]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
various fixes
[rails.git] / app / controllers / user_controller.rb
index da27a95dcce283288a578323ae3240093c3097b9..3012765d2a24732b85b4d01c5e379f49b3f3fb1d 100644 (file)
@@ -1,6 +1,32 @@
 class UserController < ApplicationController
 
+  def save
+    @user = User.new(params[:user])
+    @user.set_defaults
+
+    if @user.save
+      flash[:notice] = 'Users was successfully created.'
+      Notifier::deliver_signup_confirm(@user)
+      redirect_to :action => 'login'
+    else
+      render :action => 'new'
+    end
+  end
+
   def new
 
   end
+
+  def confirm
+    @user = User.find_by_token(params[:confirm_string])
+    if @user && @user.active == 0
+      @user.active = true
+      @user.save
+      flash[:notice] = 'Confirmed your account'
+      redirect_to :action => 'login'
+    else
+      flash[:notice] = 'Something went wrong confirming that user'
+    end
+  end
+
 end