. */ define("ROOT_DIR", __DIR__); require_once(ROOT_DIR . "/helpers/config.php"); require_once(ROOT_DIR . "/lang.php"); require_once(ROOT_DIR . "/helpers/user.php"); session_name('ulogger'); session_start(); $sid = session_id(); // check for forced login to authorize admin in case of public access $force_login = (isset($_REQUEST['force_login']) ? $_REQUEST['force_login'] : false); if ($force_login) { uConfig::$require_authentication = true; } $user = new uUser(); $user->getFromSession(); if (!$user->isValid && (uConfig::$require_authentication || defined('headless'))) { /* authentication */ $login = (isset($_REQUEST['user']) ? $_REQUEST['user'] : NULL); $pass = (isset($_REQUEST['pass']) ? $_REQUEST['pass'] : NULL); $ssl = ((!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "" || $_SERVER['HTTPS'] == "off") ? "http" : "https"); $auth_error = (isset($_REQUEST['auth_error']) ? $_REQUEST['auth_error'] : 0); if (!$login) { // not authenticated and username not submited // load form if (defined('headless')) { header('HTTP/1.1 401 Unauthorized', true, 401); } else { print '