瀏覽代碼

Added session variable $is_logged_in.

gustavf 25 年之前
父節點
當前提交
def46d09db
共有 1 個文件被更改,包括 12 次插入3 次删除
  1. 12 3
      src/webmail.php

+ 12 - 3
src/webmail.php

@@ -25,10 +25,19 @@
    include ("../config/config.php");
    include ("../functions/prefs.php");
    include ("../functions/imap.php");
+   if (!isset($plugin_php))
+      include ("../functions/plugin.php");
+
+   if ($is_logged_in != true) {
+      do_hook ("login_before");
+      // verify that username and password are correct
+      $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+      do_hook ("login_verified");
+   }
+
+   session_register ("is_logged_in");
+   $is_logged_in = true;
 
-   // verify that username and password are correct
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
-   
    include ("../src/load_prefs.php");
 
    echo "<html><head\n";