当前位置: 首页>>代码示例>>PHP>>正文


PHP UserClient::setId方法代码示例

本文整理汇总了PHP中UserClient::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP UserClient::setId方法的具体用法?PHP UserClient::setId怎么用?PHP UserClient::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserClient的用法示例。


在下文中一共展示了UserClient::setId方法的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::setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。