Jelajahi Sumber

Move prefs init above plugin stuff, make life easier for plugins hooked on config_override

pdontthink 18 tahun lalu
induk
melakukan
fce1d4d3ac
1 mengubah file dengan 13 tambahan dan 13 penghapusan
  1. 13 13
      include/init.php

+ 13 - 13
include/init.php

@@ -229,6 +229,19 @@ $SQM_INTERNAL_VERSION = explode('.', SM_VERSION, 3);
 $SQM_INTERNAL_VERSION[2] = intval($SQM_INTERNAL_VERSION[2]);
 
 
+/* load prefs system; even when user not logged in, should be OK to do this here */
+require(SM_PATH . 'functions/prefs.php');
+
+$prefs_backend = do_hook('prefs_backend', $null);
+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/file_prefs.php');
+}
+
+
 /* if plugins are disabled only for one user and
  * the current user is NOT that user, turn them
  * back on
@@ -293,19 +306,6 @@ if (! sqgetGlobalVar('squirrelmail_language',$squirrelmail_language,SQ_COOKIE))
 }
 
 
-/* load prefs system; even when user not logged in, should be OK to do this here */
-require(SM_PATH . 'functions/prefs.php');
-
-$prefs_backend = do_hook('prefs_backend', $null);
-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/file_prefs.php');
-}
-
-
 /**
  * Do something special for some pages. This is based on the PAGE_NAME constand
  * set at the top of every page.