Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -2,17 +2,17 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Dashboard Notifications
|
||||
* Last Updated: $Date
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 6980 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 9551 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -35,6 +35,7 @@ class dashboardNotifications__core
|
||||
public $lang;
|
||||
public $cache;
|
||||
public $caches;
|
||||
public $DB;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -42,6 +43,7 @@ class dashboardNotifications__core
|
||||
$this->lang = ipsRegistry::getClass('class_localization');
|
||||
$this->caches =& ipsRegistry::cache()->fetchCaches();
|
||||
$this->cache = ipsRegistry::cache();
|
||||
$this->DB = ipsRegistry::DB();
|
||||
}
|
||||
|
||||
public function get()
|
||||
@@ -49,15 +51,117 @@ 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
|
||||
{
|
||||
/* We need a classFileManagement object */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$classFileManagement = new $classToLoad();
|
||||
|
||||
/* Try to automatically update if expired */
|
||||
$licenseData = $this->cache->getCache( 'licenseData' );
|
||||
|
||||
if( ! $licenseData || ( $licenseData['key']['_expires'] != 9999999999 AND $licenseData['key']['_expires'] < IPS_UNIX_TIME_NOW ) )
|
||||
{
|
||||
/* Query the api */
|
||||
$response = $classFileManagement->getFileContents( "http://myipb.in/license.php?lk={$this->settings['ipb_reg_number']}&url={$this->settings['board_url']}&flush=1" );
|
||||
|
||||
/* Get License Data */
|
||||
$licenseData = json_decode( $response, true );
|
||||
|
||||
/* Copyright Removal? */
|
||||
if ( $licenseData['cr'] )
|
||||
{
|
||||
IPSLib::updateSettings( array( 'ipb_copy_number' => $licenseData['cr'], 'ips_cp_purchase' => 1 ) );
|
||||
}
|
||||
elseif ( $this->settings['ips_cp_purchase'] )
|
||||
{
|
||||
IPSLib::updateSettings( array( 'ips_cp_purchase' => 0 ) );
|
||||
}
|
||||
|
||||
/* Save to cache */
|
||||
$licenseData['_cached_date'] = time();
|
||||
$licenseData['key']['_expires'] = $licenseData['key']['_expires'] ? $licenseData['key']['_expires'] : 9999999999;
|
||||
$licenseData['key']['expires'] = $licenseData['key']['expires'] ? $licenseData['key']['expires'] : 9999999999;
|
||||
|
||||
$this->cache->setCache( 'licenseData', $licenseData, array( 'array' => 1 ) );
|
||||
|
||||
}
|
||||
|
||||
/* Query the api */
|
||||
$response = $classFileManagement->getFileContents("http://myipb.in/license.php?api=checkService&service=ipb&lk={$this->settings['ipb_reg_number']}&domain={$this->settings['board_url']}" );
|
||||
|
||||
/* Get License Data */
|
||||
$response = json_decode( $response, true );
|
||||
|
||||
/* Is the Spam Service Working? */
|
||||
if ( $this->settings['spam_service_enabled'] )
|
||||
{
|
||||
//$lastLog = $this->DB->buildAndFetch( array( 'select' => 'log_code', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 1 ) ); // Order on ID since log_date has no index
|
||||
|
||||
//if ( $lastLog['log_code'] === '0' )
|
||||
|
||||
/* 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 ( file_exists( IPS_CACHE_PATH . 'cache/furlCache.php' ) )
|
||||
if ( is_file( IPS_CACHE_PATH . 'cache/furlCache.php' ) )
|
||||
{
|
||||
$mtime = intval( @filemtime( IPS_CACHE_PATH . 'cache/furlCache.php' ) );
|
||||
|
||||
/* Check mtimes on extensions.. */
|
||||
foreach( ipsRegistry::$applications as $app_dir => $application )
|
||||
{
|
||||
if ( file_exists( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) )
|
||||
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) )
|
||||
{
|
||||
$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/furlTemplates.php' ) );
|
||||
|
||||
@@ -69,30 +173,46 @@ class dashboardNotifications__core
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Sphinx cache OOD? */
|
||||
if ( $this->settings['search_method'] == 'sphinx' )
|
||||
{
|
||||
$mtime = intval( $this->cache->getCache('sphinx_config') );
|
||||
|
||||
/* Check mtimes on extensions.. */
|
||||
foreach( ipsRegistry::$applications as $app_dir => $application )
|
||||
{
|
||||
if ( is_file( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) )
|
||||
{
|
||||
$_mtime = intval( @filemtime( IPSLib::getAppDir( $app_dir ) . '/extensions/sphinxTemplate.php' ) );
|
||||
|
||||
if ( !$mtime OR $_mtime > $mtime )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['sphinxconfig_outofdate'], $this->lang->words['sphinxconfig_outofdate_desc'] . ' ' . "<a href='" . $this->settings['base_url'] . "app=core&module=applications&section=applications&do=applications_overview'>{$this->lang->words['rebuild_sphinx_config']}</a>" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Minify on but /cache/tmp not writeable? */
|
||||
if ( isset( $this->settings['_use_minify'] ) AND $this->settings['_use_minify'] )
|
||||
if ( !empty( $this->settings['_use_minify'] ) )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable'] );
|
||||
}
|
||||
|
||||
/* Installer Check */
|
||||
if( @file_exists( IPS_ROOT_PATH . 'install/index.php' ) )
|
||||
if( @is_file( IPS_ROOT_PATH . 'install/index.php' ) )
|
||||
{
|
||||
if ( ! @file_exists( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) )
|
||||
if ( ! @is_file( DOC_IPS_ROOT_PATH . 'cache/installer_lock.php' ) )
|
||||
{
|
||||
$this->lang->words['cp_unlocked_warning'] = sprintf( $this->lang->words['cp_unlocked_warning'], CP_DIRECTORY );
|
||||
$entries[] = array( $this->lang->words['cp_unlockedinstaller'], $this->lang->words['cp_unlocked_warning'] );
|
||||
}
|
||||
}
|
||||
else if( @is_dir( IPS_ROOT_PATH . 'applications_addon/ips/convert/' ) and !@file_exists( DOC_IPS_ROOT_PATH . 'cache/converter_lock.php' ) and $this->caches['app_cache']['convert'] )
|
||||
{
|
||||
$this->lang->words['cp_warning_converter'] = sprintf( $this->lang->words['cp_warning_converter'], $this->settings['_base_url'] );
|
||||
$entries[] = array( $this->lang->words['cp_unlocked_converter'], $this->lang->words['cp_warning_converter'] );
|
||||
}
|
||||
|
||||
/* Unfinished Upgrade */
|
||||
require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );
|
||||
require_once( IPS_ROOT_PATH . '/setup/sources/base/setup.php' );/*noLibHook*/
|
||||
$versions = IPSSetUp::fetchAppVersionNumbers( 'core' );
|
||||
|
||||
if( $versions['current'][0] != $versions['latest'][0] )
|
||||
@@ -108,16 +228,22 @@ class dashboardNotifications__core
|
||||
$entries[] = array( sprintf( $this->lang->words['cp_yourphpversion'], PHP_VERSION ), $this->lang->words['cp_php_warning'] );
|
||||
}
|
||||
|
||||
/* Outgoing email address specified */
|
||||
if ( !$this->settings['email_out'] OR !$this->settings['email_in'] )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['cp_missingemail'], "{$this->lang->words['cp_missingemail1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=settings&section=settings&do=findsetting&key=email'>{$this->lang->words['cp_missingemail2']}</a>" );
|
||||
}
|
||||
|
||||
/* Board Offline Check */
|
||||
if ( $this->settings['board_offline'] )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=tools&section=settings&do=findsetting&key=boardoffline'>{$this->lang->words['cp_boardoffline2']}</a>" );
|
||||
$entries[] = array( $this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=settings&section=settings&do=findsetting&key=boardoffline'>{$this->lang->words['cp_boardoffline2']}</a>" );
|
||||
}
|
||||
|
||||
/* Fulltext Check */
|
||||
if( $this->settings['search_method'] == 'traditional' AND !$this->settings['use_fulltext'] AND !$this->settings['hide_ftext_note'] )
|
||||
{
|
||||
$entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=tools&section=settings&do=findsetting&key=searchsetup'>{$this->lang->words['fulltext_find']}</a>" );
|
||||
$entries[] = array( $this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&module=settings&section=settings&do=findsetting&key=searchsetup'>{$this->lang->words['fulltext_find']}</a>" );
|
||||
}
|
||||
|
||||
/* Make sure the profile directory is writable */
|
||||
@@ -176,7 +302,7 @@ class dashboardNotifications__core
|
||||
}
|
||||
|
||||
/* SQL error check */
|
||||
if ( file_exists( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) )
|
||||
/*if ( is_file( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' ) )
|
||||
{
|
||||
$unix = @filemtime( IPS_CACHE_PATH . 'cache/sql_error_latest.cgi' );
|
||||
|
||||
@@ -187,10 +313,10 @@ class dashboardNotifications__core
|
||||
|
||||
if ( $mtime == $now )
|
||||
{
|
||||
/* Display a message */
|
||||
// Display a message
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
return $entries;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user