public function lock()
    {
        $user = UserHelper::getUser($this->getUserResource());

        if ($this->getUserLocksService()->lockUser($user)) {
            $this->returnJson(['success' => true, 'message' => __('User %s successfully locked', UserHelper::getUserLogin(UserHelper::getUser($user)))]);
        } else {
            $this->returnJson(['success' => false, 'message' => __('User %s can not be locked', UserHelper::getUserLogin(UserHelper::getUser($user)))]);
        }
    }
public function lock()
    {
        $user = UserHelper::getUser($this->getUserResource());

        if ($this->getUserLocksService()->lockUser($user)) {
            $this->returnJson(['success' => true, 'message' => __('User %s successfully locked', UserHelper::getUserLogin(UserHelper::getUser($user)))]);
        } else {
            $this->returnJson(['success' => false, 'message' => __('User %s can not be locked', UserHelper::getUserLogin(UserHelper::getUser($user)))]);
        }
    }
public function lock ( ) { $ user = UserHelper :: getUser ( $ this -> getUserResource ( ) ) ; if ( $ this -> getUserLocksService ( ) -> lockUser ( $ user ) ) { $ this -> returnJson ( [ 'success' => true , 'message' => __ ( 'User %s successfully locked' , UserHelper :: getUserLogin ( UserHelper :: getUser ( $ user ) ) ) ] ) ; } else { $ this -> returnJson ( [ 'success' => false , 'message' => __ ( 'User %s can not be locked' , UserHelper :: getUserLogin ( UserHelper :: getUser ( $ user ) ) ) ] ) ; } }
Locks user account, he can not login in to the system anymore
@throws Exception
Locks user account he can not login in to the system anymore