aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates/user.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-12-23 18:20:57 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-12-23 18:20:57 +0100
commite8566a57cf1b9cc2eed10429f27840d17da945ef (patch)
tree9902d9f4dc2e871819af21ede642e50aaab1518b /app/view/templates/user.php
parent532cdf4bb82ab7cc6fa7659d9aec3ce122b2ec52 (diff)
downloadwcms-e8566a57cf1b9cc2eed10429f27840d17da945ef.tar.gz
wcms-e8566a57cf1b9cc2eed10429f27840d17da945ef.zip
feature users
Diffstat (limited to 'app/view/templates/user.php')
-rw-r--r--app/view/templates/user.php88
1 files changed, 88 insertions, 0 deletions
diff --git a/app/view/templates/user.php b/app/view/templates/user.php
new file mode 100644
index 0000000..8615f3d
--- /dev/null
+++ b/app/view/templates/user.php
@@ -0,0 +1,88 @@
+<?php $this->layout('layout', ['title' => 'user', 'css' => $css . 'home.css']) ?>
+
+
+<?php $this->start('page') ?>
+
+<body>
+
+ <?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'user']) ?>
+
+
+<main class="user">
+
+<table>
+<tr>
+<th>id</th><th>password</th><th>level</th><th>action</th>
+</tr>
+
+<tr>
+ <form action="<?= $this->url('useradd') ?>" method="post">
+ <td>
+ <input type="text" name="id" required>
+ </td>
+ <td>
+ <input type="password" name="password" minlength="4" maxlenght="64" required>
+ </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>
+ </select>
+ </td>
+ <td>
+ <input type="submit" value="add">
+ </td>
+ </form>
+</tr>
+
+
+<?php
+foreach ($userlist as $user ) {
+ ?>
+
+ <tr>
+ <form action="<?= $this->url('userupdate') ?>">
+
+ <td>
+ <?= $user->id() ?>
+ </td>
+
+ <td>
+ <input type="password" name="password" placeholder="<?= str_repeat('°', $user->password('int')) ?>" min="4" max="64" required>
+ </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>
+ </select>
+ </td>
+
+ <td>
+ <input type="submit" value="update">
+ </form>
+
+ <form action="<?= $this->url('userdelete') ?>" method="post">
+ <input type="submit" value="delete">
+ </form>
+ </td>
+
+ </tr>
+
+ <?php
+ }
+?>
+
+</table>
+
+<?php var_dump($userlist); ?>
+
+
+</main>
+</body>
+
+<?php $this->stop('page') ?> \ No newline at end of file