Commit 0dd497dee2519739c6c7790a93f74881f2ae63c8

Authored by AntonioTerceiro
1 parent c95d491c

ActionItem154: removing unused code


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1253 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/admin/features_controller.rb
1 class FeaturesController < AdminController 1 class FeaturesController < AdminController
2 protect 'edit_environment_features', :environment 2 protect 'edit_environment_features', :environment
3 3
4 - acts_as_environment_admin_controller  
5 -  
6 def index 4 def index
7 @features = Environment.available_features 5 @features = Environment.available_features
8 end 6 end
app/controllers/application.rb
@@ -31,10 +31,6 @@ class ApplicationController &lt; ActionController::Base @@ -31,10 +31,6 @@ class ApplicationController &lt; ActionController::Base
31 before_filter :detect_stuff_by_domain 31 before_filter :detect_stuff_by_domain
32 attr_reader :environment 32 attr_reader :environment
33 33
34 - def self.acts_as_environment_admin_controller  
35 - before_filter :load_admin_controller  
36 - end  
37 -  
38 # declares that the given <tt>actions</tt> cannot be accessed by other HTTP 34 # declares that the given <tt>actions</tt> cannot be accessed by other HTTP
39 # method besides POST. 35 # method besides POST.
40 def self.post_only(actions, redirect = { :action => 'index'}) 36 def self.post_only(actions, redirect = { :action => 'index'})
@@ -60,14 +56,8 @@ class ApplicationController &lt; ActionController::Base @@ -60,14 +56,8 @@ class ApplicationController &lt; ActionController::Base
60 render(:file => File.join(RAILS_ROOT, 'app', 'views', 'shared', 'not_found.rhtml'), :layout => 'not_found', :status => 404) && false 56 render(:file => File.join(RAILS_ROOT, 'app', 'views', 'shared', 'not_found.rhtml'), :layout => 'not_found', :status => 404) && false
61 end 57 end
62 58
63 - def load_admin_controller  
64 - # TODO: check access control  
65 - end  
66 -  
67 def load_profile 59 def load_profile
68 - @profile = Profile.find_by_identifier(params[:profile]) unless @profile  
69 -#raise "bli %s" % @profile.inspect  
70 -# @profile = Profile.find_by_identifier(params[:profile]) unless @profile 60 + @profile = Profile.find_by_identifier(params[:profile])
71 render_not_found unless @profile 61 render_not_found unless @profile
72 end 62 end
73 63
app/controllers/public/account_controller.rb
1 class AccountController < PublicController 1 class AccountController < PublicController
2 2
3 - before_filter :load_default_environment  
4 -  
5 # say something nice, you goof! something sweet. 3 # say something nice, you goof! something sweet.
6 def index 4 def index
7 unless logged_in? 5 unless logged_in?
@@ -131,16 +129,6 @@ class AccountController &lt; PublicController @@ -131,16 +129,6 @@ class AccountController &lt; PublicController
131 129
132 protected 130 protected
133 131
134 - before_filter :load_profile_for_user  
135 - def load_profile_for_user  
136 - return unless logged_in?  
137 - @profile = current_user.person  
138 - end  
139 -  
140 - def load_default_environment  
141 - @environment = Environment.default  
142 - end  
143 -  
144 def go_to_user_initial_page 132 def go_to_user_initial_page
145 redirect_back_or_default(:controller => "content_viewer", :profile => current_user.login, :action => 'view_page', :page => []) 133 redirect_back_or_default(:controller => "content_viewer", :profile => current_user.login, :action => 'view_page', :page => [])
146 end 134 end