Completed
Pull Request — 1.11.x (#1688)
by José
28:44
created
main/inc/lib/MoodleImport.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
             }
44 44
 
45 45
             $folder = api_get_unique_id();
46
-            $destinationDir = api_get_path(SYS_ARCHIVE_PATH) . $folder;
46
+            $destinationDir = api_get_path(SYS_ARCHIVE_PATH).$folder;
47 47
             $coursePath = api_get_course_path();
48 48
             $sessionId = api_get_session_id();
49 49
             $groupId = api_get_group_id();
50
-            $documentPath = api_get_path(SYS_COURSE_PATH) . $coursePath . '/document';
50
+            $documentPath = api_get_path(SYS_COURSE_PATH).$coursePath.'/document';
51 51
             $courseInfo = api_get_course_info();
52 52
 
53 53
             mkdir($destinationDir, api_get_permissions_for_new_directories(), true);
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
         if ($weighting > 0) {
818 818
             $questionWeighting += $weighting;
819 819
         }
820
-        $goodAnswer =  $correct ? true : false;
820
+        $goodAnswer = $correct ? true : false;
821 821
 
822 822
         $this->fixPathInText($importedFiles, $answer);
823 823
 
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
         if ($weighting > 0) {
855 855
             $questionWeighting += $weighting;
856 856
         }
857
-        $goodAnswer =  $correct ? true : false;
857
+        $goodAnswer = $correct ? true : false;
858 858
 
859 859
         $this->fixPathInText($importedFiles, $answer);
860 860
 
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
                         $answer['questiontext']
956 956
                     );
957 957
 
958
-                    $placeholder .= '<p> ' . strip_tags($answer['questiontext']).' '.$currentAnswers . ' </p>';
958
+                    $placeholder .= '<p> '.strip_tags($answer['questiontext']).' '.$currentAnswers.' </p>';
959 959
                 }
960 960
 
961 961
                 return $optionsValues;
Please login to merge, or discard this patch.
main/inc/lib/fileManage.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -193,9 +193,9 @@
 block discarded – undo
193 193
         /* File case */
194 194
         if (is_file($source)) {
195 195
             if ($forceMove && !$isWindowsOS && $canExec) {
196
-                exec('mv ' . $source . ' ' . $target . '/' . $file_name);
196
+                exec('mv '.$source.' '.$target.'/'.$file_name);
197 197
             } else {
198
-                copy($source, $target . '/' . $file_name);
198
+                copy($source, $target.'/'.$file_name);
199 199
                 unlink($source);
200 200
             }
201 201
             return true;
Please login to merge, or discard this patch.
main/exercise/exercise_history.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,41 +10,41 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 require_once __DIR__.'/../inc/global.inc.php';
13
-$this_section=SECTION_COURSES;
13
+$this_section = SECTION_COURSES;
14 14
 api_protect_course_script(true);
15 15
 
16 16
 // moved down to fix bug: http://www.dokeos.com/forum/viewtopic.php?p=18609#18609
17 17
 $show = (isset($_GET['show']) && $_GET['show'] == 'result') ? 'result' : 'test';
18 18
 
19 19
 /* 	Constants and variables */
20
-$is_allowedToEdit = api_is_allowed_to_edit(null,true);
20
+$is_allowedToEdit = api_is_allowed_to_edit(null, true);
21 21
 $is_tutor = api_is_allowed_to_edit(true);
22 22
 
23
-if (!$is_allowedToEdit){
24
-    header('Location: ' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise.php?' . api_get_cidreq());
23
+if (!$is_allowedToEdit) {
24
+    header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq());
25 25
     exit;
26 26
 }
27 27
 
28
-$interbreadcrumb[]= array ('url' => 'exercise_report.php?'.api_get_cidreq(),'name' => get_lang('Exercises'));
29
-$interbreadcrumb[]= array ('url' => 'exercise_report.php?filter=2&'.api_get_cidreq(),'name' => get_lang('StudentScore'));
30
-$interbreadcrumb[]= array ('url' => 'exercise_history.php?exe_id='.intval($_GET['exe_id']).'&'.api_get_cidreq(), 'name' => get_lang('Details'));
28
+$interbreadcrumb[] = array('url' => 'exercise_report.php?'.api_get_cidreq(), 'name' => get_lang('Exercises'));
29
+$interbreadcrumb[] = array('url' => 'exercise_report.php?filter=2&'.api_get_cidreq(), 'name' => get_lang('StudentScore'));
30
+$interbreadcrumb[] = array('url' => 'exercise_history.php?exe_id='.intval($_GET['exe_id']).'&'.api_get_cidreq(), 'name' => get_lang('Details'));
31 31
 
32 32
 $TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
33 33
 $TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
34 34
 $TBL_EXERCISES_QUESTION = Database::get_course_table(TABLE_QUIZ_QUESTION);
35
-$TBL_TRACK_ATTEMPT_RECORDING= Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
36
-Display::display_header($nameTools,get_lang('Exercise'));
35
+$TBL_TRACK_ATTEMPT_RECORDING = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
36
+Display::display_header($nameTools, get_lang('Exercise'));
37 37
 
38 38
 if (isset($_GET['message'])) {
39 39
     if (in_array($_GET['message'], array('ExerciseEdited'))) {
40
-        $my_message_history=Security::remove_XSS($_GET['message']);
40
+        $my_message_history = Security::remove_XSS($_GET['message']);
41 41
         Display::display_confirmation_message(get_lang($my_message_history));
42 42
     }
43 43
 }
44 44
 
45 45
 echo '<div class="actions">';
46
-echo '<a href="exercise_report.php?' . api_get_cidreq() . '&filter=2">' .
47
-    Display :: return_icon('back.png', get_lang('BackToResultList'),'',ICON_SIZE_MEDIUM).'</a>';
46
+echo '<a href="exercise_report.php?'.api_get_cidreq().'&filter=2">'.
47
+    Display :: return_icon('back.png', get_lang('BackToResultList'), '', ICON_SIZE_MEDIUM).'</a>';
48 48
 echo '</div>';
49 49
 
50 50
 ?>
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
         WHERE 
66 66
             quiz_question.id = question_id AND 
67 67
             user_id = author AND 
68
-            exe_id = '".(int)$_GET['exe_id']."' 
68
+            exe_id = '".(int) $_GET['exe_id']."' 
69 69
         ORDER BY position";
70 70
 $query = Database::query($sql);
71
-while($row = Database::fetch_array($query)){
71
+while ($row = Database::fetch_array($query)) {
72 72
     echo '<tr';
73 73
     if ($i % 2 == 0) {
74 74
         echo 'class="row_odd"';
Please login to merge, or discard this patch.
main/admin/user_edit.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 if ($geolocalization) {
75 75
 	$gmapsApiKey = $gMapsPlugin->get('api_key');
76
-	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
76
+	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
77 77
 }
78 78
 
79 79
 $htmlHeadXtra[] = api_get_css_asset('cropper/dist/cropper.min.css');
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 }
154 154
 
155 155
 if (api_get_setting('login_is_email') == 'true') {
156
-    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
156
+    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
157 157
     $form->addRule('email', get_lang('UserTaken'), 'username_available', $user_data['username']);
158 158
 }
159 159
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 if (api_get_setting('login_is_email') != 'true') {
188 188
 	$form->addElement('text', 'username', get_lang('LoginName'), array('maxlength' => USERNAME_MAX_LENGTH));
189 189
     $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
190
-    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
190
+    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
191 191
     $form->addRule('username', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
192 192
     $form->addRule('username', get_lang('UserTaken'), 'username_available', $user_data['username']);
193 193
 }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 }
225 225
 $form->addElement('radio', 'reset_password', null, get_lang('AutoGeneratePassword'), 1);
226 226
 $group = array();
227
-$group[] =$form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
227
+$group[] = $form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
228 228
 $group[] = $form->createElement(
229 229
     'password',
230 230
     'password',
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
 // Platform admin
259 259
 if (api_is_platform_admin()) {
260 260
 	$group = array();
261
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
261
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
263 263
 
264
-	$user_data['status'] == 1 ? $display = 'block':$display = 'none';
264
+	$user_data['status'] == 1 ? $display = 'block' : $display = 'none';
265 265
 
266 266
 	$form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">');
267 267
 	$form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 if (!$user_data['platform_admin']) {
286 286
 	// Expiration Date
287 287
 	$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
288
-	$group = array ();
288
+	$group = array();
289 289
 	$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
290 290
 	$group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();'));
291 291
 	$form->addGroup($group, 'max_member_group', null, null, false);
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 if ($studentBoss) {
304 304
     foreach ($studentBoss as $bossId => $userData) {
305 305
         $bossInfo = api_get_user_info($userData['user_id']);
306
-        $studentBossToSelect[$bossInfo['user_id']] =  $bossInfo['complete_name_with_username'];
306
+        $studentBossToSelect[$bossInfo['user_id']] = $bossInfo['complete_name_with_username'];
307 307
     }
308 308
 }
309 309
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 $jquery_ready_content = $returnParams['jquery_ready_content'];
321 321
 
322 322
 // the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
323
-$htmlHeadXtra[] ='<script>
323
+$htmlHeadXtra[] = '<script>
324 324
 $(document).ready(function(){
325 325
 	'.$jquery_ready_content.'
326 326
 });
Please login to merge, or discard this patch.
main/auth/profile.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 if ($geolocalization) {
35 35
     $gmapsApiKey = $gMapsPlugin->get('api_key');
36
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
36
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
37 37
 }
38 38
 
39 39
 $htmlHeadXtra[] = api_get_password_checker_js('#username', '#password1');
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 if (api_is_western_name_order()) {
120 120
     //    FIRST NAME and LAST NAME
121 121
     $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
122
-    $form->addElement('text', 'lastname',  get_lang('LastName'),  array('size' => 40));
122
+    $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40));
123 123
 } else {
124 124
     //    LAST NAME and FIRST NAME
125
-    $form->addElement('text', 'lastname',  get_lang('LastName'),  array('size' => 40));
125
+    $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40));
126 126
     $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
127 127
 }
128 128
 if (api_get_setting('profile', 'name') !== 'true') {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 $form->applyFilter(array('lastname', 'firstname'), 'stripslashes');
132 132
 $form->applyFilter(array('lastname', 'firstname'), 'trim');
133 133
 $form->applyFilter(array('lastname', 'firstname'), 'html_filter');
134
-$form->addRule('lastname' , get_lang('ThisFieldIsRequired'), 'required');
134
+$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
135 135
 $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
136 136
 
137 137
 //    USERNAME
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     $form->freeze('email');
177 177
 }
178 178
 
179
-if (api_get_setting('registration', 'email') == 'true' &&  api_get_setting('profile', 'email') == 'true') {
179
+if (api_get_setting('registration', 'email') == 'true' && api_get_setting('profile', 'email') == 'true') {
180 180
     $form->applyFilter('email', 'stripslashes');
181 181
     $form->applyFilter('email', 'trim');
182 182
     $form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 // the $jquery_ready_content variable collects all functions that
330 330
 // will be load in the $(document).ready javascript function
331
-$htmlHeadXtra[] ='<script>
331
+$htmlHeadXtra[] = '<script>
332 332
 $(document).ready(function(){
333 333
     '.$jquery_ready_content.'
334 334
 });
Please login to merge, or discard this patch.
plugin/google_maps/src/map_coordinates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
 if ($apiIsEnable) {
23 23
     $gmapsApiKey = $plugin->get('api_key');
24
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='. $gmapsApiKey . '" ></script>';
24
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='.$gmapsApiKey.'" ></script>';
25 25
 }
26 26
 
27 27
 $em = Database::getManager();
Please login to merge, or discard this patch.
main/install/update-files-1.9.0-1.10.0.inc.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * current configuration file.
15 15
  * @package chamilo.install
16 16
  */
17
-error_log("Starting " . basename(__FILE__));
17
+error_log("Starting ".basename(__FILE__));
18 18
 
19 19
 global $debug;
20 20
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 
144 144
     $list = scandir($langPath);
145 145
     foreach ($list as $entry) {
146
-        if (is_dir($langPath . $entry) &&
146
+        if (is_dir($langPath.$entry) &&
147 147
             in_array($entry, $officialLanguages)
148 148
         ) {
149 149
             foreach ($filesToDelete as $file) {
150
-                if (is_file($langPath . $entry . '/' . $file . '.inc.php')) {
151
-                    unlink($langPath . $entry . '/' . $file . '.inc.php');
150
+                if (is_file($langPath.$entry.'/'.$file.'.inc.php')) {
151
+                    unlink($langPath.$entry.'/'.$file.'.inc.php');
152 152
                 }
153 153
             }
154 154
         }
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
 
174 174
     // Move dirs into new structures.
175 175
     $movePathList = [
176
-        api_get_path(SYS_CODE_PATH).'upload/users/groups' => api_get_path(SYS_UPLOAD_PATH) . 'groups',
177
-        api_get_path(SYS_CODE_PATH).'upload/users' => api_get_path(SYS_UPLOAD_PATH) . 'users',
178
-        api_get_path(SYS_CODE_PATH).'upload/badges' => api_get_path(SYS_UPLOAD_PATH) . 'badges',
179
-        api_get_path(SYS_PATH).'courses' => api_get_path(SYS_APP_PATH) . 'courses',
176
+        api_get_path(SYS_CODE_PATH).'upload/users/groups' => api_get_path(SYS_UPLOAD_PATH).'groups',
177
+        api_get_path(SYS_CODE_PATH).'upload/users' => api_get_path(SYS_UPLOAD_PATH).'users',
178
+        api_get_path(SYS_CODE_PATH).'upload/badges' => api_get_path(SYS_UPLOAD_PATH).'badges',
179
+        api_get_path(SYS_PATH).'courses' => api_get_path(SYS_APP_PATH).'courses',
180 180
         api_get_path(SYS_PATH).'searchdb' => api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/',
181
-        api_get_path(SYS_PATH).'home' => api_get_path(SYS_APP_PATH) . 'home'
181
+        api_get_path(SYS_PATH).'home' => api_get_path(SYS_APP_PATH).'home'
182 182
     ];
183 183
 
184 184
     if ($debug) {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 $fs->remove($origin);
200 200
             } catch (IOException $e) {
201 201
                 // If removing the directory doesn't work, just log an error and continue
202
-                error_log('Could not move ' . $origin . ' to ' . $destination . '(' . $e->getMessage() . '). Please move it manually.');
202
+                error_log('Could not move '.$origin.' to '.$destination.'('.$e->getMessage().'). Please move it manually.');
203 203
             }
204 204
         }
205 205
     }
@@ -246,5 +246,5 @@  discard block
 block discarded – undo
246 246
     @rrmdir(api_get_path(SYS_PATH).'archive');
247 247
 
248 248
 } else {
249
-    echo 'You are not allowed here !'. __FILE__;
249
+    echo 'You are not allowed here !'.__FILE__;
250 250
 }
Please login to merge, or discard this patch.
main/inc/lib/fileUpload.lib.php 1 patch
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 if ($show_output) {
95 95
                     Display::addFlash(
96 96
                         Display::return_message(
97
-                            get_lang('UplExceedMaxPostSize'). format_file_size($max_file_size),
97
+                            get_lang('UplExceedMaxPostSize').format_file_size($max_file_size),
98 98
                             'error'
99 99
                         )
100 100
                     );
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                 if ($show_output) {
119 119
                     Display::addFlash(
120 120
                         Display::return_message(
121
-                            get_lang('UplNoFileUploaded').' '. get_lang('UplSelectFileFirst'),
121
+                            get_lang('UplNoFileUploaded').' '.get_lang('UplSelectFileFirst'),
122 122
                             'error'
123 123
                         )
124 124
                     );
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                             if ($output) {
473 473
                                 Display::addFlash(
474 474
                                     Display::return_message(
475
-                                        get_lang('UplUploadSucceeded') . '<br /> ' . $documentTitle . ' ' . get_lang('UplFileOverwritten'),
475
+                                        get_lang('UplUploadSucceeded').'<br /> '.$documentTitle.' '.get_lang('UplFileOverwritten'),
476 476
                                         'confirmation',
477 477
                                         false
478 478
                                     )
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
                         if ($output) {
610 610
                             Display::addFlash(
611 611
                                 Display::return_message(
612
-                                    get_lang('UplUploadSucceeded') . '<br />' . get_lang('UplFileSavedAs') . ' ' . $documentTitle,
612
+                                    get_lang('UplUploadSucceeded').'<br />'.get_lang('UplFileSavedAs').' '.$documentTitle,
613 613
                                     'success',
614 614
                                     false
615 615
                                 )
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
                             if ($output) {
687 687
                                 Display::addFlash(
688 688
                                     Display::display_confirmation_message(
689
-                                        get_lang('UplUploadSucceeded') . '<br /> ' . $documentTitle,
689
+                                        get_lang('UplUploadSucceeded').'<br /> '.$documentTitle,
690 690
                                         false,
691 691
                                         true
692 692
                                     )
@@ -772,12 +772,12 @@  discard block
 block discarded – undo
772 772
 function dir_total_space($dir_path)
773 773
 {
774 774
     $save_dir = getcwd();
775
-    chdir($dir_path) ;
775
+    chdir($dir_path);
776 776
     $handle = opendir($dir_path);
777 777
     $sumSize = 0;
778 778
     $dirList = array();
779 779
     while ($element = readdir($handle)) {
780
-        if ( $element == '.' || $element == '..') {
780
+        if ($element == '.' || $element == '..') {
781 781
             continue; // Skip the current and parent directories
782 782
         }
783 783
         if (is_file($element)) {
@@ -788,11 +788,11 @@  discard block
 block discarded – undo
788 788
         }
789 789
     }
790 790
 
791
-    closedir($handle) ;
791
+    closedir($handle);
792 792
 
793 793
     if (sizeof($dirList) > 0) {
794 794
         foreach ($dirList as $j) {
795
-            $sizeDir = dir_total_space($j);	// Recursivity
795
+            $sizeDir = dir_total_space($j); // Recursivity
796 796
             $sumSize += $sizeDir;
797 797
         }
798 798
     }
@@ -826,63 +826,63 @@  discard block
 block discarded – undo
826 826
 
827 827
         static $mime_type = array();
828 828
 
829
-        $mime_type[] = 'application/msword';             $extension[] = '.doc';
830
-        $mime_type[] = 'application/rtf';                $extension[] = '.rtf';
831
-        $mime_type[] = 'application/vnd.ms-powerpoint';  $extension[] = '.ppt';
832
-        $mime_type[] = 'application/vnd.ms-excel';       $extension[] = '.xls';
833
-        $mime_type[] = 'application/pdf';                $extension[] = '.pdf';
834
-        $mime_type[] = 'application/postscript';         $extension[] = '.ps';
835
-        $mime_type[] = 'application/mac-binhex40';       $extension[] = '.hqx';
836
-        $mime_type[] = 'application/x-gzip';             $extension[] = 'tar.gz';
837
-        $mime_type[] = 'application/x-shockwave-flash';  $extension[] = '.swf';
838
-        $mime_type[] = 'application/x-stuffit';          $extension[] = '.sit';
839
-        $mime_type[] = 'application/x-tar';              $extension[] = '.tar';
840
-        $mime_type[] = 'application/zip';                $extension[] = '.zip';
841
-        $mime_type[] = 'application/x-tar';              $extension[] = '.tar';
842
-        $mime_type[] = 'text/html';                      $extension[] = '.html';
843
-        $mime_type[] = 'text/plain';                     $extension[] = '.txt';
844
-        $mime_type[] = 'text/rtf';                       $extension[] = '.rtf';
845
-        $mime_type[] = 'img/gif';                        $extension[] = '.gif';
846
-        $mime_type[] = 'img/jpeg';                       $extension[] = '.jpg';
847
-        $mime_type[] = 'img/png';                        $extension[] = '.png';
848
-        $mime_type[] = 'audio/midi';                     $extension[] = '.mid';
849
-        $mime_type[] = 'audio/mpeg';                     $extension[] = '.mp3';
850
-        $mime_type[] = 'audio/x-aiff';                   $extension[] = '.aif';
851
-        $mime_type[] = 'audio/x-pn-realaudio';           $extension[] = '.rm';
852
-        $mime_type[] = 'audio/x-pn-realaudio-plugin';    $extension[] = '.rpm';
853
-        $mime_type[] = 'audio/x-wav';                    $extension[] = '.wav';
854
-        $mime_type[] = 'video/mpeg';                     $extension[] = '.mpg';
855
-        $mime_type[] = 'video/mpeg4-generic';            $extension[] = '.mp4';
856
-        $mime_type[] = 'video/quicktime';                $extension[] = '.mov';
857
-        $mime_type[] = 'video/x-msvideo';                $extension[] = '.avi';
858
-
859
-        $mime_type[] = 'video/x-ms-wmv';                 $extension[] = '.wmv';
860
-        $mime_type[] = 'video/x-flv';                    $extension[] = '.flv';
861
-        $mime_type[] = 'image/svg+xml';                  $extension[] = '.svg';
862
-        $mime_type[] = 'image/svg+xml';                  $extension[] = '.svgz';
863
-        $mime_type[] = 'video/ogg';                  	 $extension[] = '.ogv';
864
-        $mime_type[] = 'audio/ogg';                  	 $extension[] = '.oga';
865
-        $mime_type[] = 'application/ogg';                $extension[] = '.ogg';
866
-        $mime_type[] = 'application/ogg';                $extension[] = '.ogx';
867
-        $mime_type[] = 'application/x-freemind';         $extension[] = '.mm';
868
-
869
-        $mime_type[] = 'application/vnd.ms-word.document.macroEnabled.12';							$extension[] = '.docm';
870
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';	$extension[] = '.docx';
871
-        $mime_type[] = 'application/vnd.ms-word.template.macroEnabled.12';							$extension[] = '.dotm';
872
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template';	$extension[] = '.dotx';
873
-        $mime_type[] = 'application/vnd.ms-powerpoint.template.macroEnabled.12';					$extension[] = '.potm';
874
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.template';		$extension[] = '.potx';
875
-        $mime_type[] = 'application/vnd.ms-powerpoint.addin.macroEnabled.12';						$extension[] = '.ppam';
876
-        $mime_type[] = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12';					$extension[] = '.ppsm';
877
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow';	$extension[] = '.ppsx';
878
-        $mime_type[] = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12';				$extension[] = '.pptm';
879
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';	$extension[] = '.pptx';
880
-        $mime_type[] = 'application/vnd.ms-excel.addin.macroEnabled.12';							$extension[] = '.xlam';
881
-        $mime_type[] = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12';						$extension[] = '.xlsb';
882
-        $mime_type[] = 'application/vnd.ms-excel.sheet.macroEnabled.12';							$extension[] = '.xlsm';
883
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';			$extension[] = '.xlsx';
884
-        $mime_type[] = 'application/vnd.ms-excel.template.macroEnabled.12';							$extension[] = '.xltm';
885
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template';		$extension[] = '.xltx';
829
+        $mime_type[] = 'application/msword'; $extension[] = '.doc';
830
+        $mime_type[] = 'application/rtf'; $extension[] = '.rtf';
831
+        $mime_type[] = 'application/vnd.ms-powerpoint'; $extension[] = '.ppt';
832
+        $mime_type[] = 'application/vnd.ms-excel'; $extension[] = '.xls';
833
+        $mime_type[] = 'application/pdf'; $extension[] = '.pdf';
834
+        $mime_type[] = 'application/postscript'; $extension[] = '.ps';
835
+        $mime_type[] = 'application/mac-binhex40'; $extension[] = '.hqx';
836
+        $mime_type[] = 'application/x-gzip'; $extension[] = 'tar.gz';
837
+        $mime_type[] = 'application/x-shockwave-flash'; $extension[] = '.swf';
838
+        $mime_type[] = 'application/x-stuffit'; $extension[] = '.sit';
839
+        $mime_type[] = 'application/x-tar'; $extension[] = '.tar';
840
+        $mime_type[] = 'application/zip'; $extension[] = '.zip';
841
+        $mime_type[] = 'application/x-tar'; $extension[] = '.tar';
842
+        $mime_type[] = 'text/html'; $extension[] = '.html';
843
+        $mime_type[] = 'text/plain'; $extension[] = '.txt';
844
+        $mime_type[] = 'text/rtf'; $extension[] = '.rtf';
845
+        $mime_type[] = 'img/gif'; $extension[] = '.gif';
846
+        $mime_type[] = 'img/jpeg'; $extension[] = '.jpg';
847
+        $mime_type[] = 'img/png'; $extension[] = '.png';
848
+        $mime_type[] = 'audio/midi'; $extension[] = '.mid';
849
+        $mime_type[] = 'audio/mpeg'; $extension[] = '.mp3';
850
+        $mime_type[] = 'audio/x-aiff'; $extension[] = '.aif';
851
+        $mime_type[] = 'audio/x-pn-realaudio'; $extension[] = '.rm';
852
+        $mime_type[] = 'audio/x-pn-realaudio-plugin'; $extension[] = '.rpm';
853
+        $mime_type[] = 'audio/x-wav'; $extension[] = '.wav';
854
+        $mime_type[] = 'video/mpeg'; $extension[] = '.mpg';
855
+        $mime_type[] = 'video/mpeg4-generic'; $extension[] = '.mp4';
856
+        $mime_type[] = 'video/quicktime'; $extension[] = '.mov';
857
+        $mime_type[] = 'video/x-msvideo'; $extension[] = '.avi';
858
+
859
+        $mime_type[] = 'video/x-ms-wmv'; $extension[] = '.wmv';
860
+        $mime_type[] = 'video/x-flv'; $extension[] = '.flv';
861
+        $mime_type[] = 'image/svg+xml'; $extension[] = '.svg';
862
+        $mime_type[] = 'image/svg+xml'; $extension[] = '.svgz';
863
+        $mime_type[] = 'video/ogg'; $extension[] = '.ogv';
864
+        $mime_type[] = 'audio/ogg'; $extension[] = '.oga';
865
+        $mime_type[] = 'application/ogg'; $extension[] = '.ogg';
866
+        $mime_type[] = 'application/ogg'; $extension[] = '.ogx';
867
+        $mime_type[] = 'application/x-freemind'; $extension[] = '.mm';
868
+
869
+        $mime_type[] = 'application/vnd.ms-word.document.macroEnabled.12'; $extension[] = '.docm';
870
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; $extension[] = '.docx';
871
+        $mime_type[] = 'application/vnd.ms-word.template.macroEnabled.12'; $extension[] = '.dotm';
872
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'; $extension[] = '.dotx';
873
+        $mime_type[] = 'application/vnd.ms-powerpoint.template.macroEnabled.12'; $extension[] = '.potm';
874
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.template'; $extension[] = '.potx';
875
+        $mime_type[] = 'application/vnd.ms-powerpoint.addin.macroEnabled.12'; $extension[] = '.ppam';
876
+        $mime_type[] = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12'; $extension[] = '.ppsm';
877
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'; $extension[] = '.ppsx';
878
+        $mime_type[] = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12'; $extension[] = '.pptm';
879
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; $extension[] = '.pptx';
880
+        $mime_type[] = 'application/vnd.ms-excel.addin.macroEnabled.12'; $extension[] = '.xlam';
881
+        $mime_type[] = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12'; $extension[] = '.xlsb';
882
+        $mime_type[] = 'application/vnd.ms-excel.sheet.macroEnabled.12'; $extension[] = '.xlsm';
883
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; $extension[] = '.xlsx';
884
+        $mime_type[] = 'application/vnd.ms-excel.template.macroEnabled.12'; $extension[] = '.xltm';
885
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'; $extension[] = '.xltx';
886 886
 
887 887
         // Test on PC (files with no extension get application/octet-stream)
888 888
         //$mime_type[] = 'application/octet-stream';      $extension[] = '.ext';
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 
892 892
         foreach ($mime_type as $key => & $type) {
893 893
             if ($type == $file_type) {
894
-                $file_name .=  $extension[$key];
894
+                $file_name .= $extension[$key];
895 895
                 break;
896 896
             }
897 897
         }
@@ -967,12 +967,12 @@  discard block
 block discarded – undo
967 967
         }
968 968
 
969 969
         // It happens on Linux that $upload_path sometimes doesn't start with '/'
970
-        if ($upload_path[0] != '/' && substr($base_work_dir,-1,1) != '/') {
970
+        if ($upload_path[0] != '/' && substr($base_work_dir, -1, 1) != '/') {
971 971
             $upload_path = '/'.$upload_path;
972 972
         }
973 973
 
974 974
         if ($upload_path[strlen($upload_path) - 1] == '/') {
975
-            $upload_path=substr($upload_path, 0, -1);
975
+            $upload_path = substr($upload_path, 0, -1);
976 976
         }
977 977
 
978 978
         /*	Uncompressing phase */
@@ -984,15 +984,15 @@  discard block
 block discarded – undo
984 984
             - add it to the database
985 985
             - parse & change relative html links
986 986
         */
987
-        if (PHP_OS == 'Linux' && ! get_cfg_var('safe_mode') && false) { // *** UGent, changed by OC ***
987
+        if (PHP_OS == 'Linux' && !get_cfg_var('safe_mode') && false) { // *** UGent, changed by OC ***
988 988
             // Shell Method - if this is possible, it gains some speed
989
-            exec("unzip -d \"".$base_work_dir.$upload_path."/\"".$uploaded_file['name']." " .$uploaded_file['tmp_name']);
989
+            exec("unzip -d \"".$base_work_dir.$upload_path."/\"".$uploaded_file['name']." ".$uploaded_file['tmp_name']);
990 990
         } else {
991 991
             // PHP method - slower...
992 992
             $save_dir = getcwd();
993 993
             chdir($base_work_dir.$upload_path);
994 994
             $unzippingState = $zip_file->extract();
995
-            for ($j=0; $j < count($unzippingState); $j++) {
995
+            for ($j = 0; $j < count($unzippingState); $j++) {
996 996
                 $state = $unzippingState[$j];
997 997
 
998 998
                 // Fix relative links in html files
@@ -1006,8 +1006,8 @@  discard block
 block discarded – undo
1006 1006
                         if (is_dir($base_work_dir.$upload_path.'/'.$file)) $filetype = 'folder';
1007 1007
 
1008 1008
                         $safe_file = api_replace_dangerous_char($file);
1009
-                        @rename($base_work_dir.$upload_path.'/'.$file,$base_work_dir.$upload_path.'/'.$safe_file);
1010
-                        set_default_settings($upload_path, $safe_file,$filetype);
1009
+                        @rename($base_work_dir.$upload_path.'/'.$file, $base_work_dir.$upload_path.'/'.$safe_file);
1010
+                        set_default_settings($upload_path, $safe_file, $filetype);
1011 1011
                     }
1012 1012
                 }
1013 1013
 
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
     $zip = new PclZip($uploaded_file['tmp_name']);
1058 1058
 
1059 1059
     // Check the zip content (real size and file extension)
1060
-    $zip_content_array = (array)$zip->listContent();
1060
+    $zip_content_array = (array) $zip->listContent();
1061 1061
 
1062 1062
     $realSize = 0;
1063 1063
     foreach ($zip_content_array as & $this_content) {
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
 function filter_extension(&$filename)
1160 1160
 {
1161 1161
     if (substr($filename, -1) == '/') {
1162
-        return 1;  // Authorize directories
1162
+        return 1; // Authorize directories
1163 1163
     }
1164 1164
     $blacklist = api_get_setting('upload_extensions_list_type');
1165 1165
     if ($blacklist != 'whitelist') { // if = blacklist
@@ -1392,9 +1392,9 @@  discard block
 block discarded – undo
1392 1392
     $upload_path = str_replace('//', '/', $upload_path);
1393 1393
 
1394 1394
     if ($upload_path == '/') {
1395
-        $upload_path='';
1395
+        $upload_path = '';
1396 1396
     } elseif (!empty($upload_path) && $upload_path[0] != '/') {
1397
-        $upload_path="/$upload_path";
1397
+        $upload_path = "/$upload_path";
1398 1398
     }
1399 1399
 
1400 1400
     $endchar = substr($filename, strlen($filename) - 1, 1);
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
     $img_path_list = array();
1433 1433
 
1434 1434
     if (!$fp = fopen($html_file, 'r')) {
1435
-        return ;
1435
+        return;
1436 1436
     }
1437 1437
 
1438 1438
     // Aearch and store occurences of the <img> tag in an array
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
         $img_tag_list = $matches[0];
1453 1453
     }
1454 1454
 
1455
-    fclose ($fp);
1455
+    fclose($fp);
1456 1456
     unset($buffer);
1457 1457
 
1458 1458
     // Search the image file path from all the <IMG> tag detected
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 
1552 1552
     if (!is_dir($base_work_dir.$systemFolderName)) {
1553 1553
         $result = mkdir(
1554
-            $base_work_dir . $systemFolderName,
1554
+            $base_work_dir.$systemFolderName,
1555 1555
             api_get_permissions_for_new_directories(),
1556 1556
             true
1557 1557
         );
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
                     WHERE
1565 1565
                         c_id = $course_id AND
1566 1566
                         (
1567
-                            path = '" . Database::escape_string($systemFolderName). "'
1567
+                            path = '".Database::escape_string($systemFolderName)."'
1568 1568
                         )
1569 1569
             ";
1570 1570
 
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
 
1722 1722
     // Fix the image tags
1723 1723
 
1724
-    for ($i = 0, $fileNb = count($original_img_path); $i < $fileNb ; $i++) {
1724
+    for ($i = 0, $fileNb = count($original_img_path); $i < $fileNb; $i++) {
1725 1725
         $replace_what = $original_img_path[$i];
1726 1726
         // We only need the directory and the filename /path/to/file_html_files/missing_file.gif -> file_html_files/missing_file.gif
1727 1727
         $exploded_file_path = explode('/', $new_img_path[$i]);
@@ -1762,7 +1762,7 @@  discard block
 block discarded – undo
1762 1762
         .'</body>'
1763 1763
         .'</html>';
1764 1764
     if (file_exists($file_path)) {
1765
-        if (!($fp = fopen ($file_path, 'w'))) {
1765
+        if (!($fp = fopen($file_path, 'w'))) {
1766 1766
             return false;
1767 1767
         }
1768 1768
         return fwrite($fp, $file_content);
@@ -1799,7 +1799,7 @@  discard block
 block discarded – undo
1799 1799
 {
1800 1800
     // Do we need a / or not?
1801 1801
     $added_slash = ($upload_path == '/') ? '' : '/';
1802
-    $folder_id      = DocumentManager::get_document_id(api_get_course_info(), $upload_path);
1802
+    $folder_id = DocumentManager::get_document_id(api_get_course_info(), $upload_path);
1803 1803
     // Build the form
1804 1804
     $form = "<p><strong>".get_lang('MissingImagesDetected')."</strong></p>"
1805 1805
         ."<form method=\"post\" action=\"".api_get_self()."\" enctype=\"multipart/form-data\">"
Please login to merge, or discard this patch.
main/inc/local.inc.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
             // is necessary verify check
218 218
             if ($legal_type == 1) {
219
-                if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) {
219
+                if ((isset($_POST['legal_accept']) && $_POST['legal_accept'] == '1')) {
220 220
                     $legal_option = true;
221 221
                 } else {
222 222
                     $legal_option = false;
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
                  * Process external authentication
505 505
                  * on the basis of the given login name
506 506
                  */
507
-                $loginFailed = true;  // Default initialisation. It could
507
+                $loginFailed = true; // Default initialisation. It could
508 508
                 // change after the external authentication
509 509
                 $key = $uData['auth_source']; //'ldap','shibboleth'...
510 510
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                      * Process external authentication
550 550
                      * on the basis of the given login name
551 551
                      */
552
-                    $loginFailed = true;  // Default initialisation. It could
552
+                    $loginFailed = true; // Default initialisation. It could
553 553
                     // change after the external authentication
554 554
                     $key = $uData['auth_source']; //'ldap','shibboleth'...
555 555
 
@@ -560,11 +560,11 @@  discard block
 block discarded – undo
560 560
             } else {
561 561
                 // change after the external authentication
562 562
                 // login failed, Database::num_rows($result) <= 0
563
-                $loginFailed = true;  // Default initialisation. It could
563
+                $loginFailed = true; // Default initialisation. It could
564 564
             }
565 565
 
566 566
             // login failed, Database::num_rows($result) <= 0
567
-            $loginFailed = true;  // Default initialisation. It could
567
+            $loginFailed = true; // Default initialisation. It could
568 568
             // change after the external authentication
569 569
 
570 570
             /*
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
                         include_once($thisAuthSource['newUser']);
594 594
                     } else {
595 595
                         error_log(
596
-                            'Chamilo Authentication external file' .
596
+                            'Chamilo Authentication external file'.
597 597
                             ' could not be found - this might prevent your system from using'.
598 598
                             ' the authentication process in the user creation process',
599 599
                             0
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
             online_logout(null, false);
706 706
             $osso->logout(); //redirects and exits
707 707
         }
708
-    } elseif (api_get_setting('openid_authentication')=='true') {
708
+    } elseif (api_get_setting('openid_authentication') == 'true') {
709 709
         if (!empty($_POST['openid_url'])) {
710 710
             include api_get_path(SYS_CODE_PATH).'auth/openid/login.php';
711 711
             openid_begin(trim($_POST['openid_url']), api_get_path(WEB_PATH).'index.php');
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
             if ($res['status'] == 'success') {
719 719
                 $id1 = Database::escape_string($res['openid.identity']);
720 720
                 //have another id with or without the final '/'
721
-                $id2 = (substr($id1, -1, 1)=='/'?substr($id1, 0, -1):$id1.'/');
721
+                $id2 = (substr($id1, -1, 1) == '/' ? substr($id1, 0, -1) : $id1.'/');
722 722
                 //lookup the user in the main database
723 723
                 $user_table = Database::get_main_table(TABLE_MAIN_USER);
724 724
                 $sql = "SELECT user_id, username, password, auth_source, active, expiration_date
@@ -727,14 +727,14 @@  discard block
 block discarded – undo
727 727
                         OR openid = '$id2' ";
728 728
                 $result = Database::query($sql);
729 729
                 if ($result !== false) {
730
-                    if (Database::num_rows($result)>0) {
730
+                    if (Database::num_rows($result) > 0) {
731 731
                         $uData = Database::fetch_array($result);
732 732
 
733 733
                         if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {
734 734
                             //the authentification of this user is managed by Chamilo itself
735 735
 
736 736
                             // check if the account is active (not locked)
737
-                            if ($uData['active']=='1') {
737
+                            if ($uData['active'] == '1') {
738 738
                                 // check if the expiration date has not been reached
739 739
                                 if ($uData['expiration_date'] > date('Y-m-d H:i:s')
740 740
                                     || empty($uData['expiration_date'])
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
     (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))
814 814
 ) {
815 815
     $cidReset = true;
816
-    $gidReset = true;    // As groups depend from courses, group id is reset
816
+    $gidReset = true; // As groups depend from courses, group id is reset
817 817
 }
818 818
 
819 819
 /* USER INIT */
@@ -957,8 +957,8 @@  discard block
 block discarded – undo
957 957
             $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
958 958
 
959 959
             if (!empty($_GET['id_session'])) {
960
-                $sql = 'SELECT name FROM '.$tbl_session . '
961
-                        WHERE id="'.intval($_GET['id_session']) . '"';
960
+                $sql = 'SELECT name FROM '.$tbl_session.'
961
+                        WHERE id="'.intval($_GET['id_session']).'"';
962 962
                 $rs = Database::query($sql);
963 963
                 if (Database::num_rows($rs)) {
964 964
                     list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
         // Moreover, if we want to track a course with another session it can be usefull
1046 1046
         if (!empty($_GET['id_session']) && is_numeric($_GET['id_session'])) {
1047 1047
             $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
1048
-            $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"';
1048
+            $sql = 'SELECT name FROM '.$tbl_session.' WHERE id="'.intval($_GET['id_session']).'"';
1049 1049
             $rs = Database::query($sql);
1050 1050
             if (Database::num_rows($rs)) {
1051 1051
                 list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
                     }
1170 1170
                 }
1171 1171
                 $url = api_get_path(WEB_CODE_PATH).'auth/inscription.php';
1172
-                header("Location:". $url);
1172
+                header("Location:".$url);
1173 1173
                 exit;
1174 1174
             }
1175 1175
         }
@@ -1189,8 +1189,8 @@  discard block
 block discarded – undo
1189 1189
         if (Database::num_rows($result) > 0) { // this  user have a recorded state for this course
1190 1190
             $cuData = Database::fetch_array($result, 'ASSOC');
1191 1191
 
1192
-            $is_courseAdmin = (bool)($cuData['status'] == 1);
1193
-            $is_courseTutor = (bool)($cuData['is_tutor'] == 1);
1192
+            $is_courseAdmin = (bool) ($cuData['status'] == 1);
1193
+            $is_courseTutor = (bool) ($cuData['is_tutor'] == 1);
1194 1194
             $is_courseMember = true;
1195 1195
         }
1196 1196
 
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
                 // This user has no status related to this course
1202 1202
                 // The user is subscribed in a session? The user is a Session coach a Session admin ?
1203 1203
 
1204
-                $tbl_session  = Database :: get_main_table(TABLE_MAIN_SESSION);
1204
+                $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
1205 1205
                 $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
1206 1206
                 $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
1207 1207
 
@@ -1506,12 +1506,12 @@  discard block
 block discarded – undo
1506 1506
     ($logging_in && exist_firstpage_parameter())
1507 1507
 ) {
1508 1508
     $redirectCourseDir = api_get_firstpage_parameter();
1509
-    api_delete_firstpage_parameter();    // delete the cookie
1509
+    api_delete_firstpage_parameter(); // delete the cookie
1510 1510
 
1511 1511
     if (!isset($_SESSION['request_uri'])) {
1512 1512
         if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1513 1513
             $_SESSION['noredirection'] = false;
1514
-            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1514
+            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1515 1515
         }
1516 1516
     }
1517 1517
 } elseif (api_user_is_login() && exist_firstpage_parameter()) {
@@ -1519,7 +1519,7 @@  discard block
 block discarded – undo
1519 1519
     api_delete_firstpage_parameter(); // delete the cookie
1520 1520
     if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1521 1521
         $_SESSION['noredirection'] = false;
1522
-        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1522
+        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1523 1523
     }
1524 1524
 }
1525 1525
 
Please login to merge, or discard this patch.