mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Fixed restore method
This commit is contained in:
parent
2284a0783f
commit
0a5e7214aa
|
@ -497,19 +497,16 @@ class UsersController extends Controller
|
|||
{
|
||||
try {
|
||||
// Get user information
|
||||
//$user = Sentry::getUserProvider()->createModel()->withTrashed()->find($id);
|
||||
if (!$user = User::withTrashed()->find($id)) {
|
||||
return Redirect::route('users')->with('error', trans('admins/users/messages.user_not_found'));
|
||||
}
|
||||
|
||||
if (!Company::isCurrentUserHasAccess($user)) {
|
||||
return Redirect::route('users')->with('error', trans('general.insufficient_permissions'));
|
||||
} else {
|
||||
// Restore the user
|
||||
$user->restore();
|
||||
|
||||
// Prepare the success message
|
||||
$success = trans('admin/users/message.success.restored');
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('success', $success);
|
||||
return Redirect::route('users')->with('success', trans('admin/users/message.success.restored'));
|
||||
}
|
||||
} catch (UserNotFoundException $e) {
|
||||
// Prepare the error message
|
||||
|
|
Loading…
Reference in a new issue