Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

@@ -40,13 +40,13 @@ class _hookedFiles extends \IPS\Dispatcher\Controller
}
/**
* ...
* Show all third party hooks
*
* @return void
*/
protected function manage()
{
$table = new \IPS\Helpers\Table\Db( 'core_hooks', \IPS\Http\Url::internal( 'app=core&module=support&controller=hookedFiles' ) );
$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 ) ) );
$table->langPrefix = 'hooks_';
$table->quickSearch = array( 'class', 'hook_class' );
$table->include = array( 'hooks_app', 'hooks_plugin', 'hooks_type', 'hooks_class', 'hooks_file' );
@@ -104,7 +104,7 @@ class _hookedFiles extends \IPS\Dispatcher\Controller
);
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'hooked_classes' );
\IPS\Output::i()->output = $table;
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'support' )->hookedClasses( $table );
}
}
@@ -0,0 +1,51 @@
<?php
/**
* @brief Display phpinfo
* @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 4 December 2020
*/
namespace IPS\core\modules\admin\support;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Display phpinfo
*/
class _phpinfo extends \IPS\Dispatcher\Controller
{
/**
* @brief Has been CSRF-protected
*/
public static $csrfProtected = TRUE;
/**
* Execute
*
* @return void
*/
public function execute()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'get_support' );
parent::execute();
}
/**
* Support Wizard
*
* @return void
*/
protected function manage()
{
phpinfo();
exit;
}
}
@@ -88,12 +88,14 @@ class _redis extends \IPS\Dispatcher\Controller
if ( \IPS\CACHE_METHOD == 'Redis' and \IPS\REDIS_ENABLED )
{
$datasource[] = array( 'type' => 'redis_sessions', 'count' => \count( \IPS\Redis::i()->debugGetKeys( 'session_id_*', TRUE ) ), 'enabled' => true );
$datasource[] = array( 'type' => 'redis_topic_views', 'count' => \IPS\Redis::i()->zSize('topic_views'), 'enabled' => true );
$datasource[] = array( 'type' => 'redis_topic_views', 'count' => \IPS\Redis::i()->zCard('topic_views'), 'enabled' => true );
$datasource[] = array( 'type' => 'redis_advert_impressions', 'count' => \IPS\Redis::i()->zCard('advert_impressions'), 'enabled' => true );
}
else
{
$datasource[] = array( 'type' => 'redis_sessions' , 'count' => NULL, 'enabled' => false );
$datasource[] = array( 'type' => 'redis_topic_views', 'count' => NULL, 'enabled' => false );
$datasource[] = array( 'type' => 'redis_advert_impressions', 'count' => NULL, 'enabled' => false );
}
}
@@ -129,6 +131,6 @@ class _redis extends \IPS\Dispatcher\Controller
);
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('redis_info');
\IPS\Output::i()->output = \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'support' )->redis( $info, $table );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'support' )->redis( $info, $table );
}
}
@@ -82,7 +82,7 @@ class _sql extends \IPS\Dispatcher\Controller
'view' => array(
'icon' => 'search',
'title' => 'view',
'link' => \IPS\Http\Url::internal( 'app=core&module=support&controller=sql&do=query' )->setQueryString( 'q', "SELECT * FROM {$row['name']}" )->csrf()
'link' => \IPS\Http\Url::internal( 'app=core&module=support&controller=sql&do=query&action=view' )->setQueryString( 'table', $row['name'] )
),
);
};
@@ -103,22 +103,31 @@ class _sql extends \IPS\Dispatcher\Controller
*/
protected function query()
{
\IPS\Session::i()->csrfCheck();
/* Select from table */
$query = NULL;
if ( isset( \IPS\Request::i()->q ) )
$table = NULL;
if ( isset( \IPS\Request::i()->table ) AND isset( \IPS\Request::i()->action ) )
{
$query = urldecode( \IPS\Request::i()->q );
$table = \IPS\Db::i()->escape_string( \IPS\Request::i()->table );
if ( \IPS\Request::i()->action === 'count' )
{
$query = \IPS\Db::i()->select( 'COUNT(*)', $table )->returnFullQuery();
}
else
{
$query = \IPS\Db::i()->select( '*', $table )->returnFullQuery();
}
}
/* Query form */
$valuesFound = FALSE;
$form = new \IPS\Helpers\Form( 'form', 'run_query' );
$form->class = 'ipsForm_vertical';
$form->add( new \IPS\Helpers\Form\TextArea( 'sql_toolbox_query', $query, TRUE, array( 'class' => 'ipsField_codeInput' ) ) );
if ( $values = $form->values() )
{
$query = $values['sql_toolbox_query'];
$valuesFound = TRUE;
}
/* Run */
@@ -159,13 +168,21 @@ class _sql extends \IPS\Dispatcher\Controller
{
$page = isset( \IPS\Request::i()->page ) ? \intval( \IPS\Request::i()->page ) : 1;
if( $page < 1 )
if( $page < 1 OR $valuesFound )
{
$page = 1;
}
$table = ( $result->fetch_field()->table !== FALSE ) ? $result->fetch_field()->table : $table;
$paginationUrl = \IPS\Http\Url::internal( 'app=core&module=support&controller=sql&do=query&action=view' );
if ( isset( $table ) )
{
$paginationUrl = $paginationUrl->setQueryString( 'table', $table );
}
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination(
\IPS\Http\Url::internal( 'app=core&module=support&controller=sql&do=query' )->setQueryString( 'q', $query )->csrf(),
$paginationUrl,
ceil( $result->num_rows / static::SELECT_LIMIT ),
$page,
static::SELECT_LIMIT
File diff suppressed because it is too large. Load diff
@@ -104,7 +104,7 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
return $wizardData;
}
$baseUrl = \IPS\Http\Url::internal( 'app=core&module=support&controller=utf8mb4' );
$baseUrl = \IPS\Http\Url::internal( 'app=core&module=support&controller=utf8mb4' )->csrf();
return new \IPS\Helpers\MultipleRedirect( $baseUrl,
function( $mrData )
@@ -197,7 +197,7 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
$length += $tableDefinition['columns'][ $column ]['length'];
}
if( $tableDefinition['columns'][ $column ]['collation'] !== 'utf8mb4_unicode_ci' )
if( isset( $tableDefinition['columns'][ $column ]['collation'] ) AND $tableDefinition['columns'][ $column ]['collation'] !== 'utf8mb4_unicode_ci' )
{
$needToRecreate = TRUE;
}
@@ -244,7 +244,7 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
}
/* Now if we have any changes to make....make them */
if( count( $aggregatedChanges ) )
if( \count( $aggregatedChanges ) )
{
\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . \IPS\Db::i()->escape_string( $table ) . " " . implode( ', ', $aggregatedChanges ) );
}