Пример #1
0
        echo ($html ? "<tr><td colspan='20' class='spikekill_note'>" : "") . "NOTE: NO Standard Deviation Spikes found in '{$rrdfile}'" . ($html ? "</td></tr>\n" : "\n");
    }
} else {
    /* variance subroutine */
    if ($var_kills) {
        if (!$dryrun) {
            $new_output = updateXML($output, $rra);
        }
    } else {
        echo ($html ? "<tr><td colspan='20' class='spikekill_note'>" : "") . "NOTE: NO Variance Spikes found in '{$rrdfile}'" . ($html ? "</td></tr>\n" : "\n");
    }
}
/* finally update the file XML file and Reprocess the RRDfile */
if (!$dryrun) {
    if ($total_kills) {
        if (writeXMLFile($new_output, $xmlfile)) {
            if (backupRRDFile($rrdfile)) {
                createRRDFileFromXML($xmlfile, $rrdfile);
            } else {
                echo ($html ? "<tr><td colspan='20' class='spikekill_note'>" : "") . "FATAL: Unable to backup '{$rrdfile}'" . ($html ? "</td></tr>\n" : "\n");
            }
        } else {
            echo ($html ? "<tr><td colspan='20' class='spikekill_note'>" : "") . "FATAL: Unable to write XML file '{$xmlfile}'" . ($html ? "</td></tr>\n" : "\n");
        }
    }
} else {
    echo ($html ? "<tr><td colspan='20' class='spikekill_note'>" : "") . "NOTE: Dryrun requested.  No updates performed" . ($html ? "</td></tr>\n" : "\n");
}
if ($html) {
    echo "</table>";
}
Пример #2
0
    }
    if (preg_match("/(ftp|http|https):\\/\\/[a-zA-Z0-9.-_\\/]*/", $texttext)) {
        die("<br/><h2 style='color: #ff0000'>No urls allowed!</h2>");
    }
    $newentry->date = time();
    $newentry->addr = $REMOTE_ADDR;
    $newentry->agent = $HTTP_USER_AGENT;
    $newentry->text = nl2br($texttext);
    $last = count($entries) - 1;
    if (!($newentry->author == $entries[$last]->author && $newentry->email == $entries[$last]->email && $newentry->text == $entries[$last]->text)) {
        $entries[] = $newentry;
        $h = fopen($file, "w");
        if (!$h) {
            die("Couldn't write to disk!<br>\n");
        }
        writeXMLFile($h);
        include "mail.php";
        foreach ($mail as $i) {
            $emailmangled = str_replace("@", " at ", $emailname);
            $emailmangled = str_replace(".", " dot ", $emailmangled);
            mail($i, "CS documentation annotated by {$authorname}", "Author: {$authorname}\n" . "E-Mail: {$emailmangled}\n" . "Topic:  {$theme}\n" . "File:   {$HTTP_REFERER}\n" . "Time:   " . gmstrftime("%a, %d %b %G (%H:%M UTC)", $newentry->date) . " (" . $newentry->date . ")\n" . "Comment:\n" . stripslashes($texttext));
        }
        fclose($h);
        chmod($file, 0666);
        print "<h3>Comment added!</h3>\n";
        unset($entries);
        readXMLFile($file);
    }
    printEntries();
    print "<a href=\"{$self}?action=showadd#comments\">Add a comment</a><br>\n";
}