Passed
Push — 1.10.x ( f9cbcd...83c791 )
by Yannick
657:30 queued 614:41
created
main/admin/course_export.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 api_protect_admin_script();
15 15
 
16 16
 $tool_name = get_lang('ExportCourses');
17
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
17
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
18 18
 
19 19
 set_time_limit(0);
20 20
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 
63 63
         $dataToExport = [];
64 64
         foreach ($courses as $course) {
65
-            $dataToExport['code'] = str_replace(';',',',$course['code']);
66
-            $dataToExport['title'] = str_replace(';',',',$course['title']);
67
-            $dataToExport['category_code'] = str_replace(';',',',$course['category_code']);
68
-            $dataToExport['tutor_name'] = str_replace(';',',',$course['tutor_name']);
69
-            $dataToExport['course_language'] = str_replace(';',',',$course['course_language']);
65
+            $dataToExport['code'] = str_replace(';', ',', $course['code']);
66
+            $dataToExport['title'] = str_replace(';', ',', $course['title']);
67
+            $dataToExport['category_code'] = str_replace(';', ',', $course['category_code']);
68
+            $dataToExport['tutor_name'] = str_replace(';', ',', $course['tutor_name']);
69
+            $dataToExport['course_language'] = str_replace(';', ',', $course['course_language']);
70 70
 
71 71
             $dataToExport['students'] = '';
72 72
             $dataToExport['teachers'] = '';
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
 	$form->addHtml('</div>');
149 149
 }
150 150
 
151
-$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null);
152
-$form->addElement('radio', 'file_type', '' , 'XLS' , 'xls', null);
151
+$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV', 'csv', null);
152
+$form->addElement('radio', 'file_type', '', 'XLS', 'xls', null);
153 153
 $form->addElement('radio', 'file_type', null, 'XML', 'xml', null, array('id' => 'file_type_xml'));
154 154
 
155 155
 $form->setDefaults(['select_type' => '1', 'file_type' => 'csv']);
Please login to merge, or discard this patch.
main/admin/ldap_form_add_users_group.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 /**
10 10
  * This form is included by ldap_import_students.php and ldap_import_students_to_session.php
11 11
  */
12
-$nbre=0;
12
+$nbre = 0;
13 13
 echo '<form name="form" method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'">';
14
-	if($statut==1)
14
+	if ($statut == 1)
15 15
 	{
16 16
 		echo get_lang('EmailNotifySubscription').': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang('DontUnchek').'</i>';
17 17
 	}
@@ -19,30 +19,30 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		echo '<input type="hidden" name="mailling" value="1">';
21 21
 	}
22
-if(!empty($course))
22
+if (!empty($course))
23 23
 {
24 24
 	echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">';
25 25
 }
26
-elseif(!empty($id_session))
26
+elseif (!empty($id_session))
27 27
 {
28 28
 	echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">';
29 29
 }
30 30
 $is_western_name_order = api_is_western_name_order();
31 31
 echo '<input type="hidden" name="confirmed" value="yes">';
32 32
 echo '<table border="0" cellspacing="0" width="100%">';
33
-echo '<tr align="center" id="header3">' .
34
-		'<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' .
35
-		'<td width="40%"><b>'.get_lang('Email').'</b></td>' .
33
+echo '<tr align="center" id="header3">'.
34
+		'<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>'.
35
+		'<td width="40%"><b>'.get_lang('Email').'</b></td>'.
36 36
 		($is_western_name_order
37
-			? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' .
37
+			? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>'.
38 38
 			'<td width="15%"><b>'.get_lang('Name').'</b></td>'
39
-			: '<td width="15%"><b>'.get_lang('Name').'</b></td>' .
40
-			'<td width="15%"><b>'.get_lang('FirstName').'</b></td>') .
41
-		'<td width="15%"><b>'.get_lang('Login').'</b></td>' .
39
+			: '<td width="15%"><b>'.get_lang('Name').'</b></td>'.
40
+			'<td width="15%"><b>'.get_lang('FirstName').'</b></td>').
41
+		'<td width="15%"><b>'.get_lang('Login').'</b></td>'.
42 42
 	  '</tr>'."\n";
43 43
 while (list ($key, $val) = each($nom_form)) {
44
-	$nbre=$nbre+1;
45
-	if($nbre & 1) $ndiv=2; else $ndiv=3;
44
+	$nbre = $nbre + 1;
45
+	if ($nbre & 1) $ndiv = 2; else $ndiv = 3;
46 46
 	echo '<tr align="center" id="header'.$ndiv.'">';
47 47
 	echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
48 48
 	echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
Please login to merge, or discard this patch.
main/admin/skill_list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 }
21 21
 
