Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

+32 -45
View File
@@ -45,6 +45,9 @@ class _Upgrade
{
$settings['auth_types'] = \IPS\Login::AUTH_TYPE_USERNAME;
}
/* < 4.3 didn't allow this handler to be disabled, make sure that it is enabled (some communities may have worked around this limitation) */
$row['login_acp'] = TRUE;
$row['login_enabled'] = TRUE;
break;
case 'facebook':
$classname = 'IPS\\Login\\Handler\\OAuth2\\Facebook';
@@ -122,6 +125,7 @@ class _Upgrade
\IPS\Lang::saveCustom( 'core', "login_method_{$id}", $title );
\IPS\Db::i()->update( 'core_members_known_devices', array( 'login_handler' => $id ), array( 'login_handler=?', $row['login_key'] ) );
\IPS\Db::i()->update( 'core_profile_steps', array( 'step_subcompletion_act' => $id ), array( 'step_completion_act=? and step_subcompletion_act=?', 'social_login', $row['login_key'] ) );
}
return true;
@@ -316,21 +320,42 @@ class _Upgrade
/**
* Step 3
* Drop old columns
* Adjust the members table
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
$columnsToDrop = array();
$statements = array(
'DROP COLUMN ipsconnect_id',
'DROP COLUMN ipsconnect_revalidate_url',
'CHANGE members_pass_hash members_pass_hash VARCHAR(255) NULL DEFAULT NULL',
'ADD INDEX last_activity (last_activity)'
);
foreach ( array('fb_uid','fb_token','live_id','live_token','twitter_id','twitter_token','twitter_secret','tc_last_sid_import','tc_photo','tc_bwoptions','fb_photo','fb_photo_thumb','fb_bwoptions','google_id','google_token','linkedin_id','linkedin_token') as $col )
{
if ( \IPS\Db::i()->checkForColumn( 'core_members', $col ) )
{
$columnsToDrop[] = $col;
$statements[] = 'DROP COLUMN ' . $col;
}
}
\IPS\Db::i()->dropColumn( 'core_members', $columnsToDrop );
$toRunQueries = array( array(
'table' => 'core_members',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "core_members " . implode( ', ', $statements )
) );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
if ( count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 4 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
return TRUE;
}
@@ -341,7 +366,7 @@ class _Upgrade
*/
public function step3CustomTitle()
{
return 'Removing unused login data';
return 'Adjusting members table';
}
/**
@@ -521,49 +546,11 @@ class _Upgrade
/**
* Step 9
* 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()
public function step9()
{
$queries = array();
@@ -622,7 +609,7 @@ class _Upgrade
*
* @return string
*/
public function step10CustomTitle()
public function step9CustomTitle()
{
return "Removing orphaned member data";
}