mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
fix auth
This commit is contained in:
parent
5d7d87cb64
commit
354ffb0a50
@ -114,10 +114,12 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
],
|
||||
'advs/create_adv' => [
|
||||
'as' => "advs::create_adv",
|
||||
'middleware' => 'auth',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AdvsController@cats',
|
||||
],
|
||||
'advs/create_adv/post_cat' => [
|
||||
'as' => 'post_adv',
|
||||
'middleware' => 'auth',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AdvsController@create',
|
||||
],
|
||||
'advs/save_adv' => [
|
||||
@ -135,6 +137,7 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
],
|
||||
'advs/delete/{id}' => [
|
||||
'as' => 'advs::delete',
|
||||
'middleware' => 'auth',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AdvsController@deleteAd',
|
||||
],
|
||||
'adv/addCart/{id}' => [
|
||||
@ -205,6 +208,7 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
|
||||
//Configurations Admin Controller
|
||||
'admin/advs/option_configuration/create' => [
|
||||
'middleware' => 'auth',
|
||||
'as' => 'visiosoft.module.advs::configrations.create',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\Admin\OptionConfigurationController@create',
|
||||
],
|
||||
@ -215,6 +219,7 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
|
||||
//Configuration Controller
|
||||
'advs/option_configuration/create' => [
|
||||
'middleware' => 'auth',
|
||||
'as' => 'visiosoft.module.advs::user.configrations.create',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\OptionConfigurationController@create',
|
||||
],
|
||||
|
||||
@ -711,7 +711,6 @@ class AdvsController extends PublicController
|
||||
public function deleteAd(AdvRepositoryInterface $advs, $id)
|
||||
{
|
||||
$ad = $this->adv_model->find($id);
|
||||
$this->middleware('auth');
|
||||
|
||||
if ($ad->created_by_id != Auth::id()) {
|
||||
$this->messages->error(trans('visiosoft.module.advs::message.delete_author_error'));
|
||||
@ -743,8 +742,6 @@ class AdvsController extends PublicController
|
||||
|
||||
public function create(AdvFormBuilder $formBuilder, CategoryRepositoryInterface $repository)
|
||||
{
|
||||
$this->middleware('auth');
|
||||
|
||||
$isActive = new AdvModel();
|
||||
$cats = $this->request->toArray();
|
||||
unset($cats['_token']);
|
||||
@ -1059,7 +1056,6 @@ class AdvsController extends PublicController
|
||||
|
||||
public function cats()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$main_cats = $this->category_repository->getMainCategories();
|
||||
|
||||
return $this->view->make('visiosoft.module.advs::new-ad/post-cat', compact('main_cats'));
|
||||
|
||||
@ -34,7 +34,11 @@ class MyProfileController extends PublicController
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->middleware('auth');
|
||||
|
||||
if (!Auth::user()) {
|
||||
redirect('/login?redirect=' . url()->current())->send();
|
||||
}
|
||||
|
||||
$this->adressRepository = $adressRepository;
|
||||
$this->userRepository = $userRepository;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user