22 22
 $action = isset($_GET['action']) ? $_GET['action'] : 'list';
23
-$skillId = isset($_GET['id']) ? intval($_GET['id']): 0;
23
+$skillId = isset($_GET['id']) ? intval($_GET['id']) : 0;
24 24
 
25 25
 $entityManager = Database::getManager();
26 26
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             );
56 56
         }
57 57
 
58
-        header('Location: ' . api_get_self());
58
+        header('Location: '.api_get_self());
59 59
         exit;
60 60
         break;
61 61
     case 'disable':
@@ -108,33 +108,33 @@  discard block
 block discarded – undo
108 108
             );
109 109
         }
110 110
 
111
-        header('Location: ' . api_get_self());
111
+        header('Location: '.api_get_self());
112 112
         exit;
113 113
         break;
114 114
     case 'list':
115 115
         //no break
116 116
     default:
117
-        $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
117
+        $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
118 118
 
119 119
         $message = Session::has('message') ? Session::read('message') : null;
120 120
 
121 121
         $toolbar = Display::toolbarButton(
122 122
             get_lang('CreateSkill'),
123
-            api_get_path(WEB_CODE_PATH) . 'admin/skill_create.php',
123
+            api_get_path(WEB_CODE_PATH).'admin/skill_create.php',
124 124
             'plus',
125 125
             'success',
126 126
             ['title' => get_lang('CreateSkill')]
127 127
         );
128 128
         $toolbar .= Display::toolbarButton(
129 129
             get_lang('SkillsWheel'),
130
-            api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php',
130
+            api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php',
131 131
             'bullseye',
132 132
             'primary',
133 133
             ['title' => get_lang('CreateSkill')]
134 134
         );
