. */ require_once(dirname(__DIR__) . "/helpers/auth.php"); require_once(ROOT_DIR . "/helpers/config.php"); require_once(ROOT_DIR . "/helpers/lang.php"); $auth = new uAuth(); $langStrings = (new uLang(uConfig::$lang))->getStrings(); $result = []; $resultAuth = [ "isAdmin" => $auth->isAdmin(), "isAuthenticated" => $auth->isAuthenticated() ]; if ($auth->isAuthenticated()) { $resultAuth["userId"] = $auth->user->id; $resultAuth["userLogin"] = $auth->user->login; } $resultConfig = [ "interval" => uConfig::$interval, "units" => uConfig::$units, "lang" => uConfig::$lang, "mapApi" => uConfig::$mapapi, "gkey" => uConfig::$gkey, "initLatitude" => uConfig::$init_latitude, "initLongitude" => uConfig::$init_longitude, "passRegex" => uConfig::passRegex(), "strokeWeight" => uConfig::$strokeWeight, "strokeColor" => uConfig::$strokeColor, "strokeOpacity" => uConfig::$strokeOpacity, "olLayers" => [] ]; foreach (uConfig::$ol_layers as $key => $val) { $resultConfig["olLayers"][$key] = $val; } $resultLang = []; foreach ($langStrings as $key => $val) { $resultLang[$key] = $val; } $result["auth"] = $resultAuth; $result["config"] = $resultConfig; $result["lang"] = $resultLang; header("Content-type: application/json"); echo json_encode($result); ?>