api/user/__admin_session.php and random tweaks
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php // Deleting existing account
|
||||
require_once("../_auth.php");
|
||||
require_once("../_utils.php");
|
||||
require_once("./index.php");
|
||||
@@ -17,12 +17,16 @@ function User_Delete ($id) {
|
||||
|
||||
if (ThisFileIsRequested(__FILE__)) {
|
||||
require_once("../_json.php");
|
||||
|
||||
// Dirty hack for debugging purposes. Will be removed later
|
||||
if ($Config["debug"])
|
||||
$_POST = $_REQUEST;
|
||||
|
||||
if (isset($_REQUEST["id"]) && $LOGGED_IN) {
|
||||
if (!ctype_digit($_REQUEST["id"]))
|
||||
if (isset($_POST["id"]) && $LOGGED_IN) {
|
||||
if (!ctype_digit($_POST["id"]))
|
||||
ReturnJSONError($Err_RDP_InvalidID, "id must be numeric");
|
||||
$UserID = intval($_REQUEST["id"]);
|
||||
} elseif (!isset($_REQUEST["id"]) && $LOGGED_IN) {
|
||||
$UserID = intval($_POST["id"]);
|
||||
} elseif (!isset($_POST["id"]) && $LOGGED_IN) {
|
||||
$UserID = $_SESSION["userid"];
|
||||
} else {
|
||||
ReturnJSONError($Err_RDP_InvalidID, "valid session must be provided");
|
||||
|
Reference in New Issue
Block a user