Completed
Pull Request — master (#4135)
by Craig
07:52 queued 02:19
created
src/system/ZAuthModule/Api/PasswordApi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -179,8 +179,8 @@
 block discarded – undo
179 179
         if (1 === mb_strlen($saltDelimiter) && false !== mb_strpos($saltedHash, $saltDelimiter)) {
180 180
             [$hashMethod, $saltStr, $correctHash] = explode($saltDelimiter, $saltedHash);
181 181
 
182
-            if (is_numeric($hashMethod) && ((int)$hashMethod === $hashMethod)) {
183
-                $hashMethod = (int)$hashMethod;
182
+            if (is_numeric($hashMethod) && ((int) $hashMethod === $hashMethod)) {
183
+                $hashMethod = (int) $hashMethod;
184 184
             }
185 185
             $hashMethodName = $hashMethodCodeToName[$hashMethod] ?? $hashMethod;
186 186
 
Please login to merge, or discard this patch.
src/system/ZAuthModule/Controller/AccountController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -307,7 +307,7 @@
 block discarded – undo
307 307
             $data = $form->getData();
308 308
             $code = bin2hex(random_bytes(8));
309 309
             $hashedCode = $encoderFactory->getEncoder(AuthenticationMappingEntity::class)->encodePassword($code, null);
310
-            $currentUserId = (int)$currentUserApi->get('uid');
310
+            $currentUserId = (int) $currentUserApi->get('uid');
311 311
             $userVerificationRepository->setVerificationCode($currentUserId, ZAuthConstant::VERIFYCHGTYPE_EMAIL, $hashedCode, $data['email']);
312 312
             $templateArgs = [
313 313
                 'uname'    => $currentUserApi->get('uname'),
Please login to merge, or discard this patch.
Validator/Constraints/AuthenticateAdminLoginValidator.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,8 @@  discard block
 block discarded – undo
77 77
 
78 78
         $passwordEncoder = $this->encoderFactory->getEncoder(AuthenticationMappingEntity::class);
79 79
 
80
-        if (empty($user) || $user['uid'] <= 1) { // || !$passwordEncoder->isPasswordValid($user['pass'], $object['password'], null)) {
80
+        if (empty($user) || $user['uid'] <= 1) {
81
+// || !$passwordEncoder->isPasswordValid($user['pass'], $object['password'], null)) {
81 82
             $this->context
82 83
                 ->buildViolation($this->trans('Error! Could not login because the user could not be found. Please try again.'))
83 84
                 ->addViolation();
@@ -92,7 +93,8 @@  discard block
 block discarded – undo
92 93
                 // new way
93 94
                 $passwordEncoder->isPasswordValid($user['pass'], $object['password'], NULL)) {
94 95
                 $validPassword = true;
95
-                if ($passwordEncoder->needsRehash($user['pass'])) { // check to update hash to newer algo
96
+                if ($passwordEncoder->needsRehash($user['pass'])) {
97
+// check to update hash to newer algo
96 98
                     $this->setPassword((int) $user['uid'], $object['password']);
97 99
                 }
98 100
             }
Please login to merge, or discard this patch.
ZAuthModule/AuthenticationMethod/AbstractNativeAuthenticationMethod.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,8 @@
 block discarded – undo
111 111
             return $mapping->getUid();
112 112
         } elseif ($mapping && $passwordEncoder->isPasswordValid($mapping->getPass(), $data['pass'], null)) {
113 113
             // new way
114
-            if ($passwordEncoder->needsRehash($mapping->getPass())) { // check to update hash to newer algo
114
+            if ($passwordEncoder->needsRehash($mapping->getPass())) {
115
+// check to update hash to newer algo
115 116
                 $this->updatePassword($mapping, $data['pass']);
116 117
             }
117 118
 
Please login to merge, or discard this patch.