Server IP : 184.154.167.98 / Your IP : 3.14.130.58 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 : 8.2.26 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 /********************************************************************* ajax.upgrader.php AJAX interface for Upgrader Peter Rotich <peter@osticket.com> 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: **********************************************************************/ if(!defined('INCLUDE_DIR')) die('403'); require_once INCLUDE_DIR.'class.upgrader.php'; class UpgraderAjaxAPI extends AjaxController { function upgrade() { global $thisstaff, $ost; if(!$thisstaff or !$thisstaff->isAdmin() or !$ost) Http::response(403, 'Access Denied'); $upgrader = new Upgrader(TABLE_PREFIX, UPGRADE_DIR.'streams/'); if($upgrader->isAborted()) { Http::response(416, __("We have a problem ... wait a sec.")); exit; } if($upgrader->getTask() && $upgrader->doTask()) { //More pending tasks - doTasks returns the number of pending tasks Http::response(200, $upgrader->getNextAction()); exit; } elseif($ost->isUpgradePending()) { if($upgrader->isUpgradable()) { $version = $upgrader->getNextVersion(); if($upgrader->upgrade()) { //We're simply reporting progress here - call back will report next action' Http::response(200, sprintf(__("Upgraded to %s ... post-upgrade checks!"),$version)); exit; } } else { //Abort: Upgrade pending but NOT upgradable - invalid or wrong hash. $upgrader->abort(sprintf(__('Upgrade Failed: Invalid or wrong hash [%s]'),$ost->getDBSignature())); } } elseif(!$ost->isUpgradePending()) { $upgrader->setState('done'); session_write_close(); Http::response(201, __("We're done!")); exit; } if($upgrader->isAborted() || $upgrader->getErrors()) { Http::response(416, __("We have a problem ... wait a sec.")); exit; } Http::response(200, $upgrader->getNextAction()); } } ?>