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