mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-06-08 00:57:01 +03:00
Refactoring
This commit is contained in:
parent
1abfadf28c
commit
296e83fb88
811 changed files with 16877 additions and 147663 deletions
|
@ -1,37 +0,0 @@
|
|||
<?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