diff options
author | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
commit | 8fabf77b2a7720a357c63817c07035a9908818a0 (patch) | |
tree | d689fcac1403e2473010fe80bc337599a78c21a4 /Neutron-trunk/cms-special/admin/$resources/precontent.php | |
parent | 7b4af63a90a726b98a59b83e53f040a7a566a11d (diff) | |
download | electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.gz electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.bz2 electrode-8fabf77b2a7720a357c63817c07035a9908818a0.zip |
Update
Diffstat (limited to 'Neutron-trunk/cms-special/admin/$resources/precontent.php')
-rw-r--r-- | Neutron-trunk/cms-special/admin/$resources/precontent.php | 227 |
1 files changed, 0 insertions, 227 deletions
diff --git a/Neutron-trunk/cms-special/admin/$resources/precontent.php b/Neutron-trunk/cms-special/admin/$resources/precontent.php deleted file mode 100644 index e32c599..0000000 --- a/Neutron-trunk/cms-special/admin/$resources/precontent.php +++ /dev/null @@ -1,227 +0,0 @@ -<?php - -require $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php"; - -$pageid = explode("/", $_SERVER['REQUEST_URI'])[3]; -if (isset(explode("/", $_SERVER['REQUEST_URI'])[4])) { - if (explode("/", $_SERVER['REQUEST_URI'])[4] != "index.php" && substr(explode("/", $_SERVER['REQUEST_URI'])[4], 0, 1) != "?" && substr(explode("/", $_SERVER['REQUEST_URI'])[4], 0, 1) != "#") { - if (isset($lang["admin-titles"][$pageid]['subpages'])) { - $subpageid = explode("/", $_SERVER['REQUEST_URI'])[4]; - $subpageel = (array)$lang["admin-titles"][$pageid]['subpages']; - } else { - $subpageid = ""; - } - } else { - $subpageid = ""; - } -} else { - $subpageid = ""; -} - -if (isset($lang["admin-titles"][$pageid])) { - if (isset($lang["admin-titles"][$pageid]['dom']) && isset($lang["admin-titles"][$pageid]['header'])) { - if (isset($lang["admin-titles"][$pageid]['subpages'])) { - if ($subpageid != "") { - $subpages = $lang["admin-titles"][$pageid]['subpages']; - if (isset($subpageel)) { - if (isset($subpageel[$subpageid])) { - $pageConfig = [ "domName" => $subpageel[$subpageid]['dom'] . " — " . $lang["admin-titles"][$pageid]['dom'], "headerName" => $subpageel[$subpageid]['header'] ]; - } else { - $pageConfig = [ "domName" => $lang["admin-titles"]["fallback-subpages"] . " — " . $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"]["fallback-subpages"] ]; - } - } else { - $pageConfig = [ "domName" => $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"][$pageid]['header'] ]; - } - } else { - $pageConfig = [ "domName" => $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"][$pageid]['header'] ]; - } - } else { - $pageConfig = [ "domName" => $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"][$pageid]['header'] ]; - } - } else { - $pageConfig = [ "domName" => $lang["admin-titles"]["fallback"]['dom'], "headerName" => $lang["admin-titles"]["fallback"]['header'] ]; - } -} else { - $pageConfig = [ "domName" => $lang["admin-titles"]["fallback"], "headerName" => $lang["admin-titles"]["fallback"] ]; -} - -$invalid = false; - -if (isset($_COOKIE['_NEUTRON_ADMIN_TOKEN']) && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != ".." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "/" && strpos($_COOKIE['_NEUTRON_ADMIN_TOKEN'], "/") === false) { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/tokens/" . $_COOKIE['_NEUTRON_ADMIN_TOKEN'])) { - - } else { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/admin-v2/?pr=" . str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']) . "&pa=" . urlencode("?" . explode("?", $_SERVER['REQUEST_URI'])[1]) . "'</script>"); - } -} else { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/admin-v2/?pr=" . str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']) . "&pa=" . urlencode("?" . explode("?", $_SERVER['REQUEST_URI'])[1]) . "'</script>"); -} - -if (isset($_POST['password'])) { - if (password_verify($_POST['password'], file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/password"))) { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/admin-v2/home';</script>"); - return; - } else { - $invalid = true; - } -} - -?> - -<?php ob_start();echo("<!--\n\n" . str_replace('%year%', date('Y'), file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/private/license")) . "\n\n-->") ?> -<?php - -if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent")) { - $ready = true; -} else { - $ready = false; -} - -function startsWith ($string, $startString) { - $len = strlen($startString); - return (substr($string, 0, $len) === $startString); -} - -function getData(string $dir, $ignoreUploadDir = false) { - global $size; - $dircontent = scandir($dir); - foreach ($dircontent as $direl) { - if (($ignoreUploadDir && ($direl == "/upload" || $dir . "/" . $direl == $_SERVER['DOCUMENT_ROOT'] . "/resources/upload")) || $direl == ".git") {} else { - if ($direl == "." || $direl == "..") {} else { - if (is_link($dir . "/" . $direl)) {} else { - if (is_dir($dir . "/" . $direl)) { - getData($dir . "/" . $direl); - } else { - try { - $size = $size + filesize($dir . "/" . $direl); - } catch (Error $err) {} - } - } - } - } - } -} - -function isJson(string $json) { - json_decode($json); - return (json_last_error() == JSON_ERROR_NONE); -} - -require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/preprocessor.php"; - -?> - -<!DOCTYPE html> -<html style="overflow-x:hidden;background-color: transparent !important;" lang="en"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta http-equiv="X-UA-Compatible" content="ie=edge"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/fonts-import.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/alerts.css"> - <link href="<?= $_MD_INCLUDES ?>/material-components-web.min.css" rel="stylesheet"> - <script src="<?= $_MD_INCLUDES ?>/material-components-web.min.js"></script> - <link rel="stylesheet" href="<?= $_MDI_PATH ?>"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/spotlight.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/ui.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/codename.css"> - <link rel="icon" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/siteicon.png"> - <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/admin.js"></script> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/fonts-import.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/alerts.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/ui.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/common.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/index.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/responsive.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/index-dark.css" as="style"> - <link rel="preload" href="<?= $_MD_INCLUDES ?>/material-components-web.min.css" as="style"> - <link rel="preload" href="<?= $_MDI_PATH ?>" as="style"> - <link rel="preload" href="<?= $_MD_INCLUDES ?>/material-components-web.min.js" as="script"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/admin.js" as="script"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documenthead.php"; ?> - - <?php - - if (!isset($loadEditor)) { - $loadEditor = true; - } - - if ($loadEditor) { - echo('<script src="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/js/ckeditor5/ckeditor.js"></script><script src="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/js/ckeditor5/translations/fr.js"></script>'); - } - - ?> - <?php - if (file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme") == "dark") { - echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin-v2/$resources/index-dark.css">'); - } elseif (file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme") == "auto") { - echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin-v2/$resources/index-auto.css">'); - } else { - echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin-v2/$resources/index.css">'); - } - ?> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/lib/pushbar.js/library.css"> - <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/lib/pushbar.js/library.js"></script> - <title><?php - - if ($ready) { - echo("{$lang["admin-titles"]["suffix"]} — " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename")); - } else { - echo("{$lang["admin-titles"]["suffix"]} — Neutron"); - } - - ?></title> - <?php - if (!$ready) { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/setup';</script></head>"); - } - ?> - <?php - - getData($_SERVER['DOCUMENT_ROOT']); - $sizestr = $size . " " . $lang["sizes"]["bytes"]; - if ($size > 1024) { - if ($size > 1048576) { - if ($size > 1073741824) { - $sizestr = round($size / 1073741824, 2) . " " . $lang["sizes"]["gib"]; - } else { - $sizestr = round($size / 1048576, 2) . " " . $lang["sizes"]["mib"]; - } - } else { - $sizestr = round($size / 1024, 2) . " " . $lang["sizes"]["kib"]; - } - } else { - $sizestr = $size . " " . $lang["sizes"]["bytes"]; - } - $sizestr = str_replace(".", $lang["sizes"]["separator"], $sizestr); - - ?> -</head> -<body id="settings" style="display:none;overflow-x:hidden;background-color: transparent !important;"> - <script> - window.addEventListener("load", () => { - $("#settings").fadeIn(75) - }) - </script> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin-v2/\$resources/spotlight.php"; ?> - <?php - - require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documentbody.php"; - - $path = str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']); - $name = $pageConfig['headerName']; - - ?> - <div id="admin" style="margin-bottom:50px;margin-top:20px;background-color: transparent !important;"> - <?php - - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/updates")) { - echo("<div id=\"updates-available\">" . $lang["admin-home"]["updates"][0] . " — <a href=\"/cms-special/admin-v2/updates\">" . $lang["admin-home"]["updates"][1] . "</a></div>"); - $updatable = true; - } else { - $updatable = false; - } - - ?>
\ No newline at end of file |