mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 14:04:40 -04:00
Disable commercial website unless it has NINJA_PROD or NINJA_DEV env set
This commit is contained in:
parent
f2de3f8a81
commit
5ad67f55e1
3
.gitignore
vendored
3
.gitignore
vendored
@ -17,4 +17,5 @@
|
|||||||
/ninja.sublime-workspace
|
/ninja.sublime-workspace
|
||||||
/tests/_log
|
/tests/_log
|
||||||
.idea
|
.idea
|
||||||
.project
|
.project
|
||||||
|
/nbproject/private/
|
@ -66,7 +66,13 @@ App::after(function($request, $response)
|
|||||||
|
|
||||||
Route::filter('auth', function()
|
Route::filter('auth', function()
|
||||||
{
|
{
|
||||||
if (Auth::guest()) return Redirect::guest('/');
|
if (Auth::guest()) {
|
||||||
|
if(Utils::isNinja()) {
|
||||||
|
return Redirect::guest('/');
|
||||||
|
} else {
|
||||||
|
return Redirect::guest('/login');
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class Utils
|
|||||||
{
|
{
|
||||||
return isset($_ENV['DISABLE_REGISTRATION']) && $_ENV['DISABLE_REGISTRATION'];
|
return isset($_ENV['DISABLE_REGISTRATION']) && $_ENV['DISABLE_REGISTRATION'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isPro()
|
public static function isPro()
|
||||||
{
|
{
|
||||||
return Auth::check() && Auth::user()->isPro();
|
return Auth::check() && Auth::user()->isPro();
|
||||||
|
@ -22,30 +22,35 @@
|
|||||||
//dd(gethostname());
|
//dd(gethostname());
|
||||||
//Log::error('test');
|
//Log::error('test');
|
||||||
|
|
||||||
|
if(Utils::isNinja()) {
|
||||||
|
Route::get('/', 'HomeController@showWelcome');
|
||||||
|
Route::get('/rocksteady', 'HomeController@showWelcome');
|
||||||
|
Route::get('/about', 'HomeController@showAboutUs');
|
||||||
|
Route::get('/terms', 'HomeController@showTerms');
|
||||||
|
Route::get('/contact', 'HomeController@showContactUs');
|
||||||
|
Route::get('/plans', 'HomeController@showPlans');
|
||||||
|
Route::post('/contact_submit', 'HomeController@doContactUs');
|
||||||
|
Route::get('/faq', 'HomeController@showFaq');
|
||||||
|
Route::get('/features', 'HomeController@showFeatures');
|
||||||
|
Route::get('/secure_payment', 'HomeController@showSecurePayment');
|
||||||
|
Route::get('/testimonials', 'HomeController@showTestimonials');
|
||||||
|
|
||||||
Route::get('/', 'HomeController@showWelcome');
|
Route::get('log_error', 'HomeController@logError');
|
||||||
Route::get('/rocksteady', 'HomeController@showWelcome');
|
Route::get('invoice_now', 'HomeController@invoiceNow');
|
||||||
Route::get('/about', 'HomeController@showAboutUs');
|
Route::post('get_started', 'AccountController@getStarted');
|
||||||
Route::get('/terms', 'HomeController@showTerms');
|
|
||||||
Route::get('/contact', 'HomeController@showContactUs');
|
|
||||||
Route::get('/plans', 'HomeController@showPlans');
|
|
||||||
Route::post('/contact_submit', 'HomeController@doContactUs');
|
|
||||||
Route::get('/faq', 'HomeController@showFaq');
|
|
||||||
Route::get('/features', 'HomeController@showFeatures');
|
|
||||||
Route::get('/secure_payment', 'HomeController@showSecurePayment');
|
|
||||||
Route::get('/testimonials', 'HomeController@showTestimonials');
|
|
||||||
|
|
||||||
Route::get('log_error', 'HomeController@logError');
|
Route::get('view/{invitation_key}', 'InvoiceController@view');
|
||||||
Route::get('invoice_now', 'HomeController@invoiceNow');
|
Route::get('payment/{invitation_key}', 'PaymentController@show_payment');
|
||||||
Route::post('get_started', 'AccountController@getStarted');
|
Route::post('payment/{invitation_key}', 'PaymentController@do_payment');
|
||||||
|
Route::get('complete', 'PaymentController@offsite_payment');
|
||||||
|
|
||||||
Route::get('view/{invitation_key}', 'InvoiceController@view');
|
Route::post('signup/validate', 'AccountController@checkEmail');
|
||||||
Route::get('payment/{invitation_key}', 'PaymentController@show_payment');
|
Route::post('signup/submit', 'AccountController@submitSignup');
|
||||||
Route::post('payment/{invitation_key}', 'PaymentController@do_payment');
|
} else {
|
||||||
Route::get('complete', 'PaymentController@offsite_payment');
|
Route::get('/', function() {
|
||||||
|
return Redirect::to('dashboard');
|
||||||
Route::post('signup/validate', 'AccountController@checkEmail');
|
});
|
||||||
Route::post('signup/submit', 'AccountController@submitSignup');
|
}
|
||||||
|
|
||||||
// Confide routes
|
// Confide routes
|
||||||
Route::get('login', 'UserController@login');
|
Route::get('login', 'UserController@login');
|
||||||
@ -60,7 +65,7 @@ Route::get('logout', 'UserController@logout');
|
|||||||
|
|
||||||
Route::group(array('before' => 'auth'), function()
|
Route::group(array('before' => 'auth'), function()
|
||||||
{
|
{
|
||||||
Route::get('dashboard', 'DashboardController@index');
|
Route::get('dashboard', 'DashboardController@index');
|
||||||
Route::get('view_archive/{entity_type}/{visible}', 'AccountController@setTrashVisible');
|
Route::get('view_archive/{entity_type}/{visible}', 'AccountController@setTrashVisible');
|
||||||
Route::get('force_inline_pdf', 'UserController@forcePDFJS');
|
Route::get('force_inline_pdf', 'UserController@forcePDFJS');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user