function pageLink($page, $params = array()) { global $adminPath; $params['a'] = $page; return htmlentities(tokenUrl($adminPath, $params)); }
onTicketUpdate($DATA); return $DATA; } // fetch the ticket id and check for permissions $DATA = false; $id =& $_REQUEST['id']; if (empty($id) || !isTicketId($id)) { $id = false; } else { $sql = "SELECT * FROM ticket WHERE id = " . $db->quote($id); $DATA = $db->query($sql)->fetch(); if ($DATA === false || isTicketExpired($DATA) || !$auth["admin"] && $DATA["user_id"] != $auth["id"]) { $DATA = false; } } // handle update if ($DATA) { if (validateParams($ticketEditParams, $_POST)) { // if update succeeds, return to listings if (handleUpdate($id)) { $DATA = false; } } } // resulting page $src = array_key_exists(@$_REQUEST['src'], $pages) ? $_REQUEST['src'] : 'tlist'; if ($DATA === false) { header("Location: " . tokenUrl($adminPath, array('a' => $src))); } else { include "edittickets.php"; }