diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-02-23 05:12:32 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-02-23 05:12:32 +0000 |
commit | 347d2e34b3972ec1d0022b831dd5a1fe13adbaa5 (patch) | |
tree | 92cd6cd3e49c50337de07c175c2d9d71291a74f0 /identification.php | |
parent | 34538a62f4ac8bc6db41580058fdd040abaa3183 (diff) |
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
git-svn-id: http://piwigo.org/svn/trunk@1052 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | identification.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/identification.php b/identification.php index 3ff9d468d..5cf65b5a2 100644 --- a/identification.php +++ b/identification.php @@ -31,8 +31,20 @@ include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); //-------------------------------------------------------------- identification $errors = array(); + +$redirect_to = ''; +if ( !empty($_GET['redirect']) ) +{ + $redirect_to = $_GET['redirect']; + if ( $user['is_the_guest'] ) + { + array_push($errors, $lang['access_forbiden']); + } +} + if (isset($_POST['login'])) { + $redirect_to = $_POST['redirect']; $username = mysql_escape_string($_POST['username']); // retrieving the encrypted password of the login submitted $query = ' @@ -54,7 +66,7 @@ SELECT '.$conf['user_fields']['id'].' AS id, session_set_cookie_params($session_length); session_start(); $_SESSION['id'] = $row['id']; - redirect('category.php'); + redirect(empty($redirect_to) ? 'category.php' : $redirect_to); } else { @@ -85,6 +97,7 @@ $template->assign_vars( 'U_REGISTER' => PHPWG_ROOT_PATH.'register.php', 'U_LOST_PASSWORD' => PHPWG_ROOT_PATH.'password.php', 'U_HOME' => PHPWG_ROOT_PATH.'category.php', + 'U_REDIRECT' => $redirect_to, 'F_LOGIN_ACTION' => PHPWG_ROOT_PATH.'identification.php' )); |