mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
Use language strings for bulk password reset
This commit is contained in:
parent
006a3adea0
commit
400913631c
|
@ -31,8 +31,12 @@ class BulkUsersController extends Controller
|
|||
{
|
||||
$this->authorize('update', User::class);
|
||||
|
||||
// Make sure there were users selected
|
||||
if (($request->filled('ids')) && (count($request->input('ids')) > 0)) {
|
||||
|
||||
$statuslabel_list = Helper::statusLabelList();
|
||||
|
||||
// Get the list of affected users
|
||||
$users = User::whereIn('id', array_keys(request('ids')))
|
||||
->with('groups', 'assets', 'licenses', 'accessories')->get();
|
||||
|
||||
|
@ -46,7 +50,7 @@ class BulkUsersController extends Controller
|
|||
} elseif ($request->input('bulk_actions') == 'bulkpasswordreset') {
|
||||
if ($users) {
|
||||
foreach ($users as $user) {
|
||||
if ($user->email!='') {
|
||||
if (($user->activated=='1') && ($user->email!='')) {
|
||||
$credentials = ['email' => $user->email];
|
||||
Password::sendResetLink($credentials, function (Message $message) {
|
||||
$message->subject($this->getEmailSubject());
|
||||
|
@ -54,7 +58,7 @@ class BulkUsersController extends Controller
|
|||
}
|
||||
}
|
||||
}
|
||||
return redirect()->back()->with('success', 'The selected users with email addresses have been sent a password reset link.');
|
||||
return redirect()->back()->with('success', trans('admin/users/message.password_resets_sent'));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ return array(
|
|||
'insufficient_permissions' => 'Insufficient Permissions.',
|
||||
'user_deleted_warning' => 'This user has been deleted. You will have to restore this user to edit them or assign them new assets.',
|
||||
'ldap_not_configured' => 'LDAP integration has not been configured for this installation.',
|
||||
'password_resets_sent' => 'The selected users who are activated and have a valid email addresses have been sent a password reset link.',
|
||||
|
||||
|
||||
'success' => array(
|
||||
|
|
Loading…
Reference in a new issue