mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Support white label license with/without dashes
This commit is contained in:
parent
1a39d86af7
commit
b0cb73757a
@ -244,6 +244,16 @@ class NinjaController extends BaseController
|
|||||||
$licenseKey = Input::get('license_key');
|
$licenseKey = Input::get('license_key');
|
||||||
$productId = Input::get('product_id', PRODUCT_ONE_CLICK_INSTALL);
|
$productId = Input::get('product_id', PRODUCT_ONE_CLICK_INSTALL);
|
||||||
|
|
||||||
|
// add in dashes
|
||||||
|
if (strlen($licenseKey) == 20) {
|
||||||
|
$licenseKey = sprintf('%s-%s-%s-%s-%s',
|
||||||
|
substr($licenseKey, 0, 4),
|
||||||
|
substr($licenseKey, 4, 4),
|
||||||
|
substr($licenseKey, 8, 4),
|
||||||
|
substr($licenseKey, 12, 4),
|
||||||
|
substr($licenseKey, 16, 4));
|
||||||
|
}
|
||||||
|
|
||||||
$license = License::where('license_key', '=', $licenseKey)
|
$license = License::where('license_key', '=', $licenseKey)
|
||||||
->where('is_claimed', '<', 10)
|
->where('is_claimed', '<', 10)
|
||||||
->where('product_id', '=', $productId)
|
->where('product_id', '=', $productId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user