From 11699a554688e1215bae9c550a5a67c15cdb8f36 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Wed, 6 Oct 2004 22:48:48 +0000 Subject: - 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 --- identification.php | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'identification.php') diff --git a/identification.php b/identification.php index 602af430c..336879fe4 100644 --- a/identification.php +++ b/identification.php @@ -42,29 +42,15 @@ SELECT id, password $row = mysql_fetch_array(mysql_query($query)); if ($row['password'] == md5($_POST['password'])) { - if ($conf['auth_method'] == 'cookie' - or isset($_POST['remember_me']) and $_POST['remember_me'] == 1) + $session_length = $conf['session_length']; + if ($conf['authorize_remembering'] + and isset($_POST['remember_me']) + and $_POST['remember_me'] == 1) { - if ($conf['auth_method'] == 'cookie') - { - $cookie_length = $conf['session_length']; - } - else if ($_POST['remember_me'] == 1) - { - $cookie_length = $conf['remember_me_length']; - } - session_create($row['id'], - 'cookie', - $cookie_length); - redirect('category.php'); - } - else if ($conf['auth_method'] == 'URI') - { - $session_id = session_create($row['id'], - 'URI', - $conf['session_length']); - redirect('category.php?id='.$session_id); + $session_length = $conf['remember_me_length']; } + $session_id = session_create($row['id'], $session_length); + redirect('category.php?id='.$session_id); } else { @@ -97,6 +83,11 @@ $template->assign_vars( 'F_LOGIN_ACTION' => add_session_id('identification.php') )); + +if ($conf['authorize_remembering']) +{ + $template->assign_block_vars('remember_me',array()); +} //-------------------------------------------------------------- errors display if ( sizeof( $errors ) != 0 ) { -- cgit v1.2.3