Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -0,0 +1,356 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "createTable",
|
||||
"params": [
|
||||
{
|
||||
"name": "core_geoip_cache",
|
||||
"columns": {
|
||||
"ip_address": {
|
||||
"name": "ip_address",
|
||||
"type": "VARCHAR",
|
||||
"length": 46,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"comment": "The IP address",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"date": {
|
||||
"name": "date",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"comment": "Unix timestamp of when the data was retrieved ",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"data": {
|
||||
"name": "data",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The JSON-encoded data returned by the service",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"PRIMARY": {
|
||||
"type": "primary",
|
||||
"name": "PRIMARY",
|
||||
"columns": [
|
||||
"ip_address"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
},
|
||||
"date": {
|
||||
"type": "key",
|
||||
"name": "date",
|
||||
"columns": [
|
||||
"date"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"core_polls",
|
||||
"tid"
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"core_polls",
|
||||
"forum_id"
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
{
|
||||
"conf_value": "cron"
|
||||
},
|
||||
"conf_key='task_use_cron' and conf_value='1'"
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"core_sys_conf_settings",
|
||||
{
|
||||
"conf_value": "normal"
|
||||
},
|
||||
"conf_key='task_use_cron' and conf_value='0'"
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "createTable",
|
||||
"params": [
|
||||
{
|
||||
"name": "core_api_keys",
|
||||
"columns": {
|
||||
"api_id": {
|
||||
"name": "api_id",
|
||||
"type": "CHAR",
|
||||
"length": 32,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "",
|
||||
"comment": "API Key",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"api_permissions": {
|
||||
"name": "api_permissions",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "JSON encoded details of which endpoints the key can access",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"api_allowed_ips": {
|
||||
"name": "api_allowed_ips",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "Comma-delimited allowed IPs",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"id": {
|
||||
"type": "primary",
|
||||
"name": "PRIMARY",
|
||||
"columns": [
|
||||
"api_id"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "createTable",
|
||||
"params": [
|
||||
{
|
||||
"name": "core_api_logs",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "BIGINT",
|
||||
"length": "20",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"binary": false,
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"auto_increment": true,
|
||||
"comment": "ID Number"
|
||||
},
|
||||
"endpoint": {
|
||||
"name": "endpoint",
|
||||
"type": "VARCHAR",
|
||||
"length": 255,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"comment": "The endpoint that was requested",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"method": {
|
||||
"name": "method",
|
||||
"type": "VARCHAR",
|
||||
"length": 32,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The HTTP request method which was used",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"api_key": {
|
||||
"name": "api_key",
|
||||
"type": "CHAR",
|
||||
"length": 32,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The API key that was used",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"ip_address": {
|
||||
"name": "ip_address",
|
||||
"type": "VARCHAR",
|
||||
"length": 46,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The IP address that the request came from",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"request_data": {
|
||||
"name": "request_data",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The request body",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"response_code": {
|
||||
"name": "response_code",
|
||||
"type": "CHAR",
|
||||
"length": 3,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The HTTP response code",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"response_output": {
|
||||
"name": "response_output",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The response output",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"date": {
|
||||
"name": "date",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"comment": "Timestamp of when request was made",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"is_bad_key": {
|
||||
"name": "is_bad_key",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "If this log is for a request with a bad key - used to prevent brute force ",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"PRIMARY": {
|
||||
"type": "primary",
|
||||
"name": "PRIMARY",
|
||||
"columns": [
|
||||
"id"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
},
|
||||
"date": {
|
||||
"type": "key",
|
||||
"name": "date",
|
||||
"columns": [
|
||||
"date"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
},
|
||||
"bruteforce": {
|
||||
"type": "key",
|
||||
"name": "bruteforce",
|
||||
"columns": [
|
||||
"ip_address",
|
||||
"is_bad_key"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.6 Upgrade Code
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @since 30 Dec 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\core\setup\upg_101021;
|
||||
|
||||
/* 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.6 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Rebuild imported status updates to address XSS issue
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Init */
|
||||
$perCycle = 250;
|
||||
$did = 0;
|
||||
$limit = intval( \IPS\Request::i()->extra );
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
/* Loop */
|
||||
foreach( \IPS\Db::i()->select( array( 'status_id', 'status_member_id', 'status_content' ), 'core_member_status_updates', array( 'status_imported=?', 1 ), 'status_id', array( $limit, $perCycle ) ) as $row )
|
||||
{
|
||||
/* Timeout? */
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
/* Step up */
|
||||
$did++;
|
||||
|
||||
/* Rebuild the content */
|
||||
$content = \IPS\Text\Parser::parseStatic( $row['status_content'], FALSE, NULL, \IPS\Member::load( $row['status_member_id'] ), 'core_Members' );
|
||||
|
||||
/* Save */
|
||||
\IPS\Db::i()->update( 'core_member_status_updates', array( 'status_content' => $content ), array( 'status_id=?', $row['status_id'] ) );
|
||||
}
|
||||
|
||||
/* Did we do anything? */
|
||||
if( $did )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( $_SESSION['_step1Count'] );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
|
||||
if( !isset( $_SESSION['_step1Count'] ) )
|
||||
{
|
||||
$_SESSION['_step1Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_member_status_updates', array( "status_imported=?", 1 ) )->first();
|
||||
}
|
||||
|
||||
return "Fixing Imported Status Updates (Upgraded so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user