mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-11 20:09:28 +02:00
Fixed small issue in helper.php
This commit is contained in:
parent
841830fbde
commit
7522bdd4df
1 changed files with 3 additions and 3 deletions
|
@ -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.';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue