Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\install;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -47,7 +47,7 @@ class _admin extends \IPS\Dispatcher\Controller
|
||||
if ( \file_put_contents( \IPS\ROOT_PATH . '/conf_global.php', $toWrite ) )
|
||||
{
|
||||
/* PHP 5.5 - clear opcode cache or details won't be seen on next page load */
|
||||
if ( function_exists( 'opcache_invalidate' ) )
|
||||
if ( \function_exists( 'opcache_invalidate' ) )
|
||||
{
|
||||
@opcache_invalidate( \IPS\ROOT_PATH . '/conf_global.php' );
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\install;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -103,7 +103,7 @@ class _applications extends \IPS\Dispatcher\Controller
|
||||
},
|
||||
'validate' => function( $element ) use ( $defaultTicks )
|
||||
{
|
||||
if ( !in_array( 'core', $element->value ) )
|
||||
if ( !\in_array( 'core', $element->value ) )
|
||||
{
|
||||
$element->value['core'] = TRUE;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ class _applications extends \IPS\Dispatcher\Controller
|
||||
},
|
||||
'validate' => function( $element ) use ( $apps )
|
||||
{
|
||||
if ( !in_array( $element->value, array_keys( $apps ) ) or !array_key_exists( $element->value, \IPS\Request::i()->apps ) )
|
||||
if ( !\in_array( $element->value, array_keys( $apps ) ) or !array_key_exists( $element->value, \IPS\Request::i()->apps ) )
|
||||
{
|
||||
throw new \DomainException('default_app_invalid');
|
||||
}
|
||||
@@ -135,7 +135,7 @@ class _applications extends \IPS\Dispatcher\Controller
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
if ( !in_array( $values['default_app'], array_keys( $values['apps'] ) ) )
|
||||
if ( !\in_array( $values['default_app'], array_keys( $values['apps'] ) ) )
|
||||
{
|
||||
throw new \DomainException('default_app_invalid');
|
||||
}
|
||||
@@ -150,7 +150,7 @@ class _applications extends \IPS\Dispatcher\Controller
|
||||
if ( \file_put_contents( \IPS\ROOT_PATH . '/conf_global.php', $toWrite ) )
|
||||
{
|
||||
/* PHP 5.5 - clear opcode cache or details won't be seen on next page load */
|
||||
if ( function_exists( 'opcache_invalidate' ) )
|
||||
if ( \function_exists( 'opcache_invalidate' ) )
|
||||
{
|
||||
@opcache_invalidate( \IPS\ROOT_PATH . '/conf_global.php' );
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\install;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -62,7 +62,7 @@ class _done extends \IPS\Dispatcher\Controller
|
||||
), TRUE ) . ';' );
|
||||
|
||||
/* PHP 5.5 - clear opcode cache or details won't be seen on next page load */
|
||||
if ( function_exists( 'opcache_invalidate' ) )
|
||||
if ( \function_exists( 'opcache_invalidate' ) )
|
||||
{
|
||||
@opcache_invalidate( \IPS\ROOT_PATH . '/conf_global.php' );
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\install;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -81,11 +81,11 @@ class _install extends \IPS\Dispatcher\Controller
|
||||
/* If we're still here - output */
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( \IPS\Output::i()->output, 200, 'text/html', \IPS\Output::i()->httpHeaders );
|
||||
\IPS\Output::i()->sendOutput( \IPS\Output::i()->output, 200, 'text/html' );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->globalTemplate( \IPS\Output::i()->title, \IPS\Output::i()->output ), 403, 'text/html', \IPS\Output::i()->httpHeaders );
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global', 'core' )->globalTemplate( \IPS\Output::i()->title, \IPS\Output::i()->output ), 403, 'text/html' );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\install;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -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 | 18.09.2018', TRUE, array( 'size' => 50 ), function( $val )
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'lkey', 'Nulled by IPBMafia.ru | 18.08.2020', 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>' ) );
|
||||
@@ -63,7 +63,7 @@ class _license extends \IPS\Dispatcher\Controller
|
||||
else
|
||||
{
|
||||
/* PHP 5.5 - clear opcode cache or details won't be seen on next page load */
|
||||
if ( function_exists( 'opcache_invalidate' ) )
|
||||
if ( \function_exists( 'opcache_invalidate' ) )
|
||||
{
|
||||
@opcache_invalidate( \IPS\ROOT_PATH . '/conf_global.php' );
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\install;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -39,13 +39,15 @@ class _serverdetails extends \IPS\Dispatcher\Controller
|
||||
$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\YesNo( 'sql_utf8mb4', TRUE, FALSE ) );
|
||||
$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 ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
/* Enforce UTF8MB4 */
|
||||
$values['sql_utf8mb4'] = TRUE;
|
||||
|
||||
try
|
||||
{
|
||||
try
|
||||
@@ -55,7 +57,7 @@ class _serverdetails extends \IPS\Dispatcher\Controller
|
||||
/* Connection Success, check MySQL version */
|
||||
$result = \IPS\core\Setup\Upgrade::mysqlRequirements( $db );
|
||||
|
||||
if( !$result['requirements']['MySQL']['version']['success'] )
|
||||
if( !$result['requirements']['MySQL']['version']['success'] AND !\IPS\CIC )
|
||||
{
|
||||
throw new \DomainException( $result['requirements']['MySQL']['version']['message'] );
|
||||
}
|
||||
@@ -95,11 +97,6 @@ class _serverdetails extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
catch ( \UnderflowException $e ) { }
|
||||
|
||||
if ( $values['sql_utf8mb4'] and version_compare( $db->server_info, '5.5.3', '<' ) )
|
||||
{
|
||||
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack('err_no_utf8mb4') );
|
||||
}
|
||||
|
||||
$INFO = NULL;
|
||||
require \IPS\ROOT_PATH . '/conf_global.php';
|
||||
$INFO = array_merge( $INFO, $values );
|
||||
@@ -111,7 +108,7 @@ class _serverdetails extends \IPS\Dispatcher\Controller
|
||||
if ( \file_put_contents( \IPS\ROOT_PATH . '/conf_global.php', $toWrite ) )
|
||||
{
|
||||
/* PHP 5.6 - clear opcode cache or details won't be seen on next page load */
|
||||
if ( function_exists( 'opcache_invalidate' ) )
|
||||
if ( \function_exists( 'opcache_invalidate' ) )
|
||||
{
|
||||
@opcache_invalidate( \IPS\ROOT_PATH . '/conf_global.php' );
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\install;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -30,7 +30,7 @@ class _systemcheck extends \IPS\Dispatcher\Controller
|
||||
public function manage()
|
||||
{
|
||||
/* Clear previous session data */
|
||||
if( !isset( \IPS\Request::i()->sessionCheck ) AND count( $_SESSION ) )
|
||||
if( !isset( \IPS\Request::i()->sessionCheck ) AND \count( $_SESSION ) )
|
||||
{
|
||||
foreach( $_SESSION as $k => $v )
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -108,7 +108,7 @@ class _applications extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if( count( $errors ) )
|
||||
if( \count( $errors ) )
|
||||
{
|
||||
$haltUpgrade = TRUE;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ class _applications extends \IPS\Dispatcher\Controller
|
||||
unset( $apps['core'] );
|
||||
$apps = array_merge( $system, $apps );
|
||||
|
||||
if( count( $defaultTicks ) )
|
||||
if( \count( $defaultTicks ) )
|
||||
{
|
||||
$form = new \IPS\Helpers\Form( 'applications', 'continue' );
|
||||
$form->add( new \IPS\Helpers\Form\Custom( 'apps', $defaultTicks, TRUE, array(
|
||||
@@ -156,11 +156,11 @@ class _applications extends \IPS\Dispatcher\Controller
|
||||
$_SESSION['apps']['core'] = 'core';
|
||||
}
|
||||
|
||||
if( count( $values['apps'] ) )
|
||||
if( \count( $values['apps'] ) )
|
||||
{
|
||||
foreach ( $values['apps'] as $k => $v )
|
||||
{
|
||||
if ( !is_int( $k ) )
|
||||
if ( !\is_int( $k ) )
|
||||
{
|
||||
$_SESSION['apps'][$k] = $k;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ class _applications extends \IPS\Dispatcher\Controller
|
||||
|
||||
$warnings = array();
|
||||
$coreVersion = array_key_exists( 'core', $_SESSION['apps'] ) ? \IPS\Application::getAvailableVersion( 'core' ) : \IPS\Application::load( 'core' )->long_version;
|
||||
foreach ( \IPS\Application::$ipsApps as $key )
|
||||
foreach ( \IPS\IPS::$ipsApps as $key )
|
||||
{
|
||||
if ( $key == 'chat' )
|
||||
{
|
||||
@@ -191,7 +191,7 @@ class _applications extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ( count( $warnings ) )
|
||||
if ( \count( $warnings ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=applications&do=warning" )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'warnings' => implode( ',', $warnings ) ) ) );
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -33,6 +33,43 @@ class _confirm extends \IPS\Dispatcher\Controller
|
||||
$_SESSION['lastJsonIndex'] = 0;
|
||||
$_SESSION['lastSqlError'] = NULL;
|
||||
$_SESSION['sqlFinished'] = array();
|
||||
|
||||
/* Create our temporary upgrade data storage table */
|
||||
if( !\IPS\Db::i()->checkForTable( 'upgrade_temp' ) )
|
||||
{
|
||||
\IPS\Db::i()->createTable( array(
|
||||
'name' => 'upgrade_temp',
|
||||
'columns' => array(
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'int',
|
||||
'length' => 10,
|
||||
'allow_null' => false,
|
||||
'auto_increment' => true
|
||||
),
|
||||
array(
|
||||
'name' => 'upgrade_data',
|
||||
'type' => 'mediumtext',
|
||||
'length' => null,
|
||||
'allow_null' => true,
|
||||
'default' => null
|
||||
),
|
||||
array(
|
||||
'name' => 'lastaccess',
|
||||
'type' => 'int',
|
||||
'length' => 10,
|
||||
'allow_null' => false,
|
||||
'default' => 0
|
||||
),
|
||||
),
|
||||
'indexes' => array(
|
||||
array(
|
||||
'type' => 'primary',
|
||||
'columns' => array( 'id' )
|
||||
),
|
||||
)
|
||||
) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('confirmpage');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->confirm();
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -30,9 +30,16 @@ class _continueupgrade extends \IPS\Dispatcher\Controller
|
||||
public function manage()
|
||||
{
|
||||
/* Best check for the upgrade file first */
|
||||
$json = json_decode( @file_get_contents( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' ), TRUE );
|
||||
try
|
||||
{
|
||||
$json = json_decode( \IPS\Db::i()->select( 'upgrade_data', 'upgrade_temp' )->first(), TRUE );
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
$json = NULL;
|
||||
}
|
||||
|
||||
if ( is_array( $json ) and isset( $json['session'] ) and isset( $json['data'] ) )
|
||||
if ( \is_array( $json ) and isset( $json['session'] ) and isset( $json['data'] ) )
|
||||
{
|
||||
$url = \IPS\Http\Url::internal( "controller=upgrade" )->setQueryString( 'key', $_SESSION['uniqueKey'] );
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -93,7 +93,7 @@ class _customoptions extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* If there are no options, no need to show an empty/blank form */
|
||||
if( !count( $elements ) )
|
||||
if( !\count( $elements ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=confirm" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -31,10 +31,8 @@ class _done extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
\IPS\Output::clearJsFiles();
|
||||
|
||||
if ( file_exists( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' ) )
|
||||
{
|
||||
@unlink( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' );
|
||||
}
|
||||
/* Get rid of temporary upgrade data */
|
||||
\IPS\Db::i()->dropTable( 'upgrade_temp', TRUE );
|
||||
|
||||
/* Reset theme maps to make sure bad data hasn't been cached by visits mid-setup */
|
||||
foreach( \IPS\Theme::themes() as $id => $set )
|
||||
@@ -63,6 +61,9 @@ class _done extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
unset( $_SESSION['key'] );
|
||||
|
||||
/* Clear recent datastore logs to prevent an error message displaying immediately after upgrade */
|
||||
\IPS\Db::i()->delete( 'core_log', array( '`category`=? AND `time`>?', 'datastore', \IPS\DateTime::create()->sub( new \DateInterval( 'PT1H' ) )->getTimestamp() ) );
|
||||
|
||||
/* Unset settings datastore to prevent any upgrade settings that were overridden becoming persistent */
|
||||
\IPS\Settings::i()->clearCache();
|
||||
@@ -70,7 +71,13 @@ class _done extends \IPS\Dispatcher\Controller
|
||||
/* IPS Cloud Sync */
|
||||
\IPS\IPS::resyncIPSCloud('Upgraded community');
|
||||
|
||||
/* Remove any new version ACP Notifications */
|
||||
\IPS\core\AdminNotification::remove( 'core', 'NewVersion' );
|
||||
|
||||
/* 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');
|
||||
|
||||
/* The upgrader will cause a few syncs on Cloud2, but we don't have to wait for those. Clear the flag here. */
|
||||
unset( \IPS\Data\Store::i()->syncCompleted );
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -31,7 +31,7 @@ class _login extends \IPS\Dispatcher\Controller
|
||||
public function manage()
|
||||
{
|
||||
/* Clear previous session data */
|
||||
if( !isset( \IPS\Request::i()->sessionCheck ) AND count( $_SESSION ) )
|
||||
if( !isset( \IPS\Request::i()->sessionCheck ) AND \count( $_SESSION ) )
|
||||
{
|
||||
foreach( $_SESSION as $k => $v )
|
||||
{
|
||||
@@ -54,15 +54,19 @@ class _login extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Are we automatically logging in? */
|
||||
if ( isset( \IPS\Request::i()->adsess ) )
|
||||
if ( isset( \IPS\Request::i()->autologin ) and isset( \IPS\Request::i()->cookie['IPSSessionAdmin'] ) )
|
||||
{
|
||||
$session = \IPS\Db::i()->select( '*', 'core_sys_cp_sessions', array( 'session_id=?', \IPS\Request::i()->adsess ) )->first();
|
||||
$member = $session['session_member_id'] ? \IPS\Member::load( $session['session_member_id'] ) : new \IPS\Member;
|
||||
if ( $member->member_id and $this->_memberHasUpgradePermission( $member ) and ( !\IPS\Settings::i()->match_ipaddress or ( $session['session_ip_address'] === \IPS\Request::i()->ipAddress() ) ) )
|
||||
try
|
||||
{
|
||||
$_SESSION['uniqueKey'] = \IPS\Login::generateRandomString();
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=systemcheck" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
|
||||
$session = \IPS\Db::i()->select( '*', 'core_sys_cp_sessions', array( 'session_id=?', \IPS\Request::i()->cookie['IPSSessionAdmin'] ) )->first();
|
||||
$member = $session['session_member_id'] ? \IPS\Member::load( $session['session_member_id'] ) : new \IPS\Member;
|
||||
if ( $member->member_id and $this->_memberHasUpgradePermission( $member ) and ( !\IPS\Settings::i()->match_ipaddress or ( $session['session_ip_address'] === \IPS\Request::i()->ipAddress() ) ) )
|
||||
{
|
||||
$_SESSION['uniqueKey'] = \IPS\Login::generateRandomString();
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "controller=systemcheck" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
|
||||
}
|
||||
}
|
||||
catch( \UnderflowException $e ) {}
|
||||
}
|
||||
if ( \IPS\BYPASS_UPGRADER_LOGIN )
|
||||
{
|
||||
@@ -91,7 +95,7 @@ class _login extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* We need to allow logins if the previous upgrade wasn't finished */
|
||||
if( file_exists( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' ) )
|
||||
if( \IPS\Db::i()->checkForTable( 'upgrade_temp' ) )
|
||||
{
|
||||
$canUpgrade = TRUE;
|
||||
}
|
||||
@@ -99,6 +103,9 @@ class _login extends \IPS\Dispatcher\Controller
|
||||
if ( !$canUpgrade )
|
||||
{
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'forms' )->noapps();
|
||||
|
||||
/* We do this just to be 100% certain the flag didn't get "stuck" and needs to be reset. */
|
||||
\IPS\core\Setup\Upgrade::setUpgradingFlag( FALSE );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -113,13 +120,13 @@ class _login extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
$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 ) )
|
||||
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 ( password_verify( \IPS\Request::i()->password, $member->members_pass_hash ) or $member->verifyLegacyPassword( \IPS\Request::i()->protect('password') ) )
|
||||
{
|
||||
if ( $this->_memberHasUpgradePermission( $member ) )
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -30,25 +30,30 @@ class _systemcheck extends \IPS\Dispatcher\Controller
|
||||
public function manage()
|
||||
{
|
||||
/* Do we have an older upgrade session hanging around? */
|
||||
if ( ! isset( \IPS\Request::i()->skippreviousupgrade ) AND file_exists( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' ) )
|
||||
if ( ! isset( \IPS\Request::i()->skippreviousupgrade ) AND \IPS\Db::i()->checkForTable( 'upgrade_temp' ) )
|
||||
{
|
||||
$json = json_decode( @file_get_contents( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' ), TRUE );
|
||||
|
||||
if ( is_array( $json ) and isset( $json['session'] ) and isset( $json['data'] ) )
|
||||
try
|
||||
{
|
||||
$row = \IPS\Db::i()->select( '*', 'upgrade_temp' )->first();
|
||||
$json = json_decode( $row['upgrade_data'], TRUE );
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
$json = NULL;
|
||||
}
|
||||
|
||||
if ( \is_array( $json ) and isset( $json['session'] ) and isset( $json['data'] ) )
|
||||
{
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('unfinished_upgrade');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->unfinishedUpgrade( $json, @filemtime( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' ) );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->unfinishedUpgrade( $json, $row['lastaccess'] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
elseif( isset( \IPS\Request::i()->skippreviousupgrade ) AND \IPS\Request::i()->skippreviousupgrade )
|
||||
{
|
||||
/* If we skip the previous upgrade remove the file now. That way if we hit utf8 upgrader and come back to upgrader we are
|
||||
not prompted again to continue our conversion we already elected to start over */
|
||||
if ( file_exists( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' ) )
|
||||
{
|
||||
@unlink( \IPS\ROOT_PATH . '/uploads/logs/upgrader_data.cgi' );
|
||||
}
|
||||
/* If we skip the previous upgrade remove the temp upgrade data now. That way if we hit utf8 upgrader and come back to upgrader we are
|
||||
not prompted again to continue our upgrade we already elected to start over */
|
||||
\IPS\Db::i()->dropTable( 'upgrade_temp', TRUE );
|
||||
}
|
||||
|
||||
/* Do we need to disable designer mode? */
|
||||
@@ -65,7 +70,7 @@ class _systemcheck extends \IPS\Dispatcher\Controller
|
||||
$canProceed = FALSE;
|
||||
if ( !$designersModeEnabled )
|
||||
{
|
||||
$canProceed = !isset( $requirements['advice'] ) or !count( $requirements['advice'] );
|
||||
$canProceed = !isset( $requirements['advice'] ) or !\count( $requirements['advice'] );
|
||||
if ( $canProceed )
|
||||
{
|
||||
foreach ( $requirements['requirements'] as $k => $_requirements )
|
||||
@@ -82,6 +87,7 @@ class _systemcheck extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Check we have the latest version and run an md5 check */
|
||||
$incorrectFiles = array();
|
||||
/* Or do not check :) */
|
||||
|
||||
/* Display */
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\setup\upgrade;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
|
||||
Reference in new issue
Block a user