2001-08-08 01:04:49 +02:00
|
|
|
<?php
|
2003-08-28 16:16:30 +02:00
|
|
|
/**************************************************************************\
|
2003-10-21 02:06:44 +02:00
|
|
|
* eGroupWare xmlrpc server *
|
2004-01-01 16:38:15 +01:00
|
|
|
* http://www.egroupware.org *
|
2003-10-21 02:06:44 +02:00
|
|
|
* This file written by Miles Lott <milos@groupwhere.org> *
|
2003-08-28 16:16:30 +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$ */
|
|
|
|
/* $Source$ */
|
2005-06-18 22:29:17 +02:00
|
|
|
/*list($usec, $sec) = explode(" ", microtime());
|
|
|
|
$GLOBALS['concisus']['script_start'] = ((float)$usec + (float)$sec);*/
|
2003-08-28 16:16:30 +02:00
|
|
|
|
2005-07-08 07:00:14 +02:00
|
|
|
$GLOBALS['egw_info'] = array();
|
|
|
|
$GLOBALS['egw_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
|
|
|
|
2005-06-18 22:29:17 +02:00
|
|
|
//viniciuscb: a secure way to know if we're in a xmlrpc call...
|
2005-07-08 07:00:14 +02:00
|
|
|
$GLOBALS['egw_info']['server']['xmlrpc'] = true;
|
2005-06-18 22:29:17 +02:00
|
|
|
|
2003-10-21 02:04:56 +02:00
|
|
|
$server = CreateObject('phpgwapi.xmlrpc_server');
|
2005-07-08 07:00:14 +02:00
|
|
|
|
2003-10-21 02:04:56 +02:00
|
|
|
/* uncomment here if you want to show all of the testing functions for compatibility */
|
2005-07-08 07:00:14 +02:00
|
|
|
//include(EGW_API_INC . '/xmlrpc.interop.php');
|
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();
|
2004-03-12 18:58:55 +01:00
|
|
|
//print_r($headers);
|
2005-06-30 21:01:19 +02:00
|
|
|
$isodate = $headers['isoDate'] ? $headers['isoDate'] : $headers['isodate'];
|
|
|
|
$isodate = ($isodate == 'simple') ? True : False;
|
|
|
|
$server->setSimpleDate($isodate);
|
2004-03-12 18:58:55 +01:00
|
|
|
$auth_header = $headers['Authorization'] ? $headers['Authorization'] : $headers['authorization'];
|
|
|
|
|
|
|
|
if(eregi('Basic *([^ ]*)',$auth_header,$auth))
|
2001-08-20 01:55:58 +02:00
|
|
|
{
|
2004-03-12 18:58:55 +01:00
|
|
|
list($sessionid,$kp3) = explode(':',base64_decode($auth[1]));
|
|
|
|
//echo "auth='$auth[1]', sessionid='$sessionid', kp3='$kp3'\n";
|
2003-08-28 16:16:30 +02:00
|
|
|
}
|
2004-03-13 18:54:26 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
$sessionid = get_var('sessionid',array('COOKIE','GET'));
|
|
|
|
$kp3 = get_var('kp3',array('COOKIE','GET'));
|
|
|
|
}
|
2005-07-08 07:00:14 +02:00
|
|
|
$server->authed = $GLOBALS['egw']->session->verify($sessionid,$kp3);
|
2003-08-28 16:16:30 +02:00
|
|
|
|
2005-06-18 22:29:17 +02:00
|
|
|
if (!$server->authed and isset($_SERVER['PHP_AUTH_USER']) and isset($_SERVER['PHP_AUTH_PW']))
|
|
|
|
{
|
2005-07-08 07:00:14 +02:00
|
|
|
$authed = $GLOBALS['egw']->session->create($login.'@'.$domain, $_SERVER['PHP_AUTH_PW'], 'text');
|
2005-06-18 22:29:17 +02:00
|
|
|
|
|
|
|
if ($authed)
|
|
|
|
{
|
|
|
|
$server->authed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-13 18:54:26 +01:00
|
|
|
$server->service($_SERVER['HTTP_RAW_POST_DATA']);
|
2003-10-21 02:04:56 +02:00
|
|
|
?>
|