Advertisement
Guest User

Untitled

a guest
Jul 13th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. #!/usr/local/bin/php
  2. <?php
  3. ini_set('memory_limit', '320M');
  4. define('INSTALLDIR', '/usr/local/www/scrubber/');
  5. define('PID', '/var/run/generatereport.pid');
  6. include_once INSTALLDIR . 'include/config.php';
  7. include_once INSTALLDIR . 'db.php';
  8. include_once INSTALLDIR . 'network.php';
  9. include_once INSTALLDIR . 'functions.php';
  10. include_once INSTALLDIR . '/lib/ProcessHandler.php';
  11. include_once INSTALLDIR . '/lib/LicenseChecks.php';
  12. include_once INSTALLDIR . '/cluster/ClusterTitan.php';
  13. include_once '/usr/local/bin/QuarantineReport.php';
  14. include_once 'Log.php';
  15. require 'Mail.php';
  16. require 'Mail/mime.php';
  17. $args = getopt('u:t:d');
  18. $debug = (isset($args['d']) ? 1 : 0);
  19. $conf = array();
  20. $log = Log::singleton('syslog', LOG_LOCAL0, 'generatereport', $conf);
  21.  
  22. if ($debug == 0) {
  23. $log->log('Start', LOG_INFO);
  24. } else {
  25. echo "Start\n";
  26. }
  27.  
  28. $qreport_contents = db_varget('qreport_contents', SPAM_BIT | VIRUS_BIT | BANNED_BIT);
  29. $license = new LicenseChecks('/usr/local/etc/scrubber/license.key');
  30.  
  31. if ($license->status == LICENSE_NOTEXISTS) {
  32. $log->log('Cannot locate license.', LOG_INFO);
  33. session_destroy();
  34.  
  35. exit(1);
  36. }
  37.  
  38. if ($license->status == LICENSE_VERIFIED_NOTOK) {
  39. $log->log('License corrupt.', LOG_INFO);
  40. session_destroy();
  41.  
  42. exit(1);
  43. }
  44.  
  45. if ($license->LicenseExpired()) {
  46. $expired = date('d/m/Y', $license->expiry_date);
  47. $log->log('License expired (' . $expired . ').', LOG_INFO);
  48. session_destroy();
  49.  
  50. exit(1);
  51. }
  52.  
  53. if ($license->LicenseViolated()) {
  54. $log->log('License usage violated.', LOG_INFO);
  55. session_destroy();
  56.  
  57. exit(1);
  58. }
  59.  
  60. $Cluster = new ClusterTitan($db);
  61.  
  62. if ($Cluster->is_cluster_mode()) {
  63. for ($i = 0; $i < 6; $i++) {
  64. unset($Cluster);
  65. $Cluster = new ClusterTitan($db);
  66.  
  67. if ($Cluster->is_master()) {
  68. unset($args);
  69.  
  70. for ($i = 1; $i < $argc; $i++) {
  71. $args .= $argv[$i] . ' ';
  72. }
  73. $cmd = '/usr/local/bin/stc-quarreport.php ' . $args;
  74. exec($cmd, $output, $retval);
  75.  
  76. break;
  77. }
  78.  
  79. sleep(60);
  80. }
  81. session_destroy();
  82.  
  83. exit($retval);
  84. }
  85.  
  86. if (isset($args['u'])) {
  87. $id = $args['u'];
  88. $type = '';
  89.  
  90. if (isset($args['t'])) {
  91. $type = $args['t'];
  92. }
  93.  
  94. $user = getSingleUser($id, $type);
  95. ...........................................................................
  96. .................................
  97. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement