Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00034 include_once './webservice/soap/lib/nusoap.php';
00035
00039 function isValidSession($ext_uid, $soap_pw, $new_user)
00040 {
00041 $ret = array(
00042 "valid" => false,
00043 "firstname" => "",
00044 "lastname" => "",
00045 "email" => "");
00046
00047
00048 if ($new_user)
00049 {
00050 $ret["firstname"] = "first ".$ext_uid;
00051 $ret["lastname"] = "last ".$ext_uid;
00052 $ret["email"] = $ext_uid."@de.de";
00053 }
00054
00055
00056 if ($ext_uid == $soap_pw)
00057 {
00058 $ret["valid"] = true;
00059 }
00060 else
00061 {
00062 $ret["valid"] = false;
00063 }
00064
00065 return $ret;
00066 }
00067
00068
00069 class ilSoapDummyAuthServer
00070 {
00071
00072
00073
00074 var $server = null;
00075
00076
00077 function ilSoapDummyAuthServer($a_use_wsdl = true)
00078 {
00079 define('SERVICE_NAME','ILIAS SOAP Dummy Authentication Server');
00080 define('SERVICE_NAMESPACE','urn:ilSoapDummyAuthServer');
00081 define('SERVICE_STYLE','rpc');
00082 define('SERVICE_USE','encoded');
00083
00084 $this->server =& new soap_server();
00085
00086 if($a_use_wsdl)
00087 {
00088 $this->__enableWSDL();
00089 }
00090
00091 $this->__registerMethods();
00092
00093 }
00094
00095 function start()
00096 {
00097 global $HTTP_RAW_POST_DATA;
00098
00099 $this->server->service($HTTP_RAW_POST_DATA);
00100 exit();
00101 }
00102
00103
00104 function __enableWSDL()
00105 {
00106 $this->server->configureWSDL(SERVICE_NAME,SERVICE_NAMESPACE);
00107
00108 return true;
00109 }
00110
00111
00112 function __registerMethods()
00113 {
00114
00115
00116 $this->server->wsdl->addComplexType('intArray',
00117 'complexType',
00118 'array',
00119 '',
00120 'SOAP-ENC:Array',
00121 array(),
00122 array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:int[]')),
00123 'xsd:int');
00124
00125
00126 $this->server->wsdl->addComplexType('stringArray',
00127 'complexType',
00128 'array',
00129 '',
00130 'SOAP-ENC:Array',
00131 array(),
00132 array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]')),
00133 'xsd:string');
00134
00135
00136 $this->server->register('isValidSession',
00137 array('ext_uid' => 'xsd:string',
00138 'soap_pw' => 'xsd:string',
00139 'new_user' => 'xsd:boolean'),
00140 array('valid' => 'xsd:boolean',
00141 'firstname' => 'xsd:string',
00142 'lastname' => 'xsd:string',
00143 'email' => 'xsd:string'),
00144 SERVICE_NAMESPACE,
00145 SERVICE_NAMESPACE.'#isValidSession',
00146 SERVICE_STYLE,
00147 SERVICE_USE,
00148 'Dummy Session Validation');
00149
00150 return true;
00151 }
00152
00153 }
00154 ?>