Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane Luis Daniel Lucio Quiroz */ include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('var_view')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //include the header require_once "resources/header.php"; $document['title'] = $text['title-variables_advanced']; //restore the default vars.xml if ($_GET['a'] == "default" && permission_exists('var_edit')) { //read default config file $fd = fopen($_SESSION['switch']['conf']['dir'].".orig/vars.xml", "r"); $v_content = fread($fd, filesize($_SESSION['switch']['conf']['dir'].".orig/vars.xml")); fclose($fd); //write the default config fget $fd = fopen($_SESSION['switch']['conf']['dir']."/vars.xml", "w"); fwrite($fd, $v_content); fclose($fd); $savemsg = "Default Restored"; } //save the vars.xml if ($_POST['a'] == "save" && permission_exists('var_edit')) { $v_content = str_replace("\r","",$_POST['code']); $fd = fopen($_SESSION['switch']['conf']['dir']."/vars.xml", "w"); fwrite($fd, $v_content); fclose($fd); $savemsg = "Saved"; } //get the contens of vars.xml $fd = fopen($_SESSION['switch']['conf']['dir']."/vars.xml", "r"); $v_content = fread($fd, filesize($_SESSION['switch']['conf']['dir']."/vars.xml")); fclose($fd); //edit area echo " \n"; echo " "; echo "\n"; echo "\n"; ?>






location: ".$_SESSION['switch']['conf']['dir']."/vars.xml\n"; } ?> "; } ?>