Initial import and public 'release'

This commit is contained in:
Mark Schouten 2014-05-21 11:58:05 +02:00
parent 327597ca02
commit 90ee4dfea0
792 changed files with 147584 additions and 0 deletions

37
htdocs/users.php Normal file
View file

@ -0,0 +1,37 @@
<?php
include_once('includes/config.inc.php');
include_once('includes/session.inc.php');
include_once('includes/misc.inc.php');
if (!is_logged_in()) {
header("Location: index.php");
}
if (isset($_GET['action'])) {
$action = $_GET['action'];
} else {
_jtable_respond(null, 'error', 'No action given');
}
if ($action == "list") {
$users = get_all_users();
_jtable_respond($users);
} elseif ($action == "create" or $action == "update") {
$isadmin = $_POST['isadmin'] ? $_POST['isadmin'] : '0';
if (add_user($_POST['emailaddress'], $isadmin, $_POST['password']) === TRUE) {
unset($_POST['password']);
_jtable_respond($_POST, 'single');
} else {
_jtable_respond(null, 'error', 'Could not add/change this user');
}
} elseif ($action == "delete") {
if (delete_user($_POST['id']) === TRUE) {
_jtable_respond(null, 'delete');
} else {
_jtable_respond(null, 'error', 'Could not delete this user');
}
}
?>