Add "User::block()" to console command

This commit is contained in:
nupplaPhil 2020-02-21 23:12:07 +01:00
parent b4f6e8fda1
commit 0c3f8b124b
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
3 changed files with 40 additions and 8 deletions

View file

@ -894,7 +894,7 @@ class User
*/
public static function block(int $uid, bool $block = true)
{
return DBA::update('user', ['blocked' => 0], ['uid' => $uid]);
return DBA::update('user', ['blocked' => $block], ['uid' => $uid]);
}
/**
@ -1150,11 +1150,11 @@ class User
}
/**
* @param object $uid user to remove
* @param int $uid user to remove
* @return bool
* @throws InternalServerErrorException
*/
public static function remove($uid)
public static function remove(int $uid)
{
if (!$uid) {
return false;