Ejemplo n.º 1
0
        		));*/
        // we want to do our own special type of form modification here
        // so we don't pass it off to "check_page" which will hide all input boxes.
        if (!module_ticket::can_i('edit', 'Tickets') && !module_ticket::can_i('create', 'Tickets')) {
            set_error('Access to editing or creating tickets is denied.');
            redirect_browser(module_ticket::link_open(false));
        }
    }
} else {
    $ticket_id = false;
    if (class_exists('module_security', false)) {
        module_security::check_page(array('module' => $module->module_name, 'feature' => 'create'));
    }
}
if (module_ticket::can_edit_tickets()) {
    module_ticket::mark_as_read($ticket_id, true);
}
//$module->pre_menu(); // so the links are re-build and the correct "unread" count is at the top.
if (!module_security::can_access_data('ticket', $ticket)) {
    echo 'Ticket access denied';
    exit;
}
$ticket_messages = module_ticket::get_ticket_messages($ticket['ticket_id'], true);
if (!isset($logged_in_user) || !$logged_in_user) {
    // we assume the user is on the public side.
    // use the creator id as the logged in id.
    $logged_in_user = module_security::get_loggedin_id();
}
$ticket_creator = $ticket['user_id'];
if ($ticket_creator == $logged_in_user) {
    // we are sending a reply back to the admin, from the end user.