Description:
confusing merge
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r483:7cf62e1e74ba - - 1 file changed: 0 inserted, 1 deleted
@@ -1,53 +1,52 | |||||
|
1 | require 'csv' |
|
1 | require 'csv' |
|
2 |
|
2 | ||
|
3 | class UserAdminController < ApplicationController |
|
3 | class UserAdminController < ApplicationController |
|
4 |
|
4 | ||
|
5 | - |
|
||
|
6 | include MailHelperMethods |
|
5 | include MailHelperMethods |
|
7 |
|
6 | ||
|
8 | before_filter :admin_authorization |
|
7 | before_filter :admin_authorization |
|
9 |
|
8 | ||
|
10 | # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) |
|
9 | # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) |
|
11 | verify :method => :post, :only => [ :destroy, |
|
10 | verify :method => :post, :only => [ :destroy, |
|
12 | :create, :create_from_list, |
|
11 | :create, :create_from_list, |
|
13 | :update, |
|
12 | :update, |
|
14 | :manage_contest, |
|
13 | :manage_contest, |
|
15 | :bulk_mail |
|
14 | :bulk_mail |
|
16 | ], |
|
15 | ], |
|
17 | :redirect_to => { :action => :list } |
|
16 | :redirect_to => { :action => :list } |
|
18 |
|
17 | ||
|
19 | def index |
|
18 | def index |
|
20 | list |
|
19 | list |
|
21 | render :action => 'list' |
|
20 | render :action => 'list' |
|
22 | end |
|
21 | end |
|
23 |
|
22 | ||
|
24 | def list |
|
23 | def list |
|
25 | @user_count = User.count |
|
24 | @user_count = User.count |
|
26 | if params[:page] == 'all' |
|
25 | if params[:page] == 'all' |
|
27 | @users = User.all |
|
26 | @users = User.all |
|
28 | @paginated = false |
|
27 | @paginated = false |
|
29 | else |
|
28 | else |
|
30 | @users = User.paginate :page => params[:page] |
|
29 | @users = User.paginate :page => params[:page] |
|
31 | @paginated = true |
|
30 | @paginated = true |
|
32 | end |
|
31 | end |
|
33 | @hidden_columns = ['hashed_password', 'salt', 'created_at', 'updated_at'] |
|
32 | @hidden_columns = ['hashed_password', 'salt', 'created_at', 'updated_at'] |
|
34 | @contests = Contest.enabled |
|
33 | @contests = Contest.enabled |
|
35 | end |
|
34 | end |
|
36 |
|
35 | ||
|
37 | def active |
|
36 | def active |
|
38 | sessions = ActiveRecord::SessionStore::Session.find(:all, :conditions => ["updated_at >= ?", 60.minutes.ago]) |
|
37 | sessions = ActiveRecord::SessionStore::Session.find(:all, :conditions => ["updated_at >= ?", 60.minutes.ago]) |
|
39 | @users = [] |
|
38 | @users = [] |
|
40 | sessions.each do |session| |
|
39 | sessions.each do |session| |
|
41 | if session.data[:user_id] |
|
40 | if session.data[:user_id] |
|
42 | @users << User.find(session.data[:user_id]) |
|
41 | @users << User.find(session.data[:user_id]) |
|
43 | end |
|
42 | end |
|
44 | end |
|
43 | end |
|
45 | end |
|
44 | end |
|
46 |
|
45 | ||
|
47 | def show |
|
46 | def show |
|
48 | @user = User.find(params[:id]) |
|
47 | @user = User.find(params[:id]) |
|
49 | end |
|
48 | end |
|
50 |
|
49 | ||
|
51 | def new |
|
50 | def new |
|
52 | @user = User.new |
|
51 | @user = User.new |
|
53 | end |
|
52 | end |
You need to be logged in to leave comments.
Login now