Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -46,19 +46,23 @@ class _hookedFiles extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_hooks', \IPS\Http\Url::internal( 'app=core&module=support&controller=hookedFiles' ), array( \IPS\Db::i()->in( 'app', \IPS\IPS::$ipsApps, TRUE ) . " OR app IS NULL" ) );
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_hooks', \IPS\Http\Url::internal( 'app=core&module=support&controller=hookedFiles' ), array( array( "( app NOT IN( '" . implode( "','", \IPS\IPS::$ipsApps ) . "' ) OR app IS NULL )" ) ) );
|
||||
$table->langPrefix = 'hooks_';
|
||||
$table->quickSearch = array( 'class', 'hook_class' );
|
||||
$table->include = array( 'hooks_app', 'hooks_plugin', 'hooks_type', 'hooks_class', 'hooks_file' );
|
||||
$table->include = array( 'hooks_id', 'hooks_app', 'hooks_plugin', 'hooks_type', 'hooks_class', 'hooks_file' );
|
||||
|
||||
$table->parsers = array(
|
||||
'hooks_id' => function( $val, $row )
|
||||
{
|
||||
return $row['id'];
|
||||
},
|
||||
'hooks_app' => function( $val, $row )
|
||||
{
|
||||
try
|
||||
{
|
||||
return \IPS\Application::load($row['app'])->_title;
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
catch ( \OutOfRangeException | \UnexpectedValueException $e )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack('hook_class_none');
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ class _recovery extends \IPS\Dispatcher\Controller
|
||||
}, function()
|
||||
{
|
||||
\IPS\IPS::resyncIPSCloud('Enabled recovery mode');
|
||||
\IPS\Session::i()->log( 'acplog__enabled_recovery' );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=support&controller=recovery&do=done' ) );
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
'critical' => TRUE,
|
||||
'advice' => FALSE,
|
||||
'success' => FALSE,
|
||||
'link' =>\IPS\Http\Url::internal( "app=core&module=support&controller=support&do=getBlock&block=version&fix=1" ),
|
||||
'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')
|
||||
);
|
||||
}
|
||||
@@ -555,6 +555,175 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get block: Hook Scanner
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
final protected function _showBlockHookscanner()
|
||||
{
|
||||
$requirements = array( 'advice' => 0, 'failures' => 0, 'list' => array() );
|
||||
/* Do custom class's overloaded method signatures work on php8? */
|
||||
try
|
||||
{
|
||||
$scannerResult = \IPS\Application\Scanner::scanCustomizationIssues( false, true, 500, array( 'shallowCheckEnabledOnly' => true, 'enabledOnly' => false ) );
|
||||
if ( $scannerResult OR $scannerResult === false )
|
||||
{
|
||||
\IPS\core\AdminNotification::send( 'core', 'ManualInterventionMessage' );
|
||||
if( (bool) $scannerResult )
|
||||
{
|
||||
$requirements['failures']++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$requirements['advice']++;
|
||||
}
|
||||
|
||||
$requirements['list'][] = array(
|
||||
'critical' => (bool) $scannerResult,
|
||||
'advice' => !$scannerResult,
|
||||
'success' => FALSE,
|
||||
'link' => \IPS\Http\Url::internal( "app=core&module=support&controller=support&do=getBlock&block=methodcheck&fix=1" ),
|
||||
'detail' => \IPS\Member::loggedIn()->language()->addToStack( 'method_check_fail' ),
|
||||
'dialogTitle' => \IPS\Member::loggedIn()->language()->addToStack( 'method_check_fix' ),
|
||||
'dialogSize' => 'large'
|
||||
);
|
||||
}
|
||||
} catch ( \Exception $e ) {}
|
||||
|
||||
return array(
|
||||
'html' => \IPS\Theme::i()->getTemplate( 'support' )->supportBlockList( $requirements['list'] ),
|
||||
'criticalIssues' => $requirements['failures'],
|
||||
'recommendedIssues' => $requirements['advice']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get block: Hook Check. Only returns when "fixing" in the dialog
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function _showBlockMethodcheck()
|
||||
{
|
||||
if ( !\IPS\Request::i()->fix AND !\IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=support&controller=support" ) );
|
||||
}
|
||||
|
||||
$foundIssues = \IPS\Application\Scanner::scanCustomizationIssues( false, false, 500, array( 'enabledOnly' => false ) )[0];
|
||||
$issues = array();
|
||||
foreach ( $foundIssues as $appOrPlugin => $classes )
|
||||
{
|
||||
$components = explode( "-", $appOrPlugin );
|
||||
$isApp = \mb_strtolower( trim( $components[0] ) ) === 'app';
|
||||
$appDir = trim( $components[1] );
|
||||
$appOrPluginId = $appDir;
|
||||
/* Plugins are loaded by the ID not directory */
|
||||
if ( !$isApp )
|
||||
{
|
||||
try
|
||||
{
|
||||
$appOrPluginId = (int) \IPS\Db::i()->select( 'plugin_id', 'core_plugins', [ 'plugin_location=?', $appDir ], null, 1 )->first();
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $classes as $classFile => $classIssues )
|
||||
{
|
||||
foreach( $classIssues as $classIssue )
|
||||
{
|
||||
$issues[] = array(
|
||||
'type' => $isApp ? 'app' : 'plugin',
|
||||
'app' => $appOrPluginId,
|
||||
'reason' => $classIssue['reason'],
|
||||
'scanner_method' => $classIssue['class'] . '::' . $classIssue['method'] . '()',
|
||||
'parameter' => $classIssue['parameter'],
|
||||
'subclassFile' => $classIssue['subclassFile'] . ':' . $classIssue['subclassMethod']['lineNumber'],
|
||||
'baseFile' => $classIssue['baseFile'] . ':' . $classIssue['baseMethod']['lineNumber'],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty( $issues ) )
|
||||
{
|
||||
$table = \IPS\Member::loggedIn()->language()->addToStack( 'methodscanner_no_issues' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$table = new \IPS\Helpers\Table\Custom( $issues, \IPS\Http\Url::internal( 'app=core&module=support&controller=support&do=getBlock&block=methodcheck' ) );
|
||||
$table->langPrefix = 'method_';
|
||||
$table->simplePagination = true;
|
||||
|
||||
$table->parsers = array(
|
||||
'app' => function ( $val, $row ) {
|
||||
try
|
||||
{
|
||||
return $row['type'] === 'app' ?
|
||||
\IPS\Application::load( $row['app'] )->_title :
|
||||
htmlspecialchars( \is_integer( $row['app'] ? \IPS\Plugin::load( $row['app'] )->name : $row['app'] ), ENT_DISALLOWED, 'UTF-8', FALSE );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'method_class_none' );
|
||||
}
|
||||
},
|
||||
'type' => function ( $val, $row ) {
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'hooks_hooks_' . $row['type'] );
|
||||
},
|
||||
'reason' => function ( $val, $row ) {
|
||||
$reason = \IPS\Member::loggedIn()->language()->addToStack( $row['reason'] );
|
||||
$reasonDesc = \IPS\Member::loggedIn()->language()->addToStack( $row['reason'] . '_desc' );
|
||||
return "<span data-ipstooltip style='cursor:pointer' title=\"$reasonDesc\">$reason <i class=\"fa fa-info-circle\"></i></span>";
|
||||
},
|
||||
'parameter' => function ( $val, $row ) {
|
||||
if ( $row['parameter'] ?? 0 )
|
||||
{
|
||||
return '$' . $row['parameter'];
|
||||
}
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'method_na' );
|
||||
},
|
||||
'priority' => function ( $val, $row ) {
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( $val ? 'yes' : 'no' );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ( !\IPS\Request::i()->fix AND \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
return (string) $table;
|
||||
}
|
||||
return \IPS\Theme::i()->getTemplate( 'support' )->methodIssues( $table );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Endpoint to get just the chart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function methodCheck()
|
||||
{
|
||||
/* Trick the method into giving its chart */
|
||||
$fix = \IPS\Request::i()->fix ?? null;
|
||||
\IPS\Request::i()->fix = 1;
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'method_check_fix' );
|
||||
\IPS\Output::i()->output = $this->_showBlockMethodcheck();
|
||||
if ( $fix === null )
|
||||
{
|
||||
unset( \IPS\Request::i()->fix );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Request::i()->fix = $fix;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get block: Third Party
|
||||
*
|
||||
@@ -700,11 +869,12 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
|
||||
if( \in_array( 'cf-cache-status', $headerKeys ) )
|
||||
{
|
||||
$requirements['advice']++;
|
||||
$requirements['list'][] = array(
|
||||
'critical' => FALSE,
|
||||
'advice' => TRUE,
|
||||
'advice' => FALSE,
|
||||
'success' => FALSE,
|
||||
'learnmore' => TRUE,
|
||||
'dialogTitle' => \IPS\Member::loggedIn()->language()->addToStack( 'health_learn_more'),
|
||||
'element' => 'cloudflare',
|
||||
'body' => \IPS\Member::loggedIn()->language()->addToStack('health__cache_cloudflare_details'),
|
||||
'detail' => \IPS\Member::loggedIn()->language()->addToStack('health__cache_cloudflare')
|
||||
@@ -1381,6 +1551,10 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
}
|
||||
|
||||
$blocks['hookscanner'] = array(
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack('health__scanner_title'),
|
||||
);
|
||||
|
||||
$blocks['mysql'] = array(
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( \IPS\CIC ? 'health__mysql_title' : 'health__mysql_title_cic' ),
|
||||
'details' => !\IPS\CIC ? \IPS\Member::loggedIn()->language()->addToStack( 'acp_version_number_raw', FALSE, array( 'sprintf' => array( \IPS\Db::i()->server_info ) ) ) : NULL
|
||||
@@ -1618,6 +1792,9 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
$errors[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__support_tool_db_check' );
|
||||
|
||||
if ( \count( $erroredQueries ) )
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'support' )->fixDatabase( $erroredQueries, $errors, \IPS\Request::i()->_upgradeVersion );
|
||||
@@ -1921,6 +2098,8 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
$supportAccount->save();
|
||||
\IPS\core\AdminNotification::send( 'core', 'ConfigurationError', "supportAdmin-{$supportAccount->member_id}", TRUE, NULL, TRUE );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__support_tool_admin' );
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'administrator_account' );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'support' )->admin( $supportAccount->name, $supportAccount->email, $password );
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Requires MySQL 5.5.3 */
|
||||
if ( version_compare( \IPS\Db::i()->server_info, '5.5.3', '<' ) )
|
||||
if ( !\IPS\CIC AND version_compare( \IPS\Db::i()->server_info, '5.5.3', '<' ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'utf8mb4_converter_requires_553', '1C325/1', 403, '' );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user