2020-06-21 21:29:52 +02:00
|
|
|
<?php
|
2021-10-20 22:29:23 +02:00
|
|
|
use Cake\Core\Configure;
|
|
|
|
?>
|
2021-10-05 12:06:09 +02:00
|
|
|
|
2021-10-20 22:29:23 +02:00
|
|
|
<div class="form-signin panel shadow position-absolute start-50 translate-middle">
|
|
|
|
<?php
|
|
|
|
echo sprintf(
|
|
|
|
'<div class="text-center mb-4">%s</div>',
|
|
|
|
$this->Html->image('logo-purple.png', [
|
|
|
|
'alt' => __('Cerebrate logo'),
|
|
|
|
'width' => 100, 'height' => 100,
|
|
|
|
'style' => ['filter: drop-shadow(4px 4px 4px #924da666);']
|
|
|
|
])
|
|
|
|
);
|
|
|
|
$template = [
|
|
|
|
'inputContainer' => '<div class="form-floating input {{type}}{{required}}">{{content}}</div>',
|
|
|
|
'formGroup' => '{{input}}{{label}}',
|
|
|
|
'submitContainer' => '<div class="submit d-grid">{{content}}</div>',
|
|
|
|
];
|
|
|
|
$this->Form->setTemplates($template);
|
2022-02-25 00:33:00 +01:00
|
|
|
if (!Configure::check('password_auth.enabled') || Configure::read('password_auth.enabled')) {
|
|
|
|
echo sprintf('<h4 class="text-uppercase fw-light mb-3">%s</h4>', __('Sign In'));
|
|
|
|
echo $this->Form->create(null, ['url' => ['controller' => 'users', 'action' => 'login']]);
|
|
|
|
echo $this->Form->control('username', ['label' => 'Username', 'class' => 'form-control mb-2', 'placeholder' => __('Username')]);
|
|
|
|
echo $this->Form->control('password', ['type' => 'password', 'label' => 'Password', 'class' => 'form-control mb-3', 'placeholder' => __('Password')]);
|
|
|
|
echo $this->Form->control(__('Login'), ['type' => 'submit', 'class' => 'btn btn-primary']);
|
|
|
|
echo $this->Form->end();
|
|
|
|
if (!empty(Configure::read('security.registration.self-registration'))) {
|
|
|
|
echo '<div class="text-end">';
|
|
|
|
echo sprintf('<span class="text-secondary ms-auto" style="font-size: 0.8rem">%s <a href="/users/register" class="text-decoration-none link-primary fw-bold">%s</a></span>', __('Don\'t have an account?'), __('Sign up'));
|
|
|
|
echo '</div>';
|
|
|
|
}
|
|
|
|
if (!empty(Configure::read('keycloak.enabled'))) {
|
|
|
|
echo sprintf('<div class="d-flex align-items-center my-2"><hr class="d-inline-block flex-grow-1"/><span class="mx-3 fw-light">%s</span><hr class="d-inline-block flex-grow-1"/></div>', __('Or'));
|
|
|
|
}
|
2021-10-20 22:29:23 +02:00
|
|
|
}
|
2022-01-27 22:11:51 +01:00
|
|
|
if (!empty(Configure::read('keycloak.enabled'))) {
|
2021-10-20 22:29:23 +02:00
|
|
|
echo $this->Form->create(null, [
|
|
|
|
'url' => Cake\Routing\Router::url([
|
|
|
|
'prefix' => false,
|
|
|
|
'plugin' => 'ADmad/SocialAuth',
|
|
|
|
'controller' => 'Auth',
|
|
|
|
'action' => 'login',
|
|
|
|
'provider' => 'keycloak',
|
|
|
|
'?' => ['redirect' => $this->request->getQuery('redirect')]
|
|
|
|
]),
|
|
|
|
]);
|
|
|
|
echo $this->Bootstrap->button([
|
|
|
|
'type' => 'submit',
|
|
|
|
'text' => __('Login with Keycloak'),
|
|
|
|
'variant' => 'secondary',
|
|
|
|
'class' => ['d-block', 'w-100'],
|
|
|
|
'image' => [
|
|
|
|
'path' => '/img/keycloak_logo.png',
|
2022-11-24 12:50:11 +01:00
|
|
|
'alt' => 'Keycloak',
|
|
|
|
],
|
2021-10-20 22:29:23 +02:00
|
|
|
]);
|
|
|
|
echo $this->Form->end();
|
|
|
|
}
|
|
|
|
?>
|
2021-10-21 13:45:24 +02:00
|
|
|
</div>
|