Passed
Pull Request — master (#6)
by
unknown
07:22
created
src/Auth/Source/PasswordVerify.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -172,13 +172,13 @@  discard block
 block discarded – undo
172 172
                 || is_null($row[$this->passwordhashcolumn]))
173 173
             {
174 174
                 \SimpleSAML\Logger::error('sqlauth:'.$this->authId.
175
-                                          ': column ' . $this->passwordhashcolumn . ' must be in every result tuple.');
175
+                                            ': column ' . $this->passwordhashcolumn . ' must be in every result tuple.');
176 176
                 throw new \SimpleSAML\Error\Error('WRONGUSERPASS');
177 177
             }
178 178
             if( $pwhash ) {
179 179
                 if( $pwhash != $row[$this->passwordhashcolumn] ) {
180 180
                     \SimpleSAML\Logger::error('sqlauth:'.$this->authId.
181
-                                              ': column ' . $this->passwordhashcolumn . ' must be THE SAME in every result tuple.');
181
+                                                ': column ' . $this->passwordhashcolumn . ' must be THE SAME in every result tuple.');
182 182
                     throw new \SimpleSAML\Error\Error('WRONGUSERPASS');
183 183
                 }
184 184
             }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         if( is_null($pwhash)) {
192 192
             if( $pwhash != $row[$this->passwordhashcolumn] ) {
193 193
                 \SimpleSAML\Logger::error('sqlauth:'.$this->authId.
194
-                                          ': column ' . $this->passwordhashcolumn . ' does not contain a password hash.');
194
+                                            ': column ' . $this->passwordhashcolumn . ' does not contain a password hash.');
195 195
                 throw new \SimpleSAML\Error\Error('WRONGUSERPASS');
196 196
             }
197 197
         }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
         // Call the parent constructor first, as required by the interface
60 60
         parent::__construct($info, $config);
61 61
 
62
-        if( array_key_exists('passwordhashcolumn', $config )) {
62
+        if (array_key_exists('passwordhashcolumn', $config)) {
63 63
             $this->passwordhashcolumn = $config['passwordhashcolumn'];
64 64
         }
65
-        if( !$this->passwordhashcolumn ) {
65
+        if (!$this->passwordhashcolumn) {
66 66
             $this->passwordhashcolumn = 'passwordhash';
67 67
         }
68 68
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * @param array  $forbiddenAttributes An array of attributes to never return
76 76
      * @return array  Associative array with the users attributes.
77 77
      */
78
-    protected function extractAttributes( $data, $forbiddenAttributes = array() )
78
+    protected function extractAttributes($data, $forbiddenAttributes = array())
79 79
     {
80 80
         $attributes = [];
81 81
         foreach ($data as $row) {
@@ -172,13 +172,13 @@  discard block
 block discarded – undo
172 172
                 || is_null($row[$this->passwordhashcolumn]))
173 173
             {
174 174
                 \SimpleSAML\Logger::error('sqlauth:'.$this->authId.
175
-                                          ': column ' . $this->passwordhashcolumn . ' must be in every result tuple.');
175
+                                          ': column '.$this->passwordhashcolumn.' must be in every result tuple.');
176 176
                 throw new \SimpleSAML\Error\Error('WRONGUSERPASS');
177 177
             }
178
-            if( $pwhash ) {
179
-                if( $pwhash != $row[$this->passwordhashcolumn] ) {
178
+            if ($pwhash) {
179
+                if ($pwhash != $row[$this->passwordhashcolumn]) {
180 180
                     \SimpleSAML\Logger::error('sqlauth:'.$this->authId.
181
-                                              ': column ' . $this->passwordhashcolumn . ' must be THE SAME in every result tuple.');
181
+                                              ': column '.$this->passwordhashcolumn.' must be THE SAME in every result tuple.');
182 182
                     throw new \SimpleSAML\Error\Error('WRONGUSERPASS');
183 183
                 }
184 184
             }
@@ -188,10 +188,10 @@  discard block
 block discarded – undo
188 188
          * This should never happen as the count(data) test above would have already thrown.
189 189
          * But checking twice doesn't hurt.
190 190
          */
191
-        if( is_null($pwhash)) {
192
-            if( $pwhash != $row[$this->passwordhashcolumn] ) {
191
+        if (is_null($pwhash)) {
192
+            if ($pwhash != $row[$this->passwordhashcolumn]) {
193 193
                 \SimpleSAML\Logger::error('sqlauth:'.$this->authId.
194
-                                          ': column ' . $this->passwordhashcolumn . ' does not contain a password hash.');
194
+                                          ': column '.$this->passwordhashcolumn.' does not contain a password hash.');
195 195
                 throw new \SimpleSAML\Error\Error('WRONGUSERPASS');
196 196
             }
197 197
         }
@@ -200,13 +200,13 @@  discard block
 block discarded – undo
200 200
          * VERIFICATION!
201 201
          * Now to check if the password the user supplied is actually valid
202 202
          */
203
-        if( !password_verify( $password, $pwhash )) {
204
-            \SimpleSAML\Logger::error('sqlauth:'.$this->authId. ': password is incorrect.');
203
+        if (!password_verify($password, $pwhash)) {
204
+            \SimpleSAML\Logger::error('sqlauth:'.$this->authId.': password is incorrect.');
205 205
             throw new \SimpleSAML\Error\Error('WRONGUSERPASS');
206 206
         }
207 207
 
208 208
         
209
-        $attributes = $this->extractAttributes( $data, array($this->passwordhashcolumn) );
209
+        $attributes = $this->extractAttributes($data, array($this->passwordhashcolumn));
210 210
 
211 211
         \SimpleSAML\Logger::info('sqlauth:'.$this->authId.': Attributes: '.
212 212
             implode(',', array_keys($attributes)));
Please login to merge, or discard this patch.