Module: ODDB::State::Admin::LoginMethods

Included in:
PasswordReset, PowerUser, Global, Limit, PayPal::Checkout
Defined in:
src/state/admin/login.rb,
src/state/global_predefine.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) autologin(user, default = @previous)



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'src/state/admin/login.rb', line 22

def autologin(user, default=@previous)
  newstate = if(user.valid?)
    des = @session.desired_state
    @session.desired_state = nil
    @session.valid_input.update(@desired_input) if(@desired_input)
    des || default || trigger(:home)
  else
    State::User::InvalidUser.new(@session, user)
  end
  reconsider_permissions(user, newstate)
  if newstate.respond_to?(:augment_self)
    reconsider_permissions user, newstate.augment_self
  else
    newstate
  end
end

- (Object) login



13
14
15
16
17
18
19
20
21
# File 'src/state/admin/login.rb', line 13

def 
  autologin(@session.)
rescue Yus::UnknownEntityError
  @errors.store(:email, create_error(:e_authentication_error, :email, nil))
  self
rescue Yus::AuthenticationError
  @errors.store(:pass, create_error(:e_authentication_error, :pass, nil))
  self
end