Ignore:
Timestamp:
Feb 23, 2006, 6:12:32 AM (18 years ago)
Author:
rvelices
Message:

fix: permissioning not working (2 bugs)

fix: locked gallery cannot be unlocked (impossible to login)

improvement: nicer display in redirect.tpl

improvement: when a page is not accessible because of permissions (accessed
through bookmark or email), redirect to identification.php and after
identification to the initially requested page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/identification.php

    r1029 r1052  
    3232//-------------------------------------------------------------- identification
    3333$errors = array();
     34
     35$redirect_to = '';
     36if ( !empty($_GET['redirect']) )
     37{
     38  $redirect_to = $_GET['redirect'];
     39  if ( $user['is_the_guest'] )
     40  {
     41    array_push($errors, $lang['access_forbiden']);
     42  }
     43}
     44
    3445if (isset($_POST['login']))
    3546{
     47  $redirect_to = $_POST['redirect'];
    3648  $username = mysql_escape_string($_POST['username']);
    3749  // retrieving the encrypted password of the login submitted
     
    5567    session_start();
    5668    $_SESSION['id'] = $row['id'];
    57     redirect('category.php');
     69    redirect(empty($redirect_to) ? 'category.php' : $redirect_to);
    5870  }
    5971  else
     
    8698    'U_LOST_PASSWORD' => PHPWG_ROOT_PATH.'password.php',
    8799    'U_HOME' => PHPWG_ROOT_PATH.'category.php',
     100    'U_REDIRECT' => $redirect_to,
    88101   
    89102    'F_LOGIN_ACTION' => PHPWG_ROOT_PATH.'identification.php'
Note: See TracChangeset for help on using the changeset viewer.