mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-22 02:00:56 -04:00
Added the ability to cancel an account
This commit is contained in:
parent
47edf3f565
commit
74b680ef87
@ -815,4 +815,14 @@ class AccountController extends \BaseController {
|
||||
|
||||
return "{$user->first_name} {$user->last_name}";
|
||||
}
|
||||
|
||||
public function cancelAccount()
|
||||
{
|
||||
$account = Auth::user()->account;
|
||||
$account->forceDelete();
|
||||
|
||||
Confide::logout();
|
||||
|
||||
return Redirect::to('/')->with('clearGuestKey', true);
|
||||
}
|
||||
}
|
@ -405,7 +405,12 @@ return array(
|
||||
'deleted_user' => 'Successfully deleted user',
|
||||
'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users',
|
||||
|
||||
'confirm_email_invoice' => 'Confirm emailing this invoice',
|
||||
'confirm_email_quote' => 'Confirm emailing this quote',
|
||||
'confirm_email_invoice' => 'Are you sure you want to email this invoice?',
|
||||
'confirm_email_quote' => 'Are you sure you want to email this quote?',
|
||||
'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?',
|
||||
|
||||
'cancel_account' => 'Cancel Account',
|
||||
'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.',
|
||||
'go_back' => 'Go Back',
|
||||
|
||||
);
|
||||
|
@ -420,8 +420,13 @@ return array(
|
||||
'deleted_user' => 'Successfully deleted user',
|
||||
'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users',
|
||||
|
||||
'confirm_email_invoice' => 'Confirm emailing this invoice',
|
||||
'confirm_email_quote' => 'Confirm emailing this quote',
|
||||
'confirm_email_invoice' => 'Are you sure you want to email this invoice?',
|
||||
'confirm_email_quote' => 'Are you sure you want to email this quote?',
|
||||
'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?',
|
||||
|
||||
'cancel_account' => 'Cancel Account',
|
||||
'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.',
|
||||
'go_back' => 'Go Back',
|
||||
|
||||
|
||||
);
|
@ -403,7 +403,12 @@ return array(
|
||||
'deleted_user' => 'Successfully deleted user',
|
||||
'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users',
|
||||
|
||||
'confirm_email_invoice' => 'Confirm emailing this invoice',
|
||||
'confirm_email_quote' => 'Confirm emailing this quote',
|
||||
'confirm_email_invoice' => 'Are you sure you want to email this invoice?',
|
||||
'confirm_email_quote' => 'Are you sure you want to email this quote?',
|
||||
'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?',
|
||||
|
||||
'cancel_account' => 'Cancel Account',
|
||||
'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.',
|
||||
'go_back' => 'Go Back',
|
||||
|
||||
);
|
||||
|
@ -405,7 +405,12 @@ return array(
|
||||
'deleted_user' => 'Successfully deleted user',
|
||||
'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users',
|
||||
|
||||
'confirm_email_invoice' => 'Confirm emailing this invoice',
|
||||
'confirm_email_quote' => 'Confirm emailing this quote',
|
||||
'confirm_email_invoice' => 'Are you sure you want to email this invoice?',
|
||||
'confirm_email_quote' => 'Are you sure you want to email this quote?',
|
||||
'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?',
|
||||
|
||||
'cancel_account' => 'Cancel Account',
|
||||
'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.',
|
||||
'go_back' => 'Go Back',
|
||||
|
||||
);
|
||||
|
@ -405,7 +405,12 @@ return array(
|
||||
'deleted_user' => 'Successfully deleted user',
|
||||
'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users',
|
||||
|
||||
'confirm_email_invoice' => 'Confirm emailing this invoice',
|
||||
'confirm_email_quote' => 'Confirm emailing this quote',
|
||||
'confirm_email_invoice' => 'Are you sure you want to email this invoice?',
|
||||
'confirm_email_quote' => 'Are you sure you want to email this quote?',
|
||||
'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?',
|
||||
|
||||
'cancel_account' => 'Cancel Account',
|
||||
'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.',
|
||||
'go_back' => 'Go Back',
|
||||
|
||||
);
|
||||
|
@ -420,9 +420,13 @@ return array(
|
||||
'deleted_user' => 'Successfully deleted user',
|
||||
'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users',
|
||||
|
||||
'confirm_email_invoice' => 'Confirm emailing this invoice',
|
||||
'confirm_email_quote' => 'Confirm emailing this quote',
|
||||
'confirm_email_invoice' => 'Are you sure you want to email this invoice?',
|
||||
'confirm_email_quote' => 'Are you sure you want to email this quote?',
|
||||
'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?',
|
||||
|
||||
'cancel_account' => 'Cancel Account',
|
||||
'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.',
|
||||
'go_back' => 'Go Back',
|
||||
|
||||
);
|
||||
|
||||
|
@ -420,7 +420,12 @@ return array(
|
||||
'deleted_user' => 'Bruker slettet',
|
||||
'limit_users' => 'Dessverre, vil dette overstiger grensen på ' . MAX_NUM_USERS . ' brukere',
|
||||
|
||||
'confirm_email_invoice' => 'Confirm emailing this invoice',
|
||||
'confirm_email_quote' => 'Confirm emailing this quote',
|
||||
'confirm_email_invoice' => 'Are you sure you want to email this invoice?',
|
||||
'confirm_email_quote' => 'Are you sure you want to email this quote?',
|
||||
'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?',
|
||||
|
||||
'cancel_account' => 'Cancel Account',
|
||||
'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.',
|
||||
'go_back' => 'Go Back',
|
||||
|
||||
);
|
@ -406,7 +406,12 @@ return array(
|
||||
'deleted_user' => 'Successfully deleted user',
|
||||
'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users',
|
||||
|
||||
'confirm_email_invoice' => 'Confirm emailing this invoice',
|
||||
'confirm_email_quote' => 'Confirm emailing this quote',
|
||||
'confirm_email_invoice' => 'Are you sure you want to email this invoice?',
|
||||
'confirm_email_quote' => 'Are you sure you want to email this quote?',
|
||||
'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?',
|
||||
|
||||
'cancel_account' => 'Cancel Account',
|
||||
'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.',
|
||||
'go_back' => 'Go Back',
|
||||
|
||||
);
|
||||
|
@ -394,7 +394,12 @@ return array(
|
||||
'deleted_user' => 'Successfully deleted user',
|
||||
'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users',
|
||||
|
||||
'confirm_email_invoice' => 'Confirm emailing this invoice',
|
||||
'confirm_email_quote' => 'Confirm emailing this quote',
|
||||
'confirm_email_invoice' => 'Are you sure you want to email this invoice?',
|
||||
'confirm_email_quote' => 'Are you sure you want to email this quote?',
|
||||
'confirm_recurring_email_invoice' => 'Are you sure you want this invoice emailed?',
|
||||
|
||||
'cancel_account' => 'Cancel Account',
|
||||
'cancel_account_message' => 'Warning: This will permanently erase all of your data, there is no undo.',
|
||||
'go_back' => 'Go Back',
|
||||
|
||||
);
|
||||
|
@ -81,6 +81,7 @@ Route::group(array('before' => 'auth'), function()
|
||||
Route::get('company/advanced_settings/chart_builder', 'ReportController@report');
|
||||
Route::post('company/advanced_settings/chart_builder', 'ReportController@report');
|
||||
|
||||
Route::post('company/cancel_account', 'AccountController@cancelAccount');
|
||||
Route::get('account/getSearchData', array('as' => 'getSearchData', 'uses' => 'AccountController@getSearchData'));
|
||||
Route::get('company/{section?}/{sub_section?}', 'AccountController@showSection');
|
||||
Route::post('company/{section?}/{sub_section?}', 'AccountController@doSection');
|
||||
|
@ -1,17 +1,60 @@
|
||||
@extends('accounts.nav')
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
@parent
|
||||
|
||||
{{ Former::open_for_files('company/import_map')->addClass('col-md-9 col-md-offset-1') }}
|
||||
{{ Former::legend('import_clients') }}
|
||||
{{ Former::file('file')->label(trans('texts.csv_file')) }}
|
||||
{{ Former::actions( Button::lg_info_submit(trans('texts.upload'))->append_with_icon('open') ) }}
|
||||
{{ Former::close() }}
|
||||
{{ Former::open_for_files('company/import_map')->addClass('col-md-9 col-md-offset-1') }}
|
||||
{{ Former::legend('import_clients') }}
|
||||
{{ Former::file('file')->label(trans('texts.csv_file')) }}
|
||||
{{ Former::actions( Button::lg_info_submit(trans('texts.upload'))->append_with_icon('open') ) }}
|
||||
{{ Former::close() }}
|
||||
|
||||
{{ Former::open('company/export')->addClass('col-md-9 col-md-offset-1') }}
|
||||
{{ Former::legend('export_clients') }}
|
||||
{{ Former::actions( Button::lg_primary_submit(trans('texts.download'))->append_with_icon('download-alt') ) }}
|
||||
{{ Former::close() }}
|
||||
{{ Former::open('company/export')->addClass('col-md-9 col-md-offset-1') }}
|
||||
{{ Former::legend('export_clients') }}
|
||||
{{ Former::actions( Button::lg_primary_submit(trans('texts.download'))->append_with_icon('download-alt') ) }}
|
||||
{{ Former::close() }}
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
{{ Former::open('company/cancel_account')->addClass('col-md-9 col-md-offset-1 cancel-account') }}
|
||||
{{ Former::legend('cancel_account') }}
|
||||
{{ Former::actions( Button::lg_danger_button(trans('texts.cancel_account'), ['onclick' => 'showConfirm()'])->append_with_icon('trash') ) }}
|
||||
|
||||
<div class="modal fade" id="confirmCancelModal" tabindex="-1" role="dialog" aria-labelledby="confirmCancelModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" style="min-width:150px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="confirmCancelModalLabel">{{ trans('texts.cancel_account') }}</h4>
|
||||
</div>
|
||||
|
||||
<div style="background-color: #fff; padding-left: 16px; padding-right: 16px">
|
||||
<p>{{ trans('texts.cancel_account_message') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer" style="margin-top: 0px">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.go_back') }}</button>
|
||||
<button type="button" class="btn btn-primary" onclick="confirmCancel()">{{ trans('texts.cancel_account') }}</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Former::close() }}
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function showConfirm() {
|
||||
$('#confirmCancelModal').modal('show');
|
||||
}
|
||||
|
||||
function confirmCancel() {
|
||||
$('form.cancel-account').submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
@ -730,7 +730,7 @@
|
||||
|
||||
function onSaveClick() {
|
||||
if (model.invoice().is_recurring()) {
|
||||
if (confirm('{{ trans("texts.confirm_email_$entityType") }}')) {
|
||||
if (confirm('{{ trans("texts.confirm_recurring_email_$entityType") }}')) {
|
||||
submitAction('');
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user