mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
Check that the session key exists
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
d5edb0908b
commit
220f94faee
|
@ -83,7 +83,11 @@ class BulkAssetsController extends Controller
|
|||
$this->authorize('update', Asset::class);
|
||||
|
||||
// Get the back url from the session and then destroy the session
|
||||
$bulk_back_url = route('hardware');
|
||||
if ($request->session()->has('bulk_back_url')) {
|
||||
$bulk_back_url = $request->session()->pull('bulk_back_url');
|
||||
}
|
||||
|
||||
|
||||
if (! $request->filled('ids') || count($request->input('ids')) <= 0) {
|
||||
return redirect($bulk_back_url)->with('error', trans('admin/hardware/message.update.no_assets_selected'));
|
||||
|
@ -200,8 +204,10 @@ class BulkAssetsController extends Controller
|
|||
{
|
||||
$this->authorize('delete', Asset::class);
|
||||
|
||||
// Get the back url from the session and then destroy the session
|
||||
$bulk_back_url = route('hardware');
|
||||
if ($request->session()->has('bulk_back_url')) {
|
||||
$bulk_back_url = $request->session()->pull('bulk_back_url');
|
||||
}
|
||||
|
||||
if ($request->filled('ids')) {
|
||||
$assets = Asset::find($request->get('ids'));
|
||||
|
|
Loading…
Reference in a new issue