135 135
         $toolbar .= Display::toolbarButton(
136 136
             get_lang('BadgesManagement'),
137
-            api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php',
137
+            api_get_path(WEB_CODE_PATH).'admin/skill_badge_list.php',
138 138
             'shield',
139 139
             'warning',
140 140
             ['title' => get_lang('BadgesManagement')]
Please login to merge, or discard this patch.
main/admin/inactive_user_list.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@
 block discarded – undo
24 24
 Display :: display_header($tool_name, "");
25 25
 
26 26
 //On sélectionne les user élèves
27
-$sql = "SELECT user_id FROM ".$table_user." user WHERE user.status= '5' ORDER by lastname " ;
27
+$sql = "SELECT user_id FROM ".$table_user." user WHERE user.status= '5' ORDER by lastname ";
28 28
 $result = Database::query($sql);
29 29
 
30
-while($row = Database::fetch_array($result)) {
30
+while ($row = Database::fetch_array($result)) {
31 31
     $user_id = $row['user_id'];
32 32
     //  pour chaque élève, on trouve la dernière connexion
33 33
     //$last_connection_date = UserManager:: delete_inactive_student($user_id, 2, true);
Please login to merge, or discard this patch.
main/admin/usergroup_user_import.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
         foreach ($mandatory_fields as $field) {
27 27
             if (!isset($user_class[$field]) || strlen($user_class[$field]) == 0) {
28
-                $user_class['error'] = get_lang($field . 'Mandatory');
28
+                $user_class['error'] = get_lang($field.'Mandatory');
29 29
                 $errors[] = $user_class;
30 30
             }
31 31
         }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                 // 2.1.1 Check whether code exists in DB
38 38
                 $exists = $usergroup->usergroup_exists($user_class['ClassName']);
39 39
                 if (!$exists) {
40
-                    $user_class['error'] = get_lang('CodeDoesNotExists') . ': ' . $user_class['ClassName'];
40
+                    $user_class['error'] = get_lang('CodeDoesNotExists').': '.$user_class['ClassName'];
41 41
                     $errors[] = $user_class;
42 42
                 } else {
43 43
                     $classcodes[$user_class['CourseCode']] = 1;
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
         if (!UserManager::is_username_empty($user_class['UserName'])) {
50 50
             // 3.1. Check whether username is too long.
51 51
             if (UserManager::is_username_too_long($user_class['UserName'])) {
52
-                $user_class['error'] = get_lang('UserNameTooLong') . ': ' . $user_class['UserName'];
52
+                $user_class['error'] = get_lang('UserNameTooLong').': '.$user_class['UserName'];
53 53
                 $errors[] = $user_class;
54 54
             }
55 55
 
56 56
             $username = UserManager::purify_username($user_class['UserName'], $purification_option_for_usernames);
57 57
             // 3.2. Check whether username exists.
58 58
             if (UserManager::is_username_available($username)) {
59
-                $user_class['error'] = get_lang('UnknownUser') . ': ' . $username;
59
+                $user_class['error'] = get_lang('UnknownUser').': '.$username;
60 60
                 $errors[] = $user_class;
61 61
             }
62 62
         }
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
             $class_name = $user_data['class_name'];
106 106
             $user_list_name = $user_data['user_list_name'];
107 107
             $usergroup->subscribe_users_to_usergroup($class_id, $user_list, $deleteUsersNotInList);
108
-            $message .= Display::return_message(get_lang('Class') . ': ' . $class_name . '<br />', 'normal', false);
109
-            $message .= Display::return_message(get_lang('Users') . ': ' . implode(', ', $user_list_name));
108
+            $message .= Display::return_message(get_lang('Class').': '.$class_name.'<br />', 'normal', false);
109
+            $message .= Display::return_message(get_lang('Users').': '.implode(', ', $user_list_name));
110 110
         }
111 111
     }
112 112
     return $message;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 $this_section = SECTION_PLATFORM_ADMIN;
129 129
 api_protect_admin_script(true);
130 130
 
131
-$tool_name = get_lang('AddUsersToAClass') . ' CSV';
131
+$tool_name = get_lang('AddUsersToAClass').' CSV';
132 132
 
133 133
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
134 134
 $interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 if (count($errors) != 0) {
165 165
     $error_message = "\n";
166 166
     foreach ($errors as $index => $error_class_user) {
167
-        $error_message .= get_lang('Line') . ' ' . $error_class_user['line'] . ': ' . $error_class_user['error'] . '</b>';
167
+        $error_message .= get_lang('Line').' '.$error_class_user['line'].': '.$error_class_user['error'].'</b>';
168 168
         $error_message .= "<br />";
169 169
     }
170 170
     $error_message .= "\n";
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 }
173 173
 $form->display();
174 174
 ?>
175
-<p><?php echo get_lang('CSVMustLookLike') . ' (' . get_lang('MandatoryFields') . ')'; ?> :</p>
175
+<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
176 176
 <pre>
177 177
 <b>UserName</b>;<b>ClassName</b>
178 178
 jdoe;class01
Please login to merge, or discard this patch.
main/admin/user_list.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 function display_advanced_search_form () {
107 107
     if ($("#advanced_search_form").css("display") == "none") {
108 108
         $("#advanced_search_form").css("display","block");
109
-        $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
109
+        $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif', get_lang('Hide'), array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
110 110
     } else {
111 111
         $("#advanced_search_form").css("display","none");
112
-        $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
112
+        $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif', get_lang('Show'), array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
113 113
     }
114 114
 }
115 115
 
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 
186 186
     // adding the filter to see the user's only of the current access_url
187 187
     if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
188
-        $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
189
-        $sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.id=url_rel_user.user_id)";
188
+        $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
189
+        $sql .= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.id=url_rel_user.user_id)";
190 190
     }
191 191
 
