Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(18)

Side by Side Diff: app/controllers/administrator_controller.rb

Issue 2323: Upgrade to Rails 2 SVN Base: http://familyconnect.rubyforge.org/svn/trunk/
Patch Set: Created 1 year, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 require 'ostruct' 1 require 'ostruct'
2 2
3 class AdministratorController < ApplicationController 3 class AdministratorController < ApplicationController
4 before_filter :login_required 4 before_filter :login_required
5 5
6 def index 6 def index
7 setup 7 setup
8 end 8 end
9 9
10 def upload_family_photo 10 def upload_family_photo
(...skipping 26 matching lines...) Expand all
37 else 37 else
38 flash.now[:error] = "The family photo couldn't be saved on the server." 38 flash.now[:error] = "The family photo couldn't be saved on the server."
39 end 39 end
40 end 40 end
41 render :action => 'setup' 41 render :action => 'setup'
42 end 42 end
43 43
44 def signup 44 def signup
45 @menu_left = 'administrator/menu_left_signup' if @first_time_install 45 @menu_left = 'administrator/menu_left_signup' if @first_time_install
46 @admin_signup = true 46 @admin_signup = true
47 @user = User.new(@params[:user]) 47 @user = User.new(params[:user])
48 @security = OpenStruct.new(params[:security]) 48 @security = OpenStruct.new(params[:security])
49 if @request.post? 49 if request.post?
50 @user.admin = true 50 @user.admin = true
51 if @user.save 51 if @user.save
52 @session[:user] = User.authenticate(@user.login, @params[:user][:passwor d]) 52 session[:user] = User.authenticate(@user.login, params[:user][:password] )
53 redirect_to :action => 'setup_done' 53 redirect_to :action => 'setup_done'
54 end 54 end
55 end 55 end
56 end 56 end
57 57
58 def setup_done 58 def setup_done
59 end 59 end
60 60
61 protected 61 protected
62 62
63 def protect?(action) 63 def protect?(action)
64 if ['setup', 'signup'].include?(action) 64 if ['setup', 'signup'].include?(action)
65 current_user and current_user.admin? 65 current_user and current_user.admin?
66 else 66 else
67 true 67 true
68 end 68 end
69 end 69 end
70 end 70 end
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r483