mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
System: Access: Users - change isset() to !empty() for disabled status in preperation for https://github.com/opnsense/core/issues/7904
This commit is contained in:
parent
9e01cc3191
commit
85bde6565c
@ -328,7 +328,7 @@ function local_user_set(&$user, $force_password = false, $userattrs = null)
|
||||
$is_expired = !empty($user['expires']) &&
|
||||
strtotime('-1 day') > strtotime(date('m/d/Y', strtotime($user['expires'])));
|
||||
|
||||
$is_disabled = isset($user['disabled']);
|
||||
$is_disabled = !empty($user['disabled']);
|
||||
|
||||
$is_unlocked = !$is_disabled && !$is_expired;
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ class API extends Base implements IAuthConnector
|
||||
}
|
||||
|
||||
if ($userObject != null) {
|
||||
if (isset($userObject->disabled)) {
|
||||
if (!empty((string)$userObject->disabled)) {
|
||||
// disabled user
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ class Local extends Base implements IAuthConnector
|
||||
{
|
||||
$userObject = $this->getUser($username);
|
||||
if ($userObject != null) {
|
||||
if (isset($userObject->disabled)) {
|
||||
if (!empty((string)$userObject->disabled)) {
|
||||
// disabled user
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$pconfig['usernamefld'] = $a_user[$id]['name'];
|
||||
}
|
||||
$pconfig['groups'] = local_user_get_groups($a_user[$id]);
|
||||
$pconfig['disabled'] = isset($a_user[$id]['disabled']);
|
||||
$pconfig['disabled'] = !empty($a_user[$id]['disabled']);
|
||||
foreach ($fieldnames as $fieldname) {
|
||||
if (isset($a_user[$id][$fieldname])) {
|
||||
$pconfig[$fieldname] = $a_user[$id][$fieldname];
|
||||
@ -1017,7 +1017,7 @@ $( document ).ready(function() {
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
if (isset($userent['disabled'])) {
|
||||
if (!empty($userent['disabled'])) {
|
||||
$usrimg = 'text-muted';
|
||||
} elseif (userIsAdmin($userent['name'])) {
|
||||
$usrimg = 'text-danger';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user