當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserClient::setActiveTime方法代碼示例

本文整理匯總了PHP中UserClient::setActiveTime方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserClient::setActiveTime方法的具體用法?PHP UserClient::setActiveTime怎麽用?PHP UserClient::setActiveTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserClient的用法示例。


在下文中一共展示了UserClient::setActiveTime方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: check

 public function check()
 {
     //busca o post
     $login = DataHandler::getValueByArrayIndex($_POST, "login");
     $password = DataHandler::getValueByArrayIndex($_POST, "password");
     //iniciando o retorno padrao em http client ajax
     $returnResult = new ReturnResultVO();
     //se não validar retornar erro
     if (!Validation::blank($password, 1) && !Validation::blank($login, 1)) {
         $returnResult->success = 0;
         $returnResult->message = "Envie Login e Senha";
     } else {
         //cadastra o usuario e os detalhes do mesmo
         $DAO = UserDetailDAO::getInstance();
         $ReturnDataVO = $DAO->checkLogin($login, $password);
         //print_r($ReturnDataVO);
         if ($ReturnDataVO->success && count($ReturnDataVO->result) > 0) {
             if ($ReturnDataVO->result[0]->user_type_id == Config::ADMIN_USER_TYPE_ID || $ReturnDataVO->result[0]->user_type_id == Config::DEVELOPER_USER_TYPE_ID) {
                 UserClient::setId($ReturnDataVO->result[0]->id);
                 UserClient::setTypeId($ReturnDataVO->result[0]->user_type_id);
                 UserClient::setActiveTime(time());
                 //setando sucesso true caso tenha dado certo
                 $returnResult->success = $ReturnDataVO->success;
                 $returnResult->message = "sucesso ao logar";
             } else {
                 //print_r($ReturnDataVO);
                 $returnResult->success = 0;
                 $returnResult->message = "Usuario sem permissão!";
             }
         } else {
             //print_r($ReturnDataVO);
             $returnResult->success = 0;
             $returnResult->message = "Erro ao Logar!";
         }
     }
     //Debug::print_r($returnResult); exit();
     if ($returnResult->success) {
         if ($this->to != "") {
             Navigation::redirect($this->to);
         } else {
             Navigation::redirect("backend");
         }
     } else {
         return $this->init($returnResult);
     }
 }
開發者ID:reytuty,項目名稱:facil,代碼行數:46,代碼來源:Login.php

示例2: check

 public function check()
 {
     //busca o post
     $login = DataHandler::getValueByArrayIndex($_POST, "login");
     $password = DataHandler::getValueByArrayIndex($_POST, "password");
     //iniciando o retorno padrao em http client ajax
     $returnResult = new ReturnResultVO();
     //se não validar retornar erro
     if (!Validation::blank($password, 1) && !Validation::blank($login, 1)) {
         $returnResult->success = 0;
         $returnResult->addMessage("Envie Login e Senha");
     } else {
         //cadastra o usuario e os detalhes do mesmo
         $DAO = UserDetailDAO::getInstance();
         $ReturnDataVO = $DAO->checkLogin($login, $password);
         if ($ReturnDataVO->success && count($ReturnDataVO->result) > 0) {
             UserClient::setId($ReturnDataVO->result[0]->id);
             UserClient::setTypeId($ReturnDataVO->result[0]->user_type_id);
             UserClient::setActiveTime(time());
             //setando sucesso true caso tenha dado certo
             $returnResult->success = $ReturnDataVO->success;
             $message_success = file_get_contents(Config::getAsset("templates/login_sucesso.txt"));
             $returnResult->addMessage($message_success);
         } else {
             //print_r($ReturnDataVO);
             $returnResult->success = 0;
             $returnResult->addMessage("Erro ao Logar!");
         }
     }
     if ($returnResult->success) {
         if ($this->to != "") {
             Navigation::redirect($this->to);
         }
     }
     echo $returnResult->toJson();
     exit;
 }
開發者ID:reytuty,項目名稱:facil,代碼行數:37,代碼來源:Login.php


注:本文中的UserClient::setActiveTime方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。