From: stekkel Date: Sun, 6 Oct 2002 19:28:38 +0000 (+0000) Subject: sqsession_destroy X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6914653766df6184bb558b8409981851d4910c84;p=squirrelmail.git sqsession_destroy git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3778 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_general.php b/functions/imap_general.php index c58f0907..9b8b9d6e 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -235,8 +235,8 @@ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $ set_up_language($squirrelmail_language, true); include_once(SM_PATH . 'functions/display_messages.php' ); + sqsession_destroy(); logout_error( _("Unknown user or password incorrect.") ); - session_destroy(); exit; } } else { @@ -420,6 +420,15 @@ function sqimap_append ($imap_stream, $sent_folder, $length) { function sqimap_append_done ($imap_stream) { fputs ($imap_stream, "\r\n"); $tmp = fgets ($imap_stream, 1024); + if (preg_match("/(.*)(BAD|NO)(.*)$/", $tmp, $regs)) { + set_up_language($squirrelmail_language); + echo "
\n" . + _("ERROR : Bad or malformed request.") . + "
\n" . + _("Server responded: ") . + $message . "

\n"; + exit; + } } function sqimap_get_user_server ($imap_server, $username) { diff --git a/src/login.php b/src/login.php index 6da41967..89d83930 100644 --- a/src/login.php +++ b/src/login.php @@ -38,17 +38,14 @@ if (!function_exists('sqm_baseuri')){ require_once(SM_PATH . 'functions/display_messages.php'); } $base_uri = sqm_baseuri(); -@session_destroy(); /* * In case the last session was not terminated properly, make sure * we get a new one. */ -$cookie_params = session_get_cookie_params(); -setcookie(session_name(), '', 0, $cookie_params['path'], - $cookie_params['domain']); -setcookie('username', '', 0, $base_uri); -setcookie('key', '', 0, $base_uri); + +sqsession_destroy(); + header('Pragma: no-cache'); do_hook('login_cookie'); diff --git a/src/signout.php b/src/signout.php index ce7eda8e..10905310 100644 --- a/src/signout.php +++ b/src/signout.php @@ -47,11 +47,8 @@ if (!isset($_SESSION['base_uri'])) { } else { $base_uri = $_SESSION['base_uri']; } - +sqsession_destroy(); do_hook('logout'); -setcookie('username', '', 0, $base_uri); -setcookie('key', '', 0, $base_uri); -session_destroy(); if ($signout_page) { header('Status: 303 See Other');