mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
White label license
This commit is contained in:
parent
f13ba7d961
commit
22eb28d138
@ -149,14 +149,15 @@ class LicenseController extends BaseController
|
||||
return response()->json($error, 400);
|
||||
}
|
||||
|
||||
public function index(Request $request)
|
||||
public function v5ClaimLicense(Request $request)
|
||||
{
|
||||
$this->checkLicense();
|
||||
|
||||
/* Catch claim license requests */
|
||||
if (config('ninja.environment') == 'selfhost' && request()->has('license_key')) {
|
||||
|
||||
$response = Http::get( config('ninja.license_url')."/claim_license", [
|
||||
$response = Http::get( "http://ninja.test:8000/claim_license", [
|
||||
// $response = Http::get( "https://invoicing.co/claim_license", [
|
||||
'license_key' => $request->input('license_key'),
|
||||
'product_id' => 3,
|
||||
]);
|
||||
@ -168,7 +169,7 @@ class LicenseController extends BaseController
|
||||
$account = auth()->user()->account;
|
||||
|
||||
$account->plan_term = Account::PLAN_TERM_YEARLY;
|
||||
$account->plan_expires = Carbon::parse($payload?->expires)->format('Y-m-d');
|
||||
$account->plan_expires = Carbon::parse($payload['expires'])->addYear()->format('Y-m-d');
|
||||
$account->plan = Account::PLAN_WHITE_LABEL;
|
||||
$account->save();
|
||||
|
||||
|
@ -2251,7 +2251,7 @@ $LANG = array(
|
||||
'invalid_file' => 'Invalid file type',
|
||||
'add_documents_to_invoice' => 'Add Documents to Invoice',
|
||||
'mark_expense_paid' => 'Mark paid',
|
||||
'white_label_license_error' => 'Failed to validate the license, check storage/logs/laravel-error.log for more details.',
|
||||
'white_label_license_error' => 'Failed to validate the license, either expired or excessive activations. Email contact@invoiceninja.com for more information.',
|
||||
'plan_price' => 'Plan Price',
|
||||
'wrong_confirmation' => 'Incorrect confirmation code',
|
||||
'oauth_taken' => 'The account is already registered',
|
||||
|
@ -136,6 +136,7 @@ Route::group(['middleware' => ['throttle:api', 'api_db', 'token_auth', 'locale']
|
||||
Route::post('charts/chart_summary', [ChartController::class, 'chart_summary'])->name('chart.chart_summary');
|
||||
|
||||
Route::post('claim_license', [LicenseController::class, 'index'])->name('license.index');
|
||||
Route::post('v5_claim_license', [LicenseController::class, 'v5ClaimLicense'])->name('license.v5_claim_license');
|
||||
|
||||
Route::resource('clients', ClientController::class); // name = (clients. index / create / show / update / destroy / edit
|
||||
Route::put('clients/{client}/upload', [ClientController::class, 'upload'])->name('clients.upload');
|
||||
|
Loading…
Reference in New Issue
Block a user