mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 09:27:33 -04:00 
			
		
		
		
	Show message if white label license is expired
This commit is contained in:
		
							parent
							
								
									01d1c5a988
								
							
						
					
					
						commit
						d91a3fd606
					
				| @ -258,12 +258,7 @@ class NinjaController extends BaseController | |||||||
|             if ($productId == PRODUCT_INVOICE_DESIGNS) { |             if ($productId == PRODUCT_INVOICE_DESIGNS) { | ||||||
|                 return file_get_contents(storage_path() . '/invoice_designs.txt'); |                 return file_get_contents(storage_path() . '/invoice_designs.txt'); | ||||||
|             } else { |             } else { | ||||||
|                 // temporary fix to enable previous version to work
 |  | ||||||
|                 if (Input::get('get_date')) { |  | ||||||
|                 return $license->created_at->format('Y-m-d'); |                 return $license->created_at->format('Y-m-d'); | ||||||
|                 } else { |  | ||||||
|                     return 'valid'; |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|         } else { |         } else { | ||||||
|             return RESULT_FAILURE; |             return RESULT_FAILURE; | ||||||
|  | |||||||
| @ -171,14 +171,18 @@ class StartupCheck | |||||||
|                 if ($data == RESULT_FAILURE) { |                 if ($data == RESULT_FAILURE) { | ||||||
|                     Session::flash('error', trans('texts.invalid_white_label_license')); |                     Session::flash('error', trans('texts.invalid_white_label_license')); | ||||||
|                 } elseif ($data) { |                 } elseif ($data) { | ||||||
|  |                     $date = date_create($data)->modify('+1 year'); | ||||||
|  |                     if ($date < date_create()) { | ||||||
|  |                         Session::flash('message', trans('texts.expired_white_label')); | ||||||
|  |                     } else { | ||||||
|                         $company->plan_term = PLAN_TERM_YEARLY; |                         $company->plan_term = PLAN_TERM_YEARLY; | ||||||
|                         $company->plan_paid = $data; |                         $company->plan_paid = $data; | ||||||
|                     $date = max(date_create($data), date_create($company->plan_expires)); |                         $company->plan_expires = $date->format('Y-m-d'); | ||||||
|                     $company->plan_expires = $date->modify('+1 year')->format('Y-m-d'); |  | ||||||
|                         $company->plan = PLAN_WHITE_LABEL; |                         $company->plan = PLAN_WHITE_LABEL; | ||||||
|                         $company->save(); |                         $company->save(); | ||||||
| 
 | 
 | ||||||
|                         Session::flash('message', trans('texts.bought_white_label')); |                         Session::flash('message', trans('texts.bought_white_label')); | ||||||
|  |                     } | ||||||
|                 } else { |                 } else { | ||||||
|                     Session::flash('error', trans('texts.white_label_license_error')); |                     Session::flash('error', trans('texts.white_label_license_error')); | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -2644,6 +2644,7 @@ $LANG = array( | |||||||
|     'signature_on_invoice_help' => 'Add the following code to show your client\'s signature on the PDF.', |     'signature_on_invoice_help' => 'Add the following code to show your client\'s signature on the PDF.', | ||||||
|     'signature_on_pdf' => 'Show on PDF', |     'signature_on_pdf' => 'Show on PDF', | ||||||
|     'signature_on_pdf_help' => 'Show the client signature on the invoice/quote PDF.', |     'signature_on_pdf_help' => 'Show the client signature on the invoice/quote PDF.', | ||||||
|  |     'expired_white_label' => 'The white label license has expired', | ||||||
| 
 | 
 | ||||||
| ); | ); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user