diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-08 21:11:22 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-08 21:15:00 +0100 |
commit | da4625e91302901a40d460a625fd598b5ae56b18 (patch) | |
tree | 57127205fb97e8ec1bae8cdb3672111dc85c2368 | |
parent | 1ad24d1c8f77d2b4b78f692a490e9581d5831df8 (diff) | |
download | ecs-da4625e91302901a40d460a625fd598b5ae56b18.tar.gz ecs-da4625e91302901a40d460a625fd598b5ae56b18.zip |
Delete verify http methods code.
-rw-r--r-- | app/controllers/admin/communities_controller.rb | 15 | ||||
-rw-r--r-- | app/controllers/admin/organizations_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/admin/participants_controller.rb | 7 | ||||
-rw-r--r-- | app/controllers/admin/ressources_controller.rb | 35 |
4 files changed, 25 insertions, 37 deletions
diff --git a/app/controllers/admin/communities_controller.rb b/app/controllers/admin/communities_controller.rb index 5d8d02e..e358e26 100644 --- a/app/controllers/admin/communities_controller.rb +++ b/app/controllers/admin/communities_controller.rb @@ -1,17 +1,17 @@ -# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). -# +# Copyright (C) 2017 Heiko Bernloehr (FreeIT.de). +# # This file is part of ECS. -# +# # ECS is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. -# +# # ECS is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public # License along with ECS. If not, see <http://www.gnu.org/licenses/>. @@ -20,10 +20,7 @@ class Admin::CommunitiesController < ApplicationController include Admin::Helper - # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) - verify :method => [ :post, :put, :delete ], :only => [ :destroy, :create, :update, :destroy_participant ], - :add_flash => { :notice => "Failed to execute last action" }, - :redirect_to => :index_admin_communities_path + # TODO verify http methods def index list diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index 9b2c89b..238e8c2 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -20,10 +20,7 @@ class Admin::OrganizationsController < ApplicationController include Admin::Helper - # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) - verify :method => [ :post, :put, :delete ], :only => [ :destroy, :create, :update ], - :add_flash => { :notice => "Failed to execute last action" }, - :redirect_to => :admin_organization_path + # TODO verify http methods def index list diff --git a/app/controllers/admin/participants_controller.rb b/app/controllers/admin/participants_controller.rb index 8d53f85..88f475f 100644 --- a/app/controllers/admin/participants_controller.rb +++ b/app/controllers/admin/participants_controller.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2007, 2008, 2009, 2010, 2016 Heiko Bernloehr (FreeIT.de). +# Copyright (C) 2016, 2017 Heiko Bernloehr (FreeIT.de). # # This file is part of ECS. # @@ -22,10 +22,7 @@ class Admin::ParticipantsController < ApplicationController include Admin::Helper - # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) - verify :method => [ :post, :put, :delete ], :only => [ :destroy, :create, :update, :destroy_participant, :reset ], - :add_flash => { :notice => "Failed to execute last action" }, - :redirect_to => :admin_participants_path + # TODO verify http methods def default redirect_to admin_participants_path diff --git a/app/controllers/admin/ressources_controller.rb b/app/controllers/admin/ressources_controller.rb index 2975839..3c5367b 100644 --- a/app/controllers/admin/ressources_controller.rb +++ b/app/controllers/admin/ressources_controller.rb @@ -1,17 +1,17 @@ # Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). -# +# # This file is part of ECS. -# +# # ECS is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. -# +# # ECS is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public # License along with ECS. If not, see <http://www.gnu.org/licenses/>. @@ -21,43 +21,40 @@ class Admin::RessourcesController < ApplicationController include Admin::Helper - # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) - verify :method => [ :post, :put, :delete ], :only => [ :destroy, :create, :update ], - :add_flash => { :notice => "Failed to execute last action" }, - :redirect_to => :admin_ressources_path + # TODO verify http methods def index list render :action => 'list' end - - def list + + def list @ressources = Ressource.list @list_ressources_count = @ressources.count end - + def show @ressource = Ressource.find(params[:id]) end - + def new @ressource = Ressource.new end - + def create @ressource = Ressource.new(params[:ressource]) if @ressource.save flash[:notice] = 'Ressource was successfully created.' redirect_to admin_ressources_path - else + else render :action => 'new' end end - + def edit @ressource = Ressource.find(params[:id]) end - + def update #params[:participant][:community_ids] ||= [] @ressource = Ressource.find(params[:id]) @@ -68,10 +65,10 @@ class Admin::RessourcesController < ApplicationController render :action => 'edit' end end - + def destroy Ressource.find(params[:id]).destroy - redirect_to admin_ressources_path + redirect_to admin_ressources_path end - + end |