Overview

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

#index ⇒ Object

# File 'app/controllers/users_controller.rb', line 30defindexsort_init'login','asc'sort_update%w(loginfirstnamelastnamemailadmincreated_onlast_login_on)caseparams[:format]when'xml','json'@offset,@limit=api_offset_and_limitelse@limit=per_page_optionendscope=Userscope=scope.in_group(params[:group_id].to_i)ifparams[:group_id].present?@status=params[:status]?params[:status].to_i:1c=ARCondition.new(@status==0?"status <> 0":["status = ?",@status])unlessparams[:name].blank?name="%#{params[:name].strip.downcase}%"c<<["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ? OR LOWER(mail) LIKE ?",name,name,name,name]end@user_count=scope.count(:conditions=>c.conditions)@user_pages=Paginator.newself,@user_count,@limit,params['page']@offset||=@user_pages.current.offset@users=scope.find:all,:order=>sort_clause,:conditions=>c.conditions,:limit=>@limit,:offset=>@offsetrespond_todo|format|format.html{@groups=Group.all.sortrender:layout=>!request.xhr?}format.apiendend

#show ⇒ Object

70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

# File 'app/controllers/users_controller.rb', line 70defshow# show projects based on current user visibility
@memberships=@user.memberships.all(:conditions=>Project.visible_by(User.current))events=Redmine::Activity::Fetcher.new(User.current,:author=>@user).events(nil,nil,:limit=>10)@events_by_day=events.group_by(&:event_date)unlessUser.current.admin?if!@user.active?||(@user!=User.current&&@memberships.empty?&&events.empty?)render_404returnendendrespond_todo|format|format.html{render:layout=>'base'}format.apiendend