phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/inc class.datetime.inc.php,1.5.2.6,1.5.


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.datetime.inc.php,1.5.2.6,1.5.2.7
Date: Mon, 12 Aug 2002 18:50:32 -0400

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

Modified Files:
      Tag: Version-0_9_14-branch
        class.datetime.inc.php 
Log Message:
Minor touch-ups to the previous commit.

Index: class.datetime.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.datetime.inc.php,v
retrieving revision 1.5.2.6
retrieving revision 1.5.2.7
diff -C2 -r1.5.2.6 -r1.5.2.7
*** class.datetime.inc.php      12 Aug 2002 10:28:20 -0000      1.5.2.6
--- class.datetime.inc.php      12 Aug 2002 22:50:30 -0000      1.5.2.7
***************
*** 68,164 ****
                                }
                        }
- 
-                       $this->users_localtime = $this->gmtnow + 
$this->tz_offset;
- 
- /*
-                       if(!$this->gmtnow && 
address@hidden($GLOBALS['phpgw_info']['server']['tz_offset']))
-                       {
-                               print_debug('datetime::datetime::debug: Inside 
network time');
-                               $error_occured = False;
-                               if(address@hidden($GLOBALS['phpgw']->network))
-                               {
-                                       $GLOBALS['phpgw']->network = 
createobject('phpgwapi.network');
-                               }
-                               $server_time = time();
-                               
if($GLOBALS['phpgw']->network->open_port('129.6.15.28',13,15))
-                               {
-                                       $line = 
$GLOBALS['phpgw']->network->bs_read_port(64);
-                                       // host: 130.88.202.49
-                                       // Value returned is "Wed Jun 26 
00:32:26 2002"
-                                       
$GLOBALS['phpgw']->network->close_port();
-                               
-                                       $array = explode(' ',$line);
- 
- //                                    if (sizeof($array) <> 5)
- //                                    {
- //                                            $error_occured = True;
- //                                    }
- //                                    else
- //                                    {
-                                       // Convert to this format "15 Jul 2000 
20:50:22"
- //                                            $temp_date = $array[2].' 
'.$array[1].' '.$array[4].' '.$array[3].' GMT';
- //                                            $this->gmtnow = 
$this->convert_rfc_to_epoch($temp_date);
- //                                    }
-                                       
-                                       // host: 129.6.15.28
-                                       // Value returned is 52384 02-04-20 
13:55:29 50 0 0   9.2 UTC(NIST) *
-                                       print_debug('Server datetime',time());
-                                       print_debug('Temporary NTP 
datetime',$line);
-                                       if ($array[5] == 4)
-                                       {
-                                               $error_occured = True;
-                                       }
-                                       else
-                                       {
-                                               $date = explode('-',$array[1]);
-                                               $time = explode(':',$array[2]);
-                                               $this->gmtnow = 
mktime(intval($time[0]),intval($time[1]),intval($time[2]),intval($date[1]),intval($date[2]),intval($date[0])
 + 2000);
-                                               print_debug('Temporary RFC 
epoch',$this->gmtnow);
-                                               print_debug('GMT',date('Ymd 
H:i:s',$this->gmtnow));
-                                       }
-                               }
-                       }
-                       
elseif(isset($GLOBALS['phpgw_info']['server']['tz_offset']))
-                       {
-                               print_debug('datetime::datetime::debug: Inside 
server already set');
-                               $error_occured = False;
-                               $this->gmtnow = time() - 
(intval($GLOBALS['phpgw_info']['server']['tz_offset']) * 3600);
-                       }
-                       else
-                       {
-                               $error_occured = True;
-                       }
- 
-                       if($error_occured)
-                       {
-                               print_debug('datetime::datetime::debug: Inside 
getting from local server');
-                               $server_time = time();
-                               // Calculate GMT time...
-                               // If DST, add 1 hour...
-                               //  - (date('I') == 1?3600:0)
-                               $this->gmtnow = 
$this->convert_rfc_to_epoch(gmdate('D, d M Y H:i:s',$server_time).' GMT');
-                       }
-                       
- //                    $this->gmtnow += (date('I') == 1?3600:0);
- 
-                       
if(address@hidden($GLOBALS['phpgw_info']['server']['tz_offset']))
-                       {
-                               $GLOBALS['phpgw_info']['server']['tz_offset'] = 
intval(($server_time - $this->gmtnow) / 3600);
-                               
if(@isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info']))
-                               {
-                                       $cache_query = "DELETE FROM 
phpgw_app_sessions WHERE sessionid='0' and loginid='0' and app='phpgwapi' and 
location='config'";
-                                       
$GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__);                   
        
-                                       $cache_query = 'INSERT INTO 
phpgw_app_sessions(sessionid,loginid,app,location,content) VALUES('
-                                               . 
"'0','0','phpgwapi','config','".addslashes(serialize($GLOBALS['phpgw_info']['server']))."')";
-                                       
$GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__);
-                               }
-                       }
                        $this->users_localtime = $this->gmtnow + 
$this->tz_offset;
-                       
print_debug('datetime::datetime::user::tz_offset',$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']);
-                       
print_debug('datetime::datetime::server::tz_offset',$GLOBALS['phpgw_info']['server']['tz_offset']);
-                       print_debug('datetime::datetime::gmtnow',$this->gmtnow);
-                       print_debug('datetime::datetime::GMT 
DateTime',date('Ymd H:i:s',$this->gmtnow));
-                       print_debug('datetime::datetime::Local 
DateTime',date('Ymd H:i:s',$this->users_localtime));
- */
                }
                
--- 68,72 ----
***************
*** 176,180 ****
                                $line = 
$GLOBALS['phpgw']->network->bs_read_port(64);
                                $GLOBALS['phpgw']->network->close_port();
!                       
                                $array = explode(' ',$line);
                                // host: 129.6.15.28
--- 84,88 ----
                                $line = 
$GLOBALS['phpgw']->network->bs_read_port(64);
                                $GLOBALS['phpgw']->network->close_port();
! 
                                $array = explode(' ',$line);
                                // host: 129.6.15.28
***************
*** 209,213 ****
                        }
                }
!               
                function gethttpoffset()
                {
--- 117,121 ----
                        }
                }
! 
                function gethttpoffset()
                {
***************
*** 227,231 ****
                        $time = strip_tags($file[55]);
                        $date = strip_tags($file[56]);
!                       
                        print_debug('GMT DateTime',$date.' '.$time);
                        $dt_array = explode(' ',$date);
--- 135,139 ----
                        $time = strip_tags($file[55]);
                        $date = strip_tags($file[56]);
! 
                        print_debug('GMT DateTime',$date.' '.$time);
                        $dt_array = explode(' ',$date);
***************
*** 238,242 ****
                        return intval(($server_time - $this->gmtnow) / 3600);
                }
!               
                function getbestguess()
                {
--- 146,150 ----
                        return intval(($server_time - $this->gmtnow) / 3600);
                }
! 
                function getbestguess()
                {





reply via email to

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