Změna hesla + složitost na 8 znaků
parent
eec6b692b2
commit
6192b1e012
|
|
@ -244,8 +244,8 @@ class DatabazeFacade
|
||||||
if (!Validators::isEmail($email)) {
|
if (!Validators::isEmail($email)) {
|
||||||
throw new \InvalidArgumentException('Zadejte platný e-mail uživatele.');
|
throw new \InvalidArgumentException('Zadejte platný e-mail uživatele.');
|
||||||
}
|
}
|
||||||
if (mb_strlen($password) < 6) {
|
if (mb_strlen($password) < 8) {
|
||||||
throw new \InvalidArgumentException('Heslo musí mít alespoň 6 znaků.');
|
throw new \InvalidArgumentException('Heslo musí mít alespoň 8 znaků.');
|
||||||
}
|
}
|
||||||
if ($this->emailExists($email)) {
|
if ($this->emailExists($email)) {
|
||||||
throw new \InvalidArgumentException('Uživatel s tímto e-mailem už existuje.');
|
throw new \InvalidArgumentException('Uživatel s tímto e-mailem už existuje.');
|
||||||
|
|
@ -288,8 +288,8 @@ class DatabazeFacade
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($password !== null && $password !== '') {
|
if ($password !== null && $password !== '') {
|
||||||
if (mb_strlen($password) < 6) {
|
if (mb_strlen($password) < 8) {
|
||||||
throw new \InvalidArgumentException('Heslo musí mít alespoň 6 znaků.');
|
throw new \InvalidArgumentException('Heslo musí mít alespoň 8 znaků.');
|
||||||
}
|
}
|
||||||
$this->masterDb->query(
|
$this->masterDb->query(
|
||||||
'UPDATE dbo.LOGIN SET EMAIL = ?, HESLO_HASH = ? WHERE ID = ?',
|
'UPDATE dbo.LOGIN SET EMAIL = ?, HESLO_HASH = ? WHERE ID = ?',
|
||||||
|
|
@ -330,8 +330,8 @@ class DatabazeFacade
|
||||||
if ($hash === '' || !$this->passwords->verify($currentPassword, $hash)) {
|
if ($hash === '' || !$this->passwords->verify($currentPassword, $hash)) {
|
||||||
throw new \InvalidArgumentException('Původní heslo není správné.');
|
throw new \InvalidArgumentException('Původní heslo není správné.');
|
||||||
}
|
}
|
||||||
if (mb_strlen($newPassword) < 6) {
|
if (mb_strlen($newPassword) < 8) {
|
||||||
throw new \InvalidArgumentException('Heslo musí mít alespoň 6 znaků.');
|
throw new \InvalidArgumentException('Heslo musí mít alespoň 8 znaků.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->masterDb->query(
|
$this->masterDb->query(
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ class AdminPresenter extends BasePresenter
|
||||||
|
|
||||||
$form->addPassword('password', 'Heslo:')
|
$form->addPassword('password', 'Heslo:')
|
||||||
->setRequired('Zadejte 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:')
|
$form->addPassword('passwordVerify', 'Heslo znovu:')
|
||||||
->setRequired('Zadejte heslo znovu.')
|
->setRequired('Zadejte heslo znovu.')
|
||||||
|
|
@ -200,7 +200,7 @@ class AdminPresenter extends BasePresenter
|
||||||
$form->addPassword('password', 'Nové heslo:')
|
$form->addPassword('password', 'Nové heslo:')
|
||||||
->setNullable()
|
->setNullable()
|
||||||
->addCondition($form::Filled)
|
->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:')
|
$form->addPassword('passwordVerify', 'Heslo znovu:')
|
||||||
->setNullable()
|
->setNullable()
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ class NastaveniPresenter extends BasePresenter
|
||||||
$form->addPassword('password', 'Nové heslo:')
|
$form->addPassword('password', 'Nové heslo:')
|
||||||
->setHtmlAttribute('autocomplete', 'new-password')
|
->setHtmlAttribute('autocomplete', 'new-password')
|
||||||
->setRequired('Zadejte nové heslo.')
|
->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:')
|
$form->addPassword('passwordVerify', 'Nové heslo znovu:')
|
||||||
->setHtmlAttribute('autocomplete', 'new-password')
|
->setHtmlAttribute('autocomplete', 'new-password')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue