Description:
re-added registration config
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r774:0f0c4f139f2b - - 1 file changed: 8 inserted, 0 deleted
@@ -9,192 +9,200 | |||
|
9 | 9 | |
|
10 | 10 | { |
|
11 | 11 | :key => 'ui.front.title', |
|
12 | 12 | :value_type => 'string', |
|
13 | 13 | :default_value => 'Grader' |
|
14 | 14 | }, |
|
15 | 15 | |
|
16 | 16 | { |
|
17 | 17 | :key => 'ui.front.welcome_message', |
|
18 | 18 | :value_type => 'string', |
|
19 | 19 | :default_value => 'Welcome!' |
|
20 | 20 | }, |
|
21 | 21 | |
|
22 | 22 | { |
|
23 | 23 | :key => 'ui.show_score', |
|
24 | 24 | :value_type => 'boolean', |
|
25 | 25 | :default_value => 'true' |
|
26 | 26 | }, |
|
27 | 27 | |
|
28 | 28 | { |
|
29 | 29 | :key => 'contest.time_limit', |
|
30 | 30 | :value_type => 'string', |
|
31 | 31 | :default_value => 'unlimited', |
|
32 | 32 | :description => 'Time limit in format hh:mm, or "unlimited" for contests with no time limits. This config is CACHED. Restart the server before the change can take effect.' |
|
33 | 33 | }, |
|
34 | 34 | |
|
35 | 35 | { |
|
36 | 36 | :key => 'system.mode', |
|
37 | 37 | :value_type => 'string', |
|
38 | 38 | :default_value => 'standard', |
|
39 | 39 | :description => 'Current modes are "standard", "contest", "indv-contest", and "analysis".' |
|
40 | 40 | }, |
|
41 | 41 | |
|
42 | 42 | { |
|
43 | 43 | :key => 'contest.name', |
|
44 | 44 | :value_type => 'string', |
|
45 | 45 | :default_value => 'Grader', |
|
46 | 46 | :description => 'This name will be shown on the user header bar.' |
|
47 | 47 | }, |
|
48 | 48 | |
|
49 | 49 | { |
|
50 | 50 | :key => 'contest.multisites', |
|
51 | 51 | :value_type => 'boolean', |
|
52 | 52 | :default_value => 'false', |
|
53 | 53 | :description => 'If the server is in contest mode and this option is true, on the log in of the admin a menu for site selections is shown.' |
|
54 | 54 | }, |
|
55 | 55 | |
|
56 | 56 | #---------------------------- right -------------------------------- |
|
57 | 57 | { |
|
58 | 58 | :key => 'right.user_hall_of_fame', |
|
59 | 59 | :value_type => 'boolean', |
|
60 | 60 | :default_value => 'false', |
|
61 | 61 | :description => 'If true, any user can access hall of fame page.' |
|
62 | 62 | }, |
|
63 | 63 | |
|
64 | 64 | { |
|
65 | 65 | :key => 'right.multiple_ip_login', |
|
66 | 66 | :value_type => 'boolean', |
|
67 | 67 | :default_value => 'true', |
|
68 | 68 | :description => 'When change from true to false, a user can login from the first IP they logged into afterward.' |
|
69 | 69 | }, |
|
70 | 70 | |
|
71 | 71 | { |
|
72 | 72 | :key => 'right.user_view_submission', |
|
73 | 73 | :value_type => 'boolean', |
|
74 | 74 | :default_value => 'false', |
|
75 | 75 | :description => 'If true, any user can view submissions of every one.' |
|
76 | 76 | }, |
|
77 | 77 | |
|
78 | 78 | { |
|
79 | 79 | :key => 'right.bypass_agreement', |
|
80 | 80 | :value_type => 'boolean', |
|
81 | 81 | :default_value => 'true', |
|
82 | 82 | :description => 'When false, a user must accept usage agreement before login' |
|
83 | 83 | }, |
|
84 | 84 | |
|
85 | 85 | { |
|
86 | 86 | :key => 'right.heartbeat_response', |
|
87 | 87 | :value_type => 'string', |
|
88 | 88 | :default_value => 'OK', |
|
89 | 89 | :description => 'Heart beat response text' |
|
90 | 90 | }, |
|
91 | 91 | |
|
92 | 92 | { |
|
93 | 93 | :key => 'right.heartbeat_response_full', |
|
94 | 94 | :value_type => 'string', |
|
95 | 95 | :default_value => 'OK', |
|
96 | 96 | :description => 'Heart beat response text when user got full score (set this value to the empty string to disable this feature)' |
|
97 | 97 | }, |
|
98 | 98 | |
|
99 | 99 | { |
|
100 | 100 | :key => 'right.view_testcase', |
|
101 | 101 | :value_type => 'boolean', |
|
102 | 102 | :default_value => 'false', |
|
103 | 103 | :description => 'When true, any user can view/download test data' |
|
104 | 104 | }, |
|
105 | + | |
|
106 | + { | |
|
107 | + :key => 'system.online_registration', | |
|
108 | + :value_type => 'boolean', | |
|
109 | + :default_value => 'false', | |
|
110 | + :description => 'This option enables online registration.' | |
|
111 | + }, | |
|
112 | + | |
|
105 | 113 | # If Configuration['system.online_registration'] is true, the |
|
106 | 114 | # system allows online registration, and will use these |
|
107 | 115 | # information for sending confirmation emails. |
|
108 | 116 | { |
|
109 | 117 | :key => 'system.online_registration.smtp', |
|
110 | 118 | :value_type => 'string', |
|
111 | 119 | :default_value => 'smtp.somehost.com' |
|
112 | 120 | }, |
|
113 | 121 | |
|
114 | 122 | { |
|
115 | 123 | :key => 'system.online_registration.from', |
|
116 | 124 | :value_type => 'string', |
|
117 | 125 | :default_value => 'your.email@address' |
|
118 | 126 | }, |
|
119 | 127 | |
|
120 | 128 | { |
|
121 | 129 | :key => 'system.admin_email', |
|
122 | 130 | :value_type => 'string', |
|
123 | 131 | :default_value => 'admin@admin.email' |
|
124 | 132 | }, |
|
125 | 133 | |
|
126 | 134 | { |
|
127 | 135 | :key => 'system.user_setting_enabled', |
|
128 | 136 | :value_type => 'boolean', |
|
129 | 137 | :default_value => 'true', |
|
130 | 138 | :description => 'If this option is true, users can change their settings' |
|
131 | 139 | }, |
|
132 | 140 | |
|
133 | 141 | { |
|
134 | 142 | :key => 'system.user_setting_enabled', |
|
135 | 143 | :value_type => 'boolean', |
|
136 | 144 | :default_value => 'true', |
|
137 | 145 | :description => 'If this option is true, users can change their settings' |
|
138 | 146 | }, |
|
139 | 147 | |
|
140 | 148 | # If Configuration['contest.test_request.early_timeout'] is true |
|
141 | 149 | # the user will not be able to use test request at 30 minutes |
|
142 | 150 | # before the contest ends. |
|
143 | 151 | { |
|
144 | 152 | :key => 'contest.test_request.early_timeout', |
|
145 | 153 | :value_type => 'boolean', |
|
146 | 154 | :default_value => 'false' |
|
147 | 155 | }, |
|
148 | 156 | |
|
149 | 157 | { |
|
150 | 158 | :key => 'system.multicontests', |
|
151 | 159 | :value_type => 'boolean', |
|
152 | 160 | :default_value => 'false' |
|
153 | 161 | }, |
|
154 | 162 | |
|
155 | 163 | { |
|
156 | 164 | :key => 'contest.confirm_indv_contest_start', |
|
157 | 165 | :value_type => 'boolean', |
|
158 | 166 | :default_value => 'false' |
|
159 | 167 | }, |
|
160 | 168 | |
|
161 | 169 | { |
|
162 | 170 | :key => 'contest.default_contest_name', |
|
163 | 171 | :value_type => 'string', |
|
164 | 172 | :default_value => 'none', |
|
165 | 173 | :description => "New user will be assigned to this contest automatically, if it exists. Set to 'none' if there is no default contest." |
|
166 | 174 | }, |
|
167 | 175 | |
|
168 | 176 | { |
|
169 | 177 | :key => 'system.use_problem_group', |
|
170 | 178 | :value_type => 'boolean', |
|
171 | 179 | :default_value => 'false', |
|
172 | 180 | :description => "If true, available problem to the user will be only ones associated with the group of the user." |
|
173 | 181 | }, |
|
174 | 182 | |
|
175 | 183 | |
|
176 | 184 | |
|
177 | 185 | ] |
|
178 | 186 | |
|
179 | 187 | |
|
180 | 188 | def create_configuration_key(key, |
|
181 | 189 | value_type, |
|
182 | 190 | default_value, |
|
183 | 191 | description='') |
|
184 | 192 | conf = (GraderConfiguration.find_by_key(key) || |
|
185 | 193 | GraderConfiguration.new(:key => key, |
|
186 | 194 | :value_type => value_type, |
|
187 | 195 | :value => default_value)) |
|
188 | 196 | conf.description = description |
|
189 | 197 | conf.save |
|
190 | 198 | end |
|
191 | 199 | |
|
192 | 200 | def seed_config |
|
193 | 201 | CONFIGURATIONS.each do |conf| |
|
194 | 202 | if conf.has_key? :description |
|
195 | 203 | desc = conf[:description] |
|
196 | 204 | else |
|
197 | 205 | desc = '' |
|
198 | 206 | end |
|
199 | 207 | create_configuration_key(conf[:key], |
|
200 | 208 | conf[:value_type], |
You need to be logged in to leave comments.
Login now