Version 3.4.8
This commit is contained in:
1 parent
b45ea0dffb
commit
c603205a25
1398 files changed
+36675
-31023
No files matched your search
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* IP.Board v3.4.8
|
||||
* Dashboard Notifications
|
||||
* Last Updated: $Date
|
||||
*
|
||||
@@ -51,6 +51,94 @@ class dashboardNotifications__core
|
||||
/* INIT */
|
||||
$entries = array();
|
||||
|
||||
if( ! $this->settings['ipb_reg_number'] )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['lc_title_nokey'], sprintf( $this->lang->words['lc_msg_nokey'], "{$this->settings['base_url']}module=tools&section=licensekey" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Is the Spam Service Working? */
|
||||
if ( $this->settings['spam_service_enabled'] )
|
||||
{
|
||||
$GOT_SPAM_ERROR = false;
|
||||
|
||||
/* Are we entitled to it? */
|
||||
$licenseData = $this->cache->getCache( 'licenseData' );
|
||||
|
||||
if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
|
||||
{
|
||||
foreach ( $licenseData['ipbMain'] as $data )
|
||||
{
|
||||
if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] != 'Ok' )
|
||||
{
|
||||
$disableLink = $this->settings['base_url'] . "app=core&module=settings&section=settings&do=findsetting&key=spamservice";
|
||||
|
||||
if ( is_numeric( $data['_expires'] ) && time() > $data['_expires'] )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_expired'], $disableLink ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_unavailable'], $disableLink ) );
|
||||
}
|
||||
|
||||
$GOT_SPAM_ERROR = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $GOT_SPAM_ERROR )
|
||||
{
|
||||
/* Get last 5 logs, and if all 5 are errors, show message */
|
||||
$_errors = 0;
|
||||
$_entries = 0;
|
||||
$_lastError = '';
|
||||
|
||||
$this->DB->build( array( 'select' => 'log_code, log_msg', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 5 ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while( $_r = $this->DB->fetch() )
|
||||
{
|
||||
$_entries++;
|
||||
|
||||
if( $_r['log_code'] === '0' )
|
||||
{
|
||||
$_errors++;
|
||||
|
||||
if( !$_lastError )
|
||||
{
|
||||
$_lastError = $_r['log_msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $_entries > 0 && $_errors == $_entries )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_error_msg'], $_lastError ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
/* If it's disabled, are we entitiled to it? */
|
||||
else
|
||||
{
|
||||
$licenseData = $this->cache->getCache( 'licenseData' );
|
||||
|
||||
if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
|
||||
{
|
||||
foreach ( $licenseData['ipbMain'] as $data )
|
||||
{
|
||||
if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] == 'Ok' )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['spam_service_disabled'], $this->lang->words['spam_service_disabled_msg'] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* FURL cache OOD? */
|
||||
if ( is_file( FURL_CACHE_PATH ) )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user