-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathModels.php
112 lines (99 loc) · 3.21 KB
/
Models.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
namespace QueueIT\KnownUserV3\SDK;
require_once('QueueITHelpers.php');
class QueueEventConfig
{
public $eventId;
public $layoutName;
public $culture;
public $queueDomain;
public $extendCookieValidity;
public $cookieValidityMinute;
public $cookieDomain;
public $isCookieHttpOnly;
public $isCookieSecure;
public $version;
public $actionName;
function __construct() {
$this->version = -1;
$this->actionName = "unspecified";
}
public function getString() {
return "EventId:" . $this->eventId
. "&Version:" . $this->version
. "&ActionName:" . $this->actionName
. "&QueueDomain:" . $this->queueDomain
. "&CookieDomain:" . $this->cookieDomain
. "&IsCookieHttpOnly:" . Utils::boolToString($this->isCookieHttpOnly)
. "&IsCookieSecure:" . Utils::boolToString($this->isCookieSecure)
. "&ExtendCookieValidity:" . Utils::boolToString($this->extendCookieValidity)
. "&CookieValidityMinute:" . $this->cookieValidityMinute
. "&LayoutName:" . $this->layoutName
. "&Culture:" . $this->culture;
}
}
class CancelEventConfig
{
public $eventId;
public $queueDomain;
public $cookieDomain;
public $isCookieHttpOnly;
public $isCookieSecure;
public $version;
public $actionName;
function __construct() {
$this->version = -1;
$this->actionName = "unspecified";
}
public function getString() {
return "EventId:" . $this->eventId
. "&Version:" . $this->version
. "&QueueDomain:" . $this->queueDomain
. "&CookieDomain:" . $this->cookieDomain
. "&IsCookieHttpOnly:" . Utils::boolToString($this->isCookieHttpOnly)
. "&IsCookieSecure:" . Utils::boolToString($this->isCookieSecure)
. "&ActionName:" . $this->actionName;
}
}
class RequestValidationResult
{
public $eventId;
public $redirectUrl;
public $queueId;
public $actionType;
public $redirectType;
public $actionName;
public $isAjaxResult;
function __construct($actionType, $eventId, $queueId, $redirectUrl, $redirectType, $actionName) {
$this->actionType = $actionType;
$this->eventId = $eventId;
$this->queueId = $queueId;
$this->redirectUrl = $redirectUrl;
$this->redirectType = $redirectType;
$this->actionName = $actionName;
}
public function doRedirect() {
return !Utils::isNullOrEmptyString($this->redirectUrl);
}
public function getAjaxQueueRedirectHeaderKey() {
return "x-queueit-redirect";
}
public function getAjaxRedirectUrl() {
if (!Utils::isNullOrEmptyString($this->redirectUrl)) {
return rawurlencode($this->redirectUrl);
}
return "";
}
}
class KnownUserException extends \Exception
{
function __construct($message, $code = 0) {
parent::__construct($message, $code);
}
}
class ActionTypes
{
const QueueAction="Queue";
const CancelAction="Cancel";
const IgnoreAction="Ignore";
}