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.'); }
/** * geracao em massa de devolutiva via browser * * @param type $limit * @param type $enterpriseProgramaIdMaiorQue */ private function cligrava($limit, $enterpriseProgramaIdMaiorQue, $QUEM_FARA_PROCESSAMENTO) { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); echo "<small><br>EnterpriseCategoryAwardCompetitionMaiorQue: " . $enterpriseProgramaIdMaiorQue; echo "<br>"; $objUser = new DbTable_User(); //join com tb Execution $res = $objUser->getUserByLimitAndIdMaiorJoinExecution($enterpriseProgramaIdMaiorQue, $limit); //sem join com tb Execution //$res = $objUser->getUserByLimitAndIdMaior($enterpriseProgramaIdMaiorQue, $limit); //var_dump($res); echo "<br><br>"; foreach ($res as $campo) { //$userIdParaDevolutive = $campo['UserId']; $userId = $campo['UserId']; $enterpriseProgramaId = 2014; //$this->Questionnaire->tbQuestionnaire->getPontuacaoQuestao4BlocoResponsabilidadeSocial(46, $blockId=null, 65); //exit; echo "enterpriseProgramaId: " . $enterpriseProgramaId; echo " - UserId: " . $userId; echo " - "; //echo $campo['SocialName']; switch ($QUEM_FARA_PROCESSAMENTO) { //grava tabela ExecutionPontuacao case "Pontuacao_Em_Massa": $this->Devolutive->configuraGravaPontuacaoExecution($userId); //grava Pontuacao para bloco Gestao Empresa $this->Devolutive->processaPontuacaoBlocosDeUmQuestionario($userId); break; } echo "<br>"; } //echo "<br>"; //echo "Gerando devolutivas"; }