Skip to content

Commit d75a99e

Browse files
committed
refactoring
1 parent 011dc47 commit d75a99e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lam/lib/account.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,12 @@ function pwd_is_enabled($hash) {
369369
* @return String password
370370
*/
371371
function generateRandomPassword($length = 14, bool $checkStrength = true): string {
372-
$minLength = $_SESSION['cfgMain']->passwordMinLength;
372+
$cfg = $_SESSION['cfgMain'] ?? new LAMCfgMain();
373+
$minLength = $cfg->passwordMinLength;
373374
$length = max($length, $minLength);
374375
if (isset($_SESSION['config']) && is_numeric($_SESSION['config']->getPwdPolicyMinLength())) {
375376
$length = max($length, $_SESSION['config']->getPwdPolicyMinLength());
376377
}
377-
$cfg = $_SESSION['cfgMain'] ?? new LAMCfgMain();
378378
$listAll = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_';
379379
$allLength = strlen($listAll);
380380
$listLower = 'abcdefghijklmnopqrstuvwxyz';

0 commit comments

Comments
 (0)