-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBase.php
3810 lines (3587 loc) · 125 KB
/
Base.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* This file is part of the Zimbra API in PHP library.
*
* © Nguyen Van Nguyen <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Zimbra\Admin;
use Zimbra\Soap\API;
use Zimbra\Admin\Struct\AttachmentIdAttrib as Attachment;
use Zimbra\Admin\Struct\AlwaysOnClusterSelector as ClusterSelector;
use Zimbra\Admin\Struct\CalendarResourceSelector as CalendarResource;
use Zimbra\Admin\Struct\CacheSelector as Cache;
use Zimbra\Admin\Struct\CosSelector as Cos;
use Zimbra\Admin\Struct\DataSourceSpecifier as DataSource;
use Zimbra\Admin\Struct\DeviceId;
use Zimbra\Admin\Struct\DomainSelector as Domain;
use Zimbra\Admin\Struct\DistributionListSelector as DistList;
use Zimbra\Admin\Struct\EffectiveRightsTargetSelector as Target;
use Zimbra\Admin\Struct\ExchangeAuthSpec as Exchange;
use Zimbra\Admin\Struct\ExportAndDeleteMailboxSpec as ExportMailbox;
use Zimbra\Admin\Struct\GranteeSelector as Grantee;
use Zimbra\Admin\Struct\HostName;
use Zimbra\Admin\Struct\IdAndAction;
use Zimbra\Admin\Struct\IdStatus;
use Zimbra\Admin\Struct\LimitedQuery;
use Zimbra\Admin\Struct\LoggerInfo as Logger;
use Zimbra\Admin\Struct\MailboxByAccountIdSelector as MailboxId;
use Zimbra\Admin\Struct\Names;
use Zimbra\Admin\Struct\Policy;
use Zimbra\Admin\Struct\PolicyHolder;
use Zimbra\Admin\Struct\PrincipalSelector as Principal;
use Zimbra\Admin\Struct\ReindexMailboxInfo as ReindexMailbox;
use Zimbra\Admin\Struct\RightModifierInfo as RightModifier;
use Zimbra\Admin\Struct\ServerSelector as Server;
use Zimbra\Admin\Struct\ServerMailQueueQuery as ServerMail;
use Zimbra\Admin\Struct\ServerWithQueueAction as ServerQueue;
use Zimbra\Admin\Struct\SyncGalAccountSpec as SyncGalAccount;
use Zimbra\Admin\Struct\StatsSpec;
use Zimbra\Admin\Struct\TargetWithType;
use Zimbra\Admin\Struct\TimeAttr;
use Zimbra\Admin\Struct\TzFixup;
use Zimbra\Admin\Struct\UcServiceSelector as UcService;
use Zimbra\Admin\Struct\VolumeInfo as Volume;
use Zimbra\Admin\Struct\XmppComponentSelector as XmppComponent;
use Zimbra\Admin\Struct\XmppComponentSpec as Xmpp;
use Zimbra\Admin\Struct\ZimletAclStatusPri as ZimletAcl;
use Zimbra\Struct\AccountNameSelector;
use Zimbra\Struct\AccountSelector as Account;
use Zimbra\Struct\EntrySearchFilterInfo as SearchFilter;
use Zimbra\Struct\GranteeChooser;
use Zimbra\Struct\Id;
use Zimbra\Struct\KeyValuePair;
use Zimbra\Struct\NamedElement;
use Zimbra\Struct\WaitSetSpec;
use Zimbra\Struct\WaitSetId;
use Zimbra\Enum\AutoProvTaskAction as TaskAction;
use Zimbra\Enum\AttrMethod;
use Zimbra\Enum\CompactIndexAction as IndexAction;
use Zimbra\Enum\CountObjectsType as ObjType;
use Zimbra\Enum\CertType;
use Zimbra\Enum\CSRType;
use Zimbra\Enum\CSRKeySize;
use Zimbra\Enum\DedupAction;
use Zimbra\Enum\DeployZimletAction as DeployAction;
use Zimbra\Enum\GalConfigAction as ConfigAction;
use Zimbra\Enum\GalMode;
use Zimbra\Enum\GalSearchType;
use Zimbra\Enum\GetSessionsSortBy;
use Zimbra\Enum\IpType;
use Zimbra\Enum\LockoutOperation;
use Zimbra\Enum\QuotaSortBy;
use Zimbra\Enum\ReIndexAction;
use Zimbra\Enum\RightClass;
use Zimbra\Enum\SessionType;
use Zimbra\Enum\TargetType;
use Zimbra\Enum\VersionCheckAction;
use Zimbra\Enum\VolumeType;
use Zimbra\Enum\ZimletExcludeType as ExcludeType;
/**
* Base is a abstract class which allows to connect Zimbra API administration functions via SOAP
*
* @package Zimbra
* @category Admin
* @author Nguyen Van Nguyen - [email protected]
* @copyright Copyright © 2013 by Nguyen Van Nguyen.
*/
abstract class Base extends API implements AdminInterface
{
/**
* Base constructor
*
* @param string $location The Zimbra api soap location.
*/
public function __construct($location)
{
$this->setLocation($location);
}
/**
* Add an alias for the account.
* Access: domain admin sufficient.
* Note: this request is by default proxied to the account's home server.
*
* @param string $id Value of zimbra identify.
* @param string $alias Account alias.
* @return mix
*/
public function addAccountAlias($id, $alias)
{
$request = new \Zimbra\Admin\Request\AddAccountAlias(
$id, $alias
);
return $this->getClient()->doRequest($request);
}
/**
* Changes logging settings on a per-account basis.
* Adds a custom logger for the given account and log category.
* The logger stays in effect only during the lifetime of the current server instance.
* If the request is sent to a server other than the one that the account resides on,
* it is proxied to the correct server.
* If the category is "all", adds a custom logger for every category or the given user.
*
* @param Logger $logger The Logger infor.
* @param Account $account The account.
* @return mix
*/
public function addAccountLogger(Logger $logger, Account $account = null)
{
$request = new \Zimbra\Admin\Request\AddAccountLogger(
$logger, $account
);
return $this->getClient()->doRequest($request);
}
/**
* Add an alias for a distribution list.
* Access: domain admin sufficient.
*
* @param string $id Value of zimbra identify.
* @param string $alias Distribution list alias.
* @return mix
*/
public function addDistributionListAlias($id, $alias)
{
$request = new \Zimbra\Admin\Request\AddDistributionListAlias(
$id, $alias
);
return $this->getClient()->doRequest($request);
}
/**
* Adding members to a distribution list.
* Access: domain admin sufficient.
*
* @param string $id Value of zimbra identify.
* @param array $dlms Distribution list members.
* @return mix
*/
public function addDistributionListMember($id, array $dlms)
{
$request = new \Zimbra\Admin\Request\AddDistributionListMember(
$id, $dlms
);
return $this->getClient()->doRequest($request);
}
/**
* Add a GalSync data source.
* Access: domain admin sufficient.
*
* @param Account $account Account.
* @param string $name Name of the data source.
* @param string $domain Name of pre-existing domain.
* @param string $type GalMode type (both|ldap|zimbra).
* @param string $folder Contact folder name.
* @param array $attrs Attributes.
* @return mix
*/
public function addGalSyncDataSource(
Account $account,
$name,
$domain,
GalMode $type,
$folder = null,
array $attrs = []
)
{
$request = new \Zimbra\Admin\Request\AddGalSyncDataSource(
$account, $name, $domain, $type, $folder, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create a waitset to listen for changes on one or more accounts.
* Called once to initialize a WaitSet and to set its "default interest types".
* WaitSet: scalable mechanism for listening for changes to one or more accounts.
* Interest types:
* f. folders
* m. messages
* c. contacts
* a. appointments
* t. tasks
* d. documents
* all. all types (equiv to "f,m,c,a,t,d")
*
* @param WaitSetSpec $waitSets The WaitSet add spec.
* @param array $defTypes Default interest types.
* @param bool $allAccounts If all is set, then all mailboxes on the system will be listened to, including any mailboxes which are created on the system while the WaitSet is in existence.
* @return mix
*/
public function adminCreateWaitSet(
WaitSetSpec $add = null,
array $defTypes = [],
$allAccounts = null
)
{
$request = new \Zimbra\Admin\Request\AdminCreateWaitSet(
$add, $defTypes, $allAccounts
);
return $this->getClient()->doRequest($request);
}
/**
* Use this to close out the waitset.
* Note that the server will automatically time out a wait set
* if there is no reference to it for (default of) 20 minutes.
* WaitSet: scalable mechanism for listening for changes to one or more accounts.
*
* @param string $waitSet Waitset identify.
* @return mix
*/
public function adminDestroyWaitSet($waitSet)
{
$request = new \Zimbra\Admin\Request\AdminDestroyWaitSet(
$waitSet
);
return $this->getClient()->doRequest($request);
}
/**
* AdminWaitSetRequest optionally modifies the wait set and checks for any notifications.
* If block=1 and there are no notifications, then this API will BLOCK until there is data.
* Interest types:
* f. folders
* m. messages
* c. contacts
* a. appointments
* t. tasks
* d. documents
* all. all types (equiv to "f,m,c,a,t,d")
*
* @param string $waitSet Waitset identify.
* @param string $seq Last known sequence number.
* @param bool $block Flag whether or not to block until some account has new data.
* @param array $defTypes Default interest types.
* @param int $timeout Timeout length.
* @param array $addWaitSets Waitset to add.
* @param array $updateWaitSets Waitset to update.
* @param array $removeWaitSets Waitset to remove.
* @return mix
*/
public function adminWaitSet(
$waitSet,
$seq,
WaitSetSpec $add = null,
WaitSetSpec $update = null,
WaitSetId $remove = null,
$block = null,
array $defTypes = [],
$timeout = null
)
{
$request = new \Zimbra\Admin\Request\AdminWaitSet(
$waitSet, $seq, $add, $update, $remove, $block, $defTypes, $timeout
);
return $this->getClient()->doRequest($request);
}
/**
* Authenticate for an adminstration account.
*
* @param string $name Name. Only one of {auth-name} or <account> can be specified
* @param string $password Password - must be present if not using AuthToken
* @param string $authToken An authToken can be passed instead of account/password/name to validate an existing auth authToken.
* @param Account $account The account
* @param string $virtualHost Virtual host
* @param string $twoFactorCode The TOTP code used for two-factor authentication
* @param bool $persistAuthTokenCookie Controls whether the auth authToken cookie in the response should be persisted when the browser exits.
* @param bool $csrfSupported Controls whether the client supports CSRF token
* @return authentication token
*/
public function auth(
$name = null,
$password = null,
$authToken = null,
Account $account = null,
$virtualHost = null,
$twoFactorCode = null,
$persistAuthTokenCookie = null,
$csrfSupported = null
)
{
$request = new \Zimbra\Admin\Request\Auth(
$name, $password, $authToken, $account, $virtualHost,
$twoFactorCode, $persistAuthTokenCookie, $csrfSupported
);
$result = $this->getClient()->doRequest($request);
if(isset($result->authToken) && !empty($result->authToken))
{
$this->getClient()->setAuthToken($result->authToken);
}
elseif (!empty($authToken))
{
$this->getClient()->setAuthToken($authToken);
}
return $result;
}
/**
* Authenticate for an adminstration account.
*
* @param string $name Name. Only one of {auth-name} or <account> can be specified
* @param string $password The user password.
* @param string $vhost Virtual-host is used to determine the domain of the account name.
* @return authentication token
*/
public function authByName($name, $password, $vhost = null)
{
return $this->auth($name, $password, null, null, $vhost, null, true);
}
/**
* Authenticate for an adminstration account.
*
* @param Account $account The user account.
* @param string $password The user password.
* @param string $vhost Virtual-host is used to determine the domain of the account name.
* @return authentication token
*/
public function authByAccount(Account $account, $password, $vhost = null)
{
return $this->auth(null, $password, null, $account, $vhost, null, true);
}
/**
* Authenticate for an adminstration account.
*
* @param string $token The authentication token.
* @return authentication token.
*/
public function authByToken($token)
{
return $this->auth(null, null, $token, null, null, null, true);
}
/**
* Perform an autocomplete for a name against the Global Address List
* Notes: admin verison of mail equiv. Used for testing via zmprov.
* Type of addresses to auto-complete on:
* 1. "account" for regular user accounts, aliases and distribution lists
* 2. "resource" for calendar resources
* 3. "group" for groups
* 4. "all" for combination of types
*
* @param string $domain The domain name.
* @param string $name The name to test for autocompletion.
* @param SearchType $type Type of addresses to auto-complete on.
* @param string $galAcctId GAL Account ID.
* @param int $limit An integer specifying the maximum number of results to return
* @return mix
*/
public function autoCompleteGal(
$domain,
$name,
GalSearchType $type = null,
$galAcctId = null,
$limit = null)
{
$request = new \Zimbra\Admin\Request\AutoCompleteGal(
$domain, $name, $type, $galAcctId, $limit
);
return $this->getClient()->doRequest($request);
}
/**
* Auto-provision an account
*
* @param Domain $domain The domain name.
* @param Principal $principal The name used to identify the principal.
* @param string $password Password.
* @return mix
*/
public function autoProvAccount(
Domain $domain,
Principal $principal,
$password = null)
{
$request = new \Zimbra\Admin\Request\AutoProvAccount(
$domain, $principal, $password
);
return $this->getClient()->doRequest($request);
}
/**
* Auto-provision task control.
* Under normal situations, the EAGER auto provisioning task(thread)
* should be started/stopped automatically by the server when appropriate.
* The task should be running when zimbraAutoProvPollingInterval is not 0
* and zimbraAutoProvScheduledDomains is not empty.
* The task should be stopped otherwise.
* This API is to manually force start/stop or query status of the EAGER auto provisioning task.
* It is only for diagnosis purpose and should not be used under normal situations.
*
* @param TaskAction $action Action to perform - one of start|status|stop
* @return mix
*/
public function autoProvTaskControl(TaskAction $action)
{
$request = new \Zimbra\Admin\Request\AutoProvTaskControl(
$action
);
return $this->getClient()->doRequest($request);
}
/**
* Check Auth Config.
*
* @param string $name Name.
* @param string $password Password.
* @param array $attrs Attributes.
* @return mix
*/
public function checkAuthConfig($name, $password, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CheckAuthConfig(
$name, $password, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Checks for items that have no blob, blobs that have no item,
* and items that have an incorrect blob size stored in their metadata.
* If no volumes are specified, all volumes are checked.
* If no mailboxes are specified, all mailboxes are checked.
* Blob sizes are checked by default.
* Set checkSize to 0 (false) to * avoid the CPU overhead
* of uncompressing compressed blobs in order to calculate size.
*
* @param array $volumes Volumes.
* @param array $mboxes Mailboxes.
* @param bool $checkSize Check size.
* @param bool $reportUsedBlobs If set a complete list of all blobs used by the mailbox(es) is returned.
* @return mix
*/
public function checkBlobConsistency(
array $volumes = [],
array $mboxes = [],
$checkSize = null,
$reportUsedBlobs = null)
{
$request = new \Zimbra\Admin\Request\CheckBlobConsistency(
$volumes, $mboxes, $checkSize, $reportUsedBlobs
);
return $this->getClient()->doRequest($request);
}
/**
* Check existence of one or more directories and optionally create them.
*
* @param array $directories Directories.
* @return mix
*/
public function checkDirectory(array $directories = [])
{
$request = new \Zimbra\Admin\Request\CheckDirectory(
$directories
);
return $this->getClient()->doRequest($request);
}
/**
* Check Domain MX record.
*
* @param string|Domain $domain The name used to identify the domain.
* @return mix
*/
public function checkDomainMXRecord(Domain $domain)
{
$request = new \Zimbra\Admin\Request\CheckDomainMXRecord(
$domain
);
return $this->getClient()->doRequest($request);
}
/**
* Check Exchange Authorisation.
*
* @param Exchange $auth Exchange auth details.
* @return mix
*/
public function checkExchangeAuth(Exchange $auth)
{
$request = new \Zimbra\Admin\Request\CheckExchangeAuth(
$auth
);
return $this->getClient()->doRequest($request);
}
/**
* Check Global Addressbook Configuration .
* Notes:
* 1. zimbraGalMode must be set to ldap, even if you eventually want to set it to "both".
* 2. <action> is optional. GAL-action can be autocomplete|search|sync. Default is search.
* 3. <query> is ignored if <action> is "sync".
* 4. AuthMech can be none|simple|kerberos5.
* - Default is simple if both BindDn/BindPassword are provided.
* - Default is none if either BindDn or BindPassword are NOT provided.
* 5. BindDn/BindPassword are required if AuthMech is "simple".
* 6. Kerberos5Principal/Kerberos5Keytab are required only if AuthMech is "kerberos5".
* 7. zimbraGalSyncLdapXXX attributes are for GAL sync. They are ignored if <action> is not sync.
* For GAL sync, if a zimbraGalSyncLdapXXX attribute is not set,
* server will fallback to the corresponding zimbraGalLdapXXX attribute.
*
* @param LimitedQuery $query Description for element text content.
* @param ConfigAction $action Action (autocomplete|search|sync).
* @param array $attrs Attributes.
* @return mix
*/
public function checkGalConfig(
LimitedQuery $query = null,
ConfigAction $action = null,
array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CheckGalConfig(
$query, $action, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Check Health.
*
* @return mix
*/
public function checkHealth()
{
$request = new \Zimbra\Admin\Request\CheckHealth();
return $this->getClient()->doRequest($request);
}
/**
* Check whether a hostname can be resolved.
*
* @param string $hostname Hostname.
* @return mix
*/
public function checkHostnameResolve($hostname = null)
{
$request = new \Zimbra\Admin\Request\CheckHostnameResolve(
$hostname
);
return $this->getClient()->doRequest($request);
}
/**
* Check password strength.
* Access: domain admin sufficient.
* Note: this request is by default proxied to the account's home server
*
* @param string $id Zimbra identify.
* @param string $password Passowrd to check.
* @return mix
*/
public function checkPasswordStrength($id, $password)
{
$request = new \Zimbra\Admin\Request\CheckPasswordStrength(
$id, $password
);
return $this->getClient()->doRequest($request);
}
/**
* Check if a principal has the specified right on target.
* A successful return means the principal specified by the <grantee>
* is allowed for the specified right on the * target object.
* Note: this request is by default proxied to the account's home server
*
* @param Target $target The target
* @param Grantee $grantee The grantee
* @param string $right Name of right.
* @param array $attrs Attributes.
* @return mix
*/
public function checkRight(
Target $target,
Grantee $grantee,
$right,
array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CheckRight(
$target, $grantee, $right, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Clear cookie.
*
* @param array $cookies Specifies cookies to clean.
* @return mix
*/
public function clearCookie(array $cookies = [])
{
$request = new \Zimbra\Admin\Request\ClearCookie(
$cookies
);
return $this->getClient()->doRequest($request);
}
/**
* Clear two factor auth data.
*
* @param Cos $cos
* @param Account $account
* @return mix
*/
public function clearTwoFactorAuthData(Cos $cos, Account $account)
{
$request = new \Zimbra\Admin\Request\ClearTwoFactorAuthData(
$cos, $account
);
return $this->getClient()->doRequest($request);
}
/**
* Compact index.
* Access: domain admin sufficient.
* Note: this request is by default proxied to the account's home server.
*
* @param MailboxId $mbox Mailbox.
* @param IndexAction $action Action to perform (start|status).
* @return mix
*/
public function compactIndex(MailboxId $mbox, IndexAction $action = null)
{
$request = new \Zimbra\Admin\Request\CompactIndex(
$mbox, $action
);
return $this->getClient()->doRequest($request);
}
/**
* Computes the aggregate quota usage for all domains in the system.
* The request handler issues GetAggregateQuotaUsageOnServerRequest
* to all mailbox servers and computes the aggregate quota used by each domain.
* The request handler updates the zimbraAggregateQuotaLastUsage domain attribute
* and sends out warning messages for each domain having quota usage greater than a defined percentage threshold.
*
* @return mix
*/
public function computeAggregateQuotaUsage()
{
$request = new \Zimbra\Admin\Request\ComputeAggregateQuotaUsage;
return $this->getClient()->doRequest($request);
}
/**
* Configure Zimlet.
*
* @param string $content Attachment identify.
* @return mix
*/
public function configureZimlet(Attachment $content)
{
$request = new \Zimbra\Admin\Request\ConfigureZimlet(
$content
);
return $this->getClient()->doRequest($request);
}
/**
* Copy Class of service (COS).
*
* @param string $name Destination name for COS.
* @param string $cos Source COS.
* @return mix
*/
public function copyCos($name = null, Cos $cos = null)
{
$request = new \Zimbra\Admin\Request\CopyCos(
$name, $cos
);
return $this->getClient()->doRequest($request);
}
/**
* Count number of accounts by cos in a domain.
* Note: It doesn't include any account with zimbraIsSystemResource=TRUE,
* nor does it include any calendar resources.
*
* @param string $domain The name used to identify the domain.
* @return mix
*/
public function countAccount(Domain $domain = null)
{
$request = new \Zimbra\Admin\Request\CountAccount(
$domain
);
return $this->getClient()->doRequest($request);
}
/**
* Count number of objects.
* Returns number of objects of requested type.
* Note: For account/alias/dl, if a domain is specified,
* only entries on the specified domain are counted.
* If no domain is specified, entries on all domains are counted.
* For accountOnUCService/cosOnUCService/domainOnUCService,
* UCService is required, and domain cannot be specified.
*
* @param ObjType $type Object type. Valid values: (userAccount|account|alias|dl|domain|cos|server|calresource|accountOnUCService|cosOnUCService|domainOnUCService|internalUserAccount|internalArchivingAccount).
* @param Domain $domain The name used to identify the domain.
* @param UcService $ucservice Key for choosing ucservice.
* @return mix
*/
public function countObjects(
ObjType $type,
Domain $domain = null,
UcService $ucservice = null)
{
$request = new \Zimbra\Admin\Request\CountObjects(
$type, $domain, $ucservice
);
return $this->getClient()->doRequest($request);
}
/**
* Create account.
* Notes:
* 1. accounts without passwords can't be logged into.
* 2. name must include domain (uid@name), and domain specified in name must exist.
* 3. default value for zimbraAccountStatus is "active".
* Access: domain admin sufficient.
*
* @param string $name New account's name. Must include domain (uid@name), and domain specified in name must exist.
* @param string $password New account's password.
* @param array $attrs Attributes.
* @return mix
*/
public function createAccount($name, $password, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CreateAccount(
$name, $password, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create a AlwaysOnCluster
*
* @param string $name New server name.
* @param array $attrs Attributes.
* @return mix
*/
public function createAlwaysOnCluster($name, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CreateAlwaysOnCluster(
$name, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create a calendar resource.
* Notes:
* 1. A calendar resource is a special type of Account. The Create, Delete, Modify, Rename, Get, GetAll, and Search operations are very similar to those of Account.
* 2. Must specify the displayName and zimbraCalResType attributes
* Access: domain admin sufficient.
*
* @param string $name Name or calendar resource. Must include domain (uid@domain), and domain specified after @ must exist.
* @param string $password Password for calendar resource.
* @param array $attrs Attributes.
* @return mix
*/
public function createCalendarResource($name = null, $password = null, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CreateCalendarResource(
$name, $password, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create a Class of Service (COS).
* Notes:
* 1. Extra attrs: description, zimbraNotes.
*
* @param string $name COS name.
* @param array $attrs Attributes.
* @return mix
*/
public function createCos($name, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CreateCos(
$name, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Creates a data source that imports mail items into the specified folder.
* Notes:
* 1. Currently the only type supported is pop3.
* 2. every attribute value is returned except password.
* 3. this request is by default proxied to the account's home server.
*
* @param string $id ID for an existing Account.
* @param DataSource $dataSource Details of data source.
* @return mix
*/
public function createDataSource($id, DataSource $dataSource)
{
$request = new \Zimbra\Admin\Request\CreateDataSource(
$id, $dataSource
);
return $this->getClient()->doRequest($request);
}
/**
* Create a distribution list.
* Notes:
* 1. dynamic - create a dynamic distribution list.
* 2. Extra attrs: description, zimbraNotes.
*
* @param string $name Name for distribution list.
* @param bool $dynamic If 1 (true) then create a dynamic distribution list.
* @param array $attrs Attributes.
* @return mix
*/
public function createDistributionList($name, $dynamic = null, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CreateDistributionList(
$name, $dynamic, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create a domain.
* Note:
* 1. Extra attrs: description, zimbraNotes.
*
* @param string $name Name of new domain.
* @param array $attrs Attributes.
* @return mix
*/
public function createDomain($name, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CreateDomain(
$name, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create a domain.
* Notes:
* 1. if the referenced account is not found it will be created.
* 2. the identifier used in name attr is used for SyncGal and SearchGal.
* 3. name attribute is for the name of the data source.
* 4. if folder attr is not present it'll default to Contacts folder.
* 5. passed in attrs in <a/> are used to initialize the gal data source.
* 6. server is a required parameter and specifies the mailhost on which this account resides.
*
* @param Account $account The name used to identify the account.
* @param string $name Name of the data source.
* @param string $domain Domain name.
* @param GalMode $type GalMode type. Valid values: (both|ldap|zimbra).
* @param string $server The mailhost on which this account resides.
* @param string $password Password.
* @param string $folder Contact folder name.
* @param array $attrs Attributes.
* @return mix
*/
public function createGalSyncAccount(
Account $account,
$name,
$domain,
GalMode $type,
$server,
$password = null,
$folder = null,
array $attrs = []
)
{
$request = new \Zimbra\Admin\Request\CreateGalSyncAccount(
$account, $name, $domain, $type, $server, $password, $folder, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create an LDAP entry.
*
* @param string $dn A valid LDAP DN String (RFC 2253) that describes the new DN to create.
* @param array $attrs Attributes.
* @return mix
*/
public function createLDAPEntry($dn, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CreateLDAPEntry(
$dn, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create a Server.
* Extra attrs: description, zimbraNotes.
*
* @param string $name New server name.
* @param array $attrs Attributes.
* @return mix
*/
public function createServer($name, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CreateServer(
$name, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create a system retention policy.
* The system retention policy SOAP APIs allow the administrator
* to edit named system retention policies that users can apply to folders and tags.
*
* @param string $cos The name used to identify the COS.
* @param PolicyHolder $keep Keep policy details.
* @param PolicyHolder $purge Purge policy details.
* @return mix
*/
public function createSystemRetentionPolicy(
Cos $cos = null,
PolicyHolder $keep = null,
PolicyHolder $purge = null
)
{
$request = new \Zimbra\Admin\Request\CreateSystemRetentionPolicy(
$cos, $keep, $purge
);
return $this->getClient()->doRequest($request);
}
/**
* Create a UC service.
*
* @param string $name New ucservice name.
* @param array $attrs Attributes.
* @return mix
*/
public function createUCService($name, array $attrs = [])
{
$request = new \Zimbra\Admin\Request\CreateUCService(
$name, $attrs
);
return $this->getClient()->doRequest($request);
}
/**
* Create a volume.
*
* @param Volume $volume Volume information.
* @return mix
*/
public function createVolume(Volume $volume)
{
$request = new \Zimbra\Admin\Request\CreateVolume(
$volume
);
return $this->getClient()->doRequest($request);
}
/**
* Create an XMPP component.
*
* @param Xmpp $xmpp XMPP Component details.
* @return mix