Lines Matching refs:this

52         $this->csrf = $csrf;
53 $this->driver = $driver;
54 $this->payload = json_decode($payload);
60 if ($this->csrf !== getSecurityToken()) {
61 $error = $this->error("Invalid CSRF token {$this->csrf}");
71 if (!$this->checkCSRF($error)) {
75 if (!$this->validate($error)) {
79 $this->driver->open($this->payload->pageId);
81 switch ($this->payload->action) {
83 if ($this->payload->entity === self::ENTITY_TASK) {
84 $task = $this->driver->addTask(new Task($this->payload->data));
86 } elseif ($this->payload->entity === self::ENTITY_LINK) {
87 $link = $this->driver->addLink(new Link($this->payload->data));
93 if ($this->payload->entity === self::ENTITY_TASK) {
94 $this->driver->deleteTask($this->payload->id);
96 } elseif ($this->payload->entity === self::ENTITY_LINK) {
97 $this->driver->deleteLink($this->payload->id);
103 if ($this->payload->entity === self::ENTITY_TASK) {
104 $this->driver->updateTask(new Task($this->payload->data));
106 } elseif ($this->payload->entity === self::ENTITY_LINK) {
107 $this->driver->updateLink(new Link($this->payload->data));
113 $responseData = $this->error('Unknown action');
123 if (!$this->payload) {
124 $error = $this->error('no payload');
128 …if (empty($this->payload->action) || !in_array($this->payload->action, [self::ACTION_UPDATE, self:…
129 $error = $this->error('this action is not supported');
133 …if (empty($this->payload->action) || !in_array($this->payload->action, [self::ACTION_UPDATE, self:…
134 $error = $this->error('this action is not supported');
138 if (empty($this->payload->pageId) || !page_exists($this->payload->pageId)) {
139 $error = $this->error('invalid pageId');
143 if (!(auth_quickaclcheck(cleanID($this->payload->pageId)) & self::PERMISSIONS)) {
144 $error = $this->error('you don\'t have permissions');