Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+62 -92
View File
@@ -7,7 +7,6 @@
* @package IPS Social Suite
* @since 18 Feb 2013
* @version SVN_VERSION_NUMBER
* @modified 13.09.2015 by IAF (Reason: Nulling) | File Revision: 5.
*/
namespace IPS;
@@ -54,6 +53,7 @@ class IPS
'IN_DEV' => FALSE,
'DEV_USE_WHOOPS' => TRUE,
'DEV_USE_FURL_CACHE' => FALSE,
'DEV_USE_MENU_CACHE' => FALSE,
'DEBUG_JS' => FALSE,
'DEV_DEBUG_JS' => TRUE,
'DEV_DEBUG_CSS' => FALSE,
@@ -93,9 +93,8 @@ class IPS
'NEXUS_LKEY_API_CHECK_IP' => TRUE,
'NEXUS_LKEY_API_ALLOW_IP_OVERRIDE' => FALSE,
'UPGRADE_MANUAL_THRESHOLD' => 250000,
'UPGRADE_LARGE_THRESHOLD' => 100000,
'HTMLENTITIES' => ( version_compare( phpversion(), '5.4.0', '<' ) ) ? ENT_IGNORE : ENT_DISALLOWED,
'SUITE_UNIQUE_KEY' => mb_substr( md5( 'CV01' . '$Rev: 3023$'), 10, 10 ),
'SUITE_UNIQUE_KEY' => mb_substr( md5( '12bde_mafia' . '$Rev: 3023$'), 10, 10 ),
'USE_DEVELOPMENT_BUILDS' => FALSE,
'DEV_WHOOPS_EDITOR' => NULL,
'DEFAULT_REQUEST_TIMEOUT' => 5, // In seconds
@@ -179,18 +178,9 @@ class IPS
}
/* Init hooks */
if ( file_exists( \IPS\ROOT_PATH . '/plugins/hooks.txt' ) )
{
$mtime = date( 'jny', filemtime( \IPS\ROOT_PATH . '/plugins/hooks.txt' ) );
$encrypted = file_get_contents( \IPS\ROOT_PATH . '/plugins/hooks.txt' );
$decrypted = '';
for ( $i = 0; $i < \strlen( $encrypted ); $i++ )
{
$decrypted .= chr( ord( \substr( $encrypted, $i, 1 ) ) - \substr( $mtime, ( $i % \strlen( $mtime ) ) - 1, 1 ) );
}
if ( !( self::$hooks = @json_decode( $decrypted, TRUE ) ) )
if ( file_exists( \IPS\ROOT_PATH . '/plugins/hooks.php' ) )
{
if ( !( self::$hooks = require( \IPS\ROOT_PATH . '/plugins/hooks.php' ) ) )
{
self::$hooks = array();
}
@@ -534,87 +524,69 @@ class IPS
*/
public static function licenseKey()
{
/* We haven't license key saved in settings? Saving... */
if ( !\IPS\Settings::i()->ipb_reg_number ) {
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => 'LICENSE KEY GOES HERE!-123456789' ), array( 'conf_key=?', 'ipb_reg_number' ) );
\IPS\Settings::i()->ipb_reg_number = 'LICENSE KEY GOES HERE!-123456789';
}
/* Get the cached value */
$cached = NULL;
if ( isset( \IPS\Data\Store::i()->license_data ) ) //License data exists in cache?
$setFetched = FALSE;
if ( isset( \IPS\Data\Store::i()->license_data ) )
{
$cached = \IPS\Data\Store::i()->license_data;
/* Keep license data updated in cache store */
if ( $cached['fetched'] < ( time() - 1814400 ) )
/* If it's younger than 21 days, just use that */
if ( $cached['fetched'] > ( time() - 1814400 ) )
{
/* Data older, than 21 days. Updating... */
unset( \IPS\Data\Store::i()->license_data );
$response = array(
'key' => \IPS\Settings::i()->ipb_reg_number, //IPS Key
'active' => \IPS\Settings::i()->ipb_license_active, //License Active?
'cloud' => \IPS\Settings::i()->ipb_license_cloud, //We are "cloud" clients?
'url' => \IPS\Settings::i()->ipb_license_url, //Forum URL
'test_url' => \IPS\Settings::i()->ipb_license_test_url, //Test URL
'expires' => \IPS\Settings::i()->ipb_license_expires, //When our license will expire?
'products' => array( //Array of components. Can we use...
'forums' => \IPS\Settings::i()->ipb_license_product_forums, //...IP.Board / Forums?
'calendar' => \IPS\Settings::i()->ipb_license_product_calendar, //...IP.Calendar / Calendar?
'blog' => \IPS\Settings::i()->ipb_license_product_blog, //...IP.Blogs / Blogs?
'gallery' => \IPS\Settings::i()->ipb_license_product_gallery, //...IP.Gallery / Gallery?
'downloads' => \IPS\Settings::i()->ipb_license_product_downloads, //...IP.Downloads / Downloads?
'cms' => \IPS\Settings::i()->ipb_license_product_cms, //...IP.Content / Pages?
'nexus' => \IPS\Settings::i()->ipb_license_product_nexus, //...IP.Nexus / Commerce?
'spam' => FALSE, //...IPS Spam Service? No! Hardcoded to prevent requests to IPS servers.
'copyright' => \IPS\Settings::i()->ipb_license_product_copyright, //...remove copyright function?
),
'chat_limit' => \IPS\Settings::i()->ipb_license_chat_limit, //How many users can use IP.Chat?
'support' => \IPS\Settings::i()->ipb_license_support, //Can we use Support?
);
\IPS\Data\Store::i()->license_data = array( //Add information to cache...
'fetched' => time(),
'data' => $response,
);
return $response;
} else {
return $cached['data'];
}
/* If the license is not expired, return the data */
if( !$cached['data']['expires'] OR strtotime( $cached['data']['expires'] ) > time() )
{
return $cached['data'];
}
/* Otherwise if the license is expired but we've automatically refetched, return the data */
else if( $cached['data']['expires'] AND strtotime( $cached['data']['expires'] ) < time() AND isset( $cached['data']['refetched'] ) )
{
return $cached['data'];
}
/* Otherwise remember to set the 'refetched' flag */
else
{
$setFetched = TRUE;
}
}
}
else
/* Call the main server */
try
{
/* Cached license data is missing? Creating... */
$response = array(
'key' => \IPS\Settings::i()->ipb_reg_number, //IPS Key
'active' => \IPS\Settings::i()->ipb_license_active, //License Active?
'cloud' => \IPS\Settings::i()->ipb_license_cloud, //We are "cloud" clients?
'url' => \IPS\Settings::i()->ipb_license_url, //Forum URL
'test_url' => \IPS\Settings::i()->ipb_license_test_url, //Test URL
'expires' => \IPS\Settings::i()->ipb_license_expires, //When our license will expire?
'products' => array( //Array of components. Can we use...
'forums' => \IPS\Settings::i()->ipb_license_product_forums, //...IP.Board // Forums?
'calendar' => \IPS\Settings::i()->ipb_license_product_calendar, //...IP.Calendar // Calendar?
'blog' => \IPS\Settings::i()->ipb_license_product_blog, //...IP.Blogs // Blogs?
'gallery' => \IPS\Settings::i()->ipb_license_product_gallery, //...IP.Gallery // Gallery?
'downloads' => \IPS\Settings::i()->ipb_license_product_downloads, //...IP.Downloads // Downloads?
'cms' => \IPS\Settings::i()->ipb_license_product_cms, //...IP.Content // Pages?
'nexus' => \IPS\Settings::i()->ipb_license_product_nexus, //...IP.Nexus // Commerce?
'spam' => FALSE, //...IPS Spam Service? No! Hardcoded to prevent requests to IPS servers.
'copyright' => \IPS\Settings::i()->ipb_license_product_copyright, //...remove copyright function?
),
'chat_limit' => \IPS\Settings::i()->ipb_license_chat_limit, //How many users can use IP.Chat?
'support' => \IPS\Settings::i()->ipb_license_support, //Can we use Support?
);
\IPS\Data\Store::i()->license_data = array( //Add information to cache...
'fetched' => time(),
'data' => $response,
);
return $response;
$response = \IPS\Http\Url::ips( 'license/' . \IPS\Settings::i()->ipb_reg_number )->request()->get();
if ( $response->httpResponseCode == 404 )
{
return NULL;
}
$response = $response->decodeJson();
}
catch ( \Exception $e )
{
/* If we can't access the license server right now, store something in cache to prevent a request on every page load. We
set fetched to 20 days ago so that this cache is only good for 1 day instead of 21 days however. */
if( $cached === NULL )
{
\IPS\Data\Store::i()->license_data = array( 'fetched' => time() - 1728000, 'data' => NULL );
}
/* If the server is offline right now, use the cached value from above */
return $cached;
}
/* Update the license info in the store */
$licenseData = array( 'fetched' => time(), 'data' => $response );
if( $setFetched )
{
$licenseData['refetched'] = 1;
}
\IPS\Data\Store::i()->license_data = $licenseData;
/* Return */
return $response;
}
/**
@@ -627,11 +599,9 @@ class IPS
*/
public static function checkLicenseKey( $val, $url )
{
//Do Nothing
return $false;
}
}
/* Init */
IPS::init();
/* Nulled by IandroidFan (IAF) */
IPS::init();