Пример #1
0
<body>

<?php 
if ($data['status'] == 'error') {
    $txt_error = "<div>" . _("The following errors occurred") . ":</div>\n\t\t\t\t\t  <div style='padding: 2px 10px 5px 10px;'>" . implode("<br/>", $validation_errors) . "</div>";
    $config_nt = array('content' => $txt_error, 'options' => array('type' => 'nf_error', 'cancel_button' => false), 'style' => 'width: 80%; margin: 20px auto; text-align: left;');
    $nt = new Notification('nt_1', $config_nt);
    $nt->show();
    Util::make_form("POST", "newportgroupform.php");
    exit;
}
$db = new ossim_db();
$conn = $db->connect();
if (POST('insert')) {
    $actives_ports = Port_group::expand_ports($actives_ports);
    $new_id = Port_group::insert($conn, $pgname, $actives_ports, $descr, $ctx);
    Util::memcacheFlush();
}
$db->close();
?>
    <script type='text/javascript'>
        if (!parent.is_lightbox_loaded(window.name))
        {
            document.location.href="portgroup.php?msg=updated";
        }
        else
        {
            document.location.href="newportgroupform.php?id=<?php 
echo $new_id;
?>
&update=1";
Пример #2
0
<?php 
if (POST('withoutmenu') != "1") {
    include "../hmenu.php";
    $get_param = "withoutmenu=0";
} else {
    $get_param = "portname={$pgname}&withoutmenu=1";
}
if ($error == true) {
    $txt_error = "<div>" . _("We Found the following errors") . ":</div><div style='padding:10px;'>" . implode("<br/>", $message_error) . "</div>";
    Util::print_error($txt_error);
    Util::make_form("POST", "newportform.php?" . $get_param);
    die;
}
if (POST('insert')) {
    Port_group::insert($conn, $pgname, $actives_ports, $descr);
    Util::clean_json_cache_files("ports");
}
if (isset($_SESSION['_portgroup'])) {
    unset($_SESSION['_portgroup']);
}
$db->close($conn);
if ($_SESSION["menu_sopc"] == "Ports" && POST('withoutmenu') != "1") {
    ?>
	<p> <?php 
    echo gettext("Port Group succesfully inserted");
    ?>
 </p>
	<script type='text/javascript'>document.location.href="port.php"</script>
	<?php 
} else {