Show only session admin created users in user list and in session creation- refs BT#9324

1.9.x
Imanol Losada 10 years ago
parent 8cbb366115
commit 6061f6975a
  1. 4
      main/admin/add_users_to_session.php
  2. 4
      main/admin/user_list.php

@ -95,6 +95,10 @@ function search_users($needle, $type)
$order_clause = ' ORDER BY official_code, firstname, lastname, username';
}
if (api_is_session_admin() && api_get_setting('allow_session_admins_to_manage_all_users') == 'false') {
$order_clause = " AND user.creator_id = ".api_get_user_id().$order_clause;
}
$cond_user_id = '';
// Only for single & multiple

@ -446,6 +446,10 @@ function get_user_data($from, $number_of_items, $column, $direction) {
$from = intval($from);
$number_of_items = intval($number_of_items);
if (api_is_session_admin() && api_get_setting('allow_session_admins_to_manage_all_users') == 'false') {
$sql .= " WHERE u.creator_id = ".api_get_user_id();
}
$sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items";

Loading…
Cancel
Save