Server IP : 184.154.167.98 / Your IP : 3.145.85.233 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/puertode/public_html/mesa/include/ |
Upload File : |
<?php /********************************************************************* class.ajax.php AjaxController class that is an extension of the ApiController class. It will be used to provide functionality common to all Ajax API calls Jared Hancock Copyright (c) 2006-2013 osTicket http://www.osticket.com Released under the GNU General Public License WITHOUT ANY WARRANTY. See LICENSE.TXT for details. vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require_once (INCLUDE_DIR.'class.api.php'); /** * AjaxController Class * A simple extension of the ApiController class that will assist in * providing functionality common to all Ajax call controllers. Any Ajax * call controller should inherit from this class in order to maintain * consistency. */ class AjaxController extends ApiController { function staffOnly() { global $thisstaff; if (!$thisstaff || !$thisstaff->isValid()) { $this->exerr(401, sprintf('%s (%s)', __('Access Denied'), $_SERVER['REMOTE_ADDR'])); } return true; } /** * Convert a PHP array into a JSON-encoded string */ function json_encode($what) { return Format::json_encode($what); } function encode($what) { return $this->json_encode($what); } function get($var, $default=null) { return $_GET[$var] ?: $default; } }