Version 5.0.6

This commit is contained in:
Neo committed 2025-12-19 18:55:49 -08:00
1 parent a3a4a9ccbd
commit b89858b2ff
1214 files changed
+92828 -14859

No files matched your search

@@ -7,7 +7,7 @@
* @package Invision Community
* @since 2 Apr 2013
*/
namespace IPS\core\modules\setup\install;
/* To prevent PHP errors (extending class does not exist) revealing path */
@@ -48,29 +48,29 @@ class license extends Controller
public function manage() : void
{
$form = new Form( 'license', 'continue', Url::external( ( Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . '?controller=license' ) );
$form->add( new Text( 'lkey', '16BF-9C65-B3A6-1337', TRUE, array( 'size' => 50 ), function( $val )
$form->add( new Text( 'lkey', '', TRUE, array( 'size' => 50 ), function( $val )
{
IPS::checkLicenseKey( $val, ( Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . mb_substr( $_SERVER['SCRIPT_NAME'], 0, -mb_strlen( 'admin/install/index.php' ) ) );
}, NULL, 'xxxxxxxxxxx' ) );
$form->add( new Checkbox( 'eula', FALSE, TRUE, array( 'label' => 'eula_suffix' ), function( $val )
}, NULL, '<a href="' . Url::ips( 'docs/find_lkey' ) . '" target="_blank" rel="noopener">' . Member::loggedIn()->language()->addToStack('lkey_help') . ' <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"/></svg></a>' ) );
$form->add( new Checkbox( 'eula', TRUE, TRUE, array( 'label' => 'eula_suffix' ), function( $val )
{
if ( !$val )
{
throw new InvalidArgumentException('eula_err');
}
}, "<textarea disabled style='width: 100%; height: 250px'>" . file_get_contents( 'eula.txt' ) . "</textarea>" ) );
if ( $values = $form->values() )
{
$values['lkey'] = trim( $values['lkey'] );
if ( mb_substr( $values['lkey'], -12 ) === '-TESTINSTALL' )
{
$values['lkey'] = mb_substr( $values['lkey'], 0, -12 );
}
$toWrite = "<?php\n\n" . '$INFO = ' . var_export( array( 'lkey' => $values['lkey'] ), TRUE ) . ';';
$toWrite = "<?php\n\n" . '$INFO = ' . var_export( array( 'lkey' => 'LICENSE KEY GOES HERE!-123456789' ), TRUE ) . ';';
try
{
$file = @file_put_contents( \IPS\ROOT_PATH . '/conf_global.php', $toWrite );
@@ -95,17 +95,17 @@ class license extends Controller
$errorform = new Form( 'license', 'continue' );
$errorform->class = '';
$errorform->add( new TextArea( 'conf_global_error', $toWrite, FALSE ) );
foreach( $values as $k => $v )
{
$errorform->hiddenValues[ $k ] = $v;
}
Output::i()->output = Theme::i()->getTemplate( 'global' )->confWriteError( $errorform, \IPS\ROOT_PATH );
return;
}
}
Output::i()->title = Member::loggedIn()->language()->addToStack('license');
Output::i()->output = Theme::i()->getTemplate( 'global' )->block( 'license', $form, TRUE, TRUE );
}
@@ -65,7 +65,7 @@ class serverdetails extends Controller
$form->add( new Text( 'sql_tbl_prefix', NULL, FALSE, [ 'regex' => '/^([a-z0-9_-]+?)?$/i' ] ) );
$form->addHeader( 'http_server' );
$form->add( new Text( 'base_url', ( Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . mb_substr( $_SERVER['SCRIPT_NAME'], 0, -mb_strlen( 'admin/install/index.php' ) ), TRUE, array( 'size' => 50 ) ) );
$form->add( new YesNo( 'diagnostics_reporting', TRUE ) );
$form->add( new YesNo( 'diagnostics_reporting', FALSE ) );
if ( $values = $form->values() )
{
@@ -45,92 +45,7 @@ class license extends Controller
*/
public function manage() : void
{
/* Check license key */
if( Db::i()->checkForTable( 'core_store' ) )
{
$licenseData = IPS::licenseKey( TRUE );
}
else
{
$licenseData = NULL;
try
{
$license = Db::i()->select( '*', 'cache_store', array( 'cs_key=?', 'licenseData' ) )->first();
$licenseData = unserialize( $license['cs_value'] );
}
catch( Exception $e ){}
}
if( isset( $licenseData['key'] ) AND !isset( $licenseData['expires'] ) )
{
$licenseData = $this->getLicenseData();
}
if( !$licenseData )
{
$active = NULL;
}
else
{
$active = ( isset( $licenseData['expires'] ) and $licenseData['expires'] AND strtotime( $licenseData['expires'] ) > time() ) ? TRUE : ( ( isset( $licenseData['active'] ) and $licenseData['active'] ) ? TRUE : NULL );
}
if ( !$active )
{
$response = NULL;
$form = new Form( 'licensekey', 'continue' );
$form->add( new Text( 'ipb_reg_number', NULL, TRUE, array(), function( $val ){
IPS::checkLicenseKey( $val, Settings::i()->base_url );
} ) );
if( $values = $form->values() )
{
$values['ipb_reg_number'] = trim( $values['ipb_reg_number'] );
if ( mb_substr( $values['ipb_reg_number'], -12 ) === '-TESTINSTALL' )
{
$values['ipb_reg_number'] = mb_substr( $values['ipb_reg_number'], 0, -12 );
}
/* Save */
$form->saveAsSettings( $values );
/* Refresh the locally stored license info */
if( Db::i()->checkForTable( 'core_store' ) )
{
unset( Store::i()->license_data );
$licenseData = IPS::licenseKey();
}
else
{
/* Call the main server */
$licenseData = $this->getLicenseData();
}
/* Reset some vars now */
$active = ( isset( $licenseData['expires'] ) and $licenseData['expires'] AND strtotime( $licenseData['expires'] ) > time() ) ? TRUE : ( ( isset( $licenseData['active'] ) and $licenseData['active'] ) ? TRUE : FALSE );
if( $active )
{
$form = NULL;
}
}
}
if( $active )
{
/* Clear any caches or else we might not see new versions on the next screen */
if ( isset( Store::i()->applications ) )
{
unset( Store::i()->applications );
}
Output::i()->redirect( Url::internal( "controller=applications" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
}
Output::i()->title = Member::loggedIn()->language()->addToStack('license');
Output::i()->output = Theme::i()->getTemplate( 'global' )->license( $form, $active );
Output::i()->redirect( \IPS\Http\Url::internal( "controller=applications" )->setQueryString( 'key', $_SESSION['uniqueKey'] ) );
}
/**
@@ -102,18 +102,7 @@ class systemcheck extends Controller
/* Check we have the latest version and run an md5 check */
$incorrectFiles = array();
if ( UPGRADE_MD5_CHECK )
{
try
{
$incorrectFiles = Application::md5Check( Application::getAvailableVersion('core') );
if ( count( $incorrectFiles ) )
{
$canProceed = FALSE;
}
}
catch ( Exception $e ) { }
}
/* Or do not check :) */
/* Display */
if ( $canProceed )