foreach ($conf_ob->hooks[$scope_ob->scope] as $name) {
try {
- $scope_ob->set($name, Horde::callHook('prefs_init', array($name, $this->_params['user']), $scope_ob->scope));
+ $value = Horde::callHook('prefs_init', array($name, $this->_params['user']), $scope_ob->scope);
+ if (!is_null($value)) {
+ $scope_ob->set($name, $value);
+ }
} catch (Horde_Exception_HookNotSet $e) {}
}
* =================
* Two types of preferences hooks are available.
*
- * On change
- * ---------
- * A hook named prefs_change will be called after a preference is altered.
- * It is passed the preference name that has changed and does not expect a
- * return value.
- *
- * Setting value
- * -------------
+ * Setting value at login
+ * ----------------------
* If the 'hook' parameter is non-empty for a preference (config/prefs.php),
* the prefs_init hook will be run on login to allow alteration of the value.
* This hook receives the preference name and the username as parameters and
- * uses the return value from the hook as the new preference value.
+ * uses the return value from the hook as the new preference value. If null
+ * is returned, the original preference value is used.
*
* This hook is ONLY executed on login and preferences are cached during a
* users' session.
*
+ * On change
+ * ---------
+ * A hook named prefs_change will be called after a preference is altered.
+ * It is passed the preference name that has changed and does not expect a
+ * return value.
+ *
* Authentication/Login Hooks
* ==========================
* There are three special hooks called during the initial authentication
//
// case 'turba':
// return 'orange';
-//
-// default:
-// return '';
// }
-// break;
+//
+// return '';
// }
// }