summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-07-19 13:02:56 +0200
committerJoas Schilling <coding@schilljs.com>2019-07-19 13:16:19 +0200
commit8ee67f13c11746e5287352bf6e46d88b307b4d31 (patch)
tree221f99050c496357d636487c36bb29807c1b86d2
parent4474986a299c31a182e5e2d97b19d72d5c6e4bde (diff)
Show "Wrong password" info when the conversation password was wrong
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/Controller/PageController.php8
-rw-r--r--templates/authenticate.php4
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 @@
?>
<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>