Add new possibility to add a user per console

This commit is contained in:
nupplaPhil 2020-02-20 23:43:52 +01:00
parent 4d436c10df
commit f3f764bc39
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
6 changed files with 230 additions and 77 deletions

View file

@ -880,6 +880,21 @@ class User
return $return;
}
/**
* Sets block state for a given user
*
* @param int $uid The user id
* @param bool $block Block state (default is true)
*
* @return bool True, if successfully blocked
* @throws Exception
*/
public static function block(int $uid, bool $block = true)
{
return DBA::update('user', ['blocked' => 0], ['uid' => $uid]);
}
/**
* Sends pending registration confirmation email
*