mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-05-24 00:24:07 +03:00
Initial import and public 'release'
This commit is contained in:
parent
327597ca02
commit
90ee4dfea0
792 changed files with 147584 additions and 0 deletions
37
htdocs/users.php
Normal file
37
htdocs/users.php
Normal 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');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue