Passed
Push — 1.10.x ( a88556...93cae2 )
by
unknown
51:38
created
main/admin/user_update_import.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* For licensing terms, see /license.txt */
3 3
 /**
4
- * This tool allows platform admins to add users by uploading a CSV or XML file
5
- * @package chamilo.admin
6
- */
4
+         * This tool allows platform admins to add users by uploading a CSV or XML file
5
+         * @package chamilo.admin
6
+         */
7 7
 
8 8
 /**
9 9
  * Validate the imported data.
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
                     $user['error'] = get_lang('UserNameNotAvailable');
61 61
                     $errors[] = $user;
62 62
                 }
63
-             }
64
-          }
63
+                }
64
+            }
65 65
 
66 66
         // 3. Check status.
67 67
         if (isset($user['Status']) && !api_status_exists($user['Status'])) {
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
     return $users;
243 243
 }
244 244
 /**
245
- * XML-parser: handle start of element
246
- * @param   string  $parser Deprecated?
247
- * @param   string  $data The data to be parsed
248
- */
245
+     * XML-parser: handle start of element
246
+     * @param   string  $parser Deprecated?
247
+     * @param   string  $data The data to be parsed
248
+     */
249 249
 function element_start($parser, $data)
250 250
 {
251 251
     $data = api_utf8_decode($data);
Please login to merge, or discard this patch.
main/admin/user_import.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -241,10 +241,10 @@
 block discarded – undo
241 241
     return $users;
242 242
 }
243 243
 /**
244
- * XML-parser: handle start of element
245
- * @param   string  $parser Deprecated?
246
- * @param   string  $data The data to be parsed
247
- */
244
+     * XML-parser: handle start of element
245
+     * @param   string  $parser Deprecated?
246
+     * @param   string  $data The data to be parsed
247
+     */
248 248
 function element_start($parser, $data)
249 249
 {
250 250
     $data = api_utf8_decode($data);
Please login to merge, or discard this patch.
main/admin/user_list.php 1 patch
Indentation   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -308,13 +308,13 @@  discard block
 block discarded – undo
308 308
     $firstname = $userInfo['firstname'];
309 309
     $lastname = $userInfo['lastname'];
310 310
 
311
-	if (api_is_western_name_order()) {
312
-		$message = sprintf(get_lang('AttemptingToLoginAs'),$firstname, $lastname, $userId);
313
-	} else {
314
-		$message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId);
315
-	}
311
+    if (api_is_western_name_order()) {
312
+        $message = sprintf(get_lang('AttemptingToLoginAs'),$firstname, $lastname, $userId);
313
+    } else {
314
+        $message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId);
315
+    }
316 316
 
317
-	if ($userId) {
317
+    if ($userId) {
318 318
 
319 319
         // Logout the current user
320 320
         LoginDelete(api_get_user_id());
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
         Display :: display_footer();
350 350
         exit;
351 351
 
352
-	}
352
+    }
353 353
 }
354 354
 
355 355
 /**
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     }*/
389 389
 
390 390
     if (!in_array($direction, array('ASC','DESC'))) {
391
-    	$direction = 'ASC';
391
+        $direction = 'ASC';
392 392
     }
393 393
     $column = intval($column);
394 394
     $from 	= intval($from);
@@ -399,23 +399,23 @@  discard block
 block discarded – undo
399 399
         $sql .= " WHERE u.creator_id = ".api_get_user_id();
400 400
     }
401 401
 
402
-	$sql .= " ORDER BY col$column $direction ";
403
-	$sql .= " LIMIT $from,$number_of_items";
402
+    $sql .= " ORDER BY col$column $direction ";
403
+    $sql .= " LIMIT $from,$number_of_items";
404 404
 
405
-	$res = Database::query($sql);
405
+    $res = Database::query($sql);
406 406
 
407
-	$users = array ();
407
+    $users = array ();
408 408
     $t = time();
409
-	while ($user = Database::fetch_row($res)) {
410
-		$userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL);
411
-		$photo = '<img src="'.$userPicture.'" width="22" height="22" alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" />';
409
+    while ($user = Database::fetch_row($res)) {
410
+        $userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL);
411
+        $photo = '<img src="'.$userPicture.'" width="22" height="22" alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" />';
412 412
 
