Skip to content

Commit

Permalink
MDL-23774 only local users can be admins - more security and fewer "l…
Browse files Browse the repository at this point in the history
…ost admin account" problems
  • Loading branch information
skodak committed Aug 12, 2010
1 parent e985de2 commit d44df69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions admin/roles/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1507,15 +1507,16 @@ public function __construct() {
}

public function find_users($search) {
global $DB;
global $CFG, $DB;
list($wherecondition, $params) = $this->search_sql($search, '');

$fields = 'SELECT ' . $this->required_fields_sql('');
$countfields = 'SELECT COUNT(1)';

$sql = " FROM {user}
WHERE $wherecondition";
WHERE $wherecondition AND mnethostid = :localmnet";
$order = ' ORDER BY lastname ASC, firstname ASC';
$params['localmnet'] = $CFG->mnet_localhost_id; // it could be dangerous to make remote users admins and also this could lead to other problems

$availableusers = $DB->get_records_sql($fields . $sql . $order, $params);

Expand Down

0 comments on commit d44df69

Please sign in to comment.