soap_user.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Configures the WSUser SOAP service.
  5. *
  6. * @package chamilo.webservices
  7. */
  8. require_once __DIR__.'/webservice_user.php';
  9. require_once __DIR__.'/soap.php';
  10. /**
  11. * Configures the WSUser SOAP service.
  12. *
  13. * @package chamilo.webservices
  14. */
  15. $s = WSSoapServer::singleton();
  16. $s->wsdl->addComplexType(
  17. 'user_id',
  18. 'complexType',
  19. 'struct',
  20. 'all',
  21. '',
  22. [
  23. 'user_id_field_name' => [
  24. 'name' => 'user_id_field_name',
  25. 'type' => 'xsd:string',
  26. ],
  27. 'user_id_value' => [
  28. 'name' => 'user_id_value',
  29. 'type' => 'xsd:string',
  30. ],
  31. ]
  32. );
  33. $s->wsdl->addComplexType(
  34. 'user_result',
  35. 'complexType',
  36. 'struct',
  37. 'all',
  38. '',
  39. [
  40. 'user_id_value' => [
  41. 'name' => 'user_id_value',
  42. 'type' => 'xsd:string',
  43. ],
  44. 'result' => ['name' => 'result', 'type' => 'tns:result'],
  45. ]
  46. );
  47. $s->wsdl->addComplexType(
  48. 'user_result_array',
  49. 'complexType',
  50. 'array',
  51. '',
  52. 'SOAP-ENC:Array',
  53. [],
  54. [
  55. [
  56. 'ref' => 'SOAP-ENC:arrayType',
  57. 'wsdl:arrayType' => 'tns:user_result[]',
  58. ],
  59. ],
  60. 'tns:user_result'
  61. );
  62. $s->register(
  63. 'WSUser.DisableUser',
  64. [
  65. 'secret_key' => 'xsd:string',
  66. 'user_id_field_name' => 'xsd:string',
  67. 'user_id_value' => 'xsd:string',
  68. ]
  69. );
  70. $s->register(
  71. 'WSUser.DisableUsers',
  72. ['secret_key' => 'xsd:string', 'users' => 'tns:user_id[]'],
  73. ['return' => 'tns:user_result_array']
  74. );
  75. $s->register(
  76. 'WSUser.EnableUser',
  77. [
  78. 'secret_key' => 'xsd:string',
  79. 'user_id_field_name' => 'xsd:string',
  80. 'user_id_value' => 'xsd:string',
  81. ]
  82. );
  83. $s->register(
  84. 'WSUser.EnableUsers',
  85. ['secret_key' => 'xsd:string', 'users' => 'tns:user_id[]'],
  86. ['return' => 'tns:user_result_array']
  87. );
  88. $s->register(
  89. 'WSUser.DeleteUser',
  90. [
  91. 'secret_key' => 'xsd:string',
  92. 'user_id_field_name' => 'xsd:string',
  93. 'user_id_value' => 'xsd:string',
  94. ]
  95. );
  96. $s->register(
  97. 'WSUser.DeleteUsers',
  98. ['secret_key' => 'xsd:string', 'users' => 'tns:user_id[]'],
  99. ['return' => 'tns:user_result_array']
  100. );
  101. $s->register(
  102. 'WSUser.CreateUser',
  103. [
  104. 'secret_key' => 'xsd:string',
  105. 'firstname' => 'xsd:string',
  106. 'lastname' => 'xsd:string',
  107. 'status' => 'xsd:int',
  108. 'loginname' => 'xsd:string',
  109. 'password' => 'xsd:string',
  110. 'encrypt_method' => 'xsd:string',
  111. 'user_id_field_name' => 'xsd:string',
  112. 'user_id_value' => 'xsd:string',
  113. 'visibility' => 'xsd:int',
  114. 'email' => 'xsd:string',
  115. 'language' => 'xsd:string',
  116. 'phone' => 'xsd:string',
  117. 'expiration_date' => 'xsd:string',
  118. 'extras' => 'tns:extra_field',
  119. ],
  120. ['return' => 'xsd:int']
  121. );
  122. $s->wsdl->addComplexType(
  123. 'user_create',
  124. 'complexType',
  125. 'struct',
  126. 'all',
  127. '',
  128. [
  129. 'firstname' => ['name' => 'firstname', 'type' => 'xsd:string'],
  130. 'lastname' => ['name' => 'lastname', 'type' => 'xsd:string'],
  131. 'status' => ['name' => 'status', 'type' => 'xsd:int'],
  132. 'loginname' => ['name' => 'loginname', 'type' => 'xsd:string'],
  133. 'password' => ['name' => 'password', 'type' => 'xsd:string'],
  134. 'encrypt_method' => [
  135. 'name' => 'encrypt_method',
  136. 'type' => 'xsd:string',
  137. ],
  138. 'user_id_field_name' => [
  139. 'name' => 'user_id_field_name',
  140. 'type' => 'xsd:string',
  141. ],
  142. 'user_id_value' => [
  143. 'name' => 'user_id_value',
  144. 'type' => 'xsd:string',
  145. ],
  146. 'visibility' => ['name' => 'visibility', 'type' => 'xsd:int'],
  147. 'email' => ['name' => 'email', 'type' => 'xsd:string'],
  148. 'language' => ['name' => 'language', 'type' => 'xsd:string'],
  149. 'phone' => ['name' => 'phone', 'type' => 'xsd:string'],
  150. 'expiration_date' => [
  151. 'name' => 'expiration_date',
  152. 'type' => 'xsd:string',
  153. ],
  154. 'extras' => ['name' => 'extras', 'type' => 'tns:extra_field'],
  155. ]
  156. );
  157. $s->wsdl->addComplexType(
  158. 'user_create_result',
  159. 'complexType',
  160. 'struct',
  161. 'all',
  162. '',
  163. [
  164. 'user_id_value' => [
  165. 'name' => 'user_id_value',
  166. 'type' => 'xsd:string',
  167. ],
  168. 'user_id_generated' => [
  169. 'name' => 'user_id_generated',
  170. 'type' => 'xsd:int',
  171. ],
  172. 'result' => ['name' => 'result', 'type' => 'tns:result'],
  173. ]
  174. );
  175. $s->wsdl->addComplexType(
  176. 'user_create_result_array',
  177. 'complexType',
  178. 'array',
  179. '',
  180. 'SOAP-ENC:Array',
  181. [],
  182. [
  183. [
  184. 'ref' => 'SOAP-ENC:arrayType',
  185. 'wsdl:arrayType' => 'tns:user_create_result[]',
  186. ],
  187. ],
  188. 'tns:user_create_result'
  189. );
  190. $s->register(
  191. 'WSUser.CreateUsers',
  192. [
  193. 'secret_key' => 'xsd:string',
  194. 'users' => 'tns:user_create[]',
  195. ],
  196. ['return' => 'tns:user_create_result_array']
  197. );
  198. $s->register(
  199. 'WSUser.EditUser',
  200. [
  201. 'secret_key' => 'xsd:string',
  202. 'user_id_field_name' => 'xsd:string',
  203. 'user_id_value' => 'xsd:string',
  204. 'firstname' => 'xsd:string',
  205. 'lastname' => 'xsd:string',
  206. 'status' => 'xsd:int',
  207. 'loginname' => 'xsd:string',
  208. 'password' => 'xsd:string',
  209. 'encrypt_method' => 'xsd:string',
  210. 'email' => 'xsd:string',
  211. 'language' => 'xsd:string',
  212. 'phone' => 'xsd:string',
  213. 'expiration_date' => 'xsd:string',
  214. 'extras' => 'tns:extra_field',
  215. ]
  216. );
  217. $s->wsdl->addComplexType(
  218. 'user_edit',
  219. 'complexType',
  220. 'struct',
  221. 'all',
  222. '',
  223. [
  224. 'user_id_field_name' => [
  225. 'name' => 'user_id_field_name',
  226. 'type' => 'xsd:string',
  227. ],
  228. 'user_id_value' => [
  229. 'name' => 'user_id_value',
  230. 'type' => 'xsd:string',
  231. ],
  232. 'firstname' => ['name' => 'firstname', 'type' => 'xsd:string'],
  233. 'lastname' => ['name' => 'lastname', 'type' => 'xsd:string'],
  234. 'status' => ['name' => 'status', 'type' => 'xsd:int'],
  235. 'loginname' => ['name' => 'loginname', 'type' => 'xsd:string'],
  236. 'password' => ['name' => 'password', 'type' => 'xsd:string'],
  237. 'encrypt_method' => [
  238. 'name' => 'encrypt_method',
  239. 'type' => 'xsd:string',
  240. ],
  241. 'email' => ['name' => 'email', 'type' => 'xsd:string'],
  242. 'language' => ['name' => 'language', 'type' => 'xsd:string'],
  243. 'phone' => ['name' => 'phone', 'type' => 'xsd:string'],
  244. 'expiration_date' => [
  245. 'name' => 'expiration_date',
  246. 'type' => 'xsd:string',
  247. ],
  248. 'extras' => ['name' => 'extras', 'type' => 'tns:extra_field'],
  249. ]
  250. );
  251. $s->wsdl->addComplexType(
  252. 'user_edit_result',
  253. 'complexType',
  254. 'struct',
  255. 'all',
  256. '',
  257. [
  258. 'user_id_value' => [
  259. 'name' => 'user_id_value',
  260. 'type' => 'xsd:string',
  261. ],
  262. 'result' => ['name' => 'result', 'type' => 'tns:result'],
  263. ]
  264. );
  265. $s->wsdl->addComplexType(
  266. 'user_edit_result_array',
  267. 'complexType',
  268. 'array',
  269. '',
  270. 'SOAP-ENC:Array',
  271. [],
  272. [
  273. [
  274. 'ref' => 'SOAP-ENC:arrayType',
  275. 'wsdl:arrayType' => 'tns:user_edit_result[]',
  276. ],
  277. ],
  278. 'tns:user_edit_result'
  279. );
  280. $s->register(
  281. 'WSUser.EditUsers',
  282. [
  283. 'secret_key' => 'xsd:string',
  284. 'users' => 'tns:user_edit[]',
  285. ],
  286. ['return' => 'tns:user_edit_result_array']
  287. );