summaryrefslogtreecommitdiff
path: root/users/app/controllers/users_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'users/app/controllers/users_controller.rb')
-rw-r--r--users/app/controllers/users_controller.rb21
1 files changed, 8 insertions, 13 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index 09622b3..98294b9 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -3,22 +3,24 @@
#
class UsersController < UsersBaseController
-
before_filter :authorize, :only => [:show, :edit, :update, :destroy]
before_filter :fetch_user, :only => [:show, :edit, :update, :destroy]
- #before_filter :authorize_self, :only => [:update]
before_filter :authorize_admin, :only => [:index]
- respond_to :json
+ respond_to :html
def index
if params[:query]
- @users = User.by_login.startkey(params[:query]).endkey(params[:query].succ)
+ if @user = User.find_by_login(params[:query])
+ redirect_to user_overview_url(@user)
+ return
+ else
+ @users = User.by_login.startkey(params[:query]).endkey(params[:query].succ)
+ end
else
@users = User.by_created_at.descending
end
- @users = @users.limit(APP_CONFIG[:pagination_size])
- #respond_with @users.map(&:login).sort
+ @users = @users.limit(100)
end
def new
@@ -52,11 +54,4 @@ class UsersController < UsersBaseController
end
end
- protected
-
- #def authorize_self
- # # have already checked that authorized
- # access_denied unless (@user == current_user)
- #end
-
end