Portions created by the Initial Developer are Copyright (C) 2008-2019 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane James Rose */ //includes include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (permission_exists('edit_view')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //set the directory title and mode $_SESSION["app"]["edit"]["dir"] = $_GET["dir"]; $title = escape($_GET["dir"]); unset($mode); switch ($_GET["dir"]) { case 'xml': $title = 'XML'; $mode = 'xml'; break; case 'provision': $title = 'Provision'; $mode = 'xml'; break; case 'php': $title = 'PHP'; $mode = 'php'; break; case 'scripts': $title = 'Scripts'; $mode = 'lua'; break; case 'grammar': $title = 'Grammar'; $mode = 'xml'; default: $mode = 'text'; } //load editor preferences/defaults $setting_size = ($_SESSION["editor"]["font_size"]["text"] != '') ? $_SESSION["editor"]["font_size"]["text"] : '12px'; $setting_theme = ($_SESSION["editor"]["theme"]["text"] != '') ? $_SESSION["editor"]["theme"]["text"] : 'cobalt'; $setting_invisibles = ($_SESSION["editor"]["invisibles"]["boolean"] != '') ? $_SESSION["editor"]["invisibles"]["boolean"] : 'false'; $setting_indenting = ($_SESSION["editor"]["indent_guides"]["boolean"] != '') ? $_SESSION["editor"]["indent_guides"]["boolean"] : 'false'; $setting_numbering = ($_SESSION["editor"]["line_numbers"]["boolean"] != '') ? $_SESSION["editor"]["line_numbers"]["boolean"] : 'true'; //get and then set the favicon if (isset($_SESSION['theme']['favicon']['text'])){ $favicon = $_SESSION['theme']['favicon']['text']; } else { $favicon = $project_path .'/themes/default/favicon.ico'; } //create a token $key_name = '/app/edit/'.$mode; $_SESSION['keys'][$key_name] = bin2hex(random_bytes(32)); $_SESSION['token'] = hash_hmac('sha256', $key_name, $_SESSION['keys'][$key_name]); //generate the captcha image $_SESSION['captcha'] = generate_password(7, 2); $captcha = new captcha; $captcha->code = $_SESSION['captcha']; $image_base64 = $captcha->image_base64(); ?> <?php echo $title; ?>
'>