本文整理汇总了PHP中UserData::SaveToCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP UserData::SaveToCookie方法的具体用法?PHP UserData::SaveToCookie怎么用?PHP UserData::SaveToCookie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserData
的用法示例。
在下文中一共展示了UserData::SaveToCookie方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SaveTicket
function SaveTicket($_group, $_country, $_cmb = false, $_custom = true, $_url = "", $changed = false)
{
$isSpam = !empty(Server::$Configuration->File["gl_sft"]) && Visitor::CreateSPAMFilter($this->UserId);
$ticket = new Ticket(CacheManager::GetObjectId("ticket_id", DATABASE_TICKETS), strtoupper(!empty($this->Language) ? $this->Language : Server::$Configuration->File["gl_default_language"]));
$ticket->Messages[0]->Id = $ticket->Id;
$ticket->Messages[0]->IP = Communication::GetIP();
$group = Server::$Groups[$_group];
if (!isTicketFlood() && !$isSpam) {
Server::InitDataBlock(array("INPUTS"));
$ticket->SenderUserId = $ticket->Messages[0]->SenderUserId = $this->UserId;
$ticket->Group = $_group;
$ticket->Messages[0]->Fullname = $this->Browsers[0]->Fullname = $group->GetServerInput(Server::$Inputs[111], false, "", $changed);
$ticket->Messages[0]->Email = $this->Browsers[0]->Email = $group->GetServerInput(Server::$Inputs[112], false, "", $changed);
$ticket->Messages[0]->Company = $this->Browsers[0]->Company = $group->GetServerInput(Server::$Inputs[113], false, "", $changed);
$ticket->Messages[0]->Phone = $this->Browsers[0]->Phone = $group->GetServerInput(Server::$Inputs[116], false, "", $changed);
$ticket->Messages[0]->Text = $group->GetServerInput(Server::$Inputs[114], false, "", $changed);
$ticket->Messages[0]->CallMeBack = $_cmb;
$ticket->Messages[0]->Country = $_country;
$ticket->Messages[0]->EmailId = getId(32);
$ticket->Messages[0]->ChannelId = getId(32);
$ticket->Messages[0]->Edited = $ticket->Messages[0]->Created = time();
if (empty($_url)) {
$_url = Visitor::GetLastURLFromVisitor($this->UserId);
}
$ticket->Messages[0]->Subject = $_url;
$this->Browsers[0]->DesiredChatGroup = $ticket->Group;
$this->Browsers[0]->SetCookieGroup();
if ($_custom) {
foreach (Server::$Inputs as $index => $input) {
if ($input->Active && $input->Custom) {
$value = $group->GetServerInput($input, false, "", $changed);
if ($input->Type != "File" && !empty($value) && !in_array($index, $group->TicketInputsHidden)) {
$ticket->Messages[0]->Customs[$index] = $this->Browsers[0]->Customs[$index] = $value;
} else {
if ($input->Type == "File" && isset($_FILES["p_cf" . $index]) && !in_array($index, $group->TicketInputsHidden)) {
$ticket->Messages[0]->Customs[$index] = $this->Browsers[0]->Customs[$index] = $ticket->Messages[0]->AppendPostFile("p_cf" . $index, $this->UserId);
}
}
}
$ud = new UserData($ticket->Messages[0]->Fullname, $ticket->Messages[0]->Email, $ticket->Messages[0]->Company, $ticket->Messages[0]->Phone, $ticket->Messages[0]->Customs);
$ud->Save();
$ud->SaveToCookie();
}
}
if (Server::$Configuration->File["gl_adct"] == 1 || !(!empty(Server::$Configuration->File["gl_rm_om"]) && Server::$Configuration->File["gl_rm_om_time"] == 0)) {
$ticket->Save();
$ticket->AutoAssignEditor();
$ticket->SetLastUpdate(time());
}
$this->AddFunctionCall("lz_chat_mail_callback(true);", false);
if (!empty($_POST[POST_EXTERN_REQUESTED_INTERNID]) && !empty(Server::$Operators[Operator::GetSystemId(Encoding::Base64UrlDecode($_POST[POST_EXTERN_REQUESTED_INTERNID]))])) {
$TicketEditor = new TicketEditor($ticket->Id);
$TicketEditor->Editor = Operator::GetSystemId(Encoding::Base64UrlDecode($_POST[POST_EXTERN_REQUESTED_INTERNID]));
$TicketEditor->Status = 0;
$TicketEditor->GroupId = $ticket->Group;
$TicketEditor->Save();
}
if (!empty(Server::$Configuration->File["gl_mpm"])) {
foreach (Server::$Operators as $operator) {
if ($operator->IsInPushMessageState()) {
if ($operator->HasAccessToTicket($ticket)) {
$operator->AddPushMessage($ticket->Id, $this->SystemId, $ticket->Messages[0]->Fullname, 2, $ticket->Messages[0]->Text);
}
}
}
}
return $ticket;
} else {
$this->AddFunctionCall("lz_chat_mail_callback(false);", false);
}
return false;
}