Converted view ERB syntax to Haml
[merb_mart.git] / app / controllers / users.rb
blob8b9d49da923ed51584bdc0f8b42bcc8b198fca35
1 require File.join(File.dirname(__FILE__), '..', '..', "lib", "authenticated_system", "authenticated_dependencies")
2 class Users < Application
3   provides :xml
4   
5   skip_before :login_required
6   
7   def new
8     only_provides :html
9     @user = User.new(params[:user] || {})
10     display @user
11   end
12   
13   def create
14     cookies.delete :auth_token
15     
16     @user = User.new(params[:user])
17     if @user.save
18       redirect_back_or_default('/')
19     else
20       render :new
21     end
22   end
23   
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