|
1 | | -<?php |
2 | | - |
| 1 | +<?php /* vim: set colorcolumn= expandtab shiftwidth=2 softtabstop=2 tabstop=4 smarttab: */ |
3 | 2 | namespace BNETDocs\Templates\User; |
4 | | - |
| 3 | +use \CarlBennett\MVC\Libraries\Common; |
5 | 4 | use \CarlBennett\MVC\Libraries\Pair; |
6 | | - |
7 | | -$title = "Create Password"; |
8 | | -$description = "This form allows an individual to create a password hash and salt for their account. DEVELOPMENT PURPOSES ONLY"; |
9 | | -$this->opengraph->attach(new Pair("url", "/user/createpassword")); |
10 | | - |
11 | | -require("./header.inc.phtml"); |
12 | | -?> |
13 | | - <article> |
14 | | - <header>Create Password</header> |
15 | | - <form method="POST" action="?"> |
16 | | - <section> |
17 | | - <p>This form is for creating a password to your user account. It generates values that need to be given to the BNETDocs Staff for facilitating your account's creation or password reset.</p> |
18 | | - </section> |
19 | | - <section> |
20 | | - <label for="input">Password:</label><br/> |
21 | | - <input |
22 | | - type="password" |
23 | | - name="input" |
24 | | - id="input" |
25 | | - value="<?php echo filter_var($this->getContext()->input, FILTER_SANITIZE_FULL_SPECIAL_CHARS); ?>" |
26 | | - tabindex="1" |
27 | | - required |
28 | | - autofocus="autofocus" |
29 | | - /> |
30 | | - </section> |
31 | | - <section> |
32 | | - <input |
33 | | - type="submit" |
34 | | - value="Get Hash & Salt" |
35 | | - tabindex="2" |
36 | | - /> |
37 | | - </section> |
38 | | - </form> |
39 | | -<?php if (!empty($this->getContext()->output)) { ?> |
40 | | - </article> |
41 | | - <article> |
42 | | - <header class="green">Secret Data</header> |
43 | | - <section class="green"> |
44 | | - <p>These values with your email address or username must be given to BNETDocs Staff, message them now.</p> |
45 | | - <table> |
46 | | - <thead></thead> |
47 | | - <tbody> |
48 | | - <tr><th>Hash:</th><td><code><?php echo filter_var($this->getContext()->output[0], FILTER_SANITIZE_FULL_SPECIAL_CHARS); ?></code></td></tr> |
49 | | - <tr><th>Salt:</th><td><code><?php echo filter_var($this->getContext()->output[1], FILTER_SANITIZE_FULL_SPECIAL_CHARS); ?></code></td></tr> |
50 | | - </tbody> |
51 | | - </table> |
52 | | - <p>Please allow BNETDocs Staff a few moments to put these values into your account.</p> |
53 | | - </section> |
54 | | -<?php } ?> |
55 | | - </article> |
56 | | -<?php require("./footer.inc.phtml"); ?> |
| 5 | +$title = 'Create Password'; |
| 6 | +$description = 'This page creates a password suitable for a user account.'; |
| 7 | +$this->opengraph->attach(new Pair('url', '/user/createpassword')); |
| 8 | +$output = $this->getContext()->output; |
| 9 | +require('./header.inc.phtml'); ?> |
| 10 | +<div class="container"> |
| 11 | + <h1><?=$title?></h1> |
| 12 | + <p><?=$description?></p> |
| 13 | + <div class="alert alert-info"><p class="mb-0">Our <a href="<?=Common::relativeUrlToAbsolute('/privacy')?>">privacy notice</a> page clarifies your data rights. You agree to giving (or not giving) the info contained herein on this page.</p></div> |
| 14 | + <div class="alert alert-warning"><p class="mb-0"><strong>Warning:</strong> This page is to be used with permission by site staff only. Use without permission is <strong>prohibited</strong> and may result in this page being shutdown in the future.</p></div> |
| 15 | + <form method="POST" action="?"> |
| 16 | + <div class="form-group"> |
| 17 | + <label class="font-weight-bold" for="input">Password:</label><br/> |
| 18 | + <input class="bg-dark border border-primary form-control text-light" type="password" name="input" id="input" placeholder="Enter the password here" value="<?=filter_var($this->getContext()->input, FILTER_SANITIZE_FULL_SPECIAL_CHARS)?>" tabindex="1" required autocomplete="new-password" autofocus="autofocus"/> |
| 19 | + </div> |
| 20 | + <div class="form-group"> |
| 21 | + <input class="btn btn-success" type="submit" value="Submit" tabindex="2"/> |
| 22 | + </div> |
| 23 | + </form> |
| 24 | +<? if (!empty($output)) { ?> |
| 25 | + <div class="container border border-success p-2 rounded"> |
| 26 | + <h3 class="text-success">Output</h3> |
| 27 | +<? if (is_string($output)) { ?> |
| 28 | + <pre><code class="language-plaintext"><?=filter_var($output, FILTER_SANITIZE_FULL_SPECIAL_CHARS)?></code></pre> |
| 29 | +<? } else { ?> |
| 30 | + <ul> |
| 31 | + <li><strong>Hash:</strong> <code><?=filter_var($output[0], FILTER_SANITIZE_FULL_SPECIAL_CHARS)?></code></li> |
| 32 | + <li><strong>Salt:</strong> <code><?=filter_var($output[1], FILTER_SANITIZE_FULL_SPECIAL_CHARS)?></code></li> |
| 33 | + </ul> |
| 34 | +<? } ?> |
| 35 | + <p class="mb-0">Please copy the output above and send it to the staff member for integration into your user account.</p> |
| 36 | + </div> |
| 37 | +<? } ?> |
| 38 | +</div> |
| 39 | +<? require('./footer.inc.phtml'); ?> |
0 commit comments