Add "User::block()" to console command
This commit is contained in:
		
					parent
					
						
							
								b4f6e8fda1
							
						
					
				
			
			
				commit
				
					
						0c3f8b124b
					
				
			
		
					 3 changed files with 40 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue