mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 07:16:06 -06:00
fixed view ad for admin
This commit is contained in:
parent
123e5e0bd8
commit
9633ab2600
@ -482,10 +482,9 @@ class AdvsController extends PublicController
|
|||||||
$id = $seo;
|
$id = $seo;
|
||||||
$adv = $this->adv_repository->getListItemAdv($id);
|
$adv = $this->adv_repository->getListItemAdv($id);
|
||||||
}
|
}
|
||||||
|
if (auth()->user()->hasRole('admin') or ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id()))) {
|
||||||
if ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id())) {
|
|
||||||
// Check if created by exists
|
// Check if created by exists
|
||||||
if (!$adv->created_by) {
|
if (!auth()->user()->hasRole('admin') and !$adv->created_by) {
|
||||||
$this->messages->error('visiosoft.module.advs::message.this_ad_is_not_valid_anymore');
|
$this->messages->error('visiosoft.module.advs::message.this_ad_is_not_valid_anymore');
|
||||||
return $this->redirect->route('visiosoft.module.advs::list');
|
return $this->redirect->route('visiosoft.module.advs::list');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user