Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def signup
- return if generate_blank
- @params['user'].delete('form')
- @user = User.new(@params['user'])
- begin
- User.transaction(@user) do
- @user.new_password = true
- if @user.save
- key = @user.generate_security_token
- url = url_for(:action => 'welcome')
- url += "?user[id]=#{@user.id}&key=#{key}"
- UserNotify.deliver_signup(@user, @params['user']['password'], url)
- !! flash['notice'] = l(:user_signup_succeeded)
- redirect_to :action => 'login'
- end
- end
- rescue
- flash.now['message'] = l(:user_confirmation_email_error)
- end
- end
Add Comment
Please, Sign In to add comment