function search()
{
    if (!CheckRights()) {
        senderror("{ERROR_NO_PRIVS}");
    }
    $boot = new boostrap_form();
    $sock = new sockets();
    $users = new usersMenus();
    $maillog_path = $users->maillog_path;
    $tpl = new templates();
    $t = time();
    $query = base64_encode($_GET["search"]);
    if (!is_numeric($_POST["rp"])) {
        $_POST["rp"] = 500;
    }
    $array = unserialize(base64_decode($sock->getFrameWork("postfix.php?query-maillog=yes&filter={$query}&maillog={$maillog_path}&rp={$_POST["rp"]}&zarafa-filter={$_GET["zarafa-filter"]}&mimedefang-filter={$_GET["mimedefang-filter"]}")));
    $array = explode("\n", @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/query.mail.log"));
    krsort($array);
    $zDate = $tpl->_ENGINE_parse_body("{zDate}");
    $hostTXT = $tpl->_ENGINE_parse_body("{host}");
    $serviceTXT = $tpl->_ENGINE_parse_body("{servicew}");
    $eventsTXT = $tpl->_ENGINE_parse_body("{events}");
    while (list($index, $line) = each($array)) {
        $lineenc = base64_encode($line);
        if (preg_match("#^[a-zA-Z]+\\s+[0-9]+\\s+([0-9\\:]+)\\s+(.+?)\\s+(.+?)\\[([0-9]+)\\]:(.+)#", $line, $re)) {
            $date = "{$re[1]}";
            $host = $re[2];
            $service = $re[3];
            $pid = $re[4];
            $line = $re[5];
        }
        $class = LineToClass($line);
        $img = statusLogs($line);
        $loupejs = "ZoomEvents('{$lineenc}')";
        $trSwitch = $boot->trswitch("blur()");
        $tr[] = "\n\t\t<tr id='{$id}' class={$class} {$trSwitch}>\n\t\t<td style='font-size:12px' {$trSwitch} width=1% nowrap><i class='icon-time'></i>&nbsp;{$date}</td>\n\t\t<td style='font-size:12px' nowrap {$trSwitch} width=1% nowrap><i class='icon-arrow-right'></i>&nbsp;{$host}</td>\n\t\t<td style='font-size:12px' nowrap {$trSwitch} width=1% nowrap>{$service}</td>\n\t\t<td style='text-align:center;font-size:12px' width=1% nowrap>{$pid}</td>\n\t\t<td style='text-align:center;font-size:12px' width=1% nowrap><img src='{$img}'></td>\n\t\t<td style='font-size:12px' nowrap {$trSwitch} width=99% nowrap>{$line}</td>\n\t\t</tr>";
    }
    echo $tpl->_ENGINE_parse_body("\n\t\n\t\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{$zDate}</th>\n\t\t\t\t\t<th>{$hostTXT}</th>\n\t\t\t\t\t<th>{$serviceTXT}</th>\n\t\t\t\t\t<th>PID</th>\n\t\t\t\t\t<th colspan=2>{$eventsTXT}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t") . @implode("\n", $tr) . " </tbody>\n\t\t\t\t</table>\n\t\t\t\t<script>\n\n\t</script>\n\t";
}
<?php

include_once 'ressources/class.templates.inc';
include_once 'ressources/class.ldap.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.user.inc';
include_once 'ressources/class.ini.inc';
include_once 'ressources/class.donkey.inc';
if (!CheckRights()) {
    $tpl = new templates();
    $error = $tpl->_ENGINE_parse_body("{ERROR_NO_PRIVS}");
    echo "alert('{$error}')";
    die;
}
if (isset($_GET["popup"])) {
    popup();
    exit;
}
if (isset($_GET["MldonkeyActivate"])) {
    SaveInfos();
    exit;
}
js();
function CheckRights()
{
    if (!$_GET["uid"]) {
        return false;
    }
    $usersprivs = new usersMenus();
    if ($usersprivs->AsAnAdministratorGeneric) {
        return true;
<?php

include_once 'dbconnection.php';
include_once 'checkrights.php';
if (checkToken($_REQUEST['username'], $_REQUEST['token'])) {
    if ($_REQUEST['rightname']) {
        $feature = "rightsedit";
        if (CheckRights($_REQUEST['username'], $feature)) {
            grantRight($_REQUEST['thisuser'], $_REQUEST['rightname'], $_REQUEST['value']);
        } else {
            echo "{\"error\": [{ \"type\": \"alert\", \"msg\":\"You do not have access to this feature.\"}]}";
        }
    } else {
        $feature = "rightsedit";
        if (CheckRights($_REQUEST['username'], $feature)) {
            loadFeatures();
        } else {
            echo "{\"error\": [{ \"type\": \"alert\", \"msg\":\"You do not have access to this feature.\"}]}";
        }
    }
} else {
    echo "[{\"error\":\"You are not logged in. Log in to view this data.\"}]";
}
function loadFeatures()
{
    try {
        $con = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);
        $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $sql = "SELECT * FROM features";
        $stmt = $con->prepare($sql);
        $stmt->execute();
    exit;
}
if (isset($_GET["categories-graĥs"])) {
    categories_graphs();
    exit;
}
if (isset($_GET["categories-table"])) {
    categories_table();
    exit;
}
if (isset($_GET["categories-search"])) {
    categories_search();
    exit;
}
$users = new usersMenus();
CheckRights();
js();
function js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    header("content-type: application/x-javascript");
    $xtime = $_GET["xtime"];
    $dateT = date("{l} {F} d", $xtime);
    if ($tpl->language == "fr") {
        $dateT = date("{l} d {F} ", $xtime);
    }
    $dateT = $tpl->_ENGINE_parse_body($dateT);
    $dateT = date("{l} {F} d", $_GET["xtime"]);
    if ($tpl->language == "fr") {
        $dateT = date("{l} d {F} ", $_GET["xtime"]);