Prechádzať zdrojové kódy

Update Profile page

Visman 3 rokov pred
rodič
commit
b61b6bf7cc
1 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 4 2
      app/Models/Pages/Profile.php

+ 4 - 2
app/Models/Pages/Profile.php

@@ -77,6 +77,7 @@ abstract class Profile extends Page
     protected function btns(string $type): array
     {
         $btns = [];
+
         if (
             $this->user->isAdmin
             && ! $this->rules->editProfile
@@ -87,8 +88,9 @@ abstract class Profile extends Page
             ];
         }
         if ($this->rules->banUser) {
-            if (isset($this->c->bans->userList[\mb_strtolower($this->curUser->username)])) { //????
-                $id = $this->c->bans->userList[\mb_strtolower($this->curUser->username)];
+            $id = $this->c->bans->banFromName($this->curUser->username);
+
+            if ($id > 0) {
                 $btns['unban-user'] = [
                     $this->c->Router->link(
                         'AdminBansDelete',