public function getUserRow() { if (!$this->getUser()) { $this->setUser(DbTable_User::getInstance()->getUserById($this->getUserId())); } return $this->getUser(); }
/** * Authenticate * * Authenticate the username and password * * @return Zend_Auth_Result */ public function authenticate() { $codeError = Zend_Auth_Result::FAILURE; $userRow = DbTable_User::getInstance()->fetchRow(array('Login = ?' => $this->getUsername())); if (!$userRow) { return new Zend_Auth_Result($codeError, null, array('Authentication error')); } $hashedPassword = Vtx_Util_String::hashMe($this->getPassword(), $userRow->getSalt()); if ($hashedPassword['sha'] != $userRow->getKeypass()) { return new Zend_Auth_Result($codeError, null, array('Authentication error')); } return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $userRow, array()); }
public function getArrayVerificacao($login = null) { //$nacional = 2; if ($login == null) { $userId = $this->userAuth->getUserId(); } else { $userRow = DbTable_User::getInstance()->fetchRow(array('Login = ?' => $login)); if ($userRow == null) { return; } $userId = $userRow->Id; } $this->evaluationRow = $this->Appraiser->isCheckerPermit($this->enterpriseRow->getId(), $userId, $this->programId, $this->nacional); //var_dump($this->evaluationRow);die; $commentQuestions = $this->Appraiser->getQuestions(); $evaluationQuestions = DbTable_QuestionChecker::getInstance()->fetchAll('QuestionTypeId = 7', 'Designation'); //$this->evaluationRow->getAnswers() $V = array('questoes' => $commentQuestions, 'questionsAvaliacao' => $evaluationQuestions, 'respostas' => $this->Appraiser->getEnterpriseScoreAppraiserAnwserVerificadorData($this->enterpriseRow->getId(), $this->userAuth->getUserId()), 'commentAnswers' => $this->Appraiser->getApeEvaluationVerificadorComment($this->enterpriseRow->getId(), $this->userAuth->getUserId()), 'conclusao' => $this->evaluationRow->getConclusao()); return $V; }
public function getPasswordHintByCpf($data) { //$modelCpf = new Vtx_Validate_Cpf(); //$login = preg_replace('/[^0-9]/', '', $data['cpf']); $login = $data['cpf']; $userRow = DbTable_User::getInstance()->fetchRow(array('Login = ?' => $login)); if ($userRow) { return array('status' => true, 'messageSuccess' => $userRow->getPasswordHint()); } return array('status' => false, 'messageError' => 'Usuário não existente.'); }