zm-ruby-client 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9a46f4c93b0a88af487882f7263348f5e396391a1f78eb6f4237007fc5f684e
4
- data.tar.gz: b5efd5b41eca4bb27aeb004ec3eb49813f1975438be106ea702f772a4e49da44
3
+ metadata.gz: dd3bfb38026878580af8b788cb172b12c437323314ef8c959e01e5f5419f4e9e
4
+ data.tar.gz: a6da176522c636dfd169055836d5d7037397c20606616cd8b2455fd9234df29d
5
5
  SHA512:
6
- metadata.gz: 9a7ec3db28007938925d0dcf780f388ab314b1b71e84a60e5539570f9564a1aea173132a7f04476f43059ec73d4efa36c804a406b166392eceea6d92130b3939
7
- data.tar.gz: 695abff3589a4999ef61ce7dd302d7230501d224638d2a9d0762bca177ab2be81de99b9ce2e045d7349d536a5caa3b49f599e11b2245428d590f79127770f20e
6
+ metadata.gz: 1e177533cd24348761c622081040c8204eff8f9681c8e9626a39d9e156cfd710214aa03b0904b5e2e0415476cbaa7ba9a8f580bef0bef377cb21beee0ffc0614
7
+ data.tar.gz: 31b9e29e518ad142e0e6f4abc27786faa5745ff39692e91370b4759c850c5e80f98a4c13961fc0c86ca47b032ddbefc7eb2ba56f259b50ea303fad862a8dee46
@@ -29,7 +29,7 @@ module Zm
29
29
  attr_writer :used, :domain_key
30
30
 
31
31
  def soap_account_connector
32
- @soap_account_connector ||= SoapAccountConnector.create(@parent.config)
32
+ @soap_account_connector ||= SoapAccountConnector.create(soap_config)
33
33
  end
34
34
  alias sacc soap_account_connector
35
35
 
@@ -90,7 +90,7 @@ module Zm
90
90
  end
91
91
 
92
92
  def login
93
- if @parent.logged?
93
+ if parent_logged?
94
94
  admin_login
95
95
  else
96
96
  account_login
@@ -293,6 +293,22 @@ module Zm
293
293
  def uploader
294
294
  @uploader ||= Upload.new(self)
295
295
  end
296
+
297
+ private
298
+
299
+ def soap_config
300
+ return @parent.config if @parent.respond_to?(:config)
301
+ return @parent.parent.config if @parent.respond_to?(:parent) && @parent.parent.respond_to?(:config)
302
+
303
+ nil
304
+ end
305
+
306
+ def parent_logged?
307
+ return @parent.logged? if @parent.respond_to?(:logged?)
308
+ return @parent.parent.logged? if @parent.respond_to?(:parent) && @parent.parent.respond_to?(:logged?)
309
+
310
+ false
311
+ end
296
312
  end
297
313
  end
298
314
  end
@@ -47,6 +47,8 @@ module Zm
47
47
 
48
48
  logger.info 'Get Admin session token'
49
49
 
50
+ @soap_admin_connector.token = nil if logged?
51
+
50
52
  soap_request = SoapElement.admin(SoapAdminConstants::AUTH_REQUEST)
51
53
  soap_request.add_attributes(name: @config.zimbra_admin_login, password: @config.zimbra_admin_password)
52
54
  soap_resp = @soap_admin_connector.invoke(soap_request, Zm::Client::AuthError)
@@ -10,7 +10,7 @@ module Zm
10
10
  module VERSION
11
11
  MAJOR = 2
12
12
  MINOR = 0
13
- TINY = 3
13
+ TINY = 4
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zm-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Désécot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2023-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -323,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
323
  - !ruby/object:Gem::Version
324
324
  version: 1.8.11
325
325
  requirements: []
326
- rubygems_version: 3.4.19
326
+ rubygems_version: 3.1.6
327
327
  signing_key:
328
328
  specification_version: 4
329
329
  summary: zm-ruby-client