Only set top.docRoot and top.iceRoot from index.php

Avoids having something output to the browser in places where we don't
want it, such as the new file-control-xhr.php file. Temporary
console.log for now as reminder to finish checking this out.
This commit is contained in:
Matt Pass
2014-11-12 17:40:27 +00:00
parent 24c6b870fc
commit ebf12f327f

View File

@@ -98,8 +98,8 @@ $_SESSION['username'] = $_SESSION['username'];
$serverType = stristr($_SERVER['SERVER_SOFTWARE'], "win") ? "Windows" : "Linux";
$docRoot = rtrim(str_replace("\\","/",$ICEcoder['docRoot']));
$iceRoot = rtrim(str_replace("\\","/",$ICEcoder["root"]));
if ($_SESSION['loggedIn']) {
echo "<script>top.docRoot='".$docRoot."';top.iceRoot='".$iceRoot."'</script>";
if ($_SESSION['loggedIn'] && basename($_SERVER['SCRIPT_NAME']) == "index.php") {
echo "<script>console.log('".basename($_SERVER['SCRIPT_NAME'])."');top.docRoot='".$docRoot."';top.iceRoot='".$iceRoot."'</script>";
}
// Establish the dir ICEcoders running from