mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 23:36:08 -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', '!=', "");
|
||||
}
|
||||
|
||||
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);
|
||||
} else {
|
||||
return $this->getAdv(null, $nullable_ad)
|
||||
|
||||
@ -667,8 +667,7 @@ class AdvsController extends PublicController
|
||||
CategoryRepositoryInterface $categoryRepository,
|
||||
Dispatcher $events,
|
||||
AdvModel $advModel,
|
||||
AdressRepositoryInterface $address,
|
||||
CategoryModel $categoryModel
|
||||
AdressRepositoryInterface $address
|
||||
)
|
||||
{
|
||||
if (!Auth::user()) {
|
||||
@ -693,10 +692,10 @@ class AdvsController extends PublicController
|
||||
if ($advModel->is_enabled('packages') and $adv->slug == "") {
|
||||
$cat = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForNewAd($request);
|
||||
if (!is_null($cat)) {
|
||||
if (is_array($cat) && array_key_exists('allowPendingAds', $cat)) {
|
||||
if (array_key_exists('allowPendingAds', $cat)) {
|
||||
$allowPendingAdCreation = $cat['allowPendingAds'];
|
||||
} else {
|
||||
return redirect('/');
|
||||
return redirect($cat['redirect']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user