mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 23:58:54 +01:00
phpgw->egw
This commit is contained in:
parent
d6b925b16c
commit
98bb88f545
@ -6,7 +6,7 @@
|
||||
* and Mark Peters <skeeter@phpgroupware.org> *
|
||||
* Commononly used functions by phpGroupWare developers *
|
||||
* Copyright (C) 2000, 2001 Dan Kuykendall *
|
||||
* -------------------------------------------------------------------------*
|
||||
* ------------------------------------------------------------------------ *
|
||||
* This library is part of the eGroupWare API *
|
||||
* http://www.egroupware.org *
|
||||
* ------------------------------------------------------------------------ *
|
||||
@ -25,9 +25,9 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$d1 = strtolower(@substr(PHPGW_API_INC,0,3));
|
||||
$d2 = strtolower(@substr(PHPGW_SERVER_ROOT,0,3));
|
||||
$d3 = strtolower(@substr(PHPGW_APP_INC,0,3));
|
||||
$d1 = strtolower(@substr(EGW_API_INC,0,3));
|
||||
$d2 = strtolower(@substr(EGW_SERVER_ROOT,0,3));
|
||||
$d3 = strtolower(@substr(EGW_APP_INC,0,3));
|
||||
if($d1 == 'htt' || $d1 == 'ftp' || $d2 == 'htt' || $d2 == 'ftp' || $d3 == 'htt' || $d3 == 'ftp')
|
||||
{
|
||||
echo 'Failed attempt to break in via an old Security Hole!<br>'."\n";
|
||||
@ -567,17 +567,17 @@
|
||||
|
||||
function datetime()
|
||||
{
|
||||
$this->tz_offset = 3600 * (int)@$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
|
||||
$this->tz_offset = 3600 * (int)@$GLOBALS['egw_info']['user']['preferences']['common']['tz_offset'];
|
||||
print_debug('datetime::datetime::gmtnow',$this->gmtnow,'api');
|
||||
|
||||
$error_occured = True;
|
||||
// If we already have a GMT time, no need to do this again.
|
||||
if(!$this->gmtnow)
|
||||
{
|
||||
if(isset($GLOBALS['phpgw_info']['server']['tz_offset']))
|
||||
if(isset($GLOBALS['egw_info']['server']['tz_offset']))
|
||||
{
|
||||
$this->gmtnow = time() - ((int)$GLOBALS['phpgw_info']['server']['tz_offset'] * 3600);
|
||||
print_debug('datetime::datetime::tz_offset',"set via tz_offset=".$GLOBALS['phpgw_info']['server']['tz_offset'].": gmtnow=".date('Y/m/d H:i',$this->gmtnow),'api');
|
||||
$this->gmtnow = time() - ((int)$GLOBALS['egw_info']['server']['tz_offset'] * 3600);
|
||||
print_debug('datetime::datetime::tz_offset',"set via tz_offset=".$GLOBALS['egw_info']['server']['tz_offset'].": gmtnow=".date('Y/m/d H:i',$this->gmtnow),'api');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -591,16 +591,16 @@
|
||||
function getntpoffset()
|
||||
{
|
||||
$error_occured = False;
|
||||
if(!@is_object($GLOBALS['phpgw']->network))
|
||||
if(!@is_object($GLOBALS['egw']->network))
|
||||
{
|
||||
$GLOBALS['phpgw']->network = createobject('phpgwapi.network');
|
||||
$GLOBALS['egw']->network = createobject('phpgwapi.network');
|
||||
}
|
||||
$server_time = time();
|
||||
|
||||
if($GLOBALS['phpgw']->network->open_port('129.6.15.28',13,5))
|
||||
if($GLOBALS['egw']->network->open_port('129.6.15.28',13,5))
|
||||
{
|
||||
$line = $GLOBALS['phpgw']->network->bs_read_port(64);
|
||||
$GLOBALS['phpgw']->network->close_port();
|
||||
$line = $GLOBALS['egw']->network->bs_read_port(64);
|
||||
$GLOBALS['egw']->network->close_port();
|
||||
|
||||
$array = explode(' ',$line);
|
||||
// host: 129.6.15.28
|
||||
@ -638,14 +638,14 @@
|
||||
function gethttpoffset()
|
||||
{
|
||||
$error_occured = False;
|
||||
if(!@is_object($GLOBALS['phpgw']->network))
|
||||
if(!@is_object($GLOBALS['egw']->network))
|
||||
{
|
||||
$GLOBALS['phpgw']->network = createobject('phpgwapi.network');
|
||||
$GLOBALS['egw']->network = createobject('phpgwapi.network');
|
||||
}
|
||||
$server_time = time();
|
||||
|
||||
$filename = 'http://132.163.4.213/timezone.cgi?GMT';
|
||||
$file = $GLOBALS['phpgw']->network->gethttpsocketfile($filename);
|
||||
$file = $GLOBALS['egw']->network->gethttpsocketfile($filename);
|
||||
if(!$file)
|
||||
{
|
||||
return $this->getbestguess();
|
||||
@ -728,7 +728,7 @@
|
||||
function get_weekday_start($year,$month,$day)
|
||||
{
|
||||
$weekday = $this->day_of_week($year,$month,$day);
|
||||
switch($GLOBALS['phpgw_info']['user']['preferences']['calendar']['weekdaystarts'])
|
||||
switch($GLOBALS['egw_info']['user']['preferences']['calendar']['weekdaystarts'])
|
||||
{
|
||||
// Saturday is for arabic support
|
||||
case 'Saturday':
|
||||
@ -963,16 +963,16 @@
|
||||
{
|
||||
$date = Array('raw','day','month','year','full','dow','dm','bd');
|
||||
$date['raw'] = $localtime;
|
||||
$date['year'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'Y');
|
||||
$date['month'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'m');
|
||||
$date['day'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'d');
|
||||
$date['full'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'Ymd');
|
||||
$date['year'] = (int)$GLOBALS['egw']->common->show_date($date['raw'],'Y');
|
||||
$date['month'] = (int)$GLOBALS['egw']->common->show_date($date['raw'],'m');
|
||||
$date['day'] = (int)$GLOBALS['egw']->common->show_date($date['raw'],'d');
|
||||
$date['full'] = (int)$GLOBALS['egw']->common->show_date($date['raw'],'Ymd');
|
||||
$date['bd'] = mktime(0,0,0,$date['month'],$date['day'],$date['year']);
|
||||
$date['dm'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'dm');
|
||||
$date['dm'] = (int)$GLOBALS['egw']->common->show_date($date['raw'],'dm');
|
||||
$date['dow'] = $this->day_of_week($date['year'],$date['month'],$date['day']);
|
||||
$date['hour'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'H');
|
||||
$date['minute'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'i');
|
||||
$date['second'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'s');
|
||||
$date['hour'] = (int)$GLOBALS['egw']->common->show_date($date['raw'],'H');
|
||||
$date['minute'] = (int)$GLOBALS['egw']->common->show_date($date['raw'],'i');
|
||||
$date['second'] = (int)$GLOBALS['egw']->common->show_date($date['raw'],'s');
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This file written by Mark Peters <skeeter@phpgroupware.org> *
|
||||
* Handles opening network socket connections, taking proxy into account *
|
||||
* Copyright (C) 2000, 2001 Mark Peters *
|
||||
* -------------------------------------------------------------------------*
|
||||
* ------------------------------------------------------------------------ *
|
||||
* This library is part of the eGroupWare API *
|
||||
* http://www.egroupware.org/api *
|
||||
* ------------------------------------------------------------------------ *
|
||||
@ -67,11 +67,11 @@
|
||||
{
|
||||
case 80:
|
||||
case 443:
|
||||
if((isset($GLOBALS['phpgw_info']['server']['httpproxy_server']) && $GLOBALS['phpgw_info']['server']['httpproxy_server']) &&
|
||||
(isset($GLOBALS['phpgw_info']['server']['httpproxy_port']) && $GLOBALS['phpgw_info']['server']['httpproxy_port']))
|
||||
if((isset($GLOBALS['egw_info']['server']['httpproxy_server']) && $GLOBALS['egw_info']['server']['httpproxy_server']) &&
|
||||
(isset($GLOBALS['egw_info']['server']['httpproxy_port']) && $GLOBALS['egw_info']['server']['httpproxy_port']))
|
||||
{
|
||||
$server = $GLOBALS['phpgw_info']['server']['httpproxy_server'];
|
||||
$port = (int)$GLOBALS['phpgw_info']['server']['httpproxy_port'];
|
||||
$server = $GLOBALS['egw_info']['server']['httpproxy_server'];
|
||||
$port = (int)$GLOBALS['egw_info']['server']['httpproxy_port'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -198,13 +198,13 @@
|
||||
$auth = '';
|
||||
}
|
||||
|
||||
if($GLOBALS['phpgw_info']['server']['httpproxy_server'])
|
||||
if($GLOBALS['egw_info']['server']['httpproxy_server'])
|
||||
{
|
||||
$proxyAuth = '';
|
||||
if(!empty($GLOBALS['phpgw_info']['server']['httpproxy_server_username']))
|
||||
if(!empty($GLOBALS['egw_info']['server']['httpproxy_server_username']))
|
||||
{
|
||||
$proxyUsername = $GLOBALS['phpgw_info']['server']['httpproxy_server_username'];
|
||||
$proxyPassword = $GLOBALS['phpgw_info']['server']['httpproxy_server_password'];
|
||||
$proxyUsername = $GLOBALS['egw_info']['server']['httpproxy_server_username'];
|
||||
$proxyPassword = $GLOBALS['egw_info']['server']['httpproxy_server_password'];
|
||||
$proxyAuth = 'Proxy-Authorization: Basic '.base64_encode("$proxyUsername:$proxyPassword")."\n";
|
||||
}
|
||||
if($this->open_port($server,80, 15))
|
||||
|
Loading…
Reference in New Issue
Block a user