mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-02-16 18:14:23 +01:00
Check if user exists before checking redirect
This commit is contained in:
parent
4dd8e4f038
commit
1f46b3a85d
1 changed files with 12 additions and 8 deletions
|
@ -46,19 +46,23 @@ class ArtistsController extends Controller
|
||||||
{
|
{
|
||||||
$user = User::whereSlug($slug)->first();
|
$user = User::whereSlug($slug)->first();
|
||||||
|
|
||||||
if ($user->redirect_to) {
|
if ($user) {
|
||||||
$newUser = User::find($user->redirect_to);
|
if ($user->redirect_to) {
|
||||||
|
$newUser = User::find($user->redirect_to);
|
||||||
|
|
||||||
if ($newUser) {
|
if ($newUser) {
|
||||||
return Redirect::action('ArtistsController@getProfile', [$newUser->slug]);
|
return Redirect::action('ArtistsController@getProfile', [$newUser->slug]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($user->disabled_at) {
|
if ($user->disabled_at) {
|
||||||
|
App::abort('404');
|
||||||
|
}
|
||||||
|
|
||||||
|
return View::make('artists.profile');
|
||||||
|
} else {
|
||||||
App::abort('404');
|
App::abort('404');
|
||||||
}
|
}
|
||||||
|
|
||||||
return View::make('artists.profile');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getShortlink($id)
|
public function getShortlink($id)
|
||||||
|
|
Loading…
Reference in a new issue