Merge pull request #254 from openclassify/vedatakdd

fix auth
This commit is contained in:
Fatih Alp 2020-01-24 16:18:22 +03:00 committed by GitHub
commit d99afeae6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -352,4 +352,11 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
} }
return null; return null;
} }
public function authControl()
{
if (!Auth::user()) {
redirect('/login?redirect=' . url()->current())->send();
}
}
} }

View File

@ -163,7 +163,6 @@ class AdvsController extends PublicController
foreach ($featured_advs as $index => $ad) { foreach ($featured_advs as $index => $ad) {
$featured_advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list'); $featured_advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list');
$featured_advs[$index]->price = number_format($ad->price);
$featured_advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad); $featured_advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
} }