413 413
         if ($user[7] == 1 && !empty($user[10])) {
414 414
             // check expiration date
415 415
             $expiration_time = convert_sql_date($user[10]);
416 416
             // if expiration date is passed, store a special value for active field
417 417
             if ($expiration_time < $t) {
418
-        	   $user[7] = '-1';
418
+                $user[7] = '-1';
419 419
             }
420 420
         }
421 421
 
@@ -433,9 +433,9 @@  discard block
 block discarded – undo
433 433
             api_get_local_time($user[9]),
434 434
             $user[0]
435 435
         );
436
-	}
436
+    }
437 437
 
438
-	return $users;
438
+    return $users;
439 439
 }
440 440
 
441 441
 /**
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 * @return string HTML-code with a mailto-link
445 445
 */
446 446
 function email_filter($email) {
447
-	return Display :: encrypted_mailto_link($email, $email);
447
+    return Display :: encrypted_mailto_link($email, $email);
448 448
 }
449 449
 
450 450
 /**
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 * @return string HTML-code with a mailto-link
454 454
 */
455 455
 function user_filter($name, $params, $row) {
456
-	return '<a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$row[0].'">'.$name.'</a>';
456
+    return '<a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$row[0].'">'.$name.'</a>';
457 457
 }
458 458
 
459 459
 /**
@@ -464,84 +464,84 @@  discard block
 block discarded – undo
464 464
  * @return string Some HTML-code with modify-buttons
465 465
  */
