Test Failed
Push — master ( 875018...84d9fe )
by Fran
03:57
created
src/base/Security.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             session_start();
73 73
         }
74 74
         // Fix for phpunits
75
-        if(!isset($_SESSION)) {
75
+        if (!isset($_SESSION)) {
76 76
             $_SESSION = [];
77 77
         }
78 78
     }
@@ -132,12 +132,12 @@  discard block
 block discarded – undo
132 132
     {
133 133
         $saved = true;
134 134
         try {
135
-            $admins = Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json', Cache::JSONGZ, true) ?: [];
136
-            $admins[$user['username']]['hash'] = sha1($user['username'] . $user['password']);
135
+            $admins = Cache::getInstance()->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'admins.json', Cache::JSONGZ, true) ?: [];
136
+            $admins[$user['username']]['hash'] = sha1($user['username'].$user['password']);
137 137
             $admins[$user['username']]['profile'] = $user['profile'];
138 138
 
139
-            Cache::getInstance()->storeData(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json', $admins, Cache::JSONGZ, true);
140
-        } catch(\Exception $e) {
139
+            Cache::getInstance()->storeData(CONFIG_DIR.DIRECTORY_SEPARATOR.'admins.json', $admins, Cache::JSONGZ, true);
140
+        }catch (\Exception $e) {
141 141
             Logger::log($e->getMessage(), LOG_ERR);
142 142
             $saved = false;
143 143
         }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      */
175 175
     public function getAdmins()
176 176
     {
177
-        return Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json', Cache::JSONGZ, true);
177
+        return Cache::getInstance()->getDataFromFile(CONFIG_DIR.DIRECTORY_SEPARATOR.'admins.json', Cache::JSONGZ, true);
178 178
     }
179 179
 
180 180
     /**
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                 }
203 203
                 if (!empty($user) && !empty($admins[$user])) {
204 204
                     $auth = $admins[$user]['hash'];
205
-                    $this->authorized = ($auth == sha1($user . $pass));
205
+                    $this->authorized = ($auth == sha1($user.$pass));
206 206
                     if ($this->authorized) {
207 207
                         $this->admin = array(
208 208
                             'alias' => $user,
Please login to merge, or discard this patch.