load hashing functions in all setups
[squirrelmail.git] / include / init.php
index 85b7b94d7d915a20e8efc48e011d675b59316015..7ed4687cb48446b9c3685bff1c20b232a7a931c8 100644 (file)
@@ -221,13 +221,18 @@ if (isset($plugins) && is_array($plugins)) {
 switch ($sInitLocation) {
     case 'style': session_write_close(); sqsetcookieflush(); break;
     case 'redirect':
+        /**
+         * directory hashing functions are needed for all setups in case 
+         * plugins use own pref files.
+         */
+        require(SM_PATH . 'functions/prefs.php');
+        /* hook loads custom prefs backend plugins */
         $prefs_backend = do_hook_function('prefs_backend');
         if (isset($prefs_backend) && !empty($prefs_backend) && file_exists(SM_PATH . $prefs_backend)) {
             require(SM_PATH . $prefs_backend);
         } elseif (isset($prefs_dsn) && !empty($prefs_dsn)) {
             require(SM_PATH . 'functions/db_prefs.php');
         } else {
-            require(SM_PATH . 'functions/prefs.php');
             require(SM_PATH . 'functions/file_prefs.php');
         }
         //nobreak;
@@ -301,13 +306,15 @@ switch ($sInitLocation) {
             $prefs_cache = false; //array();
         }
 
+        /* see 'redirect' switch */
+        require(SM_PATH . 'functions/prefs.php');
+
         $prefs_backend = do_hook_function('prefs_backend');
         if (isset($prefs_backend) && !empty($prefs_backend) && file_exists(SM_PATH . $prefs_backend)) {
             require(SM_PATH . $prefs_backend);
         } elseif (isset($prefs_dsn) && !empty($prefs_dsn)) {
             require(SM_PATH . 'functions/db_prefs.php');
         } else {
-            require(SM_PATH . 'functions/prefs.php');
             require(SM_PATH . 'functions/file_prefs.php');
         }