From 9bebfc89c4cc8568031bc974b5607025e18a9942 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Mon, 22 Oct 2001 21:13:11 +0000 Subject: [PATCH] now uses the class var only as a default for the app part of the URL --- phpgwapi/inc/class.interserver.inc.php | 28 ++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/phpgwapi/inc/class.interserver.inc.php b/phpgwapi/inc/class.interserver.inc.php index a318350e33..e0521769e5 100644 --- a/phpgwapi/inc/class.interserver.inc.php +++ b/phpgwapi/inc/class.interserver.inc.php @@ -131,6 +131,25 @@ { preg_match('/^(.*?\/\/.*?)(\/.*)/',$url,$matches); $hostpart = $matches[1]; + $hostpart = ereg_replace('https://','',$hostpart); + $hostpart = ereg_replace('http://','',$hostpart); + switch($this->mode) + { + case 'soap': + if(!ereg('soap.php',$matches[2])) + { + $matches[2] .= $this->urlparts['soap']; + } + break; + case 'xmlrpc': + if(!ereg('xmlrpc.php',$matches[2])) + { + $matches[2] .= $this->urlparts['xmlrpc']; + } + break; + default: + break; + } $uri = $matches[2]; return array($uri,$hostpart); } @@ -138,8 +157,6 @@ function _send_xmlrpc_ssl($method_name, $args, $url, $debug=True) { list($uri,$hostpart) = $this->_split_url($url . $this->urlparts['xmlrpc']); - $hostpart = ereg_replace('https://','',$hostpart); - $hostpart = ereg_replace('http://','',$hostpart); if(gettype($args) != 'array') { $arr[] = CreateObject('phpgwapi.xmlrpcval',$args,'string'); @@ -192,8 +209,6 @@ function _send_xmlrpc_($method_name, $args, $url, $debug=True) { list($uri,$hostpart) = $this->_split_url($url . $this->urlparts['xmlrpc']); - $hostpart = ereg_replace('https://','',$hostpart); - $hostpart = ereg_replace('http://','',$hostpart); if(gettype($args) != 'array') { $arr[] = CreateObject('phpgwapi.xmlrpcval',$args,'string'); @@ -248,8 +263,6 @@ { $method_name = str_replace('.','_',$method_name); list($uri,$hostpart) = $this->_split_url($url . $this->urlparts['soap']); - $hostpart = ereg_replace('https://','',$hostpart); - $hostpart = ereg_replace('http://','',$hostpart); if(gettype($args) != 'array') { $arr[] = CreateObject('phpgwapi.soapval','','string',$args); @@ -295,8 +308,6 @@ { // $method_name = str_replace('.','_',$method_name); list($uri,$hostpart) = $this->_split_url($url . $this->urlparts['soap']); - $hostpart = ereg_replace('https://','',$hostpart); - $hostpart = ereg_replace('http://','',$hostpart); $this->build_request($args); /* if(gettype($args) != 'array') @@ -612,6 +623,7 @@ return False; } + /* TODO - Determine trust level here */ function auth($serverdata='') { if(!$serverdata || gettype($serverdata) != 'array')