soap_user.php 7.8 KB

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