Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/php
- <?php
- ini_set('memory_limit', '320M');
- define('INSTALLDIR', '/usr/local/www/scrubber/');
- define('PID', '/var/run/generatereport.pid');
- include_once INSTALLDIR . 'include/config.php';
- include_once INSTALLDIR . 'db.php';
- include_once INSTALLDIR . 'network.php';
- include_once INSTALLDIR . 'functions.php';
- include_once INSTALLDIR . '/lib/ProcessHandler.php';
- include_once INSTALLDIR . '/lib/LicenseChecks.php';
- include_once INSTALLDIR . '/cluster/ClusterTitan.php';
- include_once '/usr/local/bin/QuarantineReport.php';
- include_once 'Log.php';
- require 'Mail.php';
- require 'Mail/mime.php';
- $args = getopt('u:t:d');
- $debug = (isset($args['d']) ? 1 : 0);
- $conf = array();
- $log = Log::singleton('syslog', LOG_LOCAL0, 'generatereport', $conf);
- if ($debug == 0) {
- $log->log('Start', LOG_INFO);
- } else {
- echo "Start\n";
- }
- $qreport_contents = db_varget('qreport_contents', SPAM_BIT | VIRUS_BIT | BANNED_BIT);
- $license = new LicenseChecks('/usr/local/etc/scrubber/license.key');
- if ($license->status == LICENSE_NOTEXISTS) {
- $log->log('Cannot locate license.', LOG_INFO);
- session_destroy();
- exit(1);
- }
- if ($license->status == LICENSE_VERIFIED_NOTOK) {
- $log->log('License corrupt.', LOG_INFO);
- session_destroy();
- exit(1);
- }
- if ($license->LicenseExpired()) {
- $expired = date('d/m/Y', $license->expiry_date);
- $log->log('License expired (' . $expired . ').', LOG_INFO);
- session_destroy();
- exit(1);
- }
- if ($license->LicenseViolated()) {
- $log->log('License usage violated.', LOG_INFO);
- session_destroy();
- exit(1);
- }
- $Cluster = new ClusterTitan($db);
- if ($Cluster->is_cluster_mode()) {
- for ($i = 0; $i < 6; $i++) {
- unset($Cluster);
- $Cluster = new ClusterTitan($db);
- if ($Cluster->is_master()) {
- unset($args);
- for ($i = 1; $i < $argc; $i++) {
- $args .= $argv[$i] . ' ';
- }
- $cmd = '/usr/local/bin/stc-quarreport.php ' . $args;
- exec($cmd, $output, $retval);
- break;
- }
- sleep(60);
- }
- session_destroy();
- exit($retval);
- }
- if (isset($args['u'])) {
- $id = $args['u'];
- $type = '';
- if (isset($args['t'])) {
- $type = $args['t'];
- }
- $user = getSingleUser($id, $type);
- ...........................................................................
- .................................
- ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement