diff --git a/core/Api/Stats.class.php b/core/Api/Stats.class.php index 79b868d..052dcc1 100644 --- a/core/Api/Stats.class.php +++ b/core/Api/Stats.class.php @@ -2,7 +2,6 @@ namespace Api; -use Driver\SQL\Condition\Compare; use Driver\SQL\Condition\CondBool; class Stats extends Request { diff --git a/core/Api/UserAPI.class.php b/core/Api/UserAPI.class.php index 22bc3ec..00721da 100644 --- a/core/Api/UserAPI.class.php +++ b/core/Api/UserAPI.class.php @@ -544,17 +544,21 @@ namespace Api\User { $this->success = $req->execute(array("token" => $token)); $this->lastError = $req->getLastError(); - $result = $req->getResult(); - if (strcasecmp($result["token"]["type"], "invite") !== 0) { - return $this->createError("Invalid token type"); - } else if($result["user"]["confirmed"]) { - return $this->createError("Your email address is already confirmed."); - } else if (!$this->updateUser($result["user"]["uid"])) { - return false; - } else { - $this->invalidateToken($token); - return true; + if ($this->success) { + $result = $req->getResult(); + if (strcasecmp($result["token"]["type"], "email_confirm") !== 0) { + return $this->createError("Invalid token type"); + } else if($result["user"]["confirmed"]) { + return $this->createError("Your email address is already confirmed."); + } else if (!$this->updateUser($result["user"]["uid"])) { + return false; + } else { + $this->invalidateToken($token); + return true; + } } + + return $this->success; } } diff --git a/core/Views/Account/AccountView.class.php b/core/Views/Account/AccountView.class.php index 01d0263..b692b28 100644 --- a/core/Views/Account/AccountView.class.php +++ b/core/Views/Account/AccountView.class.php @@ -8,17 +8,19 @@ use Elements\View; abstract class AccountView extends View { protected string $description; + protected string $icon; public function __construct(Document $document, $loadView = true) { parent::__construct($document, $loadView); $this->description = ""; + $this->icon = "image"; } public function getCode() { $html = parent::getCode(); $content = $this->getAccountContent(); - $icon = $this->createIcon("user-plus", "fas", "fa-3x"); + $icon = $this->createIcon($this->icon, "fas", "fa-3x"); $html .= "