Version 4.0.13.1 (nulled)
This commit is contained in:
1 parent
c6a86f0d9b
commit
3ba79295ee
19 files changed
+277
-490
No files matched your search
@@ -7,6 +7,7 @@
|
||||
* @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;
|
||||
@@ -94,7 +95,7 @@ class IPS
|
||||
'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( '6a5ac13' . '$Rev: 3023$'), 10, 10 ),
|
||||
'SUITE_UNIQUE_KEY' => mb_substr( md5( 'CV01' . '$Rev: 3023$'), 10, 10 ),
|
||||
'USE_DEVELOPMENT_BUILDS' => FALSE,
|
||||
'DEV_WHOOPS_EDITOR' => NULL,
|
||||
'DEFAULT_REQUEST_TIMEOUT' => 5, // In seconds
|
||||
@@ -533,47 +534,87 @@ class IPS
|
||||
*/
|
||||
public static function licenseKey()
|
||||
{
|
||||
/* Get the cached value */
|
||||
/* 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';
|
||||
}
|
||||
|
||||
$cached = NULL;
|
||||
if ( isset( \IPS\Data\Store::i()->license_data ) )
|
||||
if ( isset( \IPS\Data\Store::i()->license_data ) ) //License data exists in cache?
|
||||
{
|
||||
$cached = \IPS\Data\Store::i()->license_data;
|
||||
|
||||
/* If it's younger than 21 days, just use that */
|
||||
if ( $cached['fetched'] > ( time() - 1814400 ) )
|
||||
/* Keep license data updated in cache store */
|
||||
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'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Call the main server */
|
||||
try
|
||||
else
|
||||
{
|
||||
$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 );
|
||||
}
|
||||
/* 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?
|
||||
);
|
||||
|
||||
/* If the server is offline right now, use the cached value from above */
|
||||
return $cached;
|
||||
}
|
||||
|
||||
/* Update the license info in the store */
|
||||
\IPS\Data\Store::i()->license_data = array( 'fetched' => time(), 'data' => $response );
|
||||
\IPS\Data\Store::i()->license_data = array( //Add information to cache...
|
||||
'fetched' => time(),
|
||||
'data' => $response,
|
||||
);
|
||||
|
||||
/* Return */
|
||||
return $response;
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -586,55 +627,11 @@ class IPS
|
||||
*/
|
||||
public static function checkLicenseKey( $val, $url )
|
||||
{
|
||||
$test = FALSE;
|
||||
if ( mb_substr( $val, -12 ) === '-TESTINSTALL' )
|
||||
{
|
||||
$test = TRUE;
|
||||
$val = mb_substr( $val, 0, -12 );
|
||||
}
|
||||
$urlKey = $test ? 'test_url' : 'url';
|
||||
|
||||
try
|
||||
{
|
||||
$response = \IPS\Http\Url::ips( 'license/' . $val )->setQueryString( $urlKey, $url )->request()->get();
|
||||
switch ( $response->httpResponseCode )
|
||||
{
|
||||
case 200:
|
||||
$response = json_decode( $response, TRUE );
|
||||
if ( $response['legacy'] )
|
||||
{
|
||||
throw new \DomainException( 'license_key_legacy' );
|
||||
}
|
||||
|
||||
/* Previously, URL's were stored as http://domain.com/forums - this check here may throw a "key already in use" error if upgrading or setting up a test install */
|
||||
if ( rtrim( $response[ $urlKey ], '/' ) !== rtrim( $url, '/' ) )
|
||||
{
|
||||
if ( $response[ $urlKey ] )
|
||||
{
|
||||
throw new \DomainException( $test ? 'license_key_test_active' : 'license_key_active' );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Http\Url::ips( 'license/' . $val )->request()->post( array(
|
||||
$urlKey => $url
|
||||
) );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 404:
|
||||
throw new \DomainException( 'license_key_not_found' );
|
||||
|
||||
default:
|
||||
throw new \DomainException( 'generic_license_error' );
|
||||
}
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e )
|
||||
{
|
||||
throw new \DomainException( sprintf( \IPS\Member::loggedIn()->language()->get( 'license_server_error' ), $e->getMessage() ) );
|
||||
}
|
||||
//Do Nothing
|
||||
}
|
||||
}
|
||||
|
||||
/* Init */
|
||||
IPS::init();
|
||||
IPS::init();
|
||||
|
||||
/* Nulled by IandroidFan (IAF) */
|
||||
Reference in new issue
Block a user