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.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/frostale.rb', line 10

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.



8
9
10
# File 'lib/frostale.rb', line 8

def emailaddress
  @emailaddress
end

#groupsObject

Returns the value of attribute groups.



8
9
10
# File 'lib/frostale.rb', line 8

def groups
  @groups
end

#isAuthObject

Returns the value of attribute isAuth.



8
9
10
# File 'lib/frostale.rb', line 8

def isAuth
  @isAuth
end

#passwordObject

Returns the value of attribute password.



8
9
10
# File 'lib/frostale.rb', line 8

def password
  @password
end

#roleObject

Returns the value of attribute role.



8
9
10
# File 'lib/frostale.rb', line 8

def role
  @role
end

#wdslObject

Returns the value of attribute wdsl.



8
9
10
# File 'lib/frostale.rb', line 8

def wdsl
  @wdsl
end

Instance Method Details

#authenticateObject



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

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