466 466
 function modify_filter($user_id, $url_params, $row) {
467
-	global $charset, $_admins_list;
468
-	$is_admin   = in_array($user_id,$_admins_list);
469
-	$statusname = api_get_status_langvars();
470
-	$user_is_anonymous = false;
467
+    global $charset, $_admins_list;
468
+    $is_admin   = in_array($user_id,$_admins_list);
469
+    $statusname = api_get_status_langvars();
470
+    $user_is_anonymous = false;
471 471
     $current_user_status_label = $row['7'];
472 472
 
473
-	if ($current_user_status_label == $statusname[ANONYMOUS]) {
474
-		$user_is_anonymous =true;
475
-	}
476
-	$result = '';
477
-	if (!$user_is_anonymous) {
478
-		$icon = Display::return_icon('course.png', get_lang('Courses'), array('onmouseout' => 'clear_course_list (\'div_'.$user_id.'\')'));
479
-		$result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')" >
473
+    if ($current_user_status_label == $statusname[ANONYMOUS]) {
474
+        $user_is_anonymous =true;
475
+    }
476
+    $result = '';
477
+    if (!$user_is_anonymous) {
478
+        $icon = Display::return_icon('course.png', get_lang('Courses'), array('onmouseout' => 'clear_course_list (\'div_'.$user_id.'\')'));
479
+        $result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')" >
480 480
 			        '.$icon.'
481 481
 					<div class="blackboard_hide" id="div_'.$user_id.'">&nbsp;&nbsp;</div>
482 482
 					</a>';
483 483
 
484 484
         $icon = Display::return_icon('session.png', get_lang('Sessions'), array('onmouseout' => 'clear_session_list (\'div_s_'.$user_id.'\')'));
485
-		$result .= '<a href="javascript:void(0)" onclick="load_session_list(\'div_s_'.$user_id.'\','.$user_id.')" >
485
+        $result .= '<a href="javascript:void(0)" onclick="load_session_list(\'div_s_'.$user_id.'\','.$user_id.')" >
486 486
 					'.$icon.'
487 487
 					<div class="blackboard_hide" id="div_s_'.$user_id.'">&nbsp;&nbsp;</div>
488 488
 					</a>';
489
-	} else {
490
-		$result .= Display::return_icon('course_na.png',get_lang('Courses')).'&nbsp;&nbsp;';
491
-		$result .= Display::return_icon('course_na.png',get_lang('Sessions')).'&nbsp;&nbsp;';
492
-	}
489
+    } else {
490
+        $result .= Display::return_icon('course_na.png',get_lang('Courses')).'&nbsp;&nbsp;';
491
+        $result .= Display::return_icon('course_na.png',get_lang('Sessions')).'&nbsp;&nbsp;';
492
+    }
493 493
 
494
-	if (api_is_platform_admin()) {
495
-		if (!$user_is_anonymous) {
496
-			$result .= '<a href="user_information.php?user_id='.$user_id.'">'.Display::return_icon('synthese_view.gif', get_lang('Info')).'</a>&nbsp;&nbsp;';
497
-		} else {
498
-			$result .= Display::return_icon('synthese_view_na.gif', get_lang('Info')).'&nbsp;&nbsp;';
499
-		}
500
-	}
494
+    if (api_is_platform_admin()) {
495
+        if (!$user_is_anonymous) {
496
+            $result .= '<a href="user_information.php?user_id='.$user_id.'">'.Display::return_icon('synthese_view.gif', get_lang('Info')).'</a>&nbsp;&nbsp;';
497
+        } else {
498
+            $result .= Display::return_icon('synthese_view_na.gif', get_lang('Info')).'&nbsp;&nbsp;';
499
+        }
500
+    }
501 501
 
502 502
     //only allow platform admins to login_as, or session admins only for students (not teachers nor other admins)
503 503
     if (api_is_platform_admin() || (api_is_session_admin() && $current_user_status_label == $statusname[STUDENT])) {
504
-    	if (!$user_is_anonymous) {
504
+        if (!$user_is_anonymous) {
505 505
             if (api_global_admin_can_edit_admin($user_id)) {
506 506
                 $result .= '<a href="user_list.php?action=login_as&user_id='.$user_id.'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('login_as.png', get_lang('LoginAs')).'</a>&nbsp;&nbsp;';
507 507
             } else {
508 508
                 $result .= Display::return_icon('login_as_na.png', get_lang('LoginAs')).'&nbsp;&nbsp;';
509 509
             }
510
-    	} else {
511
-    		$result .= Display::return_icon('login_as_na.png', get_lang('LoginAs')).'&nbsp;&nbsp;';
512
-    	}
510
+        } else {
511
+            $result .= Display::return_icon('login_as_na.png', get_lang('LoginAs')).'&nbsp;&nbsp;';
512
+        }
513 513
     } else {
514
-    	$result .= Display::return_icon('login_as_na.png', get_lang('LoginAs')).'&nbsp;&nbsp;';
514
+        $result .= Display::return_icon('login_as_na.png', get_lang('LoginAs')).'&nbsp;&nbsp;';
515 515
     }
516 516
 
517
-	if ($current_user_status_label != $statusname[STUDENT]) {
518
-		$result .= Display::return_icon('statistics_na.gif', get_lang('Reporting')).'&nbsp;&nbsp;';
519
-	} else {
520
-		$result .= '<a href="../mySpace/myStudents.php?student='.$user_id.'">'.Display::return_icon('statistics.gif', get_lang('Reporting')).'</a>&nbsp;&nbsp;';
521
-	}
517
+    if ($current_user_status_label != $statusname[STUDENT]) {
518
+        $result .= Display::return_icon('statistics_na.gif', get_lang('Reporting')).'&nbsp;&nbsp;';
519
+    } else {
520
+        $result .= '<a href="../mySpace/myStudents.php?student='.$user_id.'">'.Display::return_icon('statistics.gif', get_lang('Reporting')).'</a>&nbsp;&nbsp;';
521
+    }
522 522
 
523
-	if (api_is_platform_admin(true)) {
523
+    if (api_is_platform_admin(true)) {
524 524
         $editProfileUrl = Display::getProfileEditionLink($user_id, true);
525 525
 
526 526
         if (!$user_is_anonymous && api_global_admin_can_edit_admin($user_id, null, true)) {
527 527
             $result .= '<a href="' . $editProfileUrl . '">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
528
-		} else {
528
+        } else {
529 529
             $result .= Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>&nbsp;';
530
-		}
531
-	}
530
+        }
531
+    }
532 532
 
533
-	if ($is_admin) {
534
-		$result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'),array('width'=> ICON_SIZE_SMALL, 'heigth'=> ICON_SIZE_SMALL));
535
-	} else {
536
-		$result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator'));
537
-	}
533
+    if ($is_admin) {
534
+        $result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'),array('width'=> ICON_SIZE_SMALL, 'heigth'=> ICON_SIZE_SMALL));
535
+    } else {
536
+        $result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator'));
537
+    }
538 538
 
539
-	// actions for assigning sessions, courses or users
540
-	if (api_is_session_admin()) {
541
-		/*if ($row[0] == api_get_user_id()) {
539
+    // actions for assigning sessions, courses or users
540
+    if (api_is_session_admin()) {
541
+        /*if ($row[0] == api_get_user_id()) {
542 542
 			$result .= '<a href="dashboard_add_sessions_to_user.php?user='.$user_id.'">'.Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')).'</a>&nbsp;&nbsp;';
543 543
 		}*/
544
-	} else {
544
+    } else {
545 545
         if ($current_user_status_label == $statusname[SESSIONADMIN]) {
546 546
             $result .= Display::url(
547 547
                 Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')),
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
                 );
572 572
             }
573 573
         }
