Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
enforce password requirements set in settings for directory-protection
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
  • Loading branch information
d00p committed Jan 28, 2023
1 parent d854e8e commit 2a84e9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Froxlor/Api/Commands/DirProtections.php
Expand Up @@ -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("
Expand Down Expand Up @@ -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 = [
Expand Down

0 comments on commit 2a84e9c

Please sign in to comment.