Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

@@ -2,9 +2,9 @@
/**
* @brief ACP Dashboard
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 2 July 2013
* @version SVN_VERSION_NUMBER
*/
@@ -30,6 +30,8 @@ class _dashboard extends \IPS\Dispatcher\Controller
*/
protected function manage()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'view_dashboard' );
\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('admin_dashboard.js', 'core') );
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'system/dashboard.css', 'core', 'admin' ) );
@@ -72,7 +74,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
$bulletins = \IPS\Http\Url::ips('bulletin')->request()->get()->decodeJson();
\IPS\Data\Store::i()->acpBulletin = array(
'time' => time(),
'content' => $bulletins
'content' => $bulletins ?: array()
);
}
catch( \RuntimeException $e )
@@ -84,21 +86,24 @@ class _dashboard extends \IPS\Dispatcher\Controller
{
$bulletins = $bulletin['content'];
}
foreach ( $bulletins as $k => $data )
if( !empty( $bulletins ) )
{
if ( count( $data['files'] ) )
foreach ( $bulletins as $k => $data )
{
$skip = TRUE;
foreach ( $data['files'] as $file )
if ( count( $data['files'] ) )
{
if ( filemtime( \IPS\ROOT_PATH . '/' . $file ) < $data['timestamp'] )
$skip = TRUE;
foreach ( $data['files'] as $file )
{
$skip = FALSE;
if ( filemtime( \IPS\ROOT_PATH . '/' . $file ) < $data['timestamp'] )
{
$skip = FALSE;
}
}
if ( $skip )
{
unset( $bulletins[ $k ] );
}
}
if ( $skip )
{
unset( $bulletins[ $k ] );
}
}
}
@@ -139,6 +144,61 @@ class _dashboard extends \IPS\Dispatcher\Controller
);
}
/* Check Tasks */
try
{
$task = \IPS\DateTime::ts( \IPS\Db::i()->select( 'next_run', 'core_tasks', array( 'enabled=?', TRUE ), 'next_run ASC' )->first() );
$today = new \IPS\DateTime;
$difference = $today->diff( $task )->h + ( $today->diff( $task )->days * 24 );
if ( $difference >= 36 )
{
if( \IPS\Settings::i()->task_use_cron == 'cron' )
{
$warnings[] = array(
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_broken' ),
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_cron_broken_desc' )
);
}
elseif( \IPS\Settings::i()->task_use_cron == 'web' )
{
$warnings[] = array(
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_broken' ),
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_web_broken_desc' )
);
}
else
{
$warnings[] = array(
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_broken' ),
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_not_enough_desc' )
);
}
}
}
catch ( \UnderflowException $e ) { }
if ( !\IPS\Settings::i()->site_online AND \IPS\Settings::i()->task_use_cron == 'normal' AND !\IPS\CIC )
{
$warnings[] = array(
'title' => \IPS\Member::loggedIn()->language()->addToStack('dasbhoard_tasks_site_offline'),
'description' => \IPS\Member::loggedIn()->language()->addToStack('dasbhoard_tasks_site_offline_desc')
);
}
/* If there have been more than 10 datastore failurs in the last hour, or if an instant test fails, show a message */
if( !\IPS\Data\Store::i()->test() OR \IPS\Db::i()->select( 'COUNT(*)', 'core_log', array( '`category`=? AND `time`>?', 'datastore', \IPS\DateTime::create()->sub( new \DateInterval( 'PT1H' ) )->getTimestamp() ) )->first() >= 10 )
{
/* Have we just recently updated the configuration? If so, ignore this warning for 24 hours */
if( \IPS\Settings::i()->last_data_store_update < \IPS\DateTime::create()->sub( new \DateInterval( 'PT24H' ) )->getTimestamp() )
{
$warnings[] = array(
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_datastore_broken' ),
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_datastore_broken_desc' )
);
}
}
/* Get new core update available data */
$update = \IPS\Application::load( 'core' )->availableUpgrade( TRUE );
@@ -171,8 +231,8 @@ class _dashboard extends \IPS\Dispatcher\Controller
if( !$toShow OR !isset( $toShow['main'] ) OR !isset( $toShow['side'] ) )
{
$toShow = array(
'main' => array( 'core_BackgroundQueue', 'core_Registrations' ),
'side' => array( 'core_AdminNotes', 'core_OnlineUsers' ),
'main' => array( 'core_AdminNotes', 'core_Registrations', 'core_AwaitingValidation', 'core_BackgroundQueue' ),
'side' => array( 'core_OnlineAdmins', 'core_FailedLogins', 'core_OnlineUsers' ),
);
$blocks[ \IPS\Member::loggedIn()->member_id ] = $toShow;