Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

@@ -30,7 +30,7 @@ class _admin extends \IPS\Dispatcher\Controller
$form = new \IPS\Helpers\Form( 'admin', 'continue' );
$form->add( new \IPS\Helpers\Form\Text( 'admin_user', NULL, TRUE ) );
$form->add( new \IPS\Helpers\Form\Password( 'admin_pass1', NULL, TRUE ) );
$form->add( new \IPS\Helpers\Form\Password( 'admin_pass1', NULL, TRUE, array() ) );
$form->add( new \IPS\Helpers\Form\Password( 'admin_pass2', NULL, TRUE, array( 'confirm' => 'admin_pass1' ) ) );
$form->add( new \IPS\Helpers\Form\Email( 'admin_email', NULL, TRUE ) );
@@ -119,6 +119,9 @@ class _applications extends \IPS\Dispatcher\Controller
'getHtml' => function( $element ) use ( $apps )
{
$options = array_combine( array_keys( $apps ), array_map( function( $value ){ return $value['name']; }, $apps ) );
/* But put system app at end of list to ensure it's not selected by default over something else */
unset( $options['core'] );
$options['core'] = $apps['core']['name'];
return \IPS\Theme::i()->getTemplate( 'forms' )->select( 'default_app', $element->value, TRUE, $options );
},
'validate' => function( $element ) use ( $apps )
@@ -42,11 +42,7 @@ class _done extends \IPS\Dispatcher\Controller
require \IPS\ROOT_PATH . '/conf_global.php';
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $INFO['lkey'] ), array( 'conf_key=?', 'ipb_reg_number' ) );
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => md5( $INFO['sql_pass'] . $INFO['base_url'] . $INFO['sql_database'] ) ), array( 'conf_key=?', 'site_secret_key' ) );
\IPS\Settings::i()->ipb_reg_number = $INFO['lkey'];
\IPS\Settings::i()->site_secret_key = md5( $INFO['sql_pass'] . $INFO['base_url'] . $INFO['sql_database'] );
unset( \IPS\Data\Store::i()->settings );
\IPS\Settings::i()->changeValues( array( 'ipb_reg_number' => $INFO['lkey'], 'site_secret_key' => md5( $INFO['sql_pass'] . $INFO['base_url'] . $INFO['sql_database'] ) ) );
\file_put_contents( \IPS\ROOT_PATH . '/conf_global.php', "<?php\n\n" . '$INFO = ' . var_export( array(
'sql_host' => $INFO['sql_host'],
@@ -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 | 25.07.2017', TRUE, array( 'size' => 50 ), function( $val )
$form->add( new \IPS\Helpers\Form\Text( 'lkey', 'Nulled by IPBMafia.ru | 18.04.2018', 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">' . \IPS\Member::loggedIn()->language()->addToStack('lkey_help') . '</a>' ) );
@@ -57,8 +57,16 @@ class _done extends \IPS\Dispatcher\Controller
unset( $_SESSION['sqlFinished'] );
}
if( isset( $_SESSION['uniqueKey'] ) )
{
unset( $_SESSION['uniqueKey'] );
}
unset( $_SESSION['key'] );
/* Unset settings datastore to prevent any upgrade settings that were overridden becoming persistent */
\IPS\Settings::i()->clearCache();
/* IPS Cloud Sync */
\IPS\IPS::resyncIPSCloud('Upgraded community');
@@ -1,12 +1,11 @@
<?php
/**
* @brief Upgrader: License
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @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 25 Sep 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\modules\setup\upgrade;
@@ -25,7 +24,7 @@ class _license extends \IPS\Dispatcher\Controller
{
/**
* Show Form... Or not.
* Show Form
*
* @return void
*/
@@ -64,77 +64,87 @@ class _login extends \IPS\Dispatcher\Controller
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=systemcheck" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
}
}
$login = new \IPS\Login( \IPS\Http\Url::internal( "controller=login&start=1&sessionCheck=1", NULL, NULL, NULL, \IPS\Settings::i()->logins_over_https ) );
$login->flagOptions = FALSE;
/* < 4.0.0 */
$legacy = FALSE;
if( \IPS\Db::i()->checkForTable( 'login_methods' ) )
if ( \IPS\BYPASS_UPGRADER_LOGIN )
{
$legacy = TRUE;
$_SESSION['uniqueKey'] = \IPS\Login::generateRandomString();
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=systemcheck" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
}
/* Restoring a part finished upgrade means no log in hander rows even though table has been renamed */
if ( \IPS\Db::i()->checkForTable( 'core_login_handlers' ) )
/* Before going any further, make sure there is an actual upgrade to be done. This both provides a nicer experience (so
people don't log in ust to be told there's nothing to upgrade) and prevents having a permenantly available login
screen which doesn't use locking (which could be use to bruteforce an account) */
$canUpgrade = FALSE;
foreach( \IPS\Application::applications() as $app => $data )
{
$legacy = FALSE;
$path = \IPS\ROOT_PATH . '/applications/' . $app;
if ( ! \IPS\Db::i()->select( 'COUNT(*)', 'core_login_handlers' )->first() )
if ( $app != 'chat' and is_dir( $path . '/data' ) )
{
$legacy = TRUE;
}
}
if ( $legacy === TRUE )
{
/* Force internal only as we don't have the framework installed (JS/templates, etc) at this point to run external log in modules */
\IPS\Login\LoginAbstract::$databaseTable = 'login_methods';
$login::$allHandlers['internal'] = \IPS\Login\LoginAbstract::constructFromData( array (
'login_key' => 'Upgrade',
'login_enabled' => 1,
'login_settings' => '{"auth_types":"3"}',
'login_order' => 1,
'login_acp' => 1
) );
$login::$handlers = $login::$allHandlers;
}
$handlers = \IPS\Login::handlers();
/* Process */
$error = NULL;
try
{
$member = $login->authenticate();
if ( $member !== NULL )
{
/* Check permission */
if ( !$this->_memberHasUpgradePermission( $member ) )
$currentVersion = \IPS\Application::load( $app )->long_version;
$availableVersion = \IPS\Application::getAvailableVersion( $app );
if ( empty( $errors ) AND $availableVersion > $currentVersion )
{
throw new \DomainException('login_upgrader_no_permission');
$canUpgrade = TRUE;
}
/* Create a unique session key and redirect */
$_SESSION['uniqueKey'] = \IPS\Login::generateRandomString();
/* IPS Cloud Sync */
\IPS\IPS::resyncIPSCloud('Beginning upgrade');
/* Redirect */
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=systemcheck" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
}
}
catch ( \Exception $e )
/* We need to allow logins if the previous upgrade wasn't finished */
if( file_exists( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' ) )
{
$error = $e->getMessage();
$canUpgrade = TRUE;
}
/* Output */
if ( !$canUpgrade )
{
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'forms' )->noapps();
return;
}
/* Nope, show a form */
$error = NULL;
if ( isset( \IPS\Request::i()->auth ) and isset( \IPS\Request::i()->password ) )
{
$table = 'core_members';
if ( \IPS\Db::i()->checkForTable( 'members' ) AND !\IPS\Db::i()->checkForTable( 'core_members' ) )
{
$table = 'members';
}
$memberRows = \IPS\Db::i()->select( '*', $table, array( 'email=? OR email=? OR name=? OR name=?', \IPS\Request::i()->auth, \IPS\Request::legacyEscape( \IPS\Request::i()->auth ), \IPS\Request::i()->auth, \IPS\Request::legacyEscape( \IPS\Request::i()->auth ) ) );
if ( count( $memberRows ) )
{
foreach( $memberRows as $memberRow )
{
$member = \IPS\Member::constructFromData( $memberRow );
if ( password_verify( \IPS\Request::i()->password, $member->members_pass_hash ) or $member->verifyLegacyPassword( \IPS\Request::i()->password ) )
{
if ( $this->_memberHasUpgradePermission( $member ) )
{
$_SESSION['uniqueKey'] = \IPS\Login::generateRandomString();
\IPS\IPS::resyncIPSCloud('Beginning upgrade');
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=systemcheck" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
}
else
{
$error = 'login_upgrader_no_permission';
}
}
else
{
$error = 'login_err_bad_password';
}
}
}
else
{
$error = 'login_err_no_account';
}
}
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('login');
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'forms' )->login( $login->forms( TRUE ), $error );
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'forms' )->login( $error );
}
/**
@@ -54,8 +54,7 @@ class _systemcheck extends \IPS\Dispatcher\Controller
/* Do we need to disable designer mode? */
if ( isset( \IPS\Request::i()->disableDesignersMode ) )
{
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => 0 ), array( 'conf_key=?', 'theme_designers_mode' ) );
unset( \IPS\Data\Store::i()->settings );
\IPS\Settings::i()->changeValues( array( 'theme_designers_mode' => 0 ) );
}
/* Get requirements */
@@ -81,13 +80,16 @@ class _systemcheck extends \IPS\Dispatcher\Controller
}
}
}
/* Check we have the latest version and run an md5 check */
/* Or do not chek :) */
/* Display */
if ( $canProceed )
{
\IPS\Output::i()->redirect( \IPS\Http\Url::internal("controller=license&key={$_SESSION['uniqueKey']}") );
}
/* Display */
}
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('healthcheck');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->healthcheck( $requirements, $designersModeEnabled );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->healthcheck( $requirements, $designersModeEnabled, $incorrectFiles );
}
}