Example #1
0
    if ($XML_FILE != "") {
        echo _("Error while parsing the document\nMake sure that") . " {$XML_FILE} " . _("begins with xml tag!\n");
    } else {
        echo _("The directive doesn't exist");
    }
    echo "</span></center>";
    exit;
}
if ($directive_xml != "") {
    $_SESSION['XML_FILE'] = $XML_FILE;
}
if ($category_mini != "") {
    $_SESSION['mini'] = $category_mini;
}
if (!empty($directive_id)) {
    if (is_free($directive_id, $XML_FILE) == "true") {
        $direct = unserialize($_SESSION['directive']);
    } else {
        $direct = getDirectiveFromXML($dom, $directive_id);
        $tab_rules = $direct->rules;
    }
    if ($direct->id != $directive_id) {
        echo "<center><span style='color:red'>" . _("The directive {$directive_id} doesn't exist in {$XML_FILE}") . "</span></center>";
        exit;
    }
    $_SESSION['directive'] = serialize($direct);
    if ($XML_FILE != '/etc/ossim/server/directives.xml') {
        release_file($XML_FILE);
    }
    if (!empty($directive_id)) {
        $direct->printDirective($level, $directive_xml);
Example #2
0
" />
		<input type="hidden" name="level" value="<?php 
echo $_GET["level"];
?>
" />
		<input type="hidden" name="id" value="<?php 
echo $_GET["id"];
?>
" />
		<input type="button" style="width: 100px"
			value="<?php 
echo $add ? gettext('Back to main') : gettext('Back');
?>
"
			<?php 
if (is_free($_GET["directive"], '/etc/ossim/server/' . $directive_xml) == "false") {
    print "onclick=\"onClickCancel(" . $_GET["directive"] . "," . $_GET["level"] . ")\"";
} else {
    print "onclick=\"onClickCancel2()\"";
}
?>
			
		/>
		<!-- 
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" style="width: 100px"
			id="save"
			value="<?php 
echo $add ? gettext('Next') : gettext('Save');
?>
"
Example #3
0
        $_SESSION['directive'] = serialize($new_directive);
        $OLD_XML_FILE = get_directive_file($directive->id);
        if ($OLD_XML_FILE == $XML_FILE) {
            $dom2 = $dom;
        } else {
            $dom2 = open_file($OLD_XML_FILE);
        }
        $tab_directive = $dom2->get_elements_by_tagname('directive');
        foreach ($tab_directive as $direct) {
            if ($direct->get_attribute('id') == $directive->id) {
                $old_node = $direct;
            }
        }
        $parent = $old_node->parent_node();
        /* if it amends the directive id*/
        if (is_free($new_directive->id) == "true") {
            $parent->remove_child($old_node);
            $directives->append_child($node);
        } else {
            $old_node->replace_node($node);
        }
        $dom->dump_file($XML_FILE);
        $dom2->dump_file($OLD_XML_FILE);
        if ($OLD_XML_FILE != $XML_FILE) {
            release_file($OLD_XML_FILE);
        }
    }
    release_file($XML_FILE);
    echo "<html><body onload=\"window.open('../index.php?directive=" . $new_directive->id . "&level=1','main')\"></body></html>";
} elseif ($query == "delete_directive") {
    $dir_id = $_GET['id'];