login.phtml 1.66 KB
Newer Older
1
2
3
4
5
6
<?php
/**
 * @var PhpRenderer $this
 * @var array[] $types Types d'authentification activés, ex: ['db' => ['enabled'=>true, 'type'=>'local'], 'shib' => ['enabled'=>true]]
 * @var string $type Type d'authentification courante : 'db', 'ldap', 'shib'
 * @var Form $loginForm Formulaire de connexion
7
 * @var LoginForm[] $forms Formulaires de connexion possibles
8
 * @var string $redirect URL demandée nécessitant authentification
9
10
11
 * @var bool $enableRegistration
 *
 * @see \UnicaenAuth\Controller\AuthController::loginAction()
12
13
14
 */

use Application\View\Renderer\PhpRenderer;
15
use UnicaenAuth\Form\LoginForm;
Bertrand Gauthier's avatar
Bertrand Gauthier committed
16
use Laminas\Form\Form;
17
18
19
20
21
22
23
24
25

$this->headTitle("Connexion") ?>

<div class="div-connexion">
    <h1 class="page-header"><?php echo $this->translate("Connexion"); ?></h1>
    <?php echo $this->partial('unicaen-auth/auth/login-tabs', [
        'types' => $types,
        'type' => $type,
        'form' => $loginForm,
26
        'forms' => $forms,
27
28
29
30
31
32
        'redirect' => $redirect,
    ]); ?>
</div>


<!-- Création d'un compte local (si autorisée) -->
33
<?php if ($enableRegistration) : ?>
Bertrand Gauthier's avatar
Bertrand Gauthier committed
34
35
<div id="div-connexion" class="card">
    <div class="card-body">
36
    <?php echo $this->translate("Not registered?"); ?> <a href="<?php echo $this->url('zfcuser/register') . ($this->redirect ? '?redirect=' . $this->redirect : '') ?>"><?php echo $this->translate("Sign up!"); ?></a>
Bertrand Gauthier's avatar
Bertrand Gauthier committed
37
    </div>
38
39
40
41
42
43
44
45
46
47
48
49
50
</div>
<?php endif; ?>


<script type="text/javascript">
    $(function() {
        // focus sur le 1er champ vide visible
        var $input = $("input").filter(function() {
            return $(this).is(":visible") && this.value === "";
        });
        if ($input.length) $input.get(0).focus();
    });
</script>