summaryrefslogtreecommitdiff
path: root/app/Template/auth/index.php
blob: 9dcdfa374c533ad20b19025346c47f059cd9e2f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<div class="form-login">

    <?php if (isset($errors['login'])): ?>
        <p class="alert alert-error"><?= $this->e($errors['login']) ?></p>
    <?php endif ?>

    <form method="post" action="<?= $this->url->href('auth', 'check', array('redirect_query' => $redirect_query)) ?>">

        <?= $this->form->csrf() ?>

        <?= $this->form->label(t('Username'), 'username') ?>
        <?= $this->form->text('username', $values, $errors, array('autofocus', 'required')) ?><br/>

        <?= $this->form->label(t('Password'), 'password') ?>
        <?= $this->form->password('password', $values, $errors, array('required')) ?>

        <?= $this->form->checkbox('remember_me', t('Remember Me'), 1, true) ?><br/>

        <?php if (GOOGLE_AUTH || GITHUB_AUTH): ?>
        <ul>
            <?php if (GOOGLE_AUTH): ?>
                <li><?= $this->url->link(t('Login with my Google Account'), 'oauth', 'google') ?></li>
            <?php endif ?>

            <?php if (GITHUB_AUTH): ?>
                <li><?= $this->url->link(t('Login with my Github Account'), 'oauth', 'gitHub') ?></li>
            <?php endif ?>
        </ul>
        <?php endif ?>

        <div class="form-actions">
            <input type="submit" value="<?= t('Sign in') ?>" class="btn btn-blue"/>
        </div>
    </form>

</div>