mirror of https://github.com/sualko/cloud_bbb
feat: show login option
parent
e3c7eb2bbb
commit
39acceb24d
|
@ -95,20 +95,14 @@ class JoinController extends Controller {
|
|||
$presentation = new Presentation($u, $filename);
|
||||
}
|
||||
} elseif ($room->access === Room::ACCESS_INTERNAL || $room->access == Room::ACCESS_INTERNAL_RESTRICTED) {
|
||||
return new RedirectResponse(
|
||||
$this->urlGenerator->linkToRoute('core.login.showLoginForm', [
|
||||
'redirect_url' => $this->urlGenerator->linkToRoute(
|
||||
'bbb.join.index',
|
||||
['token' => $this->token]
|
||||
),
|
||||
])
|
||||
);
|
||||
return new RedirectResponse($this->getLoginUrl());
|
||||
} elseif (empty($displayname) || strlen($displayname) < 3 || ($room->access === Room::ACCESS_PASSWORD && $password !== $room->password)) {
|
||||
$response = new TemplateResponse($this->appName, 'join', [
|
||||
'room' => $room->name,
|
||||
'wrongdisplayname' => !empty($displayname) && strlen($displayname) < 3,
|
||||
'passwordRequired' => $room->access === Room::ACCESS_PASSWORD,
|
||||
'wrongPassword' => $password !== $room->password && $password !== '',
|
||||
'loginUrl' => $this->getLoginUrl(),
|
||||
], 'guest');
|
||||
|
||||
return $response;
|
||||
|
@ -139,4 +133,13 @@ class JoinController extends Controller {
|
|||
|
||||
return $this->room;
|
||||
}
|
||||
|
||||
private function getLoginUrl(): string {
|
||||
return $this->urlGenerator->linkToRoute('core.login.showLoginForm', [
|
||||
'redirect_url' => $this->urlGenerator->linkToRoute(
|
||||
'bbb.join.index',
|
||||
['token' => $this->token]
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<fieldset class="warning bbb">
|
||||
<h2><?php p($_['room']) ?></h2>
|
||||
<?php if (!isset($_['wrongdisplayname']) || !$_['wrongdisplayname']): ?>
|
||||
<p><?php p($l->t('Please enter your name!')); ?></p>
|
||||
<p class="warning-info"><?php p($l->t('Please enter your name!')); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($_['wrongdisplayname']) && $_['wrongdisplayname']): ?>
|
||||
<div class="warning"><?php p($l->t('The name must be at least 3 characters long.')); ?></div>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<input type="submit" id="displayname-submit"
|
||||
class="svg icon-confirm input-button-inline" value="" />
|
||||
<?php endif; ?>
|
||||
|
||||
<p class="login"><a href="<?php print_unescaped($_['loginUrl']); ?>"><?php p($l->t('Have an account? Log in.')); ?></a></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
|
@ -33,4 +33,10 @@
|
|||
height: 45px;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.login {
|
||||
margin-top: 1.5em;
|
||||
text-align: center;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue