瀏覽代碼

A fix for my fix of src/src. Now all basename-deriving code is located in
functions/display_messages.php, so only one edit is needed.

graf25 23 年之前
父節點
當前提交
32fc57c9ad
共有 4 個文件被更改,包括 16 次插入4 次删除
  1. 4 1
      src/login.php
  2. 4 1
      src/redirect.php
  3. 4 1
      src/signout.php
  4. 4 1
      src/webmail.php

+ 4 - 1
src/login.php

@@ -69,7 +69,10 @@ set_up_language($squirrelmail_language, TRUE);
 /**
 /**
  * Find out the base URI to set cookies.
  * Find out the base URI to set cookies.
  */
  */
-$base_uri = dirname(dirname($PHP_SELF)) . "/";
+if (!function_exists('sqm_baseuri')){
+    require_once('../functions/display_messages.php');
+}
+$base_uri = sqm_baseuri();
 @session_destroy();
 @session_destroy();
 
 
 /*
 /*

+ 4 - 1
src/redirect.php

@@ -36,7 +36,10 @@ if (get_magic_quotes_gpc()) {
 
 
 /* Before starting the session, the base URI must be known. Assuming */
 /* Before starting the session, the base URI must be known. Assuming */
 /* that this file is in the src/ subdirectory (or something).        */
 /* that this file is in the src/ subdirectory (or something).        */
-$base_uri = dirname(dirname($PHP_SELF)) . "/";
+if (!function_exists('sqm_baseuri')){
+    require_once('../functions/display_messages.php');
+}
+$base_uri = sqm_baseuri();
 
 
 header('Pragma: no-cache');
 header('Pragma: no-cache');
 $location = get_location();
 $location = get_location();

+ 4 - 1
src/signout.php

@@ -35,7 +35,10 @@ if (!isset($frame_top)) {
 /* If a user hits reload on the last page, $base_uri isn't set
 /* If a user hits reload on the last page, $base_uri isn't set
  * because it was deleted with the session. */
  * because it was deleted with the session. */
 if (!isset($base_uri)) {
 if (!isset($base_uri)) {
-    $base_uri = dirname(dirname($PHP_SELF)) . "/";
+    if (!function_exists('sqm_baseuri')){
+        require_once('../functions/display_messages.php');
+    }
+    $base_uri = sqm_baseuri();
 }
 }
 
 
 do_hook('logout');
 do_hook('logout');

+ 4 - 1
src/webmail.php

@@ -21,7 +21,10 @@ require_once('../functions/plugin.php');
 require_once('../functions/i18n.php');
 require_once('../functions/i18n.php');
 require_once('../functions/auth.php');
 require_once('../functions/auth.php');
 
 
-$base_uri = dirname(dirname($PHP_SELF)) . "/";
+if (!function_exists('sqm_baseuri')){
+    require_once('../functions/display_messages.php');
+}
+$base_uri = sqm_baseuri();
 
 
 session_start();
 session_start();
 is_logged_in();
 is_logged_in();