Module: MerbAuth::Controller::UsersBase::InstanceMethods
- Defined in:
- lib/merb-auth/controller/users_base.rb
Instance Method Summary collapse
- #activate ⇒ Object
- #create ⇒ Object
-
#new ⇒ Object
Displays the new form for the user.
Instance Method Details
#activate ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/merb-auth/controller/users_base.rb', line 38 def activate self.current_ma_user = MA[:user].find_with_conditions(:activation_code => params[:activation_code]) if logged_in? && !current_ma_user.activated? Merb.logger.info "Activated #{current_ma_user}" current_ma_user.activate redirect url(:merb_auth_activated) else redirect url(:merb_auth_activated, :fail => 'true') end end |
#create ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/merb-auth/controller/users_base.rb', line 22 def create .delete :auth_token @use_recaptcha = Object.const_defined?(:Ambethia) @ivar = MA[:user].new(params[MA[:single_resource]]) set_ivar #if (!@use_recaptcha || verify_recaptcha(@ivar, :failure_message => nil)) && @ivar.save if (!@use_recaptcha || verify_recaptcha(@ivar, :failure_message => nil)) && @ivar.valid? @ivar.save self.current_ma_user = @ivar unless MA[:use_activation] redirect url(:merb_auth_registered) else render :new end end |