574
-	}
574
+    }
575 575
 
576 576
     if (api_is_platform_admin()) {
577 577
         $result .= ' <a href="'.api_get_path(WEB_AJAX_PATH).'agenda.ajax.php?a=get_user_agenda&user_id='.$user_id.'&modal_size=lg" class="agenda_opener ajax">'.
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
             }
590 590
         }
591 591
     }
592
-	return $result;
592
+    return $result;
593 593
 }
594 594
 
595 595
 
@@ -622,10 +622,10 @@  discard block
 block discarded – undo
622 622
     if ($action == 'edit') {
623 623
         $result = Display::return_icon($image.'.png', get_lang('AccountExpired'), array(), 16);
624 624
     } elseif ($row['0']<>$_user['user_id']) {
625
-    	// 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.
626
-		$result = Display::return_icon($image.'.png', get_lang(ucfirst($action)), array('onclick'=>'active_user(this);', 'id'=>'img_'.$row['0']), 16).'</a>';
627
-	}
628
-	return $result;
625
+        // 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.
626
+        $result = Display::return_icon($image.'.png', get_lang(ucfirst($action)), array('onclick'=>'active_user(this);', 'id'=>'img_'.$row['0']), 16).'</a>';
627
+    }
628
+    return $result;
629 629
 }
630 630
 
631 631
 /**
@@ -638,8 +638,8 @@  discard block
 block discarded – undo
638 638
  * @author Patrick Cool <[email protected]>, Ghent University, Belgium
639 639
  */
640 640
 function status_filter($status) {
641
-	$statusname = api_get_status_langvars();
642
-	return $statusname[$status];
641
+    $statusname = api_get_status_langvars();
642
+    return $statusname[$status];
643 643
 }
644 644
 
645 645
 if (isset($_GET['keyword']) || isset($_GET['keyword_firstname'])) {
@@ -655,8 +655,8 @@  discard block
 block discarded – undo
655 655
 
656 656
 if (!empty($action)) {
657 657
     $check = Security::check_token('get');
658
-	if ($check) {
659
-		switch ($action) {
658
+    if ($check) {
659
+        switch ($action) {
660 660
             case 'add_user_to_my_url':
661 661
                 $user_id = $_REQUEST["user_id"];
662 662
                 $result = UrlManager::add_user_to_url($user_id, $current_access_url_id);
@@ -666,45 +666,45 @@  discard block
 block discarded – undo
666 666
                     $message  = Display::return_message($message, 'confirmation');
667 667
                 }
668 668
                 break;
669
-			case 'delete_user':
670
-				if (api_is_platform_admin()) {
669
+            case 'delete_user':
670
+                if (api_is_platform_admin()) {
671 671
                     $user_to_delete = $_GET['user_id'];
672 672
                     $current_user_id = api_get_user_id();
673 673
 
674
-					if ($deleteUserAvailable && api_global_admin_can_edit_admin($_GET['user_id'])) {
675
-						if ($user_to_delete != $current_user_id && UserManager :: delete_user($_GET['user_id'])) {
676
-							$message = Display :: return_message(get_lang('UserDeleted'), 'confirmation');
677
-						} else {
678
-							$message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error');
679
-						}
680
-					} else {
681
-						$message = Display :: return_message(get_lang('CannotDeleteUser'),'error');
682
-					}
683
-				}
684
-				break;
674
+                    if ($deleteUserAvailable && api_global_admin_can_edit_admin($_GET['user_id'])) {
675
+                        if ($user_to_delete != $current_user_id && UserManager :: delete_user($_GET['user_id'])) {
676
+                            $message = Display :: return_message(get_lang('UserDeleted'), 'confirmation');
677
+                        } else {
678
+                            $message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error');
679
+                        }
680
+                    } else {
681
+                        $message = Display :: return_message(get_lang('CannotDeleteUser'),'error');
682
+                    }
683
+                }
684
+                break;
685 685
             case 'delete':
686
-				if (api_is_platform_admin()) {
687
-					$number_of_selected_users = count($_POST['id']);
688
-					$number_of_deleted_users = 0;
689
-					if (is_array($_POST['id'])) {
690
-						foreach ($_POST['id'] as $index => $user_id) {
691
-							if($user_id != $_user['user_id']) {
692
-								if(UserManager :: delete_user($user_id)) {
693
-									$number_of_deleted_users++;
694
-								}
695
-							}
696
-						}
697
-					}
698
-					if ($number_of_selected_users == $number_of_deleted_users) {
686
+                if (api_is_platform_admin()) {
687
+                    $number_of_selected_users = count($_POST['id']);
688
+                    $number_of_deleted_users = 0;
689
+                    if (is_array($_POST['id'])) {
690
+                        foreach ($_POST['id'] as $index => $user_id) {
691
+                            if($user_id != $_user['user_id']) {
692
+                                if(UserManager :: delete_user($user_id)) {
693
+                                    $number_of_deleted_users++;
694
+                                }
695
+                            }
696
+                        }
697
+                    }
698
+                    if ($number_of_selected_users == $number_of_deleted_users) {
699 699
                         $message = Display :: return_message(get_lang('SelectedUsersDeleted'), 'confirmation');
700
-					} else {
700
+                    } else {
701 701
                         $message = Display :: return_message(get_lang('SomeUsersNotDeleted'), 'error');
702
-					}
703
-				}
704
-				break;
705
-		}
706
-		Security::clear_token();
707
-	}
702
+                    }
703
+                }
704
+                break;
705
+        }
706
+        Security::clear_token();
707
+    }
708 708
 }
