From 8ee67f13c11746e5287352bf6e46d88b307b4d31 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 19 Jul 2019 13:02:56 +0200 Subject: [PATCH] Show "Wrong password" info when the conversation password was wrong Signed-off-by: Joas Schilling --- lib/Controller/PageController.php | 8 ++++++-- templates/authenticate.php | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 29a7ab792..8ec6e6d05 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -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']); diff --git a/templates/authenticate.php b/templates/authenticate.php index ee9e04ed0..023e62685 100644 --- a/templates/authenticate.php +++ b/templates/authenticate.php @@ -6,7 +6,7 @@ ?>
- +
t('This conversation is password-protected')); ?>
t('The password is wrong. Try again.')); ?>
@@ -18,7 +18,7 @@ placeholder="t('Password')); ?>" value="" autocomplete="off" autocapitalize="off" autocorrect="off" autofocus /> -