';
- if (isset ($_GET['keyword'])) {
- $parameters = array ('keyword' => Security::remove_XSS($_GET['keyword']));
- } elseif (isset ($_GET['keyword_firstname'])) {
- $parameters['keyword_firstname'] = Security::remove_XSS($_GET['keyword_firstname']);
- $parameters['keyword_lastname'] = Security::remove_XSS($_GET['keyword_lastname']);
- $parameters['keyword_email'] = Security::remove_XSS($_GET['keyword_email']);
- $parameters['keyword_officialcode'] = Security::remove_XSS($_GET['keyword_officialcode']);
- $parameters['keyword_status'] = Security::remove_XSS($_GET['keyword_status']);
- $parameters['keyword_active'] = Security::remove_XSS($_GET['keyword_active']);
- $parameters['keyword_inactive'] = Security::remove_XSS($_GET['keyword_inactive']);
- }
- // Create a sortable table with user-data
- $parameters['sec_token'] = Security::get_token();
-
- // get the list of all admins to mark them in the users list
- $admin_table = Database::get_main_table(TABLE_MAIN_ADMIN);
- $sql_admin = "SELECT user_id FROM $admin_table";
- $res_admin = Database::query($sql_admin);
- $_admins_list = array();
- while ($row_admin = Database::fetch_row($res_admin)) {
- $_admins_list[] = $row_admin[0];
- }
-
- $table = new SortableTable('users', 'get_number_of_users', 'get_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
- $table->set_additional_parameters($parameters);
- $table->set_header(0, '', false);
- $table->set_header(1, get_lang('OfficialCode'));
- if (api_is_western_name_order()) {
- $table->set_header(2, get_lang('FirstName'));
- $table->set_header(3, get_lang('LastName'));
- } else {
- $table->set_header(2, get_lang('LastName'));
- $table->set_header(3, get_lang('FirstName'));
- }
- $table->set_header(4, get_lang('LoginName'));
- $table->set_header(5, get_lang('Email'));
- $table->set_header(6, get_lang('Status'));
- $table->set_header(7, get_lang('Active'));
- $table->set_header(8, get_lang('Modify'));
- $table->set_column_filter(5, 'email_filter');
- $table->set_column_filter(6, 'status_filter');
- $table->set_column_filter(7, 'active_filter');
- $table->set_column_filter(8, 'modify_filter');
- if (api_is_platform_admin())
- $table->set_form_actions(array ('delete' => get_lang('DeleteFromPlatform')));
- $table->display();
-}
-/*
-==============================================================================
- FOOTER
-==============================================================================
-*/
-Display :: display_footer();
-?>
+';
+$htmlHeadXtra[] = '';
+$htmlHeadXtra[] = '';
+
+$this_section = SECTION_PLATFORM_ADMIN;
+api_protect_admin_script(true);
+
+/**
+* Make sure this function is protected because it does NOT check password!
+*
+* This function defines globals.
+* @param int User ID
+* @return bool False on failure, redirection on success
+* @author Evie Embrechts
+* @author Yannick Warnier