diff --git a/app/Model/Facade/DatabazeFacade.php b/app/Model/Facade/DatabazeFacade.php index a537783..2e95868 100644 --- a/app/Model/Facade/DatabazeFacade.php +++ b/app/Model/Facade/DatabazeFacade.php @@ -244,8 +244,8 @@ class DatabazeFacade if (!Validators::isEmail($email)) { throw new \InvalidArgumentException('Zadejte platný e-mail uživatele.'); } - if (mb_strlen($password) < 6) { - throw new \InvalidArgumentException('Heslo musí mít alespoň 6 znaků.'); + if (mb_strlen($password) < 8) { + throw new \InvalidArgumentException('Heslo musí mít alespoň 8 znaků.'); } if ($this->emailExists($email)) { throw new \InvalidArgumentException('Uživatel s tímto e-mailem už existuje.'); @@ -288,8 +288,8 @@ class DatabazeFacade } if ($password !== null && $password !== '') { - if (mb_strlen($password) < 6) { - throw new \InvalidArgumentException('Heslo musí mít alespoň 6 znaků.'); + if (mb_strlen($password) < 8) { + throw new \InvalidArgumentException('Heslo musí mít alespoň 8 znaků.'); } $this->masterDb->query( 'UPDATE dbo.LOGIN SET EMAIL = ?, HESLO_HASH = ? WHERE ID = ?', @@ -330,8 +330,8 @@ class DatabazeFacade if ($hash === '' || !$this->passwords->verify($currentPassword, $hash)) { throw new \InvalidArgumentException('Původní heslo není správné.'); } - if (mb_strlen($newPassword) < 6) { - throw new \InvalidArgumentException('Heslo musí mít alespoň 6 znaků.'); + if (mb_strlen($newPassword) < 8) { + throw new \InvalidArgumentException('Heslo musí mít alespoň 8 znaků.'); } $this->masterDb->query( diff --git a/app/UI/Admin/AdminPresenter.php b/app/UI/Admin/AdminPresenter.php index 7b401ce..dccc7fd 100644 --- a/app/UI/Admin/AdminPresenter.php +++ b/app/UI/Admin/AdminPresenter.php @@ -152,7 +152,7 @@ class AdminPresenter extends BasePresenter $form->addPassword('password', 'Heslo:') ->setRequired('Zadejte heslo.') - ->addRule($form::MinLength, 'Heslo musí mít alespoň 6 znaků.', 6); + ->addRule($form::MinLength, 'Heslo musí mít alespoň 8 znaků.', 8); $form->addPassword('passwordVerify', 'Heslo znovu:') ->setRequired('Zadejte heslo znovu.') @@ -200,7 +200,7 @@ class AdminPresenter extends BasePresenter $form->addPassword('password', 'Nové heslo:') ->setNullable() ->addCondition($form::Filled) - ->addRule($form::MinLength, 'Heslo musí mít alespoň 6 znaků.', 6); + ->addRule($form::MinLength, 'Heslo musí mít alespoň 8 znaků.', 8); $form->addPassword('passwordVerify', 'Heslo znovu:') ->setNullable() diff --git a/app/UI/Nastaveni/NastaveniPresenter.php b/app/UI/Nastaveni/NastaveniPresenter.php index e3ec660..6deff5e 100644 --- a/app/UI/Nastaveni/NastaveniPresenter.php +++ b/app/UI/Nastaveni/NastaveniPresenter.php @@ -139,7 +139,7 @@ class NastaveniPresenter extends BasePresenter $form->addPassword('password', 'Nové heslo:') ->setHtmlAttribute('autocomplete', 'new-password') ->setRequired('Zadejte nové heslo.') - ->addRule(Form::MinLength, 'Heslo musí mít alespoň 6 znaků.', 6); + ->addRule(Form::MinLength, 'Heslo musí mít alespoň 8 znaků.', 8); $form->addPassword('passwordVerify', 'Nové heslo znovu:') ->setHtmlAttribute('autocomplete', 'new-password')