192 192
     $keywordList = array(
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
     if (isset($keyword_extra_data) && !empty($keyword_extra_data)) {
218 218
         $extra_info = UserManager::get_extra_field_information_by_name($keyword_extra_data);
219 219
         $field_id = $extra_info['id'];
220
-        $sql.= " INNER JOIN user_field_values ufv ON u.id=ufv.user_id AND ufv.field_id=$field_id ";
220
+        $sql .= " INNER JOIN user_field_values ufv ON u.id=ufv.user_id AND ufv.field_id=$field_id ";
221 221
     }
222 222
 
223 223
     if (isset($_GET['keyword']) && !empty($_GET['keyword'])) {
224
-        $keywordFiltered = Database::escape_string("%". $_GET['keyword'] ."%");
224
+        $keywordFiltered = Database::escape_string("%".$_GET['keyword']."%");
225 225
         $sql .= " WHERE (
226 226
                     u.firstname LIKE '$keywordFiltered' OR
227 227
                     u.lastname LIKE '$keywordFiltered' OR
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 
253 253
         $sql .= " $query_admin_table
254 254
                 WHERE (
255
-                    u.firstname LIKE '". Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND
255
+                    u.firstname LIKE '".Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND
256 256
                     u.lastname LIKE '". Database::escape_string("%".$keywordListValues['keyword_lastname']."%")."' AND
257 257
                     u.username LIKE '". Database::escape_string("%".$keywordListValues['keyword_username']."%")."' AND
258 258
                     u.email LIKE '". Database::escape_string("%".$keywordListValues['keyword_email']."%")."' AND
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
         if (isset($keyword_active) && !isset($keyword_inactive)) {
266 266
             $sql .= " AND u.active='1'";
267
-        } elseif(isset($keyword_inactive) && !isset($keyword_active)) {
267
+        } elseif (isset($keyword_inactive) && !isset($keyword_active)) {
268 268
             $sql .= " AND u.active='0'";
269 269
         }
270 270
         $sql .= " ) ";
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
     $lastname = $userInfo['lastname'];
308 308
 
309 309
 	if (api_is_western_name_order()) {
310
-		$message = sprintf(get_lang('AttemptingToLoginAs'),$firstname,$lastname, $userId);
310
+		$message = sprintf(get_lang('AttemptingToLoginAs'), $firstname, $lastname, $userId);
311 311
 	} else {
312 312
 		$message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId);
313 313
 	}
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
         Session::write('login_as', true);
342 342
 
343 343
         $target_url = api_get_path(WEB_PATH)."user_portal.php";
344
-        $message .= '<br />'.sprintf(get_lang('LoginSuccessfulGoToX'),'<a href="'.$target_url.'">'.$target_url.'</a>');
344
+        $message .= '<br />'.sprintf(get_lang('LoginSuccessfulGoToX'), '<a href="'.$target_url.'">'.$target_url.'</a>');
345 345
         Display :: display_header(get_lang('UserList'));
346 346
         Display :: display_normal_message($message, false);
347 347
         Display :: display_footer();
@@ -384,11 +384,11 @@  discard block
 block discarded – undo
384 384
         $sql .= "AND password LIKE '$easyPassword' ";
385 385
     }*/
386 386
 
387
-    if (!in_array($direction, array('ASC','DESC'))) {
387
+    if (!in_array($direction, array('ASC', 'DESC'))) {
388 388
     	$direction = 'ASC';
389 389
     }
390 390
     $column = intval($column);
391
-    $from 	= intval($from);
391
+    $from = intval($from);
392 392
     $number_of_items = intval($number_of_items);
393 393
 
394 394
     $preventSessionAdminsToManageAllUsers = api_get_setting('prevent_session_admins_to_manage_all_users');
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 
402 402
 	$res = Database::query($sql);
403 403
 
404
-	$users = array ();
404
+	$users = array();
405 405
     $t = time();
406 406
 	while ($user = Database::fetch_row($res)) {
407 407
 		$userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL);
@@ -462,13 +462,13 @@  discard block
 block discarded – undo
462 462
  */
463 463
 function modify_filter($user_id, $url_params, $row) {
464 464
 	global $charset, $_admins_list;
465
-	$is_admin   = in_array($user_id,$_admins_list);
465
+	$is_admin   = in_array($user_id, $_admins_list);
466 466
 	$statusname = api_get_status_langvars();
467 467
 	$user_is_anonymous = false;
468 468
     $current_user_status_label = $row['7'];
469 469
 
470 470
 	if ($current_user_status_label == $statusname[ANONYMOUS]) {
471
-		$user_is_anonymous =true;
471
+		$user_is_anonymous = true;
472 472
 	}
473 473
 	$result = '';
474 474
 	if (!$user_is_anonymous) {
@@ -484,8 +484,8 @@  discard block
 block discarded – undo
484 484
 					<div class="blackboard_hide" id="div_s_'.$user_id.'">&nbsp;&nbsp;</div>
485 485
 					</a>';
486 486
 	} else {
487
-		$result .= Display::return_icon('course_na.png',get_lang('Courses')).'&nbsp;&nbsp;';
488
-		$result .= Display::return_icon('course_na.png',get_lang('Sessions')).'&nbsp;&nbsp;';
487
+		$result .= Display::return_icon('course_na.png', get_lang('Courses')).'&nbsp;&nbsp;';
488
+		$result .= Display::return_icon('course_na.png', get_lang('Sessions')).'&nbsp;&nbsp;';
489 489
 	}
490 490
 
491 491
 	if (api_is_platform_admin()) {
@@ -521,14 +521,14 @@  discard block
 block discarded – undo
521 521
         $editProfileUrl = Display::getProfileEditionLink($user_id, true);
522 522
 
523 523
         if (!$user_is_anonymous && api_global_admin_can_edit_admin($user_id, null, true)) {
524
-            $result .= '<a href="' . $editProfileUrl . '">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
524
+            $result .= '<a href="'.$editProfileUrl.'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
525 525
 		} else {
526 526
             $result .= Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
527 527
 		}
528 528
 	}
529 529
 
530 530
 	if ($is_admin) {
531
-		$result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'),array('width'=> ICON_SIZE_SMALL, 'heigth'=> ICON_SIZE_SMALL));
531
+		$result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'), array('width'=> ICON_SIZE_SMALL, 'heigth'=> ICON_SIZE_SMALL));
532 532
 	} else {
533 533
 		$result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator'));
534 534
 	}
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
                 api_global_admin_can_edit_admin($user_id)
581 581
             ) {
582 582
                 // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
583
-                $result .= ' <a href="user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.$_SESSION['sec_token'].'"  onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
583
+                $result .= ' <a href="user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.$_SESSION['sec_token'].'"  onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
584 584
             } else {
585 585
                 $result .= Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
586 586
             }
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 
619 619
     if ($action == 'edit') {
620 620
         $result = Display::return_icon($image.'.png', get_lang('AccountExpired'), array(), 16);
621
-    } elseif ($row['0']<>$_user['user_id']) {
621
+    } elseif ($row['0'] <> $_user['user_id']) {
622 622
     	// you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
623 623
 		$result = Display::return_icon($image.'.png', get_lang(ucfirst($action)), array('onclick'=>'active_user(this);', 'id'=>'img_'.$row['0']), 16).'</a>';
624 624
 	}
@@ -640,11 +640,11 @@  discard block
 block discarded – undo
640 640
 }
641 641
 
642 642
 if (isset($_GET['keyword']) || isset($_GET['keyword_firstname'])) {
643
-    $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
644
-    $interbreadcrumb[] = array ("url" => 'user_list.php', "name" => get_lang('UserList'));
643
+    $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
644
+    $interbreadcrumb[] = array("url" => 'user_list.php', "name" => get_lang('UserList'));
645 645
     $tool_name = get_lang('SearchUsers');
646 646
 } else {
647
-    $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
647
+    $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
648 648
     $tool_name = get_lang('UserList');
649 649
 }
650 650
 
@@ -657,10 +657,10 @@  discard block
 block discarded – undo
657 657
             case 'add_user_to_my_url':
658 658
                 $user_id = $_REQUEST["user_id"];
659 659
                 $result = UrlManager::add_user_to_url($user_id, $current_access_url_id);
660
-                if ($result ) {
660
+                if ($result) {
661 661
                     $user_info = api_get_user_info($user_id);
662 662
                     $message = get_lang('UserAdded').' '.$user_info['firstname'].' '.$user_info['lastname'].' ('.$user_info['username'].')';
663
-                    $message  = Display::return_message($message, 'confirmation');
663
+                    $message = Display::return_message($message, 'confirmation');
664 664
                 }
665 665
                 break;
666 666
 			case 'show_message' :
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 							$message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error');
695 695
 						}
696 696
 					} else {
697
-						$message = Display :: return_message(get_lang('CannotDeleteUser'),'error');
697
+						$message = Display :: return_message(get_lang('CannotDeleteUser'), 'error');
698 698
 					}
