mirror of
https://github.com/friendica/friendica
synced 2025-04-25 18:30:11 +00:00
Adapt UserSession
- Move from App methods to UserSession methods - Deprecate corresponding App methods
This commit is contained in:
parent
c376605dd2
commit
bfc1c157f1
6 changed files with 62 additions and 46 deletions
|
@ -830,6 +830,22 @@ class User
|
|||
return DBA::update('user', $fields, ['uid' => $uid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the given uid is valid and in the admin list
|
||||
*
|
||||
* @param int $uid
|
||||
*
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function isSiteAdmin(int $uid): bool
|
||||
{
|
||||
return DBA::exists('user', [
|
||||
'uid' => $uid,
|
||||
'email' => self::getAdminEmailList()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a nickname is in the list of the forbidden nicknames
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue