/* 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);
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);
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;
}
return $sig;
}
-?>
+
+?>
\ No newline at end of file
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 );
}