Passed
Push — 1.10.x ( c7173a...70ce77 )
by
unknown
57:17
created
main/webservices/registration.soap.php 1 patch
Spacing   +455 added lines, -455 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     }
81 81
 
82 82
     if ($debug) {
83
-        error_log("checkip " . intval($check_ip));
83
+        error_log("checkip ".intval($check_ip));
84 84
     }
85 85
 
86 86
     if ($check_ip) {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     '',
139 139
     'SOAP-ENC:Array',
140 140
     array(),
141
-    array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:extras[]')),
141
+    array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:extras[]')),
142 142
     'tns:extras'
143 143
 );
144 144
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     '',
172 172
     'SOAP-ENC:Array',
173 173
     array(),
174
-    array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:usersParams[]')),
174
+    array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:usersParams[]')),
175 175
     'tns:usersParams'
176 176
 );
177 177
 
@@ -210,17 +210,17 @@  discard block
 block discarded – undo
210 210
     '',
211 211
     'SOAP-ENC:Array',
212 212
     array(),
213
-    array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:result_createUsers[]')),'tns:result_createUsers'
213
+    array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:result_createUsers[]')), 'tns:result_createUsers'
214 214
 );
215 215
 
216 216
 // Register the method to expose
217
-$server->register('WSCreateUsers',                 // method name
218
-    array('createUsers' => 'tns:createUsers'),     // input parameters
219
-    array('return' => 'tns:results_createUsers'),  // output parameters
220
-    'urn:WSRegistration',                          // namespace
221
-    'urn:WSRegistration#WSCreateUsers',            // soapaction
222
-    'rpc',                                         // style
223
-    'encoded',                                     // use
217
+$server->register('WSCreateUsers', // method name
218
+    array('createUsers' => 'tns:createUsers'), // input parameters
219
+    array('return' => 'tns:results_createUsers'), // output parameters
220
+    'urn:WSRegistration', // namespace
221
+    'urn:WSRegistration#WSCreateUsers', // soapaction
222
+    'rpc', // style
223
+    'encoded', // use
224 224
     'This service adds a user'                     // documentation
225 225
 );
226 226
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
             continue;
402 402
         }
403 403
 
404
-        $results[] =  $userId;
404
+        $results[] = $userId;
405 405
 
406 406
     } // end principal foreach
407 407
 
@@ -447,13 +447,13 @@  discard block
 block discarded – undo
447 447
 
448 448
 
449 449
 // Register the method to expose
450
-$server->register('WSCreateUser',                // method name
451
-    array('createUser' => 'tns:createUser'),     // input parameters
452
-    array('return' => 'xsd:string'),             // output parameters
453
-    'urn:WSRegistration',                        // namespace
454
-    'urn:WSRegistration#WSCreateUser',           // soapaction
455
-    'rpc',                                       // style
456
-    'encoded',                                   // use
450
+$server->register('WSCreateUser', // method name
451
+    array('createUser' => 'tns:createUser'), // input parameters
452
+    array('return' => 'xsd:string'), // output parameters
453
+    'urn:WSRegistration', // namespace
454
+    'urn:WSRegistration#WSCreateUser', // soapaction
455
+    'rpc', // style
456
+    'encoded', // use
457 457
     'This service adds a user'                   // documentation
458 458
 );
459 459
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
     }
559 559
 
560 560
     if (isset($original_user_id_name) && isset($original_user_id_value)) {
561
-        $_SESSION['ws_' . $original_user_id_name] = $original_user_id_value;
561
+        $_SESSION['ws_'.$original_user_id_name] = $original_user_id_value;
562 562
     }
563 563
 
564 564
     /** @var User $user */
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
         );
607 607
 
608 608
         if (isset($original_user_id_name) && isset($original_user_id_value)) {
609
-            unset($_SESSION['ws_' . $original_user_id_name]);
609
+            unset($_SESSION['ws_'.$original_user_id_name]);
610 610
         }
611 611
 
612 612
         if (is_array($extra_list) && count($extra_list) > 0) {
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
         'language'              => array('name' => 'language', 'type' => 'xsd:string'),
659 659
         'phone'                 => array('name' => 'phone', 'type' => 'xsd:string'),
660 660
         'expiration_date'       => array('name' => 'expiration_date', 'type' => 'xsd:string'),
661
-        'official_code'         => array('name' => 'official_code',    'type' => 'xsd:string'),
661
+        'official_code'         => array('name' => 'official_code', 'type' => 'xsd:string'),
662 662
         'original_user_id_name' => array('name' => 'original_user_id_name', 'type' => 'xsd:string'),
663 663
         'original_user_id_value'=> array('name' => 'original_user_id_value', 'type' => 'xsd:string'),
664 664
         'extra'                 => array('name' => 'extra', 'type' => 'tns:extrasList')
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
     'all',
687 687
     '',
688 688
     array(
689
-        'users'         => array('name' => 'users',      'type' => 'tns:createUsersPassEncryptParamsList'),
689
+        'users'         => array('name' => 'users', 'type' => 'tns:createUsersPassEncryptParamsList'),
690 690
         'secret_key'    => array('name' => 'secret_key', 'type' => 'xsd:string')
691 691
     )
692 692
 );
@@ -716,13 +716,13 @@  discard block
 block discarded – undo
716 716
 );
717 717
 
718 718
 // Register the method to expose
