Show "Wrong password" info when the conversation password was wrong

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-07-19 13:02:56 +02:00
Родитель 4474986a29
Коммит 8ee67f13c1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7076EA9751AACDDA
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -179,7 +179,9 @@ class PageController extends Controller {
$this->talkSession->setPasswordForRoom($token, $token);
} else {
if ($passwordVerification['url'] === '') {
return new TemplateResponse($this->appName, 'authenticate', [], 'guest');
return new TemplateResponse($this->appName, 'authenticate', [
'wrongpw' => $password !== '',
], 'guest');
}
return new RedirectResponse($passwordVerification['url']);
@ -232,7 +234,9 @@ class PageController extends Controller {
$this->talkSession->setPasswordForRoom($token, $token);
} else {
if ($passwordVerification['url'] === '') {
return new TemplateResponse($this->appName, 'authenticate', [], 'guest');
return new TemplateResponse($this->appName, 'authenticate', [
'wrongpw' => $password !== '',
], 'guest');
}
return new RedirectResponse($passwordVerification['url']);

Просмотреть файл

@ -6,7 +6,7 @@
?>
<form method="post">
<fieldset class="warning">
<?php if (!isset($_['wrongpw'])){ ?>
<?php if (!$_['wrongpw']) { ?>
<div class="warning-info"><?php p($l->t('This conversation is password-protected')); ?></div>
<?php } else { ?>
<div class="warning"><?php p($l->t('The password is wrong. Try again.')); ?></div>
@ -18,7 +18,7 @@
placeholder="<?php p($l->t('Password')); ?>" value=""
autocomplete="off" autocapitalize="off" autocorrect="off"
autofocus />
<input type="submit" id="password-submit"
<input type="submit" id="password-submit"
class="svg icon-confirm input-button-inline" value="" disabled="disabled" />
</p>
</fieldset>