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,8 +338,14 @@ class UserController extends BaseController
}
}
// 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)
{