Compare commits
No commits in common. "9867df0a04406e85b64d5af851710166c9750397" and "f46e73c64742446e722b151d0f8638307b280dab" have entirely different histories.
9867df0a04
...
f46e73c647
|
@ -133,8 +133,6 @@ function sortBy(column) {
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const table = document.getElementById('address_table') || false
|
console.log('loaded')
|
||||||
if (table) {
|
|
||||||
sortBy('last')
|
sortBy('last')
|
||||||
}
|
|
||||||
})
|
})
|
|
@ -104,11 +104,7 @@ class AddressBookAdminController
|
||||||
{
|
{
|
||||||
$this->adminCheck();
|
$this->adminCheck();
|
||||||
|
|
||||||
$nick = $_POST['nick'];
|
// TODO currently breaks on inserting a duplicate nick
|
||||||
|
|
||||||
if ($this->userRepository->findByNick(nick: $nick)) {
|
|
||||||
die("User: $nick already exists");
|
|
||||||
}
|
|
||||||
if (!empty($_POST)) {
|
if (!empty($_POST)) {
|
||||||
$isAdmin = empty($_POST['is_admin']) ? 0 : 1;
|
$isAdmin = empty($_POST['is_admin']) ? 0 : 1;
|
||||||
$user = new User(nick: $_POST['nick'], newPassword: $_POST['new_password'], first: $_POST['first'], last: $_POST['last'], isAdmin: $isAdmin);
|
$user = new User(nick: $_POST['nick'], newPassword: $_POST['new_password'], first: $_POST['first'], last: $_POST['last'], isAdmin: $isAdmin);
|
||||||
|
@ -151,10 +147,8 @@ class AddressBookAdminController
|
||||||
die("Error deleting user");
|
die("Error deleting user");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->template->render(templateName: 'status/404.html.php', vars: [
|
// TODO use 404
|
||||||
'user' => $this->user,
|
die("Nick: $nick not found");
|
||||||
'router' => $this->router
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue