2001-08-08 01:04:49 +02:00
|
|
|
<?php
|
2003-08-28 16:16:30 +02:00
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare xmlrpc server *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* This file written by Joseph Engo <jengo@phpgroupware.org> *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* 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$ */
|
|
|
|
/* $Source$ */
|
|
|
|
|
2001-12-05 17:19:12 +01:00
|
|
|
$GLOBALS['phpgw_info'] = array();
|
2001-08-23 04:54:25 +02:00
|
|
|
$GLOBALS['phpgw_info']['flags'] = array(
|
2003-08-28 16:16:30 +02:00
|
|
|
'currentapp' => 'login',
|
|
|
|
'noheader' => True,
|
2001-12-11 03:01:37 +01:00
|
|
|
'disable_Template_class' => True
|
2001-08-08 01:04:49 +02:00
|
|
|
);
|
2003-08-28 16:16:30 +02:00
|
|
|
include('header.inc.php');
|
2001-08-08 01:04:49 +02:00
|
|
|
|
2003-10-21 02:04:56 +02:00
|
|
|
$server = CreateObject('phpgwapi.xmlrpc_server');
|
|
|
|
$server->authed = False;
|
|
|
|
// debug($server);exit;
|
|
|
|
|
|
|
|
/* uncomment here if you want to show all of the testing functions for compatibility */
|
|
|
|
// include(PHPGW_API_INC . '/xmlrpc.interop.php');
|
|
|
|
|
2003-08-28 16:16:30 +02:00
|
|
|
// If XML-RPC isn't enabled in PHP, return an XML-RPC response stating so
|
2003-10-21 02:04:56 +02:00
|
|
|
if(!function_exists('xmlrpc_server_create'))
|
2003-08-28 16:16:30 +02:00
|
|
|
{
|
|
|
|
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
|
|
|
|
echo "<methodResponse>\n";
|
|
|
|
echo "<fault>\n";
|
|
|
|
echo " <value>\n";
|
|
|
|
echo " <struct>\n";
|
|
|
|
echo " <member>\n";
|
|
|
|
echo " <name>faultString</name>\n";
|
|
|
|
echo " <value>\n";
|
|
|
|
echo " <string>XML-RPC support NOT enabled in PHP installation</string>\n";
|
|
|
|
echo " </value>\n";
|
|
|
|
echo " </member>\n";
|
|
|
|
echo " <member>\n";
|
|
|
|
echo " <name>faultCode</name>\n";
|
|
|
|
echo " <value>\n";
|
|
|
|
echo " <int>1005</int>\n";
|
|
|
|
echo " </value>\n";
|
|
|
|
echo " </member>\n";
|
|
|
|
echo " </struct>\n";
|
|
|
|
echo " </value>\n";
|
|
|
|
echo "</fault>\n";
|
|
|
|
echo "</methodResponse>\n";
|
2001-08-08 01:04:49 +02:00
|
|
|
|
2003-08-28 16:16:30 +02:00
|
|
|
exit;
|
|
|
|
}
|
2001-08-08 01:04:49 +02:00
|
|
|
|
2003-10-21 02:04:56 +02:00
|
|
|
/* Note: this command only available under Apache */
|
2003-08-28 16:16:30 +02:00
|
|
|
$headers = getallheaders();
|
2003-10-21 02:04:56 +02:00
|
|
|
|
|
|
|
if(ereg('Basic',$headers['Authorization']))
|
2001-08-20 01:55:58 +02:00
|
|
|
{
|
2003-10-21 02:04:56 +02:00
|
|
|
$tmp = $headers['Authorization'];
|
|
|
|
$tmp = ereg_replace(' ','',$tmp);
|
|
|
|
$tmp = ereg_replace('Basic','',$tmp);
|
2001-08-23 04:54:25 +02:00
|
|
|
$auth = base64_decode(trim($tmp));
|
|
|
|
list($sessionid,$kp3) = split(':',$auth);
|
|
|
|
|
2003-10-21 02:04:56 +02:00
|
|
|
if($GLOBALS['phpgw']->session->verify($sessionid,$kp3))
|
2003-08-28 16:16:30 +02:00
|
|
|
{
|
2003-10-21 02:04:56 +02:00
|
|
|
$server->authed = True;
|
2003-08-28 16:16:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-21 02:04:56 +02:00
|
|
|
$server->service($HTTP_SERVER_VARS['HTTP_RAW_POST_DATA']);
|
|
|
|
?>
|