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', () => { document.addEventListener('DOMContentLoaded', () => {
const table = document.getElementById('address_table') || false console.log('loaded')
if (table) { sortBy('last')
sortBy('last')
}
}) })

View File

@ -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
]);
} }
} }