Compare commits

..

No commits in common. "9867df0a04406e85b64d5af851710166c9750397" and "f46e73c64742446e722b151d0f8638307b280dab" have entirely different histories.

2 changed files with 5 additions and 13 deletions

View File

@ -133,8 +133,6 @@ function sortBy(column) {
}
document.addEventListener('DOMContentLoaded', () => {
const table = document.getElementById('address_table') || false
if (table) {
console.log('loaded')
sortBy('last')
}
})

View File

@ -104,11 +104,7 @@ class AddressBookAdminController
{
$this->adminCheck();
$nick = $_POST['nick'];
if ($this->userRepository->findByNick(nick: $nick)) {
die("User: $nick already exists");
}
// TODO currently breaks on inserting a duplicate nick
if (!empty($_POST)) {
$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);
@ -151,10 +147,8 @@ class AddressBookAdminController
die("Error deleting user");
}
} else {
$this->template->render(templateName: 'status/404.html.php', vars: [
'user' => $this->user,
'router' => $this->router
]);
// TODO use 404
die("Nick: $nick not found");
}
}