mirror of
https://github.com/friendica/friendica
synced 2025-04-26 07:50:15 +00:00
App->contact is now removed
This commit is contained in:
parent
f60d60e997
commit
30aad250df
16 changed files with 65 additions and 54 deletions
|
@ -1569,6 +1569,38 @@ class User
|
|||
return $identities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given user id has delegations or is delegated
|
||||
*
|
||||
* @param int $uid
|
||||
* @return bool
|
||||
*/
|
||||
public static function hasIdentities(int $uid):bool
|
||||
{
|
||||
if (empty($uid)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = DBA::selectFirst('user', ['parent-uid'], ['uid' => $uid, 'account_removed' => false]);
|
||||
if (!DBA::isResult($user)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($user['parent-uid'] != 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (DBA::exists('user', ['parent-uid' => $uid, 'account_removed' => false])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (DBA::exists('manage', ['muid' => $uid])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns statistical information about the current users of this node
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue