|
@@ -293,7 +293,47 @@ if (isset($plugins) && is_array($plugins)) {
|
|
do_hook('loading_constants');
|
|
do_hook('loading_constants');
|
|
|
|
|
|
switch ($sInitLocation) {
|
|
switch ($sInitLocation) {
|
|
- case 'style': session_write_close(); sqsetcookieflush(); break;
|
|
|
|
|
|
+ case 'style':
|
|
|
|
+ // what does getting a stylesheet have to do with flushing cookies et al.?
|
|
|
|
+ session_write_close();
|
|
|
|
+ sqsetcookieflush();
|
|
|
|
+
|
|
|
|
+ // need to set up prefs for stylesheets, too, in order to
|
|
|
|
+ // know which template is being used, which often carries
|
|
|
|
+ // its own stylesheet...
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Setting the prefs backend
|
|
|
|
+ */
|
|
|
|
+ sqgetGlobalVar('prefs_cache', $prefs_cache, SQ_SESSION );
|
|
|
|
+ sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION );
|
|
|
|
+
|
|
|
|
+ if ( !sqsession_is_registered('prefs_are_cached') ||
|
|
|
|
+ !isset( $prefs_cache) ||
|
|
|
|
+ !is_array( $prefs_cache)) {
|
|
|
|
+ $prefs_are_cached = false;
|
|
|
|
+ $prefs_cache = false; //array();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* see 'redirect' case */
|
|
|
|
+ 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/file_prefs.php');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * initializing user settings
|
|
|
|
+ */
|
|
|
|
+ require(SM_PATH . 'include/load_prefs.php');
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+
|
|
case 'redirect':
|
|
case 'redirect':
|
|
/**
|
|
/**
|
|
* directory hashing functions are needed for all setups in case
|
|
* directory hashing functions are needed for all setups in case
|
|
@@ -397,7 +437,7 @@ switch ($sInitLocation) {
|
|
$prefs_cache = false; //array();
|
|
$prefs_cache = false; //array();
|
|
}
|
|
}
|
|
|
|
|
|
- /* see 'redirect' switch */
|
|
|
|
|
|
+ /* see 'redirect' case */
|
|
require(SM_PATH . 'functions/prefs.php');
|
|
require(SM_PATH . 'functions/prefs.php');
|
|
|
|
|
|
$prefs_backend = do_hook_function('prefs_backend');
|
|
$prefs_backend = do_hook_function('prefs_backend');
|
|
@@ -500,7 +540,7 @@ require(SM_PATH . 'class/template/template.class.php');
|
|
|
|
|
|
/*
|
|
/*
|
|
* $sTplDir is not initialized when a user is not logged in, so we will use
|
|
* $sTplDir is not initialized when a user is not logged in, so we will use
|
|
- * the config file defaults here. If the neccesary variables are net set,
|
|
|
|
|
|
+ * the config file defaults here. If the neccesary variables are not set,
|
|
* force a default value.
|
|
* force a default value.
|
|
*
|
|
*
|
|
* If the user is logged in, $sTplDir will be set in load_prefs.php, so we
|
|
* If the user is logged in, $sTplDir will be set in load_prefs.php, so we
|