Beispiel #1
0
 public function login()
 {
     if ($this->_identity === null) {
         $this->_identity = Yii::app()->authenticationHelper->makeIdentity($this->username, $this->password);
         $this->_identity->authenticate();
     }
     if ($this->_identity->errorCode == UserIdentity::ERROR_NONE) {
         $duration = $this->rememberMe ? 3600 * 24 * 30 : 0;
         // 30 days
         Yii::app()->user->login($this->_identity, $duration);
         // If user is usper admin, check for last stable zurmo version.
         $group = Group::getByName(Group::SUPER_ADMINISTRATORS_GROUP_NAME);
         $user = User::getByUsername(Yii::app()->user->username);
         if ($group->contains($user)) {
             ZurmoModule::checkAndUpdateZurmoInfo();
         }
         return true;
     } else {
         return false;
     }
 }
 /**
  * Check if there are new zurmo updates.
  * Then delete these logs.
  *
  * @see BaseJob::run()
  */
 public function run()
 {
     ZurmoModule::checkAndUpdateZurmoInfo(true);
     return true;
 }