Fixed small issue in helper.php

This commit is contained in:
Pinga 2025-02-01 10:54:50 +02:00
parent 841830fbde
commit 7522bdd4df

View file

@ -5,7 +5,7 @@
* Written and maintained by: * Written and maintained by:
* - Taras Kondratyuk (2023-2025) * - Taras Kondratyuk (2023-2025)
* *
* This file also incorporates functions: * This file also incorporates functions by:
* - Hezekiah O. <support@hezecom.com> * - Hezekiah O. <support@hezecom.com>
* *
* @package Namingo Panel * @package Namingo Panel
@ -624,7 +624,7 @@ function checkPasswordComplexity($password) {
$zxcvbn = new Zxcvbn(); $zxcvbn = new Zxcvbn();
// Use configured or default password strength requirement // Use configured or default password strength requirement
$requiredScore = getenv('PASSWORD_STRENGTH') ?: 3; // Default to score 3 if ENV is not set $requiredScore = envi('PASSWORD_STRENGTH') ?: 3; // Default to score 3 if ENV is not set
$score = $zxcvbn->passwordStrength($password)['score']; $score = $zxcvbn->passwordStrength($password)['score'];
@ -635,7 +635,7 @@ function checkPasswordComplexity($password) {
function checkPasswordRenewal($lastPasswordUpdateTimestamp) { function checkPasswordRenewal($lastPasswordUpdateTimestamp) {
// Use configured or default password expiration days // Use configured or default password expiration days
$passwordExpiryDays = getenv('PASSWORD_EXPIRATION_DAYS') ?: 90; // Default to 90 days $passwordExpiryDays = envi('PASSWORD_EXPIRATION_DAYS') ?: 90; // Default to 90 days
if (time() - $lastPasswordUpdateTimestamp > $passwordExpiryDays * 86400) { if (time() - $lastPasswordUpdateTimestamp > $passwordExpiryDays * 86400) {
return 'Your password is expired. Please change it.'; return 'Your password is expired. Please change it.';