Browse Source

Requested changes from review. Signed-off-by: Peter Edens <petere@conceiva.com>

pull/1020/head
Peter Edens 7 years ago
parent
commit
09b0c01df9
  1. 2
      appinfo/info.xml
  2. 10
      lib/Controller/PageController.php
  3. 11
      lib/Room.php

2
appinfo/info.xml

@ -44,7 +44,7 @@ And in the works for the [coming versions](https://github.com/nextcloud/spreed/m
<screenshot>https://raw.githubusercontent.com/nextcloud/spreed/master/docs/contacts-menu.png</screenshot>
<dependencies>
<nextcloud min-version="13" max-version="14" />
<nextcloud min-version="14" max-version="14" />
</dependencies>
<background-jobs>

10
lib/Controller/PageController.php

@ -147,17 +147,13 @@ class PageController extends Controller {
}
if ($requirePassword) {
$passwordVerification = [
'result' => false,
'url' => ''
];
$passwordVerification = $room->verifyPassword($password);
if ($passwordVerification['result']) {
$this->session->setPasswordForRoom($token, $token);
} else {
if ($passwordVerification['url'] == '') {
if ($passwordVerification['url'] === '') {
return new TemplateResponse($this->appName, 'authenticate', [], 'guest');
}
else {
@ -210,7 +206,7 @@ class PageController extends Controller {
'result' => false,
'url' => ''
];
$passwordVerification = $room->verifyPassword($password);
if ($passwordVerification['result']) {

11
lib/Room.php

@ -574,7 +574,7 @@ class Room {
*/
public function joinRoomGuest($password, $passedPasswordProtection = false) {
$this->dispatcher->dispatch(self::class . '::preJoinRoomGuest', new GenericEvent($this));
if (!$passedPasswordProtection && !$this->verifyPassword($password)['result']) {
throw new InvalidPasswordException();
}
@ -595,7 +595,7 @@ class Room {
return $sessionId;
}
/**
* @param string $sessionId
* @param bool $active
@ -640,9 +640,12 @@ class Room {
$this->dispatcher->dispatch(self::class . '::verifyPassword', $event);
if ($event->hasArgument('result')) {
$result = $event->getArgument('result');
return $result;
return [
'result' => $result['result'] ?? false,
'url' => $result['url'] ?? ''
];
}
$passwordVerification = [
'result' => !$this->hasPassword() || $this->hasher->verify($password, $this->password),
'url' => ''

Loading…
Cancel
Save