/** * Should handle execution of the task, taking as much (optional) parameters as needed * * The parameters should be optional and failing to provide them should be handled by * the task */ public function execute() { $batch = $this->getBatch(); $import = $batch->getVariable('import'); if (!(isset($import['trackId']) && $import['trackId'])) { // Do nothing return; } $tracker = $this->loader->getTracker(); $trackEngine = $tracker->getTrackEngine($import['trackId']); $trackEngine->updateRoundCount($this->currentUser->getUserLoginId()); }
/** * Set the password, if allowed for this user type. * * @param \Gems_User_User $user The user whose password to change * @param string $password * @return \Gems_User_UserDefinitionInterface (continuation pattern) */ public function setPassword(\Gems_User_User $user, $password) { $data['gup_id_user'] = $user->getUserLoginId(); $data['gup_reset_key'] = null; $data['gup_reset_requested'] = null; $data['gup_reset_required'] = 0; if (null === $password) { // Passwords may be emptied. $data['gup_password'] = null; } else { $data['gup_password'] = $this->hashPassword($password); } $data['gup_last_pwd_change'] = new \Zend_Db_Expr('CURRENT_TIMESTAMP'); $model = new \MUtil_Model_TableModel('gems__user_passwords'); \Gems_Model::setChangeFieldsByPrefix($model, 'gup', $user->getUserId()); $model->save($data); return $this; }