1 | <?php
|
---|
2 | /**************************************************************************\
|
---|
3 | * eGroupWare - SOAP Server *
|
---|
4 | * http://www.egroupware.org *
|
---|
5 | * Written by Miles Lott <milos@groupwhere.org> *
|
---|
6 | * -------------------------------------------- *
|
---|
7 | * This program is free software; you can redistribute it and/or modify it *
|
---|
8 | * under the terms of the GNU General Public License as published by the *
|
---|
9 | * Free Software Foundation; either version 2 of the License, or (at your *
|
---|
10 | * option) any later version. *
|
---|
11 | \**************************************************************************/
|
---|
12 |
|
---|
13 |
|
---|
14 | $phpgw_info = array();
|
---|
15 | $GLOBALS['phpgw_info']['flags'] = array(
|
---|
16 | 'disable_Template_class' => True,
|
---|
17 | 'currentapp' => 'login',
|
---|
18 | 'noheader' => True,
|
---|
19 | 'disable_Template_class' => True
|
---|
20 | );
|
---|
21 | include('./header.inc.php');
|
---|
22 |
|
---|
23 | $GLOBALS['server'] = CreateObject('phpgwapi.soap_server');
|
---|
24 | /* _debug_array($GLOBALS['server']);exit; */
|
---|
25 | /* include(PHPGW_API_INC . '/soaplib.soapinterop.php'); */
|
---|
26 |
|
---|
27 | if (!$GLOBALS['phpgw_info']['server']['soap_enabled'])
|
---|
28 | {
|
---|
29 | $GLOBALS['server']->make_fault(9999,'soap service is not enabled in the eGroupWare system configuration');
|
---|
30 | $GLOBALS['server']->service($GLOBALS['server']->fault());
|
---|
31 | exit;
|
---|
32 | }
|
---|
33 |
|
---|
34 | /* Note: this command only available under Apache */
|
---|
35 | $headers = getallheaders();
|
---|
36 |
|
---|
37 | if(ereg('Basic',$headers['Authorization']))
|
---|
38 | {
|
---|
39 | $tmp = $headers['Authorization'];
|
---|
40 | $tmp = str_replace(' ','',$tmp);
|
---|
41 | $tmp = str_replace('Basic','',$tmp);
|
---|
42 | $auth = base64_decode(trim($tmp));
|
---|
43 | list($sessionid,$kp3) = split(':',$auth);
|
---|
44 |
|
---|
45 | if($GLOBALS['phpgw']->session->verify($sessionid,$kp3))
|
---|
46 | {
|
---|
47 | $GLOBALS['server']->authed = True;
|
---|
48 | }
|
---|
49 | elseif($GLOBALS['phpgw']->session->verify_server($sessionid,$kp3))
|
---|
50 | {
|
---|
51 | $GLOBALS['server']->authed = True;
|
---|
52 | }
|
---|
53 | }
|
---|
54 |
|
---|
55 | $GLOBALS['server']->add_to_map(
|
---|
56 | 'system_login',
|
---|
57 | array('soapstruct'),
|
---|
58 | array('soapstruct')
|
---|
59 | );
|
---|
60 | $GLOBALS['server']->add_to_map(
|
---|
61 | 'system_logout',
|
---|
62 | array('soapstruct'),
|
---|
63 | array('soapstruct')
|
---|
64 | );
|
---|
65 |
|
---|
66 | if(function_exists('system_listapps'))
|
---|
67 | {
|
---|
68 | $GLOBALS['server']->add_to_map(
|
---|
69 | 'system_listApps',
|
---|
70 | array(),
|
---|
71 | array('soapstruct')
|
---|
72 | );
|
---|
73 | }
|
---|
74 |
|
---|
75 | $GLOBALS['server']->service($HTTP_RAW_POST_DATA);
|
---|
76 | ?>
|
---|