mirror of
https://github.com/friendica/friendica
synced 2025-04-27 23:10:12 +00:00
The boot.php had been cleared of most functions
This commit is contained in:
parent
4989d1fa99
commit
63da4a75e9
37 changed files with 279 additions and 401 deletions
14
src/App.php
14
src/App.php
|
@ -154,6 +154,20 @@ class App
|
|||
return local_user() && $this->user_id && ($this->user_id == local_user());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if current user has admin role.
|
||||
*
|
||||
* @return bool true if user is an admin
|
||||
*/
|
||||
public function isSiteAdmin()
|
||||
{
|
||||
$admin_email = $this->config->get('config', 'admin_email');
|
||||
|
||||
$adminlist = explode(',', str_replace(' ', '', $admin_email));
|
||||
|
||||
return local_user() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the user id
|
||||
* @return int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue