Version 4.1.19.4

This commit is contained in:
Neo committed 2025-12-19 05:42:01 -08:00
1 parent 2bd5025018
commit 0dc2aee5ed
312 files changed
+53730 -32118

No files matched your search

+5 -22
View File
@@ -25,28 +25,11 @@ class _Upgrade
{
/**
* Step 1
* Fix announcements
*
* @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 step1()
{
if ( \IPS\Db::i()->select( 'COUNT(*)', 'core_announcements', 'announce_active=1' )->first() )
{
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => 1 ), array( 'conf_key=?', 'announcements_exist' ) );
unset( \IPS\Data\Store::i()->settings );
}
return true;
}
/**
* Step 2
* Remove bulk mail task
*
* @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 step2()
public function step1()
{
\IPS\Db::i()->delete('core_tasks', array('`key`=? and app=?', 'bulkmail', 'core' ) );
@@ -54,12 +37,12 @@ class _Upgrade
}
/**
* Step 3
* Step 2
* Fix core_menu items
*
* @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()
public function step2()
{
\IPS\Db::i()->update( 'core_menu', array( 'is_menu_child' => 0 ), array( 'parent IS NULL' ) );
unset( \IPS\Data\Store::i()->frontNavigation );
@@ -68,12 +51,12 @@ class _Upgrade
}
/**
* Step 4
* Step 3
* Fix admin permissions - remove not existing groups
*
* @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 step4()
public function step3()
{
\IPS\Db::i()->delete( 'core_admin_permission_rows', array( 'row_id_type=? AND ' . \IPS\Db::i()->in( 'row_id', iterator_to_array( \IPS\Db::i()->select('g_id', 'core_groups' ) ), TRUE ), 'group' ) );
unset ( \IPS\Data\Store::i()->administrators );
@@ -0,0 +1,42 @@
<?php
/**
* @brief 4.1.19.1 Upgrade Code
* @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
* @since 17 Mar 2017
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_101094;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.1.19.1 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Fix announcements
*
* @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 step1()
{
if ( \IPS\Db::i()->select( 'COUNT(*)', 'core_announcements', 'announce_active=1' )->first() )
{
\IPS\Db::i()->replace( 'core_sys_conf_settings', array( 'conf_value' => 1, 'conf_key' => 'announcements_exist', 'conf_app' => 'core', 'conf_default' => 0 ) );
unset( \IPS\Data\Store::i()->settings );
}
return true;
}
}
+185 -123
View File
@@ -115,61 +115,71 @@ class _Upgrade
'length' => 150,
'allow_null' => false
) );
\IPS\Db::i()->dropIndex( 'core_sys_cp_sessions', 'session_running_time' );
\IPS\Db::i()->addIndex( 'core_sys_cp_sessions', array(
'type' => 'key',
'name' => 'session_running_time',
'columns' => array( 'session_running_time' )
) );
\IPS\Db::i()->dropIndex( 'core_sys_cp_sessions', 'session_member_id' );
\IPS\Db::i()->addIndex( 'core_sys_cp_sessions', array(
'type' => 'key',
'name' => 'session_member_id',
'columns' => array( 'session_member_id' )
) );
\IPS\Db::i()->dropIndex( 'upgrade_history', 'upgrades' );
\IPS\Db::i()->addIndex( 'upgrade_history', array(
'type' => 'key',
'name' => 'upgrades',
'columns' => array( 'upgrade_app', 'upgrade_version_id' )
) );
\IPS\Db::i()->dropIndex( 'validating', 'lost_pass' );
\IPS\Db::i()->addIndex( 'validating', array(
'type' => 'key',
'name' => 'lost_pass',
'columns' => array( 'lost_pass' )
) );
\IPS\Db::i()->dropIndex( 'validating', 'coppa_user' );
\IPS\Db::i()->addIndex( 'validating', array(
'type' => 'key',
'name' => 'coppa_user',
'columns' => array( 'coppa_user' )
) );
\IPS\Db::i()->dropIndex( 'api_log', 'api_log_date' );
\IPS\Db::i()->addIndex( 'api_log', array(
'type' => 'key',
'name' => 'api_log_date',
'columns' => array( 'api_log_date' )
) );
\IPS\Db::i()->dropIndex( 'core_applications', 'app_directory' );
\IPS\Db::i()->addIndex( 'core_applications', array(
'type' => 'key',
'name' => 'app_directory',
'columns' => array( 'app_directory' )
) );
\IPS\Db::i()->dropIndex( 'bulk_mail', 'mail_start' );
\IPS\Db::i()->addIndex( 'bulk_mail', array(
'type' => 'key',
'name' => 'mail_start',
'columns' => array( 'mail_start' )
) );
\IPS\Db::i()->dropIndex( 'skin_collections', 'set_is_default' );
\IPS\Db::i()->addIndex( 'skin_collections', array(
'type' => 'key',
'name' => 'set_is_default',
'columns' => array( 'set_is_default' )
) );
\IPS\Db::i()->dropIndex( 'rc_classes', 'onoff' );
\IPS\Db::i()->addIndex( 'rc_classes', array(
'type' => 'key',
'name' => 'onoff',
@@ -189,13 +199,15 @@ class _Upgrade
{
\IPS\Db::i()->delete( 'task_manager', "task_id NOT IN(" . implode( ',', $tasks ) . ")" );
}
\IPS\Db::i()->dropIndex( 'task_manager', 'task_key' );
\IPS\Db::i()->addIndex( 'task_manager', array(
'type' => 'unique',
'name' => 'task_key',
'columns' => array( 'task_application', 'task_key' )
) );
\IPS\Db::i()->dropIndex( 'announcements', 'announce_end' );
\IPS\Db::i()->addIndex( 'announcements', array(
'type' => 'key',
'name' => 'announce_end',
@@ -211,50 +223,58 @@ class _Upgrade
'name' => 'daterange',
'columns' => array( 'event_approved', 'event_unix_from', 'event_unix_to' )
) );
\IPS\Db::i()->dropIndex( 'cal_calendars', 'cal_rss_export' );
\IPS\Db::i()->addIndex( 'cal_calendars', array(
'type' => 'key',
'name' => 'cal_rss_export',
'columns' => array( 'cal_rss_export' )
) );
}
\IPS\Db::i()->dropIndex( 'core_sys_conf_settings', 'conf_group' );
\IPS\Db::i()->addIndex( 'core_sys_conf_settings', array(
'type' => 'key',
'name' => 'conf_group',
'columns' => array( 'conf_group', 'conf_position', 'conf_title' )
) );
\IPS\Db::i()->dropIndex( 'core_uagent_groups', 'ugroup_title' );
\IPS\Db::i()->addIndex( 'core_uagent_groups', array(
'type' => 'key',
'name' => 'ugroup_title',
'columns' => array( 'ugroup_title' )
) );
\IPS\Db::i()->dropIndex( 'core_uagents', 'ordering' );
\IPS\Db::i()->addIndex( 'core_uagents', array(
'type' => 'key',
'name' => 'ordering',
'columns' => array( 'uagent_position', 'uagent_key' )
) );
\IPS\Db::i()->dropIndex( 'core_sys_conf_settings', 'conf_add_cache' );
\IPS\Db::i()->addIndex( 'core_sys_conf_settings', array(
'type' => 'key',
'name' => 'conf_add_cache',
'columns' => array( 'conf_add_cache' )
) );
\IPS\Db::i()->dropIndex( 'emoticons', 'emo_set' );
\IPS\Db::i()->addIndex( 'emoticons', array(
'type' => 'key',
'name' => 'emo_set',
'columns' => array( 'emo_set' )
) );
\IPS\Db::i()->dropIndex( 'skin_templates', 'template_set_id' );
\IPS\Db::i()->addIndex( 'skin_templates', array(
'type' => 'key',
'name' => 'template_set_id',
'columns' => array( 'template_set_id' )
) );
\IPS\Db::i()->dropIndex( 'skin_css', 'css_set_id' );
\IPS\Db::i()->addIndex( 'skin_css', array(
'type' => 'key',
'name' => 'css_set_id',
@@ -267,34 +287,42 @@ class _Upgrade
'name' => 'map_user',
'columns' => array( 'map_user_id', 'map_folder_id', 'map_last_topic_reply' )
) );
\IPS\Db::i()->addColumn( 'validating', array(
'name' => 'spam_flag',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
if( !\IPS\Db::i()->checkForColumn( 'validating', 'spam_flag' ) )
{
\IPS\Db::i()->addColumn( 'validating', array(
'name' => 'spam_flag',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
}
\IPS\Db::i()->dropIndex( 'validating', 'spam_flag' );
\IPS\Db::i()->addIndex( 'validating', array(
'type' => 'key',
'name' => 'spam_flag',
'columns' => array( 'spam_flag' )
) );
\IPS\Db::i()->dropIndex( 'validating', 'member_id' );
\IPS\Db::i()->addIndex( 'validating', array(
'type' => 'key',
'name' => 'member_id',
'columns' => array( 'member_id' )
) );
\IPS\Db::i()->addColumn( 'core_sys_lang', array(
'name' => 'lang_protected',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
if( !\IPS\Db::i()->checkForColumn( 'core_sys_lang', 'lang_protected' ) )
{
\IPS\Db::i()->addColumn('core_sys_lang', array(
'name' => 'lang_protected',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
));
}
\IPS\Db::i()->createTable( array(
'name' => 'member_status_actions',
@@ -1385,61 +1413,82 @@ class _Upgrade
) );
\IPS\Db::i()->query( "INSERT INTO " . \IPS\Db::i()->prefix . "member_status_updates (status_member_id, status_date, status_content, status_replies, status_is_latest ) SELECT pp_member_id, pp_status_update, pp_status, 0, 1 FROM " . \IPS\Db::i()->prefix . "profile_portal WHERE LENGTH(pp_status) > 0" );
\IPS\Db::i()->addColumn( 'groups', array(
'name' => 'g_max_notifications',
'type' => 'mediumint',
'length' => 0,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'groups', array(
'name' => 'g_max_bgimg_upload',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'rc_classes', array(
'name' => 'app',
'type' => 'varchar',
'length' => 32,
'allow_null' => false
) );
\IPS\Db::i()->addColumn( 'forums', array(
'name' => 'disable_sharelinks',
'type' => 'int',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'forums', array(
'name' => 'deleted_posts',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'forums', array(
'name' => 'deleted_topics',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'forums', array(
'name' => 'rules_raw_html',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
if( !\IPS\Db::i()->checkForColumn( 'groups', 'g_max_notifications' ) )
{
\IPS\Db::i()->addColumn('groups', array(
'name' => 'g_max_notifications',
'type' => 'mediumint',
'length' => 0,
'allow_null' => false,
'default' => 0
));
}
if( !\IPS\Db::i()->checkForColumn( 'groups', 'g_max_bgimg_upload' ) )
{
\IPS\Db::i()->addColumn('groups', array(
'name' => 'g_max_bgimg_upload',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
));
}
if( !\IPS\Db::i()->checkForColumn( 'rc_classes', 'app' ) )
{
\IPS\Db::i()->addColumn('rc_classes', array(
'name' => 'app',
'type' => 'varchar',
'length' => 32,
'allow_null' => false
));
}
if( !\IPS\Db::i()->checkForColumn( 'forums', 'disable_sharelinks' ) )
{
\IPS\Db::i()->addColumn('forums', array(
'name' => 'disable_sharelinks',
'type' => 'int',
'length' => 1,
'allow_null' => false,
'default' => 0
));
}
if( !\IPS\Db::i()->checkForColumn( 'forums', 'deleted_posts' ) )
{
\IPS\Db::i()->addColumn('forums', array(
'name' => 'deleted_posts',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
));
}
if( !\IPS\Db::i()->checkForColumn( 'forums', 'deleted_topics' ) )
{
\IPS\Db::i()->addColumn('forums', array(
'name' => 'deleted_topics',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
));
}
if( !\IPS\Db::i()->checkForColumn( 'forums', 'rules_raw_html' ) )
{
\IPS\Db::i()->addColumn('forums', array(
'name' => 'rules_raw_html',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
));
}
\IPS\Db::i()->update( 'rc_classes', array( 'app' => 'core' ), array( 'my_class=?', 'default' ) );
\IPS\Db::i()->update( 'rc_classes', array( 'app' => 'forums' ), array( 'my_class=?', 'post' ) );
@@ -1473,21 +1522,26 @@ class _Upgrade
'default' => null
) );
}
\IPS\Db::i()->addColumn( 'skin_templates', array(
'name' => 'template_master_key',
'type' => 'varchar',
'length' => 100,
'allow_null' => false,
'default' => ''
) );
if( !\IPS\Db::i()->checkForColumn( 'skin_templates', 'template_master_key' ) )
{
\IPS\Db::i()->addColumn('skin_templates', array(
'name' => 'template_master_key',
'type' => 'varchar',
'length' => 100,
'allow_null' => false,
'default' => ''
));
}
\IPS\Db::i()->dropIndex( 'skin_templates', 'template_master_key' );
\IPS\Db::i()->addIndex( 'skin_templates', array(
'type' => 'key',
'name' => 'template_master_key',
'columns' => array( 'template_master_key' )
) );
\IPS\Db::i()->dropIndex( 'skin_css', 'css_master_key' );
\IPS\Db::i()->addColumn( 'skin_css', array(
'name' => 'css_master_key',
'type' => 'varchar',
@@ -1495,7 +1549,8 @@ class _Upgrade
'allow_null' => false,
'default' => ''
) );
\IPS\Db::i()->dropIndex( 'skin_collections', 'set_master_key' );
\IPS\Db::i()->addColumn( 'skin_collections', array(
'name' => 'set_master_key',
'type' => 'varchar',
@@ -1503,33 +1558,40 @@ class _Upgrade
'allow_null' => false,
'default' => ''
) );
/* @note Here we previously performed some further updates on skins that are no longer relevant */
\IPS\Db::i()->addColumn( 'skin_collections', array(
'name' => 'set_order',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
if( !\IPS\Db::i()->checkForColumn( 'skin_collections', 'set_order' ) )
{
\IPS\Db::i()->addColumn('skin_collections', array(
'name' => 'set_order',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
));
}
\IPS\Db::i()->dropIndex( 'skin_collections', 'set_order' );
\IPS\Db::i()->addIndex( 'skin_collections', array(
'type' => 'key',
'name' => 'set_order',
'columns' => array( 'set_order' )
) );
\IPS\Db::i()->addColumn( 'skin_replacements', array(
'name' => 'replacement_master_key',
'type' => 'varchar',
'length' => 100,
'allow_null' => false,
'default' => ''
) );
if( !\IPS\Db::i()->checkForColumn( 'skin_replacements', 'replacement_master_key' ) )
{
\IPS\Db::i()->addColumn('skin_replacements', array(
'name' => 'replacement_master_key',
'type' => 'varchar',
'length' => 100,
'allow_null' => false,
'default' => ''
));
}
\IPS\Db::i()->update( 'skin_replacements', array( 'replacement_master_key' => 'root' ), array( 'replacement_set_id=?', 0 ) );
\IPS\Db::i()->dropIndex( 'skin_templates', 'template_name' );
\IPS\Db::i()->addIndex( 'skin_templates', array(
'type' => 'key',
'name' => 'template_name',
@@ -9,5 +9,5 @@
* @version SVN_VERSION_NUMBER
*/
$message = \IPS\Theme::i()->getTemplate( 'global' )->block( NULL, "Пожалуйста, уделите несколько минут на изучение Вашего сообщества на наличие каких-либо ошибок. Если какие-либо ошибки были найдены, пожалуйста, воспользуйтесь инструментом Поддержка в админцентре для решения проблем." );
$message = \IPS\Theme::i()->getTemplate( 'global' )->block( NULL, "Please take a few minutes to thoroughly review your community for any issues. If any issues are found, please use the Support tool in the ACP for further assistance." );
+15 -4
View File
@@ -1173,7 +1173,7 @@ class _Upgrade
foreach( $_SESSION['pfields'] as $k => $v )
{
$options = explode( '|', $v );
$options = explode( '|', $v['content'] );
$realOptions = array();
foreach( $options as $_index => $option )
@@ -1194,7 +1194,12 @@ class _Upgrade
{
if( $_option AND isset( $realOptions[ $_option ] ) )
{
$_values[] = $realOptions[ $_option ][1];
$key = 0;
if ( $v['use_keys'] )
{
$key = 1;
}
$_values[] = $realOptions[ $_option ][$key];
}
}
@@ -1202,7 +1207,12 @@ class _Upgrade
}
else
{
$update['field_' . $k ] = ( isset( $realOptions[ $row['field_' . $k ] ] ) ) ? $realOptions[ $row['field_' . $k ] ][1] : NULL;
$key = 0;
if ( $v['use_keys'] )
{
$key = 1;
}
$update['field_' . $k ] = ( isset( $realOptions[ $row['field_' . $k ] ] ) ) ? $realOptions[ $row['field_' . $k ] ][$key] : NULL;
}
}
}
@@ -1309,7 +1319,7 @@ class _Upgrade
$_SESSION['pfields'] = array();
}
$_SESSION['pfields'][ $field['pf_id'] ] = $field['pf_content'];
$_SESSION['pfields'][ $field['pf_id'] ] = array( 'content' => $field['pf_content'], 'use_keys' => ( $update['pf_type'] == 'CheckboxSet' ) ? TRUE : FALSE );
$extra[ $field['pf_id'] ] = $field['pf_id'];
$update['pf_content'] = json_encode( $newOptions );
}
@@ -3373,6 +3383,7 @@ DROP INDEX like_lookup_area"
/* Clear out any existing module records */
\IPS\Db::i()->delete( 'core_modules' );
\IPS\Db::i()->delete( 'core_permission_index', array( 'perm_type=?', 'module' ) );
/* Remove members app */
\IPS\Db::i()->delete( 'core_applications', array( 'app_directory=?', 'members' ) );