Location: PHPKode > scripts > Support Tickets Center > zingiri-tickets/osticket/upload/scp/autocron.php

    Auto-cron handle.
    File requested as 1X1 image on the footer of every staff's page

    Peter Rotich <hide@address.com>
    Copyright (c)  2006-2010 osTicket

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
    $Id: $
ignore_user_abort(1);//Leave me a lone bro!
@set_time_limit(0); //useless when safe_mode is on
$data=sprintf ("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%",
header('Content-type:  image/gif');
header('Cache-Control: no-cache, must-revalidate');
header("Content-Length: $datasize");
header('Connection: Close');
print $data;

ob_start(); //Keep the image output clean. Hide our dirt.
//TODO: Make cron DB based to allow for better time limits. Direct calls for now sucks big time.
//We DON'T want to spawn cron on every page load...we record the lastcroncall on the session per user
if($sec>180): //user can call cron once every 3 minutes.
Cron::TicketMonitor(); //Age tickets: We're going to age tickets ever regardless of cron settings. 
if($cfg && $cfg->enableAutoCron()){ //ONLY fetch tickets if autocron is enabled!
    Cron::MailFetcher();  //Fetch mail.
    Sys::log(LOG_DEBUG,'Autocron','cron job executed ['.$thisuser->getUserName().']');
$output = ob_get_contents();
Return current item: Support Tickets Center