Guest User

dashboardNotifications.php

a guest
May 11th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. /* if( ! $this->settings['ipb_reg_number'] )
  2. {
  3. $entries[] = array( $this->lang->words['lc_title_nokey'], sprintf( $this->lang->words['lc_msg_nokey'], "{$this->settings['base_url']}module=tools&section=licensekey" ) );
  4. }
  5. else
  6. {
  7. /* Is the Spam Service Working?
  8. if ( $this->settings['spam_service_enabled'] )
  9. {
  10. $GOT_SPAM_ERROR = false;
  11. /* Are we entitled to it?
  12. $licenseData = $this->cache->getCache( 'licenseData' );
  13. if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
  14. {
  15. foreach ( $licenseData['ipbMain'] as $data )
  16. {
  17. if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] != 'Ok' )
  18. {
  19. $disableLink = $this->settings['base_url'] . "app=core&module=settings&section=settings&do=findsetting&key=spamservice";
  20. if ( is_numeric( $data['_expires'] ) && time() > $data['_expires'] )
  21. {
  22. $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_expired'], $disableLink ) );
  23. }
  24. else
  25. {
  26. $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_unavailable'], $disableLink ) );
  27. }
  28. $GOT_SPAM_ERROR = true;
  29. break;
  30. }
  31. }
  32. }
  33. if ( ! $GOT_SPAM_ERROR )
  34. {
  35. /* Get last 5 logs, and if all 5 are errors, show message
  36. $_errors = 0;
  37. $_entries = 0;
  38. $_lastError = '';
  39. $this->DB->build( array( 'select' => 'log_code, log_msg', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 5 ) );
  40. $this->DB->execute();
  41. while( $_r = $this->DB->fetch() )
  42. {
  43. $_entries++;
  44. if( $_r['log_code'] === '0' )
  45. {
  46. $_errors++;
  47. if( !$_lastError )
  48. {
  49. $_lastError = $_r['log_msg'];
  50. }
  51. }
  52. }
  53. if( $_entries > 0 && $_errors == $_entries )
  54. {
  55. $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_error_msg'], $_lastError ) );
  56. }
  57. }
  58. }
  59. /* If it's disabled, are we entitiled to it?
  60. else
  61. {
  62. $licenseData = $this->cache->getCache( 'licenseData' );
  63. if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
  64. {
  65. foreach ( $licenseData['ipbMain'] as $data )
  66. {
  67. if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] == 'Ok' )
  68. {
  69. $entries[] = array( $this->lang->words['spam_service_disabled'], $this->lang->words['spam_service_disabled_msg'] );
  70. break;
  71. }
  72. }
  73. }
  74. }
  75. }
  76. */
Advertisement
Add Comment
Please, Sign In to add comment