App->contact is now removed

This commit is contained in:
Michael 2021-07-24 11:49:11 +00:00
parent f60d60e997
commit 30aad250df
16 changed files with 65 additions and 54 deletions

View file

@ -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
*