The attached patch implements the get_pref_override and get_pref hooks in functions/db_prefs.php. This allows the administrator to set local defaults through a plugin instead of modifications to the core.
Here's a quick and dirty example of a "default_prefs" plugin:
<?php
function squirrelmail_plugin_init_default_prefs() {
global $squirrelmail_plugin_hooks;
$squirrelmail_plugin_hooks['get_pref']['default_prefs'] = 'plugin_default_prefs_do';
}
function plugin_default_prefs_do($args) {
$username = $args[0];
$string = $args[1];
if($strings == 'timezone') {
return ('US/Pacific');
}
}
?>
patch against functions/db_prefs.php
Logged In: YES
user_id=1695701
Originator: YES
Correction to the example plugin, s/strings/string/
Logged In: YES
user_id=225877
Originator: NO
See loading_prefs hook and forced_prefs plugin.