Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jordiSTIC committed Oct 28, 2024
1 parent 01d1a9f commit 49c3ac3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/Users/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,7 @@ public static function generatePassword()

// Get password requirements
$length = 6;
if (isset($res['minpwdlength']) && is_numeric($res['minpwdlength']) && $res['minpwdlength'] < $length) {
if (isset($res['minpwdlength']) && is_numeric($res['minpwdlength']) && $res['minpwdlength'] > $length) {
$length = $res['minpwdlength'];
}

Expand All @@ -2462,7 +2462,7 @@ public static function generatePassword()
$password .= implode('', $requirements);

// Create other random characters
for ($i = 0; $i < $length - count($requirements) + 1; $i++) { // loop and create password
for ($i = 0; $i < $length - count($requirements); $i++) { // loop and create password
$password .= $charBKT[mt_rand(0, strlen($charBKT) - 1)];
}

Expand Down

0 comments on commit 49c3ac3

Please sign in to comment.