diff options
author | z0rglub <z0rglub@piwigo.org> | 2004-10-06 22:48:48 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2004-10-06 22:48:48 +0000 |
commit | 11699a554688e1215bae9c550a5a67c15cdb8f36 (patch) | |
tree | d1e23ac0f904d651df37ee8a349415a888f94383 /identification.php | |
parent | 944fb4856ed687de9f525d3d515d6f7b2287bb69 (diff) |
- 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
Diffstat (limited to '')
-rw-r--r-- | identification.php | 33 |
1 files changed, 12 insertions, 21 deletions
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 ) { |