Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -253,7 +253,7 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function guideSearch()
|
||||
{
|
||||
\IPS\Output::i()->json( array() );
|
||||
\IPS\Output::i()->json( $guides );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,7 +308,14 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
switch( $k )
|
||||
{
|
||||
case 'php':
|
||||
$requirements['list'][ $k ]['detail'] = \IPS\Member::loggedIn()->language()->addToStack( 'health_check_update_recommended' );
|
||||
if( $v['downgrade'] === TRUE )
|
||||
{
|
||||
$requirements['list'][ $k ]['detail'] = \IPS\Member::loggedIn()->language()->addToStack( 'health_check_downgrade_recommended' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$requirements['list'][ $k ]['detail'] = \IPS\Member::loggedIn()->language()->addToStack( 'health_check_update_recommended' );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'curl':
|
||||
@@ -479,7 +486,7 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
/**
|
||||
* Get block: Invision Community
|
||||
*
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
protected function _showBlockVersion()
|
||||
{
|
||||
@@ -531,19 +538,23 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
}
|
||||
|
||||
/* Run MD5 check */
|
||||
$modifiedFiles = $this->_md5Checker( (bool) \IPS\Request::i()->fix );
|
||||
|
||||
if( $modifiedFiles )
|
||||
/* V5 */
|
||||
$v5Actions = ( new \IPS\core\modules\admin\support\v5 )->v5Actions();
|
||||
foreach( $v5Actions as $action )
|
||||
{
|
||||
$requirements['failures']++;
|
||||
$requirements['list'][] = array(
|
||||
'critical' => TRUE,
|
||||
'advice' => FALSE,
|
||||
'success' => FALSE,
|
||||
'link' => \IPS\Http\Url::internal( "app=core&module=support&controller=support&do=getBlock&block=version&fix=1" ),
|
||||
'detail' => \IPS\Member::loggedIn()->language()->addToStack('md5_check_fail')
|
||||
);
|
||||
if( $action === FALSE or \is_array( $action ) AND count( $action ) )
|
||||
{
|
||||
$requirements['advice']++;
|
||||
$requirements['list'][] = [
|
||||
'critical' => FALSE,
|
||||
'advice' => TRUE,
|
||||
'success' => FALSE,
|
||||
'button' => array( 'lang' => 'health_info', 'href' => \IPS\Http\Url::internal( 'app=core&module=support&controller=v5' ), 'css' => 'ipsButton_intermediate' ),
|
||||
'link' => \IPS\Http\Url::internal( "app=core&module=support&controller=v5" ),
|
||||
'detail' => \IPS\Member::loggedIn()->language()->addToStack('health_v5_upgrade_attention')
|
||||
];
|
||||
break; # At least one thing needs attention
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
@@ -852,6 +863,7 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
'success' => FALSE,
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=support&controller=redis' ),
|
||||
'detail' => $detail,
|
||||
'button' => array( 'lang' => 'health_view_redis_config' ),
|
||||
'dialogTitle' => 'health__more_information',
|
||||
);
|
||||
}
|
||||
@@ -1131,6 +1143,7 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
'advice' => FALSE,
|
||||
'success' => FALSE,
|
||||
'link' => NULL,
|
||||
'downgrade' => NULL,
|
||||
'detail' => $requirement['message']
|
||||
);
|
||||
|
||||
@@ -1154,6 +1167,7 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
'advice' => TRUE,
|
||||
'success' => FALSE,
|
||||
'link' => NULL,
|
||||
'downgrade' => $requirements['requirements'][ $category ]['version']['downgrade'] ?? NULL,
|
||||
'detail' => $requirement
|
||||
);
|
||||
}
|
||||
@@ -1848,17 +1862,6 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \IPS\Output::i()->output ), 200, 'text/html' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Run MD5 checker
|
||||
*
|
||||
* @param bool $fix Fix the issue instead of returning the count
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _md5Checker( $fix = FALSE )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a count of third party apps and plugins
|
||||
*
|
||||
@@ -1908,37 +1911,22 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
/**
|
||||
* Get third-party applications
|
||||
*
|
||||
* @param bool $separateMarketplace If TRUE, will separate ones installed from the marketplace and custom ones
|
||||
* @return array
|
||||
*/
|
||||
protected function _thirdPartyApps( $separateMarketplace = FALSE )
|
||||
protected function _thirdPartyApps()
|
||||
{
|
||||
if ( \IPS\NO_WRITES )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$apps = $separateMarketplace ? [ 'marketplace' => [], 'custom' => [] ] : [];
|
||||
$apps = [];
|
||||
|
||||
foreach ( \IPS\Application::applications() as $app )
|
||||
{
|
||||
if ( $app->enabled and !\in_array( $app->directory, \IPS\IPS::$ipsApps ) )
|
||||
{
|
||||
if ( $separateMarketplace )
|
||||
{
|
||||
if ( $app->marketplace_id )
|
||||
{
|
||||
$apps['marketplace'][] = $app;
|
||||
}
|
||||
else
|
||||
{
|
||||
$apps['custom'][] = $app;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$apps[] = $app;
|
||||
}
|
||||
$apps[] = $app;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1948,37 +1936,22 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
/**
|
||||
* Get third-party plugins
|
||||
*
|
||||
* @param bool $separateMarketplace If TRUE, will separate ones installed from the marketplace and custom ones
|
||||
* @return array
|
||||
*/
|
||||
protected function _thirdPartyPlugins( $separateMarketplace = FALSE )
|
||||
protected function _thirdPartyPlugins()
|
||||
{
|
||||
if ( \IPS\NO_WRITES )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$plugins = $separateMarketplace ? [ 'marketplace' => [], 'custom' => [] ] : [];
|
||||
$plugins = [];
|
||||
|
||||
foreach ( \IPS\Plugin::plugins() as $plugin )
|
||||
{
|
||||
if ( $plugin->enabled )
|
||||
{
|
||||
if ( $separateMarketplace )
|
||||
{
|
||||
if ( $plugin->marketplace_id )
|
||||
{
|
||||
$plugins['marketplace'][] = $plugin;
|
||||
}
|
||||
else
|
||||
{
|
||||
$plugins['custom'][] = $plugin;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$plugins[] = $plugin;
|
||||
}
|
||||
$plugins[] = $plugin;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ class _systemLogs extends \IPS\Dispatcher\Controller
|
||||
protected function deleteAll()
|
||||
{
|
||||
/* Delete */
|
||||
\IPS\Db::i()->query( "TRUNCATE core_log" );
|
||||
\IPS\Db::i()->query( "TRUNCATE " . \IPS\Settings::i()->sql_tbl_prefix . "core_log" );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=support&controller=systemLogs' ), 'deleted' );
|
||||
}
|
||||
|
||||
@@ -134,7 +134,8 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
|
||||
try
|
||||
{
|
||||
$app = \IPS\Application::load( $appName );
|
||||
$schema = json_decode( file_get_contents( \IPS\ROOT_PATH . "/applications/{$app->directory}/data/schema.json" ), TRUE );
|
||||
$schemaRoot = \in_array( $app->directory, \IPS\IPS::$ipsApps ) ? \IPS\ROOT_PATH : \IPS\SITE_FILES_PATH;
|
||||
$schema = json_decode( file_get_contents( $schemaRoot . "/applications/{$app->directory}/data/schema.json" ), TRUE );
|
||||
if ( !array_key_exists( $table, $schema ) )
|
||||
{
|
||||
/* Make a special exception for CMS database tables */
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief v5
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
|
||||
* @since 19 Sep 2024
|
||||
*/
|
||||
|
||||
namespace IPS\core\modules\admin\support;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use IPS\Application;
|
||||
use IPS\Db;
|
||||
use IPS\Http\Url;
|
||||
use IPS\Login;
|
||||
use IPS\Member;
|
||||
use IPS\Output;
|
||||
use IPS\Settings;
|
||||
use IPS\Theme;
|
||||
use function count;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* v5
|
||||
*/
|
||||
class _v5 extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
public static bool $csrfProtected = true;
|
||||
|
||||
/**
|
||||
* ...
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$actions = $this->v5Actions();
|
||||
|
||||
Output::i()->cssFiles = array_merge( Output::i()->cssFiles, Theme::i()->css( 'support/dashboard.css', 'core', 'admin' ) );
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack( 'prepare_v5_title' );
|
||||
Output::i()->output = Theme::i()->getTemplate( 'support' )->v5( ...$actions );
|
||||
}
|
||||
|
||||
public function v5actions()
|
||||
{
|
||||
if( \IPS\CIC )
|
||||
{
|
||||
$phpCheck = true;
|
||||
$mySqlCheck = true;
|
||||
$innoDb = true;
|
||||
$elasticsearch = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Check PHP */
|
||||
$phpCheck = ( version_compare( PHP_VERSION, "8.1.0" ) >= 0 );
|
||||
|
||||
/* Check MySQL */
|
||||
$mySqlVersion = Db::i()->server_info;
|
||||
$mySqlCheck = ( version_compare( $mySqlVersion, "8.0.13" ) >=0 );
|
||||
|
||||
/* Check InnoDb */
|
||||
$innoDb = !count( iterator_to_array( Db::i()->query( "SHOW TABLE STATUS WHERE Engine!='InnoDB'" ) ) );
|
||||
|
||||
/* Are we using elasticsearch */
|
||||
$elasticsearch = ( \IPS\Settings::i()->search_method == 'elastic' AND \IPS\Settings::i()->search_elastic_server );
|
||||
}
|
||||
|
||||
Output::i()->sidebar['actions']['deprecations'] = array(
|
||||
'icon' => 'question-circle',
|
||||
'title' => 'deprecation_tracker',
|
||||
'link' => Url::ips( 'docs/deprecation_tracker' ),
|
||||
'target' => '_blank'
|
||||
);
|
||||
|
||||
$deprecations = [];
|
||||
|
||||
$status = (bool) Db::i()->select( 'count(*)', 'core_member_status_updates' )->first();
|
||||
if( $status )
|
||||
{
|
||||
$deprecations['status'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_status' );
|
||||
}
|
||||
|
||||
$login = (bool) Db::i()->select( 'count(*)', 'core_login_methods', [
|
||||
[ 'login_enabled=?', 1 ],
|
||||
[ Db::i()->in( 'login_classname', [
|
||||
'IPS\Login\Handler\Standard',
|
||||
'IPS\Login\Handler\OAuth2\Apple',
|
||||
'IPS\Login\Handler\OAuth2\Facebook',
|
||||
'IPS\Login\Handler\OAuth2\Google',
|
||||
'IPS\Login\Handler\OAuth2\LinkedIn',
|
||||
'IPS\Login\Handler\OAuth2\Microsoft',
|
||||
'IPS\Login\Handler\OAuth1\Twitter',
|
||||
'IPS\Login\Handler\OAuth2\Invision',
|
||||
'IPS\Login\Handler\OAuth2\Wordpress',
|
||||
'IPS\Login\Handler\OAuth2\Custom',
|
||||
'IPS\Login\Handler\ExternalDatabase',
|
||||
'IPS\Login\Handler\LDAP',
|
||||
'IPS\convert\Login'
|
||||
], true ) ]
|
||||
] )->first();
|
||||
if( $login )
|
||||
{
|
||||
$deprecations['login'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_login' );
|
||||
}
|
||||
|
||||
$login = new Login;
|
||||
if( $login->authType() & Login::AUTH_TYPE_USERNAME )
|
||||
{
|
||||
$deprecations['display_names'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_display_name_login' );
|
||||
}
|
||||
|
||||
if( \IPS\CP_DIRECTORY != 'admin' )
|
||||
{
|
||||
$deprecations['cp_directory'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_cp_directory' );
|
||||
}
|
||||
|
||||
if( Settings::i()->tags_open_system )
|
||||
{
|
||||
$deprecations['open_tagging'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_open_tagging' );
|
||||
}
|
||||
|
||||
if( (bool) Db::i()->select('count(*)', 'core_social_promote_sharers', [ 'sharer_key!=? AND sharer_enabled=?', 'Internal', 1 ] )->first() )
|
||||
{
|
||||
$deprecations['social_promotes'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_social_promotes' );
|
||||
}
|
||||
|
||||
if( !\IPS\CIC )
|
||||
{
|
||||
if( !Settings::i()->use_friendly_urls )
|
||||
{
|
||||
$deprecations['core_furls'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_core_furls' );
|
||||
}
|
||||
|
||||
$dummyRequest = Url::external('https://invisioncommunity.com')->request();
|
||||
if( ( $dummyRequest instanceof \IPS\Http\Request\Sockets ) )
|
||||
{
|
||||
$deprecations['classic_sockets'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_classic_sockets' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Pages Checks */
|
||||
if( Application::appIsEnabled( 'cms' ) )
|
||||
{
|
||||
$appName = Application::load('cms')->_title;
|
||||
foreach( Db::i()->select( '*', 'cms_blocks', [ 'block_type=?', 'custom'] ) as $row )
|
||||
{
|
||||
$config = json_decode( $row['block_config'], true );
|
||||
if( isset( $config['editor'] ) and $config['editor'] == 'php' )
|
||||
{
|
||||
$deprecations['php_blocks'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_php_blocks', false, [ 'sprintf' => [ $appName ] ] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Commerce checks */
|
||||
if( Application::appIsEnabled( 'nexus' ) )
|
||||
{
|
||||
$appName = Application::load('nexus')->_title;
|
||||
$physical = (bool) Db::i()->select( 'count(*)', 'nexus_packages_products', [ 'p_physical=?', 1 ] )->first();
|
||||
if( $physical )
|
||||
{
|
||||
$deprecations['physical'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_physical', false, [ 'sprintf' => [ $appName ] ] );
|
||||
}
|
||||
|
||||
$shipping = (bool) Db::i()->select( 'count(*)', 'nexus_shipping' )->first();
|
||||
$shipOrders = (bool) Db::i()->select( 'count(*)', 'nexus_ship_orders' )->first();
|
||||
if( $shipping or $shipOrders )
|
||||
{
|
||||
$deprecations['shipping'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_shipping', false, [ 'sprintf' => [ $appName ] ] );
|
||||
}
|
||||
|
||||
$requests = (bool) Db::i()->select( 'count(*)', 'nexus_support_requests' )->first();
|
||||
if( $requests )
|
||||
{
|
||||
$deprecations['support'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_support', false, [ 'sprintf' => [ $appName ] ] );
|
||||
}
|
||||
|
||||
$gateways = iterator_to_array(
|
||||
Db::i()->select( 'distinct m_gateway', 'nexus_paymethods', Db::i()->in( 'm_gateway', [ 'Braintree', 'AuthorizeNet', 'TwoCheckout' ] ) )
|
||||
);
|
||||
if( count( $gateways ) )
|
||||
{
|
||||
$deprecations['gateways'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_gateways', false, [ 'sprintf' => [ $appName, implode( ", ", $gateways ) ] ] );
|
||||
}
|
||||
|
||||
if( Settings::i()->easypost_enable )
|
||||
{
|
||||
$deprecations['easypost'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_easypost', false, [ 'sprintf' => [ $appName ] ] );
|
||||
}
|
||||
}
|
||||
|
||||
/* Forums checks */
|
||||
if( Application::appIsEnabled( 'forums' ) )
|
||||
{
|
||||
$appName = Application::load('forums')->_title;
|
||||
if( (bool) \IPS\Db::i()->select( 'COUNT(*)', 'forums_forums', \IPS\Db::i()->bitwiseWhere( \IPS\forums\Forum::$bitOptions['forums_bitoptions'], 'bw_enable_answers' ) )->first() )
|
||||
{
|
||||
$deprecations['qa'] = Member::loggedIn()->language()->addToStack( 'v5_deprecate_forums_qa', false, [ 'sprintf' => [ $appName ] ] );
|
||||
}
|
||||
}
|
||||
|
||||
return [ 'phpCheck' => $phpCheck, 'mySqlCheck' => $mySqlCheck, 'innoDb' => $innoDb, 'elasticsearch' => $elasticsearch, 'deprecations' => $deprecations ];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user