From 2a84e9c1207fd3d792b7fb198fd0c66fe1a66a7a Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sat, 28 Jan 2023 11:40:07 +0100 Subject: [PATCH] enforce password requirements set in settings for directory-protection Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/DirProtections.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Froxlor/Api/Commands/DirProtections.php b/lib/Froxlor/Api/Commands/DirProtections.php index 8b478103a2..690adf8b9d 100644 --- a/lib/Froxlor/Api/Commands/DirProtections.php +++ b/lib/Froxlor/Api/Commands/DirProtections.php @@ -87,7 +87,8 @@ public function add() $path = FileDir::makeCorrectDir($customer['documentroot'] . '/' . $path); $username = Validate::validate($username, 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/', '', [], true); $authname = Validate::validate($authname, 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/', '', [], true); - Validate::validate($password, 'password', '', '', [], true); + $password = Validate::validate($password, 'password', '', '', [], true); + $password = Crypt::validatePassword($password, true); // check for duplicate usernames for the path $username_path_check_stmt = Database::prepare(" @@ -244,7 +245,8 @@ public function update() // validation $authname = Validate::validate($authname, 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/', '', [], true); - Validate::validate($password, 'password', '', '', [], true); + $password = Validate::validate($password, 'password', '', '', [], true); + $password = Crypt::validatePassword($password, true); $upd_query = ""; $upd_params = [