Esempio n. 1
0
    $Tools = new Tools($Database);
    $Log = new Logging($Database);
    $Result = new Result();
}
# user must be authenticated
$User->check_user_session();
# if direct request that redirect to tools page
if ($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest") {
    header("Location: " . create_link("tools", "logs"));
}
# if syslog print
if ($User->settings->log == "syslog") {
    $Result->show("warning", _("Log files are sent to syslog"));
} else {
    # print last 5 access logs
    $logs = $Log->fetch_logs(5, NULL, NULL, NULL, 0, 0, 0);
    print "<table class='table table-condensed table-hover table-top'>";
    # headers
    print "<tr>";
    print "\t<th>" . _('Severity') . "</th>";
    print "\t<th>" . _('Command') . "</th>";
    print "\t<th>" . _('Date') . "</th>";
    print "\t<th>" . _('Username') . "</th>";
    print "</tr>";
    # logs
    foreach ($logs as $log) {
        # cast
        $log = (array) $log;
        # reformat severity
        if ($log['severity'] == 0) {
            $log['severityText'] = _("Info");
Esempio n. 2
0
$logCount = 40;
//set severity queries
$_POST['InformationalQuery'] = @$_POST['Informational'] == _("Informational") ? 0 : 10;
$_POST['NoticeQuery'] = @$_POST['Notice'] == _("Notice") ? 1 : 10;
$_POST['WarningQuery'] = @$_POST['Warning'] == _("Warning") ? 1 : 10;
//get highest lastId */
$highestId = $Log->log_fetch_highest_id();
if (empty($_POST['lastId']) || $_POST['lastId'] == "undefined") {
    $_POST['lastId'] = $highestId;
}
//set empty direction
if (!isset($_POST['direction'])) {
    $_POST['direction'] = "";
}
/* get requested logs */
$logs = $Log->fetch_logs($logCount, $_POST['direction'], $_POST['lastId'], $highestId, $_POST['InformationalQuery'], $_POST['NoticeQuery'], $_POST['WarningQuery']);
$x = 0;
foreach ($logs as $log) {
    //cast
    $log = (array) $log;
    if ($x < $logCount) {
        //set classes based on severity
        if ($log['severity'] == 0) {
            $log['severityText'] = _("Informational");
            $color = "success";
        } else {
            if ($log['severity'] == 1) {
                $log['severityText'] = _("Notice");
                $color = "warning";
            } else {
                $log['severityText'] = _("Warning");
Esempio n. 3
0
    $Tools = new Tools($Database);
    $Log = new Logging($Database);
    $Result = new Result();
}
# user must be authenticated
$User->check_user_session();
# if direct request that redirect to tools page
if ($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest") {
    header("Location: " . create_link("tools", "logs"));
}
# if syslog print
if ($User->settings->log == "syslog") {
    $Result->show("warning", _("Log files are sent to syslog"));
} else {
    # print last 5 access logs
    $logs = $Log->fetch_logs(5, NULL, NULL, NULL, "off", "on", "on");
    print "<table class='table table-condensed table-hover table-top'>";
    # headers
    print "<tr>";
    print "\t<th>" . _('Severity') . "</th>";
    print "\t<th>" . _('Command') . "</th>";
    print "\t<th>" . _('Date') . "</th>";
    print "\t<th>" . _('Username') . "</th>";
    print "</tr>";
    # logs
    foreach ($logs as $log) {
        # cast
        $log = (array) $log;
        # reformat severity
        if ($log['severity'] == 0) {
            $log['severityText'] = _("Info");
Esempio n. 4
0
$logCount = 40;
//set severity queries
$informational = @$_POST['Informational'] == "Informational" ? "on" : "off";
$notice = @$_POST['Notice'] == "Notice" ? "on" : "off";
$warning = @$_POST['Warning'] == "Warning" ? "on" : "off";
//get highest lastId */
$highestId = $Log->log_fetch_highest_id();
if (empty($_POST['lastId']) || $_POST['lastId'] == "undefined") {
    $_POST['lastId'] = $highestId;
}
//set empty direction
if (!isset($_POST['direction'])) {
    $_POST['direction'] = "";
}
/* get requested logs */
$logs = $Log->fetch_logs($logCount, $_POST['direction'], $_POST['lastId'], $highestId, $informational, $notice, $warning);
$x = 0;
foreach ($logs as $log) {
    //cast
    $log = (array) $log;
    //set classes based on severity
    if ($log['severity'] == 0) {
        $log['severityText'] = _("Informational");
        $color = "success";
    } elseif ($log['severity'] == 1) {
        $log['severityText'] = _("Notice");
        $color = "warning";
    } elseif ($log['severity'] == 2) {
        $log['severityText'] = _("Warning");
        $color = "danger";
    } else {
Esempio n. 5
0
    $Tools = new Tools($Database);
    $Log = new Logging($Database);
    $Result = new Result();
}
# user must be authenticated
$User->check_user_session();
# if direct request that redirect to tools page
if ($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest") {
    header("Location: " . create_link("tools", "logs"));
}
# if syslog print
if ($User->settings->log == "syslog") {
    $Result->show("warning", _("Log files are sent to syslog"));
} else {
    # print last 5 access logs
    $logs = $Log->fetch_logs(5, NULL, NULL, NULL, 1, 2, 2);
    print "<table class='table table-condensed table-hover table-top'>";
    # headers
    print "<tr>";
    print "\t<th>" . _('Severity') . "</th>";
    print "\t<th>" . _('Command') . "</th>";
    print "\t<th>" . _('Date') . "</th>";
    print "\t<th>" . _('Username') . "</th>";
    print "</tr>";
    # logs
    foreach ($logs as $log) {
        # cast
        $log = (array) $log;
        # reformat severity
        if ($log['severity'] == 0) {
            $log['severityText'] = _("Info");