zm-ruby-client 2.0.2 → 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: 886f564163908a1480548f4a95d6ce5eb0518d1c448d0843813614028c86a3c1
4
- data.tar.gz: '08a2890e60d812eb839b6e128e17aac9bf56fd3732930bcff4b953466b3d96a4'
3
+ metadata.gz: dd3bfb38026878580af8b788cb172b12c437323314ef8c959e01e5f5419f4e9e
4
+ data.tar.gz: a6da176522c636dfd169055836d5d7037397c20606616cd8b2455fd9234df29d
5
5
  SHA512:
6
- metadata.gz: f01208b8b4c217d2af7bfbcc3e750e9934c78032a63bf0eba9ec5bfd46837506987f05f23a7e8a154b46262aa7a1d4d4eedd3837f32fcc6f69ad4a49991ee768
7
- data.tar.gz: d0d58cb2644a8eaaf376602e1724cd0e4eb670789912b4055cfe73bf451b3d838c180ed010a633427223e98506f4710f54791f469de170b5b8e7f633d7582998
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)
@@ -60,8 +60,7 @@ module Zm
60
60
  end
61
61
 
62
62
  def to_rename(new_name)
63
- SoapElement.admin(SoapAdminConstants::RENAME_DISTRIBUTION_LIST_REQUEST).add_attributes({ id: @id,
64
- newName: new_name })
63
+ SoapElement.admin(SoapAdminConstants::RENAME_DISTRIBUTION_LIST_REQUEST).add_attributes({ id: @item.id, newName: new_name })
65
64
  end
66
65
 
67
66
  def attrs_only_set_h
@@ -10,7 +10,7 @@ module Zm
10
10
  module VERSION
11
11
  MAJOR = 2
12
12
  MINOR = 0
13
- TINY = 2
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.2
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