X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Ffile_prefs.php;h=028541f20b18e5ab15a2a55b3c6e895762dd0942;hb=09b143cceb5a99d0b94d8303d644ffeeef203d1f;hp=e35e4df407259ff46f76815396a4d0dd4641829c;hpb=47ccfad452e8d345542d09e59112cac317cffed8;p=squirrelmail.git
diff --git a/functions/file_prefs.php b/functions/file_prefs.php
index e35e4df4..028541f2 100644
--- a/functions/file_prefs.php
+++ b/functions/file_prefs.php
@@ -5,7 +5,7 @@
*
* This contains functions for manipulating user preferences in files
*
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright © 1999-2007 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
@@ -13,11 +13,6 @@
* @since 1.2.5
*/
-/** @ignore */
-if (! defined('SM_PATH')) define('SM_PATH','../');
-
-/** include this for error messages */
-include_once(SM_PATH . 'functions/display_messages.php');
/**
* Check the preferences into the session cache.
@@ -31,6 +26,8 @@ function cachePrefValues($data_dir, $username) {
sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION );
if ( isset($prefs_are_cached) && $prefs_are_cached) {
sqgetGlobalVar('prefs_cache', $prefs_cache, SQ_SESSION );
+// sm_print_r($prefs_cache);
+// exit;
return;
}
@@ -103,13 +100,13 @@ function cachePrefValues($data_dir, $username) {
function getPref($data_dir, $username, $string, $default = '') {
global $prefs_cache;
- $result = do_hook_function('get_pref_override',array($username,$string));
+ $result = do_hook('get_pref_override', $temp=array(&$username, &$string));
if (!$result) {
cachePrefValues($data_dir, $username);
if (isset($prefs_cache[$string])) {
$result = $prefs_cache[$string];
} else {
- $result = do_hook_function('get_pref', array($username,$string));
+ $result = do_hook('get_pref', $temp=array(&$username, &$string));
if (!$result) {
$result = $default;
}
@@ -243,9 +240,9 @@ function checkForPrefs($data_dir, $username, $filename = '') {
$uid = $user_data['name'];
}
$errTitle = _("Could not create initial preference file!");
- $errString = $errTitle . "
\n" .
- sprintf( _("%s should be writable by user %s"), $data_dir, $uid ) . "
\n" .
- _("Please contact your system administrator and report this error.") . "
\n";
+ $errString = $errTitle . "\n" .
+ sprintf( _("%s should be writable by user %s."), $data_dir, $uid ) . "\n" .
+ _("Please contact your system administrator and report this error.") ;
logout_error( $errString, $errTitle );
exit;
}
@@ -312,4 +309,3 @@ function getSig($data_dir, $username, $number) {
}
// vim: et ts=4
-?>
\ No newline at end of file