From e58fd0550b4a29fac9d52dc8a78d04333ccc8c06 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 17 Jun 2013 01:27:55 -0700 Subject: new ui - initial user changes --- users/app/controllers/account_settings_controller.rb | 0 users/app/controllers/email_settings_controller.rb | 0 users/app/controllers/overviews_controller.rb | 9 +++++++++ users/app/controllers/users_base_controller.rb | 18 ++++++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 users/app/controllers/account_settings_controller.rb create mode 100644 users/app/controllers/email_settings_controller.rb create mode 100644 users/app/controllers/overviews_controller.rb create mode 100644 users/app/controllers/users_base_controller.rb (limited to 'users/app/controllers') diff --git a/users/app/controllers/account_settings_controller.rb b/users/app/controllers/account_settings_controller.rb new file mode 100644 index 0000000..e69de29 diff --git a/users/app/controllers/email_settings_controller.rb b/users/app/controllers/email_settings_controller.rb new file mode 100644 index 0000000..e69de29 diff --git a/users/app/controllers/overviews_controller.rb b/users/app/controllers/overviews_controller.rb new file mode 100644 index 0000000..52ce267 --- /dev/null +++ b/users/app/controllers/overviews_controller.rb @@ -0,0 +1,9 @@ +class OverviewsController < UsersBaseController + + before_filter :authorize + before_filter :fetch_user + + def show + end + +end diff --git a/users/app/controllers/users_base_controller.rb b/users/app/controllers/users_base_controller.rb new file mode 100644 index 0000000..dc2fa16 --- /dev/null +++ b/users/app/controllers/users_base_controller.rb @@ -0,0 +1,18 @@ +# +# common base class for all user related controllers +# + +class UsersBaseController < ApplicationController + + protected + + def fetch_user + @user = User.find_by_param(params[:user_id] || params[:id]) + if !@user && admin? + redirect_to users_url, :alert => t(:no_such_thing, :thing => 'user') + elsif !admin? && @user != current_user + access_denied + end + end + +end -- cgit v1.2.3