Fixed routing bug on (ex) admin controller.
This commit is contained in:
parent
9a54d8504c
commit
571548dfbc
10 changed files with 9 additions and 15 deletions
|
@ -1,7 +1,5 @@
|
||||||
class AdminController < ApplicationController
|
class Admin::BaseController < ApplicationController
|
||||||
before_filter :authenticate_admin
|
before_filter :authenticate_admin
|
||||||
filter_parameter_logging :password, :password_confirmation # do not log passwort parameters
|
|
||||||
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@user = self.current_user
|
@user = self.current_user
|
|
@ -1,5 +1,4 @@
|
||||||
class Admin::OrdergroupsController < ApplicationController
|
class Admin::OrdergroupsController < Admin::BaseController
|
||||||
before_filter :authenticate_admin
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if (params[:per_page] && params[:per_page].to_i > 0 && params[:per_page].to_i <= 100)
|
if (params[:per_page] && params[:per_page].to_i > 0 && params[:per_page].to_i <= 100)
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
class Admin::UsersController < ApplicationController
|
class Admin::UsersController < Admin::BaseController
|
||||||
before_filter :authenticate_admin
|
|
||||||
filter_parameter_logging :password, :password_confirmation # do not log passwort parameters
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if (params[:per_page] && params[:per_page].to_i > 0 && params[:per_page].to_i <= 100)
|
if (params[:per_page] && params[:per_page].to_i > 0 && params[:per_page].to_i <= 100)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class Admin::WorkgroupsController < ApplicationController
|
class Admin::WorkgroupsController < Admin::BaseController
|
||||||
before_filter :authenticate_admin
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if (params[:per_page] && params[:per_page].to_i > 0 && params[:per_page].to_i <= 100)
|
if (params[:per_page] && params[:per_page].to_i > 0 && params[:per_page].to_i <= 100)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
|
filter_parameter_logging :password, :password_confirmation # do not log passwort parameters
|
||||||
before_filter :select_foodcoop, :authenticate, :store_controller
|
before_filter :select_foodcoop, :authenticate, :store_controller
|
||||||
after_filter :remove_controller
|
after_filter :remove_controller
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
class LoginController < ApplicationController
|
class LoginController < ApplicationController
|
||||||
skip_before_filter :authenticate # no authentication since this is the login page
|
skip_before_filter :authenticate # no authentication since this is the login page
|
||||||
filter_parameter_logging "password" # do not log "password" parameter
|
|
||||||
before_filter :validate_token, :only => [:password, :update_password]
|
before_filter :validate_token, :only => [:password, :update_password]
|
||||||
|
|
||||||
verify :method => :post, :only => [:login, :reset_password, :new], :redirect_to => { :action => :index }
|
verify :method => :post, :only => [:login, :reset_password, :new], :redirect_to => { :action => :index }
|
||||||
|
|
|
@ -117,7 +117,7 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def tab_is_active?(tab)
|
def tab_is_active?(tab)
|
||||||
tab[:active].detect {|c| c == controller.controller_path }
|
tab[:active].detect {|c| controller.controller_path.match(c) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def icon(name, options={})
|
def icon(name, options={})
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ :name => "Administration", :url => admin_root_path,
|
{ :name => "Administration", :url => admin_root_path,
|
||||||
:active => ["admin", "admin/users", "admin/ordergroups", "admin/workgroups"],
|
:active => ["admin/"],
|
||||||
:access_denied? => (!u.role_admin?),
|
:access_denied? => (!u.role_admin?),
|
||||||
:subnav => [
|
:subnav => [
|
||||||
{ :name => "Benutzerinnen", :url => admin_users_path },
|
{ :name => "Benutzerinnen", :url => admin_users_path },
|
||||||
|
|
|
@ -68,7 +68,7 @@ ActionController::Routing::Routes.draw do |map|
|
||||||
|
|
||||||
# Administration
|
# Administration
|
||||||
map.namespace :admin do |admin|
|
map.namespace :admin do |admin|
|
||||||
admin.root :controller => "admin", :action => "index"
|
admin.root :controller => "base", :action => "index"
|
||||||
admin.resources :users
|
admin.resources :users
|
||||||
admin.resources :workgroups, :member => { :memberships => :get }
|
admin.resources :workgroups, :member => { :memberships => :get }
|
||||||
admin.resources :ordergroups, :member => { :memberships => :get }
|
admin.resources :ordergroups, :member => { :memberships => :get }
|
||||||
|
|
Loading…
Reference in a new issue