本文整理汇总了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);
}
}
示例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;
}