mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
fixed error
This commit is contained in:
parent
9633ab2600
commit
a08e5f3255
@ -482,9 +482,10 @@ 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 ((auth()->user() and auth()->user()->hasRole('admin')) or ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id()))) {
|
||||||
// Check if created by exists
|
// Check if created by exists
|
||||||
if (!auth()->user()->hasRole('admin') and !$adv->created_by) {
|
if ((auth()->user() and !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