title = "Invitation"; $this->description = "Finnish your account registration by choosing a password."; $this->icon = "user-check"; $this->success = false; $this->message = "No content"; $this->invitedUser = array(); } public function loadView() { parent::loadView(); if (isset($_GET["token"]) && is_string($_GET["token"]) && !empty($_GET["token"])) { $req = new \Api\User\CheckToken($this->getDocument()->getUser()); $this->success = $req->execute(array("token" => $_GET["token"])); if ($this->success) { if (strcmp($req->getResult()["token"]["type"], "invite") !== 0) { $this->success = false; $this->message = "The given token has a wrong type."; } else { $this->invitedUser = $req->getResult()["user"]; } } else { $this->message = "Error confirming e-mail address: " . $req->getLastError(); } } else { $this->success = false; $this->message = "The link you visited is no longer valid"; } } protected function getAccountContent() { if (!$this->success) { return $this->createErrorText($this->message); } $token = htmlspecialchars($_GET["token"], ENT_QUOTES); $username = $this->invitedUser["name"]; $emailAddress = $this->invitedUser["email"]; return "

Please fill with your details

"; } }