Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -110,15 +110,6 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
/* Warnings */
|
||||
$warnings = array();
|
||||
|
||||
$dir = @dir( '/' );
|
||||
if ( $dir instanceof \Directory )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack('open_basedir_title'),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack('open_basedir_desc'),
|
||||
);
|
||||
}
|
||||
|
||||
$functionsToDisable = array( 'exec', 'system', 'passhtru', 'pcntl_exec', 'popen', 'proc_open', 'shell_exec' );
|
||||
$showingFunctionWarning = FALSE;
|
||||
foreach ( $functionsToDisable as $k => $function )
|
||||
@@ -135,21 +126,23 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if ( $showingFunctionWarning )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'disable_functions',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack('disable_functions_title'),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack('disable_functions_desc', FALSE, array( 'sprintf' => array( implode( ', ', $functionsToDisable ) ) ) ),
|
||||
);
|
||||
}
|
||||
|
||||
if ( !\IPS\IN_DEV and ini_get( 'display_errors' ) )
|
||||
if ( !\IPS\IN_DEV and ( (bool) ini_get( 'display_errors' ) ) !== FALSE AND ini_get( 'display_errors' ) !== 'Off' )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'display_errors',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack('display_errors_title'),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack('display_errors_desc'),
|
||||
'risk' => "medium",
|
||||
);
|
||||
}
|
||||
|
||||
$tasks = \IPS\Db::i()->select( '*', 'core_tasks', 'lock_count >= 3' );
|
||||
$tasks = \IPS\Db::i()->select( '*', 'core_tasks', 'lock_count >= 3 AND enabled=1' );
|
||||
$keys = array();
|
||||
foreach( $tasks as $task )
|
||||
{
|
||||
@@ -158,6 +151,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if ( !empty( $keys ) )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_tasks_broken',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_broken' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_broken_desc', TRUE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $keys ) ) ) )
|
||||
);
|
||||
@@ -166,6 +160,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if( isset( \IPS\Data\Store::i()->failedMailCount ) AND \IPS\Data\Store::i()->failedMailCount >= 3 )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_email_broken',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_email_broken' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_email_broken_desc', TRUE )
|
||||
);
|
||||
@@ -175,6 +170,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if ( $supportAccount->member_id )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_support_account',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_support_account' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_support_account_desc', TRUE, array( 'sprintf' => array( $supportAccount->acpUrl() ) ) )
|
||||
);
|
||||
@@ -217,6 +213,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if( !$inProgress )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'block_core_OrigTables',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack('block_core_OrigTables'),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack('orig_cleanup_suggested')
|
||||
);
|
||||
@@ -227,7 +224,10 @@ 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() );
|
||||
$task = \IPS\DateTime::ts( \IPS\Db::i()->select( 'next_run', 'core_tasks', array( 'core_tasks.enabled=1 AND (core_plugins.plugin_enabled=1 OR core_applications.app_enabled=1)' ), 'next_run ASC' )
|
||||
->join( 'core_applications', array( 'core_applications.app_directory=core_tasks.app' ) )
|
||||
->join( 'core_plugins', array( 'core_plugins.plugin_id=core_tasks.plugin' ) )
|
||||
->first() );
|
||||
$today = new \IPS\DateTime;
|
||||
$difference = $today->diff( $task )->h + ( $today->diff( $task )->days * 24 );
|
||||
|
||||
@@ -236,6 +236,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if( \IPS\Settings::i()->task_use_cron == 'cron' )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_tasksrun_broken',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasksrun_broken' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( \IPS\CIC ? 'dashboard_tasks_cron_broken_desc_cic' : 'dashboard_tasks_cron_broken_desc' )
|
||||
);
|
||||
@@ -243,6 +244,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
elseif( \IPS\Settings::i()->task_use_cron == 'web' )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_tasksrun_broken',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasksrun_broken' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_web_broken_desc' )
|
||||
);
|
||||
@@ -250,6 +252,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
else
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_tasksrun_broken',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasksrun_broken' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_tasks_not_enough_desc' )
|
||||
);
|
||||
@@ -261,12 +264,39 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if ( !\IPS\Settings::i()->site_online AND \IPS\Settings::i()->task_use_cron == 'normal' AND !\IPS\CIC )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dasbhoard_tasks_site_offline',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack('dasbhoard_tasks_site_offline'),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack('dasbhoard_tasks_site_offline_desc')
|
||||
);
|
||||
}
|
||||
|
||||
/* Check MySQL and PHP min versions */
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$mysqlVersion = \IPS\Db::i()->server_info;
|
||||
$requirements = json_decode( file_get_contents( \IPS\ROOT_PATH . '/applications/core/data/requirements.json' ), TRUE );
|
||||
|
||||
if ( version_compare( $phpVersion, $requirements['php']['recommended'] ) < 0 )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_recommended_php_version',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack('dashboard_recommended_php_version'),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_advice', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['recommended'] ) ) )
|
||||
);
|
||||
}
|
||||
|
||||
if ( version_compare( $mysqlVersion, $requirements['mysql']['recommended'] ) < 0 AND !mb_strpos( $mysqlVersion, "MariaDB" ) )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dasbhoard_required_mysql_version',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack('dasbhoard_required_mysql_version'),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_version_advice', FALSE, array( 'sprintf' => array( $mysqlVersion, $requirements['mysql']['recommended'] ) ) )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/* Don't do this for IN_DEV on localhost */
|
||||
//
|
||||
|
||||
/* If there have been more than 10 datastore failures 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 )
|
||||
@@ -275,6 +305,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if( \IPS\Settings::i()->last_data_store_update < \IPS\DateTime::create()->sub( new \DateInterval( 'PT24H' ) )->getTimestamp() )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_datastore_broken',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_datastore_broken' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_datastore_broken_desc' )
|
||||
);
|
||||
@@ -307,6 +338,7 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if ( isset( $cicEmails['status'] ) AND $cicEmails['status'] == 'BLOCKED' )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_cic_email_quota',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_cic_email_quota' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_cic_email_quota_desc' )
|
||||
);
|
||||
@@ -317,10 +349,21 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if ( \IPS\CACHE_METHOD AND \IPS\CACHE_METHOD != 'None' AND \IPS\Data\Cache::i() instanceof \IPS\Data\Cache\None )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'dashboard_invalid_cachesetup',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_invalid_cachesetup' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( 'dashboard_invalid_cachesetup_desc' )
|
||||
);
|
||||
}
|
||||
|
||||
/* Temporary thing for to show a warning if Facebook login is enabled but site doesn't use https */
|
||||
if ( \IPS\Login\Handler::findMethod( 'IPS\Login\Handler\OAuth2\Facebook' ) and mb_substr( \IPS\Settings::i()->base_url, 0, 8 ) !== 'https://' )
|
||||
{
|
||||
$warnings[] = array(
|
||||
'key' => 'facebook_https',
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( time() < mktime( 0, 0, 0, 10, 6, 2018 ) ? 'facebook_https_warning_title' : 'facebook_https_warning_title2' ),
|
||||
'description' => \IPS\Member::loggedIn()->language()->addToStack( \IPS\CIC ? 'facebook_https_warning_desc_cic' : 'facebook_https_warning_desc' )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/* Get new core update available data */
|
||||
@@ -351,6 +394,19 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
catch( \RuntimeException $e ){}
|
||||
}
|
||||
|
||||
/* Don't show warnings we've hidden */
|
||||
if ( isset( \IPS\Request::i()->cookie['acpWarnings_mute'] ) )
|
||||
{
|
||||
$keys = explode( ',', \IPS\Request::i()->cookie['acpWarnings_mute'] );
|
||||
foreach( $warnings as $index => $data )
|
||||
{
|
||||
if ( isset( $data['key'] ) and in_array( $data['key'], $keys ) )
|
||||
{
|
||||
unset( $warnings[ $index ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('dashboard');
|
||||
\IPS\Output::i()->customHeader = \IPS\Theme::i()->getTemplate( 'dashboard' )->dashboardHeader( $info, $blocks );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'dashboard' )->dashboard( $update, $features, $toShow, $blocks, $info, $bulletins, $warnings );
|
||||
@@ -390,8 +446,9 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
if( !$toShow OR !isset( $toShow['main'] ) OR !isset( $toShow['side'] ) )
|
||||
{
|
||||
$toShow = array(
|
||||
'main' => array( 'core_AdminNotes', 'core_Registrations', 'core_AwaitingValidation', 'core_BackgroundQueue' ),
|
||||
'side' => array( 'core_OnlineAdmins', 'core_FailedLogins', 'core_OnlineUsers' ),
|
||||
'main' => array( 'core_AdminNotes', 'core_Registrations', 'core_AwaitingValidation', 'core_BackgroundQueue' ),
|
||||
'side' => array( 'core_OnlineAdmins', 'core_FailedLogins', 'core_OnlineUsers' ),
|
||||
'collapsed' => array( 'core_BackgroundQueue' ),
|
||||
);
|
||||
|
||||
$blocks[ \IPS\Member::loggedIn()->member_id ] = $toShow;
|
||||
|
||||
Reference in new issue
Block a user