include PasswordStrength with namespace, fix calc of strength

This commit is contained in:
Uwe Steinmann 2026-03-13 11:32:32 +01:00
parent ef48025001
commit 966bda05ae

View File

@ -27,9 +27,11 @@ include("../inc/inc.Extension.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
include("../inc/inc.ClassPasswordStrength.php");
//include("../inc/inc.ClassPasswordStrength.php");
include("../inc/inc.ClassPasswordHistoryManager.php");
use Seeddms\Seeddms\PasswordStrength;
if ($user->isGuest()) {
UI::exitError(getMLText("edit_user_details"),getMLText("access_denied"));
}
@ -59,9 +61,12 @@ if(!seed_pass_verify($current_pwd, $user->getPwd())) {
if (isset($_POST["pwd"]) && ($_POST["pwd"] != "")) {
if($settings->_passwordStrength) {
$ps = new Password_Strength();
$ps = new PasswordStrength();
$ps->set_password($_POST["pwd"]);
$ps->calculate();
if($settings->_passwordStrengthAlgorithm == 'simple')
$ps->simple_calculate();
else
$ps->calculate();
$score = $ps->get_score();
if($score > $settings->_passwordStrength) {
if($settings->_passwordHistory > 0) {