699 699
 				}
700 700
 				break;
@@ -704,8 +704,8 @@  discard block
 block discarded – undo
704 704
 					$number_of_deleted_users = 0;
705 705
 					if (is_array($_POST['id'])) {
706 706
 						foreach ($_POST['id'] as $index => $user_id) {
707
-							if($user_id != $_user['user_id']) {
708
-								if(UserManager :: delete_user($user_id)) {
707
+							if ($user_id != $_user['user_id']) {
708
+								if (UserManager :: delete_user($user_id)) {
709 709
 									$number_of_deleted_users++;
710 710
 								}
711 711
 							}
@@ -738,17 +738,17 @@  discard block
 block discarded – undo
738 738
     </a>'
739 739
 );
740 740
 
741
-$actions  = '';
741
+$actions = '';
742 742
 if (api_is_platform_admin()) {
743 743
 	$actions .= '<div style="float:right;">'.
744 744
 		 '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.
745
-         Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>'.
745
+         Display::return_icon('new_user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>'.
746 746
 		 '</div>';
747 747
 }
748 748
 $actions .= $form->return_form();
749 749
 
750 750
 if (isset ($_GET['keyword'])) {
751
-	$parameters = array ('keyword' => Security::remove_XSS($_GET['keyword']));
751
+	$parameters = array('keyword' => Security::remove_XSS($_GET['keyword']));
752 752
 } elseif (isset ($_GET['keyword_firstname'])) {
753 753
 	$parameters['keyword_firstname'] 	= Security::remove_XSS($_GET['keyword_firstname']);
754 754
 	$parameters['keyword_lastname']	 	= Security::remove_XSS($_GET['keyword_lastname']);
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 	$parameters['keyword_officialcode'] = Security::remove_XSS($_GET['keyword_officialcode']);
758 758
 	$parameters['keyword_status'] 		= Security::remove_XSS($_GET['keyword_status']);
759 759
 	$parameters['keyword_active'] 		= Security::remove_XSS($_GET['keyword_active']);
760
-	$parameters['keyword_inactive'] 	= Security::remove_XSS($_GET['keyword_inactive']);
760
+	$parameters['keyword_inactive'] = Security::remove_XSS($_GET['keyword_inactive']);
761 761
 }
762 762
 // Create a sortable table with user-data
763 763
 $parameters['sec_token'] = Security::get_token();
@@ -774,15 +774,15 @@  discard block
 block discarded – undo
774 774
 // Display Advanced search form.
775 775
 $form = new FormValidator('advanced_search', 'get', '', '', array(), FormValidator::LAYOUT_HORIZONTAL);
776 776
 
777
-$form->addElement('html','<div id="advanced_search_form" style="display:none;">');
777
+$form->addElement('html', '<div id="advanced_search_form" style="display:none;">');
778 778
 $form->addElement('header', get_lang('AdvancedSearch'));
779
-$form->addText('keyword_firstname',get_lang('FirstName'),false);
780
-$form->addText('keyword_lastname',get_lang('LastName'),false);
779
+$form->addText('keyword_firstname', get_lang('FirstName'), false);
780
+$form->addText('keyword_lastname', get_lang('LastName'), false);
781 781
 
782
-$form->addText('keyword_username',get_lang('LoginName'),false);
783
-$form->addText('keyword_email',get_lang('Email'),false);
782
+$form->addText('keyword_username', get_lang('LoginName'), false);
783
+$form->addText('keyword_email', get_lang('Email'), false);
784 784
 
785
-$form->addText('keyword_officialcode',get_lang('OfficialCode'),false);
785
+$form->addText('keyword_officialcode', get_lang('OfficialCode'), false);
786 786
 
787 787
 $status_options = array();
788 788
 $status_options['%'] = get_lang('All');
@@ -792,12 +792,12 @@  discard block
 block discarded – undo
792 792
 $status_options[SESSIONADMIN] = get_lang('SessionsAdmin');
793 793
 $status_options[PLATFORM_ADMIN] = get_lang('Administrator');
794 794
 
795
-$form->addElement('select','keyword_status',get_lang('Profile'), $status_options    );
795
+$form->addElement('select', 'keyword_status', get_lang('Profile'), $status_options);
796 796
 
797 797
 $active_group = array();
798
-$active_group[] = $form->createElement('checkbox','keyword_active','', get_lang('Active'));
799
-$active_group[] = $form->createElement('checkbox','keyword_inactive','', get_lang('Inactive'));
800
-$form->addGroup($active_group,'',get_lang('ActiveAccount'), '<br/>',false);
798
+$active_group[] = $form->createElement('checkbox', 'keyword_active', '', get_lang('Active'));
799
+$active_group[] = $form->createElement('checkbox', 'keyword_inactive', '', get_lang('Inactive'));
800
+$form->addGroup($active_group, '', get_lang('ActiveAccount'), '<br/>', false);
801 801
 
802 802
 $form->addElement('checkbox', 'check_easy_passwords', null, get_lang('CheckEasyPasswords'));
803 803
 
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 $defaults['keyword_active'] = 1;
809 809
 $defaults['keyword_inactive'] = 1;
810 810
 $form->setDefaults($defaults);
811
-$form->addElement('html','</div>');
811
+$form->addElement('html', '</div>');
812 812
 
813 813
 $form = $form->returnForm();
814 814
 
@@ -890,10 +890,10 @@  discard block
 block discarded – undo
890 890
                 }
891 891
                 if ($add_user) {
892 892
                     $row_table = array();
893
-                    $row_table[] =  api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') ';
894
-                    $row_table[] =  $access_info_to_string;
893
+                    $row_table[] = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') ';
894
+                    $row_table[] = $access_info_to_string;
895 895
                     $url = api_get_self().'?action=add_user_to_my_url&user_id='.$user['id'].'&sec_token='.$_SESSION['sec_token'];
896
-                    $row_table[] =  Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn'));
896
+                    $row_table[] = Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn'));
897 897
 
898 898
                     foreach ($row_table as $cell) {
899 899
                         $table->setCellContents($row, $column, $cell);
Please login to merge, or discard this patch.
main/admin/index.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 $nameTools = get_lang('PlatformAdmin');
20 20
 
21 21
 $accessUrlId = 0;
22
-$adminExtraContentDir = api_get_path(SYS_APP_PATH) . "home/admin/";
22
+$adminExtraContentDir = api_get_path(SYS_APP_PATH)."home/admin/";
23 23
 
24 24
 if (api_is_multiple_url_enabled()) {
25 25
     $accessUrlId = api_get_current_access_url_id();
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $urlInfo = api_get_access_url($accessUrlId);
29 29
         $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $urlInfo['url']));
30 30
         $cleanUrl = str_replace('/', '-', $url);
31
-        $adminExtraContentDir = api_get_path(SYS_APP_PATH) . "home/$cleanUrl/admin/";
31
+        $adminExtraContentDir = api_get_path(SYS_APP_PATH)."home/$cleanUrl/admin/";
32 32
     }
33 33
 }
34 34
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             <div class="form-group">
97 97
                 <input class="form-control" type="text" name="keyword" value="">
98 98
                 <button class="btn btn-default" type="submit">
99
-                    <em class="fa fa-search"></em> ' . get_lang('Search') . '
99
+                    <em class="fa fa-search"></em> ' . get_lang('Search').'
100 100
                 </button>
101 101
             </div>
102 102
         </form>';
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             <div class="form-group">
150 150
                 <input class="form-control" type="text" name="keyword" value="">
151 151
                 <button class="btn btn-default" type="submit">
152
-                    <em class="fa fa-search"></em> ' . get_lang('Search') . '
152
+                    <em class="fa fa-search"></em> ' . get_lang('Search').'
153 153
                 </button>
154 154
             </div>
155 155
         </form>';
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                 <input class="form-control" type="text" name="search_field" value="" >
210 210
                 <input type="hidden" value="search_setting" name="category">
211 211
                 <button class="btn btn-default" type="submit">
212
-                    <em class="fa fa-search"></em> ' . get_lang('Search') . '
212
+                    <em class="fa fa-search"></em> ' . get_lang('Search').'
213 213
                 </button>
214 214
             </div>
215 215
         </form>';
@@ -222,18 +222,18 @@  discard block
 block discarded – undo
222 222
     $items[] = array('url' => 'settings.php?category=Regions', 'label' => get_lang('Regions'));
223 223
     $items[] = array('url' => 'system_announcements.php', 'label' => get_lang('SystemAnnouncements'));
224 224
     $items[] = array(
225
-        'url' => api_get_path(WEB_CODE_PATH) . 'calendar/agenda_js.php?type=admin',
225
+        'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?type=admin',
226 226
         'label' => get_lang('GlobalAgenda')
227 227
     );
228 228
     $items[] = array('url' => 'configure_homepage.php', 'label' => get_lang('ConfigureHomePage'));
229 229
     $items[] = array('url' => 'configure_inscription.php', 'label' => get_lang('ConfigureInscription'));
230 230
     $items[] = array('url' => 'statistics/index.php', 'label' => get_lang('Statistics'));
231 231
     $items[] = array(
232
-        'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/company_reports.php',
232
+        'url' => api_get_path(WEB_CODE_PATH).'mySpace/company_reports.php',
233 233
         'label' => get_lang('Reports')
234 234
     );
235 235
     $items[] = array(
236
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/teacher_time_report.php',
236
+        'url' => api_get_path(WEB_CODE_PATH).'admin/teacher_time_report.php',
237 237
         'label' => get_lang('TeacherTimeReport')
238 238
     );
239 239
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
                     <div class="form-group">
283 283
                         <input class="form-control" type="text" name="keyword" value="">
284 284
                         <button class="btn btn-default" type="submit">
285
-                            <em class="fa fa-search"></em> ' . get_lang('Search') . '
285
+                            <em class="fa fa-search"></em> ' . get_lang('Search').'
286 286
                         </button>
287 287
                     </div>
288 288
                 </form>';
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 
311 311
 if (api_is_platform_admin()) {
312 312
     // option only visible in development mode. Enable through code if required
313
-    if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) {
313
+    if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) {
314 314
         $items[] = array('url' => 'user_move_stats.php', 'label' => get_lang('MoveUserStats'));
315 315
     }
316 316
     $items[] = array('url' => 'career_dashboard.php', 'label' => get_lang('CareersAndPromotions'));
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
     $items = array();
338 338
     $items[] = array('url' => 'special_exports.php', 'label' => get_lang('SpecialExports'));
339 339
     $items[] = array('url' => 'system_status.php', 'label' => get_lang('SystemStatus'));
340
-    if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) {
340
+    if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) {
341 341
         $items[] = array('url' => 'filler.php', 'label' => get_lang('DataFiller'));
342 342
     }
343 343
 
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
         $items[] = array('url' => 'skill_list.php', 'label' => get_lang('ManageSkills'));
382 382
         //$items[] = array('url'=>'skills_profile.php',   'label' => get_lang('SkillsProfile'));
383 383
         $items[] = array(
384
-            'url' => api_get_path(WEB_CODE_PATH) . 'social/skills_ranking.php',
384
+            'url' => api_get_path(WEB_CODE_PATH).'social/skills_ranking.php',
385 385
             'label' => get_lang('SkillsRanking')
386 386
         );
387 387
         $items[] = array('url' => 'skills_gradebook.php', 'label' => get_lang('SkillsAndGradebooks'));
388 388
         $items[] = array(
389
-            'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php',
389
+            'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
390 390
             'label' => get_lang('Badges')
391 391
         );
392 392
         $blocks['skills']['items'] = $items;
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         }
440 440
     }
