e949/api/user/__admin_session.php

29 lines
649 B
PHP

<?php
// Start session as any user
// ATTENTION: FOR DEBUG PURPOSES ONLY!
if ($IS_FRONTEND)
die("this file must not be included!");
// Includes
require_once("../_auth.php");
require_once("../_utils.php");
require_once("../_errorslist.php");
if (Utils_ThisFileIsRequested(__FILE__)) {
require_once("../_json.php");
if (!$Config["debug"])
JSON_ReturnError(code: E_UNS_INTERNAL, desc: "you need to enable debug mode in configuration file first");
if (!isset($_REQUEST["id"]))
JSON_ReturnError(code: E_UIN_INSUFARGS, desc: "valid id must be specified");
$_SESSION["userid"] = intval($_REQUEST["id"]);
JSON_ReturnData($_SESSION);
}
?>