function end_caching($fp, $start = '') { if (!empty($fp)) { echo "\n\t\t\t<!-- this page was cached on " . date('r') . "-->"; if (!empty($start)) { echo "\n\t\t\t\t<!-- uncached page " . stop_timer($start) . " -->"; } // open the cache file for writing flock($fp, LOCK_UN); // unlock the file // save the contents of output buffer to the file fwrite($fp, ob_get_contents()); fclose($fp); ob_end_flush(); } }
function cancel() { global $uniq; $time = stop_timer(2); //global $sess, $mytrail; $time = stop_timer(2); page_close(); $time = stop_timer(2); Header("Location: " . $GLOBALS['sess']->url(build_good_url($GLOBALS['mytrail']['path']))); exit; }
public function download() { $log =& singleton::get(__NAMESPACE__ . '\\log'); $config =& singleton::get(__NAMESPACE__ . '\\config'); $pop_accounts =& singleton::get(__NAMESPACE__ . '\\pop_accounts'); $accounts = $pop_accounts->get(array('enabled' => 1)); if (count($accounts) > 0) { include LIB . '/pop3/mime_parser.php'; include LIB . '/pop3/rfc822_addresses.php'; include LIB . '/pop3/pop3.php'; include LIB . '/pop3/sasl.php'; if (in_array('pop3', stream_get_wrappers())) { stream_wrapper_unregister('pop3'); } stream_wrapper_register('pop3', 'pop3_stream'); /* Register the pop3 stream handler class */ $pop3 = new \pop3_class(); $log_array['event_severity'] = 'notice'; $log_array['event_number'] = E_USER_NOTICE; $log_array['event_description'] = 'POP3 Start'; $log_array['event_file'] = __FILE__; $log_array['event_file_line'] = __LINE__; $log_array['event_type'] = 'download'; $log_array['event_source'] = 'pop_system'; $log_array['event_version'] = '1'; $log_array['log_backtrace'] = false; //$log->add($log_array); $storage_path = $config->get('storage_path'); //loop through each enabled email account and download email foreach ($accounts as $account) { $array = array(); $array['obj'] = $pop3; $array['hostname'] = $account['hostname']; $array['port'] = $account['port']; $array['tls'] = $account['tls']; $array['username'] = $account['username']; $array['password'] = decode($account['password']); $array['priority_id'] = $account['priority_id']; $array['department_id'] = $account['department_id']; $array['leave_messages'] = $account['leave_messages']; $array['id'] = $account['id']; if ($config->get('storage_enabled') && !empty($storage_path) && $account['download_files']) { $array['download_files'] = 1; } else { $array['download_files'] = 0; } if ($config->get('html_enabled')) { $array['html_enabled'] = 1; } else { $array['html_enabled'] = 0; } $this->download_email($array); unset($array); } $log_array['event_severity'] = 'notice'; $log_array['event_number'] = E_USER_NOTICE; $log_array['event_description'] = 'POP3 Stop Time: ' . stop_timer(); $log_array['event_file'] = __FILE__; $log_array['event_file_line'] = __LINE__; $log_array['event_type'] = 'download'; $log_array['event_source'] = 'pop_system'; $log_array['event_version'] = '1'; $log_array['log_backtrace'] = false; //$log->add($log_array); } }