441 441
 }
442
-$admin_ajax_url = api_get_path(WEB_AJAX_PATH) . 'admin.ajax.php';
442
+$admin_ajax_url = api_get_path(WEB_AJAX_PATH).'admin.ajax.php';
443 443
 
444 444
 $tpl = new Template();
445 445
 
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                 die;
493 493
             }
494 494
 
495
-            $fullFilePath = $adminExtraContentDir . $extraData['block'];
495
+            $fullFilePath = $adminExtraContentDir.$extraData['block'];
496 496
             $fullFilePath .= "_extra.html";
497 497
 
498 498
             file_put_contents($fullFilePath, $extraData['extra_content']);
Please login to merge, or discard this patch.
main/admin/event_type.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 
46 46
 $languages = api_get_languages();
47 47
 
48
-$ajaxPath = api_get_path(WEB_CODE_PATH) . 'inc/ajax/events.ajax.php';
48
+$ajaxPath = api_get_path(WEB_CODE_PATH).'inc/ajax/events.ajax.php';
49 49
 
50
-$action_array = array(array('url' =>'event_controller.php?action=listing' , 'content' => Display::return_icon('view_text.png', get_lang('ListView'), array(), ICON_SIZE_MEDIUM)));
50
+$action_array = array(array('url' =>'event_controller.php?action=listing', 'content' => Display::return_icon('view_text.png', get_lang('ListView'), array(), ICON_SIZE_MEDIUM)));
51 51
 
