diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php index 4bc41fee4..3bde3c4f4 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php @@ -436,13 +436,6 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface return null; } - public function authControl() - { - if (!Auth::user()) { - redirect('/login?redirect=' . url()->current())->send(); - } - } - public function currentAds() { return $this->whereDate('finish_at', '>=', date("Y-m-d H:i:s")) ->where('status', '=', 'approved') diff --git a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php index 8d7913146..6622c30aa 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php @@ -70,8 +70,6 @@ interface AdvInterface extends EntryInterface public function getRecommended($id); - public function authControl(); - public function inStock(); public function getCity(); diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php index 526f83d9c..4885d2938 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php @@ -711,9 +711,7 @@ class AdvsController extends PublicController public function deleteAd(AdvRepositoryInterface $advs, $id) { $ad = $this->adv_model->find($id); - if (!Auth::user()) { - redirect('/login?redirect=' . url()->current())->send(); - } + $this->middleware('auth'); if ($ad->created_by_id != Auth::id()) { $this->messages->error(trans('visiosoft.module.advs::message.delete_author_error')); @@ -745,9 +743,7 @@ class AdvsController extends PublicController public function create(AdvFormBuilder $formBuilder, CategoryRepositoryInterface $repository) { - if (!Auth::user()) { - redirect('/login?redirect=' . url()->current())->send(); - } + $this->middleware('auth'); $isActive = new AdvModel(); $cats = $this->request->toArray(); @@ -1059,9 +1055,7 @@ class AdvsController extends PublicController public function cats() { - if (!Auth::user()) { - redirect('/login?redirect=' . url()->current())->send(); - } + $this->middleware('auth'); $main_cats = $this->category_repository->getMainCategories(); return $this->view->make('visiosoft.module.advs::new-ad/post-cat', compact('main_cats')); diff --git a/addons/default/visiosoft/base-theme/resources/views/partials/metadata.twig b/addons/default/visiosoft/base-theme/resources/views/partials/metadata.twig index 2ad8eb479..9be755125 100644 --- a/addons/default/visiosoft/base-theme/resources/views/partials/metadata.twig +++ b/addons/default/visiosoft/base-theme/resources/views/partials/metadata.twig @@ -19,7 +19,7 @@ {{ asset_add("theme.css", "visiosoft.theme.base::css/select2.css") }} {{ asset_add("theme.css", "visiosoft.theme.base::css/font-awesome.min.css") }} {{ asset_add("theme.css", "visiosoft.theme.base::css/intlTelInput.css") }} -{{ asset_style("visiosoft.theme.base::css/offline.scss") }} +{{ asset_add("theme.css", "visiosoft.theme.base::css/offline.scss") }} {{ asset_script('visiosoft.theme.base::js/visiosoft.js') }} diff --git a/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig b/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig index 017843463..dc63e9255 100644 --- a/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig +++ b/addons/default/visiosoft/base-theme/resources/views/partials/metatags.twig @@ -1,6 +1,5 @@ - @@ -100,4 +105,4 @@ .location-map .nav-tabs .active { background-color: #e5e5e5; } - \ No newline at end of file + diff --git a/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php b/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php index 5eaf1f233..8042a6013 100644 --- a/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php +++ b/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php @@ -34,10 +34,7 @@ class MyProfileController extends PublicController ) { parent::__construct(); - if (!Auth::user()) { - redirect('/login?redirect=' . url()->current())->send(); - } - + $this->middleware('auth'); $this->adressRepository = $adressRepository; $this->userRepository = $userRepository; }