mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-26 00:41:34 -06:00
Save old data; bread crumbs
This commit is contained in:
parent
5f5469a7d4
commit
09d63b584d
@ -17,6 +17,7 @@ use FireflyIII\Http\Requests\DeleteAccountFormRequest;
|
||||
use FireflyIII\Http\Requests\ProfileFormRequest;
|
||||
use FireflyIII\User;
|
||||
use Hash;
|
||||
use Preferences;
|
||||
use Session;
|
||||
|
||||
/**
|
||||
@ -111,7 +112,8 @@ class ProfileController extends Controller
|
||||
event(new UserIsDeleted(Auth::user(), $request->ip()));
|
||||
|
||||
// store some stuff for the future:
|
||||
|
||||
$registration = Preferences::get('registration_ip_address')->data;
|
||||
$confirmation = Preferences::get('confirmation_ip_address')->data;
|
||||
|
||||
// DELETE!
|
||||
$email = Auth::user()->email;
|
||||
@ -121,7 +123,7 @@ class ProfileController extends Controller
|
||||
Session::flash('gaEventAction', 'delete-account');
|
||||
|
||||
// create a new user with the same email address so re-registration is blocked.
|
||||
User::create(
|
||||
$newUser = User::create(
|
||||
[
|
||||
'email' => $email,
|
||||
'password' => 'deleted',
|
||||
@ -129,6 +131,13 @@ class ProfileController extends Controller
|
||||
'blocked_code' => 'deleted',
|
||||
]
|
||||
);
|
||||
if (strlen($registration) > 0) {
|
||||
Preferences::setForUser($newUser, 'registration_ip_address', $registration);
|
||||
|
||||
}
|
||||
if (strlen($confirmation) > 0) {
|
||||
Preferences::setForUser($newUser, 'confirmation_ip_address', $confirmation);
|
||||
}
|
||||
|
||||
return redirect(route('index'));
|
||||
}
|
||||
|
@ -113,6 +113,13 @@ Breadcrumbs::register(
|
||||
}
|
||||
);
|
||||
|
||||
Breadcrumbs::register(
|
||||
'admin.users.domains', function (BreadCrumbGenerator $breadcrumbs) {
|
||||
$breadcrumbs->parent('admin.index');
|
||||
$breadcrumbs->push(trans('firefly.blocked_domains'), route('admin.users.domains'));
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* ATTACHMENTS
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user