예제 #1
0
파일: feedback.php 프로젝트: rockylo/MoZBX
<?php

require_once "config.inc.php";
require_once "functions.php";
require_once "class_zabbix.php";
require_once "cookies.php";
$zabbix = new Zabbix($arrSettings);
// Populate our class
$zabbix->setUsername($zabbixUser);
$zabbix->setPassword($zabbixPass);
$zabbix->setZabbixApiUrl($zabbixApi);
// Login
if (strlen($zabbix->getUsername()) > 0 && strlen($zabbix->getPassword()) > 0 && strlen($zabbix->getZabbixApiUrl()) > 0) {
    $zabbix->login();
}
if (!$zabbix->isLoggedIn()) {
    header("Location: index.php");
    exit;
}
$boolShowThankyou = false;
$boolShowFeedbackForm = true;
$boolShowTextlengthWarn = false;
if (isset($_POST['mZabbixFeedback'])) {
    // Process feedback
    $txtFeedback = htmlentities($_POST['txtFeedback']);
    if (strlen($txtFeedback) < 30) {
        // Don't bother, type more
        $boolShowTextlengthWarn = true;
        $boolShowThankyou = false;
        $boolShowFeedbackForm = true;
    } else {