From d6b7fc3c354473a69fae00ca71532703217d675e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 27 Sep 2006 07:10:43 +0000 Subject: [PATCH] phpgw_setcookie --> egw_setcookie and removing old code - I have no idea what is was supposed to do --- login.php | 42 ++++++++++++++---------------------------- logout.php | 28 +++++----------------------- 2 files changed, 19 insertions(+), 51 deletions(-) diff --git a/login.php b/login.php index 4c5e0335ce..0bc68a9679 100755 --- a/login.php +++ b/login.php @@ -69,15 +69,15 @@ /* if($GLOBALS['egw_info']['server']['usecookies'] == True) { - $GLOBALS['egw']->session->phpgw_setcookie('eGroupWareLoginTime', time()); + $GLOBALS['egw']->session->egw_setcookie('eGroupWareLoginTime', time()); } */ /* if($_GET['cd'] != 10 && $GLOBALS['egw_info']['server']['usecookies'] == False) { - $GLOBALS['egw']->session->setcookie('sessionid'); - $GLOBALS['egw']->session->setcookie('kp3'); - $GLOBALS['egw']->session->setcookie('domain'); + $GLOBALS['egw']->session->egw_setcookie('sessionid'); + $GLOBALS['egw']->session->egw_setcookie('kp3'); + $GLOBALS['egw']->session->egw_setcookie('domain'); } */ @@ -97,35 +97,21 @@ { case 1: return lang('You have been successfully logged out'); - break; case 2: return lang('Sorry, your login has expired'); - break; case 4: return lang('Cookies are required to login to this site.'); - break; case 5: - return '' . lang('Bad login or password') . ''; - break; + return '' . lang('Bad login or password') . ''; case 98: - return '' . lang('Account is expired') . ''; - break; + return '' . lang('Account is expired') . ''; case 99: - return '' . lang('Blocked, too many attempts') . ''; - break; + return '' . lang('Blocked, too many attempts') . ''; case 10: - $GLOBALS['egw']->session->phpgw_setcookie('sessionid'); - $GLOBALS['egw']->session->phpgw_setcookie('kp3'); - $GLOBALS['egw']->session->phpgw_setcookie('domain'); - - //fix for bug php4 expired sessions bug - if(substr($GLOBALS['egw_info']['server']['sessions_type'],0,4) == 'php4') - { - $GLOBALS['egw']->session->phpgw_setcookie(EGW_PHPSESSID); - } - - return '' . lang('Your session could not be verified.') . ''; - break; + $GLOBALS['egw']->session->egw_setcookie('sessionid'); + $GLOBALS['egw']->session->egw_setcookie('kp3'); + $GLOBALS['egw']->session->egw_setcookie('domain'); + return '' . lang('Your session could not be verified.') . ''; default: return ' '; } @@ -205,7 +191,7 @@ if(getenv('REQUEST_METHOD') != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' && !isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['SSL_CLIENT_S_DN'])) { - $GLOBALS['egw']->session->phpgw_setcookie('eGW_remember'); + $GLOBALS['egw']->session->egw_setcookie('eGW_remember'); $GLOBALS['egw']->redirect($GLOBALS['egw']->link('/login.php','cd=5')); } #if(!isset($_COOKIE['eGroupWareLoginTime'])) @@ -247,7 +233,7 @@ if(!isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid']) { - $GLOBALS['egw']->session->phpgw_setcookie('eGW_remember'); + $GLOBALS['egw']->session->egw_setcookie('eGW_remember'); $GLOBALS['egw']->redirect($GLOBALS['egw_info']['server']['webserver_url'] . '/login.php?cd=' . $GLOBALS['egw']->session->cd_reason); } else @@ -274,7 +260,7 @@ $remember_time = 2147483647; break; } - $GLOBALS['egw']->session->phpgw_setcookie('eGW_remember',serialize(array( + $GLOBALS['egw']->session->egw_setcookie('eGW_remember',serialize(array( 'login' => $login, 'passwd' => $passwd, 'passwd_type' => $passwd_type)), diff --git a/logout.php b/logout.php index c76eec59ff..681ac3fe9a 100755 --- a/logout.php +++ b/logout.php @@ -33,19 +33,6 @@ if ($verified) { - if (file_exists($GLOBALS['egw_info']['server']['temp_dir'] . SEP . $GLOBALS['sessionid'])) - { - $dh = opendir($GLOBALS['egw_info']['server']['temp_dir'] . SEP . $GLOBALS['sessionid']); - while ($file = readdir($dh)) - { - if ($file != '.' && $file != '..') - { - unlink($GLOBALS['egw_info']['server']['temp_dir'] . SEP . $GLOBALS['sessionid'] . SEP . $file); - } - } - closedir($dh); - rmdir($GLOBALS['egw_info']['server']['temp_dir'] . SEP . $GLOBALS['sessionid']); - } $GLOBALS['egw']->hooks->process('logout'); $GLOBALS['egw']->session->destroy($GLOBALS['sessionid'],$GLOBALS['kp3']); } @@ -60,14 +47,9 @@ )); } } - $GLOBALS['egw']->session->phpgw_setcookie('eGW_remember'); - $GLOBALS['egw']->session->phpgw_setcookie('sessionid'); - $GLOBALS['egw']->session->phpgw_setcookie('kp3'); - $GLOBALS['egw']->session->phpgw_setcookie('domain'); - if(substr($GLOBALS['egw_info']['server']['sessions_type'],0,4) == 'php4') - { - $GLOBALS['egw']->session->phpgw_setcookie(EGW_PHPSESSID); - } - + $GLOBALS['egw']->session->egw_setcookie('eGW_remember'); + $GLOBALS['egw']->session->egw_setcookie('sessionid'); + $GLOBALS['egw']->session->egw_setcookie('kp3'); + $GLOBALS['egw']->session->egw_setcookie('domain'); + $GLOBALS['egw']->redirect($redirectTarget); -?>