2001-08-10 02:31:21 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
2004-01-01 16:38:15 +01:00
|
|
|
* eGroupWare - SOAP Server *
|
|
|
|
* http://www.egroupware.org *
|
|
|
|
* Written by Miles Lott <milos@groupwhere.org> *
|
2001-08-10 02:31:21 +02:00
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2006-10-03 17:18:03 +02:00
|
|
|
$GLOBALS['egw_info'] = array(
|
|
|
|
'flags' => array(
|
|
|
|
'disable_Template_class' => True,
|
|
|
|
'currentapp' => 'login',
|
|
|
|
'noheader' => True,
|
|
|
|
'disable_Template_class' => True
|
|
|
|
)
|
2001-08-10 02:31:21 +02:00
|
|
|
);
|
|
|
|
include('./header.inc.php');
|
|
|
|
|
2001-12-10 03:09:17 +01:00
|
|
|
$GLOBALS['server'] = CreateObject('phpgwapi.soap_server');
|
|
|
|
/* _debug_array($GLOBALS['server']);exit; */
|
2005-07-08 07:00:14 +02:00
|
|
|
/* include(EGW_API_INC . '/soaplib.soapinterop.php'); */
|
2001-08-29 04:16:00 +02:00
|
|
|
|
2005-09-10 12:39:36 +02:00
|
|
|
if (!$GLOBALS['egw_info']['server']['soap_enabled'])
|
|
|
|
{
|
|
|
|
$GLOBALS['server']->make_fault(9999,'soap service is not enabled in the eGroupWare system configuration');
|
|
|
|
$GLOBALS['server']->service($GLOBALS['server']->fault());
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2005-09-19 05:37:07 +02:00
|
|
|
/* 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;
|
|
|
|
}
|
|
|
|
}
|
2001-08-29 04:16:00 +02:00
|
|
|
$headers = getallheaders();
|
|
|
|
|
|
|
|
if(ereg('Basic',$headers['Authorization']))
|
|
|
|
{
|
|
|
|
$tmp = $headers['Authorization'];
|
2004-01-01 16:38:15 +01:00
|
|
|
$tmp = str_replace(' ','',$tmp);
|
|
|
|
$tmp = str_replace('Basic','',$tmp);
|
2001-08-29 04:16:00 +02:00
|
|
|
$auth = base64_decode(trim($tmp));
|
|
|
|
list($sessionid,$kp3) = split(':',$auth);
|
2001-08-10 02:31:21 +02:00
|
|
|
|
2005-07-08 07:00:14 +02:00
|
|
|
if($GLOBALS['egw']->session->verify($sessionid,$kp3))
|
2001-08-29 04:16:00 +02:00
|
|
|
{
|
2001-12-10 03:09:17 +01:00
|
|
|
$GLOBALS['server']->authed = True;
|
2001-08-29 04:16:00 +02:00
|
|
|
}
|
2005-07-08 07:00:14 +02:00
|
|
|
elseif($GLOBALS['egw']->session->verify_server($sessionid,$kp3))
|
2001-08-29 04:16:00 +02:00
|
|
|
{
|
2001-12-10 03:09:17 +01:00
|
|
|
$GLOBALS['server']->authed = True;
|
2001-08-29 04:16:00 +02:00
|
|
|
}
|
|
|
|
}
|
2001-08-10 02:31:21 +02:00
|
|
|
|
2001-12-10 03:09:17 +01:00
|
|
|
$GLOBALS['server']->add_to_map(
|
2001-08-29 04:16:00 +02:00
|
|
|
'system_login',
|
2001-12-10 03:09:17 +01:00
|
|
|
array('soapstruct'),
|
|
|
|
array('soapstruct')
|
2001-08-29 04:16:00 +02:00
|
|
|
);
|
2001-12-10 03:09:17 +01:00
|
|
|
$GLOBALS['server']->add_to_map(
|
2001-08-29 04:16:00 +02:00
|
|
|
'system_logout',
|
2001-12-10 03:09:17 +01:00
|
|
|
array('soapstruct'),
|
|
|
|
array('soapstruct')
|
2001-08-29 04:16:00 +02:00
|
|
|
);
|
2001-12-10 03:09:17 +01:00
|
|
|
|
|
|
|
if(function_exists('system_listapps'))
|
|
|
|
{
|
|
|
|
$GLOBALS['server']->add_to_map(
|
|
|
|
'system_listApps',
|
|
|
|
array(),
|
|
|
|
array('soapstruct')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
$GLOBALS['server']->service($HTTP_RAW_POST_DATA);
|