Description:
check multiple login
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r520:3e7249ecca01 - - 3 files changed: 35 inserted, 0 deleted

@@ -0,0 +1,20
1 + - content_for :header do
2 + = stylesheet_link_tag 'tablesorter-theme.cafe'
3 + = javascript_include_tag 'local_jquery'
4 +
5 + %h1 Login status
6 +
7 + =render partial: 'report_menu'
8 +
9 + %table.tablesorter-cafe#my_table
10 + %thead
11 + %tr
12 + %th login
13 + %th full name
14 + %th IP
15 + %tbody
16 + - @multiple.each do |l|
17 + %tr{class: cycle('info-even','info-odd')}
18 + %td= link_to l[:login], controller: 'users', action: 'profile', id: l[:id]
19 + %td= l[:full_name]
20 + %td= l[:ip_address]
@@ -211,7 +211,21
211 end
211 end
212 end
212 end
213 @struggle.sort!{|a,b| b[:tries] <=> a[:tries] }
213 @struggle.sort!{|a,b| b[:tries] <=> a[:tries] }
214 @struggle = @struggle[0..50]
214 @struggle = @struggle[0..50]
215 end
215 end
216
216
217 +
218 + def multiple_login
219 + raw = Submission.joins(:user).joins(:problem).where("problems.available != 0").group("login,ip_address").order(:login)
220 + last,count = 0,0
221 + @multiple = []
222 + raw.each do |r|
223 + if last != r.user.login
224 + count = 1
225 + else
226 + @multiple << r
227 + end
228 + end
229 + end
230 +
217 end
231 end
@@ -2,6 +2,7
2 .task-menu
2 .task-menu
3 Reports
3 Reports
4 %br/
4 %br/
5 = link_to '[Hall of Fame]', :action => 'problem_hof'
5 = link_to '[Hall of Fame]', :action => 'problem_hof'
6 = link_to '[Struggle]', :action => 'stuck'
6 = link_to '[Struggle]', :action => 'stuck'
7 = link_to '[Login]', :action => 'login_stat'
7 = link_to '[Login]', :action => 'login_stat'
8 + = link_to '[Multiple Login]', :action => 'multiple_login'
You need to be logged in to leave comments. Login now