Exemplo n.º 1
0
 /**
  * Check to see if the user is logged in and activated, and hasn't been banned or suspended.
  *
  * @return bool
  */
 public function check()
 {
     $user = BackendAuth::getUser();
     // Something funky has happened. Don't initiate an MFA check.
     if (!$user) {
         return true;
     }
     // Not using MFA. Good to move on.
     if (!$user->mfa_enabled) {
         return true;
     }
     // User has never MFA'd before - so we know they'll need to do it
     if (!$user->mfa_persist_code) {
         return false;
     }
     // The user has logged in again since last MFA. They'll need to re-MFA
     if ($this->generatePersistCode($user) != $user->mfa_persist_code) {
         return false;
     }
     // Do standard checks
     if (!parent::check()) {
         return false;
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * Check to see if the user is logged in and activated, and hasn't been banned or suspended.
  *
  * @return bool 
  * @static 
  */
 public static function check()
 {
     //Method inherited from \October\Rain\Auth\Manager
     return \Backend\Classes\AuthManager::check();
 }