Ejemplo n.º 1
0
    }
    foreach ($config as $keyname => $section) {
        if (!empty($section["landingpage"]) && !($section["landingpage"] == "false") && $section["landingpage"] == "true") {
            $section["url"] = "?landing=" . $keyname;
        }
        if (!empty($section["enabled"]) && !($section["enabled"] == "false") && $section["enabled"] == "true") {
            if (!empty($section["default"]) && !($section["default"] == "false") && $section["default"] == "true") {
                $item .= "\n<li data-content=\"" . $keyname . "\" class=\"selected\">\n<iframe allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" scrolling=\"auto\" src=\"" . $section["url"] . "\"></iframe>\n</li>\n";
            } else {
                $item .= "\n<li data-content=\"" . $keyname . "\">\n<iframe sandbox=\"allow-forms allow-same-origin allow-pointer-lock allow-scripts\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" scrolling=\"auto\" data-src=\"" . $section["url"] . "\"></iframe>\n</li>\n";
            }
        }
        if (!empty($section["login"]) && !($section["login"] == "false") && $section["login"] == "true") {
            $item .= "\n<li data-content=\"" . $keyname . "\">\n<iframe sandbox=\"allow-forms allow-same-origin allow-pointer-lock allow-scripts\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" scrolling=\"auto\" data-src=\"" . $section["url"] . "\"></iframe>\n</li>\n";
        }
    }
    return $item;
}
function landingPage($config, $keyname)
{
    $item = "\n    <html lang=\"en\">\n    <head>\n    <title>" . $config[$keyname]["name"] . "</title>\n    <link rel=\"stylesheet\" href=\"css/landing.css\">\n    </head>\n    <body>\n    <div class=\"login\">\n        <div class=\"heading\">\n            <h2><span class=\"" . $config[$keyname]["icon"] . " fa-3x\"></span></h2>\n            <section>\n                <a href=\"" . $config[$keyname]["url"] . "\" target=\"_self\" title=\"Launch " . $config[$keyname]["name"] . "!\"><button class=\"float\">Launch " . $config[$keyname]["name"] . "</button></a>\n            </section>\n        </div>\n     </div>\n     </body></html>";
    if (empty($item)) {
        $item = '';
    }
    return $item;
}
if (isset($_GET['landing'])) {
    $keyname = $_GET['landing'];
    echo landingPage($config, $keyname);
    die;
}
Ejemplo n.º 2
0
    return $item;
}
function command_exist($cmd)
{
    $returnVal = exec("which {$cmd}");
    return empty($returnVal) ? false : true;
}
function exec_enabled()
{
    $disabled = explode(', ', ini_get('disable_functions'));
    return !in_array('exec', $disabled);
}
// URL parameters
if (isset($_GET['landing'])) {
    $keyname = $_GET['landing'];
    echo landingPage($keyname);
    die;
}
// This is where the JavaScript reads the contents of the secret file. This gets re-generated on each page load.
if (isset($_GET['get']) && $_GET['get'] == 'secret') {
    $secret = file_get_contents(SECRET) or die("Unable to open " . SECRET);
    echo $secret;
    die;
}
// What branch does the user want to track?
if (isset($_GET['get']) && $_GET['get'] == 'branch') {
    $config = new Config_Lite(CONFIG);
    echo $config->get('general', 'branch', 'master');
    die;
}
// Things wrapped inside this are protected by a secret hash.