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\setup\upg_103000;
|
||||
|
||||
/* 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;
|
||||
@@ -100,7 +100,7 @@ class _Upgrade
|
||||
$settings['button_text'] = NULL;
|
||||
$settings['button_icon'] = '';
|
||||
$settings['show_in_ucp'] = 'loggedin';
|
||||
$settings['update_name_changes'] = ( defined( '\IPS\CONNECT_NOSYNC_NAMES' ) and \IPS\CONNECT_NOSYNC_NAMES ) ? 'disabled' : 'force';
|
||||
$settings['update_name_changes'] = ( \defined( '\IPS\CONNECT_NOSYNC_NAMES' ) and \IPS\CONNECT_NOSYNC_NAMES ) ? 'disabled' : 'force';
|
||||
$settings['update_email_changes'] = 'force';
|
||||
break;
|
||||
case 'convert':
|
||||
@@ -190,7 +190,7 @@ class _Upgrade
|
||||
}
|
||||
if ( $where )
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_members', implode( $where, ' OR ' ), 'member_id ASC', array( $limit, 500 ) ) as $member )
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_members', implode( ' OR ', $where ), 'member_id ASC', array( $limit, 500 ) ) as $member )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
@@ -307,7 +307,7 @@ class _Upgrade
|
||||
}
|
||||
if ( $where )
|
||||
{
|
||||
$_SESSION['_step2Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_members', implode( $where, ' OR ' ) )->first();
|
||||
$_SESSION['_step2Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_members', implode( ' OR ', $where ) )->first();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -348,7 +348,7 @@ class _Upgrade
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 4 ) ) );
|
||||
|
||||
@@ -400,7 +400,7 @@ class _Upgrade
|
||||
*/
|
||||
public function step5()
|
||||
{
|
||||
if ( \IPS\Settings::i()->sparkpost_api_key AND \IPS\Settings::i()->sparkpost_use_for )
|
||||
if ( \IPS\Settings::i()->mail_method === 'sparkpost' AND \IPS\Settings::i()->sparkpost_api_key AND \IPS\Settings::i()->sparkpost_use_for )
|
||||
{
|
||||
$newSettings = array(
|
||||
'mail_method' => 'smtp',
|
||||
@@ -480,7 +480,7 @@ class _Upgrade
|
||||
/* Usage reporting settings */
|
||||
\IPS\Db::i()->replace( 'core_sys_conf_settings', array(
|
||||
'conf_key' => 'usage_reporting',
|
||||
'conf_value' => intval( $_SESSION['upgrade_options']['core']['103000']['usage_reporting'] ),
|
||||
'conf_value' => \intval( $_SESSION['upgrade_options']['core']['103000']['usage_reporting'] ),
|
||||
'conf_default' => 1,
|
||||
'conf_app' => 'core'
|
||||
) );
|
||||
@@ -546,11 +546,49 @@ class _Upgrade
|
||||
|
||||
/**
|
||||
* Step 9
|
||||
* Remove orphaned known device data
|
||||
* Remove announcement widgets
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function step9()
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( 'id, widgets', 'core_widget_areas', array( 'widgets LIKE(?)', '"key": "announcements"' ) )->setKeyField('id')->setValueField( 'widgets' ) as $id => $config )
|
||||
{
|
||||
$json = json_decode( $config, TRUE );
|
||||
|
||||
foreach( $json as $key => $value )
|
||||
{
|
||||
if( $value['key'] == 'announcements' AND $value['app'] == 'core' )
|
||||
{
|
||||
unset( $json[ $key ] );
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Db::i()->update( 'core_widget_areas', array( 'widgets' => json_encode( $json ) ), array( 'id=?', $id ) );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete( 'core_widgets', array( 'app=? AND `key`=?', 'core', 'announcements' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step9CustomTitle()
|
||||
{
|
||||
return "Removing announcement widgets";
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 10
|
||||
* Remove orphaned known device data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function step10()
|
||||
{
|
||||
$queries = array();
|
||||
|
||||
@@ -585,14 +623,14 @@ class _Upgrade
|
||||
catch( \UnderflowException $e ) {}
|
||||
|
||||
/* Is this site affected by any of these issues? */
|
||||
if( !count( $queries ) )
|
||||
if( !\count( $queries ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $queries );
|
||||
|
||||
if ( count( $toRun ) )
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 11 ) ) );
|
||||
|
||||
@@ -609,7 +647,7 @@ class _Upgrade
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step9CustomTitle()
|
||||
public function step10CustomTitle()
|
||||
{
|
||||
return "Removing orphaned member data";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user