1
1
Fork 0

Use Model\User::getById when possible in Module\Settings\Delegation

This commit is contained in:
Hypolite Petovan 2019-10-10 04:10:57 -04:00
parent cc0cf2b8ce
commit 3cd916d7aa

View file

@ -62,7 +62,7 @@ class Delegation extends BaseSettingsModule
self::getApp()->internalRedirect('settings/delegation'); self::getApp()->internalRedirect('settings/delegation');
} }
$user = DBA::selectFirst('user', ['nickname'], ['uid' => $user_id]); $user = User::getById($user_id, ['nickname']);
if (DBA::isResult($user)) { if (DBA::isResult($user)) {
$condition = [ $condition = [
'uid' => local_user(), 'uid' => local_user(),
@ -126,7 +126,7 @@ class Delegation extends BaseSettingsModule
$parent_user = null; $parent_user = null;
$parent_password = null; $parent_password = null;
$user = DBA::selectFirst('user', ['parent-uid', 'email'], ['uid' => local_user()]); $user = User::getById(local_user(), ['parent-uid', 'email']);
if (DBA::isResult($user) && !DBA::exists('user', ['parent-uid' => local_user()])) { if (DBA::isResult($user) && !DBA::exists('user', ['parent-uid' => local_user()])) {
$parent_uid = $user['parent-uid']; $parent_uid = $user['parent-uid'];
$parents = [0 => L10n::t('No parent user')]; $parents = [0 => L10n::t('No parent user')];