adobe_connect_api 0.0.3.alpha → 0.0.4.alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/adobe_connect_api/version.rb +1 -1
- data/lib/adobe_connect_api.rb +40 -5
- metadata +4 -4
data/lib/adobe_connect_api.rb
CHANGED
@@ -32,6 +32,11 @@ class AdobeConnectAPI
|
|
32
32
|
attr :url
|
33
33
|
attr :pointconfig
|
34
34
|
|
35
|
+
# return BREEZESESSION id
|
36
|
+
def sessionid
|
37
|
+
@sessionid
|
38
|
+
end
|
39
|
+
|
35
40
|
#The URL is the base URL of the Connect-Server, without the trailing slash
|
36
41
|
def initialize (url = nil)
|
37
42
|
#TODO ChR: Get this from the application config/initializer/abobe_connect_api.rb
|
@@ -45,11 +50,13 @@ class AdobeConnectAPI
|
|
45
50
|
|
46
51
|
#makes the login to the server
|
47
52
|
def login (login = nil, password = nil, account_id=nil, external_auth=nil, domain=nil)
|
48
|
-
if(login == nil)
|
49
|
-
login = pointconfig["username"]
|
50
|
-
end
|
51
53
|
|
52
|
-
if(password == nil)
|
54
|
+
if (login != nil && password == nil)
|
55
|
+
# user given --> use generic user password
|
56
|
+
# TODO KG: generate password
|
57
|
+
password = pointconfig["generic_user_password"]
|
58
|
+
elsif (login == nil) && (password == nil)
|
59
|
+
login = pointconfig["username"]
|
53
60
|
password = pointconfig["password"]
|
54
61
|
end
|
55
62
|
|
@@ -59,14 +66,19 @@ class AdobeConnectAPI
|
|
59
66
|
"account-id" => account_id,
|
60
67
|
"external-auth" => external_auth,
|
61
68
|
"domain" => domain)
|
69
|
+
|
70
|
+
# TODO: debug
|
71
|
+
puts res.body.inspect
|
72
|
+
|
62
73
|
cookies = res.response["set-cookie"]
|
74
|
+
puts cookies.inspect
|
63
75
|
cookies.split(";").each{|s|
|
64
76
|
array = s.split("=")
|
65
77
|
if array[0] == "BREEZESESSION"
|
66
78
|
@sessionid = array[1]
|
67
79
|
end
|
68
80
|
}
|
69
|
-
puts "ACS: Logged in"
|
81
|
+
#puts "ACS: Logged in"
|
70
82
|
return res.body
|
71
83
|
end
|
72
84
|
|
@@ -78,6 +90,28 @@ class AdobeConnectAPI
|
|
78
90
|
return res
|
79
91
|
end
|
80
92
|
|
93
|
+
# creates a new user in Adobe Connect
|
94
|
+
def create_user(email = nil, login = nil, password = nil, first_name = nil, last_name = nil)
|
95
|
+
# ?action=principal-update&email=string&first-name=string&has-children=boolean&last-name=string&login=string&password=string&send-email=boolean&type=allowedValue&session=BreezeSessionCookieValue
|
96
|
+
|
97
|
+
# send-email: true
|
98
|
+
# has-children: 0
|
99
|
+
# type: user
|
100
|
+
|
101
|
+
res = query("principal-update",
|
102
|
+
"email" => email,
|
103
|
+
"login" => login,
|
104
|
+
"password" => password,
|
105
|
+
"first-name" => first_name,
|
106
|
+
"last-name" => last_name,
|
107
|
+
"send-email" => true,
|
108
|
+
"has-children" => 0,
|
109
|
+
"type" => "user")
|
110
|
+
|
111
|
+
puts "ACS: user created"
|
112
|
+
return res.body
|
113
|
+
end
|
114
|
+
|
81
115
|
#Returns all defined quotas (untested)
|
82
116
|
def report_quotas
|
83
117
|
res = query("report-quota")
|
@@ -245,6 +279,7 @@ class AdobeConnectAPI
|
|
245
279
|
if @sessionid
|
246
280
|
request.add_field("Cookie", "BREEZESESSION="+@sessionid)
|
247
281
|
end
|
282
|
+
puts request.path
|
248
283
|
response = http.request(request)
|
249
284
|
return response
|
250
285
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adobe_connect_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4.alpha
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-05 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: xml-simple
|
16
|
-
requirement: &
|
16
|
+
requirement: &2152735880 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2152735880
|
25
25
|
description: Wrapper to the Adobe Connect API
|
26
26
|
email:
|
27
27
|
- christian.rohrer@switch.ch
|