Passed
Push — Security_and_bug_fixes ( cc57a2...cb92f3 )
by Stone
02:57
created
App/Controllers/Admin/Home.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     private function checkOriginalAdmin(): bool
45 45
     {
46
-        $userId = (int)$this->user->userId;
46
+        $userId = (int) $this->user->userId;
47 47
         //The admin selector should be disables and not sent so forcing default role
48 48
         $userLockedOut = $this->user->userLockedOut ?? 0;
49 49
         $userRoleSelector = $this->user->userRoleSelector ?? 2;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         }
61 61
 
62 62
         //forcing the default values
63
-        if($userId === 1){
63
+        if ($userId === 1) {
64 64
             $this->user->userRoleSelector = 2;
65 65
             $this->user->userLockedOut = 0;
66 66
         }
@@ -173,14 +173,14 @@  discard block
 block discarded – undo
173 173
         $this->onlyUser();
174 174
         $this->onlyPost();
175 175
 
176
-        $this->user = (object)$this->request->getDataFull();
176
+        $this->user = (object) $this->request->getDataFull();
177 177
         $redirectUrl = "/admin";
178 178
 
179 179
         if ($this->user->userId !== $this->session->get("userId") || isset($this->user->userRoleSelector) || isset($this->user->locked_out)) {
180 180
             //an admin is trying to update a user or form tampered with
181 181
             $this->onlyAdmin();
182
-            $redirectUrl = "/admin/home/view-user/" . $this->user->userId;
183
-        } else {
182
+            $redirectUrl = "/admin/home/view-user/".$this->user->userId;
183
+        }else {
184 184
             //set the role to the original state for update
185 185
             $beforeUser = $this->userModel->getUserDetailsById($this->user->userId);
186 186
             $this->user->userRoleSelector = $beforeUser->roles_idroles;
Please login to merge, or discard this patch.