Description:
add license agreement checkbox
(grafted from 93e468dab6dfc714db68d5a00d54f06b755f49bc)
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r542:ac9d2c0737d1 - - 3 files changed: 10 inserted, 2 deleted
@@ -7,7 +7,10 | |||
|
7 | 7 | end |
|
8 | 8 | |
|
9 | 9 | def login |
|
10 | - if user = User.authenticate(params[:login], params[:password]) | |
|
10 | + if (!GraderConfiguration['right.bypass_agreement']) and (!params[:accept_agree]) | |
|
11 | + flash[:notice] = 'You must accept the agreement before logging in' | |
|
12 | + redirect_to :controller => 'main', :action => 'login' | |
|
13 | + elsif user = User.authenticate(params[:login], params[:password]) | |
|
11 | 14 | session[:user_id] = user.id |
|
12 | 15 | session[:admin] = user.admin? |
|
13 | 16 |
@@ -22,6 +22,11 | |||
|
22 | 22 | %td{:align => "right"} |
|
23 | 23 | ="#{t 'password_label'}:" |
|
24 | 24 | %td= password_field_tag |
|
25 | + - unless GraderConfiguration['right.bypass_agreement'] | |
|
26 | + %tr | |
|
27 | + %td{:align => "right"}= check_box_tag 'accept_agree' | |
|
28 | + %td ยอมรับข้อตกลงการใช้งาน | |
|
29 | + | |
|
25 | 30 | = submit_tag t('login.login_submit') |
|
26 | 31 | %br/ |
|
27 | 32 |
@@ -11,7 +11,7 | |||
|
11 | 11 | # |
|
12 | 12 | # It's strongly recommended to check this file into your version control system. |
|
13 | 13 | |
|
14 |
- ActiveRecord::Schema.define(:version => 20150914 |
|
|
14 | + ActiveRecord::Schema.define(:version => 20150914223258) do | |
|
15 | 15 | |
|
16 | 16 | create_table "announcements", :force => true do |t| |
|
17 | 17 | t.string "author" |
You need to be logged in to leave comments.
Login now