API filter per user level

This commit is contained in:
Lars van Hijfte
2017-02-01 11:38:43 +01:00
parent 028c2373c1
commit e414a1633e
18 changed files with 309 additions and 268 deletions

View File

@@ -7,38 +7,44 @@ require_once ("../../queries/checkInput.php");
require_once ("../../queries/user.php");
require_once ("../../queries/group_page.php");
$offset = 0;
$entries = 20;
if (isset($_POST["currentpage"])) {
$offset = (int) test_input($_POST["currentpage"]) * $entries - $entries;
}
if (isset($_SESSION["userID"]) &&
(getRoleByID($_SESSION["userID"]) == 'admin' ||
getRoleByID($_SESSION["userID"]) == 'owner')) {
$offset = 0;
$entries = 20;
if (isset($_POST["currentpage"])) {
$offset = (int)test_input($_POST["currentpage"]) * $entries - $entries;
}
$search = "";
if (isset($_POST["search"])) {
$search = test_input($_POST["search"]);
}
$search = "";
if (isset($_POST["search"])) {
$search = test_input($_POST["search"]);
}
$pagetype = "user";
if (isset($_POST['pagetype'])) {
$pagetype = test_input($_POST['pagetype']);
}
$pagetype = "user";
if (isset($_POST['pagetype'])) {
$pagetype = test_input($_POST['pagetype']);
}
$status = array();
if (isset($_POST['status'])) {
$status = $_POST["status"];
}
$status = array();
if (isset($_POST['status'])) {
$status = $_POST["status"];
}
$groupstatus = array();
if (isset($_POST['groupstatus'])) {
$groupstatus = $_POST["groupstatus"];
}
$groupstatus = array();
if (isset($_POST['groupstatus'])) {
$groupstatus = $_POST["groupstatus"];
}
$userinfo = getRoleByID($_SESSION['userID']);
$userinfo = getRoleByID($_SESSION['userID']);
if ($pagetype == "user") {
include ("../../views/adminpanel-table.php");
} else if ($pagetype == "group") {
include ("../../views/adminpanel-grouptable.php");
if ($pagetype == "user") {
include("../../views/adminpanel-table.php");
} else if ($pagetype == "group") {
include("../../views/adminpanel-grouptable.php");
} else {
echo "Search failed!";
}
} else {
echo "Search failed!";
}
header('HTTP/1.0 403 Forbidden');
}