From fb120846d2c635e28cb95463dc0b4cac1c3219d3 Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Fri, 30 Nov 2001 18:39:15 +0000 Subject: [PATCH] Some fixup. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1818 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/constants.php | 2 ++ functions/prefs.php | 17 +++++++++-------- src/redirect.php | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/functions/constants.php b/functions/constants.php index e223c464..a53c3cb5 100644 --- a/functions/constants.php +++ b/functions/constants.php @@ -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); diff --git a/functions/prefs.php b/functions/prefs.php index 1d5fb68f..8b069242 100644 --- a/functions/prefs.php +++ b/functions/prefs.php @@ -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; } -?> + +?> \ No newline at end of file diff --git a/src/redirect.php b/src/redirect.php index 011b14b2..0e62b671 100644 --- a/src/redirect.php +++ b/src/redirect.php @@ -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 ); } -- 2.25.1