Move "User::allow()" to own method and update usages

This commit is contained in:
nupplaPhil 2020-02-21 22:57:17 +01:00
parent f3f764bc39
commit 6aee153bbd
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
7 changed files with 197 additions and 194 deletions

View file

@ -48,6 +48,27 @@ class Register
return DBA::toArray($stmt);
}
/**
* Returns the pending user based on a given user id
*
* @param int $uid The user id
*
* @return array The pending user information
*
* @throws \Exception
*/
public static function getPendingForUser(int $uid)
{
return DBA::fetchFirst(
"SELECT `register`.*, `contact`.`name`, `contact`.`url`, `contact`.`micro`, `user`.`email`
FROM `register`
INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid`
INNER JOIN `user` ON `register`.`uid` = `user`.`uid`
WHERE `register`.uid = ?",
$uid
);
}
/**
* Returns the pending registration count
*