Description:
added password recovery through e-mails git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@400 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r189:5c9646c12fab - - 5 files changed: 120 inserted, 4 deleted

@@ -0,0 +1,18
1 + .contest-title
2 + %h1
3 + = "#{Configuration['contest.name']}: #{t 'registration.password_retrieval.header'}"
4 +
5 + - if flash[:notice]
6 + %hr/
7 + %b= flash[:notice]
8 + %hr/
9 +
10 + %br/
11 +
12 + - form_tag :action => 'retrieve_password' do
13 + =t 'registration.password_retrieval.instructions'
14 + = text_field 'email', nil, :size => 20
15 + %br/
16 + = submit_tag(t 'registration.password_retrieval.button_label')
17 +
18 + = link_to "#{t 'go_back_to'}#{t 'home_page'}", :controller => 'main', :action => 'index'
@@ -1,32 +1,39
1 require 'tmail'
1 require 'tmail'
2 require 'net/smtp'
2 require 'net/smtp'
3
3
4 class UsersController < ApplicationController
4 class UsersController < ApplicationController
5
5
6 - before_filter :authenticate, :except => [:new, :register, :confirm]
6 + before_filter :authenticate, :except => [:new,
7 + :register,
8 + :confirm,
9 + :forget,
10 + :retrieve_password]
7
11
8 - before_filter :verify_online_registration, :only => [:new, :register]
12 + before_filter :verify_online_registration, :only => [:new,
13 + :register,
14 + :forget,
15 + :retrieve_password]
9
16
10 verify :method => :post, :only => [:chg_passwd],
17 verify :method => :post, :only => [:chg_passwd],
11 :redirect_to => { :action => :index }
18 :redirect_to => { :action => :index }
12
19
13 #in_place_edit_for :user, :alias_for_editing
20 #in_place_edit_for :user, :alias_for_editing
14 #in_place_edit_for :user, :email_for_editing
21 #in_place_edit_for :user, :email_for_editing
15
22
16 def index
23 def index
17 if !Configuration['system.user_setting_enabled']
24 if !Configuration['system.user_setting_enabled']
18 redirect_to :controller => 'main', :action => 'list'
25 redirect_to :controller => 'main', :action => 'list'
19 else
26 else
20 @user = User.find(session[:user_id])
27 @user = User.find(session[:user_id])
21 end
28 end
22 end
29 end
23
30
24 def chg_passwd
31 def chg_passwd
25 user = User.find(session[:user_id])
32 user = User.find(session[:user_id])
26 user.password = params[:passwd]
33 user.password = params[:passwd]
27 user.password_confirmation = params[:passwd_verify]
34 user.password_confirmation = params[:passwd_verify]
28 if user.save
35 if user.save
29 flash[:notice] = 'password changed'
36 flash[:notice] = 'password changed'
30 else
37 else
31 flash[:notice] = 'Error: password changing failed'
38 flash[:notice] = 'Error: password changing failed'
32 end
39 end
@@ -56,69 +63,122
56 else
63 else
57 @user.errors.add_to_base("Email cannot be blank") if @user.email==''
64 @user.errors.add_to_base("Email cannot be blank") if @user.email==''
58 render :action => 'new', :layout => 'empty'
65 render :action => 'new', :layout => 'empty'
59 end
66 end
60 end
67 end
61
68
62 def confirm
69 def confirm
63 login = params[:login]
70 login = params[:login]
64 key = params[:activation]
71 key = params[:activation]
65 @user = User.find_by_login(login)
72 @user = User.find_by_login(login)
66 if (@user) and (@user.verify_activation_key(key))
73 if (@user) and (@user.verify_activation_key(key))
67 if @user.valid? # check uniquenss of email
74 if @user.valid? # check uniquenss of email
68 @user.activated = true
75 @user.activated = true
69 @user.save
76 @user.save
70 @result = :successful
77 @result = :successful
71 else
78 else
72 @result = :email_used
79 @result = :email_used
73 end
80 end
74 else
81 else
75 @result = :failed
82 @result = :failed
76 end
83 end
77 render :action => 'confirm', :layout => 'empty'
84 render :action => 'confirm', :layout => 'empty'
78 end
85 end
79
86
87 + def forget
88 + render :action => 'forget', :layout => 'empty'
89 + end
90 +
91 + def retrieve_password
92 + email = params[:email]
93 + user = User.find_by_email(email)
94 + if user
95 + last_updated_time = user.updated_at || user.created_at || (Time.now.gmtime - 1.hour)
96 + if last_updated_time > Time.now.gmtime - 5.minutes
97 + flash[:notice] = 'The account has recently created or new password has recently been requested. Please wait for 5 minutes'
98 + else
99 + user.password = user.password_confirmation = User.random_password
100 + send_new_password_email(user)
101 + flash[:notice] = 'New password has been mailed to you.'
102 + end
103 + else
104 + flash[:notice] = I18n.t 'registration.password_retrieval.no_email'
105 + end
106 + redirect_to :action => 'forget'
107 + end
108 +
80 protected
109 protected
81
110
82 def verify_online_registration
111 def verify_online_registration
83 if !Configuration['system.online_registration']
112 if !Configuration['system.online_registration']
84 redirect_to :controller => 'main', :action => 'login'
113 redirect_to :controller => 'main', :action => 'login'
85 end
114 end
86 end
115 end
87
116
88 def send_confirmation_email(user)
117 def send_confirmation_email(user)
89 contest_name = Configuration['contest.name']
118 contest_name = Configuration['contest.name']
90 admin_email = Configuration['system.admin_email']
119 admin_email = Configuration['system.admin_email']
91 activation_url = url_for(:action => 'confirm',
120 activation_url = url_for(:action => 'confirm',
92 :login => user.login,
121 :login => user.login,
93 :activation => user.activation_key)
122 :activation => user.activation_key)
94 home_url = url_for(:controller => 'main', :action => 'index')
123 home_url = url_for(:controller => 'main', :action => 'index')
95 mail = TMail::Mail.new
124 mail = TMail::Mail.new
96 mail.to = user.email
125 mail.to = user.email
97 mail.from = Configuration['system.online_registration.from']
126 mail.from = Configuration['system.online_registration.from']
98 mail.subject = "[#{contest_name}] Confirmation"
127 mail.subject = "[#{contest_name}] Confirmation"
99 mail.body = t('registration.email_body', {
128 mail.body = t('registration.email_body', {
100 :full_name => user.full_name,
129 :full_name => user.full_name,
101 :contest_name => contest_name,
130 :contest_name => contest_name,
102 :login => user.login,
131 :login => user.login,
103 :password => user.password,
132 :password => user.password,
104 :activation_url => activation_url,
133 :activation_url => activation_url,
105 :admin_email => admin_email
134 :admin_email => admin_email
106 })
135 })
107
136
108 logger.info mail.body
137 logger.info mail.body
109
138
110 smtp_server = Configuration['system.online_registration.smtp']
139 smtp_server = Configuration['system.online_registration.smtp']
111
140
112 begin
141 begin
113 Net::SMTP.start(smtp_server) do |smtp|
142 Net::SMTP.start(smtp_server) do |smtp|
114 smtp.send_message(mail.to_s, mail.from, mail.to)
143 smtp.send_message(mail.to_s, mail.from, mail.to)
115 end
144 end
116 result = true
145 result = true
117 rescue
146 rescue
118 result = false
147 result = false
119 end
148 end
120
149
121 return result
150 return result
122 end
151 end
123
152
153 + def send_new_password_email(user)
154 + contest_name = Configuration['contest.name']
155 + admin_email = Configuration['system.admin_email']
156 + mail = TMail::Mail.new
157 + mail.to = user.email
158 + mail.from = Configuration['system.online_registration.from']
159 + mail.subject = "[#{contest_name}] Confirmation"
160 + mail.body = t('registration.password_retrieval.email_body', {
161 + :full_name => user.full_name,
162 + :contest_name => contest_name,
163 + :login => user.login,
164 + :password => user.password,
165 + :admin_email => admin_email
166 + })
167 +
168 + logger.info mail.body
169 +
170 + smtp_server = Configuration['system.online_registration.smtp']
171 +
172 + begin
173 + Net::SMTP.start(smtp_server) do |smtp|
174 + smtp.send_message(mail.to_s, mail.from, mail.to)
124 end
175 end
176 + result = true
177 + rescue
178 + result = false
179 + end
180 +
181 + return result
182 + end
183 +
184 + end
@@ -18,25 +18,25
18 %hr/
18 %hr/
19 %b= flash[:notice]
19 %b= flash[:notice]
20 %hr/
20 %hr/
21
21
22 %div{ :style => "border: solid 1px gray; padding: 2px; background: #f0f0f0;"}
22 %div{ :style => "border: solid 1px gray; padding: 2px; background: #f0f0f0;"}
23 - form_tag :controller => 'login', :action => 'login' do
23 - form_tag :controller => 'login', :action => 'login' do
24 %table
24 %table
25 %tr
25 %tr
26 %td{:align => "right"}
26 %td{:align => "right"}
27 ="#{t 'login_label'}:"
27 ="#{t 'login_label'}:"
28 %td= text_field_tag 'login'
28 %td= text_field_tag 'login'
29 %tr
29 %tr
30 %td{:align => "right"}
30 %td{:align => "right"}
31 ="#{t 'password_label'}:"
31 ="#{t 'password_label'}:"
32 %td= password_field_tag
32 %td= password_field_tag
33 = submit_tag t('login.login_submit')
33 = submit_tag t('login.login_submit')
34 %br/
34 %br/
35
35
36 - if Configuration['system.online_registration']
36 - if Configuration['system.online_registration']
37 =t 'login.participation'
37 =t 'login.participation'
38 %b
38 %b
39 = "#{t 'login.please'} "
39 = "#{t 'login.please'} "
40 = link_to "#{t 'login.register'}", :controller => :users, :action => :new
40 = link_to "#{t 'login.register'}", :controller => :users, :action => :new
41 %br/
41 %br/
42 -
42 + = link_to "#{t 'login.forget_password'}", :controller => :users, :action => :forget
@@ -14,105 +14,126
14 login_page: "login page"
14 login_page: "login page"
15 home_page: "home page"
15 home_page: "home page"
16
16
17 menu:
17 menu:
18 main: 'Main'
18 main: 'Main'
19 messages: 'Messages'
19 messages: 'Messages'
20 tasks: 'Tasks'
20 tasks: 'Tasks'
21 submissions: 'Submissions'
21 submissions: 'Submissions'
22 test: 'Test Interface'
22 test: 'Test Interface'
23 help: 'Help'
23 help: 'Help'
24 settings: 'Settings'
24 settings: 'Settings'
25 log_out: 'Log out'
25 log_out: 'Log out'
26
26
27 title_bar:
27 title_bar:
28 current_time: "Current time is"
28 current_time: "Current time is"
29 remaining_time: "Time left: "
29 remaining_time: "Time left: "
30 contest_not_started: "The contest has not started."
30 contest_not_started: "The contest has not started."
31
31
32 login:
32 login:
33 message: 'Please login to see the problem list'
33 message: 'Please login to see the problem list'
34 login_submit: 'Login'
34 login_submit: 'Login'
35 participation: 'Want to participate?'
35 participation: 'Want to participate?'
36 please: 'Please'
36 please: 'Please'
37 register: 'register'
37 register: 'register'
38 + forget_password: 'Forget password?'
38
39
39 main:
40 main:
40 start_soon: "The contest at your site will start soon. Please wait."
41 start_soon: "The contest at your site will start soon. Please wait."
41 specified_in_header: "Specified in header"
42 specified_in_header: "Specified in header"
42
43
43 problem_desc: "desc"
44 problem_desc: "desc"
44 submitted_at: "Submitted at"
45 submitted_at: "Submitted at"
45 graded_at: "Graded at"
46 graded_at: "Graded at"
46 score: "score: "
47 score: "score: "
47 cmp_msg: "compiler msg"
48 cmp_msg: "compiler msg"
48 src_link: "src"
49 src_link: "src"
49 submissions_link: "submissions"
50 submissions_link: "submissions"
50
51
51 test:
52 test:
52 title: "Test Interface"
53 title: "Test Interface"
53 intro: "You can test your submission with your own test data on the grading environment using this test interface."
54 intro: "You can test your submission with your own test data on the grading environment using this test interface."
54 disabled_at_end_announcement: "<b>Note:</b> Test interface will be disabled in the last 30 minutes of the contest time on your site."
55 disabled_at_end_announcement: "<b>Note:</b> Test interface will be disabled in the last 30 minutes of the contest time on your site."
55
56
56 registration:
57 registration:
57 title: "New user registration"
58 title: "New user registration"
59 +
60 + description: "Please enter your information below. Please make sure your e-mail is correct, because you will have to confirm the registration through an e-mail we send to that e-mail address."
61 +
58 successful_title: "Registration successful"
62 successful_title: "Registration successful"
59
63
60 login_guide: "Only a-z, A-Z, 0-9 and _. Can be at most 20 characters long"
64 login_guide: "Only a-z, A-Z, 0-9 and _. Can be at most 20 characters long"
61 email_guide: "Please make sure that your e-mail is correct.<br/>You'll need to verify your account by email."
65 email_guide: "Please make sure that your e-mail is correct.<br/>You'll need to verify your account by email."
62 register: "Register"
66 register: "Register"
63
67
64 email_body: "Hello {{full_name}},
68 email_body: "Hello {{full_name}},
65
69
66 You have registered for {{contest_name}}
70 You have registered for {{contest_name}}
67
71
68 Your login is: {{login}}
72 Your login is: {{login}}
69
73
70 Your password is: {{password}}
74 Your password is: {{password}}
71
75
72 Please follow the link:
76 Please follow the link:
73
77
74 {{activation_url}}
78 {{activation_url}}
75
79
76 to activate your user account.
80 to activate your user account.
77
81
78 If you did not register, please ignore this e-mail
82 If you did not register, please ignore this e-mail
79 and report this event to {{admin_email}}.
83 and report this event to {{admin_email}}.
80
84
81 Thanks!"
85 Thanks!"
82
86
83 email_sent: "We have sent a confimation message to your e-mail. (Please also check the Junk mail box."
87 email_sent: "We have sent a confimation message to your e-mail. (Please also check the Junk mail box."
84 email_verify_at: "Please check at {{email}} and confirm."
88 email_verify_at: "Please check at {{email}} and confirm."
85
89
86 activation_sucessful_title: "User activated"
90 activation_sucessful_title: "User activated"
87 account_activated: "Your account has been activated."
91 account_activated: "Your account has been activated."
88
92
89 activation_failed_title: "Activation failed"
93 activation_failed_title: "Activation failed"
90
94
91 errors:
95 errors:
92 header: "Errors occured during registration"
96 header: "Errors occured during registration"
93 email:
97 email:
94 title: "Errors in sending registration confirmation"
98 title: "Errors in sending registration confirmation"
95 expl: "<h2>Your user account has been created, but the system cannot send you the confirmation e-mail.</h2>
99 expl: "<h2>Your user account has been created, but the system cannot send you the confirmation e-mail.</h2>
96 Maybe there's a problem in the configuration. Please report the admin at {{email}}.<br/>Thank you!"
100 Maybe there's a problem in the configuration. Please report the admin at {{email}}.<br/>Thank you!"
97 activation:
101 activation:
98 email_exists: "A user with this E-mail exists."
102 email_exists: "A user with this E-mail exists."
99 invalid: "Your activation code is invalid. Please check again."
103 invalid: "Your activation code is invalid. Please check again."
100
104
105 + password_retrieval:
106 + header: "Password retrieval"
107 + instructions: "Please enter the e-mail address that you used to register."
108 + button_label: "Request new password"
109 + no_email: "No user with that e-mail address."
110 + email_body: "Hello {{full_name}},
111 +
112 + You have requested for new password for {{contest_name}}. We have generated it for you:
113 +
114 + user name: {{login}}
115 + password: {{password}}
116 +
117 + If you didn't ask for new password or you're not the person who registered,
118 + please ignore this e-mail and inform {{admin_email}} of this mistake.
119 +
120 + Thanks!"
121 +
101 help:
122 help:
102 how_to_submit: "How to submit"
123 how_to_submit: "How to submit"
103 must_specify_language: "You <b>must</b> specify the language you are using in your program header. You can optionally specify the task you are submitting to."
124 must_specify_language: "You <b>must</b> specify the language you are using in your program header. You can optionally specify the task you are submitting to."
104 list_available_language: "The possible language options are <tt>C</tt>, <tt>C++</tt>, and <tt>Pascal</tt>. The follow are examples."
125 list_available_language: "The possible language options are <tt>C</tt>, <tt>C++</tt>, and <tt>Pascal</tt>. The follow are examples."
105 accept_only_language_specified: "The server <b>will not</b> accept your submission, if you do not specify the language."
126 accept_only_language_specified: "The server <b>will not</b> accept your submission, if you do not specify the language."
106 specifying_task: "Optionally, you can also specify the task with <tt>TASK:</tt> <i>taskname</i>. On the first page, the taskname for each task is shown in parentheses."
127 specifying_task: "Optionally, you can also specify the task with <tt>TASK:</tt> <i>taskname</i>. On the first page, the taskname for each task is shown in parentheses."
107 example_cpp: "For example, suppose you are using <tt>C++</tt> to write task <b>mobiles</b>, you put the following on top of your source code."
128 example_cpp: "For example, suppose you are using <tt>C++</tt> to write task <b>mobiles</b>, you put the following on top of your source code."
108 example_pas: "If you are using <tt>Pascal</tt> to write the same task, you'll use"
129 example_pas: "If you are using <tt>Pascal</tt> to write the same task, you'll use"
109 ask_questions_at_messages: "If you have any problems, you can ask at [<a href=\"{{url}}\">{{message_link_name}}</a>]."
130 ask_questions_at_messages: "If you have any problems, you can ask at [<a href=\"{{url}}\">{{message_link_name}}</a>]."
110
131
111 activerecord:
132 activerecord:
112 attributes:
133 attributes:
113 user:
134 user:
114 login: "login"
135 login: "login"
115 full_name: "full name"
136 full_name: "full name"
116 email: "e-mail"
137 email: "e-mail"
117 province: "province"
138 province: "province"
118
139
@@ -14,108 +14,125
14 login_page: "หน้าเข้าใช้ระบบ"
14 login_page: "หน้าเข้าใช้ระบบ"
15 home_page: "หน้าแรก"
15 home_page: "หน้าแรก"
16
16
17 menu:
17 menu:
18 main: 'หน้าหลัก'
18 main: 'หน้าหลัก'
19 messages: 'ข้อความ'
19 messages: 'ข้อความ'
20 tasks: 'โจทย์'
20 tasks: 'โจทย์'
21 submissions: 'โปรแกรมที่ส่ง'
21 submissions: 'โปรแกรมที่ส่ง'
22 test: 'ทดสอบโปรแกรม'
22 test: 'ทดสอบโปรแกรม'
23 help: 'ความช่วยเหลือ'
23 help: 'ความช่วยเหลือ'
24 settings: 'เปลี่ยนรหัสผ่าน'
24 settings: 'เปลี่ยนรหัสผ่าน'
25 log_out: 'ออกจากระบบ'
25 log_out: 'ออกจากระบบ'
26
26
27 title_bar:
27 title_bar:
28 current_time: "เวลาปัจจุบันคือ"
28 current_time: "เวลาปัจจุบันคือ"
29 remaining_time: "เหลือเวลาอีก"
29 remaining_time: "เหลือเวลาอีก"
30 contest_not_started: "ยังไม่เริ่มแข่งขัน"
30 contest_not_started: "ยังไม่เริ่มแข่งขัน"
31
31
32 login:
32 login:
33 message: 'กรุณา login เพื่อเข้าสู่ระบบ'
33 message: 'กรุณา login เพื่อเข้าสู่ระบบ'
34 login_submit: 'เข้าใช้ระบบ'
34 login_submit: 'เข้าใช้ระบบ'
35 participation: 'ต้องการเข้าร่วม?'
35 participation: 'ต้องการเข้าร่วม?'
36 please: 'กรุณา'
36 please: 'กรุณา'
37 register: 'ลงทะเบียน'
37 register: 'ลงทะเบียน'
38 + forget_password: 'ลืมรหัสผ่าน?'
38
39
39 main:
40 main:
40 start_soon: "การแข่งขันกำลังจะเริ่ม กรุณารอก่อน"
41 start_soon: "การแข่งขันกำลังจะเริ่ม กรุณารอก่อน"
41 specified_in_header: "ระบุที่หัวโปรแกรมแล้ว"
42 specified_in_header: "ระบุที่หัวโปรแกรมแล้ว"
42
43
43 problem_desc: "อ่าน"
44 problem_desc: "อ่าน"
44 submitted_at: "ส่งเมื่อเวลา"
45 submitted_at: "ส่งเมื่อเวลา"
45 graded_at: "ตรวจเมื่อเวลา"
46 graded_at: "ตรวจเมื่อเวลา"
46 score: "คะแนน: "
47 score: "คะแนน: "
47 cmp_msg: "ผลคอมไพล์"
48 cmp_msg: "ผลคอมไพล์"
48 src_link: "ต้นฉบับ"
49 src_link: "ต้นฉบับ"
49 submissions_link: "การส่งครั้งอื่น ๆ"
50 submissions_link: "การส่งครั้งอื่น ๆ"
50
51
51 test:
52 test:
52 title: "ทดสอบโปรแกรมบนสภาพแวดล้อมของเครื่องตรวจ"
53 title: "ทดสอบโปรแกรมบนสภาพแวดล้อมของเครื่องตรวจ"
53 intro: "คุณสามารถทดลองการทำงานของโปรแกรมที่เขียนกับข้อมูลชุดทดสอบของคุณเองในสภาพแวดล้อมจริงของการตรวจโปรแกรมได้ โดยเลือกโปรแกรมส่งแล้วที่ด้านล่างพร้อมทั้งส่งแฟ้มข้อมูลชุดทดสอบที่ต้องการให้ทำงานด้วย"
54 intro: "คุณสามารถทดลองการทำงานของโปรแกรมที่เขียนกับข้อมูลชุดทดสอบของคุณเองในสภาพแวดล้อมจริงของการตรวจโปรแกรมได้ โดยเลือกโปรแกรมส่งแล้วที่ด้านล่างพร้อมทั้งส่งแฟ้มข้อมูลชุดทดสอบที่ต้องการให้ทำงานด้วย"
54 disabled_at_end_announcement: "<b>หมายเหตุ:</b> ระบบทดสอบโปรแกรมจะหยุดทำงานในช่วงเวลา 30 นาทีสุดท้ายของการแข่งขัน"
55 disabled_at_end_announcement: "<b>หมายเหตุ:</b> ระบบทดสอบโปรแกรมจะหยุดทำงานในช่วงเวลา 30 นาทีสุดท้ายของการแข่งขัน"
55
56
56 -
57 registration:
57 registration:
58 title: "ลงทะเบียนผู้ใช้ใหม่"
58 title: "ลงทะเบียนผู้ใช้ใหม่"
59 description: "ในการลงทะเบียน ให้ผู้สนใจเข้าร่วมการแข่งขันกรอกข้อมูลด้านล่าง จากนั้นระบบจะส่ง e-mail ไปยัง e-mail ที่ระบุเพื่อให้ยืนยันตัวตนและเปิดใช้บัญชีผู้ใช้<br/>ในกรณีที่ผู้เข้าแข่งขันเป็นนักเรียน รบกวนช่วยให้ข้อมูลเกี่ยวกับโรงเรียนและจังหวัดด้วย"
59 description: "ในการลงทะเบียน ให้ผู้สนใจเข้าร่วมการแข่งขันกรอกข้อมูลด้านล่าง จากนั้นระบบจะส่ง e-mail ไปยัง e-mail ที่ระบุเพื่อให้ยืนยันตัวตนและเปิดใช้บัญชีผู้ใช้<br/>ในกรณีที่ผู้เข้าแข่งขันเป็นนักเรียน รบกวนช่วยให้ข้อมูลเกี่ยวกับโรงเรียนและจังหวัดด้วย"
60
60
61 successful_title: "การลงทะเบียนเสร็จเรียบร้อย"
61 successful_title: "การลงทะเบียนเสร็จเรียบร้อย"
62
62
63 login_guide: "ใช้ได้เฉพาะ a-z, A-Z, 0-9 และ _ ความยาวไม่เกิน 20 ตัวอักษร"
63 login_guide: "ใช้ได้เฉพาะ a-z, A-Z, 0-9 และ _ ความยาวไม่เกิน 20 ตัวอักษร"
64 email_guide: "กรุณาตรวจสอบ e-mail ที่ใส่ให้ถูกต้อง<br/>คุณจะต้องยืนยันการลงทะเบียนผ่านทางข้อมูลที่จะส่งให้ทาง e-mail"
64 email_guide: "กรุณาตรวจสอบ e-mail ที่ใส่ให้ถูกต้อง<br/>คุณจะต้องยืนยันการลงทะเบียนผ่านทางข้อมูลที่จะส่งให้ทาง e-mail"
65 register: "ลงทะเบียน"
65 register: "ลงทะเบียน"
66
66
67 email_body: "สวัสดีครับ {{full_name}},
67 email_body: "สวัสดีครับ {{full_name}},
68
68
69 คุณได้ลงทะเบียนเข้าร่วมการแข่งขัน {{contest_name}}
69 คุณได้ลงทะเบียนเข้าร่วมการแข่งขัน {{contest_name}}
70
70
71 บัญชีเข้าใช้ของคุณคือ: {{login}}
71 บัญชีเข้าใช้ของคุณคือ: {{login}}
72
72
73 รหัสผ่านคือ: {{password}}
73 รหัสผ่านคือ: {{password}}
74
74
75 กรุณาเข้าลิงก์ต่อไปนี้:
75 กรุณาเข้าลิงก์ต่อไปนี้:
76
76
77 {{activation_url}}
77 {{activation_url}}
78
78
79 เพื่อเปิดใช้งานบัญชีของคุณ
79 เพื่อเปิดใช้งานบัญชีของคุณ
80
80
81 ถ้าคุณไม่ใช้คนที่ลงทะเบียน กรุณาละทิ้ง e-mail ฉบับนี้
81 ถ้าคุณไม่ใช้คนที่ลงทะเบียน กรุณาละทิ้ง e-mail ฉบับนี้
82 และแจ้งความผิดพลาดนี้กับ {{admin_email}}
82 และแจ้งความผิดพลาดนี้กับ {{admin_email}}
83
83
84 ขอบคุณมาก!"
84 ขอบคุณมาก!"
85
85
86 email_sent: "เราได้ส่งข้อมูลสำหรับยืนยันไปให้คุณแล้ว (โปรดอย่าลืมตรวจดูในส่วน Junk mail ด้วย)"
86 email_sent: "เราได้ส่งข้อมูลสำหรับยืนยันไปให้คุณแล้ว (โปรดอย่าลืมตรวจดูในส่วน Junk mail ด้วย)"
87 email_verify_at: "กรุณาตรวจสอบที่ {{email}} พร้อมทั้งยืนยัน"
87 email_verify_at: "กรุณาตรวจสอบที่ {{email}} พร้อมทั้งยืนยัน"
88
88
89 activation_sucessful_title: "บัณชีผู้ใช้ได้รับการยืนยันแล้ว"
89 activation_sucessful_title: "บัณชีผู้ใช้ได้รับการยืนยันแล้ว"
90 account_activated: "บัญชีผู้ใช้ของคุณพร้อมใช้งานแล้ว"
90 account_activated: "บัญชีผู้ใช้ของคุณพร้อมใช้งานแล้ว"
91
91
92 activation_failed_title: "การยืนยันล้มเหลว"
92 activation_failed_title: "การยืนยันล้มเหลว"
93
93
94 errors:
94 errors:
95 header: 'การลงทะเบียนมีข้อผิดพลาด'
95 header: 'การลงทะเบียนมีข้อผิดพลาด'
96 email:
96 email:
97 title: "เกิดปัญหาระหว่างการส่ง e-mail เพื่อยืนยันการสมัคร"
97 title: "เกิดปัญหาระหว่างการส่ง e-mail เพื่อยืนยันการสมัคร"
98 expl: "<h2>บัญชีผู้ใช้ของคุณถูกสร้างขึ้นแล้ว แต่ระบบไม่สามารถส่ง e-mail เพื่อยืนยันการสมัครได้</h2>
98 expl: "<h2>บัญชีผู้ใช้ของคุณถูกสร้างขึ้นแล้ว แต่ระบบไม่สามารถส่ง e-mail เพื่อยืนยันการสมัครได้</h2>
99 อาจเกิดปัญหาในการตั้งค่าเริ่มต้นของระบบ กรุณาช่วยติดต่อผู้ดูแลระบบด้วยที่ {{email}}<br/>ขอขอบคุณจากทีมงาน"
99 อาจเกิดปัญหาในการตั้งค่าเริ่มต้นของระบบ กรุณาช่วยติดต่อผู้ดูแลระบบด้วยที่ {{email}}<br/>ขอขอบคุณจากทีมงาน"
100 activation:
100 activation:
101 email_exists: "มีผู้ใช้ที่ใช้ e-mail นี้แล้ว"
101 email_exists: "มีผู้ใช้ที่ใช้ e-mail นี้แล้ว"
102 invalid: "รหัสสำหรับยืนยันผิดพลาด กรุณาตรวจสอบอีกครั้ง"
102 invalid: "รหัสสำหรับยืนยันผิดพลาด กรุณาตรวจสอบอีกครั้ง"
103
103
104 + password_retrieval:
105 + header: "การขอรหัสผ่านใหม่"
106 + instructions: "กรุณากรอก e-mail ที่ลงทะเบียน"
107 + button_label: "ขอรหัสผ่านใหม่"
108 + no_email: "ไม่มีบัญชีผู้ใช้ที่ใช้ e-mail ดังกล่าว"
109 + email_body: "สวัสดีครับ {{full_name}},
110 +
111 + คุณได้ร้องขอรหัสผ่านใหม่ สำหรับการแข่งขัน {{contest_name}} ซึ่งเราได้สร้างให้คุณแล้ว ดังนี้
112 +
113 + บัญชีเข้าใช้ของคุณคือ: {{login}}
114 + รหัสผ่านคือ: {{password}}
115 +
116 + ถ้าคุณไม่ได้ขอรหัสผ่านใหม่ หรือไม่ใช่คนที่ลงทะเบียน กรุณาละทิ้ง e-mail ฉบับนี้
117 + และแจ้งความผิดพลาดนี้กับ {{admin_email}}
118 +
119 + ขอบคุณมาก!"
120 +
104 help:
121 help:
105 how_to_submit: "วิธีการส่งโปรแกรม"
122 how_to_submit: "วิธีการส่งโปรแกรม"
106 must_specify_language: "คุณ<b>ต้อง</b>ระบุภาษาโปรแกรมที่ใช้ที่ตอนต้นของรหัสโปรแกรม (source code) นอกจากนี้คุณอาจจะระบุโจทย์ที่ต้องการส่งได้ด้วย"
123 must_specify_language: "คุณ<b>ต้อง</b>ระบุภาษาโปรแกรมที่ใช้ที่ตอนต้นของรหัสโปรแกรม (source code) นอกจากนี้คุณอาจจะระบุโจทย์ที่ต้องการส่งได้ด้วย"
107 list_available_language: "ภาษาโปรแกรมที่สามารถระบุได้คือ <tt>C</tt>, <tt>C++</tt>, และ <tt>Pascal</tt> ด้านล่างแสดงตัวอย่างของการระบุสำหรับภาษาต่าง ๆ"
124 list_available_language: "ภาษาโปรแกรมที่สามารถระบุได้คือ <tt>C</tt>, <tt>C++</tt>, และ <tt>Pascal</tt> ด้านล่างแสดงตัวอย่างของการระบุสำหรับภาษาต่าง ๆ"
108 accept_only_language_specified: "ระบบจะ<b>ไม่รับ</b>โปรแกรมที่ส่งถ้าคุณไม่ได้ระบุภาษาที่ใช้"
125 accept_only_language_specified: "ระบบจะ<b>ไม่รับ</b>โปรแกรมที่ส่งถ้าคุณไม่ได้ระบุภาษาที่ใช้"
109 specifying_task: "นอกจากนี้ คุณยังสามารถระบุชื่อของโจทย์ที่ต้องการส่งเพิ่มเติมได้ ในการระบุให้ใส่ <tt>TASK:</tt> <i>taskname</i> คุณสามารถตรวจสอบชื่อของโจทย์ได้ โดยจะแสดงในวงเล็บหลังชื่อภาษาไทยของโจทย์"
126 specifying_task: "นอกจากนี้ คุณยังสามารถระบุชื่อของโจทย์ที่ต้องการส่งเพิ่มเติมได้ ในการระบุให้ใส่ <tt>TASK:</tt> <i>taskname</i> คุณสามารถตรวจสอบชื่อของโจทย์ได้ โดยจะแสดงในวงเล็บหลังชื่อภาษาไทยของโจทย์"
110 example_cpp: "ยกตัวอย่างเช่น ถ้าคุณใช้ภาษา <tt>C++</tt> สำหรับเขียนโจทย์ <tt>mobiles</tt> ตอนต้นโปรแกรมคุณจะใส่ดังนี้"
127 example_cpp: "ยกตัวอย่างเช่น ถ้าคุณใช้ภาษา <tt>C++</tt> สำหรับเขียนโจทย์ <tt>mobiles</tt> ตอนต้นโปรแกรมคุณจะใส่ดังนี้"
111 example_pas: "ถ้าคุณใช้ภาษา <tt>Pascal</tt> เพื่อเขียนโจทย์ข้อเดียวกัน คุณจะระบุ"
128 example_pas: "ถ้าคุณใช้ภาษา <tt>Pascal</tt> เพื่อเขียนโจทย์ข้อเดียวกัน คุณจะระบุ"
112 ask_questions_at_messages: "ถ้ามีปัญหาในการใช้งานสามารถสอบถามได้ที่หน้า<a href=\"{{url}}\">{{message_link_name}}</a>"
129 ask_questions_at_messages: "ถ้ามีปัญหาในการใช้งานสามารถสอบถามได้ที่หน้า<a href=\"{{url}}\">{{message_link_name}}</a>"
113
130
114 activerecord:
131 activerecord:
115 attributes:
132 attributes:
116 user:
133 user:
117 login: "ชื่อเข้าใช้ระบบ"
134 login: "ชื่อเข้าใช้ระบบ"
118 full_name: "ชื่อเต็ม"
135 full_name: "ชื่อเต็ม"
119 email: "e-mail"
136 email: "e-mail"
120 province: "จังหวัด"
137 province: "จังหวัด"
121
138
You need to be logged in to leave comments. Login now