Změna hesla + složitost na 8 znaků

master
Kowalski 2026-10-31 11:37:23 +01:00
parent eec6b692b2
commit 6192b1e012
3 changed files with 9 additions and 9 deletions

View File

@ -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(

View File

@ -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()

View File

@ -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')