719
-$server->register('WSCreateUsersPasswordCrypted',                            // method name
719
+$server->register('WSCreateUsersPasswordCrypted', // method name
720 720
     array('createUsersPasswordCrypted' => 'tns:createUsersPasswordCrypted'), // input parameters
721
-    array('return' => 'tns:results_createUsersPassEncrypt'),                 // output parameters
722
-    'urn:WSRegistration',                                                    // namespace
723
-    'urn:WSRegistration#WSCreateUsersPasswordCrypted',                       // soapaction
724
-    'rpc',                                                                   // style
725
-    'encoded',                                                               // use
721
+    array('return' => 'tns:results_createUsersPassEncrypt'), // output parameters
722
+    'urn:WSRegistration', // namespace
723
+    'urn:WSRegistration#WSCreateUsersPasswordCrypted', // soapaction
724
+    'rpc', // style
725
+    'encoded', // use
726 726
     'This service adds users to the system'                                  // documentation
727 727
 );
728 728
 
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
         $salt = '';
770 770
 
771 771
         if (!empty($_configuration['password_encryption'])) {
772
-            if ($_configuration['password_encryption'] === $encrypt_method ) {
772
+            if ($_configuration['password_encryption'] === $encrypt_method) {
773 773
                 if ($encrypt_method == 'md5' && !preg_match('/^[A-Fa-f0-9]{32}$/', $password)) {
774 774
                     $msg = "Encryption $encrypt_method is invalid";
775 775
                     $results[] = $msg;
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 
793 793
         if (is_array($extra_list) && count($extra_list) > 0) {
794 794
             foreach ($extra_list as $extra) {
795
-                if($extra['field_name'] == 'salt') {
795
+                if ($extra['field_name'] == 'salt') {
796 796
                     $salt = $extra['field_value'];
797 797
                     break;
798 798
                 }
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
                         active='1',
848 848
                         hr_dept_id=".intval($hr_dept_id);
849 849
 
850
-                $sql .=  " WHERE user_id='".$r_check_user[0]."'";
850
+                $sql .= " WHERE user_id='".$r_check_user[0]."'";
851 851
                 Database::query($sql);
852 852
 
853 853
                 if (is_array($extra_list) && count($extra_list) > 0) {
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
 
968 968
     $count_results = count($results);
969 969
     $output = array();
970
-    for($i = 0; $i < $count_results; $i++) {
970
+    for ($i = 0; $i < $count_results; $i++) {
971 971
         $output[] = array(
972 972
             'original_user_id_value' => $orig_user_id_value[$i],
973 973
             'result' => $results[$i],
@@ -986,9 +986,9 @@  discard block
 block discarded – undo
986 986
     'all',
987 987
     '',
988 988
     array(
989
-        'user_id' => array('name' => 'course',     'type' => 'xsd:string'), // Chamilo user Id
990
-        'session_id' => array('name' => 'user_id',    'type' => 'xsd:string'), // Current Session course ID
991
-        'course_id' =>array('name' => 'courseId',      'type' => 'xsd:string'), // Course Real Id
989
+        'user_id' => array('name' => 'course', 'type' => 'xsd:string'), // Chamilo user Id
990
+        'session_id' => array('name' => 'user_id', 'type' => 'xsd:string'), // Current Session course ID
991
+        'course_id' =>array('name' => 'courseId', 'type' => 'xsd:string'), // Course Real Id
992 992
         'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string'),
993 993
 
994 994
         // optional
@@ -1044,9 +1044,9 @@  discard block
 block discarded – undo
1044 1044
         );
1045 1045
     }
1046 1046
 
1047
-    if ($debug) error_log('$userId found: '. $userId);
1048
-    if ($debug) error_log('$courseId found: '. $courseId);
1049
-    if ($debug) error_log('$sessionId found: '. $sessionId);
1047
+    if ($debug) error_log('$userId found: '.$userId);
1048
+    if ($debug) error_log('$courseId found: '.$courseId);
1049
+    if ($debug) error_log('$sessionId found: '.$sessionId);
1050 1050
 
1051 1051
     return [
1052 1052
         'user_id' => $userId,
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
         return returnError(WS_ERROR_SECRET_KEY);
1083 1083
     }
1084 1084
 
1085
-    if ($debug) error_log('Params '. print_r($params, 1));
1085
+    if ($debug) error_log('Params '.print_r($params, 1));
1086 1086
 
1087 1087
     $params = parseCourseSessionUserParams($params);
1088 1088
 
@@ -1095,13 +1095,13 @@  discard block
 block discarded – undo
1095 1095
     $result = 0;
1096 1096
 
1097 1097
     if (!empty($coaches)) {
1098
-        if ($debug) error_log('Coaches:  '. print_r($coaches, 1));
1098
+        if ($debug) error_log('Coaches:  '.print_r($coaches, 1));
1099 1099
         if (in_array($userId, $coaches)) {
1100 1100
             $result = 1;
1101 1101
         }
1102 1102
     }
1103 1103
 
1104
-    if ($debug) error_log('Result:  '. $result);
1104
+    if ($debug) error_log('Result:  '.$result);
1105 1105
 
1106 1106
     return $result;
1107 1107
 }
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
         return returnError(WS_ERROR_SECRET_KEY);
1134 1134
     }
1135 1135
 
1136
-    if ($debug) error_log('Params '. print_r($params, 1));
1136
+    if ($debug) error_log('Params '.print_r($params, 1));
1137 1137
 
1138 1138
     $params = parseCourseSessionUserParams($params);
1139 1139
 
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
     $result = 0;
1148 1148
 
1149 1149
     if (!empty($coaches)) {
1150
-        if ($debug) error_log('Coaches:  ' . print_r($coaches, 1));
1150
+        if ($debug) error_log('Coaches:  '.print_r($coaches, 1));
1151 1151
         if (!in_array($userId, $coaches)) {
1152 1152
             $result = 1;
1153 1153
         }
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
         $result = 1;
1156 1156
     }
1157 1157
 
1158
-    if ($debug) error_log('Final Result: '. $result);
1158
+    if ($debug) error_log('Final Result: '.$result);
1159 1159
 
1160 1160
     return $result;
1161 1161
 }
@@ -1173,32 +1173,32 @@  discard block
 block discarded – undo
1173 1173
     'all',
1174 1174
     '',
1175 1175
     array(
1176
-        'firstname'                 => array('name' => 'firstname',                 'type' => 'xsd:string'),
1177
-        'lastname'                  => array('name' => 'lastname',                  'type' => 'xsd:string'),
1178
-        'status'                    => array('name' => 'status',                    'type' => 'xsd:string'),
1179
-        'email'                     => array('name' => 'email',                     'type' => 'xsd:string'),
1180
-        'loginname'                 => array('name' => 'loginname',                 'type' => 'xsd:string'),
1181
-        'password'                  => array('name' => 'password',                  'type' => 'xsd:string'), //encripted password using the encrypt_method
1182
-        'encrypt_method'            => array('name' => 'encrypt_method',            'type' => 'xsd:string'),
1183
-        'language'                  => array('name' => 'language',                  'type' => 'xsd:string'),
1184
-        'phone'                     => array('name' => 'phone',                     'type' => 'xsd:string'),
1185
-        'expiration_date'           => array('name' => 'expiration_date',           'type' => 'xsd:string'),
1186
-        'official_code'             => array('name' => 'official_code',             'type' => 'xsd:string'),
1187
-        'original_user_id_name'     => array('name' => 'original_user_id_name',     'type' => 'xsd:string'),
1188
-        'original_user_id_value'    => array('name' => 'original_user_id_value',    'type' => 'xsd:string'),
1189
-        'extra'                     => array('name' => 'extra',                     'type' => 'tns:extrasList'),
1190
-        'secret_key'                => array('name' => 'secret_key',                'type' => 'xsd:string')
1176
+        'firstname'                 => array('name' => 'firstname', 'type' => 'xsd:string'),
1177
+        'lastname'                  => array('name' => 'lastname', 'type' => 'xsd:string'),
1178
+        'status'                    => array('name' => 'status', 'type' => 'xsd:string'),
1179
+        'email'                     => array('name' => 'email', 'type' => 'xsd:string'),
1180
+        'loginname'                 => array('name' => 'loginname', 'type' => 'xsd:string'),
1181
+        'password'                  => array('name' => 'password', 'type' => 'xsd:string'), //encripted password using the encrypt_method
1182
+        'encrypt_method'            => array('name' => 'encrypt_method', 'type' => 'xsd:string'),
1183
+        'language'                  => array('name' => 'language', 'type' => 'xsd:string'),
1184
+        'phone'                     => array('name' => 'phone', 'type' => 'xsd:string'),
1185
+        'expiration_date'           => array('name' => 'expiration_date', 'type' => 'xsd:string'),
1186
+        'official_code'             => array('name' => 'official_code', 'type' => 'xsd:string'),
1187
+        'original_user_id_name'     => array('name' => 'original_user_id_name', 'type' => 'xsd:string'),
1188
+        'original_user_id_value'    => array('name' => 'original_user_id_value', 'type' => 'xsd:string'),
1189
+        'extra'                     => array('name' => 'extra', 'type' => 'tns:extrasList'),
1190
+        'secret_key'                => array('name' => 'secret_key', 'type' => 'xsd:string')
1191 1191
     )
1192 1192
 );
1193 1193
 
1194 1194
 // Register the method to expose
1195
-$server->register('WSCreateUserPasswordCrypted',                            // method name
1196
-    array('createUserPasswordCrypted' => 'tns:createUserPasswordCrypted'),  // input parameters
1197
-    array('return' => 'xsd:string'),                                        // output parameters
1198
-    'urn:WSRegistration',                                                   // namespace
1199
-    'urn:WSRegistration#WSCreateUserPasswordCrypted',                       // soapaction
1200
-    'rpc',                                                                  // style
1201
-    'encoded',                                                              // use
1195
+$server->register('WSCreateUserPasswordCrypted', // method name
1196
+    array('createUserPasswordCrypted' => 'tns:createUserPasswordCrypted'), // input parameters
1197
+    array('return' => 'xsd:string'), // output parameters
1198
+    'urn:WSRegistration', // namespace
1199
+    'urn:WSRegistration#WSCreateUserPasswordCrypted', // soapaction
1200
+    'rpc', // style
1201
+    'encoded', // use
1202 1202
     'This service adds users'                                               // documentation
1203 1203
 );
1204 1204
 
@@ -1208,7 +1208,7 @@  discard block
 block discarded – undo
1208 1208
     global $_user, $_configuration, $debug;
1209 1209
     $debug = 1;
1210 1210
     if ($debug) error_log('WSCreateUserPasswordCrypted');
1211
-    if ($debug) error_log(print_r($params,1));
1211
+    if ($debug) error_log(print_r($params, 1));
1212 1212
 
1213 1213
     if (!WSHelperVerifyKey($params)) {
1214 1214
         return returnError(WS_ERROR_SECRET_KEY);
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
     $extra_list = isset($params['extra']) ? $params['extra'] : '';
1242 1242
 
1243 1243
     if (!empty($_configuration['password_encryption'])) {
1244
-        if ($_configuration['password_encryption'] === $encrypt_method ) {
1244
+        if ($_configuration['password_encryption'] === $encrypt_method) {
1245 1245
             if ($encrypt_method == 'md5' && !preg_match('/^[A-Fa-f0-9]{32}$/', $password)) {
1246 1246
                 $msg = "Encryption $encrypt_method is invalid";
1247 1247
                 if ($debug) error_log($msg);
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
             if (!is_null($auth_source)) {
1304 1304
                 $sql .= " auth_source='".Database::escape_string($auth_source)."',";
1305 1305
             }
1306
-            $sql .=    "
1306
+            $sql .= "
1307 1307
                     password='".Database::escape_string($password)."',
1308 1308
                     email='".Database::escape_string($email)."',
1309 1309
                     status='".Database::escape_string($status)."',
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
                     expiration_date='".Database::escape_string($expiration_date)."',
1313 1313
                     active='1',
1314 1314
                     hr_dept_id=".intval($hr_dept_id);
1315
-            $sql .=    " WHERE user_id='".$r_check_user[0]."'";
1315
+            $sql .= " WHERE user_id='".$r_check_user[0]."'";
1316 1316
             if ($debug) error_log($sql);
1317 1317
             Database::query($sql);
1318 1318
 
@@ -1492,13 +1492,13 @@  discard block
 block discarded – undo
1492 1492
 );
1493 1493
 
1494 1494
 // Register the method to expose
1495
-$server->register('WSEditUserCredentials',                      // method name
1496
-    array('editUserCredentials' => 'tns:editUserCredentials'),  // input parameters
1497
-    array('return' => 'xsd:string'),                            // output parameters
1498
-    'urn:WSRegistration',                                       // namespace
1499
-    'urn:WSRegistration#WSEditUserCredentials',                 // soapaction
1500
-    'rpc',                                                      // style
1501
-    'encoded',                                                  // use
1495
+$server->register('WSEditUserCredentials', // method name
1496
+    array('editUserCredentials' => 'tns:editUserCredentials'), // input parameters
1497
+    array('return' => 'xsd:string'), // output parameters
1498
+    'urn:WSRegistration', // namespace
1499
+    'urn:WSRegistration#WSEditUserCredentials', // soapaction
1500
+    'rpc', // style
1501
+    'encoded', // use
1502 1502
     'This service edits the username and password of a user'    // documentation
1503 1503
 );
1504 1504
 
@@ -1597,13 +1597,13 @@  discard block
 block discarded – undo
1597 1597
 );
1598 1598
 
1599 1599
 // Register the method to expose
1600
-$server->register('WSEditUsers',                // method name
1601
-    array('editUsers' => 'tns:editUsers'),      // input parameters
1600
+$server->register('WSEditUsers', // method name
1601
+    array('editUsers' => 'tns:editUsers'), // input parameters
1602 1602
     array('return' => 'tns:results_editUsers'), // output parameters
1603
-    'urn:WSRegistration',                       // namespace
1604
-    'urn:WSRegistration#WSEditUsers',           // soapaction
1605
-    'rpc',                                      // style
1606
-    'encoded',                                  // use
1603
+    'urn:WSRegistration', // namespace
1604
+    'urn:WSRegistration#WSEditUsers', // soapaction
1605
+    'rpc', // style
1606
+    'encoded', // use
1607 1607
     'This service edits a user from wiener'     // documentation
1608 1608
 );
1609 1609
 
@@ -1795,13 +1795,13 @@  discard block
 block discarded – undo
1795 1795
 );
1796 1796
 
1797 1797
 // Register the method to expose
1798
-$server->register('WSEditUser',              // method name
1799
-    array('editUser' => 'tns:editUser'),     // input parameters
1800
-    array('return' => 'xsd:string'),         // output parameters
1801
-    'urn:WSRegistration',                    // namespace
1802
-    'urn:WSRegistration#WSEditUser',         // soapaction
1803
-    'rpc',                                   // style
1804
-    'encoded',                               // use
1798
+$server->register('WSEditUser', // method name
1799
+    array('editUser' => 'tns:editUser'), // input parameters
1800
+    array('return' => 'xsd:string'), // output parameters
1801
+    'urn:WSRegistration', // namespace
1802
+    'urn:WSRegistration#WSEditUser', // soapaction
1803
+    'rpc', // style
1804
+    'encoded', // use
1805 1805
     'This service edits a user from wiener'  // documentation
1806 1806
 );
1807 1807
 
@@ -1972,13 +1972,13 @@  discard block
 block discarded – undo
1972 1972
 );
1973 1973
 
1974 1974
 // Register the method to expose
1975
-$server->register('WSEditUserWithPicture',              // method name
1976
-    array('editUserWithPicture' => 'tns:editUserWithPicture'),     // input parameters
1977
-    array('return' => 'xsd:string'),                    // output parameters
1978
-    'urn:WSRegistration',                               // namespace
1979
-    'urn:WSRegistration#WSEditUserWithPicture',         // soapaction
1980
-    'rpc',                                              // style
1981
-    'encoded',                                          // use
1975
+$server->register('WSEditUserWithPicture', // method name
1976
+    array('editUserWithPicture' => 'tns:editUserWithPicture'), // input parameters
1977
+    array('return' => 'xsd:string'), // output parameters
1978
+    'urn:WSRegistration', // namespace
1979
+    'urn:WSRegistration#WSEditUserWithPicture', // soapaction
1980
+    'rpc', // style
1981
+    'encoded', // use
1982 1982
     'This service edits a user from wiener'             // documentation
1983 1983
 );
1984 1984
 
@@ -2036,8 +2036,8 @@  discard block
 block discarded – undo
2036 2036
     $tempDir = api_get_path(SYS_ARCHIVE_PATH);
2037 2037
     // Make sure the file download was OK by checking the HTTP headers for OK
2038 2038
     if (strpos(get_headers($picture_url)[0], "OK")) {
2039
-        file_put_contents($tempDir . $filename, file_get_contents($picture_url));
2040
-        $pictureUri = UserManager::update_user_picture($user_id, $filename, $tempDir . $filename);
2039
+        file_put_contents($tempDir.$filename, file_get_contents($picture_url));
2040
+        $pictureUri = UserManager::update_user_picture($user_id, $filename, $tempDir.$filename);
2041 2041
     }
2042 2042
 
2043 2043
     if ($user_id == 0) {
@@ -2108,7 +2108,7 @@  discard block
 block discarded – undo
2108 2108
         ->setExpirationDate($expiration_date)
2109 2109
         ->setHrDeptId($hr_dept_id)
2110 2110
         ->setActive(true)
2111
-        ->setPictureUri($pictureUri);;
2111
+        ->setPictureUri($pictureUri); ;
2112 2112
 
2113 2113
     if (!is_null($creator_id)) {
2114 2114
         $user->setCreatorId($creator_id);
@@ -2205,13 +2205,13 @@  discard block
 block discarded – undo
2205 2205
 );
2206 2206
 
2207 2207
 // Register the method to expose
2208
-$server->register('WSEditUsersPasswordCrypted',                           // method name
2209
-    array('editUsersPasswordCrypted' => 'tns:editUsersPasswordCrypted'),  // input parameters
2210
-    array('return' => 'tns:results_editUsersPasswordCrypted'),            // output parameters
2211
-    'urn:WSRegistration',                                                 // namespace
2212
-    'urn:WSRegistration#WSEditUsersPasswordCrypted',                      // soapaction
2213
-    'rpc',                                                                // style
2214
-    'encoded',                                                            // use
2208
+$server->register('WSEditUsersPasswordCrypted', // method name
2209
+    array('editUsersPasswordCrypted' => 'tns:editUsersPasswordCrypted'), // input parameters
2210
+    array('return' => 'tns:results_editUsersPasswordCrypted'), // output parameters
2211
+    'urn:WSRegistration', // namespace
2212
+    'urn:WSRegistration#WSEditUsersPasswordCrypted', // soapaction
2213
+    'rpc', // style
2214
+    'encoded', // use
2215 2215
     'This service edits a user'                                           // documentation
2216 2216
 );
2217 2217
 
@@ -2219,7 +2219,7 @@  discard block
 block discarded – undo
2219 2219
 function WSEditUsersPasswordCrypted($params) {
2220 2220
     global $_configuration;
2221 2221
 
2222
-    if(!WSHelperVerifyKey($params)) {
2222
+    if (!WSHelperVerifyKey($params)) {
2223 2223
         return returnError(WS_ERROR_SECRET_KEY);
2224 2224
     }
2225 2225
 
@@ -2256,7 +2256,7 @@  discard block
 block discarded – undo
2256 2256
 
2257 2257
             $password = $user_param['password'];
2258 2258
             $encrypt_method = $user_param['encrypt_method'];
2259
-            if ($_configuration['password_encryption'] === $encrypt_method ) {
2259
+            if ($_configuration['password_encryption'] === $encrypt_method) {
2260 2260
                 if ($encrypt_method == 'md5' && !preg_match('/^[A-Fa-f0-9]{32}$/', $password)) {
2261 2261
                     $msg = "Encryption $encrypt_method is invalid";
2262 2262
                     $results[] = $msg;
@@ -2271,11 +2271,11 @@  discard block
 block discarded – undo
2271 2271
                 $results[] = $msg;
2272 2272
                 continue;
2273 2273
             }
2274
-        } elseif (!empty($user_param['password']) && empty($user_param['encrypt_method'])){
2274
+        } elseif (!empty($user_param['password']) && empty($user_param['encrypt_method'])) {
2275 2275
             $msg = "If password is not empty the encrypt_method param is required ";
2276 2276
             $results[] = $msg;
2277 2277
             continue;
2278
-        } elseif (empty($user_param['password']) && !empty($user_param['encrypt_method'])){
2278
+        } elseif (empty($user_param['password']) && !empty($user_param['encrypt_method'])) {
2279 2279
             $msg = "If encrypt_method is not empty the password param is required ";
2280 2280
             $results[] = $msg;
2281 2281
             continue;
@@ -2411,13 +2411,13 @@  discard block
 block discarded – undo
2411 2411
 );
2412 2412
 
2413 2413
 // Register the method to expose
2414
-$server->register('WSEditUserPasswordCrypted',                         // method name
2414
+$server->register('WSEditUserPasswordCrypted', // method name
2415 2415
     array('editUserPasswordCrypted' => 'tns:editUserPasswordCrypted'), // input parameters
2416
-    array('return' => 'xsd:string'),                                   // output parameters
2417
-    'urn:WSRegistration',                                              // namespace
2418
-    'urn:WSRegistration#WSEditUserPasswordCrypted',                    // soapaction
2419
-    'rpc',                                                             // style
2420
-    'encoded',                                                         // use
2416
+    array('return' => 'xsd:string'), // output parameters
2417
+    'urn:WSRegistration', // namespace
2418
+    'urn:WSRegistration#WSEditUserPasswordCrypted', // soapaction
2419
+    'rpc', // style
2420
+    'encoded', // use
2421 2421
     'This service edits a user'                                        // documentation
2422 2422
 );
2423 2423
 
@@ -2461,7 +2461,7 @@  discard block
 block discarded – undo
2461 2461
     if (!empty($params['password']) && !empty($params['encrypt_method'])) {
2462 2462
         $password = $params['password'];
2463 2463
         $encrypt_method = $params['encrypt_method'];
2464
-        if ($_configuration['password_encryption'] === $encrypt_method ) {
2464
+        if ($_configuration['password_encryption'] === $encrypt_method) {
2465 2465
             if ($encrypt_method == 'md5' && !preg_match('/^[A-Fa-f0-9]{32}$/', $password)) {
2466 2466
                 $msg = "Encryption $encrypt_method is invalid";
2467 2467
                 return $msg;
@@ -2602,7 +2602,7 @@  discard block
 block discarded – undo
2602 2602
     '',
2603 2603
     'SOAP-ENC:Array',
2604 2604
     array(),
2605
-    array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:user_id[]')),'tns:user_id'
2605
+    array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:user_id[]')), 'tns:user_id'
2606 2606
 );
2607 2607
 
2608 2608
 $server->wsdl->addComplexType(
@@ -2618,35 +2618,35 @@  discard block
 block discarded – undo
2618 2618
 );
2619 2619
 
2620 2620
 function WSHelperActionOnUsers($params, $type) {
2621
-    if(!WSHelperVerifyKey($params)) {
2621
+    if (!WSHelperVerifyKey($params)) {
2622 2622
         return returnError(WS_ERROR_SECRET_KEY);
2623 2623
     }
2624 2624
 
2625 2625
     $original_user_ids = $params['ids'];
2626
-    foreach($original_user_ids as $original_user_id) {
2626
+    foreach ($original_user_ids as $original_user_id) {
2627 2627
         $user_id = UserManager::get_user_id_from_original_id(
2628 2628
             $original_user_id['original_user_id_value'],
2629 2629
             $original_user_id['original_user_id_name']
2630 2630
         );
2631
-        if($user_id > 0) {
2632
-            if($type == "delete") {
2631
+        if ($user_id > 0) {
2632
+            if ($type == "delete") {
2633 2633
                 UserManager::delete_user($user_id);
2634
-            } else if($type == "disable") {
2634
+            } else if ($type == "disable") {
2635 2635
                 UserManager::disable($user_id);
2636
-            } else if($type == "enable") {
2636
+            } else if ($type == "enable") {
2637 2637
                 UserManager::enable($user_id);
2638 2638
             }
2639 2639
         }
2640 2640
     }
2641 2641
 }
2642 2642
 
2643
-$server->register('WSDeleteUsers',                         // method name
2644
-    array('user_ids' => 'tns:user_ids'),                   // input parameters
2645
-    array(),                                               // output parameters
2646
-    'urn:WSRegistration',                                  // namespace
2647
-    'urn:WSRegistration#WSDeleteUsers',                    // soapaction
2648
-    'rpc',                                                 // style
2649
-    'encoded',                                             // use
2643
+$server->register('WSDeleteUsers', // method name
2644
+    array('user_ids' => 'tns:user_ids'), // input parameters
2645
+    array(), // output parameters
2646
+    'urn:WSRegistration', // namespace
2647
+    'urn:WSRegistration#WSDeleteUsers', // soapaction
2648
+    'rpc', // style
2649
+    'encoded', // use
2650 2650
     'Deletes users provided as parameters from the system' // documentation
2651 2651
 );
2652 2652
 
@@ -2655,13 +2655,13 @@  discard block
 block discarded – undo
2655 2655
 }
2656 2656
 
2657 2657
 /** WSDisableUsers **/
2658
-$server->register('WSDisableUsers',                         // method name
2659
-    array('user_ids' => 'tns:user_ids'),                    // input parameters
2660
-    array(),                                                // output parameters
2661
-    'urn:WSRegistration',                                   // namespace
2662
-    'urn:WSRegistration#WSDisableUsers',                    // soapaction
2663
-    'rpc',                                                  // style
2664
-    'encoded',                                              // use
2658
+$server->register('WSDisableUsers', // method name
2659
+    array('user_ids' => 'tns:user_ids'), // input parameters
2660
+    array(), // output parameters
2661
+    'urn:WSRegistration', // namespace
2662
+    'urn:WSRegistration#WSDisableUsers', // soapaction
2663
+    'rpc', // style
2664
+    'encoded', // use
2665 2665
     'Disables users provided as parameters from the system' // documentation
2666 2666
 );
2667 2667
 
@@ -2670,13 +2670,13 @@  discard block
 block discarded – undo
2670 2670
 }
2671 2671
 
2672 2672
 /** WSEnableUsers **/
2673
-$server->register('WSEnableUsers',            // method name
2674
-    array('user_ids' => 'tns:user_ids'),      // input parameters
2675
-    array(),                                  // output parameters
2676
-    'urn:WSRegistration',                     // namespace
2677
-    'urn:WSRegistration#WSEnableUsers',       // soapaction
2678
-    'rpc',                                    // style
2679
-    'encoded',                                // use
2673
+$server->register('WSEnableUsers', // method name
2674
+    array('user_ids' => 'tns:user_ids'), // input parameters
2675
+    array(), // output parameters
2676
+    'urn:WSRegistration', // namespace
2677
+    'urn:WSRegistration#WSEnableUsers', // soapaction
2678
+    'rpc', // style
2679
+    'encoded', // use
2680 2680
     'Enables users provided as parameters'    // documentation
2681 2681
 );
2682 2682
 
@@ -2726,7 +2726,7 @@  discard block
 block discarded – undo
2726 2726
     '',
2727 2727
     'SOAP-ENC:Array',
2728 2728
     array(),
2729
-    array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:createCourseParams[]')),'tns:createCourseParams'
2729
+    array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:createCourseParams[]')), 'tns:createCourseParams'
2730 2730
 );
2731 2731
 
2732 2732
 // Register the data structures used by the service
@@ -2767,13 +2767,13 @@  discard block
 block discarded – undo
2767 2767
 );
2768 2768
 
2769 2769
 // Register the method to expose
2770
-$server->register('WSCreateCourse',                // method name
2771
-    array('createCourse' => 'tns:createCourse'),   // input parameters
2770
+$server->register('WSCreateCourse', // method name
2771
+    array('createCourse' => 'tns:createCourse'), // input parameters
2772 2772
     array('return' => 'tns:results_createCourse'), // output parameters
2773
-    'urn:WSRegistration',                          // namespace
2774
-    'urn:WSRegistration#WSCreateCourse',           // soapaction
2775
-    'rpc',                                         // style
2776
-    'encoded',                                     // use
2773
+    'urn:WSRegistration', // namespace
2774
+    'urn:WSRegistration#WSCreateCourse', // soapaction
2775
+    'rpc', // style
2776
+    'encoded', // use
2777 2777
     'This service adds a course'                   // documentation
2778 2778
 );
2779 2779
 
@@ -2829,7 +2829,7 @@  discard block
 block discarded – undo
2829 2829
                             category_code='".Database::escape_string($category_code)."',
2830 2830
                             tutor_name='".Database::escape_string($tutor_name)."',
2831 2831
                             visual_code='".Database::escape_string($wanted_code)."'";
2832
-                if($visibility !== null) {
2832
+                if ($visibility !== null) {
2833 2833
                     $sql .= ", visibility = '$visibility' ";
2834 2834
                 }
2835 2835
                 $sql .= " WHERE id='".$courseInfo['real_id']."'";
@@ -2879,7 +2879,7 @@  discard block
 block discarded – undo
2879 2879
         $params['title'] = $title;
2880 2880
         $params['wanted_code'] = $wanted_code;
2881 2881
         $params['category_code'] = $category_code;
2882
-        $params['course_category']    = $category_code;
2882
+        $params['course_category'] = $category_code;
2883 2883
         $params['tutor_name'] = $tutor_name;
2884 2884
         $params['course_language'] = $course_language;
2885 2885
         $params['user_id'] = api_get_user_id();
@@ -3010,13 +3010,13 @@  discard block
 block discarded – undo
3010 3010
 
3011 3011
 
3012 3012
 // Register the method to expose
3013
-$server->register('WSCreateCourseByTitle',                     // method name
3013
+$server->register('WSCreateCourseByTitle', // method name
3014 3014
     array('createCourseByTitle' => 'tns:createCourseByTitle'), // input parameters
3015
-    array('return' => 'tns:results_createCourseByTitle'),      // output parameters
3016
-    'urn:WSRegistration',                                      // namespace
3017
-    'urn:WSRegistration#WSCreateCourseByTitle',                // soapaction
3018
-    'rpc',                                                     // style
3019
-    'encoded',                                                 // use
3015
+    array('return' => 'tns:results_createCourseByTitle'), // output parameters
3016
+    'urn:WSRegistration', // namespace
3017
+    'urn:WSRegistration#WSCreateCourseByTitle', // soapaction
3018
+    'rpc', // style
3019
+    'encoded', // use
3020 3020
     'This service adds a course by title'                      // documentation
3021 3021
 );
3022 3022
 
@@ -3247,18 +3247,18 @@  discard block
 block discarded – undo
3247 3247
 );
3248 3248
 
3249 3249
 // Register the method to expose
3250
-$server->register('WSEditCourse',                // method name
3251
-    array('editCourse' => 'tns:editCourse'),     // input parameters
3250
+$server->register('WSEditCourse', // method name
3251
+    array('editCourse' => 'tns:editCourse'), // input parameters
3252 3252
     array('return' => 'tns:results_editCourse'), // output parameters
3253
-    'urn:WSRegistration',                        // namespace
3254
-    'urn:WSRegistration#WSEditCourse',           // soapaction
3255
-    'rpc',                                       // style
3256
-    'encoded',                                   // use
3253
+    'urn:WSRegistration', // namespace
3254
+    'urn:WSRegistration#WSEditCourse', // soapaction
3255
+    'rpc', // style
3256
+    'encoded', // use
3257 3257
     'This service edits a course'                // documentation
3258 3258
 );
3259 3259
 
3260 3260
 // Define the method WSEditCourse
3261
-function WSEditCourse($params){
3261
+function WSEditCourse($params) {
3262 3262
 
3263 3263
     global $_configuration;
3264 3264
     if (!WSHelperVerifyKey($params)) {
@@ -3413,13 +3413,13 @@  discard block
 block discarded – undo
3413 3413
 
3414 3414
 
3415 3415
 // Register the method to expose
3416
-$server->register('WSCourseDescription',                    // method name
3417
-    array('courseDescription' => 'tns:courseDescription'),  // input parameters
3418
-    array('return' => 'tns:fields_course_desc_list'),       // output parameters
3419
-    'urn:WSRegistration',                                   // namespace
3420
-    'urn:WSRegistration#WSCourseDescription',               // soapaction
3421
-    'rpc',                                                  // style
3422
-    'encoded',                                              // use
3416
+$server->register('WSCourseDescription', // method name
3417
+    array('courseDescription' => 'tns:courseDescription'), // input parameters
3418
+    array('return' => 'tns:fields_course_desc_list'), // output parameters
3419
+    'urn:WSRegistration', // namespace
3420
+    'urn:WSRegistration#WSCourseDescription', // soapaction
3421
+    'rpc', // style
3422
+    'encoded', // use
3423 3423
     'This service edits a course description'               // documentation
3424 3424
 );
3425 3425
 
@@ -3472,14 +3472,14 @@  discard block
 block discarded – undo
3472 3472
     }
3473 3473
 
3474 3474
     while ($row = Database::fetch_array($result)) {
3475
-        $ind = (int)$row['id'];
3475
+        $ind = (int) $row['id'];
3476 3476
         $array_course_desc_title[$ind] = $row['title'];
3477 3477
         $array_course_desc_content[$ind] = $row['content'];
3478 3478
     }
3479 3479
 
3480 3480
     $count_results = count($default_titles);
3481 3481
     $output = array();
3482
-    for($i = 1; $i <= $count_results; $i++) {
3482
+    for ($i = 1; $i <= $count_results; $i++) {
3483 3483
         $output[] = array(
3484 3484
             'course_desc_id' => $array_course_desc_id[$i],
3485 3485
             'course_desc_default_title' => $array_course_desc_default_title[$i],
@@ -3559,13 +3559,13 @@  discard block
 block discarded – undo
3559 3559
 
3560 3560
 
3561 3561
 // Register the method to expose
3562
-$server->register('WSEditCourseDescription',                       // method name
3562
+$server->register('WSEditCourseDescription', // method name
3563 3563
     array('editCourseDescription' => 'tns:editCourseDescription'), // input parameters
3564
-    array('return' => 'tns:results_editCourseDescription'),        // output parameters
3565
-    'urn:WSRegistration',                                          // namespace
3566
-    'urn:WSRegistration#WSEditCourseDescription',                  // soapaction
3567
-    'rpc',                                                         // style
3568
-    'encoded',                                                     // use
3564
+    array('return' => 'tns:results_editCourseDescription'), // output parameters
3565
+    'urn:WSRegistration', // namespace
3566
+    'urn:WSRegistration#WSEditCourseDescription', // soapaction
3567
+    'rpc', // style
3568
+    'encoded', // use
3569 3569
     'This service edits a course description'                      // documentation
3570 3570
 );
3571 3571
 
@@ -3609,7 +3609,7 @@  discard block
 block discarded – undo
3609 3609
         $course_desc_title = Database::escape_string($course_desc_title);
3610 3610
         $course_desc_content = Database::escape_string($course_desc_content);
3611 3611
 
3612
-        $course_desc_id = (int)$course_desc_id;
3612
+        $course_desc_id = (int) $course_desc_id;
3613 3613
         if ($course_desc_id > 8 && $course_desc_id < 1) {
3614 3614
             $results[] = 0; // course_desc_id invalid.
3615 3615
             continue;
@@ -3643,7 +3643,7 @@  discard block
 block discarded – undo
3643 3643
 
3644 3644
     $count_results = count($results);
3645 3645
     $output = array();
3646
-    for($i = 0; $i < $count_results; $i++) {
3646
+    for ($i = 0; $i < $count_results; $i++) {
3647 3647
         $output[] = array(
3648 3648
             'original_course_id_value' => $orig_course_id_value[$i],
3649 3649
             'result' => $results[$i],
@@ -3715,13 +3715,13 @@  discard block
 block discarded – undo
3715 3715
     'tns:result_deleteCourse'
3716 3716
 );
3717 3717
 
3718
-$server->register('WSDeleteCourse',                // method name
3719
-    array('deleteCourse' => 'tns:deleteCourse'),   // input parameters
3718
+$server->register('WSDeleteCourse', // method name
3719
+    array('deleteCourse' => 'tns:deleteCourse'), // input parameters
3720 3720
     array('return' => 'tns:results_deleteCourse'), // output parameters
3721
-    'urn:WSRegistration',                          // namespace
3722
-    'urn:WSRegistration#WSDeleteCourse',           // soapaction
3723
-    'rpc',                                         // style
3724
-    'encoded',                                     // use
3721
+    'urn:WSRegistration', // namespace
3722
+    'urn:WSRegistration#WSDeleteCourse', // soapaction
3723
+    'rpc', // style
3724
+    'encoded', // use
3725 3725
     'This service deletes a course '               // documentation
3726 3726
 );
3727 3727
 
@@ -3847,13 +3847,13 @@  discard block
 block discarded – undo
3847 3847
 );
3848 3848
 
3849 3849
 // Register the method to expose
3850
-$server->register('WSCreateSession',                // method name
3851
-    array('createSession' => 'tns:createSession'),  // input parameters
3850
+$server->register('WSCreateSession', // method name
3851
+    array('createSession' => 'tns:createSession'), // input parameters
3852 3852
     array('return' => 'tns:results_createSession'), // output parameters
3853
-    'urn:WSRegistration',                           // namespace
3854
-    'urn:WSRegistration#WSCreateSession',           // soapaction
3855
-    'rpc',                                          // style
3856
-    'encoded',                                      // use
3853
+    'urn:WSRegistration', // namespace
3854
+    'urn:WSRegistration#WSCreateSession', // soapaction
3855
+    'rpc', // style
3856
+    'encoded', // use
3857 3857
     'This service edits a session'                  // documentation
3858 3858
 );
3859 3859
 
@@ -3907,8 +3907,8 @@  discard block
 block discarded – undo
3907 3907
         }
3908 3908
 
3909 3909
         if (empty($nolimit)) {
3910
-            $date_start = "$year_start-".(($month_start < 10)?"0$month_start":$month_start)."-".(($day_start < 10)?"0$day_start":$day_start) . ' 00:00:00';
3911
-            $date_end = "$year_end-".(($month_end < 10)?"0$month_end":$month_end)."-".(($day_end < 10)?"0$day_end":$day_end) . ' 23:59:59';
3910
+            $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start).' 00:00:00';
3911
+            $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end).' 23:59:59';
3912 3912
         } else {
3913 3913
             $date_start = "";
3914 3914
             $date_end = "";
@@ -3926,7 +3926,7 @@  discard block
 block discarded – undo
3926 3926
             }
3927 3927
             $results[] = 0;
3928 3928
             continue;
3929
-        } elseif (empty($nolimit) && (!$month_end || !$day_end || !$year_end || !checkdate($month_end,  $day_end, $year_end))) {
3929
+        } elseif (empty($nolimit) && (!$month_end || !$day_end || !$year_end || !checkdate($month_end, $day_end, $year_end))) {
3930 3930
             $results[] = 0;
3931 3931
             if ($debug) {
3932 3932
                 error_log("There's an error with the end date: $month_end - $day_end - $year_end");
@@ -4029,7 +4029,7 @@  discard block
 block discarded – undo
4029 4029
 
4030 4030
     $count_results = count($results);
4031 4031
     $output = array();
4032
-    for($i = 0; $i < $count_results; $i++) {
4032
+    for ($i = 0; $i < $count_results; $i++) {
4033 4033
         $output[] = array(
4034 4034
             'original_session_id_value' => $orig_session_id_value[$i],
4035 4035
             'result' => $results[$i],
@@ -4114,13 +4114,13 @@  discard block
 block discarded – undo
4114 4114
 
4115 4115
 
4116 4116
 // Register the method to expose
4117
-$server->register('WSEditSession',                // method name
4118
-    array('editSession' => 'tns:editSession'),    // input parameters
4117
+$server->register('WSEditSession', // method name
4118
+    array('editSession' => 'tns:editSession'), // input parameters
4119 4119
     array('return' => 'tns:results_editSession'), // output parameters
4120
-    'urn:WSRegistration',                         // namespace
4121
-    'urn:WSRegistration#WSEditSession',           // soapaction
4122
-    'rpc',                                        // style
4123
-    'encoded',                                    // use
4120
+    'urn:WSRegistration', // namespace
4121
+    'urn:WSRegistration#WSEditSession', // soapaction
4122
+    'rpc', // style
4123
+    'encoded', // use
4124 4124
     'This service edits a session'                // documentation
4125 4125
 );
4126 4126
 
@@ -4170,11 +4170,11 @@  discard block
 block discarded – undo
4170 4170
         }
4171 4171
 
4172 4172
         if (empty($nolimit)) {
4173
-            $date_start="$year_start-".(($month_start < 10)?"0$month_start":$month_start)."-".(($day_start < 10)?"0$day_start":$day_start);
4174
-            $date_end="$year_end-".(($month_end < 10)?"0$month_end":$month_end)."-".(($day_end < 10)?"0$day_end":$day_end);
4173
+            $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start);
4174
+            $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end);
4175 4175
         } else {
4176
-            $date_start="";
4177
-            $date_end="";
4176
+            $date_start = "";
4177
+            $date_end = "";
4178 4178
         }
4179 4179
         if (empty($name)) {
4180 4180
             $results[] = 0; //SessionNameIsRequired
@@ -4318,13 +4318,13 @@  discard block
 block discarded – undo
4318 4318
     'tns:result_deleteSession'
4319 4319
 );
4320 4320
 
4321
-$server->register('WSDeleteSession',                // method name
4322
-    array('deleteSession' => 'tns:deleteSession'),  // input parameters
4321
+$server->register('WSDeleteSession', // method name
4322
+    array('deleteSession' => 'tns:deleteSession'), // input parameters
4323 4323
     array('return' => 'tns:results_deleteSession'), // output parameters
4324
-    'urn:WSRegistration',                           // namespace
4325
-    'urn:WSRegistration#WSDeleteSession',           // soapaction
4326
-    'rpc',                                          // style
4327
-    'encoded',                                      // use
4324
+    'urn:WSRegistration', // namespace
4325
+    'urn:WSRegistration#WSDeleteSession', // soapaction
4326
+    'rpc', // style
4327
+    'encoded', // use
4328 4328
     'This service deletes a session '               // documentation
4329 4329
 );
4330 4330
 
@@ -4406,10 +4406,10 @@  discard block
 block discarded – undo
4406 4406
     'struct',
4407 4407
     'all',
4408 4408
     '',
4409
-    array (
4409
+    array(
4410 4410
         'course_id' => array('name' => 'course_id', 'type' => 'tns:course_id'),
4411
-        'user_id'   => array('name' => 'user_id',   'type' => 'tns:user_id'),
4412
-        'status'    => array('name' => 'status',    'type' => 'xsd:int')
4411
+        'user_id'   => array('name' => 'user_id', 'type' => 'tns:user_id'),
4412
+        'status'    => array('name' => 'status', 'type' => 'xsd:int')
4413 4413
     )
4414 4414
 );
4415 4415
 
@@ -4419,9 +4419,9 @@  discard block
 block discarded – undo
4419 4419
     'struct',
4420 4420
     'all',
4421 4421
     '',
4422
-    array (
4423
-        'userscourses'  => array('name' => 'userscourses',  'type' => 'tns:user_course_status_array'), //removed []
4424
-        'secret_key'    => array('name' => 'secret_key',    'type' => 'xsd:string')
4422
+    array(
4423
+        'userscourses'  => array('name' => 'userscourses', 'type' => 'tns:user_course_status_array'), //removed []
4424
+        'secret_key'    => array('name' => 'secret_key', 'type' => 'xsd:string')
4425 4425
     )
4426 4426
 );
4427 4427
 
@@ -4446,9 +4446,9 @@  discard block
 block discarded – undo
4446 4446
     'all',
4447 4447
     '',
4448 4448
     array(
4449
-        'original_user_id_value'    => array('name' => 'original_user_id_value',    'type' => 'xsd:string'),
4450
-        'original_course_id_value'  => array('name' => 'original_course_id_value',  'type' => 'xsd:string'),
4451
-        'result'                    => array('name' => 'result',                    'type' => 'xsd:int')
4449
+        'original_user_id_value'    => array('name' => 'original_user_id_value', 'type' => 'xsd:string'),
4450
+        'original_course_id_value'  => array('name' => 'original_course_id_value', 'type' => 'xsd:string'),
4451
+        'result'                    => array('name' => 'result', 'type' => 'xsd:int')
4452 4452
     )
4453 4453
 );
4454 4454
 
@@ -4464,13 +4464,13 @@  discard block
 block discarded – undo
4464 4464
 );
4465 4465
 
4466 4466
 // Register the method to expose
4467
-$server->register('WSSubscribeUserToCourse',                            // method name
4468
-    array('subscribeUserToCourse' => 'tns:subscribeUserToCourse_arg'),  // input parameters
4467
+$server->register('WSSubscribeUserToCourse', // method name
4468
+    array('subscribeUserToCourse' => 'tns:subscribeUserToCourse_arg'), // input parameters
4469 4469
     array('return' => 'tns:subscribeUserToCourse_return_global'),
4470
-    'urn:WSRegistration',                                               // namespace
4471
-    'urn:WSRegistration#WSSubscribeUserToCourse',                       // soapaction
4472
-    'rpc',                                                              // style
4473
-    'encoded',                                                          // use
4470
+    'urn:WSRegistration', // namespace
4471
+    'urn:WSRegistration#WSSubscribeUserToCourse', // soapaction
4472
+    'rpc', // style
4473
+    'encoded', // use
4474 4474
     'This service subscribes a user to a course'                        // documentation
4475 4475
 );
4476 4476
 
@@ -4480,7 +4480,7 @@  discard block
 block discarded – undo
4480 4480
     if (!WSHelperVerifyKey($params)) {
4481 4481
         return returnError(WS_ERROR_SECRET_KEY);
4482 4482
     }
4483
-    if ($debug) error_log('WSSubscribeUserToCourse params: '.print_r($params,1));
4483
+    if ($debug) error_log('WSSubscribeUserToCourse params: '.print_r($params, 1));
4484 4484
 
4485 4485
     $results = array();
4486 4486
     $userscourses = $params['userscourses'];
@@ -4548,8 +4548,8 @@  discard block
 block discarded – undo
4548 4548
     'all',
4549 4549
     '',
4550 4550
     array(
4551
-        'course'       => array('name' => 'course',     'type' => 'xsd:string'), //Course string code
4552
-        'user_id'      => array('name' => 'user_id',    'type' => 'xsd:string'), //Chamilo user_id
4551
+        'course'       => array('name' => 'course', 'type' => 'xsd:string'), //Course string code
4552
+        'user_id'      => array('name' => 'user_id', 'type' => 'xsd:string'), //Chamilo user_id
4553 4553
         'secret_key'   => array('name' => 'secret_key', 'type' => 'xsd:string')
4554 4554
     )
4555 4555
 );
@@ -4562,18 +4562,18 @@  discard block
 block discarded – undo
4562 4562
     'struct',
4563 4563
     'all',
4564 4564
     '',
4565
-    array('message' => array('name' => 'message',    'type' => 'xsd:string'))
4565
+    array('message' => array('name' => 'message', 'type' => 'xsd:string'))
4566 4566
 );
4567 4567
 
4568 4568
 
4569 4569
 // Register the method to expose
4570
-$server->register('WSSubscribeUserToCourseSimple',                                 // method name
4570
+$server->register('WSSubscribeUserToCourseSimple', // method name
4571 4571
     array('subscribeUserToCourseSimple' => 'tns:subscribeUserToCourseSimple_arg'), // input parameters
4572
-    array('return' => 'xsd:string'),                                               // output parameters
4573
-    'urn:WSRegistration',                                                          // namespace
4574
-    'urn:WSRegistration#WSSubscribeUserToCourseSimple',                            // soapaction
4575
-    'rpc',                                                                         // style
4576
-    'encoded',                                                                     // use
4572
+    array('return' => 'xsd:string'), // output parameters
4573
+    'urn:WSRegistration', // namespace
4574
+    'urn:WSRegistration#WSSubscribeUserToCourseSimple', // soapaction
4575
+    'rpc', // style
4576
+    'encoded', // use
4577 4577
     'This service subscribes a user to a course in a simple way'                   // documentation
4578 4578
 );
4579 4579
 
@@ -4582,7 +4582,7 @@  discard block
 block discarded – undo
4582 4582
     global $debug;
4583 4583
 
4584 4584
     if ($debug) error_log('WSSubscribeUserToCourseSimple');
4585
-    if ($debug) error_log('Params '. print_r($params, 1));
4585
+    if ($debug) error_log('Params '.print_r($params, 1));
4586 4586
     if (!WSHelperVerifyKey($params)) {
4587 4587
         return returnError(WS_ERROR_SECRET_KEY);
4588 4588
     }
@@ -4630,9 +4630,9 @@  discard block
 block discarded – undo
4630 4630
     'all',
4631 4631
     '',
4632 4632
     array(
4633
-        'original_user_id_value'      => array('name' => 'original_user_id_value',    'type' => 'xsd:string'),
4634
-        'original_user_id_name'       => array('name' => 'original_user_id_name',     'type' => 'xsd:string'),
4635
-        'secret_key'                  => array('name' => 'secret_key',                'type' => 'xsd:string')
4633
+        'original_user_id_value'      => array('name' => 'original_user_id_value', 'type' => 'xsd:string'),
4634
+        'original_user_id_name'       => array('name' => 'original_user_id_name', 'type' => 'xsd:string'),
4635
+        'secret_key'                  => array('name' => 'secret_key', 'type' => 'xsd:string')
4636 4636
     )
4637 4637
 );
4638 4638
 
@@ -4643,21 +4643,21 @@  discard block
 block discarded – undo
4643 4643
     'struct',
4644 4644
     'all',
4645 4645
     '',
4646
-    array (
4647
-        'user_id'      => array('name' => 'user_id',    'type' => 'xsd:string'),
4648
-        'firstname'    => array('name' => 'firstname',  'type' => 'xsd:string'),
4649
-        'lastname'     => array('name' => 'lastname',   'type' => 'xsd:string'),
4646
+    array(
4647
+        'user_id'      => array('name' => 'user_id', 'type' => 'xsd:string'),
4648
+        'firstname'    => array('name' => 'firstname', 'type' => 'xsd:string'),
4649
+        'lastname'     => array('name' => 'lastname', 'type' => 'xsd:string'),
4650 4650
     )
4651 4651
 );
4652 4652
 
4653 4653
 // Register the method to expose
4654
-$server->register('WSGetUser',                   // method name
4655
-    array('GetUser' => 'tns:GetUserArg'),        // input parameters
4656
-    array('return' => 'tns:User'),               // output parameters
4657
-    'urn:WSRegistration',                        // namespace
4658
-    'urn:WSRegistration#WSGetUser',              // soapaction
4659
-    'rpc',                                       // style
4660
-    'encoded',                                   // use
4654
+$server->register('WSGetUser', // method name
4655
+    array('GetUser' => 'tns:GetUserArg'), // input parameters
4656
+    array('return' => 'tns:User'), // output parameters
4657
+    'urn:WSRegistration', // namespace
4658
+    'urn:WSRegistration#WSGetUser', // soapaction
4659
+    'rpc', // style
4660
+    'encoded', // use
4661 4661
     'This service get user information by id'    // documentation
4662 4662
 );
4663 4663
 
@@ -4701,17 +4701,17 @@  discard block
 block discarded – undo
4701 4701
     '',
4702 4702
     array(
4703 4703
         'username'      => array('name' => 'username', 'type' => 'xsd:string'),
4704
-        'secret_key'    => array('name' => 'secret_key','type' => 'xsd:string')
4704
+        'secret_key'    => array('name' => 'secret_key', 'type' => 'xsd:string')
4705 4705
     )
4706 4706
 );
4707 4707
 // Register the method to expose
4708
-$server->register('WSGetUserFromUsername',                     // method name
4709
-    array('GetUserFromUsername' => 'tns:GetUserArgUsername'),  // input params
4710
-    array('return' => 'tns:User'),                             // output parameters
4711
-    'urn:WSRegistration',                                      // namespace
4712
-    'urn:WSRegistration#WSGetUserFromUsername',                // soapaction
4713
-    'rpc',                                                     // style
4714
-    'encoded',                                                 // use
4708
+$server->register('WSGetUserFromUsername', // method name
4709
+    array('GetUserFromUsername' => 'tns:GetUserArgUsername'), // input params
4710
+    array('return' => 'tns:User'), // output parameters
4711
+    'urn:WSRegistration', // namespace
4712
+    'urn:WSRegistration#WSGetUserFromUsername', // soapaction
4713
+    'rpc', // style
4714
+    'encoded', // use
4715 4715
     'This service get user information by username'            // documentation
4716 4716
 );
4717 4717
 
@@ -4752,10 +4752,10 @@  discard block
 block discarded – undo
4752 4752
     'all',
4753 4753
     '',
4754 4754
     array(
4755
-        'original_user_id_values'   => array('name' => 'original_user_id_values',   'type' => 'tns:originalUsersList'),
4756
-        'original_user_id_name'     => array('name' => 'original_user_id_name',     'type' => 'xsd:string'),
4757
-        'original_course_id_value'  => array('name' => 'original_course_id_value',  'type' => 'xsd:string'),
4758
-        'original_course_id_name'   => array('name' => 'original_course_id_name',   'type' => 'xsd:string'),
4755
+        'original_user_id_values'   => array('name' => 'original_user_id_values', 'type' => 'tns:originalUsersList'),
4756
+        'original_user_id_name'     => array('name' => 'original_user_id_name', 'type' => 'xsd:string'),
4757
+        'original_course_id_value'  => array('name' => 'original_course_id_value', 'type' => 'xsd:string'),
4758
+        'original_course_id_name'   => array('name' => 'original_course_id_name', 'type' => 'xsd:string'),
4759 4759
     )
4760 4760
 );
4761 4761
 
@@ -4808,13 +4808,13 @@  discard block
 block discarded – undo
4808 4808
 );
4809 4809
 
4810 4810
 // Register the method to expose
4811
-$server->register('WSUnsubscribeUserFromCourse',                         // method name
4811
+$server->register('WSUnsubscribeUserFromCourse', // method name
4812 4812
     array('unsuscribeUserFromCourse' => 'tns:unsuscribeUserFromCourse'), // input parameters
4813
-    array('return' => 'tns:results_unsuscribeUserFromCourse'),           // output parameters
4814
-    'urn:WSRegistration',                                                // namespace
4815
-    'urn:WSRegistration#WSUnsubscribeUserFromCourse',                    // soapaction
4816
-    'rpc',                                                               // style
4817
-    'encoded',                                                           // use
4813
+    array('return' => 'tns:results_unsuscribeUserFromCourse'), // output parameters
4814
+    'urn:WSRegistration', // namespace
4815
+    'urn:WSRegistration#WSUnsubscribeUserFromCourse', // soapaction
4816
+    'rpc', // style
4817
+    'encoded', // use
4818 4818
     'This service unsubscribes a user from a course'                     // documentation
4819 4819
 );
4820 4820
 
@@ -4826,7 +4826,7 @@  discard block
 block discarded – undo
4826 4826
     }
4827 4827
 
4828 4828
     $user_table = Database::get_main_table(TABLE_MAIN_USER);
4829
-    $table_course     = Database :: get_main_table(TABLE_MAIN_COURSE);
4829
+    $table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
4830 4830
     $table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
4831 4831
 
4832 4832
     $userscourses_params = $params['userscourses'];
@@ -4836,8 +4836,8 @@  discard block
 block discarded – undo
4836 4836
     foreach ($userscourses_params as $usercourse_param) {
4837 4837
 
4838 4838
         $original_user_id_values     = $usercourse_param['original_user_id_values'];
4839
-        $original_user_id_name         = $usercourse_param['original_user_id_name'];
4840
-        $original_course_id_value     = $usercourse_param['original_course_id_value'];
4839
+        $original_user_id_name = $usercourse_param['original_user_id_name'];
4840
+        $original_course_id_value = $usercourse_param['original_course_id_value'];
4841 4841
         $original_course_id_name     = $usercourse_param['original_course_id_name'];
4842 4842
         $orig_course_id_value[] = $original_course_id_value;
4843 4843
 
@@ -4858,7 +4858,7 @@  discard block
 block discarded – undo
4858 4858
             $usersList[] = $user_id;
4859 4859
         }
4860 4860
 
4861
-        $orig_user_id_value[] = implode(',',$usersList);
4861
+        $orig_user_id_value[] = implode(',', $usersList);
4862 4862
 
4863 4863
         $courseInfo = CourseManager::getCourseInfoFromOriginalId(
4864 4864
             $original_course_id_value,
@@ -4891,7 +4891,7 @@  discard block
 block discarded – undo
4891 4891
 
4892 4892
     $count_results = count($results);
4893 4893
     $output = array();
4894
-    for($i = 0; $i < $count_results; $i++) {
4894
+    for ($i = 0; $i < $count_results; $i++) {
4895 4895
         $output[] = array(
4896 4896
             'original_user_id_values' => $orig_user_id_value[$i],
4897 4897
             'original_course_id_value' => $orig_course_id_value[$i],
@@ -4920,13 +4920,13 @@  discard block
 block discarded – undo
4920 4920
 
4921 4921
 
4922 4922
 // Register the method to expose
4923
-$server->register('WSUnSubscribeUserFromCourseSimple',                         // method name
4923
+$server->register('WSUnSubscribeUserFromCourseSimple', // method name
4924 4924
     array('unSubscribeUserFromCourseSimple' => 'tns:unSubscribeUserFromCourseSimple'), // input parameters
4925
-    array('return' => 'tns:result_createUsersPassEncrypt'),           // output parameters
4926
-    'urn:WSRegistration',                                                // namespace
4927
-    'urn:WSRegistration#WSUnSubscribeUserFromCourseSimple',                    // soapaction
4928
-    'rpc',                                                               // style
4929
-    'encoded',                                                           // use
4925
+    array('return' => 'tns:result_createUsersPassEncrypt'), // output parameters
4926
+    'urn:WSRegistration', // namespace
4927
+    'urn:WSRegistration#WSUnSubscribeUserFromCourseSimple', // soapaction
4928
+    'rpc', // style
4929
+    'encoded', // use
4930 4930
     'This service unsubscribe a user from a course'                     // documentation
4931 4931
 );
4932 4932
 /**
@@ -4996,10 +4996,10 @@  discard block
 block discarded – undo
4996 4996
     'all',
4997 4997
     '',
4998 4998
     array(
4999
-        'original_user_id_values'   => array('name' => 'original_user_id_values',   'type' => 'tns:originalUsersList'),
5000
-        'original_user_id_name'     => array('name' => 'original_user_id_name',     'type' => 'xsd:string'),
5001
-        'original_course_id_value'  => array('name' => 'original_course_id_value',  'type' => 'xsd:string'),
5002
-        'original_course_id_name'   => array('name' => 'original_course_id_value',  'type' => 'xsd:string')
4999
+        'original_user_id_values'   => array('name' => 'original_user_id_values', 'type' => 'tns:originalUsersList'),
5000
+        'original_user_id_name'     => array('name' => 'original_user_id_name', 'type' => 'xsd:string'),
5001
+        'original_course_id_value'  => array('name' => 'original_course_id_value', 'type' => 'xsd:string'),
5002
+        'original_course_id_name'   => array('name' => 'original_course_id_value', 'type' => 'xsd:string')
5003 5003
     )
5004 5004
 );
5005 5005
 
@@ -5093,13 +5093,13 @@  discard block
 block discarded – undo
5093 5093
 
5094 5094
 
5095 5095
 // Register the method to expose
5096
-$server->register('WSSuscribeUsersToSession',                          // method name
5096
+$server->register('WSSuscribeUsersToSession', // method name
5097 5097
     array('subscribeUsersToSession' => 'tns:subscribeUsersToSession'), // input parameters
5098
-    array('return' => 'tns:results_subscribeUsersToSession'),          // output parameters
5099
-    'urn:WSRegistration',                                              // namespace
5100
-    'urn:WSRegistration#WSSuscribeUsersToSession',                     // soapaction
5101
-    'rpc',                                                             // style
5102
-    'encoded',                                                         // use
5098
+    array('return' => 'tns:results_subscribeUsersToSession'), // output parameters
5099
+    'urn:WSRegistration', // namespace
5100
+    'urn:WSRegistration#WSSuscribeUsersToSession', // soapaction
5101
+    'rpc', // style
5102
+    'encoded', // use
5103 5103
     'This service subscribes a user to a session'                      // documentation
5104 5104
 );
5105 5105
 
@@ -5176,7 +5176,7 @@  discard block
 block discarded – undo
5176 5176
 
5177 5177
     $count_results = count($results);
5178 5178
     $output = array();
5179
-    for($i = 0; $i < $count_results; $i++) {
5179
+    for ($i = 0; $i < $count_results; $i++) {
5180 5180
         $output[] = array(
5181 5181
             'original_user_id_values' => $orig_user_id_value[$i],
5182 5182
             'original_session_id_value' => $orig_session_id_value[$i],
@@ -5196,25 +5196,25 @@  discard block
 block discarded – undo
5196 5196
     'all',
5197 5197
     '',
5198 5198
     array(
5199
-        'session'    => array('name' => 'session',    'type' => 'xsd:string'), // Session ID
5200
-        'user_id'    => array('name' => 'user_id',    'type' => 'xsd:string'), // Chamilo user_id
5199
+        'session'    => array('name' => 'session', 'type' => 'xsd:string'), // Session ID
5200
+        'user_id'    => array('name' => 'user_id', 'type' => 'xsd:string'), // Chamilo user_id
5201 5201
         'secret_key' => array('name' => 'secret_key', 'type' => 'xsd:string')
5202 5202
     )
5203 5203
 );
5204
-$server->register('WSSubscribeUserToSessionSimple',                                   // method name
5205
-    array('subscribeUserToSessionSimple' => 'tns:subscribeUserToSessionSimple_arg'),  // input parameters
5206
-    array('return' => 'xsd:string'),                                                  // output parameters
5207
-    'urn:WSRegistration',                                                             // namespace
5208
-    'urn:WSRegistration#WSSubscribeUserToSessionSimple',                              // soapaction
5209
-    'rpc',                                                                            // style
5210
-    'encoded',                                                                        // use
5204
+$server->register('WSSubscribeUserToSessionSimple', // method name
5205
+    array('subscribeUserToSessionSimple' => 'tns:subscribeUserToSessionSimple_arg'), // input parameters
5206
+    array('return' => 'xsd:string'), // output parameters
5207
+    'urn:WSRegistration', // namespace
5208
+    'urn:WSRegistration#WSSubscribeUserToSessionSimple', // soapaction
5209
+    'rpc', // style
5210
+    'encoded', // use
5211 5211
     'This service subscribes a user to a session in a simple way'                     // documentation
5212 5212
 );
5213 5213
 function WSSubscribeUserToSessionSimple($params) {
5214 5214
     global $debug;
5215 5215
 
5216 5216
     if ($debug) {
5217
-        error_log('WSSubscribeUserToSessionSimple with params=[' . serialize($params). ']');
5217
+        error_log('WSSubscribeUserToSessionSimple with params=['.serialize($params).']');
5218 5218
     }
5219 5219
 
5220 5220
     // Check security key
@@ -5223,8 +5223,8 @@  discard block
 block discarded – undo
5223 5223
     }
5224 5224
 
5225 5225
     // Get input parameters
5226
-    $session_id = intval($params['session']);  // Session ID
5227
-    $user_id    = intval($params['user_id']);  // Chamilo user id
5226
+    $session_id = intval($params['session']); // Session ID
5227
+    $user_id    = intval($params['user_id']); // Chamilo user id
5228 5228
 
5229 5229
     // Get user id
5230 5230
     $user_data = api_get_user_info($user_id);
@@ -5325,13 +5325,13 @@  discard block
 block discarded – undo
5325 5325
 );
5326 5326
 
5327 5327
 // Register the method to expose
5328
-$server->register('WSUnsuscribeUsersFromSession',                              // method name
5328
+$server->register('WSUnsuscribeUsersFromSession', // method name
5329 5329
     array('unsubscribeUsersFromSession' => 'tns:unsubscribeUsersFromSession'), // input parameters
5330
-    array('return' => 'tns:results_unsubscribeUsersFromSession'),              // output parameters
5331
-    'urn:WSRegistration',                                                      // namespace
5332
-    'urn:WSRegistration#WSUnsuscribeUsersFromSession',                         // soapaction
5333
-    'rpc',                                                                     // style
5334
-    'encoded',                                                                 // use
5330
+    array('return' => 'tns:results_unsubscribeUsersFromSession'), // output parameters
5331
+    'urn:WSRegistration', // namespace
5332
+    'urn:WSRegistration#WSUnsuscribeUsersFromSession', // soapaction
5333
+    'rpc', // style
5334
+    'encoded', // use
5335 5335
     'This service unsubscribes a user to a session'                            // documentation
5336 5336
 );
5337 5337
 
@@ -5345,7 +5345,7 @@  discard block
 block discarded – undo
5345 5345
     global $debug;
5346 5346
 
5347 5347
     if ($debug) {
5348
-        error_log('WSUnsuscribeUsersFromSession with params=[' . serialize($params). ']');
5348
+        error_log('WSUnsuscribeUsersFromSession with params=['.serialize($params).']');
5349 5349
     }
5350 5350
 
5351 5351
     $user_table = Database::get_main_table(TABLE_MAIN_USER);
@@ -5437,7 +5437,7 @@  discard block
 block discarded – undo
5437 5437
     'all',
5438 5438
     '',
5439 5439
     array(
5440
-        'course_code'   => array('name' => 'course_code',   'type' => 'xsd:string'),
5440
+        'course_code'   => array('name' => 'course_code', 'type' => 'xsd:string'),
5441 5441
     )
5442 5442
 );
5443 5443
 
@@ -5473,9 +5473,9 @@  discard block
 block discarded – undo
5473 5473
     '',
5474 5474
     array(
5475 5475
         'original_course_id_values' => array('name' => 'original_course_id_values', 'type' => 'tns:originalCoursesList'),
5476
-        'original_course_id_name'   => array('name' => 'original_course_id_name',   'type' => 'xsd:string'),
5476
+        'original_course_id_name'   => array('name' => 'original_course_id_name', 'type' => 'xsd:string'),
5477 5477
         'original_session_id_value' => array('name' => 'original_session_id_value', 'type' => 'xsd:string'),
5478
-        'original_session_id_name'  => array('name' => 'original_session_id_name',  'type' => 'xsd:string')
5478
+        'original_session_id_name'  => array('name' => 'original_session_id_name', 'type' => 'xsd:string')
5479 5479
     )
5480 5480
 );
5481 5481
 
@@ -5528,13 +5528,13 @@  discard block
 block discarded – undo
5528 5528
 );
5529 5529
 
5530 5530
 // Register the method to expose
5531
-$server->register('WSSuscribeCoursesToSession',                            // method name
5531
+$server->register('WSSuscribeCoursesToSession', // method name
5532 5532
     array('subscribeCoursesToSession' => 'tns:subscribeCoursesToSession'), // input parameters
5533
-    array('return' => 'tns:results_subscribeCoursesToSession'),            // output parameters
5534
-    'urn:WSRegistration',                                                  // namespace
5535
-    'urn:WSRegistration#WSSuscribeCoursesToSession',                       // soapaction
5536
-    'rpc',                                                                 // style
5537
-    'encoded',                                                             // use
5533
+    array('return' => 'tns:results_subscribeCoursesToSession'), // output parameters
5534
+    'urn:WSRegistration', // namespace
5535
+    'urn:WSRegistration#WSSuscribeCoursesToSession', // soapaction
5536
+    'rpc', // style
5537
+    'encoded', // use
5538 5538
     'This service subscribes a course to a session'                        // documentation
5539 5539
 );
5540 5540
 
@@ -5672,13 +5672,13 @@  discard block
 block discarded – undo
5672 5672
 
5673 5673
 
5674 5674
 // Register the method to expose
5675
-$server->register('WSUnsuscribeCoursesFromSession',                                // method name
5675
+$server->register('WSUnsuscribeCoursesFromSession', // method name
5676 5676
     array('unsubscribeCoursesFromSession' => 'tns:unsubscribeCoursesFromSession'), // input parameters
5677
-    array('return' => 'tns:results_unsubscribeCoursesFromSession'),                // output parameters
5678
-    'urn:WSRegistration',                                                          // namespace
5679
-    'urn:WSRegistration#WSUnsuscribeCoursesFromSession',                           // soapaction
5680
-    'rpc',                                                                         // style
5681
-    'encoded',                                                                     // use
5677
+    array('return' => 'tns:results_unsubscribeCoursesFromSession'), // output parameters
5678
+    'urn:WSRegistration', // namespace
5679
+    'urn:WSRegistration#WSUnsuscribeCoursesFromSession', // soapaction
5680
+    'rpc', // style
5681
+    'encoded', // use
5682 5682
     'This service subscribes a course to a session'                                // documentation
5683 5683
 );
5684 5684
 
@@ -5785,7 +5785,7 @@  discard block
 block discarded – undo
5785 5785
 
5786 5786
     $count_results = count($results);
5787 5787
     $output = array();
5788
-    for($i = 0; $i < $count_results; $i++) {
5788
+    for ($i = 0; $i < $count_results; $i++) {
5789 5789
         $output[] = array(
5790 5790
             'original_course_id_values' => $orig_course_id_value[$i],
5791 5791
             'original_session_id_value' => $orig_session_id_value[$i],
@@ -5843,13 +5843,13 @@  discard block
 block discarded – undo
5843 5843
 
5844 5844
 
5845 5845
 // Register the method to expose
5846
-$server->register('WSListCourses',                                                  // method name
5846
+$server->register('WSListCourses', // method name
5847 5847
     array('listCourseInput' => 'tns:listCourseInput'), // input parameters
5848
-    array('return' => 'tns:courses'),                                               // output parameters
5849
-    'urn:WSRegistration',                                                           // namespace
5850
-    'urn:WSRegistration#WSListCourses',                                             // soapaction
5851
-    'rpc',                                                                          // style
5852
-    'encoded',                                                                      // use
5848
+    array('return' => 'tns:courses'), // output parameters
5849
+    'urn:WSRegistration', // namespace
5850
+    'urn:WSRegistration#WSListCourses', // soapaction
5851
+    'rpc', // style
5852
+    'encoded', // use
5853 5853
     'This service list courses available on the system'                             // documentation
5854 5854
 );
5855 5855
 
@@ -5868,7 +5868,7 @@  discard block
 block discarded – undo
5868 5868
     $from = isset($params['from']) ? $params['from'] : null;
5869 5869
     $to = isset($params['to']) ? $params['to'] : null;
5870 5870
 
5871
-    error_log(print_r($params,1));
5871
+    error_log(print_r($params, 1));
5872 5872
     error_log($from);
5873 5873
     error_log($to);
5874 5874
 
@@ -5926,27 +5926,27 @@  discard block
 block discarded – undo
5926 5926
     'all',
5927 5927
     '',
5928 5928
     array(
5929
-        'original_user_id_name'     => array('name' => 'original_user_id_name',     'type' => 'xsd:string'),
5930
-        'original_user_id_value'    => array('name' => 'original_user_id_value',    'type' => 'xsd:string'),
5931
-        'chamilo_username'          => array('name' => 'chamilo_username',          'type' => 'xsd:string'),
5932
-        'secret_key'                => array('name' => 'secret_key',                'type' => 'xsd:string')
5929
+        'original_user_id_name'     => array('name' => 'original_user_id_name', 'type' => 'xsd:string'),
5930
+        'original_user_id_value'    => array('name' => 'original_user_id_value', 'type' => 'xsd:string'),
5931
+        'chamilo_username'          => array('name' => 'chamilo_username', 'type' => 'xsd:string'),
5932
+        'secret_key'                => array('name' => 'secret_key', 'type' => 'xsd:string')
5933 5933
     )
5934 5934
 );
5935 5935
 
5936 5936
 // Register the method to expose
5937
-$server->register('WSUpdateUserApiKey',      // method name
5937
+$server->register('WSUpdateUserApiKey', // method name
5938 5938
     array('userApiKey' => 'tns:userApiKey'), // input parameters
5939
-    array('return' => 'xsd:string'),         // output parameters
5940
-    'urn:WSRegistration',                    // namespace
5941
-    'urn:WSRegistration#WSListCourses',      // soapaction
5942
-    'rpc',                                   // style
5943
-    'encoded',                               // use
5939
+    array('return' => 'xsd:string'), // output parameters
5940
+    'urn:WSRegistration', // namespace
5941
+    'urn:WSRegistration#WSListCourses', // soapaction
5942
+    'rpc', // style
5943
+    'encoded', // use
5944 5944
     'This service return user api key'       // documentation
5945 5945
 );
5946 5946
 
5947 5947
 
5948 5948
 function WSUpdateUserApiKey($params) {
5949
-    if(!WSHelperVerifyKey($params)) {
5949
+    if (!WSHelperVerifyKey($params)) {
5950 5950
         return returnError(WS_ERROR_SECRET_KEY);
5951 5951
     }
5952 5952
 
@@ -5988,9 +5988,9 @@  discard block
 block discarded – undo
5988 5988
     'all',
5989 5989
     '',
5990 5990
     array(
5991
-        'date_start'  => array('name' => 'date_start',  'type' => 'xsd:string'),
5992
-        'date_end'    => array('name' => 'date_end',    'type' => 'xsd:string'),
5993
-        'secret_key'  => array('name' => 'secret_key',  'type' => 'xsd:string')
5991
+        'date_start'  => array('name' => 'date_start', 'type' => 'xsd:string'),
5992
+        'date_end'    => array('name' => 'date_end', 'type' => 'xsd:string'),
5993
+        'secret_key'  => array('name' => 'secret_key', 'type' => 'xsd:string')
5994 5994
     )
5995 5995
 );
5996 5996
 
@@ -6001,11 +6001,11 @@  discard block
 block discarded – undo
6001 6001
     'all',
6002 6002
     '',
6003 6003
     array(
6004
-        'id' => array ('name' => 'id'  , 'type' => 'xsd:int'),
6005
-        'title' => array ('name' => 'title', 'type' => 'xsd:string'),
6006
-        'url' => array ('name' => 'url', 'type' => 'xsd:string'),
6007
-        'date_start' => array ('name' => 'date_start', 'type' => 'xsd:string'),
6008
-        'date_end' => array ('name' => 'date_end', 'type' => 'xsd:string'),
6004
+        'id' => array('name' => 'id', 'type' => 'xsd:int'),
6005
+        'title' => array('name' => 'title', 'type' => 'xsd:string'),
6006
+        'url' => array('name' => 'url', 'type' => 'xsd:string'),
6007
+        'date_start' => array('name' => 'date_start', 'type' => 'xsd:string'),
6008
+        'date_end' => array('name' => 'date_end', 'type' => 'xsd:string'),
6009 6009
     )
6010 6010
 );
6011 6011
 
@@ -6024,13 +6024,13 @@  discard block
 block discarded – undo
6024 6024
 );
6025 6025
 
6026 6026
 // Register the method to expose
6027
-$server->register('WSListSessions',           // method name
6028
-    array('input'  => 'tns:session_arg'),     // input parameters
6029
-    array('return' => 'tns:sessions'),        // output parameters
6030
-    'urn:WSRegistration',                     // namespace
6031
-    'urn:WSRegistration#WSListSessions',      // soapaction
6032
-    'rpc',                                    // style
6033
-    'encoded',                                // use
6027
+$server->register('WSListSessions', // method name
6028
+    array('input'  => 'tns:session_arg'), // input parameters
6029
+    array('return' => 'tns:sessions'), // output parameters
6030
+    'urn:WSRegistration', // namespace
6031
+    'urn:WSRegistration#WSListSessions', // soapaction
6032
+    'rpc', // style
6033
+    'encoded', // use
6034 6034
     'This service returns a list of sessions' // documentation
6035 6035
 );
6036 6036
 
@@ -6045,7 +6045,7 @@  discard block
 block discarded – undo
6045 6045
  * @return array Sessions list (id=>[title=>'title',url='http://...',date_start=>'...',date_end=>''])
6046 6046
  */
6047 6047
 function WSListSessions($params) {
6048
-    if(!WSHelperVerifyKey($params)) {
6048
+    if (!WSHelperVerifyKey($params)) {
6049 6049
         return returnError(WS_ERROR_SECRET_KEY);
6050 6050
     }
6051 6051
     $sql_params = array();
@@ -6084,20 +6084,20 @@  discard block
 block discarded – undo
6084 6084
     'all',
6085 6085
     '',
6086 6086
     array(
6087
-        'course'       => array('name' => 'course',     'type' => 'xsd:string'), //Course string code
6088
-        'user_id'      => array('name' => 'user_id',    'type' => 'xsd:string'), //Chamilo user_id
6087
+        'course'       => array('name' => 'course', 'type' => 'xsd:string'), //Course string code
6088
+        'user_id'      => array('name' => 'user_id', 'type' => 'xsd:string'), //Chamilo user_id
6089 6089
         'secret_key'   => array('name' => 'secret_key', 'type' => 'xsd:string')
6090 6090
     )
6091 6091
 );
6092 6092
 
6093 6093
 // Register the method to expose
6094
-$server->register('WSUserSubscribedInCourse',                            // method name
6095
-    array('UserSubscribedInCourse' => 'tns:UserSubscribedInCourse'),    // input parameters
6096
-    array('return' => 'xsd:string'),                                        // output parameters
6097
-    'urn:WSRegistration',                                                    // namespace
6098
-    'urn:WSRegistration#WSUserSubscribedInCourse',                       // soapaction
6099
-    'rpc',                                                                    // style
6100
-    'encoded',                                                                // use
6094
+$server->register('WSUserSubscribedInCourse', // method name
6095
+    array('UserSubscribedInCourse' => 'tns:UserSubscribedInCourse'), // input parameters
6096
+    array('return' => 'xsd:string'), // output parameters
6097
+    'urn:WSRegistration', // namespace
6098
+    'urn:WSRegistration#WSUserSubscribedInCourse', // soapaction
6099
+    'rpc', // style
6100
+    'encoded', // use
6101 6101
     'This service checks if user assigned to course'    // documentation
6102 6102
 );
6103 6103
 
@@ -6111,7 +6111,7 @@  discard block
 block discarded – undo
6111 6111
     global $debug;
6112 6112
 
6113 6113
     if ($debug) error_log('WSUserSubscribedInCourse');
6114
-    if ($debug) error_log('Params '. print_r($params, 1));
6114
+    if ($debug) error_log('Params '.print_r($params, 1));
6115 6115
     if (!WSHelperVerifyKey($params)) {
6116 6116
 
6117 6117
         return returnError(WS_ERROR_SECRET_KEY);
@@ -6119,7 +6119,7 @@  discard block
 block discarded – undo
6119 6119
     $courseCode  = $params['course']; //Course code
6120 6120
     $userId      = $params['user_id']; //chamilo user id
6121 6121
 
6122
-    return (CourseManager::is_user_subscribed_in_course($userId,$courseCode));
6122
+    return (CourseManager::is_user_subscribed_in_course($userId, $courseCode));
6123 6123
 }
6124 6124
 
6125 6125
 
@@ -6147,8 +6147,8 @@  discard block
 block discarded – undo
6147 6147
     'all',
6148 6148
     '',
6149 6149
     array(
6150
-        'variable' => array('name'=>'variable','type'=>'xsd:string'),
6151
-        'value' => array('name'=>'value','type'=>'xsd:string')
6150
+        'variable' => array('name'=>'variable', 'type'=>'xsd:string'),
6151
+        'value' => array('name'=>'value', 'type'=>'xsd:string')
6152 6152
     )
6153 6153
 );
6154 6154
 
@@ -6210,12 +6210,12 @@  discard block
 block discarded – undo
6210 6210
 //Reister WSSearchSession
6211 6211
 $server->register(
6212 6212
     'WSSearchSession',
6213
-    array('SearchSession' => 'tns:SearchSession'),      // input parameters
6214
-    array('return' => 'tns:searchedSessionList'),       // output parameters
6215
-    'urn:WSRegistration',                               // namespace
6216
-    'urn:WSRegistration#WSSearchSession',               // soapaction
6217
-    'rpc',                                              // style
6218
-    'encoded',                                          // use
6213
+    array('SearchSession' => 'tns:SearchSession'), // input parameters
6214
+    array('return' => 'tns:searchedSessionList'), // output parameters
6215
+    'urn:WSRegistration', // namespace
6216
+    'urn:WSRegistration#WSSearchSession', // soapaction
6217
+    'rpc', // style
6218
+    'encoded', // use
6219 6219
     'This service to get a session list filtered by name, description or short description extra field'    // documentation
6220 6220
 );
6221 6221
 
@@ -6270,12 +6270,12 @@  discard block
 block discarded – undo
6270 6270
 //Reister WSFetchSession
6271 6271
 $server->register(
6272 6272
     'WSFetchSession',
6273
-    array('SearchSession' => 'tns:FetchSession'),                    // input parameters
6274
-    array('return' => 'tns:searchedSessionList'),       // output parameters
6275
-    'urn:WSRegistration',                               // namespace
6276
-    'urn:WSRegistration#WSFetchSession',                // soapaction
6277
-    'rpc',                                              // style
6278
-    'encoded',                                          // use
6273
+    array('SearchSession' => 'tns:FetchSession'), // input parameters
6274
+    array('return' => 'tns:searchedSessionList'), // output parameters
6275
+    'urn:WSRegistration', // namespace
6276
+    'urn:WSRegistration#WSFetchSession', // soapaction
6277
+    'rpc', // style
6278
+    'encoded', // use
6279 6279
     'This service get a session by its id. Optionally can get its extra fields values'    // documentation
6280 6280
 );
6281 6281
 
@@ -6352,16 +6352,16 @@  discard block
 block discarded – undo
6352 6352
 );
6353 6353
 // Register the method to expose
6354 6354
 $server->register(
6355
-    'WSCertificatesList',                           // method name
6355
+    'WSCertificatesList', // method name
6356 6356
     array(
6357
-        'startingDate' => 'xsd:string',             // input parameters
6357
+        'startingDate' => 'xsd:string', // input parameters
6358 6358
         'endingDate' => 'xsd:string'
6359 6359
     ),
6360
-    array('return' => 'tns:certificatesList'),      // output parameters
6361
-    'urn:WSRegistration',                           // namespace
6362
-    'urn:WSRegistration#WSCertificatesList',        // soapaction
6363
-    'rpc',                                          // style
6364
-    'encoded',                                      // use
6360
+    array('return' => 'tns:certificatesList'), // output parameters
6361
+    'urn:WSRegistration', // namespace
6362
+    'urn:WSRegistration#WSCertificatesList', // soapaction
6363
+    'rpc', // style
6364
+    'encoded', // use
6365 6365
     'This service returns a list of certificates'   // documentation
6366 6366
 );
6367 6367
 
@@ -6427,13 +6427,13 @@  discard block
 block discarded – undo
6427 6427
 );
6428 6428
 
6429 6429
 // Register the method to expose
6430
-$server->register('WSCreateGroup',              // method name
6431
-    array('createGroup' => 'tns:createGroup'),  // input parameters
6432
-    array('return' => 'xsd:string'),            // output parameters
6433
-    'urn:WSRegistration',                       // namespace
6434
-    'urn:WSRegistration#WSCreateGroup',         // soapaction
6435
-    'rpc',                                      // style
6436
-    'encoded',                                  // use
6430
+$server->register('WSCreateGroup', // method name
6431
+    array('createGroup' => 'tns:createGroup'), // input parameters
6432
+    array('return' => 'xsd:string'), // output parameters
6433
+    'urn:WSRegistration', // namespace
6434
+    'urn:WSRegistration#WSCreateGroup', // soapaction
6435
+    'rpc', // style
6436
+    'encoded', // use
6437 6437
     'This service adds a group'                 // documentation
6438 6438
 );
6439 6439
 
@@ -6476,13 +6476,13 @@  discard block
 block discarded – undo
6476 6476
 );
6477 6477
 
6478 6478
 // Register the method to expose
6479
-$server->register('WSUpdateGroup',              // method name
6480
-    array('updateGroup' => 'tns:updateGroup'),  // input parameters
6481
-    array('return' => 'xsd:string'),            // output parameters
6482
-    'urn:WSRegistration',                       // namespace
6483
-    'urn:WSRegistration#WSUpdateGroup',         // soapaction
6484
-    'rpc',                                      // style
6485
-    'encoded',                                  // use
6479
+$server->register('WSUpdateGroup', // method name
6480
+    array('updateGroup' => 'tns:updateGroup'), // input parameters
6481
+    array('return' => 'xsd:string'), // output parameters
6482
+    'urn:WSRegistration', // namespace
6483
+    'urn:WSRegistration#WSUpdateGroup', // soapaction
6484
+    'rpc', // style
6485
+    'encoded', // use
6486 6486
     'This service updates a group'              // documentation
6487 6487
 );
6488 6488
 
@@ -6527,13 +6527,13 @@  discard block
 block discarded – undo
6527 6527
 );
6528 6528
 
6529 6529
 // Register the method to expose
6530
-$server->register('WSDeleteGroup',              // method name
6531
-    array('deleteGroup' => 'tns:deleteGroup'),  // input parameters
6532
-    array('return' => 'xsd:string'),            // output parameters
6533
-    'urn:WSRegistration',                       // namespace
6534
-    'urn:WSRegistration#WSDeleteGroup',         // soapaction
6535
-    'rpc',                                      // style
6536
-    'encoded',                                  // use
6530
+$server->register('WSDeleteGroup', // method name
6531
+    array('deleteGroup' => 'tns:deleteGroup'), // input parameters
6532
+    array('return' => 'xsd:string'), // output parameters
6533
+    'urn:WSRegistration', // namespace
6534
+    'urn:WSRegistration#WSDeleteGroup', // soapaction
6535
+    'rpc', // style
6536
+    'encoded', // use
6537 6537
     'This service deletes a group'              // documentation
6538 6538
 );
6539 6539
 
@@ -6570,13 +6570,13 @@  discard block
 block discarded – undo
6570 6570
 );
6571 6571
 
6572 6572
 // Register the method to expose
6573
-$server->register('GroupBindToParent',                      // method name
6574
-    array('groupBindToParent' => 'tns:groupBindToParent'),  // input parameters
6575
-    array('return' => 'xsd:string'),                        // output parameters
6576
-    'urn:WSRegistration',                                   // namespace
6577
-    'urn:WSRegistration#GroupBindToParent',                 // soapaction
6578
-    'rpc',                                                  // style
6579
-    'encoded',                                              // use
6573
+$server->register('GroupBindToParent', // method name
6574
+    array('groupBindToParent' => 'tns:groupBindToParent'), // input parameters
6575
+    array('return' => 'xsd:string'), // output parameters
6576
+    'urn:WSRegistration', // namespace
6577
+    'urn:WSRegistration#GroupBindToParent', // soapaction
6578
+    'rpc', // style
6579
+    'encoded', // use
6580 6580
     'This service binds a group to a parent'                // documentation
6581 6581
 );
6582 6582
 
@@ -6612,13 +6612,13 @@  discard block
 block discarded – undo
6612 6612
 );
6613 6613
 
6614 6614
 // Register the method to expose
6615
-$server->register('GroupUnbindFromParent',                          // method name
6616
-    array('groupUnbindFromParent' => 'tns:groupUnbindFromParent'),  // input parameters
6617
-    array('return' => 'xsd:string'),                                // output parameters
6618
-    'urn:WSRegistration',                                           // namespace
6619
-    'urn:WSRegistration#GroupUnbindFromParent',                     // soapaction
6620
-    'rpc',                                                          // style
6621
-    'encoded',                                                      // use
6615
+$server->register('GroupUnbindFromParent', // method name
6616
+    array('groupUnbindFromParent' => 'tns:groupUnbindFromParent'), // input parameters
6617
+    array('return' => 'xsd:string'), // output parameters
6618
+    'urn:WSRegistration', // namespace
6619
+    'urn:WSRegistration#GroupUnbindFromParent', // soapaction
6620
+    'rpc', // style
6621
+    'encoded', // use
6622 6622
     'This service unbinds a group from its parent'                  // documentation
6623 6623
 );
6624 6624
 
@@ -6652,13 +6652,13 @@  discard block
 block discarded – undo
6652 6652
 );
6653 6653
 
6654 6654
 // Register the method to expose
6655
-$server->register('WSAddUserToGroup',                   // method name
6656
-    array('addUserToGroup' => 'tns:addUserToGroup'),    // input parameters
6657
-    array('return' => 'xsd:string'),                    // output parameters
6658
-    'urn:WSRegistration',                               // namespace
6659
-    'urn:WSRegistration#WSAddUserToGroup',              // soapaction
6660
-    'rpc',                                              // style
6661
-    'encoded',                                          // use
6655
+$server->register('WSAddUserToGroup', // method name
6656
+    array('addUserToGroup' => 'tns:addUserToGroup'), // input parameters
6657
+    array('return' => 'xsd:string'), // output parameters
6658
+    'urn:WSRegistration', // namespace
6659
+    'urn:WSRegistration#WSAddUserToGroup', // soapaction
6660
+    'rpc', // style
6661
+    'encoded', // use
6662 6662
     'This service adds a user to a group'               // documentation
6663 6663
 );
6664 6664
 
@@ -6695,13 +6695,13 @@  discard block
 block discarded – undo
6695 6695
 );
6696 6696
 
6697 6697
 // Register the method to expose
6698
-$server->register('WSUpdateUserRoleInGroup',                        // method name
6699
-    array('updateUserRoleInGroup' => 'tns:updateUserRoleInGroup'),  // input parameters
6700
-    array('return' => 'xsd:string'),                                // output parameters
6701
-    'urn:WSRegistration',                                           // namespace
6702
-    'urn:WSRegistration#WSUpdateUserRoleInGroup',                   // soapaction
6703
-    'rpc',                                                          // style
6704
-    'encoded',                                                      // use
6698
+$server->register('WSUpdateUserRoleInGroup', // method name
6699
+    array('updateUserRoleInGroup' => 'tns:updateUserRoleInGroup'), // input parameters
6700
+    array('return' => 'xsd:string'), // output parameters
6701
+    'urn:WSRegistration', // namespace
6702
+    'urn:WSRegistration#WSUpdateUserRoleInGroup', // soapaction
6703
+    'rpc', // style
6704
+    'encoded', // use
6705 6705
     'This service updates a user role in group'                     // documentation
6706 6706
 );
6707 6707
 
@@ -6740,13 +6740,13 @@  discard block
 block discarded – undo
6740 6740
 );
6741 6741
 
6742 6742
 // Register the method to expose
6743
-$server->register('WSDeleteUserFromGroup',                      // method name
6744
-    array('deleteUserFromGroup' => 'tns:deleteUserFromGroup'),  // input parameters
6745
-    array('return' => 'xsd:string'),                            // output parameters
6746
-    'urn:WSRegistration',                                       // namespace
6747
-    'urn:WSRegistration#WSDeleteUserFromGroup',                 // soapaction
6748
-    'rpc',                                                      // style
6749
-    'encoded',                                                  // use
6743
+$server->register('WSDeleteUserFromGroup', // method name
6744
+    array('deleteUserFromGroup' => 'tns:deleteUserFromGroup'), // input parameters
6745
+    array('return' => 'xsd:string'), // output parameters
6746
+    'urn:WSRegistration', // namespace
6747
+    'urn:WSRegistration#WSDeleteUserFromGroup', // soapaction
6748
+    'rpc', // style
6749
+    'encoded', // use
6750 6750
     'This service deletes a user from a group'                  // documentation
6751 6751
 );
6752 6752
 
Please login to merge, or discard this patch.
main/newscorm/lp_view_item.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 if (isset($_GET['lp_item_id'])) {
20 20
 
21 21
     // Get parameter only came from lp_view.php.
22
-    $lp_item_id  = intval($_GET['lp_item_id']);
22
+    $lp_item_id = intval($_GET['lp_item_id']);
23 23
     if (isset($_SESSION['lpobject'])) {
24 24
         $oLP = unserialize($_SESSION['lpobject']);
25 25
     }
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
57 57
 $tbl_lp_view = Database::get_course_table(TABLE_LP_VIEW);
58 58
 
59
-$isStudentView = (empty($_REQUEST['isStudentView']) ? 0 : (int)$_REQUEST['isStudentView']);
60
-$learnpath_id = (int)$_REQUEST['lp_id'];
59
+$isStudentView = (empty($_REQUEST['isStudentView']) ? 0 : (int) $_REQUEST['isStudentView']);
60
+$learnpath_id = (int) $_REQUEST['lp_id'];
61 61
 
62 62
 // Using the resource linker as a tool for adding resources to the learning path.
63 63
 if ($action == 'add' && $type == 'learnpathitem') {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 /* SHOWING THE ADMIN TOOLS	*/
79 79
 
80 80
 if (api_is_in_gradebook()) {
81
-    $interbreadcrumb[] = array (
81
+    $interbreadcrumb[] = array(
82 82
         'url' => api_get_path(WEB_CODE_PATH).'gradebook/index.php?'.api_get_cidreq(),
83 83
         'name' => get_lang('ToolGradebook')
84 84
     );
Please login to merge, or discard this patch.