Changesets can be listed by changeset number.
The Git repository is here.
Changeset 108
Substantial changes and additions to Hub. Now in a state where
it will integrate with other applications to an acceptable level.
Requires HubSsoLib gem 0.0.4 or later - see Changeset #107.
- Comitted by: adh
- Date: Monday October 23 18:16:22 2006 (over 18 years ago)
Affected files:
- rool/rails/hub/trunk/public/images/account/
- rool/rails/hub/trunk/public/images/tasks/
- rool/rails/hub/trunk/public/images/account/change_details.png
- rool/rails/hub/trunk/public/images/account/change_password.png
- rool/rails/hub/trunk/public/images/account/delete.png
- rool/rails/hub/trunk/public/images/account/delete_confirm.png
- rool/rails/hub/trunk/public/images/account/destroy.png
- rool/rails/hub/trunk/public/images/account/edit_roles.png
- rool/rails/hub/trunk/public/images/account/forgot_password.png
- rool/rails/hub/trunk/public/images/account/list.png
- rool/rails/hub/trunk/public/images/account/login.png
- rool/rails/hub/trunk/public/images/account/logout.png
- rool/rails/hub/trunk/public/images/account/rails.png
- rool/rails/hub/trunk/public/images/account/show.png
- rool/rails/hub/trunk/public/images/account/signup.png
- rool/rails/hub/trunk/public/images/tasks/index.png
- rool/rails/hub/trunk/app/controllers/account_controller.rb (diff)
- rool/rails/hub/trunk/app/controllers/application.rb (diff)
- rool/rails/hub/trunk/app/controllers/tasks_controller.rb (diff)
- rool/rails/hub/trunk/app/helpers/account_helper.rb (diff)
- rool/rails/hub/trunk/app/helpers/application_helper.rb (diff)
- rool/rails/hub/trunk/app/models/user.rb (diff)
- rool/rails/hub/trunk/app/views/account/change_details.rhtml (diff)
- rool/rails/hub/trunk/app/views/account/change_password.rhtml (diff)
- rool/rails/hub/trunk/app/views/account/delete.rhtml (diff)
- rool/rails/hub/trunk/app/views/account/edit_roles.rhtml (diff)
- rool/rails/hub/trunk/app/views/account/forgot_password.rhtml (diff)
- rool/rails/hub/trunk/app/views/account/list.rhtml (diff)
- rool/rails/hub/trunk/app/views/account/login.rhtml (diff)
- rool/rails/hub/trunk/app/views/account/show.rhtml (diff)
- rool/rails/hub/trunk/app/views/account/signup.rhtml (diff)
- rool/rails/hub/trunk/app/views/layouts/default.rhtml (diff)
- rool/rails/hub/trunk/app/views/shared/_theme.rhtml (diff)
- rool/rails/hub/trunk/app/views/tasks/index.rhtml (diff)
- rool/rails/hub/trunk/config/environment.rb (diff)
- rool/rails/hub/trunk/public/stylesheets/risc_os_open.css (diff)
rool/rails/hub/trunk/app/controllers/account_controller.rb:
prev. | current | |
# Action permissions for this class as a class variable, exposed | ||
# to the public through a class method. | ||
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | | |
18 | | |
19 | | |
8 | @@hubssolib_permissions = HubSsoLib::Permissions.new({ | |
9 | :change_password => [ :admin, :webmaster, :privileged, :normal ], | |
10 | :change_details => [ :admin, :webmaster, :privileged, :normal ], | |
11 | :delete => [ :admin, :webmaster, :privileged, :normal ], | |
12 | :delete_confirm => [ :admin, :webmaster, :privileged, :normal ], | |
13 | :list => [ :admin, :webmaster, :privileged ], | |
14 | :show => [ :admin, :webmaster ], | |
15 | :edit_roles => [ :admin ], | |
16 | :destroy => [ :admin ] | |
17 | }) | |
21 | | |
22 | | |
19 | def AccountController.hubssolib_permissions | |
20 | @@hubssolib_permissions | |
end | ||
25 | | |
26 | | |
27 | | |
28 | ||
29 | | |
30 | | |
31 | | |
32 | | |
33 | | |
34 | | |
35 | | |
36 | ||
37 | | |
38 | | |
39 | | |
40 | ||
# Set up the notification mailer. | ||
observer :user_observer | ||
# HTTPS enforcement | ||
before_filter :hubssolib_ensure_https | ||
29 | # The "proper" login method | |
30 | # | |
def login | ||
@title = 'Log in' | ||
return unless request.post? | ||
@email = params[:email] | ||
52 | | |
36 | self.hubssolib_current_user = from_real_user(User.authenticate(@email, params[:password])) | |
54 | | |
38 | if (self.hubssolib_current_user and self.hubssolib_current_user != :false) | |
39 | hubssolib_set_last_used(Time.now.utc) | |
56 | ||
57 | ||
58 | ||
59 | ||
60 | ||
61 | ||
62 | ||
63 | ||
64 | ||
65 | ||
66 | | |
67 | | |
41 | privileges = self.hubssolib_current_user.roles.to_authenticated_roles.to_human_s.downcase | |
42 | hubssolib_set_flash(:notice, "Logged in successfully. Welcome, #{self.hubssolib_current_user.real_name}. You have #{privileges} privileges.") | |
hubssolib_redirect_back_or_default(:controller => 'tasks', :action => nil) | ||
else | ||
flash[:alert] = 'Incorrect e-mail address or password.' | ||
71 | | |
72 | | |
73 | | |
end | ||
end | ||
77 | | |
78 | | |
79 | | |
80 | | |
81 | | |
49 | # Log out the user and redirect to the Tasks controller. | |
# | ||
83 | | |
51 | def logout | |
@title = 'Log out' | ||
85 | | |
86 | ||
87 | | |
88 | | |
89 | | |
90 | | |
91 | | |
92 | | |
93 | | |
53 | hubssolib_log_out() | |
54 | flash[:attention] = 'You are now logged out.' | |
55 | redirect_to :controller => 'tasks', :action => nil | |
end | ||
96 | | |
97 | | |
98 | | |
99 | | |
100 | | |
101 | | |
102 | | |
103 | | |
104 | | |
105 | ||
def signup | ||
@title = 'Sign up' | ||
return unless request.post? | ||
... | ... | |
@user.roles = HubSsoLib::Roles.new(true).to_s | ||
@user.save! | ||
@user.activate | ||
127 | | |
79 | self.hubssolib_current_user = from_real_user(@user) | |
flash[:notice] = 'Thanks for signing up. You are now the system administrator ' << | ||
'and your account has been automatically activated.' | ||
... | ... | |
@user = User.find_by_activation_code(activation_code) | ||
if @user and @user.activate | ||
154 | | |
155 | | |
106 | self.hubssolib_current_user = from_real_user(@user) | |
157 | | |
108 | hubssolib_set_flash(:notice, 'Your RISC OS Open web site account is now active.') | |
hubssolib_redirect_back_or_default(:controller => 'tasks', :action => nil) | ||
else | ||
flash[:alert] = 'Unable to activate your RISC OS Open web site account. ' << | ||
... | ... | |
@title = 'Change password' | ||
return unless request.post? | ||
176 | | |
127 | user = to_real_user(self.hubssolib_current_user) | |
if User.authenticate(user.email, params[:old_password]) | ||
if (params[:password] == params[:password_confirmation]) | ||
user.password_confirmation = params[:password_confirmation] | ||
user.password = params[:password] | ||
save_password_and_set_flash(user) | ||
183 | | |
134 | self.hubssolib_current_user = from_real_user(user) | |
redirect_to :controller => 'tasks', :action => nil | ||
else | ||
set_password_mismatch_flash | ||
188 | | |
189 | | |
190 | ||
@old_password = params[:old_password] | ||
end | ||
else | ||
flash[:alert] = 'Incorrect current password.' | ||
195 | | |
end | ||
end | ||
def change_details | ||
@title = 'Update account details' | ||
201 | | |
148 | @user = to_real_user(self.hubssolib_current_user) | |
@real_name = @user ? @user.real_name || '' : '' | ||
return unless request.post? | ||
... | ... | |
if (params[:real_name]) | ||
@user.real_name = @real_name = params[:real_name] | ||
@user.save! | ||
209 | | |
156 | self.hubssolib_current_user = from_real_user(@user) | |
flash[:notice] = 'Account details updated successfully.' | ||
212 | | |
213 | | |
214 | | |
159 | redirect_to :controller => 'tasks', :action => nil | |
end | ||
end | ||
... | ... | |
if @user = User.find_by_email(params[:email]) | ||
@user.forgot_password | ||
@user.save! | ||
225 | | |
170 | self.hubssolib_current_user = from_real_user(@user) | |
flash[:notice] = 'An e-mail message which tells you how to reset your ' << | ||
'account password has been set to your e-mail address.' | ||
... | ... | |
redirect_to :controller => 'tasks', :action => nil | ||
else | ||
flash[:alert] = 'No account was found for the given e-mail address.' | ||
233 | | |
end | ||
end | ||
... | ... | |
@user = User.find_by_password_reset_code(params[:id]) | ||
if (@user.nil?) | ||
248 | | |
249 | | |
250 | | |
192 | hubssolib_set_flash(:alert, 'Invalid reset code. Did your e-mail client break up the reset ' << | |
193 | 'link so it spanned more than one line? If so, please try again, ' << | |
194 | 'copying all of the link in the message however many lines it spans.') | |
hubssolib_redirect_back_or_default(:controller => 'tasks', :action => nil) | ||
return | ||
... | ... | |
unless params[:password] | ||
flash[:alert] = 'Reset your password using the form below.' | ||
265 | | |
return | ||
end | ||
... | ... | |
@user.password = params[:password] | ||
@user.reset_password | ||
save_password_and_set_flash(@user) | ||
274 | | |
217 | self.hubssolib_current_user = from_real_user(@user) | |
redirect_to :controller => 'tasks', :action => nil | ||
return | ||
else | ||
set_password_mismatch_flash | ||
279 | | |
return | ||
end | ||
end | ||
def delete | ||
flash[:alert] = 'Are you sure?' | ||
286 | | |
title = 'Delete account: Are you sure?' | ||
end | ||
def delete_confirm | ||
291 | | |
292 | | |
232 | me = to_real_user(self.hubssolib_current_user) | |
233 | hubssolib_log_out() | |
me.destroy | ||
flash.clear | ||
296 | | |
237 | flash[:attention] = 'Your account has been deleted.' | |
redirect_to :controller => 'tasks', :action => nil | ||
end | ||
... | ... | |
unless (roles.validate) | ||
flash[:alert] = 'Invalid roles chosen. Ensure at least one item in the list is selected.' | ||
331 | | |
else | ||
@user.roles = roles.to_s | ||
@user.save! | ||
335 | | |
276 | # Did I update my own roles? | |
277 | ||
278 | if (self.hubssolib_current_user.id == @user.id) | |
279 | self.hubssolib_current_user = from_real_user(@user) | |
280 | end | |
281 | ||
flash[:notice] = 'Account roles updated successfully.' | ||
redirect_to :action => 'show', :id => @user.id | ||
end | ||
... | ... | |
def destroy | ||
user = User.find(params[:id]) | ||
345 | | |
290 | if (user.id == self.hubssolib_current_user.id) | |
flash[:alert] = 'Please use the normal control panel to delete your own account.' | ||
elsif (user.roles.to_authenticated_roles.include?(:admin)) | ||
348 | | |
293 | flash[:alert] = 'You cannot destroy an administrator account from here! ' << | |
294 | 'You can only do that at the control panel when ' << | |
295 | 'logged into the account, or at the database level.' | |
else | ||
user.destroy | ||
flash[:alert] = 'The account has been deleted.' | ||
... | ... | |
protected | ||
306 | # Pass a HubSsoLib::User object. Returns an equivalent User Model object. | |
307 | # | |
308 | def to_real_user(user) | |
309 | return nil if user.nil? | |
310 | raise 'Incorrect argument class' unless user.class == HubSsoLib::User | |
311 | ||
312 | real_user = User.find(user.id) | |
313 | raise 'No equivalent real user' unless real_user | |
314 | ||
315 | real_user.salt = user.salt | |
316 | real_user.roles = user.roles | |
317 | real_user.activated_at = user.activated_at | |
318 | real_user.real_name = user.real_name | |
319 | real_user.crypted_password = user.crypted_password | |
320 | real_user.remember_token_expires_at = user.remember_token_expires_at | |
321 | real_user.activation_code = user.activation_code | |
322 | real_user.member_id = user.member_id | |
323 | real_user.password_reset_code = user.password_reset_code | |
324 | real_user.remember_token = user.remember_token | |
325 | real_user.email = user.email | |
326 | real_user.password_reset_code_expires_at = user.password_reset_code_expires_at | |
327 | ||
328 | return real_user | |
329 | end | |
330 | ||
331 | # Pass a User Model object. Returns an equivalent HubSsoLib::User object. | |
332 | # | |
333 | def from_real_user(real_user) | |
334 | return nil if real_user.nil? | |
335 | raise 'Incorrect argument class' unless real_user.class == User | |
336 | ||
337 | user = HubSsoLib::User.new | |
338 | ||
339 | user.salt = real_user.salt | |
340 | user.roles = real_user.roles | |
341 | user.updated_at = real_user.updated_at | |
342 | user.activated_at = real_user.activated_at | |
343 | user.real_name = real_user.real_name | |
344 | user.crypted_password = real_user.crypted_password | |
345 | user.remember_token_expires_at = real_user.remember_token_expires_at | |
346 | user.activation_code = real_user.activation_code | |
347 | user.member_id = real_user.member_id | |
348 | user.id = real_user.id | |
349 | user.password_reset_code = real_user.password_reset_code | |
350 | user.remember_token = real_user.remember_token | |
351 | user.email = real_user.email | |
352 | user.created_at = real_user.created_at | |
353 | user.password_reset_code_expires_at = real_user.password_reset_code_expires_at | |
354 | ||
355 | return user | |
356 | end | |
357 | ||
def save_password_and_set_flash(user) | ||
user.save ? | ||
flash[:notice] = 'Your password has been changed.' : | ||
... | ... | |
def set_password_mismatch_flash | ||
flash[:alert] = 'The new password differed from the password confirmation you entered.' | ||
end | ||
368 | ||
369 | | |
370 | | |
371 | ||
372 | | |
373 | | |
374 | | |
375 | | |
376 | | |
377 | | |
378 | ||
end |
rool/rails/hub/trunk/app/controllers/application.rb:
prev. | current | |
class ApplicationController < ActionController::Base | ||
6 | | |
6 | # Hub single sign-on support. | |
require 'hub_sso_lib' | ||
include HubSsoLib::Core | ||
10 | before_filter :hubssolib_update_state | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | ||
16 | | |
17 | | |
18 | ||
end |
rool/rails/hub/trunk/app/controllers/tasks_controller.rb:
prev. | current | |
def index | ||
# Generate a list of available tasks. | ||
21 | | |
21 | @title = 'Control panel' | |
end | ||
end |
rool/rails/hub/trunk/app/helpers/account_helper.rb:
prev. | current | |
'</td>' | ||
end | ||
41 | | |
42 | | |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | ||
# Output a selection list for roles. Pass the name of the parent | ||
# object, the name of the field to take the selected value, an array | ||
# of option values for the selection list and the associated roles |
rool/rails/hub/trunk/app/helpers/application_helper.rb:
prev. | current | |
# Methods added to this helper will be available to all templates in the application. | ||
2 | ||
module ApplicationHelper | ||
4 | ||
5 | # Make a link to the given controller and action, using an image based on the | |
6 | # action name of the given width and height. A <br /> tag separates the image | |
7 | # from some given text to add underneath, also a link. Since web spiders may | |
8 | # follow standard links, do not use this call for destructive actions such as | |
9 | # 'delete'; use make_protected_action_link instead. Remember that 'robots.txt' | |
10 | # files are not entirely sufficient as some local Desktop cacheing software | |
11 | # packages ignore them, and this sort of software is more likely to be running | |
12 | # under login credentials that let it get at otherwise protected pages. | |
13 | # | |
14 | # If you don't want the text link adding, pass 'nil' or an empty string. | |
15 | # | |
16 | def make_action_link(controller, action, width, height, text) | |
17 | html = link_to(image_tag("#{controller}/#{action}", :size => "#{width}x#{height}", :border => 0), | |
18 | {:controller => controller, :action => action}, :class => 'image') | |
19 | ||
20 | unless (text.nil? or text.empty?) | |
21 | html << '<br />' | |
22 | html << link_to(text, :controller => controller, :action => action) | |
23 | end | |
24 | ||
25 | return html | |
26 | end | |
27 | ||
28 | # Make a protected link to the given controller and action with the given ID, | |
29 | # using an image based on the action name. The link is done as an image button | |
30 | # in a form to help stop accidental activation by web spiders (so use this call | |
31 | # for destructive actions such as 'delete'). Some given text is put underneath | |
32 | # the form but not included as part of the link. The final parameter is | |
33 | # optional; if you want a JavaScript "onclick" confirmation before the form can | |
34 | # be submitted, pass the message to use in the dialogue box here. | |
35 | # | |
36 | # If you don't want the text link adding, pass 'nil' or an empty string. | |
37 | # | |
38 | def make_protected_action_link(controller, action, id, text, onclick = nil) | |
39 | html = start_form_tag({:controller => controller, :action => action, :id => id}) | |
40 | opts = {:type => 'image', | |
41 | :name => 'submit', | |
42 | :alt => Inflector.humanize(action), | |
43 | :src => image_path("#{controller}/#{action}")} | |
44 | ||
45 | unless (onclick.nil? or onclick.empty?) | |
46 | opts[:onclick] = "return confirm('#{onclick}');" | |
47 | end | |
48 | ||
49 | html << tag('input', opts) | |
50 | html << end_form_tag() | |
51 | ||
52 | unless (text.nil? or text.empty?) | |
53 | html << text | |
54 | end | |
55 | end | |
end |
rool/rails/hub/trunk/app/models/user.rb:
prev. | current | |
crypted_password == encrypt(password) | ||
end | ||
49 | | |
50 | | |
51 | | |
52 | ||
53 | | |
54 | | |
55 | | |
56 | | |
57 | | |
58 | | |
59 | ||
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
65 | ||
# Activates the user in the database. | ||
def activate | ||
@activated = true |
rool/rails/hub/trunk/app/views/account/change_details.rhtml:
prev. | current | |
</table> | ||
<p align="center" /> | ||
24 | | |
24 | <%= submit_tag('Update') %> | |
<%= end_form_tag %> | ||
<p /> | ||
If you don't want to do this, you can | ||
29 | | |
29 | <%= link_to 'go back to the control panel', :controller => 'tasks', :action => 'index' %> | |
instead. | ||
rool/rails/hub/trunk/app/views/account/change_password.rhtml:
prev. | current | |
<p /> | ||
If you don't want to do this, you can | ||
28 | | |
28 | <%= link_to 'go back to the control panel', :controller => 'tasks', :action => 'index' %> | |
instead. | ||
rool/rails/hub/trunk/app/views/account/delete.rhtml:
prev. | current | |
1 | | |
2 | | |
3 | | |
1 | <%= image_tag 'account/delete_confirm', :size => '80x80', :alt => 'Delete confirmation', :align => 'left' %> | |
5 | | |
6 | | |
3 | If you are sure you want to delete your account, please use the | |
4 | button below to confirm the action. Once deleted your account | |
5 | cannot be recovered, except by creating a new account from scratch. | |
8 | | |
9 | | |
10 | | |
11 | | |
7 | <p /> | |
8 | <%= button_to 'Yes, really delete my account!', :controller => 'account', :action => 'delete_confirm' %> | |
9 | ||
10 | <p /> | |
11 | If you don't want to do this, you can | |
12 | <%= link_to 'go back to the control panel', :controller => 'tasks', :action => 'index' %> | |
13 | instead. | |
rool/rails/hub/trunk/app/views/account/edit_roles.rhtml:
prev. | current | |
<%= end_form_tag %> | ||
<p /> | ||
34 | | |
34 | Alternatively, please select one of the following options: | |
<p /> | ||
37 | | |
38 | | |
39 | | |
40 | | |
41 | | |
37 | <table border="0" cellspacing="0" cellpadding="6" align="center"> | |
38 | <tr valign="top" align="center"> | |
39 | <td><%= make_action_link('tasks', 'index', 80, 80, 'Control<br />panel') %></td> | |
40 | <td> </td> | |
41 | <td><%= make_action_link('account', 'list', 80, 80, 'Return<br />to list') %></td> | |
42 | <td> </td> | |
43 | <td><%= make_protected_action_link('account', 'show', @user.id, 'Return<br />to details') %></td> | |
44 | <td> </td> | |
45 | <td class="dangerous"><%= make_protected_action_link('account', 'destroy', @user.id, 'Delete<br />account', 'Are you absolutely sure you want to permanently delete this account?') %></td> | |
46 | </tr> | |
47 | </table> | |
rool/rails/hub/trunk/app/views/account/forgot_password.rhtml:
prev. | current | |
<p /> | ||
If you don't want to do this, you can | ||
20 | | |
20 | <%= link_to 'go back to the control panel', :controller => 'tasks', :action => 'index' %> | |
instead. | ||
rool/rails/hub/trunk/app/views/account/list.rhtml:
prev. | current | |
</table> | ||
<p /> | ||
28 | | |
29 |
| |
30 | | |
31 | | |
32 | | |
33 | | |
28 | When you've finished managing accounts, you can | |
29 | <%= link_to 'return to control panel', :controller => 'tasks', :action => nil %>. | |
rool/rails/hub/trunk/app/views/account/login.rhtml:
prev. | current | |
1 | | |
2 | | |
3 | | |
1 | Please enter your e-mail address and account password in the table below, then | |
2 | use the "Log in" button below to proceed. | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
4 | <p /> | |
5 | <%= start_form_tag %> | |
6 | <table class="list" cellspacing="1" cellpadding="4" border="1" align="center" bgcolor="#ffffff"> | |
7 | <tr> | |
8 | <th bgcolor="#eeeeee" align="left"><label for="email">E-mail address</label></th> | |
9 | <td><%= text_field_tag 'email', @email, :size => 40, :maxlength => 200 %></td> | |
10 | </tr> | |
11 | <tr> | |
12 | <th bgcolor="#eeeeee" align="left"><label for="password">Password</label></th> | |
13 | <td><%= password_field_tag 'password', '', :size => 40, :maxlength => 40 %></td> | |
14 | </tr> | |
15 | </table> | |
18 | | |
19 | | |
20 | | |
17 | <p align="center" /> | |
18 | <%= submit_tag('Log in') %> | |
19 | <%= end_form_tag %> | |
22 | | |
23 | | |
21 | <p /> | |
22 | Other options: | |
25 | | |
26 | | |
27 | | |
28 | | |
29 | | |
24 | <p /> | |
25 | <table border="0" cellspacing="0" cellpadding="6" align="center"> | |
26 | <tr valign="top" align="center"> | |
27 | <td><%= make_action_link('tasks', 'index', 80, 80, 'Control<br />panel') %></td> | |
28 | <td> </td> | |
29 | <td><%= make_action_link('account', 'forgot_password', 80, 80, 'Forgotten<br />password?') %></td> | |
30 | <td> </td> | |
31 | <td><%= make_action_link('account', 'signup', 80, 80, 'Sign up!') %></td> | |
32 | </tr> | |
33 | </table> | |
rool/rails/hub/trunk/app/views/account/show.rhtml:
prev. | current | |
</table> | ||
<p /> | ||
41 | | |
42 |
| |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
41 | <table border="0" cellspacing="0" cellpadding="6" align="center"> | |
42 | <tr valign="top" align="center"> | |
43 | <td><%= make_action_link('tasks', 'index', 80, 80, 'Control<br />panel') %></td> | |
44 | <td> </td> | |
45 | <td><%= make_action_link('account', 'list', 80, 80, 'Return<br />to list') %></td> | |
46 | <td> </td> | |
47 | <td><%= make_protected_action_link('account', 'edit_roles', @user.id, 'Edit<br />roles') %></td> | |
48 | <td> </td> | |
49 | <td class="dangerous"><%= make_protected_action_link('account', 'destroy', @user.id, 'Delete<br />account', 'Are you absolutely sure you want to permanently delete this account?') %></td> | |
50 | </tr> | |
51 | </table> | |
rool/rails/hub/trunk/app/views/account/signup.rhtml:
prev. | current | |
log in. | ||
<p /> | ||
6 | Your <b>e-mail address</b> is required for account activiation. Please give a | |
7 | reasonably complete <b>real name</b> that you are happy being used in forum posts, | |
8 | documentation pages, welcome messages and so-on (e.g. "John Doe"). Your | |
9 | <b>password</b> can consist of any combination of letters, numbers and symbols | |
10 | but must be at least four characters long. | |
11 | ||
12 | <p /> | |
<%= error_messages_for :user %> | ||
<% form_for :user do |f| %> | ||
... | ... | |
<% end %> | ||
<p /> | ||
41 | We will never pass your details to third parties or send you unsolicited e-mail messages. | |
42 | For more information, please see our <a href="/rails/radiant/documentation/privacy">privacy | |
43 | page</a>. | |
44 | ||
45 | ||
46 | <p /> | |
If you don't want to do this, you can | ||
35 | | |
48 | <%= link_to 'go back to the control panel', :controller => 'tasks', :action => 'index' %> | |
instead. | ||
rool/rails/hub/trunk/app/views/layouts/default.rhtml:
prev. | current | |
<table width="85%" cellspacing="0" cellpadding="0" align="center"> | ||
<tr valign="top" align="left"> | ||
<td width="75%"> | ||
19 | | |
20 | | |
21 | | |
19 | <%= hubssolib_flash_tags -%> | |
21 | <div class="content"> | |
<%= @content_for_layout %> | ||
23 | </div> | |
</td> | ||
<td> </td> |
rool/rails/hub/trunk/app/views/shared/_theme.rhtml:
prev. | current | |
1 | ||
1 | -->The RISC OS Open Hub icons are adapted from material at <a href="http://openclipart.org/">openclipart.org</a><!-- |
rool/rails/hub/trunk/app/views/tasks/index.rhtml:
prev. | current | |
1 | | |
1 | <h2>Web site accounts: Control panel</h2> | |
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
3 | <p /> | |
4 | The RISC OS Open web site asks its users to create accounts if | |
5 | they want to do things like make forum posts or comment on news | |
6 | articles. Currently available account management options are | |
7 | listed below. | |
9 | | |
10 | | |
9 | <p /> | |
10 | <table border="0" cellspacing="0" cellpadding="6" align="center"> | |
11 | <tr valign="top" align="center"> | |
<% unless hubssolib_logged_in? -%> | ||
12 | | |
13 | | |
14 | | |
13 | <td><%= make_action_link('account', 'login', 80, 80, 'Log in') %></td> | |
14 | <td> </td> | |
15 | <td><%= make_action_link('account', 'forgot_password', 80, 80, 'Forgotten<br />password?') %></td> | |
16 | <td> </td> | |
17 | <td><%= make_action_link('account', 'signup', 80, 80, 'Sign up!') %></td> | |
<% else -%> | ||
16 | | |
17 | | |
18 | | |
19 | | |
19 | <td><%= make_action_link('account', 'logout', 80, 80, 'Log out') %></td> | |
20 | <td> </td> | |
21 | <td><%= make_action_link('account', 'change_password', 80, 80, 'Change<br />password') %></td> | |
22 | <td> </td> | |
23 | <td><%= make_action_link('account', 'change_details', 80, 80, 'Update<br />details') %></td> | |
24 | <td> </td> | |
25 | <td class="dangerous"><%= make_protected_action_link('account', 'delete', nil, 'Delete<br />account') %></td> | |
<% end -%> | ||
21 | | |
27 | </tr> | |
28 | </table> | |
<% if hubssolib_logged_in? && hubssolib_authorized?('list', AccountController) -%> | ||
24 | | |
25 | | |
31 | <p /> | |
32 | Administrative options: | |
27 | | |
28 | | |
29 | | |
30 | | |
31 | ||
34 | <p /> | |
35 | <table border="0" cellspacing="0" cellpadding="6" align="center"> | |
36 | <tr valign="top" align="center"> | |
37 | <td><%= make_action_link('account', 'list', 80, 80, 'List accounts') %></td> | |
38 | </tr> | |
39 | </table> | |
40 | <% end -%> | |
rool/rails/hub/trunk/config/environment.rb:
prev. | current | |
# codes persist in the database indefinitely but will be rejected | ||
# if too old when someone tries to use one. | ||
RESET_TIME_LIMIT = 2 * 24 * 60 * 60 | ||
95 | ||
96 | ||
97 | ||
98 | ||
99 | ||
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | ||
106 | ||
107 | ||
108 |
rool/rails/hub/trunk/public/stylesheets/risc_os_open.css:
prev. | current | |
text-align: center; | ||
} | ||
43 | TABLE TD.dangerous IMG, | |
44 | TABLE TD.dangerous INPUT[type='image'] | |
45 | { | |
46 | border: 2px solid #966; | |
47 | background: #fee; | |
48 | margin: 1px; | |
49 | } | |
50 | ||
FORM.button-to INPUT | ||
{ | ||
margin-top: 4px; | ||
... | ... | |
margin-top: 4px; | ||
width: 100%; | ||
} | ||
62 | ||
63 | TABLE TD INPUT[type='image'] | |
64 | { | |
65 | border: none; | |
66 | background: inherit; | |
67 | } | |
68 | ||
69 | DIV.content A.image, | |
70 | DIV.content A.image:hover | |
71 | { | |
72 | background: inherit; | |
73 | border: none; | |
74 | } | |
75 |