Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-06-28 00:00:23 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2019-08-28 10:19:28 +0300
commitee0e77f48f533f8ab9f0faa8eb181dd45124e3f5 (patch)
tree9e7d67cd545ff4e7b6ea4fa48d9c27da2f0b24d5 /lib/Controller/PageController.php
parent52ef654e084b2e355867e2332a850e8118a2cb59 (diff)
Get password from session if not given when joining room
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller/PageController.php')
-rw-r--r--lib/Controller/PageController.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
index 8ec6e6d05..8f65a6932 100644
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -160,8 +160,6 @@ class PageController extends Controller {
$token = '';
}
- $this->talkSession->removePasswordForRoom($token);
-
if ($room instanceof Room && $room->hasPassword()) {
// If the user joined themselves or is not found, they need the password.
try {
@@ -172,12 +170,14 @@ class PageController extends Controller {
}
if ($requirePassword) {
+ $password = $password !== '' ? $password : (string) $this->talkSession->getPasswordForRoom($token);
$passwordVerification = $room->verifyPassword($password);
if ($passwordVerification['result']) {
- $this->talkSession->setPasswordForRoom($token, $token);
+ $this->talkSession->setPasswordForRoom($token, $password);
} else {
+ $this->talkSession->removePasswordForRoom($token);
if ($passwordVerification['url'] === '') {
return new TemplateResponse($this->appName, 'authenticate', [
'wrongpw' => $password !== '',
@@ -226,13 +226,14 @@ class PageController extends Controller {
]));
}
- $this->talkSession->removePasswordForRoom($token);
if ($room->hasPassword()) {
- $passwordVerification = $room->verifyPassword($password);
+ $password = $password !== '' ? $password : (string) $this->talkSession->getPasswordForRoom($token);
+ $passwordVerification = $room->verifyPassword($password);
if ($passwordVerification['result']) {
- $this->talkSession->setPasswordForRoom($token, $token);
+ $this->talkSession->setPasswordForRoom($token, $password);
} else {
+ $this->talkSession->removePasswordForRoom($token);
if ($passwordVerification['url'] === '') {
return new TemplateResponse($this->appName, 'authenticate', [
'wrongpw' => $password !== '',