709 709
 
710 710
 // Create a search-box
@@ -724,24 +724,24 @@  discard block
 block discarded – undo
724 724
 
725 725
 $actions  = '';
726 726
 if (api_is_platform_admin()) {
727
-	$actions .= '<div style="float:right;">'.
728
-		 '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.
729
-         Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>'.
730
-		 '</div>';
727
+    $actions .= '<div style="float:right;">'.
728
+            '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.
729
+            Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>'.
730
+            '</div>';
731 731
 }
732 732
 $actions .= $form->return_form();
733 733
 
734 734
 if (isset ($_GET['keyword'])) {
735
-	$parameters = array ('keyword' => Security::remove_XSS($_GET['keyword']));
735
+    $parameters = array ('keyword' => Security::remove_XSS($_GET['keyword']));
736 736
 } elseif (isset ($_GET['keyword_firstname'])) {
737
-	$parameters['keyword_firstname'] 	= Security::remove_XSS($_GET['keyword_firstname']);
738
-	$parameters['keyword_lastname']	 	= Security::remove_XSS($_GET['keyword_lastname']);
739
-	$parameters['keyword_username']	 	= Security::remove_XSS($_GET['keyword_username']);
740
-	$parameters['keyword_email'] 	 	= Security::remove_XSS($_GET['keyword_email']);
741
-	$parameters['keyword_officialcode'] = Security::remove_XSS($_GET['keyword_officialcode']);
742
-	$parameters['keyword_status'] 		= Security::remove_XSS($_GET['keyword_status']);
743
-	$parameters['keyword_active'] 		= Security::remove_XSS($_GET['keyword_active']);
744
-	$parameters['keyword_inactive'] 	= Security::remove_XSS($_GET['keyword_inactive']);
737
+    $parameters['keyword_firstname'] 	= Security::remove_XSS($_GET['keyword_firstname']);
738
+    $parameters['keyword_lastname']	 	= Security::remove_XSS($_GET['keyword_lastname']);
739
+    $parameters['keyword_username']	 	= Security::remove_XSS($_GET['keyword_username']);
740
+    $parameters['keyword_email'] 	 	= Security::remove_XSS($_GET['keyword_email']);
741
+    $parameters['keyword_officialcode'] = Security::remove_XSS($_GET['keyword_officialcode']);
742
+    $parameters['keyword_status'] 		= Security::remove_XSS($_GET['keyword_status']);
743
+    $parameters['keyword_active'] 		= Security::remove_XSS($_GET['keyword_active']);
744
+    $parameters['keyword_inactive'] 	= Security::remove_XSS($_GET['keyword_inactive']);
745 745
 }
746 746
 // Create a sortable table with user-data
747 747
 $parameters['sec_token'] = Security::get_token();
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 $res_admin = Database::query($sql_admin);
753 753
 $_admins_list = array();
