2012-05-02 10:18:07 +01:00
|
|
|
class Users::BaseController < ApplicationController
|
2015-03-04 23:19:19 +00:00
|
|
|
before_action :authenticate_user!
|
|
|
|
before_action :find_user
|
2012-05-02 10:18:07 +01:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def find_user
|
2012-05-03 22:52:56 +01:00
|
|
|
if user_id = params[:uname] || params[:user_id] || params[:id]
|
2012-12-27 18:27:50 +00:00
|
|
|
@user = User.opened.find_by_insensitive_uname! user_id
|
2012-05-02 10:18:07 +01:00
|
|
|
end
|
|
|
|
end
|
2013-03-01 11:33:02 +00:00
|
|
|
|
|
|
|
def set_current_user
|
|
|
|
@user = current_user
|
|
|
|
end
|
2012-05-02 10:18:07 +01:00
|
|
|
end
|