beta 6: init.php change 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 = IPSHttpUrl::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
{
IPSHttpUrl::ips( 'license/' . $val )->request()->post( array(
$urlKey => $url
) );
}
}
break;
case 404:
throw new DomainException( 'license_key_not_found' );
default:
throw new DomainException( 'license_server_error' );
}
}
catch ( IPSHttpRequestException $e )
{
throw new DomainException( 'license_server_error' );
}
}to 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 = IPSHttpUrl::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
{
IPSHttpUrl::ips( 'license/' . $val )->request()->post( array(
$urlKey => $url
) );
}
}
break;
case 404:
throw new DomainException( 'license_key_not_found' );
default:
throw new DomainException( 'license_server_error' );
}
}
catch ( IPSHttpRequestException $e )
{
throw new DomainException( 'license_server_error' );
}*/
}systemOutputOutput.phpchange public function licenseKeyWarning()
{
if ( !IPSSettings::i()->ipb_reg_number and IPSMember::loggedIn()->hasAcpRestriction( 'core', 'settings', 'licensekey_manage' ) )
{
return 'none';
}
else
{
$licenseKey = IPSIPS::licenseKey();
if ( ( $licenseKey === NULL or ( isset( $licenseKey['legacy'] ) and $licenseKey['legacy'] ) ) and IPSMember::loggedIn()->hasAcpRestriction( 'core', 'settings', 'licensekey_manage' ) )
{
return 'none';
}
elseif ( ( ( $licenseKey['expires'] and strtotime( $licenseKey['expires'] ) < time() ) or ! isset( $licenseKey['active'] ) or !$licenseKey['active'] ) and IPSMember::loggedIn()->hasAcpRestriction( 'core', 'settings', 'licensekey_manage' ) )
{
return 'expired';
}
}
return NULL;
}to public function licenseKeyWarning()
{
/*if ( !IPSSettings::i()->ipb_reg_number and IPSMember::loggedIn()->hasAcpRestriction( 'core', 'settings', 'licensekey_manage' ) )
{
return 'none';
}
else
{
$licenseKey = IPSIPS::licenseKey();
if ( ( $licenseKey === NULL or ( isset( $licenseKey['legacy'] ) and $licenseKey['legacy'] ) ) and IPSMember::loggedIn()->hasAcpRestriction( 'core', 'settings', 'licensekey_manage' ) )
{
return 'none';
}
elseif ( ( ( $licenseKey['expires'] and strtotime( $licenseKey['expires'] ) < time() ) or ! isset( $licenseKey['active'] ) or !$licenseKey['active'] ) and IPSMember::loggedIn()->hasAcpRestriction( 'core', 'settings', 'licensekey_manage' ) )
{
return 'expired';
}
}*/
return NULL;
}