754 754
 while ($row_admin = Database::fetch_row($res_admin)) {
755
-	$_admins_list[] = $row_admin[0];
755
+    $_admins_list[] = $row_admin[0];
756 756
 }
757 757
 
758 758
 // Display Advanced search form.
@@ -808,11 +808,11 @@  discard block
 block discarded – undo
808 808
 $table->set_header(2, get_lang('OfficialCode'));
809 809
 
810 810
 if (api_is_western_name_order()) {
811
-	$table->set_header(3, get_lang('FirstName'));
812
-	$table->set_header(4, get_lang('LastName'));
811
+    $table->set_header(3, get_lang('FirstName'));
812
+    $table->set_header(4, get_lang('LastName'));
813 813
 } else {
814
-	$table->set_header(3, get_lang('LastName'));
815
-	$table->set_header(4, get_lang('FirstName'));
814
+    $table->set_header(3, get_lang('LastName'));
815
+    $table->set_header(4, get_lang('FirstName'));
816 816
 }
817 817
 $table->set_header(5, get_lang('LoginName'));
818 818
 $table->set_header(6, get_lang('Email'));
Please login to merge, or discard this patch.
main/admin/access_urls.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,12 +85,12 @@
 block discarded – undo
85 85
     }
86 86
 }
87 87
 if(!empty($url_string)) {
88
-	Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false);
88
+    Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false);
89 89
 }
90 90
 
91 91
 // checking the current installation
92 92
 if ($current_access_url_id==-1) {
93
-	Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH));
93
+    Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH));
94 94
 } elseif(api_is_platform_admin()) {
95 95
     $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id);
96 96
     if ($quant==0) {
Please login to merge, or discard this patch.
main/admin/skills_import.php 1 patch
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             $oskill = new Skill();
71 71
             $skill_id = $oskill->add($skill);
72 72
             $parents[$saved_id] = $skill_id;
73
-		}
73
+        }
74 74
     }
75 75
 }
76 76
 
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
  */
82 82
 function parse_csv_data($file)
83 83
 {
84
-	$skills = Import :: csvToArray($file);
85
-	foreach ($skills as $index => $skill) {
86
-		$skills[$index] = $skill;
87
-	}
84
+    $skills = Import :: csvToArray($file);
85
+    foreach ($skills as $index => $skill) {
86
+        $skills[$index] = $skill;
87
+    }
88 88
 
89
-	return $skills;
89
+    return $skills;
90 90
 }
91 91
 
92 92
 /**
@@ -94,16 +94,16 @@  discard block
 block discarded – undo
94 94
  */
95 95
 function element_start($parser, $data)
96 96
 {
97
-	$data = api_utf8_decode($data);
98
-	global $skill;
99
-	global $current_tag;
100
-	switch ($data) {
101
-		case 'Skill' :
102
-			$skill = array ();
103
-			break;
104
-		default :
105
-			$current_tag = $data;
106
-	}
97
+    $data = api_utf8_decode($data);
98
+    global $skill;
99
+    global $current_tag;
100
+    switch ($data) {
101
+        case 'Skill' :
102
+            $skill = array ();
103
+            break;
104
+        default :
105
+            $current_tag = $data;
106
+    }
107 107
 }
108 108
 
109 109
 /**
@@ -111,18 +111,18 @@  discard block
 block discarded – undo
111 111
  */
112 112
 function element_end($parser, $data)
113 113
 {
114
-	$data = api_utf8_decode($data);
115
-	global $skill;
116
-	global $skills;
117
-	global $current_value;
118
-	switch ($data) {
119
-		case 'Skill' :
120
-			$skills[] = $skill;
121
-			break;
122
-		default :
123
-			$skill[$data] = $current_value;
124
-			break;
125
-	}
114
+    $data = api_utf8_decode($data);
115
+    global $skill;
116
+    global $skills;
117
+    global $current_value;
118
+    switch ($data) {
119
+        case 'Skill' :
120
+            $skills[] = $skill;
121
+            break;
122
+        default :
123
+            $skill[$data] = $current_value;
124
+            break;
125
+    }
126 126
 }
127 127
 
128 128
 /**
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
  */
131 131
 function character_data($parser, $data)
132 132
 {
133
-	$data = trim(api_utf8_decode($data));
134
-	global $current_value;
135
-	$current_value = $data;
133
+    $data = trim(api_utf8_decode($data));
134
+    global $current_value;
135
+    $current_value = $data;
136 136
 }
137 137
 
