Example #1
0
<body>

  <h1> <?php 
echo gettext("New RRD Profile");
?>
 </h1>

<?php 
$profile = REQUEST('profile');
ossim_valid($profile, OSS_ALPHA, OSS_SPACE, OSS_PUNC, 'illegal:' . _("Profile"));
if (ossim_error()) {
    die(ossim_error());
}
$db = new ossim_db();
$conn = $db->connect();
if ($rrd_list = RRD_Config::get_list($conn, "WHERE profile = 'Default'")) {
    foreach ($rrd_list as $rrd) {
        $attrib = $rrd->get_rrd_attrib();
        if (POST("{$attrib}#rrd_attrib")) {
            if (POST("{$attrib}#enable") == "on") {
                $enable = 1;
            } else {
                $enable = 0;
            }
            ossim_valid(POST("{$attrib}#rrd_attrib"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#rrd_attrib"));
            ossim_valid(POST("{$attrib}#threshold"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#threshold"));
            ossim_valid(POST("{$attrib}#priority"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#priority"));
            ossim_valid(POST("{$attrib}#alpha"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#alpha"));
            ossim_valid(POST("{$attrib}#beta"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#beta"));
            ossim_valid(POST("{$attrib}#persistence"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#persistence"));
            if (ossim_error()) {
Example #2
0
                ossim_valid(POST("{$attrib}#rrd_attrib"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#rrd_attrib"));
                ossim_valid(POST("{$attrib}#threshold"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#threshold"));
                ossim_valid(POST("{$attrib}#priority"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#priority"));
                ossim_valid(POST("{$attrib}#alpha"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#alpha"));
                ossim_valid(POST("{$attrib}#beta"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#beta"));
                ossim_valid(POST("{$attrib}#persistence"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#persistence"));
                if (ossim_error()) {
                    die(ossim_error());
                }
                RRD_Config::update($conn, $profile, POST("{$attrib}#rrd_attrib"), POST("{$attrib}#threshold"), POST("{$attrib}#priority"), POST("{$attrib}#alpha"), POST("{$attrib}#beta"), POST("{$attrib}#persistence"), $enable);
            }
        }
    }
}
echo "<h2>{$profile}</h2>";
$rrd_list = RRD_Config::get_list($conn, "WHERE profile = '{$profile}' ORDER BY {$order}");
$db->close($conn);
?>

  <table align="center">
    <tr>
      <th><a href="<?php 
echo $_SERVER["SCRIPT_NAME"];
?>
?order=<?php 
echo ossim_db::get_order("rrd_attrib", $order);
?>
&profile=<?php 
echo $profile;
?>
">