require 'recaptcha' class UserManager < BaseManager include Recaptcha::Verify def initialize(options={}) super(options) @log = Logging.logger[self] end def signup(first_name, last_name, email, password, password_confirmation, city, state, country, instruments, signup_confirm_url) @user = User.new # TODO: figure out why can't user verify_recaptcha here # check recaptcha; if any errors seen, contribute it to the model #unless verify_recaptcha(:model => @user, :message => "recaptcha") # return @user # @user.errors.any? is true now #else # sends email to email account for confirmation @user = User.signup(first_name, last_name, email, password, password_confirmation, city, state, country, instruments, signup_confirm_url) return @user #end end def signup_confirm(signup_token) begin @user = User.signup_confirm(signup_token) rescue ActiveRecord::RecordNotFound @user = nil end return @user end end