|
1 | | -<?php if(!$this->Auth->isAuthenticated()): ?> |
2 | | - <div class="row g-0 flex-row overflow-hidden"> |
3 | | - <div class="col-lg-6 p-5" style="background: var(--bs-body-bg);"> |
4 | | - <?php if(is_null($this->Request->getParams('GET','verify'))): ?> |
5 | | - <div class="mb-4"> |
6 | | - <h2 class="h4 mb-1"><?= $this->Locale->get('Reset your password') ?></h2> |
7 | | - <p class="opacity-50 mb-0"><?= $this->Locale->get('Use your company account') ?></p> |
| 1 | +<div class="row g-0 flex-row overflow-hidden"> |
| 2 | + <div class="col-lg-6 p-5" style="background: var(--bs-body-bg);"> |
| 3 | + <?php if(is_null($this->Request->getParams('GET','verify'))): ?> |
| 4 | + <div class="mb-4"> |
| 5 | + <h2 class="h4 mb-1"><?= $this->Locale->get('Reset your password') ?></h2> |
| 6 | + <p class="opacity-50 mb-0"><?= $this->Locale->get('Use your company account') ?></p> |
| 7 | + </div> |
| 8 | + <form method="POST" action="?forgot&verify" class="needs-validation" autocomplete="off" novalidate> |
| 9 | + <?= $this->CSRF->field(); ?> |
| 10 | + <div class="mb-3"> |
| 11 | + <label for="username" class="form-label"><?= $this->Locale->get('Username') ?></label> |
| 12 | + <input type="email" class="form-control" name="username" id="username" autocomplete="off" placeholder="username@domain.com" required> |
| 13 | + <div class="invalid-feedback"><?= $this->Locale->get('Please enter a valid email.') ?></div> |
8 | 14 | </div> |
9 | | - <form method="POST" action="?forgot&verify" class="needs-validation" autocomplete="off" novalidate> |
10 | | - <?= $this->CSRF->field(); ?> |
11 | | - <div class="mb-3"> |
12 | | - <label for="username" class="form-label"><?= $this->Locale->get('Username') ?></label> |
13 | | - <input type="email" class="form-control" name="username" id="username" autocomplete="off" placeholder="username@domain.com" required> |
14 | | - <div class="invalid-feedback"><?= $this->Locale->get('Please enter a valid email.') ?></div> |
15 | | - </div> |
16 | | - <div class="d-flex justify-content-between align-items-center gap-3 mt-4 mb-2"> |
17 | | - <button type="button" class="btn btn-outline-secondary" onclick="window.history.back();"><i class="bi bi-arrow-left me-1"></i><?= $this->Locale->get('Go Back') ?></button> |
18 | | - <button type="submit" class="btn btn-primary flex-grow-1" name="reset"><?= $this->Locale->get('Continue') ?></button> |
19 | | - </div> |
20 | | - </form> |
21 | | - <?php else: ?> |
22 | | - <div class="mb-4"> |
23 | | - <h2 class="h4 mb-1"><?= $this->Locale->get('Enter your verification code') ?></h2> |
24 | | - <p class="opacity-50 mb-0"><?= $this->Locale->get('We sent you a code to your email') ?></p> |
| 15 | + <div class="d-flex justify-content-between align-items-center gap-3 mt-4 mb-2"> |
| 16 | + <button type="button" class="btn btn-outline-secondary" onclick="window.history.back();"><i class="bi bi-arrow-left me-1"></i><?= $this->Locale->get('Go Back') ?></button> |
| 17 | + <button type="submit" class="btn btn-primary flex-grow-1" name="reset"><?= $this->Locale->get('Continue') ?></button> |
25 | 18 | </div> |
26 | | - <form method="POST" action="<?= $this->Request->getHostAddress() . '/' . $this->Request->getUri() ?>" class="needs-validation" autocomplete="off" novalidate> |
27 | | - <?= $this->CSRF->field(); ?> |
28 | | - <input type="email" class="d-none" name="username" id="username" autocomplete="off" value="<?=$this->Request->getParams('POST','username')?>"> |
29 | | - <div class="mb-3"> |
30 | | - <label for="code" class="form-label"><?= $this->Locale->get('Code') ?></label> |
31 | | - <input type="text" class="form-control" name="code" id="code" autocomplete="off" placeholder="000000" value="<?=$this->Request->getParams('GET','verify')?>" required> |
32 | | - <div class="invalid-feedback"><?= $this->Locale->get('Please enter a valid pin.') ?></div> |
33 | | - </div> |
34 | | - <div class="d-flex justify-content-between align-items-center gap-3 mt-4 mb-2"> |
35 | | - <button type="button" class="btn btn-outline-secondary" onclick="window.history.back();"><i class="bi bi-arrow-left me-1"></i><?= $this->Locale->get('Go Back') ?></button> |
36 | | - <button type="submit" class="btn btn-primary flex-grow-1" name="reset"><?= $this->Locale->get('Continue') ?></button> |
37 | | - </div> |
38 | | - </form> |
39 | | - <?php endif; ?> |
40 | | - </div> |
41 | | - <div class="col-lg-6 p-5 d-flex flex-column text-white" style="background: linear-gradient(120deg, var(--bs-primary), var(--bs-dark));"> |
42 | | - <div class="d-flex align-items-center gap-2 mb-4"> |
43 | | - <img src="/logo" alt="<?= $this->Config->get('application','name'); ?>" style="max-height: 4rem; max-width: 4rem;"> |
44 | | - <h3 class="fw-lighter m-0"><?= $this->Config->get('application','name'); ?></h3> |
45 | | - </div> |
46 | | - <div class="mt-auto"> |
47 | | - <h3 class="h4 fw-light"><?= $this->Locale->get($this->Config->get('application','slogan') ?? ''); ?></h3> |
48 | | - <p class="opacity-50"><?= $this->Locale->get($this->Config->get('application','tagline') ?? ''); ?></p> |
| 19 | + </form> |
| 20 | + <?php else: ?> |
| 21 | + <div class="mb-4"> |
| 22 | + <h2 class="h4 mb-1"><?= $this->Locale->get('Enter your verification code') ?></h2> |
| 23 | + <p class="opacity-50 mb-0"><?= $this->Locale->get('We sent you a code to your email') ?></p> |
49 | 24 | </div> |
| 25 | + <form method="POST" action="<?= $this->Request->getHostAddress() . '/' . $this->Request->getUri() ?>" class="needs-validation" autocomplete="off" novalidate> |
| 26 | + <?= $this->CSRF->field(); ?> |
| 27 | + <input type="email" class="d-none" name="username" id="username" autocomplete="off" value="<?=$this->Request->getParams('POST','username')?>"> |
| 28 | + <div class="mb-3"> |
| 29 | + <label for="code" class="form-label"><?= $this->Locale->get('Code') ?></label> |
| 30 | + <input type="text" class="form-control" name="code" id="code" autocomplete="off" placeholder="000000" value="<?=$this->Request->getParams('GET','verify')?>" required> |
| 31 | + <div class="invalid-feedback"><?= $this->Locale->get('Please enter a valid pin.') ?></div> |
| 32 | + </div> |
| 33 | + <div class="d-flex justify-content-between align-items-center gap-3 mt-4 mb-2"> |
| 34 | + <button type="button" class="btn btn-outline-secondary" onclick="window.history.back();"><i class="bi bi-arrow-left me-1"></i><?= $this->Locale->get('Go Back') ?></button> |
| 35 | + <button type="submit" class="btn btn-primary flex-grow-1" name="reset"><?= $this->Locale->get('Continue') ?></button> |
| 36 | + </div> |
| 37 | + </form> |
| 38 | + <?php endif; ?> |
| 39 | + </div> |
| 40 | + <div class="col-lg-6 p-5 d-flex flex-column text-white" style="background: linear-gradient(120deg, var(--bs-primary), var(--bs-dark));"> |
| 41 | + <div class="d-flex align-items-center gap-2 mb-4"> |
| 42 | + <img src="/logo" alt="<?= $this->Config->get('application','name'); ?>" style="max-height: 4rem; max-width: 4rem;"> |
| 43 | + <h3 class="fw-lighter m-0"><?= $this->Config->get('application','name'); ?></h3> |
| 44 | + </div> |
| 45 | + <div class="mt-auto"> |
| 46 | + <h3 class="h4 fw-light"><?= $this->Locale->get($this->Config->get('application','slogan') ?? ''); ?></h3> |
| 47 | + <p class="opacity-50"><?= $this->Locale->get($this->Config->get('application','tagline') ?? ''); ?></p> |
50 | 48 | </div> |
51 | 49 | </div> |
52 | | - <script> |
| 50 | +</div> |
| 51 | +<script> |
53 | 52 |
|
54 | | - // Bootstrap validation |
55 | | - (() => { |
56 | | - const forms = document.querySelectorAll('.needs-validation'); |
57 | | - Array.from(forms).forEach(form => { |
58 | | - form.addEventListener('submit', event => { |
59 | | - if (!form.checkValidity()) { |
60 | | - event.preventDefault(); |
61 | | - event.stopPropagation(); |
62 | | - } |
63 | | - form.classList.add('was-validated'); |
64 | | - }, false); |
65 | | - }); |
| 53 | + // Bootstrap validation |
| 54 | + (() => { |
| 55 | + const forms = document.querySelectorAll('.needs-validation'); |
| 56 | + Array.from(forms).forEach(form => { |
| 57 | + form.addEventListener('submit', event => { |
| 58 | + if (!form.checkValidity()) { |
| 59 | + event.preventDefault(); |
| 60 | + event.stopPropagation(); |
| 61 | + } |
| 62 | + form.classList.add('was-validated'); |
| 63 | + }, false); |
| 64 | + }); |
66 | 65 |
|
67 | | - // Configure Input Mask |
68 | | - $('input[name="verify"]').inputmask({ |
69 | | - mask: ["999999"], |
70 | | - placeholder: " ", |
71 | | - greedy: false, |
72 | | - showMaskOnHover: false, |
73 | | - showMaskOnFocus: true |
74 | | - }); |
75 | | - })(); |
76 | | - </script> |
77 | | -<?php else: $this->interrupt()->Router->render('503'); endif; ?> |
| 66 | + // Configure Input Mask |
| 67 | + $('input[name="verify"]').inputmask({ |
| 68 | + mask: ["999999"], |
| 69 | + placeholder: " ", |
| 70 | + greedy: false, |
| 71 | + showMaskOnHover: false, |
| 72 | + showMaskOnFocus: true |
| 73 | + }); |
| 74 | + })(); |
| 75 | +</script> |
0 commit comments