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 include_once './webservice/soap/classes/class.ilSoapUserAdministration.php';
00036
00037 class ilNusoapUserAdministrationAdapter
00038 {
00039
00040
00041
00042 var $server = null;
00043
00044
00045 function ilNusoapUserAdministrationAdapter($a_use_wsdl = true)
00046 {
00047 define('SERVICE_NAME','ilUserAdministration');
00048 define('SERVICE_NAMESPACE','urn:ilUserAdministration');
00049 define('SERVICE_STYLE','rpc');
00050 define('SERVICE_USE','encoded');
00051
00052 $this->server =& new soap_server();
00053
00054 if($a_use_wsdl)
00055 {
00056 $this->__enableWSDL();
00057 }
00058
00059 $this->__registerMethods();
00060
00061
00062 }
00063
00064 function start()
00065 {
00066 global $HTTP_RAW_POST_DATA;
00067
00068 $this->server->service($HTTP_RAW_POST_DATA);
00069 exit();
00070 }
00071
00072
00073 function __enableWSDL()
00074 {
00075 $this->server->configureWSDL(SERVICE_NAME,SERVICE_NAMESPACE);
00076
00077 return true;
00078 }
00079
00080
00081 function __registerMethods()
00082 {
00083
00084
00085
00086 $this->server->register('login',
00087 array('client' => 'xsd:string',
00088 'username' => 'xsd:string',
00089 'password' => 'xsd:string'),
00090 array('sid' => 'xsd:string'),
00091 SERVICE_NAMESPACE,
00092 SERVICE_NAMESPACE.'#login',
00093 SERVICE_STYLE,
00094 SERVICE_USE,
00095 'ILIAS login function');
00096
00097
00098 $this->server->register('logout',
00099 array('sid' => 'xsd:string'),
00100 array('success' => 'xsd:boolean'),
00101 SERVICE_NAMESPACE,
00102 SERVICE_NAMESPACE.'#logout',
00103 SERVICE_STYLE,
00104 SERVICE_USE,
00105 'ILIAS logout function');
00106
00107 $this->server->wsdl->addComplexType('ilUserData',
00108 'complexType',
00109 'struct',
00110 'all',
00111 '',
00112 array('usr_id' => array('name' => 'usr_id','type' => 'xsd:int'),
00113 'login' => array('name' => 'login', 'type' => 'xsd:string'),
00114 'passwd' => array('name' => 'passwd', 'type' => 'xsd:string'),
00115 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'),
00116 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'),
00117 'title' => array('name' => 'title', 'type' => 'xsd:string'),
00118 'gender' => array('name' => 'gender', 'type' => 'xsd:string'),
00119 'email' => array('name' => 'email', 'type' => 'xsd:string'),
00120 'institution' => array('name' => 'institution', 'type' => 'xsd:string'),
00121 'street' => array('name' => 'street', 'type' => 'xsd:string'),
00122 'city' => array('name' => 'city', 'type' => 'xsd:string'),
00123 'zipcode' => array('name' => 'zipcode', 'type' => 'xsd:string'),
00124 'country' => array('name' => 'country', 'type' => 'xsd:string'),
00125 'phone_office' => array('name' => 'phone_office', 'type' => 'xsd:string'),
00126 'last_login' => array('name' => 'last_login', 'type' => 'xsd:string'),
00127 'last_update' => array('name' => 'last_update', 'type' => 'xsd:string'),
00128 'create_date' => array('name' => 'create_date', 'type' => 'xsd:string'),
00129 'hobby' => array('name' => 'hobby', 'type' => 'xsd:string'),
00130 'department' => array('name' => 'department', 'type' => 'xsd:string'),
00131 'phone_home' => array('name' => 'phone_home', 'type' => 'xsd:string'),
00132 'phone_mobile' => array('name' => 'phone_mobile', 'type' => 'xsd:string'),
00133 'fax' => array('name' => 'fax', 'type' => 'xsd:string'),
00134 'time_limit_owner' => array('name' => 'time_limit_owner', 'type' => 'xsd:int'),
00135 'time_limit_unlimited' => array('name' => 'time_limit_unlimited', 'type' => 'xsd:int'),
00136 'time_limit_from' => array('name' => 'time_limit_from', 'type' => 'xsd:int'),
00137 'time_limit_until' => array('name' => 'time_limit_until', 'type' => 'xsd:int'),
00138 'time_limit_message' => array('name' => 'time_limit_message', 'type' => 'xsd:int'),
00139 'referral_comment' => array('name' => 'referral_comment', 'type' => 'xsd:string'),
00140 'matriculation' => array('name' => 'matriculation', 'type' => 'xsd:string'),
00141 'active' => array('name' => 'active', 'type' => 'xsd:int'),
00142 'approve_date' => array('name' => 'approve_date', 'type' => 'xsd:string'),
00143 'user_skin' => array('name' => 'user_skin', 'type' => 'xsd:string'),
00144 'user_style' => array('name' => 'user_style', 'type' => 'xsd:string'),
00145 'user_language' => array('name' => 'user_languaage', 'type' => 'xsd:string')));
00146
00147
00148 $this->server->register('lookupUser',
00149 array('sid' => 'xsd:string',
00150 'user_name' => 'xsd:string'),
00151 array('usr_id' => 'xsd:int'),
00152 SERVICE_NAMESPACE,
00153 SERVICE_NAMESPACE.'#lookupUser',
00154 SERVICE_STYLE,
00155 SERVICE_USE,
00156 'ILIAS lookupUser(): check if username exists. Return usr_id or 0 if lookup fails.');
00157
00158
00159
00160 $this->server->register('getUser',
00161 array('sid' => 'xsd:string',
00162 'user_id' => 'xsd:int'),
00163 array('user_data' => 'tns:ilUserData'),
00164 SERVICE_NAMESPACE,
00165 SERVICE_NAMESPACE.'#getUser',
00166 SERVICE_STYLE,
00167 SERVICE_USE,
00168 'ILIAS getUser(): get complete set of user data.');
00169
00170 $this->server->register('updateUser',
00171 array('sid' => 'xsd:string',
00172 'user_data' => 'tns:ilUserData'),
00173 array('success' => 'xsd:boolean'),
00174 SERVICE_NAMESPACE,
00175 SERVICE_NAMESPACE.'#updateUser',
00176 SERVICE_STYLE,
00177 SERVICE_USE,
00178 'ILIAS updateUser(). Updates all user data. '.
00179 'Use getUser(), then modify desired fields and finally start the updateUser() call.');
00180
00181
00182 $this->server->register('addUser',
00183 array('sid' => 'xsd:string',
00184 'user_data' => 'tns:ilUserData',
00185 'global_role_id' => 'xsd:int'),
00186 array('user_id' => 'xsd:int'),
00187 SERVICE_NAMESPACE,
00188 SERVICE_NAMESPACE.'#addUser',
00189 SERVICE_STYLE,
00190 SERVICE_USE,
00191 'ILIAS addUser() user. Add new ILIAS user. Requires complete or subset of user_data structure');
00192
00193
00194 $this->server->register('deleteUser',
00195 array('sid' => 'xsd:string',
00196 'user_id' => 'xsd:int'),
00197 array('success' => 'xsd:boolean'),
00198 SERVICE_NAMESPACE,
00199 SERVICE_NAMESPACE.'#deleteUser',
00200 SERVICE_STYLE,
00201 SERVICE_USE,
00202 'ILIAS deleteUser(). Deletes all user related data (Bookmarks, Mails ...)');
00203 return true;
00204 }
00205
00206 }
00207 ?>