From d42945030fff2bb8b98fd5aac0af5bd2d4bc38a3 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Mon, 19 Sep 2005 03:37:07 +0000 Subject: [PATCH] Add getallheaders() function if not natively available --- soap.php | 17 ++++++++++++++++- xmlrpc.php | 20 ++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/soap.php b/soap.php index c13c21c1ad..b2d3a23cae 100644 --- a/soap.php +++ b/soap.php @@ -32,7 +32,22 @@ exit; } - /* Note: this command only available under Apache */ + /* Note: this command only available natively in Apache (Netscape/iPlanet/SunONE in php >= 4.3.3) */ + if(!function_exists('getallheaders')) + { + function getallheaders() + { + settype($headers,'array'); + foreach($_SERVER as $h => $v) + { + if(ereg('HTTP_(.+)',$h,$hp)) + { + $headers[$hp[1]] = $v; + } + } + return $headers; + } + } $headers = getallheaders(); if(ereg('Basic',$headers['Authorization'])) diff --git a/xmlrpc.php b/xmlrpc.php index ab045f6f80..f09d1cc85c 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -30,15 +30,31 @@ /* uncomment here if you want to show all of the testing functions for compatibility */ //include(EGW_API_INC . '/xmlrpc.interop.php'); - + if (!$GLOBALS['egw_info']['server']['xmlrpc_enabled']) { $server->xmlrpc_error(9999,'xmlrpc service is not enabled in the eGroupWare system configuration'); exit; } - /* Note: this command only available under Apache */ + /* Note: this command only available natively in Apache (Netscape/iPlanet/SunONE in php >= 4.3.3) */ + if(!function_exists('getallheaders')) + { + function getallheaders() + { + settype($headers,'array'); + foreach($_SERVER as $h => $v) + { + if(ereg('HTTP_(.+)',$h,$hp)) + { + $headers[$hp[1]] = $v; + } + } + return $headers; + } + } $headers = getallheaders(); + //print_r($headers); $isodate = $headers['isoDate'] ? $headers['isoDate'] : $headers['isodate']; $isodate = ($isodate == 'simple') ? True : False;