mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 01:03:31 +02:00
- checkbox for "remember me" are only shown if authorized
- simplification : each session is created with a cookie and if PhpWebGallery can't read the cookie, it uses the URI id and it will be used in the add_session_id function. - configuration parameter "auth_method" disappeared (didn't lived much...) - only one session id size possible. More comments for configuration in include/config.inc.php git-svn-id: http://piwigo.org/svn/trunk@555 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+7
-17
@@ -39,25 +39,15 @@ $query_user = 'SELECT * FROM '.USERS_TABLE;
|
||||
$query_done = false;
|
||||
$user['is_the_guest'] = false;
|
||||
|
||||
// cookie deletion if administrator don't authorize them anymore
|
||||
if (!$conf['authorize_remembering'] and isset($_COOKIE['id']))
|
||||
{
|
||||
setcookie('id', '', 0, cookie_path());
|
||||
$url = 'category.php';
|
||||
redirect($url);
|
||||
}
|
||||
|
||||
if (isset($_GET['id']))
|
||||
{
|
||||
$session_id = $_GET['id'];
|
||||
$user['has_cookie'] = false;
|
||||
$session_id_size = $conf['session_id_size_URI'];
|
||||
}
|
||||
elseif (isset($_COOKIE['id']))
|
||||
if (isset($_COOKIE['id']))
|
||||
{
|
||||
$session_id = $_COOKIE['id'];
|
||||
$user['has_cookie'] = true;
|
||||
$session_id_size = $conf['session_id_size_cookie'];
|
||||
}
|
||||
else if (isset($_GET['id']))
|
||||
{
|
||||
$session_id = $_GET['id'];
|
||||
$user['has_cookie'] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -65,7 +55,7 @@ else
|
||||
}
|
||||
|
||||
if (isset($session_id)
|
||||
and ereg("^[0-9a-zA-Z]{".$session_id_size."}$", $session_id))
|
||||
and ereg("^[0-9a-zA-Z]{".$conf['session_id_size']."}$", $session_id))
|
||||
{
|
||||
$page['session_id'] = $session_id;
|
||||
$query = '
|
||||
|
||||
Reference in New Issue
Block a user