Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -6,63 +6,37 @@
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
|
||||
* @since 31 May 2023
|
||||
* @since 28 Apr 2023
|
||||
*/
|
||||
|
||||
namespace IPS\core\setup\upg_107690;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\core\AdminNotification;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.7.11 Beta 1 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
class Upgrade
|
||||
{
|
||||
/**
|
||||
* Charts Menu
|
||||
* Finish - This is run after all apps have been upgraded
|
||||
*
|
||||
* @return bool|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)
|
||||
* @return mixed 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)
|
||||
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
|
||||
*/
|
||||
public function step1()
|
||||
public function finish()
|
||||
{
|
||||
/* Try and make sure My Charts is added to the top of the stats menu */
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_acp_tab_order' ) AS $order )
|
||||
{
|
||||
$data = json_decode( $order['data'], true );
|
||||
|
||||
if ( isset( $data['stats'] ) )
|
||||
{
|
||||
foreach( $data['stats'] AS $k => $v )
|
||||
{
|
||||
if ( $v === '' OR $v === 'core_overview' )
|
||||
{
|
||||
unset( $data['stats'][ $k ] );
|
||||
}
|
||||
}
|
||||
|
||||
array_unshift( $data['stats'], '', 'core_overview' ); // This looks weird but each entry in the order has a blank entry at the beginning, so preserve that.
|
||||
}
|
||||
|
||||
\IPS\Db::i()->update( 'core_acp_tab_order', array( 'data' => json_encode( $data ) ), array( "`id`=?", $order['id'] ) );
|
||||
}
|
||||
|
||||
/* Set a flag to force ACP order cookies to be reset */
|
||||
/* The setting won't have been inserted yet at this point */
|
||||
\IPS\Db::i()->replace( 'core_sys_conf_settings', array(
|
||||
'conf_key' => 'acp_menu_cookie_rebuild',
|
||||
'conf_value' => '1',
|
||||
'conf_default' => '0',
|
||||
'conf_app' => 'core'
|
||||
) );
|
||||
AdminNotification::remove( 'core', 'ConfigurationError', 'usernameLoginEnabled' );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// You can create as many additional methods (step2, step3, etc.) as is necessary.
|
||||
// Each step will be executed in a new HTTP request
|
||||
}
|
||||
Reference in new issue
Block a user