mirror of
https://github.com/friendica/friendica
synced 2025-04-25 15:10:13 +00:00
AP: Always sign requests
This commit is contained in:
parent
dca1fa06bf
commit
e06d9f20cf
4 changed files with 48 additions and 29 deletions
|
@ -185,6 +185,29 @@ class User
|
|||
return DBA::selectFirst('user', $fields, ['email' => $email]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the user array of the administrator. The first one if there are several.
|
||||
*
|
||||
* @param array $fields
|
||||
* @return array user
|
||||
*/
|
||||
public static function getFirstAdmin(array $fields = [])
|
||||
{
|
||||
$condition = [];
|
||||
if (!empty(DI::config()->get('config', 'admin_nickname'))) {
|
||||
$condition['nickname'] = DI::config()->get('config', 'admin_nickname');
|
||||
}
|
||||
if (!empty(DI::config()->get('config', 'admin_email'))) {
|
||||
$adminList = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
|
||||
$condition['email'] = $adminList[0];
|
||||
$administrator = self::getByEmail($adminList[0], $fields);
|
||||
if (!empty($administrator)) {
|
||||
return $administrator;
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get owner data by user id
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue