added use of cookie or url to pass session id

This commit is contained in:
Ralf Becker 2004-03-13 17:54:26 +00:00
parent 1bde9c9f1e
commit c863808815

View File

@ -22,27 +22,25 @@
include('header.inc.php'); include('header.inc.php');
$server = CreateObject('phpgwapi.xmlrpc_server'); $server = CreateObject('phpgwapi.xmlrpc_server');
$server->authed = False;
/* uncomment here if you want to show all of the testing functions for compatibility */ /* uncomment here if you want to show all of the testing functions for compatibility */
//include(PHPGW_API_INC . '/xmlrpc.interop.php'); //include(PHPGW_API_INC . '/xmlrpc.interop.php');
/* Note: this command only available under Apache */ /* Note: this command only available under Apache */
$headers = getallheaders(); $headers = getallheaders();
//print_r($headers); //print_r($headers);
$auth_header = $headers['Authorization'] ? $headers['Authorization'] : $headers['authorization']; $auth_header = $headers['Authorization'] ? $headers['Authorization'] : $headers['authorization'];
if(eregi('Basic *([^ ]*)',$auth_header,$auth)) if(eregi('Basic *([^ ]*)',$auth_header,$auth))
{ {
list($sessionid,$kp3) = explode(':',base64_decode($auth[1])); list($sessionid,$kp3) = explode(':',base64_decode($auth[1]));
//echo "auth='$auth[1]', sessionid='$sessionid', kp3='$kp3'\n"; //echo "auth='$auth[1]', sessionid='$sessionid', kp3='$kp3'\n";
}
if($GLOBALS['phpgw']->session->verify($sessionid,$kp3)) else
{ {
$server->authed = True; $sessionid = get_var('sessionid',array('COOKIE','GET'));
} $kp3 = get_var('kp3',array('COOKIE','GET'));
} }
$server->authed = $GLOBALS['phpgw']->session->verify($sessionid,$kp3);
$server->service($HTTP_SERVER_VARS['HTTP_RAW_POST_DATA']); $server->service($_SERVER['HTTP_RAW_POST_DATA']);
?> ?>