diff options
Diffstat (limited to 'app/view/templates/user.php')
-rw-r--r-- | app/view/templates/user.php | 259 |
1 files changed, 138 insertions, 121 deletions
diff --git a/app/view/templates/user.php b/app/view/templates/user.php index 21a7639..f281c93 100644 --- a/app/view/templates/user.php +++ b/app/view/templates/user.php @@ -10,157 +10,174 @@ <main class="user"> -<section> + <section> + <div class="block"> -<article> + + <h1>User : <?= $user->id() ?></h1> + + <div class="scroll"> -<h1>User : <?= $user->id() ?></h1> -<h2>Infos</h2> + <h2>Infos</h2> -<p>Connections count : <?= $getuser->connectcount() ?></p> + <p>Connections count : <?= $getuser->connectcount() ?></p> -<p>Account will expire in : <?= $getuser->expiredate('hrdi') ?></p> + <p>Account will expire in : <?= $getuser->expiredate('hrdi') ?></p> -<h2>Preferences</h2> + <h2>Preferences</h2> -<form action="<?= $this->url('userpref') ?>" method="post"> + <form action="<?= $this->url('userpref') ?>" method="post"> -<p> - <input type="number" name="cookie" value="<?= $getuser->cookie() ?>" id="cookie" min="0" max="365"> - <label for="cookie">Cookie conservation time <i>(In days)</i></label> - <input type="submit" value="submit"> -</p> - -</form> - -</article> - - -<?php if($user->isadmin()) { ?> - -<article> - -<h1>Admin panel</h1> - -<table> -<tr> -<th>id</th><th>password</th><th>hash</th><th>level</th><th>set expiration date</th><th>action</th><th>expire</th><th>connect</th> -</tr> - -<tr> - <form action="<?= $this->url('useradd') ?>" method="post"> - <td> - <input type="text" name="id" maxlength="128" required> - </td> - <td> - <input type="password" name="password" minlength="4" maxlength="64" required> - </td> - - <td> - <input type="hidden" name="passwordhashed" value="0"> - <input type="checkbox" name="passwordhashed" value="1"> - </td> - - <td> - <select name="level" id="level"> - <option value="1">reader</option> - <option value="2">invite</option> - <option value="3">editor</option> - <option value="4">super editor</option> - <option value="10">admin</option> - </select> - </td> - <td> - <input type="date" name="expiredate" id="expiredate" min="<?= $now ?>"> - </td> - <td> - <input type="submit" value="add"> - </td> - <td> - - </td> - <td> - - </td> - - </form> -</tr> + <p> + <input type="number" name="cookie" value="<?= $getuser->cookie() ?>" id="cookie" min="0" max="365"> + <label for="cookie">Cookie conservation time <i>(In days)</i></label> + <input type="submit" value="submit"> + </p> + + </form> + + + </div> + + + </div> + </section> -<?php -foreach ($userlist as $user ) { - ?> - <tr> - <form action="<?= $this->url('userupdate') ?>" method="post"> - - <td> - <?= $user->id() ?> - </td> - - <td> - <input type="password" name="password" minlength="4" maxlength="64" > - </td> - - <td> - <?= $user->passwordhashed() ? '🔑' : '<input type="hidden" name="passwordhashed" value="0"><input type="checkbox" name="passwordhashed" value="1">' ?> - </td> - - <td> - <select name="level" id="level"> - <option value="1" <?= $user->level() === 1 ? 'selected' : '' ?>>reader</option> - <option value="2" <?= $user->level() === 2 ? 'selected' : '' ?>>invite</option> - <option value="3" <?= $user->level() === 3 ? 'selected' : '' ?>>editor</option> - <option value="4" <?= $user->level() === 4 ? 'selected' : '' ?>>super editor</option> - <option value="10" <?= $user->level() === 10 ? 'selected' : '' ?>>admin</option> - </select> - </td> - - - <td> - <input type="date" name="expiredate" id="expiredate"<?= $user->expiredate() !== false ? 'value="' . $user->expiredate('string') . '"' : '' ?>> - <span>reset<input type="checkbox" name="expiredate" id="expiredate" value="null"></span> + <?php if($user->isadmin()) { ?> + + <section> - </td> + <div class="block"> + + <h1>Admin panel</h1> + + <div class="scroll"> + + <table> + <tr> + <th>id</th><th>password</th><th>hash</th><th>level</th><th>set expiration date</th><th>action</th><th>expire</th><th>connect</th> + </tr> + + <tr> + <form action="<?= $this->url('useradd') ?>" method="post"> + <td> + <input type="text" name="id" maxlength="128" required> + </td> + <td> + <input type="password" name="password" minlength="4" maxlength="64" required> + </td> + + <td> + <input type="hidden" name="passwordhashed" value="0"> + <input type="checkbox" name="passwordhashed" value="1"> + </td> + + <td> + <select name="level" id="level"> + <option value="1">reader</option> + <option value="2">invite</option> + <option value="3">editor</option> + <option value="4">super editor</option> + <option value="10">admin</option> + </select> + </td> + <td> + <input type="date" name="expiredate" id="expiredate" min="<?= $now ?>"> + </td> + <td> + <input type="submit" value="add"> + </td> + <td> + + </td> + <td> + + </td> + + </form> + </tr> + + + <?php + foreach ($userlist as $user ) { + ?> + + <tr> + <form action="<?= $this->url('userupdate') ?>" method="post"> + + <td> + <?= $user->id() ?> + </td> + + <td> + <input type="password" name="password" minlength="4" maxlength="64" > + </td> + + <td> + <?= $user->passwordhashed() ? '🔑' : '<input type="hidden" name="passwordhashed" value="0"><input type="checkbox" name="passwordhashed" value="1">' ?> + </td> + + <td> + <select name="level" id="level"> + <option value="1" <?= $user->level() === 1 ? 'selected' : '' ?>>reader</option> + <option value="2" <?= $user->level() === 2 ? 'selected' : '' ?>>invite</option> + <option value="3" <?= $user->level() === 3 ? 'selected' : '' ?>>editor</option> + <option value="4" <?= $user->level() === 4 ? 'selected' : '' ?>>super editor</option> + <option value="10" <?= $user->level() === 10 ? 'selected' : '' ?>>admin</option> + </select> + </td> + + + <td> + <input type="date" name="expiredate" id="expiredate"<?= $user->expiredate() !== false ? 'value="' . $user->expiredate('string') . '"' : '' ?>> + <span>reset<input type="checkbox" name="expiredate" id="expiredate" value="null"></span> + + </td> + + <td> + <input type="hidden" name="id" value="<?= $user->id() ?>"> + <input type="submit" name="action" value="update"> + <input type="submit" name="action" value="delete"> + </form> + + </td> + - <td> - <input type="hidden" name="id" value="<?= $user->id() ?>"> - <input type="submit" name="action" value="update"> - <input type="submit" name="action" value="delete"> - </form> - </td> + <td> + <?= $user->expiredate('hrdi') ?> + </td> + <td> + <?= $user->connectcount() ?> + </td> - <td> - <?= $user->expiredate('hrdi') ?> - </td> + </tr> - <td> - <?= $user->connectcount() ?> - </td> + <?php + } + ?> + </table> - </tr> - <?php - } -?> + </div> -</table> + </div> -</article> -<?php } ?> + </section> + <?php } ?> -</section> </main> |