Version 4.7.6

This commit is contained in:
Neo committed 2025-12-19 16:05:19 -08:00
1 parent 8ba7d43898
commit 7b7404e741
1085 files changed
+30590 -7837

No files matched your search

@@ -30,7 +30,7 @@ class _license extends \IPS\Dispatcher\Controller
public function manage()
{
$form = new \IPS\Helpers\Form( 'license', 'continue', \IPS\Http\Url::external( ( \IPS\Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . '?controller=license' ) );
$form->add( new \IPS\Helpers\Form\Text( 'lkey', 'Nulled by IPBMafia.ru | 06.07.2022', TRUE, array( 'size' => 50 ), function( $val )
$form->add( new \IPS\Helpers\Form\Text( 'lkey', '16BF-9C65-B3A6-1337', TRUE, array( 'size' => 50 ), function( $val )
{
\IPS\IPS::checkLicenseKey( $val, ( \IPS\Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . mb_substr( $_SERVER['SCRIPT_NAME'], 0, -mb_strlen( \IPS\CP_DIRECTORY . '/install/index.php' ) ) );
}, NULL, '<a href="' . \IPS\Http\Url::ips( 'docs/find_lkey' ) . '" target="_blank" rel="noopener">' . \IPS\Member::loggedIn()->language()->addToStack('lkey_help') . '</a>' ) );
@@ -38,7 +38,7 @@ class _serverdetails extends \IPS\Dispatcher\Controller
$form->add( new \IPS\Helpers\Form\Text( 'sql_database', NULL, TRUE ) );
$form->add( new \IPS\Helpers\Form\Number( 'sql_port', ini_get('mysqli.default_port'), FALSE ) );
$form->add( new \IPS\Helpers\Form\Text( 'sql_socket', ini_get('mysqli.default_socket'), FALSE ) );
$form->add( new \IPS\Helpers\Form\Text( 'sql_tbl_prefix', NULL, FALSE ) );
$form->add( new \IPS\Helpers\Form\Text( 'sql_tbl_prefix', NULL, FALSE, [ 'regex' => '/^([a-z0-9_-]+?)?$/i' ] ) );
$form->addHeader( 'http_server' );
$form->add( new \IPS\Helpers\Form\Text( 'base_url', ( \IPS\Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . mb_substr( $_SERVER['SCRIPT_NAME'], 0, -mb_strlen( \IPS\CP_DIRECTORY . '/install/index.php' ) ), TRUE, array( 'size' => 50 ) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'diagnostics_reporting', FALSE ) );
@@ -7,7 +7,7 @@
* @package Invision Community
* @since 20 May 2014
*/
namespace IPS\core\modules\setup\upgrade;
/* To prevent PHP errors (extending class does not exist) revealing path */
@@ -25,14 +25,12 @@ class _applications extends \IPS\Dispatcher\Controller
/**
* Show Form
*
* @todo [Upgrade] This may not accurately detect older versions - need to test and adjust
* @return void
*/
public function manage()
{
$apps = array();
$defaultTicks = array();
/* Update old app keys or everything gets confused */
\IPS\Db::i()->update( 'core_applications', array( 'app_directory' => 'cms' ), array( 'app_directory=?', 'ccs' ) );
\IPS\Db::i()->update( 'core_applications', array( 'app_directory' => 'chat' ), array( 'app_directory=?', 'ipchat' ) );
@@ -53,13 +51,11 @@ class _applications extends \IPS\Dispatcher\Controller
{
unset( \IPS\Data\Store::i()->modules );
}
$haltUpgrade = FALSE;
foreach( \IPS\Application::applications() as $app => $data )
{
$path = \IPS\Application::getRootPath( $app ) . '/applications/' . $app;
if ( $app == 'chat' )
{
continue;
@@ -70,10 +66,10 @@ class _applications extends \IPS\Dispatcher\Controller
{
continue;
}
/* See if there are any errors */
$errors = array();
if ( file_exists( $path . '/setup/requirements.php' ) )
{
require $path . '/setup/requirements.php';
@@ -83,19 +79,14 @@ class _applications extends \IPS\Dispatcher\Controller
$currentVersion = \IPS\Application::load( $app )->long_version;
$availableVersion = \IPS\Application::getAvailableVersion( $app );
if ( empty( $errors ) AND $availableVersion > $currentVersion )
{
$defaultTicks[] = $app;
}
$name = $data->_title;
/* Get app name */
if ( file_exists( $path . '/data/lang.xml' ) )
{
$xml = \IPS\Xml\XMLReader::safeOpen( $path . '/data/lang.xml' );
$xml->read();
$xml->read();
while ( $xml->read() )
{
@@ -107,110 +98,53 @@ class _applications extends \IPS\Dispatcher\Controller
}
}
if( \count( $errors ) )
if( $availableVersion > $currentVersion )
{
$haltUpgrade = TRUE;
$apps[ $app ] = array(
'name' => $name,
'disabled' => ( !empty( $errors ) OR $availableVersion <= $currentVersion ),
'errors' => $errors,
'current' => \IPS\Application::load( $app )->version,
'available' => \IPS\Application::getAvailableVersion( $app, TRUE )
);
}
$apps[ $app ] = array(
'name' => $name,
'disabled' => ( !empty( $errors ) OR $availableVersion <= $currentVersion ),
'errors' => $errors,
'current' => \IPS\Application::load( $app )->version,
'available' => \IPS\Application::getAvailableVersion( $app, TRUE ),
'force' => ( ( $app === 'core' or $app === 'cloud' ) and $availableVersion > $currentVersion )
);
}
/* Bring core app to top */
$system['core'] = $apps['core'];
unset( $apps['core'] );
if ( isset( $apps['cloud'] ) )
if( \count( $apps ) )
{
$system['cloud'] = $apps['cloud'];
unset( $apps['cloud'] );
}
$apps = array_merge( $system, $apps );
if( \count( $defaultTicks ) )
{
$form = new \IPS\Helpers\Form( 'applications', 'continue' );
$form->add( new \IPS\Helpers\Form\Custom( 'apps', $defaultTicks, TRUE, array(
'getHtml' => function( $element ) use ( $apps )
{
return \IPS\Theme::i()->getTemplate( 'forms' )->apps( $apps, $element->value );
},
'validate' => function( $element ) use ( $defaultTicks )
{
$uninstallable = ( $element->value === NULL ) ? NULL : array_diff( array_keys( $element->value ), $defaultTicks );
$_SESSION['apps'] = $apps;
if ( !empty( $uninstallable ) )
{
throw new \DomainException;
}
}
) ) );
if ( $values = $form->values() )
$warnings = array();
$coreVersion = array_key_exists( 'core', $_SESSION['apps'] ) ? \IPS\Application::getAvailableVersion( 'core' ) : \IPS\Application::load( 'core' )->long_version;
foreach ( \IPS\IPS::$ipsApps as $key )
{
$_SESSION['apps'] = array();
if ( $apps['core']['force'] )
if ( $key == 'chat' )
{
$_SESSION['apps']['core'] = 'core';
}
if ( isset( $apps['cloud'] ) and $apps['cloud']['force'] )
{
$_SESSION['apps']['cloud'] = 'cloud';
continue;
}
if( \count( $values['apps'] ) )
try
{
foreach ( $values['apps'] as $k => $v )
$appVersion = array_key_exists( $key, $_SESSION['apps'] ) ? \IPS\Application::getAvailableVersion( $key ) : \IPS\Application::load( $key )->long_version;
if ( $appVersion != $coreVersion )
{
if ( !\is_int( $k ) )
{
$_SESSION['apps'][$k] = $k;
}
$warnings[] = $key;
}
}
$warnings = array();
$coreVersion = array_key_exists( 'core', $_SESSION['apps'] ) ? \IPS\Application::getAvailableVersion( 'core' ) : \IPS\Application::load( 'core' )->long_version;
foreach ( \IPS\IPS::$ipsApps as $key )
catch( \OutOfRangeException $e )
{
if ( $key == 'chat' )
{
continue;
}
try
{
$appVersion = array_key_exists( $key, $_SESSION['apps'] ) ? \IPS\Application::getAvailableVersion( $key ) : \IPS\Application::load( $key )->long_version;
if ( $appVersion != $coreVersion )
{
$warnings[] = $key;
}
}
catch( \OutOfRangeException $e )
{
/* The application is not installed */
continue;
}
/* The application is not installed */
continue;
}
if ( \count( $warnings ) )
{
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=applications&do=warning" )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'warnings' => implode( ',', $warnings ) ) ) );
}
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=customoptions" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
}
if( $haltUpgrade )
if ( \count( $warnings ) )
{
$form->actionButtons = array( \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->button( "continue", 'submit', null, 'ipsButton ipsButton_disabled', array( 'disabled' => 'disabled' ) ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=applications&do=warning" )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'warnings' => implode( ',', $warnings ) ) ) );
}
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=customoptions" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
}
else
{
@@ -222,7 +156,7 @@ class _applications extends \IPS\Dispatcher\Controller
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('applications');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( 'applications', $form );
}
/**
* Show Warning
*
@@ -241,7 +175,7 @@ class _applications extends \IPS\Dispatcher\Controller
{
$xml = \IPS\Xml\XMLReader::safeOpen( $path . '/data/lang.xml' );
$xml->read();
$xml->read();
while ( $xml->read() )
{
@@ -256,7 +190,7 @@ class _applications extends \IPS\Dispatcher\Controller
}
catch ( \Exception $e ) { }
}
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('applications');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( 'applications', \IPS\Theme::i()->getTemplate( 'global' )->appWarnings( $apps ) );
}
@@ -40,21 +40,21 @@ class _confirm extends \IPS\Dispatcher\Controller
\IPS\Db::i()->createTable( array(
'name' => 'upgrade_temp',
'columns' => array(
array(
'id' => array(
'name' => 'id',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'auto_increment' => true
),
array(
'upgrade_data' => array(
'name' => 'upgrade_data',
'type' => 'mediumtext',
'length' => null,
'allow_null' => true,
'default' => null
),
array(
'lastaccess' => array(
'name' => 'lastaccess',
'type' => 'int',
'length' => 10,
@@ -63,9 +63,11 @@ class _confirm extends \IPS\Dispatcher\Controller
),
),
'indexes' => array(
array(
'PRIMARY' => array(
'type' => 'primary',
'columns' => array( 'id' )
'name' => 'PRIMARY',
'columns' => array( 'id' ),
'length' => array( NULL )
),
)
) );
@@ -73,6 +73,82 @@ class _done extends \IPS\Dispatcher\Controller
/* Remove any new version ACP Notifications */
\IPS\core\AdminNotification::remove( 'core', 'NewVersion' );
/* Check for php8 method substitution issues */
if ( \IPS\Application\Scanner::scanCustomizationIssues( false, true ) !== null )
{
$foundIssues = \IPS\Application\Scanner::scanCustomizationIssues()[0];
$disabledApps = array();
$disabledPlugins = array();
foreach ( $foundIssues as $appOrPlugin => $classes )
{
$components = explode( "-", $appOrPlugin );
$isApp = \mb_strtolower( trim( $components[0] ) ) === 'app';
$appDir = trim( $components[1] );
/* Disable the plugin/app and flag for manual intervention */
if ( $isApp and ( empty( $disabledApps[$appDir] ) ) )
{
/* IPS Code is flawless, skip it */
if ( \in_array( $appDir, \IPS\IPS::$ipsApps ) )
{
continue;
}
try
{
$app = \IPS\Application::load( $appDir );
$app->_enabled = false;
if ( ! \IPS\IN_DEV )
{
$app->requires_manual_intervention = 1;
}
$app->save();
$disabledApps[$appDir] = $app->_title;
}
catch ( \InvalidArgumentException|\OutOfRangeException $e )
{
/* This still won't work, so don't leave it empty */
$disabledApps[$appDir] = $appDir;
continue;
}
}
elseif ( empty( $disabledPlugins[$appDir] ) )
{
try
{
$pluginId = \IPS\Db::i()->select( 'plugin_id', 'core_plugins', [ 'plugin_location=?', $appDir ], null, 1 )->first();
$plugin = \IPS\Plugin::load( $pluginId );
$plugin->_enabled = false;
if ( ! \IPS\IN_DEV )
{
$plugin->requires_manual_intervention = 1;
}
$plugin->save();
$disabledPlugins[$appDir] = $plugin->name;
}
catch ( \UnderflowException|\InvalidArgumentException|\OutOfRangeException $e )
{
/* This still won't work, so don't leave it empty */
$disabledPlugins[$appDir] = $appDir;
continue;
}
}
}
if ( \count( $disabledPlugins ) OR \count( $disabledApps ) )
{
\IPS\core\AdminNotification::send( 'core', 'ManualInterventionMessage' );
$_SESSION['upgrade_postUpgrade']['core'][] = \IPS\Theme::i()->getTemplate( 'global' )->methodIssues(
\IPS\Theme::i()->getTemplate( 'global' )->disabled3rdParty( array_keys( $disabledApps ), array_keys( $disabledPlugins ), false )
);
}
}
/* And show the complete page - the template handles this step special already so we don't have to output anything */
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('done');