Beispiel #1
0
<?php

ini_set("display_errors", 1);
error_reporting(E_ALL ^ E_NOTICE);
session_start();
require_once "./subs.php";
require_once "./conf.php";
require_once "../subs.php";
require_once "../conf.inc.php";
require_once "../lib/dblayer.php";
$result['msg'] = "Unknown error";
$result['success'] = false;
if ($admin_login = isKnownUser($_SESSION['username']) or $admin_login = isAuthorized()) {
    /*  Получаем параметры в виде JSON-объекта и преобразуем в асс.массив
     *  Обязательный параметр - 'action'
     * */
    $action = $_REQUEST['action'];
    $c['admin_id'] = $admin_login["uid"];
    $users = getUsers();
    switch ($action) {
        // Сохраняем пользовательский фильтр
        case 'saveNewFilter':
            $global = check_string($_REQUEST['global'], 'digits');
            $user_id = $global != 1 ? $admin_login['uid'] : '0';
            $name = check_string($_REQUEST['name'], 'text');
            $filter = check_string($_REQUEST['filter'], 'json');
            if ($filter != '' and $user_id != '' and $name != '' and $global != '') {
                $query_save = $db->query("INSERT INTO helpdesk_filter (`name`, `user`, `filter`)\r\n                                                                     VALUES ('{$name}', '{$user_id}', '{$filter}')");
                if ($query_save) {
                    $result['success'] = true;
                    $result['msg'] = "Фильтр {$name} успешно сохранён";
Beispiel #2
0
    unset($_REQUEST['u']);
    unset($_REQUEST['p']);
    unset($_REQUEST['c']);
    unset($_REQUEST['os']);
    $url = "http://utils.z-area.ru/helpdesk/client/";
    $rating = checkRequest('r', false);
    $rating = $rating ? "&r={$rating}" : "";
    if (checkRequest('ticket')) {
        header("Location: {$url}?ticket={$_REQUEST['ticket']}");
    } elseif (checkRequest('list')) {
        header("Location: {$url}?list");
    } else {
        header("Location: {$url}");
    }
}
if ($c = isKnownUser($_SESSION['username'], $_SESSION['userpass'])) {
    $uid = $c["uid"];
    $users = getUsers();
    $c['MONTHS_G'] = $MONTHS_G;
    $c['usercomp'] = $_SESSION['usercomp'];
    $c['useros'] = $_SESSION['useros'];
    $c['dir'] = 'helpdesk';
    $c['admins'] = getAdmins();
    $c['users'] = $users;
    $c['statuses'] = getTicketsStatuses();
    $c['msg'] = $_SESSION['msg'];
    unset($_SESSION['msg']);
    $c['msg_type'] = $_SESSION['msg_type'];
    unset($_SESSION['msg_type']);
    $c["is_boss"] = in_array($users[$uid]['post_id'], [1, 5, 9, 37, 68, 21, 60, 25, 51, 29, 35, 57, 59, 40, 46]);
    if (isset($_REQUEST['list']) or isset($_REQUEST['dept_list'])) {