mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 07:16:06 -06:00
#2436 Ad post "Lütfen Paket Satın Alın!" error
This commit is contained in:
parent
537d9dc9f8
commit
b60004ae15
@ -67,9 +67,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
return $query->where('advs_advs.slug', '!=', "");
|
return $query->where('advs_advs.slug', '!=', "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function userAdv($nullable_ad = false)
|
public function userAdv($nullable_ad = false, $checkRole = true)
|
||||||
{
|
{
|
||||||
if (Auth::user()->hasRole('admin')) {
|
if (Auth::user()->hasRole('admin') && $checkRole) {
|
||||||
return $this->getAdv(null, $nullable_ad);
|
return $this->getAdv(null, $nullable_ad);
|
||||||
} else {
|
} else {
|
||||||
return $this->getAdv(null, $nullable_ad)
|
return $this->getAdv(null, $nullable_ad)
|
||||||
|
|||||||
@ -667,8 +667,7 @@ class AdvsController extends PublicController
|
|||||||
CategoryRepositoryInterface $categoryRepository,
|
CategoryRepositoryInterface $categoryRepository,
|
||||||
Dispatcher $events,
|
Dispatcher $events,
|
||||||
AdvModel $advModel,
|
AdvModel $advModel,
|
||||||
AdressRepositoryInterface $address,
|
AdressRepositoryInterface $address
|
||||||
CategoryModel $categoryModel
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!Auth::user()) {
|
if (!Auth::user()) {
|
||||||
@ -693,10 +692,10 @@ class AdvsController extends PublicController
|
|||||||
if ($advModel->is_enabled('packages') and $adv->slug == "") {
|
if ($advModel->is_enabled('packages') and $adv->slug == "") {
|
||||||
$cat = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForNewAd($request);
|
$cat = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForNewAd($request);
|
||||||
if (!is_null($cat)) {
|
if (!is_null($cat)) {
|
||||||
if (is_array($cat) && array_key_exists('allowPendingAds', $cat)) {
|
if (array_key_exists('allowPendingAds', $cat)) {
|
||||||
$allowPendingAdCreation = $cat['allowPendingAds'];
|
$allowPendingAdCreation = $cat['allowPendingAds'];
|
||||||
} else {
|
} else {
|
||||||
return redirect('/');
|
return redirect($cat['redirect']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user