52 52
 $key_lang = get_lang('YouHaveSomeUnsavedChanges');
53 53
 $users = UserManager::get_user_list(array(), array('firstname'));
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
         <select class="col-md-6" multiple="1" id="eventList" onchange="confirmMessage(this.name); return false;" name="eventList">
312 312
         <?php
313 313
         foreach ($event_config as $key => $config) {
314
-            echo '<option value="' . $key . '">' . $config['name_lang_var'] . '</option>';
314
+            echo '<option value="'.$key.'">'.$config['name_lang_var'].'</option>';
315 315
         }
316 316
         ?>
317 317
         </select>
Please login to merge, or discard this patch.
main/admin/user_update_import.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
             // We are sure that the extra field exists.
216 216
             foreach ($extra_fields as $extras) {
217 217
                 if (isset($user[$extras[1]])) {
218
-                    $key 	= $extras[1];
219
-                    $value 	= $user[$extras[1]];
218
+                    $key = $extras[1];
219
+                    $value = $user[$extras[1]];
220 220
                     UserManager::update_extra_field_value($user_id, $key, $value);
221 221
                 }
222 222
             }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     global $current_tag;
254 254
     switch ($data) {
255 255
         case 'Contact':
256
-            $user = array ();
256
+            $user = array();
257 257
             break;
258 258
         default:
259 259
             $current_tag = $data;
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
     if (in_array($ext_import_file, $allowed_file_mimetype)) {
352 352
         if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) {
353
-            $users	= parse_csv_data($_FILES['import_file']['tmp_name']);
353
+            $users = parse_csv_data($_FILES['import_file']['tmp_name']);
354 354
             $errors = validate_data($users);
355 355
             $error_kind_file = false;
356 356
         } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) {
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
     Display::display_error_message($error_message);
425 425
 }
426 426
 
427
-$form = new FormValidator('user_update_import','post','user_update_import.php');
427
+$form = new FormValidator('user_update_import', 'post', 'user_update_import.php');
428 428
 $form->addElement('header', '', $tool_name);
429 429
 $form->addElement('hidden', 'formSent');
430 430
 $form->addElement('file', 'import_file', get_lang('ImportFileLocation'));
Please login to merge, or discard this patch.