mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
Redirect to dashboard when switching accounts if viewing an entity
This commit is contained in:
parent
c0a3971ca5
commit
7fcc634a74
@ -338,7 +338,13 @@ class UserController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
return Redirect::to($referer);
|
||||
// If the user is looking at an entity redirect to the dashboard
|
||||
preg_match('/\/[0-9*][\/edit]*$/', $referer, $matches);
|
||||
if (count($matches)) {
|
||||
return Redirect::to('/dashboard');
|
||||
} else {
|
||||
return Redirect::to($referer);
|
||||
}
|
||||
}
|
||||
|
||||
public function unlinkAccount($userAccountId, $userId)
|
||||
|
Loading…
Reference in New Issue
Block a user