mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-04 08:28:56 +08:00
Symfony 6.4 - Re-setup Security Controller
- Use attributes instead of annotations - Adjust to new session changes - Adjust to new symfony setup [Legacy] Re-setup Security Controller - Add method to check if user is enabled
This commit is contained in:
parent
9463e4f6ec
commit
bb7074b86b
3 changed files with 77 additions and 47 deletions
|
@ -297,6 +297,22 @@ class AuthenticationController
|
|||
return $this->authenticated;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called on every page hit.
|
||||
* It returns true if the current session is authenticated or false otherwise
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isUserActive(): bool
|
||||
{
|
||||
global $current_user;
|
||||
|
||||
/** @var User $reloadedUser */
|
||||
$reloadedUser = BeanFactory::getBean('Users', $current_user->id);
|
||||
|
||||
return $reloadedUser->isEnabled() ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a user requests to logout. Should invalidate the session and redirect
|
||||
* to the login page.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue