Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 1194 Bytes
1 | class AccountsController < ApplicationController |
2 | |
3 | before_filter :verify_users, :only => [:login] |
4 | |
5 | def login |
6 | case request.method |
7 | when :post |
8 | if session[:user] = User.authenticate(params[:user_login], params[:user_password]) |
9 | |
10 | flash[:notice] = "Login successful" |
11 | cookies[:typoapp_is_admin] = "yes" |
12 | redirect_back_or_default :controller => "admin/content", :action => "index" |
13 | else |
14 | flash.now[:notice] = "Login unsuccessful" |
15 | |
16 | @login = params[:user_login] |
17 | end |
18 | end |
19 | end |
20 | |
21 | def signup |
22 | unless User.count.zero? |
23 | redirect_to :action => 'login' |
24 | return |
25 | end |
26 | |
27 | @user = User.new(params[:user]) |
28 | |
29 | if request.post? and @user.save |
30 | session[:user] = User.authenticate(@user.login, params[:user][:password]) |
31 | flash[:notice] = "Signup successful" |
32 | redirect_to :controller => "admin/general", :action => "index" |
33 | return |
34 | end |
35 | end |
36 | |
37 | def logout |
38 | session[:user] = nil |
39 | cookies.delete :typoapp_is_admin |
40 | end |
41 | |
42 | def welcome |
43 | end |
44 | |
45 | private |
46 | |
47 | def verify_users |
48 | if User.count == 0 |
49 | redirect_to :controller => "accounts", :action => "signup" |
50 | else |
51 | true |
52 | end |
53 | end |
54 | |
55 | end |