phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc class.preferences.inc.php, 1.43.2.2


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.preferences.inc.php, 1.43.2.2.2.8, 1.43.2.2.2.9
Date: Fri, 19 Sep 2003 05:18:44 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv16832

Modified Files:
      Tag: Version-0_9_16-branch
        class.preferences.inc.php 
Log Message:
Fix for bug #5312+5328

Index: class.preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.preferences.inc.php,v
retrieving revision 1.43.2.2.2.8
retrieving revision 1.43.2.2.2.9
diff -C2 -r1.43.2.2.2.8 -r1.43.2.2.2.9
*** class.preferences.inc.php   20 May 2003 04:30:02 -0000      1.43.2.2.2.8
--- class.preferences.inc.php   19 Sep 2003 09:18:40 -0000      1.43.2.2.2.9
***************
*** 615,621 ****
                function verify_basic_settings()
                {
!                       if 
(gettype($GLOBALS['phpgw_info']['user']['preferences']) != 'array')
                        {
!                                $GLOBALS['phpgw_info']['user']['preferences'] 
= array();
                        }
                        /* This takes care of new users who dont have proper 
default prefs setup */
--- 615,623 ----
                function verify_basic_settings()
                {
!                       $preferences_update = False;
!                       if 
(!is_array($GLOBALS['phpgw_info']['user']['preferences']))
                        {
!                                $GLOBALS['phpgw_info']['user']['preferences'] 
= read_repository();
!                                $preferences_update = True;
                        }
                        /* This takes care of new users who dont have proper 
default prefs setup */
***************
*** 623,627 ****
                                
!$GLOBALS['phpgw_info']['flags']['nocommon_preferences'])
                        {
-                               $preferences_update = False;
                                if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) 
|| 
                                        
!$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'])
--- 625,628 ----
***************
*** 639,643 ****
                                        
!$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
                                {
!                                       
$this->add('common','template_set','default');
                                        $preferences_update = True;
                                }
--- 640,644 ----
                                        
!$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
                                {
!                                       
$this->add('common','template_set','verdilak');
                                        $preferences_update = True;
                                }
***************
*** 645,649 ****
                                        
!$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
                                {
!                                       
$this->add('common','dateformat','m/d/Y');
                                        $preferences_update = True;
                                }
--- 646,650 ----
                                        
!$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
                                {
!                                       
$this->add('common','dateformat','d-M-Y');
                                        $preferences_update = True;
                                }
***************
*** 662,666 ****
--- 663,687 ----
                                if ($preferences_update)
                                {
+                                       $user_id = $this->account_id;
+                                       $user_prefs = 
$GLOBALS['phpgw_info']['preferences'];
+                                       $this->account_id = -1;
+                                       $df_prefs = $this->read_repository();
+                                       if(is_array($df_prefs))
+                                       {
+                                               foreach($df_pref as $app_name 
=> $app_prefs)
+                                               {
+                                                       if(is_array($app_prefs))
+                                                       {
+                                                               
foreach($app_prefs as $pref => $ignore)
+                                                               {
+                                                                       
unset($user_prefs[$app_name][$pref]);
+                                                               }
+                                                       }
+                                               }
+                                       }
+                                       $this->account_id = $user_id;
+                                       $this->update_data($user_prefs);
                                        $this->save_repository();
+                                       $GLOBALS['phpgw_info']['preferences'] = 
$this->read_respository();
                                }
                                unset($preferences_update);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]