瀏覽代碼

Some fixup.

philippe_mingo 23 年之前
父節點
當前提交
bc6ece97aa
共有 3 個文件被更改,包括 12 次插入8 次删除
  1. 2 0
      functions/constants.php
  2. 9 8
      functions/prefs.php
  3. 1 0
      src/redirect.php

+ 2 - 0
functions/constants.php

@@ -17,6 +17,8 @@
     /* Set values for constants used by Squirrelmail preferences. */
     /**************************************************************/
 
+    require_once( '../functions/plugin.php' );      // Required for the hook
+
     /* Define basic, general purpose preference constants. */
     define('SMPREF_NO', 0);
     define('SMPREF_OFF', 0);

+ 9 - 8
functions/prefs.php

@@ -89,26 +89,26 @@
 
    function removePref($data_dir, $username, $string) {
       global $prefs_cache;
-      
+
       cachePrefValues($data_dir, $username);
-      
+
       if (isset($prefs_cache[$string])) {
           unset($prefs_cache[$string]);
       }
-          
+
       savePrefValues($data_dir, $username);
    }
-   
+
    /** sets the pref, $string, to $set_to **/
    function setPref($data_dir, $username, $string, $set_to) {
       global $prefs_cache;
-      
+
       cachePrefValues($data_dir, $username);
       if (isset($prefs_cache[$string]) && $prefs_cache[$string] == $set_to)
          return;
       if ($set_to === '') {
          removePref($data_dir, $username, $string);
-	 return;
+         return;
       }
       $prefs_cache[$string] = $set_to;
       savePrefValues($data_dir, $username);
@@ -119,7 +119,7 @@
        create it. **/
    function checkForPrefs($data_dir, $username) {
       $filename = $data_dir . $username . '.pref';
-      if (!file_exists($filename)) {
+      if (!file_exists($filename) ) {
          if (!copy($data_dir . 'default_pref', $filename)) {
             echo _("Error opening ") . $filename;
             exit;
@@ -150,4 +150,5 @@
       }
       return $sig;
    }
-?>
+
+?>

+ 1 - 0
src/redirect.php

@@ -104,6 +104,7 @@
         session_register ('username');
         setcookie('key', $key, 0, $base_uri);
         do_hook ('login_verified');
+
         setPref( $data_dir, $username, 'counter',
             getPref( $data_dir, $username, 'counter', 0 ) + 1 );
     }