Switch to egw_info, etc, and remove reset/while

This commit is contained in:
Miles Lott 2005-08-23 17:53:41 +00:00
parent 9438655ca5
commit b4a21c4e9e

View File

@ -81,13 +81,13 @@
function interserver($serverid='') function interserver($serverid='')
{ {
$url = eregi_replace('https*://[^/]*/','',$GLOBALS['phpgw_info']['server']['webserver_url']); $url = eregi_replace('https*://[^/]*/','',$GLOBALS['egw_info']['server']['webserver_url']);
$this->urlparts = array( $this->urlparts = array(
'xmlrpc' => $url.'/xmlrpc.php', 'xmlrpc' => $url.'/xmlrpc.php',
'soap' => $url.'/soap.php' 'soap' => $url.'/soap.php'
); );
$this->db = $GLOBALS['phpgw']->db; $this->db = clone($GLOBALS['egw']->db);
if($serverid) if($serverid)
{ {
$this->serverid = (int)$serverid; $this->serverid = (int)$serverid;
@ -169,11 +169,11 @@
} }
else else
{ {
while(list($key,$val) = @each($args)) foreach($args as $key => $val)
{ {
if(@is_array($val)) if(@is_array($val))
{ {
while(list($x,$y) = each($val)) foreach($val as $x => $y)
{ {
$tmp[$x] = CreateObject('phpgwapi.xmlrpcval',$y, 'string'); $tmp[$x] = CreateObject('phpgwapi.xmlrpcval',$y, 'string');
} }
@ -221,11 +221,11 @@
} }
else else
{ {
while(list($key,$val) = @each($args)) foreach($args as $key => $val)
{ {
if(@is_array($val)) if(@is_array($val))
{ {
while(list($x,$y) = each($val)) foreach($val as $x => $y)
{ {
$tmp[$x] = CreateObject('phpgwapi.xmlrpcval',$y, 'string'); $tmp[$x] = CreateObject('phpgwapi.xmlrpcval',$y, 'string');
} }
@ -274,11 +274,11 @@
} }
else else
{ {
while(list($key,$val) = @each($args)) foreach($args as $key => $val)
{ {
if(@is_array($val)) if(@is_array($val))
{ {
while(list($x,$y) = each($val)) foreach($val as $x => $y)
{ {
$tmp[] = CreateObject('phpgwapi.soapval',$x,'string',$y); $tmp[] = CreateObject('phpgwapi.soapval',$x,'string',$y);
} }
@ -320,11 +320,11 @@
} }
elseif(@is_array($args)) elseif(@is_array($args))
{ {
while(list($key,$val) = @each($args)) foreach($args as $key => $val)
{ {
if(@is_array($val)) if(@is_array($val))
{ {
while(list($x,$y) = each($val)) foreach($val as $x => $y)
{ {
$tmp[] = CreateObject('phpgwapi.soapval',$x,'string',$y); $tmp[] = CreateObject('phpgwapi.soapval',$x,'string',$y);
} }
@ -368,8 +368,7 @@
if(@is_array($_req)) if(@is_array($_req))
{ {
$ele = array(); $ele = array();
@reset($_req); foreach($_req as $key => $val)
while(list($key,$val) = @each($_req))
{ {
$ele[$key] = $this->build_request($val,True,$key); $ele[$key] = $this->build_request($val,True,$key);
} }
@ -543,7 +542,7 @@
$x = ''; $x = '';
$slist = $this->get_list('','','','','',$x); $slist = $this->get_list('','','','','',$x);
while (list($key,$val) = each($slist)) foreach($slist as $key => $val)
{ {
$foundservers = True; $foundservers = True;
$select .= '<option value="' . $val['server_id'] . '"'; $select .= '<option value="' . $val['server_id'] . '"';
@ -642,8 +641,8 @@
$this->db->query($sql,__LINE__,__FILE__); $this->db->query($sql,__LINE__,__FILE__);
if($this->db->next_record()) if($this->db->next_record())
{ {
if ($username == $GLOBALS['phpgw_info']['server']['site_username'] && if ($username == $GLOBALS['egw_info']['server']['site_username'] &&
$password == $GLOBALS['phpgw_info']['server']['site_password'] && $password == $GLOBALS['egw_info']['server']['site_password'] &&
$this->db->f('trust_rel') >= 1) $this->db->f('trust_rel') >= 1)
{ {
$this->authed = True; $this->authed = True;