Class: Frostale

Inherits:
Object
  • Object
show all
Defined in:
lib/frostale.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(emailaddress, password, group, ldap_uri) ⇒ Frostale

Returns a new instance of Frostale.



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/frostale.rb', line 13

def initialize(emailaddress, password, group, ldap_uri)
  @mldap_uri = ldap_uri
   @wdsl = nil
   begin
    @wdsl = SOAP::WSDLDriverFactory.new(@mldap_uri)
   rescue => e
     e.message
   end
  @emailaddress = emailaddress
  @password     = password
  @groups       = group
end

Instance Attribute Details

#emailaddressObject

Returns the value of attribute emailaddress.



11
12
13
# File 'lib/frostale.rb', line 11

def emailaddress
  @emailaddress
end

#groupsObject

Returns the value of attribute groups.



11
12
13
# File 'lib/frostale.rb', line 11

def groups
  @groups
end

#isAuthObject

Returns the value of attribute isAuth.



11
12
13
# File 'lib/frostale.rb', line 11

def isAuth
  @isAuth
end

#passwordObject

Returns the value of attribute password.



11
12
13
# File 'lib/frostale.rb', line 11

def password
  @password
end

#roleObject

Returns the value of attribute role.



11
12
13
# File 'lib/frostale.rb', line 11

def role
  @role
end

#wdslObject

Returns the value of attribute wdsl.



11
12
13
# File 'lib/frostale.rb', line 11

def wdsl
  @wdsl
end

Instance Method Details

#authenticateObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/frostale.rb', line 26

def authenticate
  soap = @wdsl.create_rpc_driver

  # TODO: figure out how to make the params below dynamic
  response = soap.AuthenticateUser(
    :emailaddress => @emailaddress,
    :password     => @password,
    :admins       => @groups,
    :editors      => '',
    :authors      => '',
    :contributors => '',
    :subscribers  => ''
  )
  soap.reset_stream
  
  @isAuth = response.isAuthenticated
  @role   = response.role
end