138 138
 /**
@@ -142,19 +142,19 @@  discard block
 block discarded – undo
142 142
  */
143 143
 function parse_xml_data($file)
144 144
 {
145
-	global $current_tag;
146
-	global $current_value;
147
-	global $skill;
148
-	global $skills;
149
-	$skills = array();
150
-	$parser = xml_parser_create('UTF-8');
151
-	xml_set_element_handler($parser, 'element_start', 'element_end');
152
-	xml_set_character_data_handler($parser, 'character_data');
153
-	xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
154
-	xml_parse($parser, api_utf8_encode_xml(file_get_contents($file)));
155
-	xml_parser_free($parser);
145
+    global $current_tag;
146
+    global $current_value;
147
+    global $skill;
148
+    global $skills;
149
+    $skills = array();
150
+    $parser = xml_parser_create('UTF-8');
151
+    xml_set_element_handler($parser, 'element_start', 'element_end');
152
+    xml_set_character_data_handler($parser, 'character_data');
153
+    xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
154
+    xml_parse($parser, api_utf8_encode_xml(file_get_contents($file)));
155
+    xml_parser_free($parser);
156 156
 
157
-	return $skills;
157
+    return $skills;
158 158
 }
159 159
 
160 160
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -169,81 +169,81 @@  discard block
 block discarded – undo
169 169
 $error_message = '';
170 170
 
171 171
 if (!empty($_POST['formSent']) && $_FILES['import_file']['size'] !== 0) {
172
-	$file_type = $_POST['file_type'];
173
-	Security::clear_token();
174
-	$tok = Security::get_token();
175
-	$allowed_file_mimetype = array('csv','xml');
176
-	$error_kind_file = false;
172
+    $file_type = $_POST['file_type'];
173
+    Security::clear_token();
174
+    $tok = Security::get_token();
175
+    $allowed_file_mimetype = array('csv','xml');
176
+    $error_kind_file = false;
177 177
     $error_message = '';
178 178
 
179
-	$ext_import_file = substr($_FILES['import_file']['name'], (strrpos($_FILES['import_file']['name'],'.')+1));
179
+    $ext_import_file = substr($_FILES['import_file']['name'], (strrpos($_FILES['import_file']['name'],'.')+1));
180 180
 
181
-	if (in_array($ext_import_file,$allowed_file_mimetype)) {
182
-		if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) {
183
-			$skills	= parse_csv_data($_FILES['import_file']['tmp_name']);
184
-			$errors = validate_data($skills);
185
-			$error_kind_file = false;
186
-		} elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) {
187
-			$skills = parse_xml_data($_FILES['import_file']['tmp_name']);
188
-			$errors = validate_data($skills);
189
-			$error_kind_file = false;
190
-		} else {
191
-			$error_kind_file = true;
192
-		}
193
-	} else {
194
-		$error_kind_file = true;
195
-	}
181
+    if (in_array($ext_import_file,$allowed_file_mimetype)) {
182
+        if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) {
183
+            $skills	= parse_csv_data($_FILES['import_file']['tmp_name']);
184
+            $errors = validate_data($skills);
185
+            $error_kind_file = false;
186
+        } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) {
187
+            $skills = parse_xml_data($_FILES['import_file']['tmp_name']);
188
+            $errors = validate_data($skills);
189
+            $error_kind_file = false;
190
+        } else {
191
+            $error_kind_file = true;
192
+        }
193
+    } else {
194
+        $error_kind_file = true;
195
+    }
196 196
 
197
-	// List skill id with error.
198
-	$skills_to_insert = $skill_id_error = array();
199
-	if (is_array($errors)) {
200
-		foreach ($errors as $my_errors) {
201
-			$skill_id_error[] = $my_errors['SkillName'];
202
-		}
203
-	}
204
-	if (is_array($skills)) {
205
-		foreach ($skills as $my_skill) {
206
-			if (isset($my_skill['name']) && !in_array($my_skill['name'], $skill_id_error)) {
207
-				$skills_to_insert[] = $my_skill;
208
-			}
209
-		}
210
-	}
197
+    // List skill id with error.
198
+    $skills_to_insert = $skill_id_error = array();
199
+    if (is_array($errors)) {
200
+        foreach ($errors as $my_errors) {
201
+            $skill_id_error[] = $my_errors['SkillName'];
202
+        }
203
+    }
204
+    if (is_array($skills)) {
205
+        foreach ($skills as $my_skill) {
206
+            if (isset($my_skill['name']) && !in_array($my_skill['name'], $skill_id_error)) {
207
+                $skills_to_insert[] = $my_skill;
208
+            }
209
+        }
210
+    }
211 211
 
