user_list.php 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994
  1. <?php // $Id: user_list.php 22292 2009-07-22 18:32:32Z herodoto $
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. @author Bart Mollet
  5. * @package chamilo.admin
  6. */
  7. // name of the language file that needs to be included
  8. $language_file = array ('registration','admin');
  9. $cidReset = true;
  10. require_once '../inc/global.inc.php';
  11. require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
  12. require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
  13. require_once api_get_path(LIBRARY_PATH).'security.lib.php';
  14. require_once api_get_path(LIBRARY_PATH).'xajax/xajax.inc.php';
  15. require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  16. global $_configuration;
  17. // Blocks the possibility to delete a user
  18. $delete_user_available = true;
  19. if (isset($_configuration['deny_delete_users']) && $_configuration['deny_delete_users']) {
  20. $delete_user_available = false;
  21. }
  22. $htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>';
  23. $htmlHeadXtra[] = '<script type="text/javascript">
  24. function load_course_list (div_course,my_user_id) {
  25. $.ajax({
  26. contentType: "application/x-www-form-urlencoded",
  27. beforeSend: function(objeto) {
  28. $("div#"+div_course).html("<img src=\'../inc/lib/javascript/indicator.gif\' />"); },
  29. type: "POST",
  30. url: "course_user_list.php",
  31. data: "user_id="+my_user_id,
  32. success: function(datos) {
  33. $("div#"+div_course).html(datos);
  34. $("div#div_"+my_user_id).attr("class","blackboard_show");
  35. $("div#div_"+my_user_id).attr("style","");
  36. }
  37. });
  38. }
  39. function active_user(element_div) {
  40. id_image=$(element_div).attr("id");
  41. image_clicked=$(element_div).attr("src");
  42. image_clicked_info = image_clicked.split("/");
  43. image_real_clicked = image_clicked_info[image_clicked_info.length-1];
  44. var status = 1;
  45. if (image_real_clicked == "right.gif") {
  46. status = 0;
  47. }
  48. user_id=id_image.split("_");
  49. ident="#img_"+user_id[1];
  50. if (confirm("'.get_lang('AreYouSureToEditTheUserStatus', '').'")) {
  51. $.ajax({
  52. contentType: "application/x-www-form-urlencoded",
  53. beforeSend: function(objeto) {
  54. $(ident).attr("src","'.api_get_path(WEB_IMG_PATH).'loading1.gif'.'"); }, //candy eye stuff
  55. type: "GET",
  56. url: "'.api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=active_user",
  57. data: "user_id="+user_id[1]+"&status="+status,
  58. success: function(datos) {
  59. if (status == 1) {
  60. $(ident).attr("src","'.api_get_path(WEB_IMG_PATH).'right.gif'.'");
  61. $(ident).attr("title","'.get_lang('Lock').'");
  62. } else {
  63. $(ident).attr("src","'.api_get_path(WEB_IMG_PATH).'wrong.gif'.'");
  64. $(ident).attr("title","'.get_lang('Unlock').'");
  65. }
  66. }
  67. });
  68. }
  69. }
  70. function clear_course_list (div_course) {
  71. $("div#"+div_course).html("&nbsp;");
  72. $("div#"+div_course).hide("");
  73. }
  74. function display_advanced_search_form () {
  75. if ($("#advanced_search_form").css("display") == "none") {
  76. $("#advanced_search_form").css("display","block");
  77. $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
  78. } else {
  79. $("#advanced_search_form").css("display","none");
  80. $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedSearch').'\');
  81. }
  82. }
  83. $(document).ready(function() {
  84. var select_val = $("#input_select_extra_data").val();
  85. if (select_val != 0) {
  86. document.getElementById(\'extra_data_text\').style.display="block";
  87. document.getElementById(\'input_extra_text\').value = "";
  88. } else {
  89. document.getElementById(\'extra_data_text\').style.display="none";
  90. }
  91. });
  92. </script>';
  93. $htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
  94. .blackboard_show {
  95. float:left;
  96. position:absolute;
  97. border:1px solid black;
  98. width: 200px;
  99. background-color:white;
  100. z-index:99; padding: 3px;
  101. display: inline;
  102. }
  103. .blackboard_hide {
  104. display: none;
  105. }
  106. ';
  107. // xajax
  108. $xajax = new xajax();
  109. $xajax->registerFunction('courses_of_user');
  110. //$xajax->registerFunction('empty_courses_of_user');
  111. $xajax->processRequests();
  112. /**
  113. * Get a formatted list of courses for given user
  114. * @param int User ID
  115. * @return resource XAJAX response
  116. */
  117. function courses_of_user($arg) {
  118. // do some stuff based on $arg like query data from a database and
  119. // put it into a variable like $newContent
  120. //$newContent = 'werkt het? en met een beetje meer text, wordt dat goed opgelost? ';
  121. $personal_course_list = UserManager::get_personal_session_course_list($arg);
  122. $newContent = '';
  123. if(count($personal_course_list)>0)
  124. {
  125. foreach ($personal_course_list as $key=>$course)
  126. {
  127. $newContent .= $course['i'].'<br />';
  128. }
  129. }
  130. else
  131. {
  132. $newContent .= '- '.get_lang('None').' -<br />';
  133. }
  134. $newContent = api_convert_encoding($newContent,'utf-8',api_get_system_encoding());
  135. // Instantiate the xajaxResponse object
  136. $objResponse = new xajaxResponse();
  137. // add a command to the response to assign the innerHTML attribute of
  138. // the element with id="SomeElementId" to whatever the new content is
  139. $objResponse->addAssign("user".$arg,"innerHTML", $newContent);
  140. $objResponse->addReplace("coursesofuser".$arg,"alt", $newContent);
  141. $objResponse->addReplace("coursesofuser".$arg,"title", $newContent);
  142. $objResponse->addAssign("user".$arg,"style.display", "block");
  143. //return the xajaxResponse object
  144. return $objResponse;
  145. }
  146. /**
  147. * Empties the XAJAX object representing the courses list
  148. * @param int User ID
  149. * @return resource XAJAX object
  150. */
  151. function empty_courses_of_user($arg)
  152. {
  153. // do some stuff based on $arg like query data from a database and
  154. // put it into a variable like $newContent
  155. $newContent = '';
  156. // Instantiate the xajaxResponse object
  157. $objResponse = new xajaxResponse();
  158. // add a command to the response to assign the innerHTML attribute of
  159. // the element with id="SomeElementId" to whatever the new content is
  160. $objResponse->addAssign("user".$arg,"innerHTML", $newContent);
  161. //return the xajaxResponse object
  162. return $objResponse;
  163. }
  164. $htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
  165. $htmlHeadXtra[] = '<style>
  166. .tooltipLinkInner {
  167. position:relative;
  168. float:left;
  169. color:blue;
  170. text-decoration:none;
  171. }
  172. </style>';
  173. $this_section = SECTION_PLATFORM_ADMIN;
  174. api_protect_admin_script(true);
  175. /**
  176. * Make sure this function is protected because it does NOT check password!
  177. *
  178. * This function defines globals.
  179. * @param int User ID
  180. * @return bool False on failure, redirection on success
  181. * @author Evie Embrechts
  182. * @author Yannick Warnier <yannick.warnier@dokeos.com>
  183. */
  184. function login_user($user_id) {
  185. //init
  186. //Load $_user to be sure we clean it before logging in
  187. global $uidReset, $loginFailed, $_configuration, $_user;
  188. $main_user_table = Database :: get_main_table(TABLE_MAIN_USER);
  189. $main_admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
  190. $track_e_login_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
  191. //logic
  192. unset($_user['user_id']); // uid not in session ? prevent any hacking
  193. if (!isset ($user_id)) {
  194. $uidReset = true;
  195. return;
  196. }
  197. if ($user_id != strval(intval($user_id))) {
  198. return false;
  199. }
  200. $sql_query = "SELECT * FROM $main_user_table WHERE user_id='$user_id'";
  201. $sql_result = Database::query($sql_query);
  202. $result = Database :: fetch_array($sql_result);
  203. // check if the user is allowed to 'login_as'
  204. $can_login_as = (api_is_platform_admin() OR (api_is_session_admin() && $result['status'] == 5 ));
  205. if (!$can_login_as) { return false; }
  206. $firstname = $result['firstname'];
  207. $lastname = $result['lastname'];
  208. $user_id = $result['user_id'];
  209. //$message = "Attempting to login as ".api_get_person_name($firstname, $lastname)." (id ".$user_id.")";
  210. if (api_is_western_name_order()) {
  211. $message = sprintf(get_lang('AttemptingToLoginAs'),$firstname,$lastname,$user_id);
  212. } else {
  213. $message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $user_id);
  214. }
  215. $loginFailed = false;
  216. $uidReset = false;
  217. if ($user_id) { // a uid is given (log in succeeded)
  218. if ($_configuration['tracking_enabled']) {
  219. $sql_query = "SELECT user.*, a.user_id is_admin,
  220. UNIX_TIMESTAMP(login.login_date) login_date
  221. FROM $main_user_table
  222. LEFT JOIN $main_admin_table a
  223. ON user.user_id = a.user_id
  224. LEFT JOIN $track_e_login_table login
  225. ON user.user_id = login.login_user_id
  226. WHERE user.user_id = '".$user_id."'
  227. ORDER BY login.login_date DESC LIMIT 1";
  228. } else {
  229. $sql_query = "SELECT user.*, a.user_id is_admin
  230. FROM $main_user_table
  231. LEFT JOIN $main_admin_table a
  232. ON user.user_id = a.user_id
  233. WHERE user.user_id = '".$user_id."'";
  234. }
  235. $sql_result = Database::query($sql_query);
  236. if (Database::num_rows($sql_result) > 0) {
  237. // Extracting the user data
  238. $user_data = Database::fetch_array($sql_result);
  239. //Delog the current user
  240. LoginDelete($_SESSION["_user"]["user_id"]);
  241. // Cleaning session variables
  242. unset($_SESSION['_user']);
  243. unset($_SESSION['is_platformAdmin']);
  244. unset($_SESSION['is_allowedCreateCourse']);
  245. unset($_SESSION['_uid']);
  246. $_user['firstName'] = $user_data['firstname'];
  247. $_user['lastName'] = $user_data['lastname'];
  248. $_user['mail'] = $user_data['email'];
  249. $_user['lastLogin'] = $user_data['login_date'];
  250. $_user['official_code'] = $user_data['official_code'];
  251. $_user['picture_uri'] = $user_data['picture_uri'];
  252. $_user['user_id'] = $user_data['user_id'];
  253. $_user['status'] = $user_data['status'];
  254. $is_platformAdmin = (bool) (!is_null($user_data['is_admin']));
  255. $is_allowedCreateCourse = (bool) ($user_data['status'] == 1);
  256. // Filling session variables with new data
  257. $_SESSION['_uid'] = $user_id;
  258. $_SESSION['_user'] = $_user;
  259. $_SESSION['is_platformAdmin'] = $is_platformAdmin;
  260. $_SESSION['is_allowedCreateCourse'] = $is_allowedCreateCourse;
  261. $_SESSION['login_as'] = true; // will be usefull later to know if the user is actually an admin or not (example reporting)s
  262. $target_url = api_get_path(WEB_PATH)."user_portal.php";
  263. //$message .= "<br/>Login successful. Go to <a href=\"$target_url\">$target_url</a>";
  264. $message .= '<br />'.sprintf(get_lang('LoginSuccessfulGoToX'),'<a href="'.$target_url.'">'.$target_url.'</a>');
  265. Display :: display_header(get_lang('UserList'));
  266. Display :: display_normal_message($message,false);
  267. Display :: display_footer();
  268. exit;
  269. } else {
  270. exit ("<br />WARNING UNDEFINED UID !! ");
  271. }
  272. }
  273. }
  274. /**
  275. * Get the total number of users on the platform
  276. * @see SortableTable#get_total_number_of_items()
  277. */
  278. function get_number_of_users()
  279. {
  280. $user_table = Database :: get_main_table(TABLE_MAIN_USER);
  281. $sql = "SELECT COUNT(u.user_id) AS total_number_of_items FROM $user_table u";
  282. // adding the filter to see the user's only of the current access_url
  283. global $_configuration;
  284. if ((api_is_platform_admin() || api_is_session_admin()) && $_configuration['multiple_access_urls'] && api_get_current_access_url_id()!=-1) {
  285. $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
  286. $sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)";
  287. }
  288. if (isset($_GET['keyword_extra_data'])) {
  289. $keyword_extra_data = Database::escape_string($_GET['keyword_extra_data']);
  290. if (!empty($keyword_extra_data)) {
  291. $extra_info = UserManager::get_extra_field_information_by_name($keyword_extra_data);
  292. $field_id = $extra_info['id'];
  293. $sql.= " INNER JOIN user_field_values ufv ON u.user_id=ufv.user_id AND ufv.field_id=$field_id ";
  294. }
  295. }
  296. if ( isset ($_GET['keyword'])) {
  297. $keyword = Database::escape_string(trim($_GET['keyword']));
  298. $sql .= " WHERE (u.firstname LIKE '%".$keyword."%' OR u.lastname LIKE '%".$keyword."%' OR concat(u.firstname,' ',u.lastname) LIKE '%".$keyword."%' OR concat(u.lastname,' ',u.firstname) LIKE '%".$keyword."%' OR u.username LIKE '%".$keyword."%' OR u.email LIKE '%".$keyword."%' OR u.official_code LIKE '%".$keyword."%') ";
  299. } elseif (isset ($_GET['keyword_firstname'])) {
  300. $admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
  301. $keyword_firstname = Database::escape_string($_GET['keyword_firstname']);
  302. $keyword_lastname = Database::escape_string($_GET['keyword_lastname']);
  303. $keyword_email = Database::escape_string($_GET['keyword_email']);
  304. $keyword_officialcode = Database::escape_string($_GET['keyword_officialcode']);
  305. $keyword_username = Database::escape_string($_GET['keyword_username']);
  306. $keyword_status = Database::escape_string($_GET['keyword_status']);
  307. $query_admin_table = '';
  308. $keyword_admin = '';
  309. if ($keyword_status == SESSIONADMIN) {
  310. $keyword_status = '%';
  311. $query_admin_table = " , $admin_table a ";
  312. $keyword_admin = ' AND a.user_id = u.user_id ';
  313. }
  314. $keyword_extra_value = '';
  315. if (isset($_GET['keyword_extra_data'])) {
  316. if (!empty($_GET['keyword_extra_data']) && !empty($_GET['keyword_extra_data_text'])) {
  317. $keyword_extra_data_text = Database::escape_string($_GET['keyword_extra_data_text']);
  318. $keyword_extra_value = " AND ufv.field_value LIKE '%".trim($keyword_extra_data_text)."%' ";
  319. }
  320. }
  321. $keyword_active = isset($_GET['keyword_active']);
  322. $keyword_inactive = isset($_GET['keyword_inactive']);
  323. $sql .= $query_admin_table .
  324. " WHERE (u.firstname LIKE '%".$keyword_firstname."%' " .
  325. "AND u.lastname LIKE '%".$keyword_lastname."%' " .
  326. "AND u.username LIKE '%".$keyword_username."%' " .
  327. "AND u.email LIKE '%".$keyword_email."%' " .
  328. "AND u.official_code LIKE '%".$keyword_officialcode."%'" .
  329. "AND u.status LIKE '".$keyword_status."'" .
  330. $keyword_admin.$keyword_extra_value;
  331. if($keyword_active && !$keyword_inactive) {
  332. $sql .= " AND u.active='1'";
  333. } elseif($keyword_inactive && !$keyword_active) {
  334. $sql .= " AND u.active='0'";
  335. }
  336. $sql .= " ) ";
  337. }
  338. // adding the filter to see the user's only of the current access_url
  339. if ((api_is_platform_admin() || api_is_session_admin()) && $_configuration['multiple_access_urls'] && api_get_current_access_url_id()!=-1) {
  340. $sql.= " AND url_rel_user.access_url_id=".api_get_current_access_url_id();
  341. }
  342. $res = Database::query($sql);
  343. $obj = Database::fetch_object($res);
  344. return $obj->total_number_of_items;
  345. }
  346. /**
  347. * Get the users to display on the current page (fill the sortable-table)
  348. * @param int offset of first user to recover
  349. * @param int Number of users to get
  350. * @param int Column to sort on
  351. * @param string Order (ASC,DESC)
  352. * @see SortableTable#get_table_data($from)
  353. */
  354. function get_user_data($from, $number_of_items, $column, $direction)
  355. {
  356. global $_configuration,$origin;
  357. $user_table = Database :: get_main_table(TABLE_MAIN_USER);
  358. $admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
  359. $sql = "SELECT
  360. u.user_id AS col0,
  361. u.official_code AS col2,
  362. ".(api_is_western_name_order()
  363. ? "u.firstname AS col3,
  364. u.lastname AS col4,"
  365. : "u.lastname AS col3,
  366. u.firstname AS col4,")."
  367. u.username AS col5,
  368. u.email AS col6,
  369. u.status AS col7,
  370. u.active AS col8,
  371. u.user_id AS col9 ".
  372. ", u.expiration_date AS exp ".
  373. " FROM $user_table u ";
  374. // adding the filter to see the user's only of the current access_url
  375. if ((api_is_platform_admin() || api_is_session_admin()) && $_configuration['multiple_access_urls'] && api_get_current_access_url_id()!=-1) {
  376. $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
  377. $sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)";
  378. }
  379. if (isset($_GET['keyword_extra_data'])) {
  380. $keyword_extra_data = Database::escape_string($_GET['keyword_extra_data']);
  381. if (!empty($keyword_extra_data)) {
  382. $extra_info = UserManager::get_extra_field_information_by_name($keyword_extra_data);
  383. $field_id = $extra_info['id'];
  384. $sql.= " INNER JOIN user_field_values ufv ON u.user_id=ufv.user_id AND ufv.field_id=$field_id ";
  385. }
  386. }
  387. if (isset ($_GET['keyword'])) {
  388. $keyword = Database::escape_string(trim($_GET['keyword']));
  389. $sql .= " WHERE (u.firstname LIKE '%".$keyword."%' OR u.lastname LIKE '%".$keyword."%' OR concat(u.firstname,' ',u.lastname) LIKE '%".$keyword."%' OR concat(u.lastname,' ',u.firstname) LIKE '%".$keyword."%' OR u.username LIKE '%".$keyword."%' OR u.official_code LIKE '%".$keyword."%' OR u.email LIKE '%".$keyword."%' )";
  390. } elseif (isset ($_GET['keyword_firstname'])) {
  391. $keyword_firstname = Database::escape_string($_GET['keyword_firstname']);
  392. $keyword_lastname = Database::escape_string($_GET['keyword_lastname']);
  393. $keyword_email = Database::escape_string($_GET['keyword_email']);
  394. $keyword_officialcode = Database::escape_string($_GET['keyword_officialcode']);
  395. $keyword_username = Database::escape_string($_GET['keyword_username']);
  396. $keyword_status = Database::escape_string($_GET['keyword_status']);
  397. $query_admin_table = '';
  398. $keyword_admin = '';
  399. if ($keyword_status == SESSIONADMIN) {
  400. $keyword_status = '%';
  401. $query_admin_table = " , $admin_table a ";
  402. $keyword_admin = ' AND a.user_id = u.user_id ';
  403. }
  404. $keyword_extra_value = '';
  405. if (isset($_GET['keyword_extra_data'])) {
  406. if (!empty($_GET['keyword_extra_data']) && !empty($_GET['keyword_extra_data_text'])) {
  407. $keyword_extra_data_text = Database::escape_string($_GET['keyword_extra_data_text']);
  408. $keyword_extra_value = " AND ufv.field_value LIKE '%".trim($keyword_extra_data_text)."%' ";
  409. }
  410. }
  411. $keyword_active = isset($_GET['keyword_active']);
  412. $keyword_inactive = isset($_GET['keyword_inactive']);
  413. $sql .= $query_admin_table." WHERE (u.firstname LIKE '%".$keyword_firstname."%' " .
  414. "AND u.lastname LIKE '%".$keyword_lastname."%' " .
  415. "AND u.username LIKE '%".$keyword_username."%' " .
  416. "AND u.email LIKE '%".$keyword_email."%' " .
  417. "AND u.official_code LIKE '%".$keyword_officialcode."%' " .
  418. "AND u.status LIKE '".$keyword_status."'" .
  419. $keyword_admin.$keyword_extra_value;
  420. if ($keyword_active && !$keyword_inactive) {
  421. $sql .= " AND u.active='1'";
  422. } elseif($keyword_inactive && !$keyword_active) {
  423. $sql .= " AND u.active='0'";
  424. }
  425. $sql .= " ) ";
  426. }
  427. // adding the filter to see the user's only of the current access_url
  428. if ((api_is_platform_admin() || api_is_session_admin()) && $_configuration['multiple_access_urls'] && api_get_current_access_url_id()!=-1) {
  429. $sql.= " AND url_rel_user.access_url_id=".api_get_current_access_url_id();
  430. }
  431. if (!in_array($direction, array('ASC','DESC'))) {
  432. $direction = 'ASC';
  433. }
  434. $column = intval($column);
  435. $from = intval($from);
  436. $number_of_items = intval($number_of_items);
  437. $sql .= " ORDER BY col$column $direction ";
  438. $sql .= " LIMIT $from,$number_of_items";
  439. $res = Database::query($sql);
  440. $users = array ();
  441. $t = time();
  442. while ($user = Database::fetch_row($res)) {
  443. $image_path = UserManager::get_user_picture_path_by_id($user[0], 'web', false, true);
  444. $user_profile = UserManager::get_picture_user($user[0], $image_path['file'], 22, USER_IMAGE_SIZE_SMALL, ' width="22" height="22" ');
  445. if (!api_is_anonymous()) {
  446. $photo = '<center><a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$user[0].'" title="'.get_lang('Info').'" ><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($user[2],$user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" /></a></center>';
  447. } else {
  448. $photo = '<center><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" /></center>';
  449. }
  450. if ($user[7] == 1 && $user[9] != '0000-00-00 00:00:00') {
  451. // check expiration date
  452. $expiration_time = convert_mysql_date($user[9]);
  453. // if expiration date is passed, store a special value for active field
  454. if ($expiration_time < $t) {
  455. $user[7] = '-1';
  456. }
  457. }
  458. // forget about the expiration date field
  459. $users[] = array($user[0],$photo,$user[1],$user[2],$user[3],$user[4],$user[5],$user[6],$user[7],$user[8]);
  460. }
  461. return $users;
  462. }
  463. /**
  464. * Returns a mailto-link
  465. * @param string $email An email-address
  466. * @return string HTML-code with a mailto-link
  467. */
  468. function email_filter($email)
  469. {
  470. return Display :: encrypted_mailto_link($email, $email);
  471. }
  472. /**
  473. * Returns a mailto-link
  474. * @param string $email An email-address
  475. * @return string HTML-code with a mailto-link
  476. */
  477. function user_filter($name, $params, $row) {
  478. return '<a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$row[0].'">'.$name.'</a>';
  479. }
  480. /**
  481. * Build the modify-column of the table
  482. * @param int The user id
  483. * @param string URL params to add to table links
  484. * @param array Row of elements to alter
  485. * @return string Some HTML-code with modify-buttons
  486. */
  487. function modify_filter($user_id,$url_params,$row) {
  488. global $charset, $_user, $_admins_list, $delete_user_available;
  489. $is_admin = in_array($user_id,$_admins_list);
  490. $statusname = api_get_status_langvars();
  491. $user_is_anonymous = false;
  492. if ($row['7'] == $statusname[ANONYMOUS]) {
  493. $user_is_anonymous =true;
  494. }
  495. if (!$user_is_anonymous) {
  496. $result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')">
  497. <img onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')" onmouseout="clear_course_list (\'div_'.$user_id.'\')" src="../img/course.gif" title="'.get_lang('Courses').'" alt="'.get_lang('Courses').'"/>
  498. <div class="blackboard_hide" id="div_'.$user_id.'">&nbsp;&nbsp;</div>
  499. </a>&nbsp;&nbsp;';
  500. } else {
  501. $result .= Display::return_icon('course_na.gif',get_lang('Courses')).'&nbsp;&nbsp;';
  502. }
  503. if (api_is_platform_admin()) {
  504. if (!$user_is_anonymous) {
  505. $result .= '<a href="user_information.php?user_id='.$user_id.'">'.Display::return_icon('synthese_view.gif', get_lang('Info')).'</a>&nbsp;&nbsp;';
  506. } else {
  507. $result .= Display::return_icon('synthese_view_na.gif', get_lang('Info')).'&nbsp;&nbsp;';
  508. }
  509. }
  510. //only allow platform admins to login_as, or session admins only for students (not teachers nor other admins)
  511. if (api_is_platform_admin() || (api_is_session_admin() && $row['7'] == $statusname[STUDENT])) {
  512. if (!$user_is_anonymous) {
  513. $result .= '<a href="user_list.php?action=login_as&amp;user_id='.$user_id.'&amp;sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('login_as.gif', get_lang('LoginAs')).'</a>&nbsp;&nbsp;';
  514. } else {
  515. $result .= Display::return_icon('login_as_na.gif', get_lang('LoginAs')).'&nbsp;&nbsp;';
  516. }
  517. } else {
  518. $result .= Display::return_icon('login_as_na.gif', get_lang('LoginAs')).'&nbsp;&nbsp;';
  519. }
  520. if ($row['7'] != $statusname[STUDENT]) {
  521. $result .= Display::return_icon('statistics_na.gif', get_lang('Reporting')).'&nbsp;&nbsp;';
  522. } else {
  523. $result .= '<a href="../mySpace/myStudents.php?student='.$user_id.'">'.Display::return_icon('statistics.gif', get_lang('Reporting')).'</a>&nbsp;&nbsp;';
  524. }
  525. if (api_is_platform_admin()) {
  526. if (!$user_is_anonymous) {
  527. $result .= '<a href="user_edit.php?user_id='.$user_id.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>&nbsp;&nbsp;';
  528. } else {
  529. $result .= Display::return_icon('edit_na.gif', get_lang('Edit')).'</a>&nbsp;&nbsp;';
  530. }
  531. if ($delete_user_available) {
  532. if ($row[0] != $_user['user_id'] && !$user_is_anonymous) {
  533. // 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.
  534. $result .= '<a href="user_list.php?action=delete_user&amp;user_id='.$user_id.'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
  535. } else {
  536. $result .= Display::return_icon('delete_na.gif', get_lang('Delete'));
  537. }
  538. }
  539. }
  540. if ($is_admin) {
  541. $result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'),array('width'=> 22, 'heigth'=> 22));
  542. } else {
  543. $result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator'));
  544. }
  545. // actions for assigning sessions, courses or users
  546. if (api_is_session_admin()) {
  547. /*if ($row[0] == api_get_user_id()) {
  548. $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;';
  549. }*/
  550. } else {
  551. if ($row['7'] == $statusname[DRH] || UserManager::is_admin($row[0])) {
  552. $result .= '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">'.Display::return_icon('add_user_big.gif', get_lang('AssignUsers')).'</a>&nbsp;&nbsp;';
  553. $result .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">'.Display::return_icon('course_add.gif', get_lang('AssignCourses')).'</a>&nbsp;&nbsp;';
  554. $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;';
  555. } else if ($row['7'] == $statusname[SESSIONADMIN]) {
  556. $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;';
  557. }
  558. }
  559. return $result;
  560. }
  561. /**
  562. * Build the active-column of the table to lock or unlock a certain user
  563. * lock = the user can no longer use this account
  564. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  565. * @param int $active the current state of the account
  566. * @param int $user_id The user id
  567. * @param string $url_params
  568. * @return string Some HTML-code with the lock/unlock button
  569. */
  570. function active_filter($active, $url_params, $row) {
  571. global $_user;
  572. if ($active=='1') {
  573. $action='Lock';
  574. $image='right';
  575. } elseif ($active=='-1') {
  576. $action='edit';
  577. $image='expired';
  578. } elseif ($active=='0') {
  579. $action='Unlock';
  580. $image='wrong';
  581. }
  582. if ($action=='edit') {
  583. $result = Display::return_icon($image.'.gif', get_lang('AccountExpired'));
  584. } elseif ($row['0']<>$_user['user_id']) {
  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='.$action.'&amp;user_id='.$row['0'].'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon($image.'.gif', get_lang(ucfirst($action))).'</a>';
  587. //$result = '<a href="'.api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?action=active_user&amp;user_id='.$row['0'].'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'">';
  588. $result .=Display::return_icon($image.'.gif', get_lang(ucfirst($action)), array('onclick'=>'active_user(this);', 'id'=>'img_'.$row['0'])).'</a>';
  589. //$result .= '<div>';
  590. }
  591. return $result;
  592. }
  593. /**
  594. * Lock or unlock a user
  595. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  596. * @param int $status, do we want to lock the user ($status=lock) or unlock it ($status=unlock)
  597. * @param int $user_id The user id
  598. * @return language variable
  599. */
  600. function lock_unlock_user($status,$user_id)
  601. {
  602. $user_table = Database :: get_main_table(TABLE_MAIN_USER);
  603. if ($status=='lock')
  604. {
  605. $status_db='0';
  606. $return_message=get_lang('UserLocked');
  607. }
  608. if ($status=='unlock')
  609. {
  610. $status_db='1';
  611. $return_message=get_lang('UserUnlocked');
  612. }
  613. if(($status_db=='1' OR $status_db=='0') AND is_numeric($user_id))
  614. {
  615. $sql="UPDATE $user_table SET active='".Database::escape_string($status_db)."' WHERE user_id='".Database::escape_string($user_id)."'";
  616. $result = Database::query($sql);
  617. }
  618. if ($result)
  619. {
  620. return $return_message;
  621. }
  622. }
  623. /**
  624. * Instead of displaying the integer of the status, we give a translation for the status
  625. *
  626. * @param integer $status
  627. * @return string translation
  628. *
  629. * @version march 2008
  630. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  631. */
  632. function status_filter($status)
  633. {
  634. $statusname = api_get_status_langvars();
  635. return $statusname[$status];
  636. }
  637. /** INIT SECTION */
  638. $action = $_GET["action"];
  639. $login_as_user_id = $_GET["user_id"];
  640. // Login as ...
  641. if ($_GET['action'] == "login_as" && isset ($login_as_user_id))
  642. {
  643. login_user($login_as_user_id);
  644. }
  645. //if (isset ($_GET['search']) && $_GET['search'] == 'advanced')
  646. //{}
  647. //else
  648. //{
  649. if (isset($_GET['keyword']) || isset($_GET['keyword_firstname'])) {
  650. $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
  651. $interbreadcrumb[] = array ("url" => 'user_list.php', "name" => get_lang('UserList'));
  652. $tool_name = get_lang('SearchUsers');
  653. } else {
  654. $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
  655. $tool_name = get_lang('UserList');
  656. }
  657. Display :: display_header($tool_name, "");
  658. //api_display_tool_title($tool_name);
  659. if (isset ($_GET['action'])) {
  660. $check = Security::check_token('get');
  661. if($check) {
  662. switch ($_GET['action']) {
  663. case 'show_message' :
  664. if (!empty($_GET['warn'])) {
  665. // to prevent too long messages
  666. if ($_GET['warn'] == 'session_message'){
  667. $_GET['warn'] = $_SESSION['session_message_import_users'];
  668. }
  669. Display::display_warning_message(urldecode($_GET['warn']),false);
  670. }
  671. if (!empty($_GET['message'])) {
  672. Display :: display_confirmation_message(stripslashes($_GET['message']));
  673. }
  674. break;
  675. case 'delete_user' :
  676. if (api_is_platform_admin()) {
  677. if ($delete_user_available) {
  678. if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id'])) {
  679. Display :: display_confirmation_message(get_lang('UserDeleted'));
  680. } else {
  681. Display :: display_error_message(get_lang('CannotDeleteUserBecauseOwnsCourse'));
  682. }
  683. } else {
  684. Display :: display_error_message(get_lang('CannotDeleteUser'));
  685. }
  686. }
  687. break;
  688. case 'lock' :
  689. $message=lock_unlock_user('lock',$_GET['user_id']);
  690. Display :: display_normal_message($message);
  691. break;
  692. case 'unlock';
  693. $message=lock_unlock_user('unlock',$_GET['user_id']);
  694. Display :: display_normal_message($message);
  695. break;
  696. }
  697. Security::clear_token();
  698. }
  699. }
  700. if (isset ($_POST['action']))
  701. {
  702. $check = Security::check_token('get');
  703. if($check)
  704. {
  705. switch ($_POST['action'])
  706. {
  707. case 'delete' :
  708. if (api_is_platform_admin()) {
  709. $number_of_selected_users = count($_POST['id']);
  710. $number_of_deleted_users = 0;
  711. if (is_array($_POST['id'])) {
  712. foreach ($_POST['id'] as $index => $user_id)
  713. {
  714. if($user_id != $_user['user_id'])
  715. {
  716. if(UserManager :: delete_user($user_id))
  717. {
  718. $number_of_deleted_users++;
  719. }
  720. }
  721. }
  722. }
  723. if($number_of_selected_users == $number_of_deleted_users)
  724. {
  725. Display :: display_confirmation_message(get_lang('SelectedUsersDeleted'));
  726. }
  727. else
  728. {
  729. Display :: display_error_message(get_lang('SomeUsersNotDeleted'));
  730. }
  731. }
  732. break;
  733. }
  734. Security::clear_token();
  735. }
  736. }
  737. // Create a search-box
  738. $form = new FormValidator('search_simple','get','','',null,false);
  739. $renderer =& $form->defaultRenderer();
  740. $renderer->setElementTemplate('<span>{element}</span> ');
  741. $form->addElement('text','keyword',get_lang('keyword'));
  742. $form->addElement('style_submit_button', 'submit',get_lang('Search'),'class="search"');
  743. //$form->addElement('static','search_advanced_link',null,'<a href="user_list.php?search=advanced">'.get_lang('AdvancedSearch').'</a>');
  744. $form->addElement('static','search_advanced_link',null,'<a href="javascript://" class = "advanced_parameters" onclick="display_advanced_search_form();"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'</span></a>');
  745. echo '<div class="actions" style="width:100%;">';
  746. if (api_is_platform_admin()) {
  747. echo '<span style="float:right; padding-top:7px;">'.
  748. '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.Display::return_icon('add_user_big.gif',get_lang('AddUsers')).get_lang('AddUsers').'</a>'.
  749. '</span>';
  750. }
  751. $form->display();
  752. echo '</div>';
  753. if (isset ($_GET['keyword'])) {
  754. $parameters = array ('keyword' => Security::remove_XSS($_GET['keyword']));
  755. } elseif (isset ($_GET['keyword_firstname'])) {
  756. $parameters['keyword_firstname'] = Security::remove_XSS($_GET['keyword_firstname']);
  757. $parameters['keyword_lastname'] = Security::remove_XSS($_GET['keyword_lastname']);
  758. $parameters['keyword_email'] = Security::remove_XSS($_GET['keyword_email']);
  759. $parameters['keyword_officialcode'] = Security::remove_XSS($_GET['keyword_officialcode']);
  760. $parameters['keyword_status'] = Security::remove_XSS($_GET['keyword_status']);
  761. $parameters['keyword_active'] = Security::remove_XSS($_GET['keyword_active']);
  762. $parameters['keyword_inactive'] = Security::remove_XSS($_GET['keyword_inactive']);
  763. }
  764. // Create a sortable table with user-data
  765. $parameters['sec_token'] = Security::get_token();
  766. // get the list of all admins to mark them in the users list
  767. $admin_table = Database::get_main_table(TABLE_MAIN_ADMIN);
  768. $sql_admin = "SELECT user_id FROM $admin_table";
  769. $res_admin = Database::query($sql_admin);
  770. $_admins_list = array();
  771. while ($row_admin = Database::fetch_row($res_admin)) {
  772. $_admins_list[] = $row_admin[0];
  773. }
  774. $image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
  775. $user_profile = UserManager::get_picture_user($user_id, $image_path['file'], 22, USER_IMAGE_SIZE_SMALL, ' width="22" height="22" ');
  776. if (!api_is_anonymous()) {
  777. $photo = '<center><a href="userInfo.php?'.api_get_cidreq().'&origin='.$origin.'&amp;uInfo='.$user_id.'" title="'.get_lang('Info').'" ><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" title="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" /></a></center>';
  778. } else {
  779. $photo = '<center><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" title="'.api_get_person_name($o_course_user['firstname'], $o_course_user['lastname']).'" /></center>';
  780. }
  781. // display advaced search form
  782. $form = new FormValidator('advanced_search','get');
  783. $form->addElement('html','<div id="advanced_search_form" style="display:none;">');
  784. $form->addElement('header', '', get_lang('AdvancedSearch'));
  785. //$form->addElement('html', '<strong>'.get_lang('SearchAUser').'</strong>');
  786. $form->addElement('html', '<table>');
  787. $form->addElement('html', '<tr><td>');
  788. $form->add_textfield('keyword_firstname',get_lang('FirstName'),false,array('style'=>'margin-left:17px'));
  789. $form->addElement('html', '</td><td width="200px;">');
  790. $form->add_textfield('keyword_lastname',get_lang('LastName'),false,array('style'=>'margin-left:17px'));
  791. $form->addElement('html', '</td></tr>');
  792. $form->addElement('html', '<tr><td>');
  793. $form->add_textfield('keyword_username',get_lang('LoginName'),false,array('style'=>'margin-left:17px'));
  794. $form->addElement('html', '</td>');
  795. $form->addElement('html', '<td>');
  796. $form->add_textfield('keyword_email',get_lang('Email'),false,array('style'=>'margin-left:17px'));
  797. $form->addElement('html', '</td></tr>');
  798. $form->addElement('html', '<tr><td>');
  799. $form->add_textfield('keyword_officialcode',get_lang('OfficialCode'),false,array('style'=>'margin-left:17px'));
  800. $form->addElement('html', '</td><td>');
  801. $status_options = array();
  802. $status_options['%'] = get_lang('All');
  803. $status_options[STUDENT] = get_lang('Student');
  804. $status_options[COURSEMANAGER] = get_lang('Teacher');
  805. $status_options[DRH] = get_lang('Drh');
  806. $status_options[SESSIONADMIN] = get_lang('Administrator');
  807. $form->addElement('select','keyword_status',get_lang('Profile'),$status_options, array('style'=>'margin-left:17px'));
  808. $form->addElement('html', '</td></tr>');
  809. $form->addElement('html', '<tr><td>');
  810. $active_group = array();
  811. $active_group[] = $form->createElement('checkbox','keyword_active','',get_lang('Active'), array('style'=>'margin-left:17px'));
  812. $active_group[] = $form->createElement('checkbox','keyword_inactive','',get_lang('Inactive'),array('style'=>'margin-left:17px'));
  813. $form->addGroup($active_group,'',get_lang('ActiveAccount'),'<br/>',false);
  814. $form->addElement('html', '</td><td>');
  815. $extra_data = UserManager::get_extra_user_data($user_id, false, true, false, 1);
  816. $extra_options = array();
  817. if (!empty($extra_data)) {
  818. $extra_options[0] = get_lang('All');
  819. // get information about extra data for adding to input select
  820. foreach ($extra_data as $field_variable => $field_value) {
  821. $extra = UserManager::get_extra_field_information_by_name($field_variable);
  822. $extra_options[$field_variable] = $extra['field_display_text'];
  823. }
  824. $form->addElement('select', 'keyword_extra_data', get_lang('ExtraData'), $extra_options, array('id'=>'input_select_extra_data', 'style'=>'margin-left:17px', 'onchange'=>'if(this.value!=0){document.getElementById(\'extra_data_text\').style.display=\'block\';document.getElementById(\'input_extra_text\').value = "";}else{document.getElementById(\'extra_data_text\').style.display=\'none\';}'));
  825. $form->addElement('html', '<div id="extra_data_text" style="display:none;">');
  826. $form->add_textfield('keyword_extra_data_text', '', false, array('style'=>'margin-left:17px', 'id'=>'input_extra_text'));
  827. $form->addElement('html', '</div>');
  828. } else {
  829. $form->addElement('html', '<div id="extra_data_text" style="display:none;">');
  830. }
  831. $form->addElement('html', '</td></tr>');
  832. $form->addElement('html', '<tr><td>');
  833. $form->addElement('style_submit_button', 'submit',get_lang('SearchUsers'),'class="search"');
  834. $form->addElement('html', '</td></tr>');
  835. $form->addElement('html', '</table>');
  836. $defaults['keyword_active'] = 1;
  837. $defaults['keyword_inactive'] = 1;
  838. $form->setDefaults($defaults);
  839. $form -> addElement('html','</div>');
  840. $form->display();
  841. $table = new SortableTable('users', 'get_number_of_users', 'get_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
  842. $table->set_additional_parameters($parameters);
  843. $table->set_header(0, '', false, 'width="18px"');
  844. $table->set_header(1, get_lang('Photo'), false);
  845. $table->set_header(2, get_lang('OfficialCode'));
  846. if (api_is_western_name_order()) {
  847. $table->set_header(3, get_lang('FirstName'));
  848. $table->set_header(4, get_lang('LastName'));
  849. } else {
  850. $table->set_header(3, get_lang('LastName'));
  851. $table->set_header(4, get_lang('FirstName'));
  852. }
  853. $table->set_header(5, get_lang('LoginName'));
  854. $table->set_header(6, get_lang('Email'));
  855. $table->set_header(7, get_lang('Profile'));
  856. $table->set_header(8, get_lang('Active'),true, 'width="15px"');
  857. $table->set_header(9, get_lang('Action'), false,'width="220px"');
  858. $table->set_column_filter(3, 'user_filter');
  859. $table->set_column_filter(4, 'user_filter');
  860. $table->set_column_filter(6, 'email_filter');
  861. $table->set_column_filter(7, 'status_filter');
  862. $table->set_column_filter(8, 'active_filter');
  863. $table->set_column_filter(9, 'modify_filter');
  864. if (api_is_platform_admin())
  865. $table->set_form_actions(array ('delete' => get_lang('DeleteFromPlatform')));
  866. $table->display();
  867. //}
  868. Display :: display_footer();