soap_user.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Configures the WSUser SOAP service
  5. * @package chamilo.webservices
  6. */
  7. require_once(dirname(__FILE__).'/webservice_user.php');
  8. require_once(dirname(__FILE__).'/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('name' => 'user_id_field_name', 'type' => 'xsd:string'),
  22. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string')
  23. )
  24. );
  25. $s->wsdl->addComplexType(
  26. 'user_result',
  27. 'complexType',
  28. 'struct',
  29. 'all',
  30. '',
  31. array(
  32. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string'),
  33. 'result' => array('name' => 'result', 'type' => 'tns:result')
  34. )
  35. );
  36. $s->wsdl->addComplexType(
  37. 'user_result_array',
  38. 'complexType',
  39. 'array',
  40. '',
  41. 'SOAP-ENC:Array',
  42. array(),
  43. array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:user_result[]')),
  44. 'tns:user_result'
  45. );
  46. $s->register(
  47. 'WSUser.DisableUser',
  48. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string')
  49. );
  50. $s->register(
  51. 'WSUser.DisableUsers',
  52. array('secret_key' => 'xsd:string', 'users' => 'tns:user_id[]'),
  53. array('return' => 'tns:user_result_array')
  54. );
  55. $s->register(
  56. 'WSUser.EnableUser',
  57. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string')
  58. );
  59. $s->register(
  60. 'WSUser.EnableUsers',
  61. array('secret_key' => 'xsd:string', 'users' => 'tns:user_id[]'),
  62. array('return' => 'tns:user_result_array')
  63. );
  64. $s->register(
  65. 'WSUser.DeleteUser',
  66. array('secret_key' => 'xsd:string', 'user_id_field_name' => 'xsd:string', 'user_id_value' => 'xsd:string')
  67. );
  68. $s->register(
  69. 'WSUser.DeleteUsers',
  70. array('secret_key' => 'xsd:string', 'users' => 'tns:user_id[]'),
  71. array('return' => 'tns:user_result_array')
  72. );
  73. $s->register(
  74. 'WSUser.CreateUser',
  75. array(
  76. 'secret_key' => 'xsd:string',
  77. 'firstname' => 'xsd:string',
  78. 'lastname' => 'xsd:string',
  79. 'status' => 'xsd:int',
  80. 'loginname' => 'xsd:string',
  81. 'password' => 'xsd:string',
  82. 'encrypt_method' => 'xsd:string',
  83. 'user_id_field_name' => 'xsd:string',
  84. 'user_id_value' => 'xsd:string',
  85. 'visibility' => 'xsd:int',
  86. 'email' => 'xsd:string',
  87. 'language' => 'xsd:string',
  88. 'phone' => 'xsd:string',
  89. 'expiration_date' => 'xsd:string',
  90. 'extras' => 'tns:extra_field'
  91. ),
  92. array('return' => 'xsd:int')
  93. );
  94. $s->wsdl->addComplexType(
  95. 'user_create',
  96. 'complexType',
  97. 'struct',
  98. 'all',
  99. '',
  100. array(
  101. 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'),
  102. 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'),
  103. 'status' => array('name' => 'status', 'type' => 'xsd:int'),
  104. 'loginname' => array('name' => 'loginname', 'type' => 'xsd:string'),
  105. 'password' => array('name' => 'password', 'type' => 'xsd:string'),
  106. 'encrypt_method' => array('name' => 'encrypt_method', 'type' => 'xsd:string'),
  107. 'user_id_field_name' => array('name' => 'user_id_field_name', 'type' => 'xsd:string'),
  108. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string'),
  109. 'visibility' => array('name' => 'visibility', 'type' => 'xsd:int'),
  110. 'email' => array('name' => 'email', 'type' => 'xsd:string'),
  111. 'language' => array('name' => 'language', 'type' => 'xsd:string'),
  112. 'phone' => array('name' => 'phone', 'type' => 'xsd:string'),
  113. 'expiration_date' => array('name' => 'expiration_date', 'type' => 'xsd:string'),
  114. 'extras' => array('name' => 'extras', 'type' => 'tns:extra_field')
  115. )
  116. );
  117. $s->wsdl->addComplexType(
  118. 'user_create_result',
  119. 'complexType',
  120. 'struct',
  121. 'all',
  122. '',
  123. array(
  124. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string'),
  125. 'user_id_generated' => array('name' => 'user_id_generated', 'type' => 'xsd:int'),
  126. 'result' => array('name' => 'result', 'type' => 'tns:result')
  127. )
  128. );
  129. $s->wsdl->addComplexType(
  130. 'user_create_result_array',
  131. 'complexType',
  132. 'array',
  133. '',
  134. 'SOAP-ENC:Array',
  135. array(),
  136. array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:user_create_result[]')),
  137. 'tns:user_create_result'
  138. );
  139. $s->register(
  140. 'WSUser.CreateUsers',
  141. array(
  142. 'secret_key' => 'xsd:string',
  143. 'users' => 'tns:user_create[]'
  144. ),
  145. array('return' => 'tns:user_create_result_array')
  146. );
  147. $s->register(
  148. 'WSUser.EditUser',
  149. array(
  150. 'secret_key' => 'xsd:string',
  151. 'user_id_field_name' => 'xsd:string',
  152. 'user_id_value' => 'xsd:string',
  153. 'firstname' => 'xsd:string',
  154. 'lastname' => 'xsd:string',
  155. 'status' => 'xsd:int',
  156. 'loginname' => 'xsd:string',
  157. 'password' => 'xsd:string',
  158. 'encrypt_method' => 'xsd:string',
  159. 'email' => 'xsd:string',
  160. 'language' => 'xsd:string',
  161. 'phone' => 'xsd:string',
  162. 'expiration_date' => 'xsd:string',
  163. 'extras' => 'tns:extra_field'
  164. )
  165. );
  166. $s->wsdl->addComplexType(
  167. 'user_edit',
  168. 'complexType',
  169. 'struct',
  170. 'all',
  171. '',
  172. array(
  173. 'user_id_field_name' => array('name' => 'user_id_field_name', 'type' => 'xsd:string'),
  174. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string'),
  175. 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'),
  176. 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'),
  177. 'status' => array('name' => 'status', 'type' => 'xsd:int'),
  178. 'loginname' => array('name' => 'loginname', 'type' => 'xsd:string'),
  179. 'password' => array('name' => 'password', 'type' => 'xsd:string'),
  180. 'encrypt_method' => array('name' => 'encrypt_method', 'type' => 'xsd:string'),
  181. 'email' => array('name' => 'email', 'type' => 'xsd:string'),
  182. 'language' => array('name' => 'language', 'type' => 'xsd:string'),
  183. 'phone' => array('name' => 'phone', 'type' => 'xsd:string'),
  184. 'expiration_date' => array('name' => 'expiration_date', 'type' => 'xsd:string'),
  185. 'extras' => array('name' => 'extras', 'type' => 'tns:extra_field')
  186. )
  187. );
  188. $s->wsdl->addComplexType(
  189. 'user_edit_result',
  190. 'complexType',
  191. 'struct',
  192. 'all',
  193. '',
  194. array(
  195. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string'),
  196. 'result' => array('name' => 'result', 'type' => 'tns:result')
  197. )
  198. );
  199. $s->wsdl->addComplexType(
  200. 'user_edit_result_array',
  201. 'complexType',
  202. 'array',
  203. '',
  204. 'SOAP-ENC:Array',
  205. array(),
  206. array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:user_edit_result[]')),
  207. 'tns:user_edit_result'
  208. );
  209. $s->register(
  210. 'WSUser.EditUsers',
  211. array(
  212. 'secret_key' => 'xsd:string',
  213. 'users' => 'tns:user_edit[]'
  214. ),
  215. array('return' => 'tns:user_edit_result_array')
  216. );