e949/api/user/__admin_session.php

26 lines
639 B
PHP
Raw Normal View History

<?php // Start session as any user
// ATTENTION: FOR DEBUG PURPOSES ONLY!
// 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_WRONGID, desc: "valid id must be specified");
if (!isset($_SESSION["userid"]))
session_start();
$_SESSION["userid"] = intval($_REQUEST["id"]);
JSON_ReturnData($_SESSION);
}
?>