mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Check for accessories
This commit is contained in:
parent
8900672181
commit
6b982ec253
|
@ -360,6 +360,12 @@ class UsersController extends Controller
|
|||
return Redirect::route('users')->with('error', 'This user still has ' . count($user->licenses) . ' licenses associated with them.');
|
||||
}
|
||||
|
||||
if (count($user->accessories) > 0) {
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', 'This user still has ' . count($user->accessories) . ' accessories associated with them.');
|
||||
}
|
||||
|
||||
// Delete the user
|
||||
$user->delete();
|
||||
|
||||
|
@ -504,7 +510,7 @@ class UsersController extends Controller
|
|||
if (!Company::isCurrentUserHasAccess($user)) {
|
||||
return Redirect::route('users')->with('error', trans('general.insufficient_permissions'));
|
||||
} else {
|
||||
|
||||
|
||||
// Restore the user
|
||||
if (User::withTrashed()->where('id',$id)->restore()) {
|
||||
return Redirect::route('users')->with('success', trans('admin/users/message.success.restored'));
|
||||
|
|
Loading…
Reference in a new issue