function post() { $users = new UsersData(); if ($users->authNeeded()) { if ($_POST['user'] != '' && $_POST['password'] != '' && $_POST['password'] == $_POST['password2']) { $users->addUser($_POST['user'], $_POST['password'], array('admin')); include_once 'admin-pages/login.php'; } else { // todo: better error messaging include_once 'admin-pages/init-setup.php?error=error'; } } else { include_once '404.html'; } }