@@ -215,8 +215,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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]) { |
@@ -83,9 +83,9 @@ |
||
| 83 | 83 | |
| 84 | 84 | //With this function we can add actions to the jgrid (edit, delete, etc) |
| 85 | 85 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
| 86 | - return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. |
|
| 87 | - ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'. |
|
| 88 | - ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
| 86 | + return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'. |
|
| 87 | + ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).'</a>'. |
|
| 88 | + ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'. |
|
| 89 | 89 | '\'; |
| 90 | 90 | }'; |
| 91 | 91 | ?> |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | function display_advanced_search_form () { |
| 108 | 108 | if ($("#advanced_search_form").css("display") == "none") { |
| 109 | 109 | $("#advanced_search_form").css("display","block"); |
| 110 | - $("#img_plus_and_minus").html(\' '.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
| 110 | + $("#img_plus_and_minus").html(\' '.Display::return_icon('div_hide.gif', get_lang('Hide'), array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
| 111 | 111 | } else { |
| 112 | 112 | $("#advanced_search_form").css("display","none"); |
| 113 | - $("#img_plus_and_minus").html(\' '.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
| 113 | + $("#img_plus_and_minus").html(\' '.Display::return_icon('div_show.gif', get_lang('Show'), array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // adding the filter to see the user's only of the current access_url |
| 189 | 189 | if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) { |
| 190 | 190 | $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
| 191 | - $sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.id=url_rel_user.user_id)"; |
|
| 191 | + $sql .= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.id=url_rel_user.user_id)"; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | $keywordList = array( |
@@ -219,11 +219,11 @@ discard block |
||
| 219 | 219 | if (isset($keyword_extra_data) && !empty($keyword_extra_data)) { |
| 220 | 220 | $extra_info = UserManager::get_extra_field_information_by_name($keyword_extra_data); |
| 221 | 221 | $field_id = $extra_info['id']; |
| 222 | - $sql.= " INNER JOIN user_field_values ufv ON u.id=ufv.user_id AND ufv.field_id=$field_id "; |
|
| 222 | + $sql .= " INNER JOIN user_field_values ufv ON u.id=ufv.user_id AND ufv.field_id=$field_id "; |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | if (isset($_GET['keyword']) && !empty($_GET['keyword'])) { |
| 226 | - $keywordFiltered = Database::escape_string("%". $_GET['keyword'] ."%"); |
|
| 226 | + $keywordFiltered = Database::escape_string("%".$_GET['keyword']."%"); |
|
| 227 | 227 | $sql .= " WHERE ( |
| 228 | 228 | u.firstname LIKE '$keywordFiltered' OR |
| 229 | 229 | u.lastname LIKE '$keywordFiltered' OR |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | $sql .= " $query_admin_table |
| 256 | 256 | WHERE ( |
| 257 | - u.firstname LIKE '". Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND |
|
| 257 | + u.firstname LIKE '".Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND |
|
| 258 | 258 | u.lastname LIKE '". Database::escape_string("%".$keywordListValues['keyword_lastname']."%")."' AND |
| 259 | 259 | u.username LIKE '". Database::escape_string("%".$keywordListValues['keyword_username']."%")."' AND |
| 260 | 260 | u.email LIKE '". Database::escape_string("%".$keywordListValues['keyword_email']."%")."' AND |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | $lastname = $userInfo['lastname']; |
| 310 | 310 | |
| 311 | 311 | if (api_is_western_name_order()) { |
| 312 | - $message = sprintf(get_lang('AttemptingToLoginAs'),$firstname, $lastname, $userId); |
|
| 312 | + $message = sprintf(get_lang('AttemptingToLoginAs'), $firstname, $lastname, $userId); |
|
| 313 | 313 | } else { |
| 314 | 314 | $message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId); |
| 315 | 315 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | Session::write('login_as', true); |
| 344 | 344 | |
| 345 | 345 | $target_url = api_get_path(WEB_PATH)."user_portal.php"; |
| 346 | - $message .= '<br />'.sprintf(get_lang('LoginSuccessfulGoToX'),'<a href="'.$target_url.'">'.$target_url.'</a>'); |
|
| 346 | + $message .= '<br />'.sprintf(get_lang('LoginSuccessfulGoToX'), '<a href="'.$target_url.'">'.$target_url.'</a>'); |
|
| 347 | 347 | Display :: display_header(get_lang('UserList')); |
| 348 | 348 | Display :: display_normal_message($message, false); |
| 349 | 349 | Display :: display_footer(); |
@@ -387,11 +387,11 @@ discard block |
||
| 387 | 387 | $sql .= "AND password LIKE '$easyPassword' "; |
| 388 | 388 | }*/ |
| 389 | 389 | |
| 390 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
| 390 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
| 391 | 391 | $direction = 'ASC'; |
| 392 | 392 | } |
| 393 | 393 | $column = intval($column); |
| 394 | - $from = intval($from); |
|
| 394 | + $from = intval($from); |
|
| 395 | 395 | $number_of_items = intval($number_of_items); |
| 396 | 396 | |
| 397 | 397 | $preventSessionAdminsToManageAllUsers = api_get_setting('prevent_session_admins_to_manage_all_users'); |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | $res = Database::query($sql); |
| 406 | 406 | |
| 407 | - $users = array (); |
|
| 407 | + $users = array(); |
|
| 408 | 408 | $t = time(); |
| 409 | 409 | while ($user = Database::fetch_row($res)) { |
| 410 | 410 | $userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL); |
@@ -465,13 +465,13 @@ discard block |
||
| 465 | 465 | */ |
| 466 | 466 | function modify_filter($user_id, $url_params, $row) { |
| 467 | 467 | global $charset, $_admins_list; |
| 468 | - $is_admin = in_array($user_id,$_admins_list); |
|
| 468 | + $is_admin = in_array($user_id, $_admins_list); |
|
| 469 | 469 | $statusname = api_get_status_langvars(); |
| 470 | 470 | $user_is_anonymous = false; |
| 471 | 471 | $current_user_status_label = $row['7']; |
| 472 | 472 | |
| 473 | 473 | if ($current_user_status_label == $statusname[ANONYMOUS]) { |
| 474 | - $user_is_anonymous =true; |
|
| 474 | + $user_is_anonymous = true; |
|
| 475 | 475 | } |
| 476 | 476 | $result = ''; |
| 477 | 477 | if (!$user_is_anonymous) { |
@@ -487,8 +487,8 @@ discard block |
||
| 487 | 487 | <div class="blackboard_hide" id="div_s_'.$user_id.'"> </div> |
| 488 | 488 | </a>'; |
| 489 | 489 | } else { |
| 490 | - $result .= Display::return_icon('course_na.png',get_lang('Courses')).' '; |
|
| 491 | - $result .= Display::return_icon('course_na.png',get_lang('Sessions')).' '; |
|
| 490 | + $result .= Display::return_icon('course_na.png', get_lang('Courses')).' '; |
|
| 491 | + $result .= Display::return_icon('course_na.png', get_lang('Sessions')).' '; |
|
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | if (api_is_platform_admin()) { |
@@ -524,14 +524,14 @@ discard block |
||
| 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 | - $result .= '<a href="' . $editProfileUrl . '">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a> '; |
|
| 527 | + $result .= '<a href="'.$editProfileUrl.'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a> '; |
|
| 528 | 528 | } else { |
| 529 | 529 | $result .= Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a> '; |
| 530 | 530 | } |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | if ($is_admin) { |
| 534 | - $result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'),array('width'=> ICON_SIZE_SMALL, 'heigth'=> ICON_SIZE_SMALL)); |
|
| 534 | + $result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'), array('width'=> ICON_SIZE_SMALL, 'heigth'=> ICON_SIZE_SMALL)); |
|
| 535 | 535 | } else { |
| 536 | 536 | $result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator')); |
| 537 | 537 | } |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | api_global_admin_can_edit_admin($user_id) |
| 584 | 584 | ) { |
| 585 | 585 | // 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. |
| 586 | - $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>'; |
|
| 586 | + $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>'; |
|
| 587 | 587 | } else { |
| 588 | 588 | $result .= Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL); |
| 589 | 589 | } |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | |
| 622 | 622 | if ($action == 'edit') { |
| 623 | 623 | $result = Display::return_icon($image.'.png', get_lang('AccountExpired'), array(), 16); |
| 624 | - } elseif ($row['0']<>$_user['user_id']) { |
|
| 624 | + } elseif ($row['0'] <> $_user['user_id']) { |
|
| 625 | 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 | 626 | $result = Display::return_icon($image.'.png', get_lang(ucfirst($action)), array('onclick'=>'active_user(this);', 'id'=>'img_'.$row['0']), 16).'</a>'; |
| 627 | 627 | } |
@@ -643,11 +643,11 @@ discard block |
||
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | if (isset($_GET['keyword']) || isset($_GET['keyword_firstname'])) { |
| 646 | - $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
| 647 | - $interbreadcrumb[] = array ("url" => 'user_list.php', "name" => get_lang('UserList')); |
|
| 646 | + $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
| 647 | + $interbreadcrumb[] = array("url" => 'user_list.php', "name" => get_lang('UserList')); |
|
| 648 | 648 | $tool_name = get_lang('SearchUsers'); |
| 649 | 649 | } else { |
| 650 | - $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
| 650 | + $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
| 651 | 651 | $tool_name = get_lang('UserList'); |
| 652 | 652 | } |
| 653 | 653 | |
@@ -660,10 +660,10 @@ discard block |
||
| 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); |
| 663 | - if ($result ) { |
|
| 663 | + if ($result) { |
|
| 664 | 664 | $user_info = api_get_user_info($user_id); |
| 665 | 665 | $message = get_lang('UserAdded').' '.$user_info['firstname'].' '.$user_info['lastname'].' ('.$user_info['username'].')'; |
| 666 | - $message = Display::return_message($message, 'confirmation'); |
|
| 666 | + $message = Display::return_message($message, 'confirmation'); |
|
| 667 | 667 | } |
| 668 | 668 | break; |
| 669 | 669 | case 'delete_user': |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | $message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error'); |
| 679 | 679 | } |
| 680 | 680 | } else { |
| 681 | - $message = Display :: return_message(get_lang('CannotDeleteUser'),'error'); |
|
| 681 | + $message = Display :: return_message(get_lang('CannotDeleteUser'), 'error'); |
|
| 682 | 682 | } |
| 683 | 683 | } |
| 684 | 684 | break; |
@@ -688,8 +688,8 @@ discard block |
||
| 688 | 688 | $number_of_deleted_users = 0; |
| 689 | 689 | if (is_array($_POST['id'])) { |
| 690 | 690 | foreach ($_POST['id'] as $index => $user_id) { |
| 691 | - if($user_id != $_user['user_id']) { |
|
| 692 | - if(UserManager :: delete_user($user_id)) { |
|
| 691 | + if ($user_id != $_user['user_id']) { |
|
| 692 | + if (UserManager :: delete_user($user_id)) { |
|
| 693 | 693 | $number_of_deleted_users++; |
| 694 | 694 | } |
| 695 | 695 | } |
@@ -722,17 +722,17 @@ discard block |
||
| 722 | 722 | </a>' |
| 723 | 723 | ); |
| 724 | 724 | |
| 725 | -$actions = ''; |
|
| 725 | +$actions = ''; |
|
| 726 | 726 | if (api_is_platform_admin()) { |
| 727 | 727 | $actions .= '<div style="float:right;">'. |
| 728 | 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>'. |
|
| 729 | + Display::return_icon('new_user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>'. |
|
| 730 | 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 | 737 | $parameters['keyword_firstname'] = Security::remove_XSS($_GET['keyword_firstname']); |
| 738 | 738 | $parameters['keyword_lastname'] = Security::remove_XSS($_GET['keyword_lastname']); |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | $parameters['keyword_officialcode'] = Security::remove_XSS($_GET['keyword_officialcode']); |
| 742 | 742 | $parameters['keyword_status'] = Security::remove_XSS($_GET['keyword_status']); |
| 743 | 743 | $parameters['keyword_active'] = Security::remove_XSS($_GET['keyword_active']); |
| 744 | - $parameters['keyword_inactive'] = Security::remove_XSS($_GET['keyword_inactive']); |
|
| 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(); |
@@ -758,15 +758,15 @@ discard block |
||
| 758 | 758 | // Display Advanced search form. |
| 759 | 759 | $form = new FormValidator('advanced_search', 'get', '', '', array(), FormValidator::LAYOUT_HORIZONTAL); |
| 760 | 760 | |
| 761 | -$form->addElement('html','<div id="advanced_search_form" style="display:none;">'); |
|
| 761 | +$form->addElement('html', '<div id="advanced_search_form" style="display:none;">'); |
|
| 762 | 762 | $form->addElement('header', get_lang('AdvancedSearch')); |
| 763 | -$form->addText('keyword_firstname',get_lang('FirstName'),false); |
|
| 764 | -$form->addText('keyword_lastname',get_lang('LastName'),false); |
|
| 763 | +$form->addText('keyword_firstname', get_lang('FirstName'), false); |
|
| 764 | +$form->addText('keyword_lastname', get_lang('LastName'), false); |
|
| 765 | 765 | |
| 766 | -$form->addText('keyword_username',get_lang('LoginName'),false); |
|
| 767 | -$form->addText('keyword_email',get_lang('Email'),false); |
|
| 766 | +$form->addText('keyword_username', get_lang('LoginName'), false); |
|
| 767 | +$form->addText('keyword_email', get_lang('Email'), false); |
|
| 768 | 768 | |
| 769 | -$form->addText('keyword_officialcode',get_lang('OfficialCode'),false); |
|
| 769 | +$form->addText('keyword_officialcode', get_lang('OfficialCode'), false); |
|
| 770 | 770 | |
| 771 | 771 | $status_options = array(); |
| 772 | 772 | $status_options['%'] = get_lang('All'); |
@@ -776,12 +776,12 @@ discard block |
||
| 776 | 776 | $status_options[SESSIONADMIN] = get_lang('SessionsAdmin'); |
| 777 | 777 | $status_options[PLATFORM_ADMIN] = get_lang('Administrator'); |
| 778 | 778 | |
| 779 | -$form->addElement('select','keyword_status',get_lang('Profile'), $status_options ); |
|
| 779 | +$form->addElement('select', 'keyword_status', get_lang('Profile'), $status_options); |
|
| 780 | 780 | |
| 781 | 781 | $active_group = array(); |
| 782 | -$active_group[] = $form->createElement('checkbox','keyword_active','', get_lang('Active')); |
|
| 783 | -$active_group[] = $form->createElement('checkbox','keyword_inactive','', get_lang('Inactive')); |
|
| 784 | -$form->addGroup($active_group,'',get_lang('ActiveAccount'), '<br/>',false); |
|
| 782 | +$active_group[] = $form->createElement('checkbox', 'keyword_active', '', get_lang('Active')); |
|
| 783 | +$active_group[] = $form->createElement('checkbox', 'keyword_inactive', '', get_lang('Inactive')); |
|
| 784 | +$form->addGroup($active_group, '', get_lang('ActiveAccount'), '<br/>', false); |
|
| 785 | 785 | |
| 786 | 786 | $form->addElement('checkbox', 'check_easy_passwords', null, get_lang('CheckEasyPasswords')); |
| 787 | 787 | |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | $defaults['keyword_active'] = 1; |
| 793 | 793 | $defaults['keyword_inactive'] = 1; |
| 794 | 794 | $form->setDefaults($defaults); |
| 795 | -$form->addElement('html','</div>'); |
|
| 795 | +$form->addElement('html', '</div>'); |
|
| 796 | 796 | |
| 797 | 797 | $form = $form->returnForm(); |
| 798 | 798 | |
@@ -874,10 +874,10 @@ discard block |
||
| 874 | 874 | } |
| 875 | 875 | if ($add_user) { |
| 876 | 876 | $row_table = array(); |
| 877 | - $row_table[] = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') '; |
|
| 878 | - $row_table[] = $access_info_to_string; |
|
| 877 | + $row_table[] = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') '; |
|
| 878 | + $row_table[] = $access_info_to_string; |
|
| 879 | 879 | $url = api_get_self().'?action=add_user_to_my_url&user_id='.$user['id'].'&sec_token='.$_SESSION['sec_token']; |
| 880 | - $row_table[] = Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn')); |
|
| 880 | + $row_table[] = Display::url(get_lang('AddUserToMyURL'), $url, array('class' => 'btn')); |
|
| 881 | 881 | |
| 882 | 882 | foreach ($row_table as $cell) { |
| 883 | 883 | $table->setCellContents($row, $column, $cell); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | exit; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -$interbreadcrumb[] = array ("url" => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
| 22 | +$interbreadcrumb[] = array("url" => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
| 23 | 23 | $tool_name = get_lang('MultipleAccessURLs'); |
| 24 | 24 | Display :: display_header($tool_name); |
| 25 | 25 | |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | case 'register': |
| 56 | 56 | // we are going to register the admin |
| 57 | 57 | if (api_is_platform_admin()) { |
| 58 | - if ($current_access_url_id!=-1) { |
|
| 58 | + if ($current_access_url_id != -1) { |
|
| 59 | 59 | $url_str = ''; |
| 60 | 60 | foreach ($url_list as $my_url) { |
| 61 | 61 | if (!in_array($my_url['id'], $my_user_url_list)) { |
| 62 | 62 | UrlManager::add_user_to_url(api_get_user_id(), $my_url['id']); |
| 63 | - $url_str.=$my_url['url'].' <br />'; |
|
| 63 | + $url_str .= $my_url['url'].' <br />'; |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | Display:: display_normal_message( |
@@ -84,16 +84,16 @@ discard block |
||
| 84 | 84 | $url_string .= $my_url['url'].' <br />'; |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | -if(!empty($url_string)) { |
|
| 88 | - Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false); |
|
| 87 | +if (!empty($url_string)) { |
|
| 88 | + Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string, false); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // checking the current installation |
| 92 | -if ($current_access_url_id==-1) { |
|
| 92 | +if ($current_access_url_id == -1) { |
|
| 93 | 93 | Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH)); |
| 94 | -} elseif(api_is_platform_admin()) { |
|
| 95 | - $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id); |
|
| 96 | - if ($quant==0) { |
|
| 94 | +} elseif (api_is_platform_admin()) { |
|
| 95 | + $quant = UrlManager::relation_url_user_exist(api_get_user_id(), $current_access_url_id); |
|
| 96 | + if ($quant == 0) { |
|
| 97 | 97 | Display:: display_warning_message( |
| 98 | 98 | '<a href="'.api_get_self().'?action=register&sec_token='.$parameters['sec_token'].'">'.get_lang('ClickToRegisterAdmin').'</a>', |
| 99 | 99 | false |
@@ -142,16 +142,16 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | //Status |
| 144 | 144 | $active = $row['active']; |
| 145 | - if ($active=='1') { |
|
| 146 | - $action='lock'; |
|
| 147 | - $image='right'; |
|
| 145 | + if ($active == '1') { |
|
| 146 | + $action = 'lock'; |
|
| 147 | + $image = 'right'; |
|
| 148 | 148 | } |
| 149 | - if ($active=='0') { |
|
| 150 | - $action='unlock'; |
|
| 151 | - $image='wrong'; |
|
| 149 | + if ($active == '0') { |
|
| 150 | + $action = 'unlock'; |
|
| 151 | + $image = 'wrong'; |
|
| 152 | 152 | } |
| 153 | 153 | // you cannot lock the default |
| 154 | - if ($row['id']=='1') { |
|
| 154 | + if ($row['id'] == '1') { |
|
| 155 | 155 | $status = Display::return_icon($image.'.gif', get_lang(ucfirst($action))); |
| 156 | 156 | } else { |
| 157 | 157 | $status = '<a href="access_urls.php?action='.$action.'&url_id='.$row['id'].'">'. |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $url_id = $row['id']; |
| 162 | 162 | $actions = Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), "access_url_edit.php?url_id=$url_id"); |
| 163 | 163 | if ($url_id != '1') { |
| 164 | - $actions .= '<a href="access_urls.php?action=delete_url&url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'. |
|
| 164 | + $actions .= '<a href="access_urls.php?action=delete_url&url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'. |
|
| 165 | 165 | Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
| 166 | 166 | } |
| 167 | 167 | $urls[] = array($url, $description, $status, $actions); |
@@ -215,8 +215,8 @@ discard block |
||
| 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 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | global $current_tag; |
| 253 | 253 | switch ($data) { |
| 254 | 254 | case 'Contact': |
| 255 | - $user = array (); |
|
| 255 | + $user = array(); |
|
| 256 | 256 | break; |
| 257 | 257 | default: |
| 258 | 258 | $current_tag = $data; |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | $allowed_file_mimetype = array('csv', 'xml'); |
| 346 | 346 | $error_kind_file = false; |
| 347 | 347 | |
| 348 | - $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] :null; |
|
| 348 | + $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] : null; |
|
| 349 | 349 | |
| 350 | 350 | $uploadInfo = pathinfo($_FILES['import_file']['name']); |
| 351 | 351 | $ext_import_file = $uploadInfo['extension']; |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | if (strcmp($file_type, 'csv') === 0 && |
| 355 | 355 | $ext_import_file == $allowed_file_mimetype[0] |
| 356 | 356 | ) { |
| 357 | - $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
| 357 | + $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
| 358 | 358 | $errors = validate_data($users, $checkUniqueEmail); |
| 359 | 359 | $error_kind_file = false; |
| 360 | 360 | } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | // current section |
| 18 | 18 | $this_section = SECTION_COURSES; |
| 19 | 19 | |
| 20 | -$current_course_tool = TOOL_COURSE_PROGRESS; |
|
| 20 | +$current_course_tool = TOOL_COURSE_PROGRESS; |
|
| 21 | 21 | |
| 22 | 22 | // protect a course script |
| 23 | 23 | api_protect_course_script(true); |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | 'thematic_advance_delete' |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | -$action = 'thematic_details'; |
|
| 53 | -if (isset($_GET['action']) && in_array($_GET['action'],$actions)) { |
|
| 52 | +$action = 'thematic_details'; |
|
| 53 | +if (isset($_GET['action']) && in_array($_GET['action'], $actions)) { |
|
| 54 | 54 | $action = $_GET['action']; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -187,21 +187,21 @@ discard block |
||
| 187 | 187 | $thematicControl = Session::read('thematic_control'); |
| 188 | 188 | |
| 189 | 189 | if ($action == 'thematic_list') { |
| 190 | - $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('ThematicControl')); |
|
| 190 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('ThematicControl')); |
|
| 191 | 191 | } |
| 192 | 192 | if ($action == 'thematic_add') { |
| 193 | - $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 194 | - $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewThematicSection')); |
|
| 193 | + $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 194 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewThematicSection')); |
|
| 195 | 195 | } |
| 196 | 196 | if ($action == 'thematic_edit') { |
| 197 | - $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 198 | - $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('EditThematicSection')); |
|
| 197 | + $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 198 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditThematicSection')); |
|
| 199 | 199 | } |
| 200 | 200 | if ($action == 'thematic_details') { |
| 201 | - $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('ThematicControl')); |
|
| 201 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('ThematicControl')); |
|
| 202 | 202 | } |
| 203 | 203 | if ($action == 'thematic_plan_list' || $action == 'thematic_plan_delete') { |
| 204 | - $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 204 | + $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 205 | 205 | if (!empty($thematic_data)) { |
| 206 | 206 | $interbreadcrumb[] = array( |
| 207 | 207 | 'url' => '#', |
@@ -210,22 +210,22 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | if ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') { |
| 213 | - $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 214 | - $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic_id, 'name' => get_lang('ThematicPlan').' ('.$thematic_data['title'].')'); |
|
| 213 | + $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 214 | + $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic_id, 'name' => get_lang('ThematicPlan').' ('.$thematic_data['title'].')'); |
|
| 215 | 215 | if ($description_type >= ADD_THEMATIC_PLAN) { |
| 216 | - $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewBloc')); |
|
| 216 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewBloc')); |
|
| 217 | 217 | } else { |
| 218 | - $interbreadcrumb[] = array ('url' => '#', 'name' => $default_thematic_plan_title[$description_type]); |
|
| 218 | + $interbreadcrumb[] = array('url' => '#', 'name' => $default_thematic_plan_title[$description_type]); |
|
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | if ($action == 'thematic_advance_list' || $action == 'thematic_advance_delete') { |
| 222 | - $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 223 | - $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('ThematicAdvance').' ('.$thematic_data['title'].')'); |
|
| 222 | + $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 223 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('ThematicAdvance').' ('.$thematic_data['title'].')'); |
|
| 224 | 224 | } |
| 225 | 225 | if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') { |
| 226 | - $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 227 | - $interbreadcrumb[] = array ('url' => 'index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic_id, 'name' => get_lang('ThematicAdvance').' ('.$thematic_data['title'].')'); |
|
| 228 | - $interbreadcrumb[] = array ('url' => '#', 'name' => get_lang('NewThematicAdvance')); |
|
| 226 | + $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action='.$thematicControl, 'name' => get_lang('ThematicControl')); |
|
| 227 | + $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic_id, 'name' => get_lang('ThematicAdvance').' ('.$thematic_data['title'].')'); |
|
| 228 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewThematicAdvance')); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | // Distpacher actions to controller |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | case 'thematic_import': |
| 240 | 240 | case 'moveup': |
| 241 | 241 | case 'movedown': |
| 242 | - if (!api_is_allowed_to_edit(null,true)) { |
|
| 242 | + if (!api_is_allowed_to_edit(null, true)) { |
|
| 243 | 243 | api_not_allowed(); |
| 244 | 244 | } |
| 245 | 245 | case 'thematic_list': |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | case 'thematic_plan_add': |
| 252 | 252 | case 'thematic_plan_edit': |
| 253 | 253 | case 'thematic_plan_delete': |
| 254 | - if (!api_is_allowed_to_edit(null,true)) { |
|
| 254 | + if (!api_is_allowed_to_edit(null, true)) { |
|
| 255 | 255 | api_not_allowed(); |
| 256 | 256 | } |
| 257 | 257 | case 'thematic_plan_list': |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | case 'thematic_advance_add': |
| 261 | 261 | case 'thematic_advance_edit': |
| 262 | 262 | case 'thematic_advance_delete': |
| 263 | - if (!api_is_allowed_to_edit(null,true)) { |
|
| 263 | + if (!api_is_allowed_to_edit(null, true)) { |
|
| 264 | 264 | api_not_allowed(); |
| 265 | 265 | } |
| 266 | 266 | case 'thematic_advance_list': |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function __construct() |
| 23 | 23 | { |
| 24 | - $this->table = Database::get_main_table(TABLE_CAREER); |
|
| 24 | + $this->table = Database::get_main_table(TABLE_CAREER); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $promotion = new Promotion(); |
| 63 | 63 | $promotion_list = $promotion->get_all_promotions_by_career_id($career_id); |
| 64 | 64 | if (!empty($promotion_list)) { |
| 65 | - foreach($promotion_list as $item) { |
|
| 65 | + foreach ($promotion_list as $item) { |
|
| 66 | 66 | $params['id'] = $item['id']; |
| 67 | 67 | $params['status'] = $status; |
| 68 | 68 | $promotion->update($params); |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | public function display() |
| 78 | 78 | { |
| 79 | 79 | echo '<div class="actions" style="margin-bottom:20px">'; |
| 80 | - echo '<a href="career_dashboard.php">'.Display::return_icon('back.png',get_lang('Back'),'','32').'</a>'; |
|
| 81 | - echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('new_career.png',get_lang('Add'),'','32').'</a>'; |
|
| 80 | + echo '<a href="career_dashboard.php">'.Display::return_icon('back.png', get_lang('Back'), '', '32').'</a>'; |
|
| 81 | + echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('new_career.png', get_lang('Add'), '', '32').'</a>'; |
|
| 82 | 82 | echo '</div>'; |
| 83 | 83 | echo Display::grid_html('careers'); |
| 84 | 84 | } |
@@ -184,9 +184,9 @@ discard block |
||
| 184 | 184 | if ($copy_promotions) { |
| 185 | 185 | //Now also copy each session of the promotion as a new session and register it inside the promotion |
| 186 | 186 | $promotion = new Promotion(); |
| 187 | - $promo_list = $promotion->get_all_promotions_by_career_id($id); |
|
| 187 | + $promo_list = $promotion->get_all_promotions_by_career_id($id); |
|
| 188 | 188 | if (!empty($promo_list)) { |
| 189 | - foreach($promo_list as $item) { |
|
| 189 | + foreach ($promo_list as $item) { |
|
| 190 | 190 | $pid = $promotion->copy($item['id'], $cid, true); |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -201,9 +201,9 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function get_status($career_id) |
| 203 | 203 | { |
| 204 | - $TBL_CAREER = Database::get_main_table(TABLE_CAREER); |
|
| 204 | + $TBL_CAREER = Database::get_main_table(TABLE_CAREER); |
|
| 205 | 205 | $career_id = intval($career_id); |
| 206 | - $sql = "SELECT status FROM $TBL_CAREER WHERE id = '$career_id'"; |
|
| 206 | + $sql = "SELECT status FROM $TBL_CAREER WHERE id = '$career_id'"; |
|
| 207 | 207 | $result = Database::query($sql); |
| 208 | 208 | if (Database::num_rows($result) > 0) { |
| 209 | 209 | $data = Database::fetch_array($result); |