mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
system: use userIsAdmin() even if we have to resolve again
This commit is contained in:
parent
d6a5db4f63
commit
ca5140cbf7
@ -350,8 +350,10 @@ function userHasPrivilege($userent, $privid = false)
|
||||
return true;
|
||||
}
|
||||
|
||||
function userIsAdmin($username) {
|
||||
function userIsAdmin($username)
|
||||
{
|
||||
$user = getUserEntry($username);
|
||||
|
||||
return userHasPrivilege($user, 'page-all');
|
||||
}
|
||||
|
||||
@ -485,7 +487,7 @@ function local_user_set(&$user, $force_password = false)
|
||||
}
|
||||
|
||||
/* admins access gives wheely rights */
|
||||
if (userHasPrivilege($user, 'page-all')) {
|
||||
if (userIsAdmin($user['name'])) {
|
||||
$user_group = 'wheel';
|
||||
}
|
||||
|
||||
|
||||
@ -998,7 +998,7 @@ $( document ).ready(function() {
|
||||
<?php
|
||||
if (isset($userent['disabled'])) {
|
||||
$usrimg = 'text-muted';
|
||||
} elseif (userHasPrivilege($userent, 'page-all')) {
|
||||
} elseif (userIsAdmin($userent['name'])) {
|
||||
$usrimg = 'text-danger';
|
||||
} else {
|
||||
$usrimg = 'text-info';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user