1
0
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:
Hillel Coren 2016-10-25 17:29:37 +03:00
parent c0a3971ca5
commit 7fcc634a74

View File

@ -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) public function unlinkAccount($userAccountId, $userId)