phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/inc class.preferences.inc.php, 1.43.2.2.2.12


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] phpgwapi/inc class.preferences.inc.php, 1.43.2.2.2.12, 1.43.2.2.2.13
Date: Fri, 17 Oct 2003 02:55:37 +0000

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

Modified Files:
      Tag: Version-0_9_16-branch
        class.preferences.inc.php 
Log Message:
fix for losing prefs


Index: class.preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.preferences.inc.php,v
retrieving revision 1.43.2.2.2.12
retrieving revision 1.43.2.2.2.13
diff -C2 -d -r1.43.2.2.2.12 -r1.43.2.2.2.13
*** class.preferences.inc.php   24 Sep 2003 04:05:19 -0000      1.43.2.2.2.12
--- class.preferences.inc.php   17 Oct 2003 02:55:34 -0000      1.43.2.2.2.13
***************
*** 629,696 ****
                        }
                        /* This takes care of new users who dont have proper 
default prefs setup */
!                       if 
(!isset($GLOBALS['phpgw_info']['flags']['nocommon_preferences']) || 
!                               
!$GLOBALS['phpgw_info']['flags']['nocommon_preferences'])
                        {
!                               if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) 
|| 
!                                       
!$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'])
!                               {
!                                       $this->add('common','maxmatchs',15);
!                                       $preferences_update = True;
!                               }
!                               if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['theme']) || 
!                                       
!$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'])
!                               {
!                                       $this->add('common','theme','default');
!                                       $preferences_update = True;
!                               }
!                               if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
 || 
!                                       
!$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
!                               {
!                                       
$this->add('common','template_set','verdilak');
!                                       $preferences_update = True;
!                               }
!                               if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']) 
|| 
!                                       
!$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
!                               {
!                                       
$this->add('common','dateformat','d-M-Y');
!                                       $preferences_update = True;
!                               }
!                               if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat']) 
|| 
!                                       
!$GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'])
!                               {
!                                       $this->add('common','timeformat',12);
!                                       $preferences_update = True;
!                               }
!                               if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) || 
!                                       
!$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])
!                               {
!                                       
$this->add('common','lang',$GLOBALS['phpgw']->common->getPreferredLanguage());
!                                       $preferences_update = True;
!                               }
!                               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_prefs 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_repository();
!                               }
!                               unset($preferences_update);
                        }
                }
--- 629,673 ----
                        }
                        /* This takes care of new users who dont have proper 
default prefs setup */
!                       if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) 
|| 
!                               
!$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'])
                        {
!                               $this->add('common','maxmatchs',15);
!                               $preferences_update = True;
!                       }
!                       if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['theme']) || 
!                               
!$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'])
!                       {
!                               $this->add('common','theme','default');
!                               $preferences_update = True;
!                       }
!                       if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
 || 
!                               
!$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
!                       {
!                               $this->add('common','template_set','verdilak');
!                               $preferences_update = True;
!                       }
!                       if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']) 
|| 
!                               
!$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
!                       {
!                               $this->add('common','dateformat','d-M-Y');
!                               $preferences_update = True;
!                       }
!                       if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat']) 
|| 
!                               
!$GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'])
!                       {
!                               $this->add('common','timeformat',12);
!                               $preferences_update = True;
!                       }
!                       if 
(!isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) || 
!                               
!$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])
!                       {
!                               
$this->add('common','lang',$GLOBALS['phpgw']->common->getPreferredLanguage());
!                               $preferences_update = True;
!                       }
!                       if ($preferences_update)
!                       {
!                               $this->update_data($user_prefs);
!                               $this->save_repository();
!                               $GLOBALS['phpgw_info']['preferences'] = 
$this->read_repository();
                        }
                }





reply via email to

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