212
-	if (strcmp($file_type, 'csv') === 0) {
213
-		save_data($skills_to_insert);
214
-	} elseif (strcmp($file_type, 'xml') === 0) {
215
-		save_data($skills_to_insert);
216
-	} else {
217
-		$error_message = get_lang('YouMustImportAFileAccordingToSelectedOption');
218
-	}
212
+    if (strcmp($file_type, 'csv') === 0) {
213
+        save_data($skills_to_insert);
214
+    } elseif (strcmp($file_type, 'xml') === 0) {
215
+        save_data($skills_to_insert);
216
+    } else {
217
+        $error_message = get_lang('YouMustImportAFileAccordingToSelectedOption');
218
+    }
219 219
 
220
-	if (count($errors) > 0) {
221
-		$see_message_import = get_lang('FileImportedJustSkillsThatAreNotRegistered');
222
-	} else {
223
-		$see_message_import = get_lang('FileImported');
224
-	}
220
+    if (count($errors) > 0) {
221
+        $see_message_import = get_lang('FileImportedJustSkillsThatAreNotRegistered');
222
+    } else {
223
+        $see_message_import = get_lang('FileImported');
224
+    }
225 225
 
226
-	if (count($errors) != 0) {
227
-		$warning_message = '<ul>';
228
-		foreach ($errors as $index => $error_skill) {
229
-			$warning_message .= '<li><b>'.$error_skill['error'].'</b>: ';
230
-			$warning_message .= '<strong>'.$error_skill['SkillName'].'</strong>&nbsp;('.$error_skill['SkillName'].')';
231
-			$warning_message .= '</li>';
232
-		}
233
-		$warning_message .= '</ul>';
234
-	}
226
+    if (count($errors) != 0) {
227
+        $warning_message = '<ul>';
228
+        foreach ($errors as $index => $error_skill) {
229
+            $warning_message .= '<li><b>'.$error_skill['error'].'</b>: ';
230
+            $warning_message .= '<strong>'.$error_skill['SkillName'].'</strong>&nbsp;('.$error_skill['SkillName'].')';
231
+            $warning_message .= '</li>';
232
+        }
233
+        $warning_message .= '</ul>';
234
+    }
235 235
 
236 236
     if ($error_kind_file) {
237
-		$error_message = get_lang('YouMustImportAFileAccordingToSelectedOption');
238
-	}
237
+        $error_message = get_lang('YouMustImportAFileAccordingToSelectedOption');
238
+    }
239 239
 }
240 240
 Display :: display_header($tool_name);
241 241
 
242 242
 if (!empty($error_message)) {
243
-	Display::display_error_message($error_message);
243
+    Display::display_error_message($error_message);
244 244
 }
245 245
 if (!empty($see_message_import)) {
246
-	Display::display_normal_message($see_message_import);
246
+    Display::display_normal_message($see_message_import);
247 247
 }
248 248
 
249 249
 $form = new FormValidator('user_import','post','skills_import.php');
@@ -266,16 +266,16 @@  discard block
 block discarded – undo
266 266
 $i = 0;
267 267
 $count_fields = count($extra_fields);
268 268
 if ($count_fields > 0) {
269
-	foreach ($extra_fields as $extra) {
270
-		$list[] = $extra[1];
271
-		$list_reponse[] = 'xxx';
272
-		$spaces = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
273
-		$result_xml .= $spaces.'&lt;'.$extra[1].'&gt;xxx&lt;/'.$extra[1].'&gt;';
274
-		if ($i != $count_fields - 1) {
275
-			$result_xml .= '<br/>';
276
-		}
277
-		$i++;
278
-	}
269
+    foreach ($extra_fields as $extra) {
270
+        $list[] = $extra[1];
271
+        $list_reponse[] = 'xxx';
272
+        $spaces = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
273
+        $result_xml .= $spaces.'&lt;'.$extra[1].'&gt;xxx&lt;/'.$extra[1].'&gt;';
274
+        if ($i != $count_fields - 1) {
275
+            $result_xml .= '<br/>';
276
+        }
277
+        $i++;
278
+    }
279 279
 }
280 280
 ?>
281 281
 <p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
Please login to merge, or discard this patch.