}
//With not activated user
- if (!$user->isActivated()) {
- $ex = new UnactivatedException('Account is not activated');
- $ex->setUser($user);
- throw $ex;
- }
+ if (!$user->isActivated()) {
+ $ex = new UnactivatedException('User Account is not activated');
+ $ex->setUser($user);
+ throw $ex;
+ }
- //With disabled user
- if ($user->isDisabled()) {
- $ex = new DisabledException('Account is disabled');
- $ex->setUser($user);
- throw $ex;
- }
+ //Call parent checkPreAuth
+ parent::checkPostAuth($user);
}
}
/**
* Check if account is activated
*
- * It was from deprecated AdvancedUserInterface, see if it's used anymore
- *
- * @see vendor/symfony/security-core/User/AdvancedUserInterface.php
+ * @see vendor/rapsys/userbundle/Checker/UserChecker.php
*/
public function isActivated(): bool {
return $this->active;
}
/**
- * Check if account is disabled
- *
- * It was from deprecated AdvancedUserInterface, see if it's used anymore
+ * Check if account is enabled
*
- * @see vendor/symfony/security-core/User/AdvancedUserInterface.php
+ * @see vendor/symfony/security-core/User/InMemoryUserChecker.php
*/
- public function isDisabled(): bool {
- return $this->disabled;
+ public function isEnabled(): bool {
+ return !$this->disabled;
}
/**