diff --git a/preferences/inc/class.bosettings.inc.php b/preferences/inc/class.bosettings.inc.php index 701dec08c6..877ba2c820 100644 --- a/preferences/inc/class.bosettings.inc.php +++ b/preferences/inc/class.bosettings.inc.php @@ -43,30 +43,23 @@ $this->xmlrpc = @is_object($GLOBALS['server']) && $GLOBALS['server']->last_method; $this->session_data = $GLOBALS['egw']->session->appsession('session_data','preferences'); - if($appname) - { - $this->call_hook($appname); - } + $this->appname = $appname; } - function save_session($appname,$type,$show_help,$prefix) + function save_session($appname,$type,$show_help,$prefix,$notifies='') { $GLOBALS['egw']->session->appsession('session_data','preferences',array( 'type' => $type, // save our state in the app-session 'show_help' => $show_help, 'prefix' => $prefix, - 'appname' => $appname // we use this to reset prefix on appname-change + 'appname' => $appname, // we use this to reset prefix on appname-change + 'notifies' => $notifies, )); } function call_hook($appname) { $this->appname = $appname; - if(!$GLOBALS['egw']->hooks->single('settings',$this->appname)) - { - return False; - } - $this->settings = array_merge($this->settings,$GLOBALS['settings']); $GLOBALS['egw']->translation->add_app($this->appname); if($this->appname != 'preferences') @@ -74,6 +67,12 @@ $GLOBALS['egw']->translation->add_app('preferences'); // we need the prefs translations too } + if(!$GLOBALS['egw']->hooks->single('settings',$this->appname)) + { + return False; + } + $this->settings = array_merge($this->settings,$GLOBALS['settings']); + /* Remove ui-only settings */ if($this->xmlrpc) { @@ -165,11 +164,11 @@ continue; // dont write empty password-fields } } - $prefs[$var] = stripslashes($value); + $prefs[$var] = get_magic_quotes_gpc() ? stripslashes($value) : $value; - if($notifies[$var]) // need to translate the key-words back + if($this->session_data['notifies'][$var]) // need to translate the key-words back { - $prefs[$var] = $GLOBALS['egw']->preferences->lang_notify($prefs[$var],$notifies[$var],True); + $prefs[$var] = $GLOBALS['egw']->preferences->lang_notify($prefs[$var],$this->session_data['notifies'][$var],True); } } else diff --git a/preferences/inc/class.uisettings.inc.php b/preferences/inc/class.uisettings.inc.php index 7626c28f66..a97eeb182a 100755 --- a/preferences/inc/class.uisettings.inc.php +++ b/preferences/inc/class.uisettings.inc.php @@ -22,7 +22,7 @@ function uisettings() { - $this->bo =& CreateObject('preferences.bosettings'); + $this->bo =& CreateObject('preferences.bosettings',$_GET['appname']); if($GLOBALS['egw']->acl->check('run',1,'admin')) { @@ -149,7 +149,7 @@ { if($valarray['admin']) { - next; + continue; } } switch($valarray['type']) @@ -230,13 +230,7 @@ // TODO - what is the purpose of this? if(count($notifies)) // there have been notifies in the hook, we need to save in the session { - $this->bo->save_session( - $GLOBALS['type'], // save our state in the app-session - $this->show_help, - $this->prefix, - $_GET['appname'], // we use this to reset prefix on appname-change - $notifies - ); + $this->bo->save_session($_GET['appname'],$GLOBALS['type'],$this->show_help,$this->prefix,$notifies); //_debug_array($notifies); } if($this->is_admin()) @@ -404,7 +398,7 @@ $s .= '