@@ -5,7 +5,7 @@ |
||
5 | 5 | */ |
6 | 6 | $ip = trim($_SERVER['REMOTE_ADDR']); |
7 | 7 | if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
8 | - list($ip1,$ip2) = preg_split('/,/',$_SERVER['HTTP_X_FORWARDED_FOR']); |
|
8 | + list($ip1, $ip2) = preg_split('/,/', $_SERVER['HTTP_X_FORWARDED_FOR']); |
|
9 | 9 | $ip = trim($ip1); |
10 | 10 | } |
11 | 11 | echo htmlentities($ip); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function GetTimeSpentOnPlatform($user_id_field_name, $user_id_value) { |
22 | 22 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
23 | - if($user_id instanceof WSError) { |
|
23 | + if ($user_id instanceof WSError) { |
|
24 | 24 | return $user_id; |
25 | 25 | } else { |
26 | 26 | return Tracking::get_time_spent_on_the_platform($user_id); |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function GetTimeSpentOnCourse($user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value) { |
40 | 40 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
41 | - if($user_id instanceof WSError) { |
|
41 | + if ($user_id instanceof WSError) { |
|
42 | 42 | return $user_id; |
43 | 43 | } |
44 | 44 | $course_id = $this->getCourseId($course_id_field_name, $course_id_value); |
45 | - if($course_id instanceof WSError) { |
|
45 | + if ($course_id instanceof WSError) { |
|
46 | 46 | return $course_id; |
47 | 47 | } else { |
48 | 48 | $course_code = CourseManager::get_course_code_from_course_id($course_id); |
@@ -61,17 +61,17 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function GetTimeSpentOnCourseInSession($user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $session_id_field_name, $session_id_value) { |
63 | 63 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
64 | - if($user_id instanceof WSError) { |
|
64 | + if ($user_id instanceof WSError) { |
|
65 | 65 | return $user_id; |
66 | 66 | } |
67 | 67 | $course_id = $this->getCourseId($course_id_field_name, $course_id_value); |
68 | - if($course_id instanceof WSError) { |
|
68 | + if ($course_id instanceof WSError) { |
|
69 | 69 | return $course_id; |
70 | 70 | } else { |
71 | 71 | $course_code = CourseManager::get_course_code_from_course_id($course_id); |
72 | 72 | } |
73 | 73 | $session_id = $this->getSessionId($session_id_field_name, $session_id_value); |
74 | - if($session_id instanceof WSError) { |
|
74 | + if ($session_id instanceof WSError) { |
|
75 | 75 | return $session_id; |
76 | 76 | } |
77 | 77 | return Tracking::get_time_spent_on_the_course($user_id, $course_id, $session_id); |
@@ -87,17 +87,17 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function GetLearnpathsByCourse($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value) { |
89 | 89 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
90 | - if($user_id instanceof WSError) { |
|
90 | + if ($user_id instanceof WSError) { |
|
91 | 91 | return $user_id; |
92 | 92 | } |
93 | 93 | $course_id = $this->getCourseId($course_id_field_name, $course_id_value); |
94 | - if($course_id instanceof WSError) { |
|
94 | + if ($course_id instanceof WSError) { |
|
95 | 95 | return $course_id; |
96 | 96 | } else { |
97 | 97 | $course_code = CourseManager::get_course_code_from_course_id($course_id); |
98 | 98 | } |
99 | 99 | |
100 | - $lp = new LearnpathList($user_id,$course_code); |
|
100 | + $lp = new LearnpathList($user_id, $course_code); |
|
101 | 101 | $list = $lp->list; |
102 | 102 | $return = array(); |
103 | 103 | foreach ($list as $id => $item) { |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function GetLearnpathProgress($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $learnpath_id) { |
119 | 119 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
120 | - if($user_id instanceof WSError) { |
|
120 | + if ($user_id instanceof WSError) { |
|
121 | 121 | return $user_id; |
122 | 122 | } |
123 | 123 | $course_id = $this->getCourseId($course_id_field_name, $course_id_value); |
124 | - if($course_id instanceof WSError) { |
|
124 | + if ($course_id instanceof WSError) { |
|
125 | 125 | return $course_id; |
126 | 126 | } else { |
127 | 127 | $course_code = CourseManager::get_course_code_from_course_id($course_id); |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function GetLearnpathHighestLessonLocation($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $learnpath_id) { |
152 | 152 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
153 | - if($user_id instanceof WSError) { |
|
153 | + if ($user_id instanceof WSError) { |
|
154 | 154 | return $user_id; |
155 | 155 | } |
156 | 156 | $course_id = $this->getCourseId($course_id_field_name, $course_id_value); |
157 | - if($course_id instanceof WSError) { |
|
157 | + if ($course_id instanceof WSError) { |
|
158 | 158 | return $course_id; |
159 | 159 | } else { |
160 | 160 | $course_code = CourseManager::get_course_code_from_course_id($course_id); |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function GetLearnpathScoreSingleItem($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $learnpath_id, $learnpath_item_id) { |
181 | 181 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
182 | - if($user_id instanceof WSError) { |
|
182 | + if ($user_id instanceof WSError) { |
|
183 | 183 | return $user_id; |
184 | 184 | } |
185 | 185 | $course_id = $this->getCourseId($course_id_field_name, $course_id_value); |
186 | - if($course_id instanceof WSError) { |
|
186 | + if ($course_id instanceof WSError) { |
|
187 | 187 | return $course_id; |
188 | 188 | } else { |
189 | 189 | $course_code = CourseManager::get_course_code_from_course_id($course_id); |
@@ -213,15 +213,15 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function GetLearnpathStatusSingleItem($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $learnpath_id, $learnpath_item_id) { |
215 | 215 | $verifKey = $this->verifyKey($secret_key); |
216 | - if($verifKey instanceof WSError) { |
|
216 | + if ($verifKey instanceof WSError) { |
|
217 | 217 | $this->handleError($verifKey); |
218 | 218 | } else { |
219 | 219 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
220 | - if($user_id instanceof WSError) { |
|
220 | + if ($user_id instanceof WSError) { |
|
221 | 221 | return $user_id; |
222 | 222 | } |
223 | 223 | $course_id = $this->getCourseId($course_id_field_name, $course_id_value); |
224 | - if($course_id instanceof WSError) { |
|
224 | + if ($course_id instanceof WSError) { |
|
225 | 225 | return $course_id; |
226 | 226 | } else { |
227 | 227 | $course_code = CourseManager::get_course_code_from_course_id($course_id); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | if ($debug) { |
78 | - error_log("checkip " . intval($check_ip)); |
|
78 | + error_log("checkip ".intval($check_ip)); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | if ($check_ip) { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | '', |
132 | 132 | 'SOAP-ENC:Array', |
133 | 133 | array(), |
134 | - array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:portalItem[]')),'tns:portalItem' |
|
134 | + array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:portalItem[]')), 'tns:portalItem' |
|
135 | 135 | ); |
136 | 136 | |
137 | 137 | $server->wsdl->addComplexType( |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | ); |
147 | 147 | |
148 | 148 | // Register the method to expose |
149 | -$server->register('WSGetPortals', // method name |
|
150 | - array('getPortals' => 'tns:getPortals'), // input parameters |
|
151 | - array('return' => 'tns:portalList'), // output parameters |
|
152 | - 'urn:WSAccessUrl', // namespace |
|
153 | - 'urn:WSAccessUrl#WSGetPortals', // soapaction |
|
154 | - 'rpc', // style |
|
155 | - 'encoded', // use |
|
149 | +$server->register('WSGetPortals', // method name |
|
150 | + array('getPortals' => 'tns:getPortals'), // input parameters |
|
151 | + array('return' => 'tns:portalList'), // output parameters |
|
152 | + 'urn:WSAccessUrl', // namespace |
|
153 | + 'urn:WSAccessUrl#WSGetPortals', // soapaction |
|
154 | + 'rpc', // style |
|
155 | + 'encoded', // use |
|
156 | 156 | 'This service adds a user to portal' // documentation |
157 | 157 | ); |
158 | 158 | |
@@ -193,13 +193,13 @@ discard block |
||
193 | 193 | ); |
194 | 194 | |
195 | 195 | // Register the method to expose |
196 | -$server->register('WSAddUserToPortal', // method name |
|
197 | - array('addUserToPortal' => 'tns:AddUserToPortal'), // input parameters |
|
198 | - array('return' => 'xsd:string'), // output parameters |
|
199 | - 'urn:WSAccessUrl', // namespace |
|
200 | - 'urn:WSAccessUrl#WSAddUserToPortal', // soapaction |
|
201 | - 'rpc', // style |
|
202 | - 'encoded', // use |
|
196 | +$server->register('WSAddUserToPortal', // method name |
|
197 | + array('addUserToPortal' => 'tns:AddUserToPortal'), // input parameters |
|
198 | + array('return' => 'xsd:string'), // output parameters |
|
199 | + 'urn:WSAccessUrl', // namespace |
|
200 | + 'urn:WSAccessUrl#WSAddUserToPortal', // soapaction |
|
201 | + 'rpc', // style |
|
202 | + 'encoded', // use |
|
203 | 203 | 'This service adds a user to portal' // documentation |
204 | 204 | ); |
205 | 205 | |
@@ -224,13 +224,13 @@ discard block |
||
224 | 224 | } |
225 | 225 | |
226 | 226 | // Register the method to expose |
227 | -$server->register('WSRemoveUserFromPortal', // method name |
|
228 | - array('removeUserFromPortal' => 'tns:AddUserToPortal'), // input parameters |
|
229 | - array('return' => 'xsd:string'), // output parameters |
|
230 | - 'urn:WSAccessUrl', // namespace |
|
231 | - 'urn:WSAccessUrl#WSRemoveUserFromPortal', // soapaction |
|
232 | - 'rpc', // style |
|
233 | - 'encoded', // use |
|
227 | +$server->register('WSRemoveUserFromPortal', // method name |
|
228 | + array('removeUserFromPortal' => 'tns:AddUserToPortal'), // input parameters |
|
229 | + array('return' => 'xsd:string'), // output parameters |
|
230 | + 'urn:WSAccessUrl', // namespace |
|
231 | + 'urn:WSAccessUrl#WSRemoveUserFromPortal', // soapaction |
|
232 | + 'rpc', // style |
|
233 | + 'encoded', // use |
|
234 | 234 | 'This service remove a user from a portal' // documentation |
235 | 235 | ); |
236 | 236 | |
@@ -267,13 +267,13 @@ discard block |
||
267 | 267 | ); |
268 | 268 | |
269 | 269 | // Register the method to expose |
270 | -$server->register('WSGetPortalListFromUser', // method name |
|
271 | - array('getPortalListFromUser' => 'tns:getPortalListFromUser'), // input parameters |
|
272 | - array('return' => 'tns:portalList'), // output parameters |
|
273 | - 'urn:WSAccessUrl', // namespace |
|
274 | - 'urn:WSAccessUrl#WSGetPortalListFromUser', // soapaction |
|
275 | - 'rpc', // style |
|
276 | - 'encoded', // use |
|
270 | +$server->register('WSGetPortalListFromUser', // method name |
|
271 | + array('getPortalListFromUser' => 'tns:getPortalListFromUser'), // input parameters |
|
272 | + array('return' => 'tns:portalList'), // output parameters |
|
273 | + 'urn:WSAccessUrl', // namespace |
|
274 | + 'urn:WSAccessUrl#WSGetPortalListFromUser', // soapaction |
|
275 | + 'rpc', // style |
|
276 | + 'encoded', // use |
|
277 | 277 | 'This service remove a user from a portal' // documentation |
278 | 278 | ); |
279 | 279 | |
@@ -311,13 +311,13 @@ discard block |
||
311 | 311 | ); |
312 | 312 | |
313 | 313 | // Register the method to expose |
314 | -$server->register('WSGetPortalListFromCourse', // method name |
|
315 | - array('getPortalListFromCourse' => 'tns:getPortalListFromCourse'), // input parameters |
|
316 | - array('return' => 'tns:portalList'), // output parameters |
|
317 | - 'urn:WSAccessUrl', // namespace |
|
318 | - 'urn:WSAccessUrl#getPortalListFromCourse', // soapaction |
|
319 | - 'rpc', // style |
|
320 | - 'encoded', // use |
|
314 | +$server->register('WSGetPortalListFromCourse', // method name |
|
315 | + array('getPortalListFromCourse' => 'tns:getPortalListFromCourse'), // input parameters |
|
316 | + array('return' => 'tns:portalList'), // output parameters |
|
317 | + 'urn:WSAccessUrl', // namespace |
|
318 | + 'urn:WSAccessUrl#getPortalListFromCourse', // soapaction |
|
319 | + 'rpc', // style |
|
320 | + 'encoded', // use |
|
321 | 321 | 'This service remove a user from a portal' // documentation |
322 | 322 | ); |
323 | 323 | |
@@ -361,13 +361,13 @@ discard block |
||
361 | 361 | ); |
362 | 362 | |
363 | 363 | // Register the method to expose |
364 | -$server->register('WSAddCourseToPortal', // method name |
|
365 | - array('addCourseToPortal' => 'tns:addCourseToPortal'), // input parameters |
|
366 | - array('return' => 'xsd:string'), // output parameters |
|
367 | - 'urn:WSAccessUrl', // namespace |
|
368 | - 'urn:WSAccessUrl#WSAddCourseToPortal', // soapaction |
|
369 | - 'rpc', // style |
|
370 | - 'encoded', // use |
|
364 | +$server->register('WSAddCourseToPortal', // method name |
|
365 | + array('addCourseToPortal' => 'tns:addCourseToPortal'), // input parameters |
|
366 | + array('return' => 'xsd:string'), // output parameters |
|
367 | + 'urn:WSAccessUrl', // namespace |
|
368 | + 'urn:WSAccessUrl#WSAddCourseToPortal', // soapaction |
|
369 | + 'rpc', // style |
|
370 | + 'encoded', // use |
|
371 | 371 | 'This service adds a course to portal' // documentation |
372 | 372 | ); |
373 | 373 | |
@@ -394,13 +394,13 @@ discard block |
||
394 | 394 | } |
395 | 395 | |
396 | 396 | // Register the method to expose |
397 | -$server->register('WSRemoveCourseFromPortal', // method name |
|
398 | - array('removeCourseFromPortal' => 'tns:addCourseToPortal'), // input parameters |
|
399 | - array('return' => 'xsd:string'), // output parameters |
|
400 | - 'urn:WSAccessUrl', // namespace |
|
401 | - 'urn:WSAccessUrl#WSRemoveCourseFromPortal', // soapaction |
|
402 | - 'rpc', // style |
|
403 | - 'encoded', // use |
|
397 | +$server->register('WSRemoveCourseFromPortal', // method name |
|
398 | + array('removeCourseFromPortal' => 'tns:addCourseToPortal'), // input parameters |
|
399 | + array('return' => 'xsd:string'), // output parameters |
|
400 | + 'urn:WSAccessUrl', // namespace |
|
401 | + 'urn:WSAccessUrl#WSRemoveCourseFromPortal', // soapaction |
|
402 | + 'rpc', // style |
|
403 | + 'encoded', // use |
|
404 | 404 | 'This service remove a course from a portal' // documentation |
405 | 405 | ); |
406 | 406 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param WSErrorHandler Error handler |
50 | 50 | */ |
51 | 51 | public static function setErrorHandler($handler) { |
52 | - if($handler instanceof WSErrorHandler) { |
|
52 | + if ($handler instanceof WSErrorHandler) { |
|
53 | 53 | self::$_handler = $handler; |
54 | 54 | } |
55 | 55 | } |
@@ -114,12 +114,12 @@ discard block |
||
114 | 114 | // if we are behind a reverse proxy, assume it will send the |
115 | 115 | // HTTP_X_FORWARDED_FOR header and use this IP instead |
116 | 116 | if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
117 | - list($ip1,$ip2) = preg_split('/,/',$_SERVER['HTTP_X_FORWARDED_FOR']); |
|
117 | + list($ip1, $ip2) = preg_split('/,/', $_SERVER['HTTP_X_FORWARDED_FOR']); |
|
118 | 118 | $ip = trim($ip1); |
119 | 119 | } |
120 | 120 | $security_key = $ip.$this->_configuration['security_key']; |
121 | 121 | |
122 | - if(!api_is_valid_secret_key($secret_key, $security_key)) { |
|
122 | + if (!api_is_valid_secret_key($secret_key, $security_key)) { |
|
123 | 123 | return new WSError(1, "API key is invalid"); |
124 | 124 | } else { |
125 | 125 | return null; |
@@ -136,15 +136,15 @@ discard block |
||
136 | 136 | * @return mixed System user id if the user was found, WSError otherwise |
137 | 137 | */ |
138 | 138 | protected function getUserId($user_id_field_name, $user_id_value) { |
139 | - if($user_id_field_name == "chamilo_user_id") { |
|
140 | - if(UserManager::is_user_id_valid(intval($user_id_value))) { |
|
139 | + if ($user_id_field_name == "chamilo_user_id") { |
|
140 | + if (UserManager::is_user_id_valid(intval($user_id_value))) { |
|
141 | 141 | return intval($user_id_value); |
142 | 142 | } else { |
143 | 143 | return new WSError(100, "User not found"); |
144 | 144 | } |
145 | 145 | } else { |
146 | 146 | $user_id = UserManager::get_user_id_from_original_id($user_id_value, $user_id_field_name); |
147 | - if($user_id == 0) { |
|
147 | + if ($user_id == 0) { |
|
148 | 148 | return new WSError(100, "User not found"); |
149 | 149 | } else { |
150 | 150 | return $user_id; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | protected function getSessionId($session_id_field_name, $session_id_value) |
198 | 198 | { |
199 | 199 | if ($session_id_field_name == "chamilo_session_id") { |
200 | - $session = SessionManager::fetch((int)$session_id_value); |
|
200 | + $session = SessionManager::fetch((int) $session_id_value); |
|
201 | 201 | if (!empty($session)) { |
202 | 202 | return intval($session_id_value); |
203 | 203 | } else { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $soap_error = $client->getError(); |
34 | 34 | |
35 | 35 | if (!empty($soap_error)) { |
36 | - $error_message = 'Nusoap object creation failed: ' . $soap_error; |
|
36 | + $error_message = 'Nusoap object creation failed: '.$soap_error; |
|
37 | 37 | throw new Exception($error_message); |
38 | 38 | } |
39 | 39 | $client->setDebugLevel(10000); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $ip_address = "127.0.0.1"; |
46 | 46 | |
47 | 47 | //Secret key |
48 | -$secret_key = sha1($ip_address.$security_key);// Hash of the combination of IP Address + Chamilo security key |
|
48 | +$secret_key = sha1($ip_address.$security_key); // Hash of the combination of IP Address + Chamilo security key |
|
49 | 49 | //$secret_key = sha1($security_key); |
50 | 50 | |
51 | 51 | //Creating a random user_id, this values need to be provided from your system |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | if ($err) { |
95 | 95 | // Display the error |
96 | - echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; |
|
96 | + echo '<h2>Constructor error</h2><pre>'.$err.'</pre>'; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | |
@@ -325,14 +325,14 @@ discard block |
||
325 | 325 | |
326 | 326 | if ($err) { |
327 | 327 | // Display the error |
328 | - echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; |
|
328 | + echo '<h2>Constructor error</h2><pre>'.$err.'</pre>'; |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | |
332 | 332 | //1. Create user webservice |
333 | 333 | $result = $client->call( |
334 | 334 | 'WSGetPortals', |
335 | - array('getPortals' => [ 'secret_key' => $secret_key]) |
|
335 | + array('getPortals' => ['secret_key' => $secret_key]) |
|
336 | 336 | ); |
337 | 337 | |
338 | 338 | $result = $client->call( |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | ); |
364 | 364 | |
365 | 365 | |
366 | -var_dump($user_id);exit; |
|
366 | +var_dump($user_id); exit; |
|
367 | 367 | |
368 | 368 | |
369 | 369 | |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | $err = $client->getError(); |
383 | 383 | if ($err) { |
384 | 384 | // Display the error |
385 | - echo '<h2>Error</h2><pre>' . $err . '</pre>'; |
|
385 | + echo '<h2>Error</h2><pre>'.$err.'</pre>'; |
|
386 | 386 | } else { |
387 | 387 | // Display the result |
388 | 388 | echo '<h2>There are no errors</h2>'; |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | 'all', |
27 | 27 | '', |
28 | 28 | array( |
29 | - 'name'=>'code' , 'type'=>'xsd:string', |
|
30 | - 'name'=>'title' , 'type'=>'xsd:string', |
|
31 | - 'name'=>'url' , 'type'=>'xsd:string', |
|
29 | + 'name'=>'code', 'type'=>'xsd:string', |
|
30 | + 'name'=>'title', 'type'=>'xsd:string', |
|
31 | + 'name'=>'url', 'type'=>'xsd:string', |
|
32 | 32 | 'name'=>'teacher', 'type'=>'xsd:string', |
33 | - 'name'=>'language','type'=>'xsd:string', |
|
33 | + 'name'=>'language', 'type'=>'xsd:string', |
|
34 | 34 | ) |
35 | 35 | ); |
36 | 36 | |
@@ -49,14 +49,14 @@ discard block |
||
49 | 49 | ); |
50 | 50 | |
51 | 51 | // Register the method to expose |
52 | -$server->register('WSCourseListOfUser', // method name |
|
52 | +$server->register('WSCourseListOfUser', // method name |
|
53 | 53 | array('username' => 'xsd:string', |
54 | - 'signature' => 'xsd:string'), // input parameters |
|
55 | - array('return' => 'xsd:Array'), // output parameters |
|
56 | - 'urn:WSUserInfo', // namespace |
|
57 | - 'urn:WSUserInfo#WSUserInfo', // soapaction |
|
58 | - 'rpc', // style |
|
59 | - 'encoded', // use |
|
54 | + 'signature' => 'xsd:string'), // input parameters |
|
55 | + array('return' => 'xsd:Array'), // output parameters |
|
56 | + 'urn:WSUserInfo', // namespace |
|
57 | + 'urn:WSUserInfo#WSUserInfo', // soapaction |
|
58 | + 'rpc', // style |
|
59 | + 'encoded', // use |
|
60 | 60 | 'This service returns a list of courses' // documentation |
61 | 61 | ); |
62 | 62 | |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | 'all', |
105 | 105 | '', |
106 | 106 | array( |
107 | - 'name'=>'datestart','type'=>'xsd:string', |
|
108 | - 'name'=>'dateend','type'=>'xsd:string', |
|
109 | - 'name'=>'title','type'=>'xsd:string', |
|
110 | - 'name'=>'link','type'=>'xsd:string', |
|
111 | - 'name'=>'coursetitle','type'=>'xsd:string', |
|
107 | + 'name'=>'datestart', 'type'=>'xsd:string', |
|
108 | + 'name'=>'dateend', 'type'=>'xsd:string', |
|
109 | + 'name'=>'title', 'type'=>'xsd:string', |
|
110 | + 'name'=>'link', 'type'=>'xsd:string', |
|
111 | + 'name'=>'coursetitle', 'type'=>'xsd:string', |
|
112 | 112 | ) |
113 | 113 | ); |
114 | 114 | |
@@ -127,16 +127,16 @@ discard block |
||
127 | 127 | ); |
128 | 128 | |
129 | 129 | // Register the method to expose |
130 | -$server->register('WSEventsList', // method name |
|
130 | +$server->register('WSEventsList', // method name |
|
131 | 131 | array('username' => 'xsd:string', |
132 | 132 | 'signature' => 'xsd:string', |
133 | 133 | 'datestart' => 'xsd:int', |
134 | - 'dateend' => 'xsd:int'), // input parameters |
|
135 | - array('return' => 'xsd:Array'), // output parameters |
|
136 | - 'urn:WSUserInfo', // namespace |
|
137 | - 'urn:WSUserInfo#WSEventsList', // soapaction |
|
138 | - 'rpc', // style |
|
139 | - 'encoded', // use |
|
134 | + 'dateend' => 'xsd:int'), // input parameters |
|
135 | + array('return' => 'xsd:Array'), // output parameters |
|
136 | + 'urn:WSUserInfo', // namespace |
|
137 | + 'urn:WSUserInfo#WSEventsList', // soapaction |
|
138 | + 'rpc', // style |
|
139 | + 'encoded', // use |
|
140 | 140 | 'This service returns a list of events of the courses the given user is subscribed to' // documentation |
141 | 141 | ); |
142 | 142 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | |
172 | 172 | $user_id = UserManager::get_user_id_from_username($username); |
173 | 173 | if ($user_id === false) { return $events_list; } // Error in user id recovery. |
174 | - $ds = substr($datestart,0,4).'-'.substr($datestart,4,2).'-'.substr($datestart,6,2).' 00:00:00'; |
|
175 | - $de = substr($dateend,0,4).'-'.substr($dateend,4,2).'-'.substr($dateend,6,2).' 00:00:00'; |
|
174 | + $ds = substr($datestart, 0, 4).'-'.substr($datestart, 4, 2).'-'.substr($datestart, 6, 2).' 00:00:00'; |
|
175 | + $de = substr($dateend, 0, 4).'-'.substr($dateend, 4, 2).'-'.substr($dateend, 6, 2).' 00:00:00'; |
|
176 | 176 | $events_list = Agenda::get_personal_agenda_items_between_dates($user_id, $ds, $de); |
177 | 177 | return $events_list; |
178 | 178 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * Singleton method |
44 | 44 | */ |
45 | 45 | public static function singleton() { |
46 | - if(!isset(self::$_instance)) { |
|
46 | + if (!isset(self::$_instance)) { |
|
47 | 47 | self::$_instance = new soap_server(); |
48 | 48 | // Set the error handler |
49 | 49 | WSError::setErrorHandler(new WSSoapErrorHandler()); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | '', |
89 | 89 | 'SOAP-ENC:Array', |
90 | 90 | array(), |
91 | - array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:extras[]')),'tns:extras' |
|
91 | + array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:extras[]')), 'tns:extras' |
|
92 | 92 | ); |
93 | 93 | |
94 | 94 | /* |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | $script = isset($_POST['script']) ? $_POST['script'] : false; |
16 | 16 | $function = isset($_POST['function']) ? $_POST['function'] : false; |
17 | 17 | |
18 | -$contact= $server.$script.'?wsdl'; |
|
18 | +$contact = $server.$script.'?wsdl'; |
|
19 | 19 | |
20 | 20 | $client = new nusoap_client($contact); |
21 | 21 | $err = $client->getError(); |
22 | 22 | if ($err) { |
23 | 23 | // Display the error |
24 | - echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; |
|
24 | + echo '<h2>Constructor error</h2><pre>'.$err.'</pre>'; |
|
25 | 25 | // At this point, you know the call that follows will fail |
26 | 26 | } |
27 | 27 | $response = array(); |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | $list = scandir($serversys); |
38 | 38 | $scripts = array(); |
39 | 39 | foreach ($list as $item) { |
40 | - if (substr($item,0,1) == '.') { continue; } |
|
41 | - if (substr($item,-8)=='soap.php') { |
|
40 | + if (substr($item, 0, 1) == '.') { continue; } |
|
41 | + if (substr($item, -8) == 'soap.php') { |
|
42 | 42 | $scripts[] = $item; |
43 | 43 | } |
44 | 44 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | ?> |
56 | 56 | </select><br /> |
57 | 57 | <label for="function">Function</label> |
58 | -<input type="text" name="function" value="<?php echo $function;?>"></input><br /> |
|
58 | +<input type="text" name="function" value="<?php echo $function; ?>"></input><br /> |
|
59 | 59 | <label for="param[0]">Param 0</label> |
60 | 60 | <input type="text" name="param[0]" ></input><br /> |
61 | 61 | <input type="submit" name="submit" value="Send"/> |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | 'all', |
29 | 29 | '', |
30 | 30 | array( |
31 | - 'name'=>'code' , 'type'=>'xsd:string', |
|
32 | - 'name'=>'title' , 'type'=>'xsd:string', |
|
33 | - 'name'=>'url' , 'type'=>'xsd:string', |
|
31 | + 'name'=>'code', 'type'=>'xsd:string', |
|
32 | + 'name'=>'title', 'type'=>'xsd:string', |
|
33 | + 'name'=>'url', 'type'=>'xsd:string', |
|
34 | 34 | 'name'=>'teacher', 'type'=>'xsd:string', |
35 | - 'name'=>'language','type'=>'xsd:string', |
|
35 | + 'name'=>'language', 'type'=>'xsd:string', |
|
36 | 36 | ) |
37 | 37 | ); |
38 | 38 | |
@@ -51,15 +51,15 @@ discard block |
||
51 | 51 | ); |
52 | 52 | |
53 | 53 | // Register the method to expose |
54 | -$server->register('WSCourseList', // method name |
|
54 | +$server->register('WSCourseList', // method name |
|
55 | 55 | array('username' => 'xsd:string', |
56 | 56 | 'signature' => 'xsd:string', |
57 | - 'visibilities' => 'xsd:string'), // input parameters |
|
58 | - array('return' => 'xsd:Array'), // output parameters |
|
59 | - 'urn:WSCourseList', // namespace |
|
60 | - 'urn:WSCourseList#WSCourseList', // soapaction |
|
61 | - 'rpc', // style |
|
62 | - 'encoded', // use |
|
57 | + 'visibilities' => 'xsd:string'), // input parameters |
|
58 | + array('return' => 'xsd:Array'), // output parameters |
|
59 | + 'urn:WSCourseList', // namespace |
|
60 | + 'urn:WSCourseList#WSCourseList', // soapaction |
|
61 | + 'rpc', // style |
|
62 | + 'encoded', // use |
|
63 | 63 | 'This service returns a list of courses' // documentation |
64 | 64 | ); |
65 | 65 |