Description:
fixed timing stat bug when used with single user mode
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r245:4658efe40e96 - - 2 files changed: 7 inserted, 1 deleted
@@ -10,7 +10,6 | |||||
|
10 | if user = User.authenticate(params[:login], params[:password]) |
|
10 | if user = User.authenticate(params[:login], params[:password]) |
|
11 | session[:user_id] = user.id |
|
11 | session[:user_id] = user.id |
|
12 | session[:admin] = user.admin? |
|
12 | session[:admin] = user.admin? |
|
13 | - UserContestStat.update_user_start_time(user) |
|
||
|
14 | redirect_to :controller => 'main', :action => 'list' |
|
13 | redirect_to :controller => 'main', :action => 'list' |
|
15 | else |
|
14 | else |
|
16 | flash[:notice] = 'Wrong password' |
|
15 | flash[:notice] = 'Wrong password' |
@@ -3,6 +3,8 | |||||
|
3 | before_filter :authenticate, :except => [:index, :login] |
|
3 | before_filter :authenticate, :except => [:index, :login] |
|
4 | before_filter :check_viewability, :except => [:index, :login] |
|
4 | before_filter :check_viewability, :except => [:index, :login] |
|
5 |
|
5 | ||
|
|
6 | + append_before_filter :update_user_start_time, :except => [:index, :login] | ||
|
|
7 | + | ||
|
6 | # COMMENTED OUT: filter in each action instead |
|
8 | # COMMENTED OUT: filter in each action instead |
|
7 | # before_filter :verify_time_limit, :only => [:submit] |
|
9 | # before_filter :verify_time_limit, :only => [:submit] |
|
8 |
|
10 | ||
@@ -455,5 +457,10 | |||||
|
455 | } |
|
457 | } |
|
456 | end |
|
458 | end |
|
457 |
|
459 | ||
|
|
460 | + def update_user_start_time | ||
|
|
461 | + user = User.find(session[:user_id]) | ||
|
|
462 | + UserContestStat.update_user_start_time(user) | ||
|
|
463 | + end | ||
|
|
464 | + | ||
|
458 | end |
|
465 | end |
|
459 |
|
466 |
You need to be logged in to leave comments.
Login now