Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 208
- Log:
First attempt at Gullery configured for the ROOL site. Unfroze the
Rails revision by deleting vendor/rails; Hub integration by a veneer
in the lib/authenticated_system.rb (Acts As Authenticated) plug-in,
plus some view changes and protection for the Account controller;
rewrote the default layout in .rhtml rather than .mab; plus the
usual set of configuration changes to work from a subdirectory and
with the ROOL database server.
- Author:
- rool
- Date:
- Sun May 20 19:12:33 +0100 2007
- Size:
- 2009 Bytes
1 | class AccountController < ApplicationController |
2 | include AuthenticatedSystem |
3 | |
4 | observer :user_observer |
5 | before_filter :login_required, :only => [:update_description] |
6 | |
7 | @@hubssolib_permissions = HubSsoLib::Permissions.new({ |
8 | :update_description => [ :admin, :webmaster, :privileged ], |
9 | :index => [ :admin, :webmaster, :privileged ], |
10 | :login => [ :admin, :webmaster, :privileged ], |
11 | :signup => [ :admin, :webmaster, :privileged ], |
12 | :logout => [ :admin, :webmaster, :privileged ], |
13 | }) |
14 | |
15 | def AccountController.hubssolib_permissions |
16 | @@hubssolib_permissions |
17 | end |
18 | |
19 | def update_description |
20 | current_user.description = @params[:value] |
21 | if current_user.save |
22 | render :text => textilize(current_user.description) |
23 | end |
24 | end |
25 | |
26 | def index |
27 | redirect_to(:action => 'signup') unless logged_in? or User.count > 0 |
28 | end |
29 | |
30 | def login |
31 | return unless request.post? |
32 | ::ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:session_expires => 4.weeks.from_now) if params[:remember_me] |
33 | self.current_user = User.authenticate(params[:login], params[:password]) |
34 | if current_user |
35 | redirect_back_or_default(:controller => '/') |
36 | flash[:notice] = "Logged in successfully" |
37 | else |
38 | flash[:notice] = "Please try again" |
39 | end |
40 | end |
41 | |
42 | def signup |
43 | if User.count > 0 |
44 | flash[:notice] = 'Someone has already signed up for this installation!' |
45 | redirect_to(:controller => '/') |
46 | return |
47 | end |
48 | @user = User.new(params[:user]) |
49 | return unless request.post? |
50 | @user.website = "http://#{@params[:user][:website]}" |
51 | if @user.save |
52 | self.current_user = User.authenticate(params[:user][:login], params[:user][:password]) |
53 | redirect_back_or_default(:controller => '/') |
54 | flash[:notice] = "Thanks for signing up!" |
55 | end |
56 | end |
57 | |
58 | def logout |
59 | self.current_user = nil |
60 | flash[:notice] = "You have been logged out." |
61 | redirect_back_or_default(:controller => '/') |
62 | end |
63 | |
64 | end |