瀏覽代碼

Close connection cleanly when login/pw incorrect, following RFC recommendation.

Thijs Kinkhorst 21 年之前
父節點
當前提交
850e646c72
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      functions/imap_general.php

+ 3 - 1
functions/imap_general.php

@@ -721,6 +721,8 @@ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $
                 set_up_language($squirrelmail_language, true);
                 set_up_language($squirrelmail_language, true);
                 include_once(SM_PATH . 'functions/display_messages.php' );
                 include_once(SM_PATH . 'functions/display_messages.php' );
                 sqsession_destroy();
                 sqsession_destroy();
+                /* terminate the session nicely */
+                sqimap_logout($imap_stream);
                 logout_error( _("Unknown user or password incorrect.") );
                 logout_error( _("Unknown user or password incorrect.") );
                 exit;
                 exit;
             }
             }
@@ -988,4 +990,4 @@ function map_yp_alias($username) {
    return chop(substr($yp, strlen($username)+1));
    return chop(substr($yp, strlen($username)+1));
 }
 }
 
 
-?>
+?>