Example #1
0
 public function isAuthenticated()
 {
     if ($this->getGuardUser()) {
         if ($this->hasAttribute(self::SESSION_LAST_ATHENTICATED_CHECK)) {
             if ($this->getAttribute(self::SESSION_LAST_ATHENTICATED_CHECK) != $this->getGuardUser()->getUpdatedAt()) {
                 if (!$this->getGuardUser()->getIsActive()) {
                     $this->signOut();
                     return false;
                 }
                 $this->setAttribute(self::SESSION_LAST_ATHENTICATED_CHECK, $this->getGuardUser()->getUpdatedAt());
             }
         } else {
             $this->setAttribute(self::SESSION_LAST_ATHENTICATED_CHECK, $this->getGuardUser()->getUpdatedAt());
         }
     }
     return parent::isAuthenticated();
 }