Some fixup.

This commit is contained in:
philippe_mingo 2001-11-30 18:39:15 +00:00
parent 7808719aee
commit bc6ece97aa
3 changed files with 12 additions and 8 deletions

View file

@ -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);

View file

@ -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;
}
?>
?>

View file

@ -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 );
}