Consolidation of work on slicefiying application with original app
[merb_mart.git] / app / controllers / users.rb
blob14e4b9f58c4359df0514969fa4c70394ae01a5e4
1 require File.join(File.dirname(__FILE__), '..', '..', "lib", "authenticated_system", "authenticated_dependencies")
2 class Users < Application
3   provides :xml
5   skip_before :login_required
7   def new
8     only_provides :html
9     @user = User.new(params[:user] || {})
10     display @user
11   end
13   def create
14     cookies.delete :auth_token
16     @user = User.new(params[:user])
17     if @user.save
18       redirect_back_or_default('/')
19     else
20       render :new
21     end
22   end
24   def activate
25     self.current_user = User.find_activated_authenticated_model(params[:activation_code])
26     if logged_in? && !current_user.active?
27       current_user.activate
28     end
29     redirect_back_or_default('/')
30   end
31 end