line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#################################################################### |
2
|
|
|
|
|
|
|
# Perl interface to CommuniGate Pro CLI. |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Version 2.7.5 |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Original location: |
7
|
|
|
|
|
|
|
# Revision history: |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# See for the related info. |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# Mail your comments and error reports to |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
############################## Commands: |
14
|
|
|
|
|
|
|
# new |
15
|
|
|
|
|
|
|
# Logout |
16
|
|
|
|
|
|
|
# getErrCode |
17
|
|
|
|
|
|
|
# getErrMessage |
18
|
|
|
|
|
|
|
# isSuccess |
19
|
|
|
|
|
|
|
# getErrCommand |
20
|
|
|
|
|
|
|
# setStringsTranslateMode |
21
|
|
|
|
|
|
|
# NewPassword |
22
|
|
|
|
|
|
|
# SendCommand |
23
|
|
|
|
|
|
|
# GetResponseData |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
############################## Accounts commands |
26
|
|
|
|
|
|
|
# ListAccounts |
27
|
|
|
|
|
|
|
# CreateAccount |
28
|
|
|
|
|
|
|
# RenameAccount |
29
|
|
|
|
|
|
|
# DeleteAccount |
30
|
|
|
|
|
|
|
# SetAccountType |
31
|
|
|
|
|
|
|
# GetAccountSettings |
32
|
|
|
|
|
|
|
# GetAccountEffectiveSettings |
33
|
|
|
|
|
|
|
# UpdateAccountSettings |
34
|
|
|
|
|
|
|
# SetAccountSettings |
35
|
|
|
|
|
|
|
# SetAccountPassword |
36
|
|
|
|
|
|
|
# VerifyAccountPassword |
37
|
|
|
|
|
|
|
# GetAccountAliases |
38
|
|
|
|
|
|
|
# SetAccountAliases |
39
|
|
|
|
|
|
|
# [Get|Set]AccountTelnums |
40
|
|
|
|
|
|
|
# [Get|Set]AccountRules |
41
|
|
|
|
|
|
|
# [Get|Set]Account[Mail|Signal]Rules |
42
|
|
|
|
|
|
|
# UpdateAccount[Mail|Signal]Rule |
43
|
|
|
|
|
|
|
# SetAccountRules |
44
|
|
|
|
|
|
|
# GetAccountRPOP |
45
|
|
|
|
|
|
|
# SetAccountRPOP |
46
|
|
|
|
|
|
|
# GetAccountRights |
47
|
|
|
|
|
|
|
# SetAccountRights |
48
|
|
|
|
|
|
|
# GetAccountInfo |
49
|
|
|
|
|
|
|
# [Get|Set|Update]AccountPrefs |
50
|
|
|
|
|
|
|
# GetEffectiveaAccountPrefs |
51
|
|
|
|
|
|
|
# KillAccountSessions |
52
|
|
|
|
|
|
|
# [Get|Set]AccountACL |
53
|
|
|
|
|
|
|
# GetAccountACLRights |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
############################## Group Commands |
56
|
|
|
|
|
|
|
# ListGroups |
57
|
|
|
|
|
|
|
# CreateGroup |
58
|
|
|
|
|
|
|
# RenameGroup |
59
|
|
|
|
|
|
|
# DeleteGroup |
60
|
|
|
|
|
|
|
# GetGroup |
61
|
|
|
|
|
|
|
# SetGroup |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
############################## Forwarder Commands |
64
|
|
|
|
|
|
|
# ListForwarders |
65
|
|
|
|
|
|
|
# CreateForwarder |
66
|
|
|
|
|
|
|
# RenameForwarder |
67
|
|
|
|
|
|
|
# DeleteForwarder |
68
|
|
|
|
|
|
|
# GetForwarder |
69
|
|
|
|
|
|
|
# FindForwarders |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
############################## Domain commands |
72
|
|
|
|
|
|
|
# ListDomains |
73
|
|
|
|
|
|
|
# MainDomainName |
74
|
|
|
|
|
|
|
# [Get|Update|Set]DomainSettings |
75
|
|
|
|
|
|
|
# GetDomainEffectiveSettings |
76
|
|
|
|
|
|
|
# [Create|Rename|Delete]Domain |
77
|
|
|
|
|
|
|
# [Suspend|Resume]Domain |
78
|
|
|
|
|
|
|
# CreateSharedDomain |
79
|
|
|
|
|
|
|
# CreateDirectoryDomain |
80
|
|
|
|
|
|
|
# [Get|Set]DomainRules |
81
|
|
|
|
|
|
|
# [Get|Set]DomainAliases |
82
|
|
|
|
|
|
|
# ListAdminDomains |
83
|
|
|
|
|
|
|
# [Insert|Delete]DirectoryRecords |
84
|
|
|
|
|
|
|
# [Get|Set][Server|Cluster]TrustedCerts |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# [Get|Set]DirectoryIntegration |
87
|
|
|
|
|
|
|
# [Get|Set]ClusterDirectoryIntegration |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# [Get|Update|Set]DomainDefaults |
91
|
|
|
|
|
|
|
# [Get|Update|Set]ClusterDomainDefaults |
92
|
|
|
|
|
|
|
# [Get|Update|Set]AllAccountsDefaults * |
93
|
|
|
|
|
|
|
# [Get|Update|Set]ServerAccountsDefaults |
94
|
|
|
|
|
|
|
# GetDomainLocation |
95
|
|
|
|
|
|
|
# GetAccountLocation |
96
|
|
|
|
|
|
|
# [Get|Update|Set]AccountDefaults |
97
|
|
|
|
|
|
|
# [Get|Update|Set]ClusterAccountDefaults |
98
|
|
|
|
|
|
|
# [Get|Set|Update]AccountDefaultPrefs |
99
|
|
|
|
|
|
|
# [Get|Set][Server|Cluster]AccountPrefs |
100
|
|
|
|
|
|
|
# [Get|Update|Set]AccountTemplate |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
############################## Mailbox Administration |
103
|
|
|
|
|
|
|
# ListMailboxes |
104
|
|
|
|
|
|
|
# [Create|Rename|Delete]Mailbox |
105
|
|
|
|
|
|
|
# [Rename|Delete]Mailboxes |
106
|
|
|
|
|
|
|
# GetMailboxInfo |
107
|
|
|
|
|
|
|
# [Get|Set]MailboxACL |
108
|
|
|
|
|
|
|
# GetMailboxRights |
109
|
|
|
|
|
|
|
# SetMailboxClass |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# [Get|Set]AccountSubscription |
112
|
|
|
|
|
|
|
# [Get|Set]MailboxAliases |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
############################## Alerts Administration |
115
|
|
|
|
|
|
|
# Get[Domain|Account|Server|Cluster]Alerts |
116
|
|
|
|
|
|
|
# Set[Domain|Account|Server|Cluster]Alerts |
117
|
|
|
|
|
|
|
# Post[Domain|Account|Server|Cluster]Alert |
118
|
|
|
|
|
|
|
# Remove[Domain|Account|Server|Cluster]Alert |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
############################## Personal Web Site Administration |
121
|
|
|
|
|
|
|
# GetWebFile |
122
|
|
|
|
|
|
|
# PutWebFile |
123
|
|
|
|
|
|
|
# RenameWebFile |
124
|
|
|
|
|
|
|
# DeleteWebFile |
125
|
|
|
|
|
|
|
# ListWebFiles |
126
|
|
|
|
|
|
|
# GetWebFilesInfo |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
############################## Lists commands |
129
|
|
|
|
|
|
|
# ListLists |
130
|
|
|
|
|
|
|
# GetDomainLists |
131
|
|
|
|
|
|
|
# GetAccountLists |
132
|
|
|
|
|
|
|
# [Create|Rename|Delete|Get|Update]List |
133
|
|
|
|
|
|
|
# List |
134
|
|
|
|
|
|
|
# ListSubscribers |
135
|
|
|
|
|
|
|
# GetSubscriberInfo |
136
|
|
|
|
|
|
|
# SetPostingMode |
137
|
|
|
|
|
|
|
# ProcessBounce |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
############################## Web Skins Administration |
140
|
|
|
|
|
|
|
# ListDomainSkins( [domainName] ) |
141
|
|
|
|
|
|
|
# CreateDomainSkin(domainName,skinName) |
142
|
|
|
|
|
|
|
# RenameDomainSkin(domainName,oldSkinName,newSkinName) |
143
|
|
|
|
|
|
|
# DeleteDomainSkin(domainName,skinName) |
144
|
|
|
|
|
|
|
# ListDomainSkinFiles(domainName,skinName) |
145
|
|
|
|
|
|
|
# ReadDomainSkinFile(domainName,skinName,fileName) |
146
|
|
|
|
|
|
|
# StoreDomainSkinFile(domainName,skinName,fileName,base64data) |
147
|
|
|
|
|
|
|
# DeleteDomainSkinFile(domainName,skinName,fileName) |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
# ListServerSkins() |
150
|
|
|
|
|
|
|
# CreateServerSkin(skinName) |
151
|
|
|
|
|
|
|
# RenameServerSkin(oldSkinName,newSkinName) |
152
|
|
|
|
|
|
|
# DeleteServerSkin(skinName) |
153
|
|
|
|
|
|
|
# ListServerSkinFiles(skinName) |
154
|
|
|
|
|
|
|
# ReadServerSkinFile(skinName,fileName) |
155
|
|
|
|
|
|
|
# StoreServerSkinFile(skinName,fileName,base64data) |
156
|
|
|
|
|
|
|
# DeleteServerSkinFile(skinName,fileName) |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# ListClusterSkins() |
159
|
|
|
|
|
|
|
# CreateClusterSkin(skinName) |
160
|
|
|
|
|
|
|
# RenameClusterSkin(oldSkinName,newSkinName) |
161
|
|
|
|
|
|
|
# DeleteClusterSkin(skinName) |
162
|
|
|
|
|
|
|
# ListClusterSkinFiles(skinName) |
163
|
|
|
|
|
|
|
# ReadClusterSkinFile(skinName,fileName) |
164
|
|
|
|
|
|
|
# StoreClusterSkinFile(skinName,fileName,base64data) |
165
|
|
|
|
|
|
|
# DeleteClusterSkinFile(skinName,fileName) |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
############################## Web Interface Tuning |
168
|
|
|
|
|
|
|
# [List|Get|Put|Delete]WebUserInterface |
169
|
|
|
|
|
|
|
# ClearWebUserCache |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
############################## Web Interface Integration |
172
|
|
|
|
|
|
|
# [Create|Get|Kill|Find]WebUserSession |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
############################## Real-Time Application Administration |
175
|
|
|
|
|
|
|
# Create[Domain|Server|Cluster]PBX |
176
|
|
|
|
|
|
|
# List[Domain|Server|Cluster]PBXFiles |
177
|
|
|
|
|
|
|
# [Read|Store|Delete][Domain|Server|Cluster]PBXFile |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
############################## Server commands |
180
|
|
|
|
|
|
|
# [Get|Update|Set]Module |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
# [Get|Set]LANIPs |
183
|
|
|
|
|
|
|
# [Get|Set]BlacklistedIPs |
184
|
|
|
|
|
|
|
# [Get|Set]ClientIPs |
185
|
|
|
|
|
|
|
# [Get|Set]WhiteHoleIPs |
186
|
|
|
|
|
|
|
# [Get|Set]Protection |
187
|
|
|
|
|
|
|
# [Get|Set]Banned |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
# [Get|Set]ClusterLANIPs |
190
|
|
|
|
|
|
|
# [Get|Set]ClusterBlacklistedIPs |
191
|
|
|
|
|
|
|
# [Get|Set]ClusterClientIPs |
192
|
|
|
|
|
|
|
# [Get|Set]ClusterWhiteHoleIPs |
193
|
|
|
|
|
|
|
# [Get|Set]ClusterProtection |
194
|
|
|
|
|
|
|
# GetClusterBanned |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
# [Get|Set][Server|Cluster]Rules |
197
|
|
|
|
|
|
|
# [Get|Set][Server|Cluster][Mail|Signal]Rules |
198
|
|
|
|
|
|
|
## Update[Server|Cluster][Mail|Signal]Rule |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
# RefreshOSData |
201
|
|
|
|
|
|
|
# [Get|Set]RouterTable |
202
|
|
|
|
|
|
|
# [Get|Set]RouterSettings |
203
|
|
|
|
|
|
|
# [Get|Set]ClusterRouterTable |
204
|
|
|
|
|
|
|
# [Get|Set][Server|Cluster]Intercept |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
# Route |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
############################## Monitoring commands |
209
|
|
|
|
|
|
|
# GetSNMPElement |
210
|
|
|
|
|
|
|
# Shutdown |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
############################## Statistics commands |
213
|
|
|
|
|
|
|
# [Get|Reset]AccountStat |
214
|
|
|
|
|
|
|
# [Get|Reset]DomainStat |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
############################## Miscellaneous commands |
217
|
|
|
|
|
|
|
# WriteLog |
218
|
|
|
|
|
|
|
# ReleaseSMTPQueue |
219
|
|
|
|
|
|
|
# RejectQueueMessage |
220
|
|
|
|
|
|
|
# GetMessageQueueInfo |
221
|
|
|
|
|
|
|
# GetCurrentController |
222
|
|
|
|
|
|
|
# GetTempClientIPs |
223
|
|
|
|
|
|
|
# [Get|Set]TempBlacklistedIPs |
224
|
|
|
|
|
|
|
# RemoveAccountSubset |
225
|
|
|
|
|
|
|
# List[Domain|Server|Cluster]Telnums |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
############################################################## |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
package CGP::CLI; |
230
|
|
|
|
|
|
|
|
231
|
1
|
|
|
1
|
|
1085
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
232
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
# You may need to change this to "use IO::Socket::INET;" if you have INET.pm |
235
|
1
|
|
|
1
|
|
805
|
use IO::Socket; |
|
1
|
|
|
|
|
883477
|
|
|
1
|
|
|
|
|
7
|
|
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
# You may need to install this module. |
238
|
|
|
|
|
|
|
# See |
239
|
1
|
|
|
1
|
|
1138
|
use Digest::MD5; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
51
|
|
240
|
|
|
|
|
|
|
|
241
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36316
|
|
242
|
|
|
|
|
|
|
($VERSION) = '2.7.5'; |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
$CGP::SECURE_LOGIN = 1; |
246
|
|
|
|
|
|
|
$CGP::WEBUSER_LOGIN = 0; |
247
|
|
|
|
|
|
|
$CGP::TIMEOUT = 60*5-5; # 5 minutes timeout |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
$CGP::ERR_STRING = "No error"; |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
$CGP::CLI_CODE_OK = 200; |
252
|
|
|
|
|
|
|
$CGP::CLI_CODE_OK_INLINE = 201; |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
$CGP::CLI_CODE_PASSWORD = 300; |
255
|
|
|
|
|
|
|
$CGP::CLI_CODE_UNKNOW_USER = 500; |
256
|
|
|
|
|
|
|
$CGP::CLI_CODE_GEN_ERR = 501; |
257
|
|
|
|
|
|
|
$CGP::CLI_CODE_STRANGE = 10000; |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
sub connect { |
263
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
264
|
0
|
|
|
|
|
|
$this->{isConnected}=0; |
265
|
|
|
|
|
|
|
|
266
|
0
|
|
|
|
|
|
delete $this->{theSocket}; |
267
|
|
|
|
|
|
|
|
268
|
0
|
|
|
|
|
|
$this->{theSocket} = new IO::Socket::INET( %{$this->{connParams}} ); |
|
0
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
|
270
|
0
|
0
|
0
|
|
|
|
unless(defined $this->{theSocket} && $this->{theSocket}) { |
271
|
0
|
|
|
|
|
|
$CGP::ERR_STRING="Can't open connection to CGPro Server"; |
272
|
0
|
|
|
|
|
|
return undef; |
273
|
|
|
|
|
|
|
}; |
274
|
0
|
|
|
|
|
|
$this->{theSocket}->autoflush(1); |
275
|
|
|
|
|
|
|
|
276
|
0
|
0
|
|
|
|
|
unless($this->_parseResponse()) { |
277
|
0
|
|
|
|
|
|
$CGP::ERR_STRING="Can't read CGPro Server prompt"; |
278
|
0
|
|
|
|
|
|
return undef; |
279
|
|
|
|
|
|
|
}; |
280
|
|
|
|
|
|
|
|
281
|
0
|
0
|
0
|
|
|
|
if($this->{isSecureLogin} && $this->{errMsg} =~ /(\<.*\@*\>)/) { |
|
|
0
|
|
|
|
|
|
282
|
0
|
|
|
|
|
|
my $md5=Digest::MD5->new; |
283
|
0
|
0
|
|
|
|
|
if($md5) { |
284
|
0
|
|
|
|
|
|
$md5->add($1.$this->{password}); |
285
|
0
|
|
|
|
|
|
$this->send('APOP '.$this->{login}.' '.$md5->hexdigest); |
286
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
287
|
|
|
|
|
|
|
} else { |
288
|
0
|
|
|
|
|
|
$CGP::ERR_STRING="Can't create MD5 object"; |
289
|
0
|
|
|
|
|
|
close($this->{theSocket}); |
290
|
0
|
|
|
|
|
|
return undef; |
291
|
|
|
|
|
|
|
} |
292
|
|
|
|
|
|
|
} elsif($this->{isWebUserLogin}) { |
293
|
0
|
|
|
|
|
|
$this->send('AUTH WEBUSER '.$this->{login}.' '.$this->{password}); |
294
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
} else { |
297
|
0
|
|
|
|
|
|
$this->send('USER '.$this->{login}); |
298
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
299
|
0
|
0
|
|
|
|
|
unless( $this->{errCode} == $CGP::CLI_CODE_PASSWORD) { |
300
|
0
|
|
|
|
|
|
$CGP::ERR_STRING="Unexpected answer: ".$this->{errCode}; |
301
|
0
|
|
|
|
|
|
close($this->{theSocket}); |
302
|
0
|
|
|
|
|
|
return undef; |
303
|
|
|
|
|
|
|
} |
304
|
0
|
|
|
|
|
|
$this->send('PASS '.$this->{password}); |
305
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
306
|
|
|
|
|
|
|
} |
307
|
|
|
|
|
|
|
|
308
|
0
|
0
|
|
|
|
|
unless($this->isSuccess) { |
309
|
0
|
|
|
|
|
|
$CGP::ERR_STRING=$this->{errMsg}; |
310
|
0
|
|
|
|
|
|
close($this->{theSocket}); |
311
|
0
|
|
|
|
|
|
return undef; |
312
|
|
|
|
|
|
|
} |
313
|
0
|
|
|
|
|
|
$this->send('INLINE'); |
314
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
315
|
0
|
|
|
|
|
|
$this->setStringsTranslateMode(0); |
316
|
0
|
|
|
|
|
|
$this->{isConnected}=1; |
317
|
0
|
|
|
|
|
|
1; |
318
|
|
|
|
|
|
|
} |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
sub new { |
322
|
0
|
|
|
0
|
0
|
|
my ($class, $params) = @_; |
323
|
0
|
|
|
|
|
|
my $this = {}; |
324
|
|
|
|
|
|
|
|
325
|
0
|
|
|
|
|
|
$this->{login} = delete $params->{'login'}; |
326
|
0
|
|
|
|
|
|
$this->{password} = delete $params->{'password'}; |
327
|
|
|
|
|
|
|
|
328
|
0
|
|
|
|
|
|
$this->{isSecureLogin} = delete $params->{'SecureLogin'}; |
329
|
0
|
|
|
|
|
|
$this->{isWebUserLogin} = delete $params->{'WebUserLogin'}; |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
|
332
|
0
|
0
|
|
|
|
|
$this->{isSecureLogin} = $CGP::SECURE_LOGIN unless defined $this->{isSecureLogin}; |
333
|
0
|
0
|
|
|
|
|
$this->{isWebUserLogin} = $CGP::WEBUSER_LOGIN unless defined $this->{isWebUserLogin}; |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
|
336
|
0
|
0
|
|
|
|
|
croak 'You must pass login parameter to CGP::CLI::new' |
337
|
|
|
|
|
|
|
unless defined $this->{login}; |
338
|
0
|
0
|
|
|
|
|
croak 'You must pass password parameter to CGP::CLI::new' |
339
|
|
|
|
|
|
|
unless defined $this->{password}; |
340
|
|
|
|
|
|
|
|
341
|
0
|
0
|
0
|
|
|
|
croak 'SecureLogin and WebUserLogin are mutually exclusive' |
342
|
|
|
|
|
|
|
if($this->{isSecureLogin} && $this->{isWebUserLogin}); |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
#print %$params; |
345
|
0
|
|
|
|
|
|
bless $this; |
346
|
0
|
|
|
|
|
|
$this->{connParams}=$params; |
347
|
|
|
|
|
|
|
|
348
|
0
|
0
|
0
|
|
|
|
if(!(defined $params->{'connectNow'}) || $params->{'connectNow'}) { |
349
|
0
|
0
|
|
|
|
|
unless($this->connect()) { |
350
|
0
|
|
|
|
|
|
return undef; |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
} |
353
|
0
|
|
|
|
|
|
$this; |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
sub DESTROY { |
357
|
0
|
|
|
0
|
|
|
my $this = shift; |
358
|
0
|
0
|
|
|
|
|
$this->Logout() if($this->{isConnected}); |
359
|
|
|
|
|
|
|
} |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
sub getErrCode { |
362
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
363
|
0
|
|
|
|
|
|
return $this->{errCode}; |
364
|
|
|
|
|
|
|
} |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
sub getErrMessage { |
367
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
368
|
0
|
|
|
|
|
|
return $this->{errMsg}; |
369
|
|
|
|
|
|
|
} |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
sub getErrCommand { |
372
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
373
|
0
|
|
|
|
|
|
return $this->{'currentCGateCommand'}; |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
sub isSuccess { |
377
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
378
|
0
|
|
0
|
|
|
|
return ($this->{errCode} == $CGP::CLI_CODE_OK || $this->{errCode} == $CGP::CLI_CODE_OK_INLINE); |
379
|
|
|
|
|
|
|
} |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
sub setDebug { |
382
|
0
|
|
|
0
|
0
|
|
my ($this, $debugFlag) = @_; |
383
|
0
|
|
|
|
|
|
$this->{'debug'} = $debugFlag; |
384
|
|
|
|
|
|
|
} |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
sub setStringsTranslateMode { |
387
|
0
|
|
|
0
|
0
|
|
my ($this, $onFlag) = @_; |
388
|
0
|
|
|
|
|
|
$this->{'translateStrings'} = $onFlag; |
389
|
|
|
|
|
|
|
} |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
sub Logout { |
392
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
393
|
0
|
|
|
|
|
|
$this->send('QUIT'); |
394
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
395
|
0
|
|
|
|
|
|
$this->{isConnected}=0; |
396
|
|
|
|
|
|
|
} |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
sub NewPassword { |
399
|
0
|
|
|
0
|
0
|
|
my ($this, $newPassword) = @_; |
400
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->NewPassword($newPassword)' |
401
|
|
|
|
|
|
|
unless defined $newPassword; |
402
|
0
|
|
|
|
|
|
$this->send('NEWPASS '.$newPassword); |
403
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
404
|
|
|
|
|
|
|
} |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
sub SendCommand { |
407
|
0
|
|
|
0
|
0
|
|
my ($this, $command) = @_; |
408
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SendCommand($commandString)' |
409
|
|
|
|
|
|
|
unless defined $command; |
410
|
0
|
|
|
|
|
|
$this->send($command); |
411
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
412
|
|
|
|
|
|
|
} |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
sub GetResponseData { |
415
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
416
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
417
|
|
|
|
|
|
|
} |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
#################################################################### |
421
|
|
|
|
|
|
|
# Account commands |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
sub ListDomainObjects { |
424
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName,$limit,$filter,$what,$cookie) = @_; |
425
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->ListDomainObjects($domainName,$limit[,$filter][,$what][,$cookie])' |
426
|
|
|
|
|
|
|
unless defined $domainName && defined $limit; |
427
|
0
|
|
|
|
|
|
my $line = "ListDomainObjects $domainName"; |
428
|
0
|
0
|
|
|
|
|
$line .= ' FILTER '.$this->printWords($filter) if defined $filter; |
429
|
0
|
|
|
|
|
|
$line .= " $limit"; |
430
|
0
|
0
|
|
|
|
|
$line .= " $what" if $what; |
431
|
0
|
0
|
|
|
|
|
$line .= " COOKIE ".$this->printWords($cookie) if defined $cookie; |
432
|
0
|
|
|
|
|
|
$this->send($line); |
433
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
434
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
435
|
|
|
|
|
|
|
} |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
sub ListAccounts { |
439
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
440
|
0
|
|
|
|
|
|
my $line = 'ListAccounts'; |
441
|
0
|
0
|
|
|
|
|
$line .= ' '.$domainName if $domainName; |
442
|
0
|
|
|
|
|
|
$this->send($line); |
443
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
444
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
445
|
|
|
|
|
|
|
} |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
sub ListDomainTelnums { |
448
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName,$limit,$filter) = @_; |
449
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->ListDomainTelnums($domainName,$limit[,$filter])' |
450
|
|
|
|
|
|
|
unless defined $domainName && defined $limit; |
451
|
0
|
|
|
|
|
|
my $line = "ListDomainTelnums $domainName"; |
452
|
0
|
0
|
|
|
|
|
$line .= ' FILTER '.$this->printWords($filter) if defined $filter; |
453
|
0
|
|
|
|
|
|
$line .= " $limit"; |
454
|
0
|
|
|
|
|
|
$this->send($line); |
455
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
456
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
457
|
|
|
|
|
|
|
} |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
sub CreateAccount { |
462
|
0
|
|
|
0
|
0
|
|
my ($this) = shift;; |
463
|
0
|
|
|
|
|
|
my %params = (@_); |
464
|
|
|
|
|
|
|
|
465
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->CreateAccount(accountName => \'newAccountName\', |
466
|
|
|
|
|
|
|
accountType => \'accountType\', |
467
|
|
|
|
|
|
|
externalFlag => \'externalFlag\', |
468
|
|
|
|
|
|
|
settings => $settings)' |
469
|
|
|
|
|
|
|
unless exists $params{accountName}; |
470
|
0
|
|
|
|
|
|
my $line = 'CreateAccount '.$params{accountName}; |
471
|
0
|
0
|
|
|
|
|
$line .= ' ' . $params{accountType} if exists $params{accountType}; |
472
|
0
|
0
|
|
|
|
|
$line .= ' ' . 'external' if exists $params{externalFlag}; |
473
|
0
|
0
|
|
|
|
|
$line .= ' ' . $this->printWords($params{settings}) if exists $params{settings}; |
474
|
|
|
|
|
|
|
|
475
|
0
|
|
|
|
|
|
$this->send($line); |
476
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
477
|
|
|
|
|
|
|
} |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
sub RenameAccount { |
480
|
0
|
|
|
0
|
0
|
|
my ($this, $oldAccountName, $newAccountName) = @_; |
481
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameAccount($oldAccountName, $newAccountName)' |
482
|
|
|
|
|
|
|
unless defined $oldAccountName && defined $newAccountName; |
483
|
0
|
|
|
|
|
|
$this->send('RenameAccount '.$oldAccountName.' into '.$newAccountName); |
484
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
485
|
|
|
|
|
|
|
} |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
sub DeleteAccount { |
488
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName) = @_; |
489
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->DeleteAccount($accountName)' |
490
|
|
|
|
|
|
|
unless defined $accountName; |
491
|
0
|
|
|
|
|
|
$this->send('DeleteAccount '.$accountName); |
492
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
493
|
|
|
|
|
|
|
} |
494
|
|
|
|
|
|
|
sub SetAccountType { |
495
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName,$type) = @_; |
496
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountType($accountName,$type)' |
497
|
|
|
|
|
|
|
unless (defined $accountName && defined $type); |
498
|
0
|
|
|
|
|
|
$this->send('SetAccountType '.$accountName.' '.$type); |
499
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
500
|
|
|
|
|
|
|
} |
501
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
sub GetAccountSettings { |
503
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName) = @_; |
504
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountSettings($accountName)' |
505
|
|
|
|
|
|
|
unless defined $accountName; |
506
|
0
|
|
|
|
|
|
$this->send('GetAccountSettings '.$accountName); |
507
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
508
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
509
|
|
|
|
|
|
|
} |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
sub GetAccount { |
512
|
0
|
|
|
0
|
0
|
|
GetAccountSettings(@_); |
513
|
|
|
|
|
|
|
} |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
sub GetAccountEffectiveSettings { |
516
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName) = @_; |
517
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountEffectiveSettings($accountName)' |
518
|
|
|
|
|
|
|
unless defined $accountName; |
519
|
0
|
|
|
|
|
|
$this->send('GetAccountEffectiveSettings '.$accountName); |
520
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
521
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
522
|
|
|
|
|
|
|
} |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
sub UpdateAccountSettings { |
525
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $params) = @_; |
526
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->UpdateAccountSettings($accountName, \%settings)' |
527
|
|
|
|
|
|
|
unless defined $accountName; |
528
|
0
|
|
|
|
|
|
$this->send('UpdateAccountSettings '.$accountName.' '.$this->printWords($params)); |
529
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
530
|
|
|
|
|
|
|
} |
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
sub UpdateAccount { |
533
|
0
|
|
|
0
|
0
|
|
UpdateAccountSettings(@_); |
534
|
|
|
|
|
|
|
} |
535
|
|
|
|
|
|
|
|
536
|
|
|
|
|
|
|
sub SetAccountSettings { |
537
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $params) = @_; |
538
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetAccountSettings($accountName, \%settings)' |
539
|
|
|
|
|
|
|
unless defined $accountName; |
540
|
0
|
|
|
|
|
|
$this->send('SetAccountSettings '.$accountName.' '.$this->printWords($params)); |
541
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
542
|
|
|
|
|
|
|
} |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
sub SetAccount { |
545
|
0
|
|
|
0
|
0
|
|
SetAccountSettings(@_); |
546
|
|
|
|
|
|
|
} |
547
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
sub SetAccountPassword { |
549
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $newPass) = @_; |
550
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountPassword($accountName, $newPassword)' |
551
|
|
|
|
|
|
|
unless defined $accountName && defined $newPass; |
552
|
0
|
|
|
|
|
|
$this->send('SetAccountPassword '.$accountName.' TO '.$this->printWords($newPass)); |
553
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
554
|
|
|
|
|
|
|
} |
555
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
sub VerifyAccountPassword { |
557
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $pass) = @_; |
558
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->VerifyAccountPassword($accountName, $password)' |
559
|
|
|
|
|
|
|
unless defined $accountName && defined $pass; |
560
|
0
|
|
|
|
|
|
$this->send('VerifyAccountPassword '.$accountName.' PASSWORD '.$this->printWords($pass)); |
561
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
562
|
|
|
|
|
|
|
} |
563
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
sub GetAccountAliases { |
566
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName) = @_; |
567
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountAliases($accountName)' |
568
|
|
|
|
|
|
|
unless defined $accountName; |
569
|
0
|
|
|
|
|
|
$this->send('GetAccountAliases '.$accountName); |
570
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
571
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
572
|
|
|
|
|
|
|
} |
573
|
|
|
|
|
|
|
|
574
|
|
|
|
|
|
|
sub SetAccountAliases { |
575
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $aliases) = @_; |
576
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountAliases($accountName, \@aliases)' |
577
|
|
|
|
|
|
|
unless defined $accountName && defined $aliases; |
578
|
0
|
|
|
|
|
|
$this->send('SetAccountAliases '.$accountName.' '.$this->printWords($aliases)); |
579
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
580
|
|
|
|
|
|
|
} |
581
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
sub GetAccountTelnums { |
583
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName) = @_; |
584
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountTelnums($accountName)' |
585
|
|
|
|
|
|
|
unless defined $accountName; |
586
|
0
|
|
|
|
|
|
$this->send('GetAccountTelnums '.$accountName); |
587
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
588
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
589
|
|
|
|
|
|
|
} |
590
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
sub SetAccountTelnums { |
592
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $aliases) = @_; |
593
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountTelnums($accountName, \@telnums)' |
594
|
|
|
|
|
|
|
unless defined $accountName && defined $aliases; |
595
|
0
|
|
|
|
|
|
$this->send('SetAccountTelnums '.$accountName.' '.$this->printWords($aliases)); |
596
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
597
|
|
|
|
|
|
|
} |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
|
600
|
|
|
|
|
|
|
sub GetAccountRules { |
601
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName) = @_; |
602
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountRules($accountName)' |
603
|
|
|
|
|
|
|
unless defined $accountName; |
604
|
0
|
|
|
|
|
|
$this->send('GetAccountRules '.$accountName); |
605
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
606
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
607
|
|
|
|
|
|
|
} |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
sub SetAccountRules { |
610
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $rules) = @_; |
611
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountRules($accountName, \@rules)' |
612
|
|
|
|
|
|
|
unless defined $accountName && defined $rules; |
613
|
0
|
|
|
|
|
|
$this->send('SetAccountRules '.$accountName.' '.$this->printWords($rules)); |
614
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
615
|
|
|
|
|
|
|
} |
616
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
sub GetAccountMailRules { |
618
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName) = @_; |
619
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountMailRules($accountName)' |
620
|
|
|
|
|
|
|
unless defined $accountName; |
621
|
0
|
|
|
|
|
|
$this->send('GetAccountMailRules '.$accountName); |
622
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
623
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
624
|
|
|
|
|
|
|
} |
625
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
sub SetAccountMailRules { |
627
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $rules) = @_; |
628
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountMailRules($accountName, \@rules)' |
629
|
|
|
|
|
|
|
unless defined $accountName && defined $rules; |
630
|
0
|
|
|
|
|
|
$this->send('SetAccountMailRules '.$accountName.' '.$this->printWords($rules)); |
631
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
632
|
|
|
|
|
|
|
} |
633
|
|
|
|
|
|
|
sub UpdateAccountMailRule { |
634
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $rule) = @_; |
635
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->UpdateAccountMailRule($accountName, \@rule)' |
636
|
|
|
|
|
|
|
unless defined $accountName && defined $rule; |
637
|
0
|
|
|
|
|
|
$this->send('UpdateAccountMailRule '.$accountName.' '.$this->printWords($rule)); |
638
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
639
|
|
|
|
|
|
|
} |
640
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
sub GetAccountSignalRules { |
642
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName) = @_; |
643
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountSignalRules($accountName)' |
644
|
|
|
|
|
|
|
unless defined $accountName; |
645
|
0
|
|
|
|
|
|
$this->send('GetAccountSignalRules '.$accountName); |
646
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
647
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
648
|
|
|
|
|
|
|
} |
649
|
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
sub SetAccountSignalRules { |
651
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $rules) = @_; |
652
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountSignalRules($accountName, \@rules)' |
653
|
|
|
|
|
|
|
unless defined $accountName && defined $rules; |
654
|
0
|
|
|
|
|
|
$this->send('SetAccountSignalRules '.$accountName.' '.$this->printWords($rules)); |
655
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
656
|
|
|
|
|
|
|
} |
657
|
|
|
|
|
|
|
sub UpdateAccountSignalRule { |
658
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $rule) = @_; |
659
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->UpdateAccountSignalRule($accountName, \@rule)' |
660
|
|
|
|
|
|
|
unless defined $accountName && defined $rule; |
661
|
0
|
|
|
|
|
|
$this->send('UpdateAccountSignalRule '.$accountName.' '.$this->printWords($rule)); |
662
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
663
|
|
|
|
|
|
|
} |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
sub GetAccountRPOP { |
666
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName) = @_; |
667
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountRPOP($accountName)' |
668
|
|
|
|
|
|
|
unless defined $accountName; |
669
|
0
|
|
|
|
|
|
$this->send('GetAccountRPOP '.$accountName); |
670
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
671
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
672
|
|
|
|
|
|
|
} |
673
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
sub SetAccountRPOP { |
675
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $newRecords) = @_; |
676
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountAliases($accountName, \@newRecords)' |
677
|
|
|
|
|
|
|
unless defined $accountName && defined $newRecords; |
678
|
0
|
|
|
|
|
|
$this->send('SetAccountRPOP '.$accountName.' '.$this->printWords($newRecords)); |
679
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
680
|
|
|
|
|
|
|
} |
681
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
sub GetAccountRights { |
683
|
0
|
|
|
0
|
0
|
|
my ($this, $account) = @_; |
684
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountRights($account)' |
685
|
|
|
|
|
|
|
unless defined $account; |
686
|
0
|
|
|
|
|
|
$this->send('GetAccountRights '.$account); |
687
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
688
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
689
|
|
|
|
|
|
|
} |
690
|
|
|
|
|
|
|
|
691
|
|
|
|
|
|
|
sub SetAccountRights { |
692
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $list) = @_; |
693
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountRigthts($acount, \@list)' |
694
|
|
|
|
|
|
|
unless defined $account && defined $list; |
695
|
0
|
|
|
|
|
|
my $line = 'SetAccountRights '.$account.' '.$this->printWords($list); |
696
|
|
|
|
|
|
|
|
697
|
0
|
|
|
|
|
|
$this->send($line); |
698
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
699
|
|
|
|
|
|
|
} |
700
|
|
|
|
|
|
|
|
701
|
|
|
|
|
|
|
sub GetAccountInfo { |
702
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $key) = @_; |
703
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->GetAccountInfo($account,$key)' |
704
|
|
|
|
|
|
|
unless defined $account && defined $key; |
705
|
0
|
|
|
|
|
|
$this->send('GetAccountInfo '.$account.' Key '.$this->printWords($key)); |
706
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
707
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
708
|
|
|
|
|
|
|
} |
709
|
|
|
|
|
|
|
|
710
|
|
|
|
|
|
|
sub GetWebUser { |
711
|
0
|
|
|
0
|
0
|
|
my ($this, $account) = @_; |
712
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetWebUser($account)' |
713
|
|
|
|
|
|
|
unless defined $account; |
714
|
0
|
|
|
|
|
|
$this->send('GetWebUser '.$account); |
715
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
716
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
717
|
|
|
|
|
|
|
} |
718
|
|
|
|
|
|
|
|
719
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
sub GetAccountPrefs { |
721
|
0
|
|
|
0
|
0
|
|
my ($this, $account) = @_; |
722
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountPrefs($account)' |
723
|
|
|
|
|
|
|
unless defined $account; |
724
|
0
|
|
|
|
|
|
$this->send('GetAccountPrefs '.$account); |
725
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
726
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
727
|
|
|
|
|
|
|
} |
728
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
sub SetWebUser { |
730
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $settings) = @_; |
731
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetWebUser($acount, \%settings)' |
732
|
|
|
|
|
|
|
unless defined $account && defined $settings; |
733
|
0
|
|
|
|
|
|
my $line = 'SetWebUser '.$account.' '.$this->printWords($settings); |
734
|
|
|
|
|
|
|
|
735
|
0
|
|
|
|
|
|
$this->send($line); |
736
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
737
|
|
|
|
|
|
|
} |
738
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
sub SetAccountPrefs { |
740
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $settings) = @_; |
741
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountPrefs($acount, \%settings)' |
742
|
|
|
|
|
|
|
unless defined $account && defined $settings; |
743
|
0
|
|
|
|
|
|
my $line = 'SetAccountPrefs '.$account.' '.$this->printWords($settings); |
744
|
|
|
|
|
|
|
|
745
|
0
|
|
|
|
|
|
$this->send($line); |
746
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
747
|
|
|
|
|
|
|
} |
748
|
|
|
|
|
|
|
sub UpdateAccountPrefs { |
749
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $settings) = @_; |
750
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->UpdateAccountPrefs($acount, \%settings)' |
751
|
|
|
|
|
|
|
unless defined $account && defined $settings; |
752
|
0
|
|
|
|
|
|
my $line = 'UpdateAccountPrefs '.$account.' '.$this->printWords($settings); |
753
|
|
|
|
|
|
|
|
754
|
0
|
|
|
|
|
|
$this->send($line); |
755
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
756
|
|
|
|
|
|
|
} |
757
|
|
|
|
|
|
|
|
758
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
sub GetEffectiveWebUser { |
760
|
0
|
|
|
0
|
0
|
|
my ($this, $account) = @_; |
761
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetEffectiveWebUser($account)' |
762
|
|
|
|
|
|
|
unless defined $account; |
763
|
0
|
|
|
|
|
|
$this->send('GetEffectiveWebUser '.$account); |
764
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
765
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
766
|
|
|
|
|
|
|
} |
767
|
|
|
|
|
|
|
|
768
|
|
|
|
|
|
|
sub GetEffectiveAccountPrefs { |
769
|
0
|
|
|
0
|
0
|
|
my ($this, $account) = @_; |
770
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetEffectiveAccountPrefs($account)' |
771
|
|
|
|
|
|
|
unless defined $account; |
772
|
0
|
|
|
|
|
|
$this->send('GetEffectiveAccountPrefs '.$account); |
773
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
774
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
775
|
|
|
|
|
|
|
} |
776
|
|
|
|
|
|
|
|
777
|
|
|
|
|
|
|
|
778
|
|
|
|
|
|
|
sub KillAccountSessions { |
779
|
0
|
|
|
0
|
0
|
|
my ($this, $account) = @_; |
780
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->KillAccountSessions($account)' |
781
|
|
|
|
|
|
|
unless defined $account; |
782
|
0
|
|
|
|
|
|
$this->send('KillAccountSessions '.$account); |
783
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
784
|
|
|
|
|
|
|
} |
785
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
sub GetAccountACL { |
787
|
0
|
|
|
0
|
0
|
|
my ($this, $account,$authAccountName) = @_; |
788
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountACL($accountName [,authAccountName])' |
789
|
|
|
|
|
|
|
unless defined $account; |
790
|
|
|
|
|
|
|
|
791
|
0
|
|
|
|
|
|
my $line = 'GetAccountACL '.$account; |
792
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if($authAccountName); |
793
|
0
|
|
|
|
|
|
$this->send($line); |
794
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
795
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
796
|
|
|
|
|
|
|
} |
797
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
sub SetAccountACL { |
799
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $newACL,$authAccountName) = @_; |
800
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountACL($acountACL, \%newACL [,$authAccountName])' |
801
|
|
|
|
|
|
|
unless defined $account && defined $newACL; |
802
|
0
|
|
|
|
|
|
my $line = 'SetAccountACL '.$account; |
803
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if($authAccountName); |
804
|
0
|
|
|
|
|
|
$line.=' '.$this->printWords($newACL); |
805
|
0
|
|
|
|
|
|
$this->send($line); |
806
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
807
|
|
|
|
|
|
|
} |
808
|
|
|
|
|
|
|
|
809
|
|
|
|
|
|
|
sub GetAccountACLRights { |
810
|
0
|
|
|
0
|
0
|
|
my ($this, $account,$authAccountName) = @_; |
811
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->GetAccountACLRights($accountName ,authAccountName)' |
812
|
|
|
|
|
|
|
unless (defined $account && defined $authAccountName); |
813
|
|
|
|
|
|
|
|
814
|
0
|
|
|
|
|
|
my $line = 'GetAccountACLRights '.$account.' AUTH '.$authAccountName ; |
815
|
0
|
|
|
|
|
|
$this->send($line); |
816
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
817
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
818
|
|
|
|
|
|
|
} |
819
|
|
|
|
|
|
|
|
820
|
|
|
|
|
|
|
################################################################# |
821
|
|
|
|
|
|
|
# Group managent commands |
822
|
|
|
|
|
|
|
|
823
|
|
|
|
|
|
|
sub ListGroups { |
824
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
825
|
0
|
|
|
|
|
|
my $line = 'ListGroups'; |
826
|
0
|
0
|
|
|
|
|
$line .= ' '.$domainName if $domainName; |
827
|
0
|
|
|
|
|
|
$this->send($line); |
828
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
829
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
830
|
|
|
|
|
|
|
} |
831
|
|
|
|
|
|
|
|
832
|
|
|
|
|
|
|
sub CreateGroup { |
833
|
0
|
|
|
0
|
0
|
|
my ($this, $groupName, $params) = @_; |
834
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->CreateGroup($groupName[, \%params])' |
835
|
|
|
|
|
|
|
unless defined $groupName; |
836
|
0
|
|
|
|
|
|
my $line = 'CreateGroup '.$groupName; |
837
|
0
|
0
|
|
|
|
|
$line .= ' '.$this->printWords($params) if $params; |
838
|
0
|
|
|
|
|
|
$this->send($line); |
839
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
840
|
|
|
|
|
|
|
} |
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
sub RenameGroup { |
843
|
0
|
|
|
0
|
0
|
|
my ($this, $oldGroupName, $newGroupName) = @_; |
844
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameGroup($oldGroupName, $newGroupName)' |
845
|
|
|
|
|
|
|
unless defined $oldGroupName && defined $newGroupName; |
846
|
0
|
|
|
|
|
|
$this->send('RenameGroup '.$oldGroupName.' into '.$newGroupName); |
847
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
848
|
|
|
|
|
|
|
} |
849
|
|
|
|
|
|
|
|
850
|
|
|
|
|
|
|
sub DeleteGroup { |
851
|
0
|
|
|
0
|
0
|
|
my ($this, $groupName) = @_; |
852
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->DeleteGroup($groupName)' |
853
|
|
|
|
|
|
|
unless defined $groupName; |
854
|
0
|
|
|
|
|
|
$this->send('DeleteGroup '.$groupName); |
855
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
856
|
|
|
|
|
|
|
} |
857
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
sub GetGroup { |
859
|
0
|
|
|
0
|
0
|
|
my ($this, $groupName) = @_; |
860
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetGroup($groupName)' |
861
|
|
|
|
|
|
|
unless defined $groupName; |
862
|
0
|
|
|
|
|
|
$this->send('GetGroup '.$groupName); |
863
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
864
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
865
|
|
|
|
|
|
|
} |
866
|
|
|
|
|
|
|
|
867
|
|
|
|
|
|
|
sub SetGroup { |
868
|
0
|
|
|
0
|
0
|
|
my ($this, $groupName, $params) = @_; |
869
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetGroup($groupName, \%settings)' |
870
|
|
|
|
|
|
|
unless defined $groupName && defined $params; |
871
|
0
|
|
|
|
|
|
$this->send('SetGroup '.$groupName.' '.$this->printWords($params)); |
872
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
873
|
|
|
|
|
|
|
} |
874
|
|
|
|
|
|
|
|
875
|
|
|
|
|
|
|
|
876
|
|
|
|
|
|
|
################################################################# |
877
|
|
|
|
|
|
|
# Forwarder managent commands |
878
|
|
|
|
|
|
|
|
879
|
|
|
|
|
|
|
sub ListForwarders { |
880
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
881
|
0
|
|
|
|
|
|
my $line = 'ListForwarders'; |
882
|
0
|
0
|
|
|
|
|
$line .= ' ' .$domainName if $domainName; |
883
|
0
|
|
|
|
|
|
$this->send($line); |
884
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
885
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
886
|
|
|
|
|
|
|
} |
887
|
|
|
|
|
|
|
|
888
|
|
|
|
|
|
|
sub CreateForwarder { |
889
|
0
|
|
|
0
|
0
|
|
my ($this, $forwarderName, $address) = @_; |
890
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->CreateForwarder($forwarderName, $address)' |
891
|
|
|
|
|
|
|
unless defined $forwarderName && defined $address; |
892
|
0
|
|
|
|
|
|
$this->send('CreateForwarder '.$forwarderName.' TO '.$this->printWords($address)); |
893
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
894
|
|
|
|
|
|
|
} |
895
|
|
|
|
|
|
|
sub RenameForwarder { |
896
|
0
|
|
|
0
|
0
|
|
my ($this, $forwarderName, $newName) = @_; |
897
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameForwarder($forwarderName, $newName)' |
898
|
|
|
|
|
|
|
unless defined $forwarderName && defined $newName; |
899
|
0
|
|
|
|
|
|
$this->send('RenameForwarder '.$forwarderName.' into '.$newName); |
900
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
901
|
|
|
|
|
|
|
} |
902
|
|
|
|
|
|
|
|
903
|
|
|
|
|
|
|
sub DeleteForwarder { |
904
|
0
|
|
|
0
|
0
|
|
my ($this, $forwarderName) = @_; |
905
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->DeleteForwarder($forwarderName)' |
906
|
|
|
|
|
|
|
unless defined $forwarderName; |
907
|
0
|
|
|
|
|
|
$this->send('DeleteForwarder '.$forwarderName); |
908
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
909
|
|
|
|
|
|
|
} |
910
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
sub GetForwarder { |
912
|
0
|
|
|
0
|
0
|
|
my ($this, $forwarderName) = @_; |
913
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetForwarder($forwarderName)' |
914
|
|
|
|
|
|
|
unless defined $forwarderName; |
915
|
0
|
|
|
|
|
|
$this->send('GetForwarder '.$forwarderName); |
916
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
917
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
918
|
|
|
|
|
|
|
} |
919
|
|
|
|
|
|
|
sub FindForwarders { |
920
|
0
|
|
|
0
|
0
|
|
my ($this, $domain,$forwarderAddress) = @_; |
921
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->FindForwarders($domainName,$forwarderAddress)' |
922
|
|
|
|
|
|
|
unless (defined $domain && defined $forwarderAddress); |
923
|
0
|
|
|
|
|
|
$this->send('FindForwarders '.$domain.' TO '.$this->printWords($forwarderAddress)); |
924
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
925
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
926
|
|
|
|
|
|
|
} |
927
|
|
|
|
|
|
|
|
928
|
|
|
|
|
|
|
################################################################# |
929
|
|
|
|
|
|
|
# Domain managent commands |
930
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
sub ListDomains { |
932
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
933
|
0
|
|
|
|
|
|
$this->send('ListDomains'); |
934
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
935
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
936
|
|
|
|
|
|
|
} |
937
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
sub MainDomainName { |
939
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
940
|
0
|
|
|
|
|
|
$this->send('MainDomainName'); |
941
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
942
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
943
|
|
|
|
|
|
|
} |
944
|
|
|
|
|
|
|
|
945
|
|
|
|
|
|
|
sub GetDomainSettings { |
946
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
947
|
|
|
|
|
|
|
|
948
|
0
|
|
|
|
|
|
my $line = 'GetDomainSettings'; |
949
|
0
|
0
|
|
|
|
|
$line .= ' '.$domainName if($domainName); |
950
|
|
|
|
|
|
|
|
951
|
0
|
|
|
|
|
|
$this->send($line); |
952
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
953
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
954
|
|
|
|
|
|
|
} |
955
|
|
|
|
|
|
|
|
956
|
|
|
|
|
|
|
sub GetDomain { |
957
|
0
|
|
|
0
|
0
|
|
GetDomainSettings(@_); |
958
|
|
|
|
|
|
|
} |
959
|
|
|
|
|
|
|
|
960
|
|
|
|
|
|
|
sub GetDomainEffectiveSettings { |
961
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
962
|
0
|
|
|
|
|
|
my $line = 'GetDomainEffectiveSettings'; |
963
|
0
|
0
|
|
|
|
|
$line .= ' '.$domainName if($domainName); |
964
|
0
|
|
|
|
|
|
$this->send($line); |
965
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
966
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
967
|
|
|
|
|
|
|
} |
968
|
|
|
|
|
|
|
|
969
|
|
|
|
|
|
|
sub UpdateDomainSettings { |
970
|
0
|
|
|
0
|
0
|
|
my ($this) = shift; |
971
|
0
|
|
|
|
|
|
my %params = (@_); |
972
|
|
|
|
|
|
|
|
973
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->UpdateDomainSettings(domain => \'domainName\',settings => {settings})' |
974
|
|
|
|
|
|
|
unless exists $params{settings}; |
975
|
|
|
|
|
|
|
|
976
|
0
|
|
|
|
|
|
my $line = 'UpdateDomainSettings'; |
977
|
0
|
0
|
|
|
|
|
$line .= ' '.$params{domain} if exists $params{domain}; |
978
|
0
|
|
|
|
|
|
$this->send($line.' '.$this->printWords($params{settings})); |
979
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
980
|
|
|
|
|
|
|
} |
981
|
|
|
|
|
|
|
|
982
|
|
|
|
|
|
|
sub UpdateDomain { |
983
|
0
|
|
|
0
|
0
|
|
UpdateDomainSettings(@_); |
984
|
|
|
|
|
|
|
} |
985
|
|
|
|
|
|
|
|
986
|
|
|
|
|
|
|
sub SetDomainSettings { |
987
|
0
|
|
|
0
|
0
|
|
my ($this) = shift; |
988
|
0
|
|
|
|
|
|
my %params = (@_); |
989
|
|
|
|
|
|
|
|
990
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetDomainSettings(domain => \'domainName\',settings => {settings})' |
991
|
|
|
|
|
|
|
unless exists $params{settings}; |
992
|
|
|
|
|
|
|
|
993
|
0
|
|
|
|
|
|
my $line = 'SetDomainSettings'; |
994
|
0
|
0
|
|
|
|
|
$line .= ' '.$params{domain} if exists $params{domain}; |
995
|
0
|
|
|
|
|
|
$this->send($line.' '.$this->printWords($params{settings})); |
996
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
997
|
|
|
|
|
|
|
} |
998
|
|
|
|
|
|
|
|
999
|
|
|
|
|
|
|
sub SetDomain { |
1000
|
0
|
|
|
0
|
0
|
|
SetDomainSettings(@_); |
1001
|
|
|
|
|
|
|
} |
1002
|
|
|
|
|
|
|
|
1003
|
|
|
|
|
|
|
|
1004
|
|
|
|
|
|
|
sub CreateDomain { |
1005
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $params) = @_; |
1006
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->CreateDomain($domainName[, \%params])' |
1007
|
|
|
|
|
|
|
unless defined $domainName; |
1008
|
0
|
|
|
|
|
|
my $line = 'CreateDomain '.$domainName; |
1009
|
0
|
0
|
|
|
|
|
$line .= ' '.$this->printWords($params) if $params; |
1010
|
0
|
|
|
|
|
|
$this->send($line); |
1011
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1012
|
|
|
|
|
|
|
} |
1013
|
|
|
|
|
|
|
|
1014
|
|
|
|
|
|
|
sub RenameDomain { |
1015
|
0
|
|
|
0
|
0
|
|
my ($this, $oldDomainName, $newDomainName) = @_; |
1016
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameDomain($oldDomainName, $newDomainName)' |
1017
|
|
|
|
|
|
|
unless defined $oldDomainName && defined $newDomainName; |
1018
|
0
|
|
|
|
|
|
$this->send('RenameDomain '.$oldDomainName.' into '.$newDomainName ); |
1019
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1020
|
|
|
|
|
|
|
} |
1021
|
|
|
|
|
|
|
|
1022
|
|
|
|
|
|
|
sub DeleteDomain { |
1023
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $force) = @_; |
1024
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->DeleteDomain($domainName[, $force])' |
1025
|
|
|
|
|
|
|
unless defined $domainName; |
1026
|
0
|
|
|
|
|
|
my $line = 'DeleteDomain '.$domainName; |
1027
|
0
|
0
|
|
|
|
|
$line .= ' force' if $force; |
1028
|
0
|
|
|
|
|
|
$this->send($line); |
1029
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1030
|
|
|
|
|
|
|
} |
1031
|
|
|
|
|
|
|
|
1032
|
|
|
|
|
|
|
sub SuspendDomain { |
1033
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
1034
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SuspendDomain($domainName)' |
1035
|
|
|
|
|
|
|
unless defined $domainName; |
1036
|
0
|
|
|
|
|
|
$this->send('SuspendDomain '.$domainName); |
1037
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1038
|
|
|
|
|
|
|
} |
1039
|
|
|
|
|
|
|
sub ResumeDomain { |
1040
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
1041
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ResumeDomain($domainName)' |
1042
|
|
|
|
|
|
|
unless defined $domainName; |
1043
|
0
|
|
|
|
|
|
$this->send('ResumeDomain '.$domainName); |
1044
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1045
|
|
|
|
|
|
|
} |
1046
|
|
|
|
|
|
|
|
1047
|
|
|
|
|
|
|
sub CreateSharedDomain { |
1048
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $params) = @_; |
1049
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->CreateSharedDomain($domainName[, \%params])' |
1050
|
|
|
|
|
|
|
unless defined $domainName; |
1051
|
0
|
|
|
|
|
|
my $line = 'CreateSharedDomain '.$domainName; |
1052
|
0
|
0
|
|
|
|
|
$line .= ' '.$this->printWords($params) if $params; |
1053
|
0
|
|
|
|
|
|
$this->send($line); |
1054
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1055
|
|
|
|
|
|
|
} |
1056
|
|
|
|
|
|
|
|
1057
|
|
|
|
|
|
|
sub CreateDirectoryDomain { |
1058
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $params) = @_; |
1059
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->CreateDirectoryDomain($domainName[, \%params])' |
1060
|
|
|
|
|
|
|
unless defined $domainName; |
1061
|
0
|
|
|
|
|
|
my $line = 'CreateDirectoryDomain '.$domainName; |
1062
|
0
|
0
|
|
|
|
|
$line .= ' '.$this->printWords($params) if $params; |
1063
|
0
|
|
|
|
|
|
$this->send($line); |
1064
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1065
|
|
|
|
|
|
|
} |
1066
|
|
|
|
|
|
|
|
1067
|
|
|
|
|
|
|
sub ReloadDirectoryDomains { |
1068
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
1069
|
0
|
|
|
|
|
|
$this->send('ReloadDirectoryDomains'); |
1070
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1071
|
|
|
|
|
|
|
} |
1072
|
|
|
|
|
|
|
|
1073
|
|
|
|
|
|
|
sub GetDomainRules { |
1074
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
1075
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetDomainRules($domainName)' |
1076
|
|
|
|
|
|
|
unless defined $domainName; |
1077
|
0
|
|
|
|
|
|
$this->send('GetDomainRules '.$domainName); |
1078
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1079
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1080
|
|
|
|
|
|
|
} |
1081
|
|
|
|
|
|
|
|
1082
|
|
|
|
|
|
|
sub SetDomainRules { |
1083
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $rules) = @_; |
1084
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetDomainRules($domainName, \@rules)' |
1085
|
|
|
|
|
|
|
unless defined $domainName && defined $rules; |
1086
|
0
|
|
|
|
|
|
$this->send('SetDomainRules '.$domainName.' '.$this->printWords($rules)); |
1087
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1088
|
|
|
|
|
|
|
} |
1089
|
|
|
|
|
|
|
|
1090
|
|
|
|
|
|
|
sub GetDomainMailRules { |
1091
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
1092
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetDomainMailRules($domainName)' |
1093
|
|
|
|
|
|
|
unless defined $domainName; |
1094
|
0
|
|
|
|
|
|
$this->send('GetDomainMailRules '.$domainName); |
1095
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1096
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1097
|
|
|
|
|
|
|
} |
1098
|
|
|
|
|
|
|
|
1099
|
|
|
|
|
|
|
sub SetDomainMailRules { |
1100
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $rules) = @_; |
1101
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetDomainMailRules($domainName, \@rules)' |
1102
|
|
|
|
|
|
|
unless defined $domainName && defined $rules; |
1103
|
0
|
|
|
|
|
|
$this->send('SetDomainMailRules '.$domainName.' '.$this->printWords($rules)); |
1104
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1105
|
|
|
|
|
|
|
} |
1106
|
|
|
|
|
|
|
|
1107
|
|
|
|
|
|
|
#sub UpdateDomainMailRule { |
1108
|
|
|
|
|
|
|
# my ($this, $domainName, $rule) = @_; |
1109
|
|
|
|
|
|
|
# croak 'usage CGP::CLI->UpdateDomainMailRules($domainName, \@rule)' |
1110
|
|
|
|
|
|
|
# unless defined $domainName && defined $rule; |
1111
|
|
|
|
|
|
|
# $this->send('UpdateDomainMailRule '.$domainName.' '.$this->printWords($rule)); |
1112
|
|
|
|
|
|
|
# $this->_parseResponse(); |
1113
|
|
|
|
|
|
|
#} |
1114
|
|
|
|
|
|
|
sub GetDomainSignalRules { |
1115
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
1116
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetDomainSignalRules($domainName)' |
1117
|
|
|
|
|
|
|
unless defined $domainName; |
1118
|
0
|
|
|
|
|
|
$this->send('GetDomainSignalRules '.$domainName); |
1119
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1120
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1121
|
|
|
|
|
|
|
} |
1122
|
|
|
|
|
|
|
|
1123
|
|
|
|
|
|
|
sub SetDomainSignalRules { |
1124
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $rules) = @_; |
1125
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetDomainSignalRules($domainName, \@rules)' |
1126
|
|
|
|
|
|
|
unless defined $domainName && defined $rules; |
1127
|
0
|
|
|
|
|
|
$this->send('SetDomainSignalRules '.$domainName.' '.$this->printWords($rules)); |
1128
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1129
|
|
|
|
|
|
|
} |
1130
|
|
|
|
|
|
|
|
1131
|
|
|
|
|
|
|
#sub UpdateDomainSignalRule { |
1132
|
|
|
|
|
|
|
# my ($this, $domainName, $rule) = @_; |
1133
|
|
|
|
|
|
|
# croak 'usage CGP::CLI->UpdateDomainSignalRules($domainName, \@rule)' |
1134
|
|
|
|
|
|
|
# unless defined $domainName && defined $rule; |
1135
|
|
|
|
|
|
|
# $this->send('UpdateDomainSignalRule '.$domainName.' '.$this->printWords($rule)); |
1136
|
|
|
|
|
|
|
# $this->_parseResponse(); |
1137
|
|
|
|
|
|
|
#} |
1138
|
|
|
|
|
|
|
|
1139
|
|
|
|
|
|
|
|
1140
|
|
|
|
|
|
|
sub GetDomainAliases { |
1141
|
0
|
|
|
0
|
0
|
|
my ($this, $domain) = @_; |
1142
|
|
|
|
|
|
|
|
1143
|
0
|
|
|
|
|
|
my $line = 'GetDomainAliases'; |
1144
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if $domain; |
1145
|
0
|
|
|
|
|
|
$this->send($line); |
1146
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1147
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1148
|
|
|
|
|
|
|
} |
1149
|
|
|
|
|
|
|
|
1150
|
|
|
|
|
|
|
|
1151
|
|
|
|
|
|
|
sub SetDomainAliases { |
1152
|
0
|
|
|
0
|
0
|
|
my ($this, $domain, $aliases) = @_; |
1153
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetDomainAliases($domainName, \@aliases)' |
1154
|
|
|
|
|
|
|
unless defined $domain && defined $aliases; |
1155
|
0
|
|
|
|
|
|
$this->send('SetDomainAliases '.$domain.' '.$this->printWords($aliases)); |
1156
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1157
|
|
|
|
|
|
|
} |
1158
|
|
|
|
|
|
|
|
1159
|
|
|
|
|
|
|
sub ListAdminDomains { |
1160
|
0
|
|
|
0
|
0
|
|
my ($this, $domain) = @_; |
1161
|
0
|
|
|
|
|
|
my $line = 'ListAdminDomains'; |
1162
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if $domain; |
1163
|
0
|
|
|
|
|
|
$this->send($line); |
1164
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1165
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1166
|
|
|
|
|
|
|
} |
1167
|
|
|
|
|
|
|
|
1168
|
|
|
|
|
|
|
sub InsertDirectoryRecords { |
1169
|
0
|
|
|
0
|
0
|
|
my ($this, $domain) = @_; |
1170
|
0
|
|
|
|
|
|
my $line = 'InsertDirectoryRecords'; |
1171
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if $domain; |
1172
|
0
|
|
|
|
|
|
$this->send($line); |
1173
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1174
|
|
|
|
|
|
|
} |
1175
|
|
|
|
|
|
|
sub DeleteDirectoryRecords { |
1176
|
0
|
|
|
0
|
0
|
|
my ($this, $domain) = @_; |
1177
|
0
|
|
|
|
|
|
my $line = 'DeleteDirectoryRecords'; |
1178
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if $domain; |
1179
|
0
|
|
|
|
|
|
$this->send($line); |
1180
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1181
|
|
|
|
|
|
|
} |
1182
|
|
|
|
|
|
|
|
1183
|
|
|
|
|
|
|
sub GetServerTrustedCerts { |
1184
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1185
|
0
|
|
|
|
|
|
$this->send('GetServerTrustedCerts'); |
1186
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1187
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1188
|
|
|
|
|
|
|
} |
1189
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
sub SetServerTrustedCerts { |
1191
|
0
|
|
|
0
|
0
|
|
my ( $this, $certs ) = @_; |
1192
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetServerTrustedCerts(\@certs)' |
1193
|
|
|
|
|
|
|
unless defined $certs; |
1194
|
0
|
|
|
|
|
|
$this->send('SetServerTrustedCerts '.$this->printWords($certs)); |
1195
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1196
|
|
|
|
|
|
|
} |
1197
|
|
|
|
|
|
|
|
1198
|
|
|
|
|
|
|
sub GetClusterTrustedCerts { |
1199
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1200
|
0
|
|
|
|
|
|
$this->send('GetClusterTrustedCerts'); |
1201
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1202
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1203
|
|
|
|
|
|
|
} |
1204
|
|
|
|
|
|
|
|
1205
|
|
|
|
|
|
|
sub SetClusterTrustedCerts { |
1206
|
0
|
|
|
0
|
0
|
|
my ( $this, $certs ) = @_; |
1207
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterTrustedCerts(\@certs)' |
1208
|
|
|
|
|
|
|
unless defined $certs; |
1209
|
0
|
|
|
|
|
|
$this->send('SetClusterTrustedCerts '.$this->printWords($certs)); |
1210
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1211
|
|
|
|
|
|
|
} |
1212
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
|
1214
|
|
|
|
|
|
|
sub GetDirectoryIntegration { |
1215
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1216
|
0
|
|
|
|
|
|
$this->send('GetDirectoryIntegration'); |
1217
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1218
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1219
|
|
|
|
|
|
|
} |
1220
|
|
|
|
|
|
|
|
1221
|
|
|
|
|
|
|
sub SetDirectoryIntegration { |
1222
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1223
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetDirectoryIntegration(\%settings)' |
1224
|
|
|
|
|
|
|
unless defined $dict; |
1225
|
|
|
|
|
|
|
|
1226
|
0
|
|
|
|
|
|
$this->send('SetDirectoryIntegration '.$this->printWords($dict)); |
1227
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1228
|
|
|
|
|
|
|
} |
1229
|
|
|
|
|
|
|
|
1230
|
|
|
|
|
|
|
sub GetClusterDirectoryIntegration { |
1231
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1232
|
0
|
|
|
|
|
|
$this->send('GetClusterDirectoryIntegration'); |
1233
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1234
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1235
|
|
|
|
|
|
|
} |
1236
|
|
|
|
|
|
|
|
1237
|
|
|
|
|
|
|
sub SetClusterDirectoryIntegration { |
1238
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1239
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterDirectoryIntegration(\%settings)' |
1240
|
|
|
|
|
|
|
unless defined $dict; |
1241
|
|
|
|
|
|
|
|
1242
|
0
|
|
|
|
|
|
$this->send('SetClusterDirectoryIntegration '.$this->printWords($dict)); |
1243
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1244
|
|
|
|
|
|
|
} |
1245
|
|
|
|
|
|
|
|
1246
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
sub GetDomainDefaults { |
1248
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1249
|
0
|
|
|
|
|
|
$this->send('GetDomainDefaults'); |
1250
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1251
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1252
|
|
|
|
|
|
|
} |
1253
|
|
|
|
|
|
|
|
1254
|
|
|
|
|
|
|
sub UpdateDomainDefaults { |
1255
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1256
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->UpdateDomainDefaults(\%settings)' |
1257
|
|
|
|
|
|
|
unless defined $dict; |
1258
|
|
|
|
|
|
|
|
1259
|
0
|
|
|
|
|
|
$this->send('UpdateDomainDefaults '.$this->printWords($dict)); |
1260
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1261
|
|
|
|
|
|
|
} |
1262
|
|
|
|
|
|
|
|
1263
|
|
|
|
|
|
|
sub SetDomainDefaults { |
1264
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1265
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetDomainDefaults(\%settings)' |
1266
|
|
|
|
|
|
|
unless defined $dict; |
1267
|
0
|
|
|
|
|
|
$this->send('SetDomainDefaults '.$this->printWords($dict)); |
1268
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1269
|
|
|
|
|
|
|
} |
1270
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
sub GetClusterDomainDefaults { |
1272
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1273
|
0
|
|
|
|
|
|
$this->send('GetClusterDomainDefaults'); |
1274
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1275
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1276
|
|
|
|
|
|
|
} |
1277
|
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
|
sub UpdateClusterDomainDefaults { |
1279
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1280
|
0
|
|
|
|
|
|
$this->send('UpdateClusterDomainDefaults '.$this->printWords($dict)); |
1281
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1282
|
|
|
|
|
|
|
} |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
sub SetClusterDomainDefaults { |
1285
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1286
|
0
|
|
|
|
|
|
$this->send('SetClusterDomainDefaults '.$this->printWords($dict)); |
1287
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1288
|
|
|
|
|
|
|
} |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
sub GetAllAccountsDefaults { |
1292
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1293
|
0
|
|
|
|
|
|
$this->send('GetAllAccountsDefaults'); |
1294
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1295
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1296
|
|
|
|
|
|
|
} |
1297
|
|
|
|
|
|
|
|
1298
|
|
|
|
|
|
|
sub UpdateAllAccountsDefaults { |
1299
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1300
|
0
|
|
|
|
|
|
$this->send('UpdateAllAccountsDefaults '.$this->printWords($dict)); |
1301
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1302
|
|
|
|
|
|
|
} |
1303
|
|
|
|
|
|
|
|
1304
|
|
|
|
|
|
|
sub SetAllAccountsDefaults { |
1305
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1306
|
0
|
|
|
|
|
|
$this->send('SetAllAccountsDefaults '.$this->printWords($dict)); |
1307
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1308
|
|
|
|
|
|
|
} |
1309
|
|
|
|
|
|
|
|
1310
|
|
|
|
|
|
|
sub GetServerAccountDefaults { |
1311
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1312
|
0
|
|
|
|
|
|
$this->send('GetServerAccountDefaults'); |
1313
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1314
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1315
|
|
|
|
|
|
|
} |
1316
|
|
|
|
|
|
|
|
1317
|
|
|
|
|
|
|
sub UpdateServerAccountDefaults { |
1318
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1319
|
0
|
|
|
|
|
|
$this->send('UpdateServerAccountDefaults '.$this->printWords($dict)); |
1320
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1321
|
|
|
|
|
|
|
} |
1322
|
|
|
|
|
|
|
|
1323
|
|
|
|
|
|
|
sub SetServerAccountDefaults { |
1324
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1325
|
0
|
|
|
|
|
|
$this->send('SetServerAccountDefaults '.$this->printWords($dict)); |
1326
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1327
|
|
|
|
|
|
|
} |
1328
|
|
|
|
|
|
|
|
1329
|
|
|
|
|
|
|
sub GetClusterAccountDefaults { |
1330
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1331
|
0
|
|
|
|
|
|
$this->send('GetClusterAccountDefaults'); |
1332
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1333
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1334
|
|
|
|
|
|
|
} |
1335
|
|
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
sub UpdateClusterAccountDefaults { |
1337
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1338
|
0
|
|
|
|
|
|
$this->send('UpdateClusterAccountDefaults '.$this->printWords($dict)); |
1339
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1340
|
|
|
|
|
|
|
} |
1341
|
|
|
|
|
|
|
|
1342
|
|
|
|
|
|
|
sub SetClusterAccountDefaults { |
1343
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1344
|
0
|
|
|
|
|
|
$this->send('SetClusterAccountDefaults '.$this->printWords($dict)); |
1345
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1346
|
|
|
|
|
|
|
} |
1347
|
|
|
|
|
|
|
|
1348
|
|
|
|
|
|
|
sub GetServerWebUserDefaults { |
1349
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1350
|
0
|
|
|
|
|
|
$this->send('GetServerWebUserDefaults'); |
1351
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1352
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1353
|
|
|
|
|
|
|
} |
1354
|
|
|
|
|
|
|
sub GetServerAccountPrefs { |
1355
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1356
|
0
|
|
|
|
|
|
$this->send('GetServerAccountPrefs'); |
1357
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1358
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1359
|
|
|
|
|
|
|
} |
1360
|
|
|
|
|
|
|
|
1361
|
|
|
|
|
|
|
sub SetServerWebUserDefaults { |
1362
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1363
|
0
|
|
|
|
|
|
$this->send('SetServerWebUserDefaults '.$this->printWords($dict)); |
1364
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1365
|
|
|
|
|
|
|
} |
1366
|
|
|
|
|
|
|
sub SetServerAccountPrefs { |
1367
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1368
|
0
|
|
|
|
|
|
$this->send('SetServerAccountPrefs '.$this->printWords($dict)); |
1369
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1370
|
|
|
|
|
|
|
} |
1371
|
|
|
|
|
|
|
|
1372
|
|
|
|
|
|
|
sub GetClusterWebUserDefaults { |
1373
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1374
|
0
|
|
|
|
|
|
$this->send('GetClusterWebUserDefaults'); |
1375
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1376
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1377
|
|
|
|
|
|
|
} |
1378
|
|
|
|
|
|
|
sub GetClusterAccountPrefs { |
1379
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
1380
|
0
|
|
|
|
|
|
$this->send('GetClusterAccountPrefs'); |
1381
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1382
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1383
|
|
|
|
|
|
|
} |
1384
|
|
|
|
|
|
|
sub SetClusterWebUserDefaults { |
1385
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1386
|
0
|
|
|
|
|
|
$this->send('SetClusterWebUserDefaults '.$this->printWords($dict)); |
1387
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1388
|
|
|
|
|
|
|
} |
1389
|
|
|
|
|
|
|
sub SetClusterAccountPrefs { |
1390
|
0
|
|
|
0
|
0
|
|
my ( $this, $dict ) = @_; |
1391
|
0
|
|
|
|
|
|
$this->send('SetClusterAccountPrefs '.$this->printWords($dict)); |
1392
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1393
|
|
|
|
|
|
|
} |
1394
|
|
|
|
|
|
|
|
1395
|
|
|
|
|
|
|
sub GetDomainLocation { |
1396
|
0
|
|
|
0
|
0
|
|
my ( $this, $account ) = @_; |
1397
|
0
|
|
|
|
|
|
$this->send('GetDomainLocation '.$account); |
1398
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1399
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1400
|
|
|
|
|
|
|
} |
1401
|
|
|
|
|
|
|
|
1402
|
|
|
|
|
|
|
sub GetAccountLocation { |
1403
|
0
|
|
|
0
|
0
|
|
my ( $this, $account ) = @_; |
1404
|
0
|
|
|
|
|
|
$this->send('GetAccountLocation '.$account); |
1405
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1406
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1407
|
|
|
|
|
|
|
} |
1408
|
|
|
|
|
|
|
|
1409
|
|
|
|
|
|
|
sub ListServerTelnums { |
1410
|
0
|
|
|
0
|
0
|
|
my ($this, $limit,$filter) = @_; |
1411
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ListServerTelnums($limit[,$filter])' |
1412
|
|
|
|
|
|
|
unless defined $limit; |
1413
|
0
|
|
|
|
|
|
my $line = "ListServerTelnums"; |
1414
|
0
|
0
|
|
|
|
|
$line .= ' FILTER '.$this->printWords($filter) if defined $filter; |
1415
|
0
|
|
|
|
|
|
$line .= " $limit"; |
1416
|
0
|
|
|
|
|
|
$this->send($line); |
1417
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1418
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1419
|
|
|
|
|
|
|
} |
1420
|
|
|
|
|
|
|
|
1421
|
|
|
|
|
|
|
sub ListClusterTelnums { |
1422
|
0
|
|
|
0
|
0
|
|
my ($this, $limit,$filter) = @_; |
1423
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ListClusterTelnums($limit[,$filter])' |
1424
|
|
|
|
|
|
|
unless defined $limit; |
1425
|
0
|
|
|
|
|
|
my $line = "ListClusterTelnums"; |
1426
|
0
|
0
|
|
|
|
|
$line .= ' FILTER '.$this->printWords($filter) if defined $filter; |
1427
|
0
|
|
|
|
|
|
$line .= " $limit"; |
1428
|
0
|
|
|
|
|
|
$this->send($line); |
1429
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1430
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1431
|
|
|
|
|
|
|
} |
1432
|
|
|
|
|
|
|
|
1433
|
|
|
|
|
|
|
|
1434
|
|
|
|
|
|
|
sub GetAccountDefaults { |
1435
|
0
|
|
|
0
|
0
|
|
my ($this, $domain) = @_; |
1436
|
|
|
|
|
|
|
|
1437
|
0
|
|
|
|
|
|
my $line = 'GetAccountDefaults'; |
1438
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if($domain); |
1439
|
0
|
|
|
|
|
|
$this->send($line); |
1440
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1441
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1442
|
|
|
|
|
|
|
} |
1443
|
|
|
|
|
|
|
|
1444
|
|
|
|
|
|
|
sub UpdateAccountDefaults { |
1445
|
0
|
|
|
0
|
0
|
|
my ($this) = shift; |
1446
|
0
|
|
|
|
|
|
my %params = (@_); |
1447
|
|
|
|
|
|
|
|
1448
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->UpdateAccountDefaults(domain => \'domainName\',settings => {settings})' |
1449
|
|
|
|
|
|
|
unless exists $params{settings}; |
1450
|
|
|
|
|
|
|
|
1451
|
0
|
|
|
|
|
|
my $line = 'UpdateAccountDefaults'; |
1452
|
0
|
0
|
|
|
|
|
$line .= ' '.$params{domain} if exists $params{domain}; |
1453
|
|
|
|
|
|
|
|
1454
|
0
|
|
|
|
|
|
$this->send($line . ' ' . $this->printWords($params{settings})); |
1455
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1456
|
|
|
|
|
|
|
} |
1457
|
|
|
|
|
|
|
|
1458
|
|
|
|
|
|
|
sub SetAccountDefaults { |
1459
|
0
|
|
|
0
|
0
|
|
my ($this) = shift; |
1460
|
0
|
|
|
|
|
|
my %params = (@_); |
1461
|
|
|
|
|
|
|
|
1462
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetAccountDefaults(domain => \'domainName\',settings => {settings})' |
1463
|
|
|
|
|
|
|
unless exists $params{settings}; |
1464
|
|
|
|
|
|
|
|
1465
|
0
|
|
|
|
|
|
my $line = 'SetAccountDefaults'; |
1466
|
0
|
0
|
|
|
|
|
$line .= ' '.$params{domain} if exists $params{domain}; |
1467
|
|
|
|
|
|
|
|
1468
|
0
|
|
|
|
|
|
$this->send($line . ' ' . $this->printWords($params{settings})); |
1469
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1470
|
|
|
|
|
|
|
} |
1471
|
|
|
|
|
|
|
|
1472
|
|
|
|
|
|
|
sub GetWebUserDefaults { |
1473
|
0
|
|
|
0
|
0
|
|
my ($this, $domain) = @_; |
1474
|
|
|
|
|
|
|
|
1475
|
0
|
|
|
|
|
|
my $line = 'GetWebUserDefaults'; |
1476
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if($domain); |
1477
|
|
|
|
|
|
|
|
1478
|
0
|
|
|
|
|
|
$this->send($line); |
1479
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1480
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1481
|
|
|
|
|
|
|
} |
1482
|
|
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
sub GetAccountDefaultPrefs { |
1484
|
0
|
|
|
0
|
0
|
|
my ($this, $domain) = @_; |
1485
|
|
|
|
|
|
|
|
1486
|
0
|
|
|
|
|
|
my $line = 'GetAccountDefaultPrefs'; |
1487
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if($domain); |
1488
|
|
|
|
|
|
|
|
1489
|
0
|
|
|
|
|
|
$this->send($line); |
1490
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1491
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1492
|
|
|
|
|
|
|
} |
1493
|
|
|
|
|
|
|
|
1494
|
|
|
|
|
|
|
sub SetWebUserDefaults { |
1495
|
0
|
|
|
0
|
0
|
|
my ($this) = shift;; |
1496
|
0
|
|
|
|
|
|
my %params = (@_); |
1497
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetWebUserDefaults(domain => \'domainName\',settings => {settings})' |
1498
|
|
|
|
|
|
|
unless exists $params{settings}; |
1499
|
|
|
|
|
|
|
|
1500
|
0
|
|
|
|
|
|
my $line = 'SetWebUserDefaults'; |
1501
|
0
|
0
|
|
|
|
|
$line .= ' ' .$params{domain} if exists $params{domain}; |
1502
|
|
|
|
|
|
|
|
1503
|
0
|
|
|
|
|
|
$this->send($line . ' ' . $this->printWords($params{settings})); |
1504
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1505
|
|
|
|
|
|
|
} |
1506
|
|
|
|
|
|
|
sub SetAccountDefaultPrefs { |
1507
|
0
|
|
|
0
|
0
|
|
my ($this) = shift;; |
1508
|
0
|
|
|
|
|
|
my %params = (@_); |
1509
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetAccountDefaultPrefs(domain => \'domainName\',settings => {settings})' |
1510
|
|
|
|
|
|
|
unless exists $params{settings}; |
1511
|
|
|
|
|
|
|
|
1512
|
0
|
|
|
|
|
|
my $line = 'SetAccountDefaultPrefs'; |
1513
|
0
|
0
|
|
|
|
|
$line .= ' ' .$params{domain} if exists $params{domain}; |
1514
|
|
|
|
|
|
|
|
1515
|
0
|
|
|
|
|
|
$this->send($line . ' ' . $this->printWords($params{settings})); |
1516
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1517
|
|
|
|
|
|
|
} |
1518
|
|
|
|
|
|
|
|
1519
|
|
|
|
|
|
|
sub UpdateWebUserDefaults { |
1520
|
0
|
|
|
0
|
0
|
|
my ($this) = shift;; |
1521
|
0
|
|
|
|
|
|
my %params = (@_); |
1522
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->UpdateWebUserDefaults(domain => \'domainName\',settings => {settings})' |
1523
|
|
|
|
|
|
|
unless exists $params{settings}; |
1524
|
|
|
|
|
|
|
|
1525
|
0
|
|
|
|
|
|
my $line = 'UpdateWebUserDefaults'; |
1526
|
0
|
0
|
|
|
|
|
$line .= ' ' .$params{domain} if exists $params{domain}; |
1527
|
|
|
|
|
|
|
|
1528
|
0
|
|
|
|
|
|
$this->send($line . ' ' . $this->printWords($params{settings})); |
1529
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1530
|
|
|
|
|
|
|
} |
1531
|
|
|
|
|
|
|
sub UpdateAccountDefaultPrefs { |
1532
|
0
|
|
|
0
|
0
|
|
my ($this) = shift;; |
1533
|
0
|
|
|
|
|
|
my %params = (@_); |
1534
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->UpdateAccountDefaultPrefs(domain => \'domainName\',settings => {settings})' |
1535
|
|
|
|
|
|
|
unless exists $params{settings}; |
1536
|
|
|
|
|
|
|
|
1537
|
0
|
|
|
|
|
|
my $line = 'UpdateAccountDefaultPrefs'; |
1538
|
0
|
0
|
|
|
|
|
$line .= ' ' .$params{domain} if exists $params{domain}; |
1539
|
|
|
|
|
|
|
|
1540
|
0
|
|
|
|
|
|
$this->send($line . ' ' . $this->printWords($params{settings})); |
1541
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1542
|
|
|
|
|
|
|
} |
1543
|
|
|
|
|
|
|
|
1544
|
|
|
|
|
|
|
sub GetAccountTemplate { |
1545
|
0
|
|
|
0
|
0
|
|
my ($this, $domain) = @_; |
1546
|
|
|
|
|
|
|
|
1547
|
0
|
|
|
|
|
|
my $line = 'GetAccountTemplate'; |
1548
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if($domain); |
1549
|
|
|
|
|
|
|
|
1550
|
0
|
|
|
|
|
|
$this->send($line); |
1551
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1552
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1553
|
|
|
|
|
|
|
} |
1554
|
|
|
|
|
|
|
|
1555
|
|
|
|
|
|
|
sub UpdateAccountTemplate { |
1556
|
0
|
|
|
0
|
0
|
|
my ($this) = shift;; |
1557
|
0
|
|
|
|
|
|
my %params = (@_); |
1558
|
|
|
|
|
|
|
|
1559
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->UpdateAccountTemplate(domain => \'domainName\',settings => {settings})' |
1560
|
|
|
|
|
|
|
unless exists $params{settings}; |
1561
|
|
|
|
|
|
|
|
1562
|
0
|
|
|
|
|
|
my $line = 'UpdateAccountTemplate'; |
1563
|
0
|
0
|
|
|
|
|
$line .= ' '.$params{domain} if exists $params{domain}; |
1564
|
|
|
|
|
|
|
|
1565
|
0
|
|
|
|
|
|
$this->send($line.' '.$this->printWords($params{settings})); |
1566
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1567
|
|
|
|
|
|
|
} |
1568
|
|
|
|
|
|
|
|
1569
|
|
|
|
|
|
|
sub SetAccountTemplate { |
1570
|
0
|
|
|
0
|
0
|
|
my ($this) = shift;; |
1571
|
0
|
|
|
|
|
|
my %params = (@_); |
1572
|
|
|
|
|
|
|
|
1573
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetAccountTemplate(domain => \'domainName\',settings => {settings})' |
1574
|
|
|
|
|
|
|
unless exists $params{settings}; |
1575
|
|
|
|
|
|
|
|
1576
|
0
|
|
|
|
|
|
my $line = 'SetAccountTemplate'; |
1577
|
0
|
0
|
|
|
|
|
$line .= ' '.$params{domain} if exists $params{domain}; |
1578
|
|
|
|
|
|
|
|
1579
|
0
|
|
|
|
|
|
$this->send($line.' '.$this->printWords($params{settings})); |
1580
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1581
|
|
|
|
|
|
|
} |
1582
|
|
|
|
|
|
|
|
1583
|
|
|
|
|
|
|
################################################################# |
1584
|
|
|
|
|
|
|
# Mailbox managent commands |
1585
|
|
|
|
|
|
|
|
1586
|
|
|
|
|
|
|
sub ListMailboxes { |
1587
|
0
|
|
|
0
|
0
|
|
my ($this) = shift;; |
1588
|
0
|
|
|
|
|
|
my %params = (@_); |
1589
|
|
|
|
|
|
|
|
1590
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ListMailboxes(accountName => \'account\',filter => \'*\',authAccountName => \'extAccount\')' |
1591
|
|
|
|
|
|
|
unless exists $params{accountName}; |
1592
|
|
|
|
|
|
|
|
1593
|
0
|
|
|
|
|
|
my $line = 'ListMailboxes '.$params{accountName}; |
1594
|
0
|
0
|
|
|
|
|
$line .= ' FILTER '.$this->printWords($params{filter}) if exists $params{filter}; |
1595
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$params{authAccountName} if exists $params{authAccountName}; |
1596
|
|
|
|
|
|
|
|
1597
|
0
|
|
|
|
|
|
$this->send($line); |
1598
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1599
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1600
|
|
|
|
|
|
|
} |
1601
|
|
|
|
|
|
|
|
1602
|
|
|
|
|
|
|
sub CreateMailbox { |
1603
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$mailboxName,$authAccountName,$class) = @_; |
1604
|
|
|
|
|
|
|
|
1605
|
|
|
|
|
|
|
|
1606
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->CreateMailbox(accountName,mailboxName,[authAccountName],[class])' |
1607
|
|
|
|
|
|
|
unless (defined $accountName && defined $mailboxName); |
1608
|
|
|
|
|
|
|
|
1609
|
0
|
|
|
|
|
|
my $line = 'CREATEMAILBOX '.$accountName; |
1610
|
0
|
|
|
|
|
|
$line .= ' MAILBOX '.$this->printWords($mailboxName); |
1611
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if($authAccountName); |
1612
|
0
|
0
|
|
|
|
|
$line .= ' CLASS '.$class if($class); |
1613
|
|
|
|
|
|
|
|
1614
|
0
|
|
|
|
|
|
$this->send($line); |
1615
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1616
|
|
|
|
|
|
|
} |
1617
|
|
|
|
|
|
|
|
1618
|
|
|
|
|
|
|
sub RenameMailbox { |
1619
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$oldMailboxName,$newMailboxName,$authAccountName) = @_; |
1620
|
|
|
|
|
|
|
|
1621
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameMailbox(accountName,oldMailboxName,newMailboxName[,authAccountName])' |
|
|
|
0
|
|
|
|
|
1622
|
|
|
|
|
|
|
unless (defined $accountName && defined $oldMailboxName && defined $newMailboxName); |
1623
|
|
|
|
|
|
|
|
1624
|
0
|
|
|
|
|
|
my $line = 'RENAMEMAILBOX '.$accountName; |
1625
|
0
|
|
|
|
|
|
$line .= ' MAILBOX '.$this->printWords($oldMailboxName); |
1626
|
0
|
|
|
|
|
|
$line .= ' INTO '.$this->printWords($newMailboxName); |
1627
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if defined $authAccountName; |
1628
|
|
|
|
|
|
|
|
1629
|
0
|
|
|
|
|
|
$this->send($line); |
1630
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1631
|
|
|
|
|
|
|
} |
1632
|
|
|
|
|
|
|
|
1633
|
|
|
|
|
|
|
sub RenameMailboxes { |
1634
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$oldMailboxName,$newMailboxName,$authAccountName) = @_; |
1635
|
|
|
|
|
|
|
|
1636
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameMailboxes(accountName,oldMailboxName,newMailboxName[,authAccountName])' |
|
|
|
0
|
|
|
|
|
1637
|
|
|
|
|
|
|
unless (defined $accountName && defined $oldMailboxName && defined $newMailboxName); |
1638
|
|
|
|
|
|
|
|
1639
|
0
|
|
|
|
|
|
my $line = 'RENAMEMAILBOX '.$accountName; |
1640
|
0
|
|
|
|
|
|
$line .= ' MAILBOXES '.$this->printWords($oldMailboxName); |
1641
|
0
|
|
|
|
|
|
$line .= ' INTO '.$this->printWords($newMailboxName); |
1642
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if defined $authAccountName; |
1643
|
|
|
|
|
|
|
|
1644
|
0
|
|
|
|
|
|
$this->send($line); |
1645
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1646
|
|
|
|
|
|
|
} |
1647
|
|
|
|
|
|
|
|
1648
|
|
|
|
|
|
|
sub DeleteMailbox { |
1649
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$mailboxName,$authAccountName) = @_; |
1650
|
|
|
|
|
|
|
|
1651
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->DeleteMailbox(accountName,mailboxName[,authAccountName])' |
1652
|
|
|
|
|
|
|
unless (defined $accountName && defined $mailboxName); |
1653
|
|
|
|
|
|
|
|
1654
|
0
|
|
|
|
|
|
my $line = 'DELETEMAILBOX '.$accountName; |
1655
|
0
|
|
|
|
|
|
$line .= ' MAILBOX '.$this->printWords($mailboxName); |
1656
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if defined $authAccountName; |
1657
|
|
|
|
|
|
|
|
1658
|
0
|
|
|
|
|
|
$this->send($line); |
1659
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1660
|
|
|
|
|
|
|
} |
1661
|
|
|
|
|
|
|
|
1662
|
|
|
|
|
|
|
sub DeleteMailboxes { |
1663
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$mailboxName,$authAccountName) = @_; |
1664
|
|
|
|
|
|
|
|
1665
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->DeleteMailboxes(accountName,mailboxName[,authAccountName])' |
1666
|
|
|
|
|
|
|
unless (defined $accountName && defined $mailboxName); |
1667
|
|
|
|
|
|
|
|
1668
|
0
|
|
|
|
|
|
my $line = 'DELETEMAILBOX '.$accountName; |
1669
|
0
|
|
|
|
|
|
$line .= ' MAILBOXES '.$this->printWords($mailboxName); |
1670
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if defined $authAccountName; |
1671
|
|
|
|
|
|
|
|
1672
|
0
|
|
|
|
|
|
$this->send($line); |
1673
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1674
|
|
|
|
|
|
|
} |
1675
|
|
|
|
|
|
|
|
1676
|
|
|
|
|
|
|
sub GetMailboxInfo { |
1677
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$mailboxName,$authAccountName) = @_; |
1678
|
|
|
|
|
|
|
|
1679
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->GetMailboxInfo(accountName,mailboxName[,authAccountName])' |
1680
|
|
|
|
|
|
|
unless (defined $accountName && defined $mailboxName); |
1681
|
|
|
|
|
|
|
|
1682
|
0
|
|
|
|
|
|
my $line = 'GETMAILBOXINFO '.$accountName; |
1683
|
0
|
|
|
|
|
|
$line .= ' MAILBOX '.$this->printWords($mailboxName); |
1684
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if defined $authAccountName; |
1685
|
|
|
|
|
|
|
|
1686
|
0
|
|
|
|
|
|
$this->send($line); |
1687
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1688
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1689
|
|
|
|
|
|
|
} |
1690
|
|
|
|
|
|
|
|
1691
|
|
|
|
|
|
|
sub GetMailboxACL { |
1692
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$mailboxName,$authAccountName) = @_; |
1693
|
|
|
|
|
|
|
|
1694
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->GetMailboxACL(accountName,mailboxName[,authAccountName])' |
1695
|
|
|
|
|
|
|
unless (defined $accountName && defined $mailboxName); |
1696
|
|
|
|
|
|
|
|
1697
|
0
|
|
|
|
|
|
my $line = 'GETMAILBOXACL '.$accountName; |
1698
|
0
|
|
|
|
|
|
$line .= ' MAILBOX '.$this->printWords($mailboxName); |
1699
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if defined $authAccountName; |
1700
|
|
|
|
|
|
|
|
1701
|
0
|
|
|
|
|
|
$this->send($line); |
1702
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1703
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1704
|
|
|
|
|
|
|
} |
1705
|
|
|
|
|
|
|
|
1706
|
|
|
|
|
|
|
sub SetMailboxACL { |
1707
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$mailboxName,$newACL,$authAccountName) = @_; |
1708
|
|
|
|
|
|
|
|
1709
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetMailboxACL(accountName,mailboxName,\@newACL[,authAccountName])' |
|
|
|
0
|
|
|
|
|
1710
|
|
|
|
|
|
|
unless (defined $accountName && defined $mailboxName && defined $newACL); |
1711
|
|
|
|
|
|
|
|
1712
|
0
|
|
|
|
|
|
my $line = 'SETMAILBOXACL '.$accountName; |
1713
|
0
|
|
|
|
|
|
$line .= ' MAILBOX '.$this->printWords($mailboxName); |
1714
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if defined $authAccountName; |
1715
|
|
|
|
|
|
|
|
1716
|
0
|
|
|
|
|
|
$this->send($line.' '.$this->printWords($newACL)); |
1717
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1718
|
|
|
|
|
|
|
} |
1719
|
|
|
|
|
|
|
|
1720
|
|
|
|
|
|
|
|
1721
|
|
|
|
|
|
|
sub GetMailboxRights { |
1722
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$mailboxName,$authAccountName) = @_; |
1723
|
|
|
|
|
|
|
|
1724
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->GetMailboxRights(accountName,mailboxName,authAccountName)' |
|
|
|
0
|
|
|
|
|
1725
|
|
|
|
|
|
|
unless (defined $accountName && defined $mailboxName && defined $authAccountName); |
1726
|
|
|
|
|
|
|
|
1727
|
0
|
|
|
|
|
|
my $line = 'GETMAILBOXRIGHTS '.$accountName; |
1728
|
0
|
|
|
|
|
|
$line .= ' MAILBOX '.$this->printWords($mailboxName); |
1729
|
0
|
|
|
|
|
|
$line .= ' AUTH '.$authAccountName; |
1730
|
|
|
|
|
|
|
|
1731
|
0
|
|
|
|
|
|
$this->send($line); |
1732
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1733
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1734
|
|
|
|
|
|
|
} |
1735
|
|
|
|
|
|
|
|
1736
|
|
|
|
|
|
|
sub SetMailboxClass { |
1737
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$mailboxName,$class,$authAccountName) = @_; |
1738
|
|
|
|
|
|
|
|
1739
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetMailboxClass(accountName,mailboxName,class [,authAccountName])' |
|
|
|
0
|
|
|
|
|
1740
|
|
|
|
|
|
|
unless (defined $accountName && defined $mailboxName && defined $class); |
1741
|
|
|
|
|
|
|
|
1742
|
0
|
|
|
|
|
|
my $line = 'SetMailboxClass '.$accountName; |
1743
|
0
|
|
|
|
|
|
$line .= ' MAILBOX '.$this->printWords($mailboxName); |
1744
|
0
|
0
|
|
|
|
|
$line .= ' AUTH '.$authAccountName if(defined $authAccountName); |
1745
|
0
|
|
|
|
|
|
$line .= ' CLASS '.$class; |
1746
|
|
|
|
|
|
|
|
1747
|
0
|
|
|
|
|
|
$this->send($line); |
1748
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1749
|
|
|
|
|
|
|
} |
1750
|
|
|
|
|
|
|
|
1751
|
|
|
|
|
|
|
|
1752
|
|
|
|
|
|
|
sub GetAccountSubscription { |
1753
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName) = @_; |
1754
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountSubscription(accountName)' |
1755
|
|
|
|
|
|
|
unless defined $accountName; |
1756
|
|
|
|
|
|
|
|
1757
|
0
|
|
|
|
|
|
$this->send('GetAccountSubscription '.$accountName); |
1758
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1759
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1760
|
|
|
|
|
|
|
} |
1761
|
|
|
|
|
|
|
|
1762
|
|
|
|
|
|
|
sub SetAccountSubscription { |
1763
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$newSubscription) = @_; |
1764
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountSubscription(accountName,\%newSubscription)' |
1765
|
|
|
|
|
|
|
unless (defined $accountName && defined $newSubscription); |
1766
|
|
|
|
|
|
|
|
1767
|
0
|
|
|
|
|
|
$this->send('SetAccountSubscription '.$accountName.' '.$this->printWords($newSubscription)); |
1768
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1769
|
|
|
|
|
|
|
} |
1770
|
|
|
|
|
|
|
|
1771
|
|
|
|
|
|
|
sub GetMailboxAliases { |
1772
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName) = @_; |
1773
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetMailboxAliases(accountName)' |
1774
|
|
|
|
|
|
|
unless defined $accountName; |
1775
|
|
|
|
|
|
|
|
1776
|
0
|
|
|
|
|
|
$this->send('GetMailboxAliases '.$accountName); |
1777
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1778
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1779
|
|
|
|
|
|
|
} |
1780
|
|
|
|
|
|
|
|
1781
|
|
|
|
|
|
|
sub SetMailboxAliases { |
1782
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$newAliases) = @_; |
1783
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetMailboxAliases(accountName,\%newAliases)' |
1784
|
|
|
|
|
|
|
unless (defined $accountName && defined $newAliases); |
1785
|
|
|
|
|
|
|
|
1786
|
0
|
|
|
|
|
|
$this->send('SetMailboxAliases '.$accountName.' '.$this->printWords($newAliases)); |
1787
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1788
|
|
|
|
|
|
|
} |
1789
|
|
|
|
|
|
|
|
1790
|
|
|
|
|
|
|
|
1791
|
|
|
|
|
|
|
################################################################# |
1792
|
|
|
|
|
|
|
# Alerts Administration |
1793
|
|
|
|
|
|
|
|
1794
|
|
|
|
|
|
|
sub GetDomainAlerts { |
1795
|
0
|
|
|
0
|
0
|
|
my ($this, $domain) = @_; |
1796
|
|
|
|
|
|
|
|
1797
|
0
|
|
|
|
|
|
my $line = 'GetDomainAlerts'; |
1798
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if $domain; |
1799
|
0
|
|
|
|
|
|
$this->send($line); |
1800
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1801
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1802
|
|
|
|
|
|
|
} |
1803
|
|
|
|
|
|
|
|
1804
|
|
|
|
|
|
|
sub SetDomainAlerts { |
1805
|
0
|
|
|
0
|
0
|
|
my ($this, $domain, $alerts) = @_; |
1806
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetDomainAlerts($domainName, \@alerts)' |
1807
|
|
|
|
|
|
|
unless defined $domain && defined $alerts; |
1808
|
0
|
|
|
|
|
|
$this->send('SetDomainAlerts '.$domain.' '.$this->printWords($alerts)); |
1809
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1810
|
|
|
|
|
|
|
} |
1811
|
|
|
|
|
|
|
|
1812
|
|
|
|
|
|
|
sub PostDomainAlert { |
1813
|
0
|
|
|
0
|
0
|
|
my ($this, $domain, $alert) = @_; |
1814
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->PostDomainAlert($domainName, $alertString)' |
1815
|
|
|
|
|
|
|
unless defined $domain && defined $alert; |
1816
|
0
|
|
|
|
|
|
$this->send('PostDomainAlert '.$domain.' ALERT '.$this->printWords($alert)); |
1817
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1818
|
|
|
|
|
|
|
} |
1819
|
|
|
|
|
|
|
|
1820
|
|
|
|
|
|
|
sub RemoveDomainAlert { |
1821
|
0
|
|
|
0
|
0
|
|
my ($this, $domain, $timeStamp) = @_; |
1822
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RemoveDomainAlert($domainName, $timeStamp)' |
1823
|
|
|
|
|
|
|
unless defined $domain && defined $timeStamp; |
1824
|
0
|
|
|
|
|
|
$this->send('RemoveDomainAlert '.$domain.' ALERT '.$timeStamp); |
1825
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1826
|
|
|
|
|
|
|
} |
1827
|
|
|
|
|
|
|
|
1828
|
|
|
|
|
|
|
sub GetAccountAlerts { |
1829
|
0
|
|
|
0
|
0
|
|
my ($this, $account) = @_; |
1830
|
0
|
|
|
|
|
|
$this->send('GetAccountAlerts '.$account); |
1831
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1832
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1833
|
|
|
|
|
|
|
} |
1834
|
|
|
|
|
|
|
|
1835
|
|
|
|
|
|
|
sub SetAccountAlerts { |
1836
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $alerts) = @_; |
1837
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetAccountAlerts($account, \@alerts)' |
1838
|
|
|
|
|
|
|
unless defined $account && defined $alerts; |
1839
|
0
|
|
|
|
|
|
$this->send('SetAccountAlerts '.$account.' '.$this->printWords($alerts)); |
1840
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1841
|
|
|
|
|
|
|
} |
1842
|
|
|
|
|
|
|
|
1843
|
|
|
|
|
|
|
sub PostAccountAlert { |
1844
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $alert) = @_; |
1845
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->PostAccountAlert($account, $alertString)' |
1846
|
|
|
|
|
|
|
unless defined $account && defined $alert; |
1847
|
0
|
|
|
|
|
|
$this->send('PostAccountAlert '.$account.' ALERT '.$this->printWords($alert)); |
1848
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1849
|
|
|
|
|
|
|
} |
1850
|
|
|
|
|
|
|
|
1851
|
|
|
|
|
|
|
sub RemoveAccountAlert { |
1852
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $timeStamp) = @_; |
1853
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RemoveAccountAlert($account, $timeStamp)' |
1854
|
|
|
|
|
|
|
unless defined $account && defined $timeStamp; |
1855
|
0
|
|
|
|
|
|
$this->send('RemoveAccountAlert '.$account.' ALERT '.$timeStamp); |
1856
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1857
|
|
|
|
|
|
|
} |
1858
|
|
|
|
|
|
|
|
1859
|
|
|
|
|
|
|
|
1860
|
|
|
|
|
|
|
sub GetServerAlerts { |
1861
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
1862
|
0
|
|
|
|
|
|
$this->send('GetServerAlerts'); |
1863
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1864
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1865
|
|
|
|
|
|
|
} |
1866
|
|
|
|
|
|
|
|
1867
|
|
|
|
|
|
|
sub SetServerAlerts { |
1868
|
0
|
|
|
0
|
0
|
|
my ($this, $alerts) = @_; |
1869
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetServerAlerts(\@alerts)' |
1870
|
|
|
|
|
|
|
unless defined $alerts; |
1871
|
0
|
|
|
|
|
|
$this->send('SetServerAlerts '.$this->printWords($alerts)); |
1872
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1873
|
|
|
|
|
|
|
} |
1874
|
|
|
|
|
|
|
|
1875
|
|
|
|
|
|
|
sub PostServerAlert { |
1876
|
0
|
|
|
0
|
0
|
|
my ($this, $alert) = @_; |
1877
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->PostServerAlert($alertString)' |
1878
|
|
|
|
|
|
|
unless defined $alert; |
1879
|
0
|
|
|
|
|
|
$this->send('PostServerAlert '.$this->printWords($alert)); |
1880
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1881
|
|
|
|
|
|
|
} |
1882
|
|
|
|
|
|
|
|
1883
|
|
|
|
|
|
|
sub RemoveServerAlert { |
1884
|
0
|
|
|
0
|
0
|
|
my ($this, $timeStamp) = @_; |
1885
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->RemoveServerAlert($timeStamp)' |
1886
|
|
|
|
|
|
|
unless defined $timeStamp; |
1887
|
0
|
|
|
|
|
|
$this->send('RemoveServerAlert '.$timeStamp); |
1888
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1889
|
|
|
|
|
|
|
} |
1890
|
|
|
|
|
|
|
|
1891
|
|
|
|
|
|
|
sub GetClusterAlerts { |
1892
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
1893
|
0
|
|
|
|
|
|
$this->send('GetClusterAlerts'); |
1894
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
1895
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1896
|
|
|
|
|
|
|
} |
1897
|
|
|
|
|
|
|
|
1898
|
|
|
|
|
|
|
sub SetClusterAlerts { |
1899
|
0
|
|
|
0
|
0
|
|
my ($this, $alerts) = @_; |
1900
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterAlerts(\@alerts)' |
1901
|
|
|
|
|
|
|
unless defined $alerts; |
1902
|
0
|
|
|
|
|
|
$this->send('SetClusterAlerts '.$this->printWords($alerts)); |
1903
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1904
|
|
|
|
|
|
|
} |
1905
|
|
|
|
|
|
|
|
1906
|
|
|
|
|
|
|
sub PostClusterAlert { |
1907
|
0
|
|
|
0
|
0
|
|
my ($this, $alert) = @_; |
1908
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->PostClusterAlert($alertString)' |
1909
|
|
|
|
|
|
|
unless defined $alert; |
1910
|
0
|
|
|
|
|
|
$this->send('PostClusterAlert '.$this->printWords($alert)); |
1911
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1912
|
|
|
|
|
|
|
} |
1913
|
|
|
|
|
|
|
|
1914
|
|
|
|
|
|
|
sub RemoveClusterAlert { |
1915
|
0
|
|
|
0
|
0
|
|
my ($this, $timeStamp) = @_; |
1916
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->RemoveClusterAlert($timeStamp)' |
1917
|
|
|
|
|
|
|
unless defined $timeStamp; |
1918
|
0
|
|
|
|
|
|
$this->send('RemoveClusterAlert '.$timeStamp); |
1919
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
1920
|
|
|
|
|
|
|
} |
1921
|
|
|
|
|
|
|
|
1922
|
|
|
|
|
|
|
################################################################# |
1923
|
|
|
|
|
|
|
# Personal Web Site Administration |
1924
|
|
|
|
|
|
|
|
1925
|
|
|
|
|
|
|
sub GetWebFile { |
1926
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$fileName,$position,$sliceSize) = @_; |
1927
|
|
|
|
|
|
|
|
1928
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->GetWebFile(accountName,fileName[,position,sliceSize])' |
1929
|
|
|
|
|
|
|
unless (defined $accountName && defined $fileName); |
1930
|
0
|
|
|
|
|
|
my $line='GetWebFile '.$accountName.' FILE '.$this->printWords($fileName); |
1931
|
0
|
0
|
0
|
|
|
|
$line .= ' OFFSET '. $position if(defined $position && $position!=0); |
1932
|
0
|
0
|
|
|
|
|
$line .= ' SIZE '. $sliceSize if(defined $sliceSize); |
1933
|
|
|
|
|
|
|
|
1934
|
0
|
|
|
|
|
|
$this->send($line); |
1935
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse; |
1936
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1937
|
|
|
|
|
|
|
} |
1938
|
|
|
|
|
|
|
|
1939
|
|
|
|
|
|
|
sub PutWebFile { |
1940
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$fileName,$data,$position) = @_; |
1941
|
|
|
|
|
|
|
|
1942
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->PutWebFile(accountName,fileName,data [,position])' |
|
|
|
0
|
|
|
|
|
1943
|
|
|
|
|
|
|
unless (defined $accountName && defined $fileName && defined $data); |
1944
|
0
|
|
|
|
|
|
my $line='PutWebFile '.$accountName.' FILE '.$this->printWords($fileName); |
1945
|
0
|
0
|
0
|
|
|
|
$line .= ' OFFSET '. $position if(defined $position && $position!=0); |
1946
|
|
|
|
|
|
|
|
1947
|
0
|
|
|
|
|
|
$line .= ' DATA ['.$data.']'; |
1948
|
|
|
|
|
|
|
|
1949
|
0
|
|
|
|
|
|
$this->send($line); |
1950
|
0
|
|
|
|
|
|
$this->_parseResponse; |
1951
|
|
|
|
|
|
|
} |
1952
|
|
|
|
|
|
|
|
1953
|
|
|
|
|
|
|
sub RenameWebFile { |
1954
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$oldFileName,$newFileName) = @_; |
1955
|
|
|
|
|
|
|
|
1956
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameWebFile(accountName,oldFileName,newFileName)' |
|
|
|
0
|
|
|
|
|
1957
|
|
|
|
|
|
|
unless (defined $accountName && defined $oldFileName && defined $newFileName); |
1958
|
0
|
|
|
|
|
|
$this->send('RenameWebFile '.$accountName.' FILE '.$this->printWords($oldFileName).' INTO '.$this->printWords($newFileName)); |
1959
|
0
|
|
|
|
|
|
$this->_parseResponse; |
1960
|
|
|
|
|
|
|
} |
1961
|
|
|
|
|
|
|
|
1962
|
|
|
|
|
|
|
sub DeleteWebFile { |
1963
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$fileName) = @_; |
1964
|
|
|
|
|
|
|
|
1965
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->DeleteWebFile(accountName,fileName)' |
1966
|
|
|
|
|
|
|
unless (defined $accountName && defined $fileName); |
1967
|
0
|
|
|
|
|
|
$this->send('DeleteWebFile '.$accountName.' FILE '.$this->printWords($fileName)); |
1968
|
0
|
|
|
|
|
|
$this->_parseResponse; |
1969
|
|
|
|
|
|
|
} |
1970
|
|
|
|
|
|
|
|
1971
|
|
|
|
|
|
|
sub ListWebFiles { |
1972
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName,$filePath) = @_; |
1973
|
|
|
|
|
|
|
|
1974
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ListWebFiles(accountName [,filePath])' |
1975
|
|
|
|
|
|
|
unless defined $accountName; |
1976
|
0
|
|
|
|
|
|
my $line = 'ListWebFiles '.$accountName; |
1977
|
0
|
0
|
|
|
|
|
$line .= ' PATH '.$this->printWords($filePath) if $filePath; |
1978
|
0
|
|
|
|
|
|
$this->send($line); |
1979
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse; |
1980
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1981
|
|
|
|
|
|
|
} |
1982
|
|
|
|
|
|
|
|
1983
|
|
|
|
|
|
|
sub GetWebFilesInfo { |
1984
|
0
|
|
|
0
|
0
|
|
my ($this,$accountName) = @_; |
1985
|
|
|
|
|
|
|
|
1986
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->InfoWebFiles(accountName)' |
1987
|
|
|
|
|
|
|
unless defined $accountName; |
1988
|
0
|
|
|
|
|
|
$this->send('GetWebFilesInfo '.$accountName); |
1989
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse; |
1990
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
1991
|
|
|
|
|
|
|
} |
1992
|
|
|
|
|
|
|
|
1993
|
|
|
|
|
|
|
################################################################# |
1994
|
|
|
|
|
|
|
# List management commands |
1995
|
|
|
|
|
|
|
|
1996
|
|
|
|
|
|
|
sub ListLists { |
1997
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain ) = @_; |
1998
|
0
|
|
|
|
|
|
my $line = 'LISTLISTS'; |
1999
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if $domain; |
2000
|
0
|
|
|
|
|
|
$this->send($line); |
2001
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse; |
2002
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2003
|
|
|
|
|
|
|
} |
2004
|
|
|
|
|
|
|
|
2005
|
|
|
|
|
|
|
sub GetDomainLists { |
2006
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain ) = @_; |
2007
|
0
|
|
|
|
|
|
my $line = 'GetDomainLists'; |
2008
|
0
|
0
|
|
|
|
|
$line .= ' '.$domain if $domain; |
2009
|
0
|
|
|
|
|
|
$this->send($line); |
2010
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse; |
2011
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2012
|
|
|
|
|
|
|
} |
2013
|
|
|
|
|
|
|
|
2014
|
|
|
|
|
|
|
sub GetAccountLists { |
2015
|
0
|
|
|
0
|
0
|
|
my ( $this, $accountName ) = @_; |
2016
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccoountLists($accountName)' |
2017
|
|
|
|
|
|
|
unless defined $accountName; |
2018
|
|
|
|
|
|
|
|
2019
|
0
|
|
|
|
|
|
$this->send('GetAccountLists '.$accountName); |
2020
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse; |
2021
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2022
|
|
|
|
|
|
|
} |
2023
|
|
|
|
|
|
|
|
2024
|
|
|
|
|
|
|
sub CreateList { |
2025
|
0
|
|
|
0
|
0
|
|
my ($this, $listName, $accountName) = @_; |
2026
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->CreateList($listName, $accountName)' |
2027
|
|
|
|
|
|
|
unless defined $listName && defined $accountName; |
2028
|
0
|
|
|
|
|
|
$this->send('CREATELIST '.$listName.' for '.$accountName); |
2029
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2030
|
|
|
|
|
|
|
} |
2031
|
|
|
|
|
|
|
|
2032
|
|
|
|
|
|
|
sub RenameList { |
2033
|
0
|
|
|
0
|
0
|
|
my ($this, $oldListName, $newListName) = @_; |
2034
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameList($oldListName, $newListName)' |
2035
|
|
|
|
|
|
|
unless defined $oldListName && defined $newListName; |
2036
|
0
|
|
|
|
|
|
$this->send('RENAMELIST '.$oldListName.' into '.$newListName); |
2037
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2038
|
|
|
|
|
|
|
} |
2039
|
|
|
|
|
|
|
|
2040
|
|
|
|
|
|
|
sub DeleteList { |
2041
|
0
|
|
|
0
|
0
|
|
my ( $this, $listName ) = @_; |
2042
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->DeleteList($listName)' |
2043
|
|
|
|
|
|
|
unless defined $listName; |
2044
|
|
|
|
|
|
|
|
2045
|
0
|
|
|
|
|
|
$this->send('DELETELIST '.$listName); |
2046
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2047
|
|
|
|
|
|
|
} |
2048
|
|
|
|
|
|
|
|
2049
|
|
|
|
|
|
|
sub GetList { |
2050
|
0
|
|
|
0
|
0
|
|
my ( $this, $listName ) = @_; |
2051
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetList($listName)' |
2052
|
|
|
|
|
|
|
unless defined $listName; |
2053
|
|
|
|
|
|
|
|
2054
|
0
|
|
|
|
|
|
$this->send('GETLIST '.$listName); |
2055
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2056
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2057
|
|
|
|
|
|
|
} |
2058
|
|
|
|
|
|
|
|
2059
|
|
|
|
|
|
|
sub UpdateList { |
2060
|
0
|
|
|
0
|
0
|
|
my ( $this, $listName, $dict ) = @_; |
2061
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->UpdateList($listName,\%params)' |
2062
|
|
|
|
|
|
|
unless defined $listName && defined $dict; |
2063
|
|
|
|
|
|
|
|
2064
|
0
|
|
|
|
|
|
$this->send('UPDATELIST '.$listName.' '.$this->printWords($dict) ); |
2065
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2066
|
|
|
|
|
|
|
} |
2067
|
|
|
|
|
|
|
|
2068
|
|
|
|
|
|
|
sub List { |
2069
|
0
|
|
|
0
|
0
|
|
my ( $this, $listName, $command, $subscriber, @options ) = @_; |
2070
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->List($listName, $command, $subscriber, @options)' |
|
|
|
0
|
|
|
|
|
2071
|
|
|
|
|
|
|
unless defined $listName && defined $command && defined $subscriber; |
2072
|
|
|
|
|
|
|
|
2073
|
0
|
|
|
|
|
|
$this->send('LIST '.$listName.' '.$command.' '.join(' ',@options).' '.$subscriber); |
2074
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2075
|
|
|
|
|
|
|
} |
2076
|
|
|
|
|
|
|
|
2077
|
|
|
|
|
|
|
sub ListSubscribers { |
2078
|
0
|
|
|
0
|
0
|
|
my ( $this, $listName,$filter,$limit ) = @_; |
2079
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ListSubscribers($listName [,$filter[,$limit]])' |
2080
|
|
|
|
|
|
|
unless defined $listName; |
2081
|
|
|
|
|
|
|
|
2082
|
0
|
|
|
|
|
|
my $line = 'ListSubscribers '.$listName; |
2083
|
0
|
0
|
0
|
|
|
|
$line .= ' FILTER '. ($filter eq '' ? '""' : $this->printWords($filter)) if($filter || $limit); |
|
|
0
|
|
|
|
|
|
2084
|
0
|
0
|
|
|
|
|
$line .= " $limit" if($limit); |
2085
|
|
|
|
|
|
|
|
2086
|
0
|
|
|
|
|
|
$this->send($line ); |
2087
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2088
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2089
|
|
|
|
|
|
|
} |
2090
|
|
|
|
|
|
|
|
2091
|
|
|
|
|
|
|
sub GetSubscriberInfo { |
2092
|
0
|
|
|
0
|
0
|
|
my ( $this, $listName,$address ) = @_; |
2093
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->GetSubscriberInfo($listName ,$subscriberAddress)' |
2094
|
|
|
|
|
|
|
unless defined $listName && defined $address; |
2095
|
0
|
|
|
|
|
|
$this->send('GetSubscriberInfo '.$listName.' NAME '.$address); |
2096
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2097
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2098
|
|
|
|
|
|
|
} |
2099
|
|
|
|
|
|
|
|
2100
|
|
|
|
|
|
|
sub SetPostingMode { |
2101
|
0
|
|
|
0
|
0
|
|
my ($this, $listName, $address, $mode) = @_; |
2102
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetPostingMode($listName,$subscriberAddress,$mode)' |
|
|
|
0
|
|
|
|
|
2103
|
|
|
|
|
|
|
unless defined $listName && defined $address && defined $mode; |
2104
|
0
|
|
|
|
|
|
$this->send('SetPostingMode '.$listName.' FOR '.$address.' '.$mode); |
2105
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2106
|
|
|
|
|
|
|
} |
2107
|
|
|
|
|
|
|
|
2108
|
|
|
|
|
|
|
sub ProcessBounce { |
2109
|
0
|
|
|
0
|
0
|
|
my ($this, $listName, $address, $fatal) = @_; |
2110
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->ProcessBounce($listName,$subscriberAddress,"fatal")' |
2111
|
|
|
|
|
|
|
unless defined $listName && defined $address; |
2112
|
0
|
|
|
|
|
|
my $line = 'ProcessBounce '.$listName; |
2113
|
0
|
0
|
|
|
|
|
$line .= ' FATAL' if($fatal); |
2114
|
0
|
|
|
|
|
|
$this->send($line. ' FOR '.$address); |
2115
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2116
|
|
|
|
|
|
|
} |
2117
|
|
|
|
|
|
|
|
2118
|
|
|
|
|
|
|
############################################# |
2119
|
|
|
|
|
|
|
# Web Skins Administration |
2120
|
|
|
|
|
|
|
|
2121
|
|
|
|
|
|
|
sub ListDomainSkins { |
2122
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
2123
|
0
|
|
|
|
|
|
my $line = 'ListDomainSkins'; |
2124
|
0
|
0
|
|
|
|
|
$line .= ' '.$domainName if($domainName); |
2125
|
0
|
|
|
|
|
|
$this->send($line); |
2126
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2127
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2128
|
|
|
|
|
|
|
} |
2129
|
|
|
|
|
|
|
|
2130
|
|
|
|
|
|
|
sub CreateDomainSkin { |
2131
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $skin ) = @_; |
2132
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->CreateDomainSkin($domainName,$skinName)' |
2133
|
|
|
|
|
|
|
unless defined $domain && defined $skin; |
2134
|
|
|
|
|
|
|
|
2135
|
0
|
|
|
|
|
|
$this->send('CreateDomainSkin '.$domain.' SKIN '.$this->printWords($skin)); |
2136
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2137
|
|
|
|
|
|
|
} |
2138
|
|
|
|
|
|
|
|
2139
|
|
|
|
|
|
|
sub RenameDomainSkin { |
2140
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $skin, $newName ) = @_; |
2141
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameDomainSkin($domainName,$oldSkinName,$newSkinName)' |
|
|
|
0
|
|
|
|
|
2142
|
|
|
|
|
|
|
unless defined $domain && defined $skin && defined $newName; |
2143
|
|
|
|
|
|
|
|
2144
|
0
|
|
|
|
|
|
$this->send('RenameDomainSkin '.$domain.' SKIN '.$this->printWords($skin).' INTO '.$this->printWords($newName)); |
2145
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2146
|
|
|
|
|
|
|
} |
2147
|
|
|
|
|
|
|
|
2148
|
|
|
|
|
|
|
sub DeleteDomainSkin { |
2149
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $skin ) = @_; |
2150
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->DeleteDomainSkin($domainName,$skinName)' |
2151
|
|
|
|
|
|
|
unless defined $domain && defined $skin; |
2152
|
|
|
|
|
|
|
|
2153
|
0
|
|
|
|
|
|
$this->send('DeleteDomainSkin '.$domain.' SKIN '.$this->printWords($skin)); |
2154
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2155
|
|
|
|
|
|
|
} |
2156
|
|
|
|
|
|
|
|
2157
|
|
|
|
|
|
|
sub ListDomainSkinFiles { |
2158
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $skin ) = @_; |
2159
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->ListDomainSkinFiles($domainName,$skinName)' |
2160
|
|
|
|
|
|
|
unless defined $domain && defined $skin; |
2161
|
|
|
|
|
|
|
|
2162
|
0
|
|
|
|
|
|
$this->send('ListDomainSkinFiles '.$domain.' SKIN '.$this->printWords($skin)); |
2163
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2164
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2165
|
|
|
|
|
|
|
} |
2166
|
|
|
|
|
|
|
|
2167
|
|
|
|
|
|
|
sub ReadDomainSkinFile { |
2168
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $skin, $fileName ) = @_; |
2169
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->ReadDomainSkinFile($domainName,$skinName,$fileName)' |
|
|
|
0
|
|
|
|
|
2170
|
|
|
|
|
|
|
unless defined $domain && defined $skin && defined $fileName; |
2171
|
|
|
|
|
|
|
|
2172
|
0
|
|
|
|
|
|
$this->send('ReadDomainSkinFile '.$domain.' SKIN '.$this->printWords($skin).' FILE '.$this->printWords($fileName)); |
2173
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2174
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2175
|
|
|
|
|
|
|
} |
2176
|
|
|
|
|
|
|
|
2177
|
|
|
|
|
|
|
sub StoreDomainSkinFile { |
2178
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $skin, $fileName,$base64data ) = @_; |
2179
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->StoreDomainSkinFile($domainName,$skinName,$fileName,$base64data)' |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2180
|
|
|
|
|
|
|
unless defined $domain && defined $skin && defined $fileName && defined $base64data; |
2181
|
0
|
|
|
|
|
|
$this->send('StoreDomainSkinFile '.$domain.' SKIN '.$this->printWords($skin).' FILE '.$this->printWords($fileName).' DATA ['.$base64data.']'); |
2182
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2183
|
|
|
|
|
|
|
} |
2184
|
|
|
|
|
|
|
|
2185
|
|
|
|
|
|
|
sub DeleteDomainSkinFile { |
2186
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $skin, $fileName ) = @_; |
2187
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->DeleteDomainSkinFile($domainName,$skinName,$fileName)' |
|
|
|
0
|
|
|
|
|
2188
|
|
|
|
|
|
|
unless defined $domain && defined $skin && defined $fileName; |
2189
|
|
|
|
|
|
|
|
2190
|
0
|
|
|
|
|
|
$this->send('StoreDomainSkinFile '.$domain.' SKIN '.$this->printWords($skin).' FILE '.$this->printWords($fileName).' DELETE'); |
2191
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2192
|
|
|
|
|
|
|
} |
2193
|
|
|
|
|
|
|
|
2194
|
|
|
|
|
|
|
#-- |
2195
|
|
|
|
|
|
|
sub ListServerSkins { |
2196
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
2197
|
0
|
|
|
|
|
|
$this->send('ListServerSkins'); |
2198
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2199
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2200
|
|
|
|
|
|
|
} |
2201
|
|
|
|
|
|
|
|
2202
|
|
|
|
|
|
|
sub CreateServerSkin { |
2203
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin ) = @_; |
2204
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->CreateServerSkin($skinName)' |
2205
|
|
|
|
|
|
|
unless defined $skin; |
2206
|
|
|
|
|
|
|
|
2207
|
0
|
|
|
|
|
|
$this->send('CreateServerSkin '.$this->printWords($skin)); |
2208
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2209
|
|
|
|
|
|
|
} |
2210
|
|
|
|
|
|
|
|
2211
|
|
|
|
|
|
|
sub RenameServerSkin { |
2212
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin, $newName ) = @_; |
2213
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameServerSkin($oldSkinName,$newSkinName)' |
2214
|
|
|
|
|
|
|
unless defined $skin && defined $newName; |
2215
|
|
|
|
|
|
|
|
2216
|
0
|
|
|
|
|
|
$this->send('RenameServerSkin '.$this->printWords($skin).' INTO '.$this->printWords($newName)); |
2217
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2218
|
|
|
|
|
|
|
} |
2219
|
|
|
|
|
|
|
|
2220
|
|
|
|
|
|
|
sub DeleteServerSkin { |
2221
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin ) = @_; |
2222
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->DeleteServerSkin($skinName)' |
2223
|
|
|
|
|
|
|
unless defined $skin; |
2224
|
|
|
|
|
|
|
|
2225
|
0
|
|
|
|
|
|
$this->send('DeleteServerSkin '.$this->printWords($skin)); |
2226
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2227
|
|
|
|
|
|
|
} |
2228
|
|
|
|
|
|
|
|
2229
|
|
|
|
|
|
|
sub ListServerSkinFiles { |
2230
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin ) = @_; |
2231
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ListServerSkinFiles($skinName)' |
2232
|
|
|
|
|
|
|
unless defined $skin; |
2233
|
|
|
|
|
|
|
|
2234
|
0
|
|
|
|
|
|
$this->send('ListServerSkinFiles '.$this->printWords($skin)); |
2235
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2236
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2237
|
|
|
|
|
|
|
} |
2238
|
|
|
|
|
|
|
|
2239
|
|
|
|
|
|
|
sub ReadServerSkinFile { |
2240
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin, $fileName ) = @_; |
2241
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->ReadServerSkinFile($skinName,$fileName)' |
2242
|
|
|
|
|
|
|
unless defined $skin && defined $fileName; |
2243
|
|
|
|
|
|
|
|
2244
|
0
|
|
|
|
|
|
$this->send('ReadServerSkinFile '.$this->printWords($skin).' FILE '.$this->printWords($fileName)); |
2245
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2246
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2247
|
|
|
|
|
|
|
} |
2248
|
|
|
|
|
|
|
|
2249
|
|
|
|
|
|
|
sub StoreServerSkinFile { |
2250
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin, $fileName,$data ) = @_; |
2251
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->StoreServerSkinFile($skinName,$fileName,$base64data)' |
|
|
|
0
|
|
|
|
|
2252
|
|
|
|
|
|
|
unless defined $skin && defined $fileName && defined $data; |
2253
|
|
|
|
|
|
|
|
2254
|
0
|
|
|
|
|
|
$this->send('StoreServerSkinFile '.$this->printWords($skin).' FILE '.$this->printWords($fileName).' DATA ['.$data.']'); |
2255
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2256
|
|
|
|
|
|
|
} |
2257
|
|
|
|
|
|
|
|
2258
|
|
|
|
|
|
|
sub DeleteServerSkinFile { |
2259
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin, $fileName ) = @_; |
2260
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->DeleteServerSkinFile($skinName,$fileName)' |
2261
|
|
|
|
|
|
|
unless defined $skin && defined $fileName; |
2262
|
|
|
|
|
|
|
|
2263
|
0
|
|
|
|
|
|
$this->send('StoreServerSkinFile '.$this->printWords($skin).' FILE '.$this->printWords($fileName).' DELETE'); |
2264
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2265
|
|
|
|
|
|
|
} |
2266
|
|
|
|
|
|
|
|
2267
|
|
|
|
|
|
|
#-- |
2268
|
|
|
|
|
|
|
sub ListClusterSkins { |
2269
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
2270
|
0
|
|
|
|
|
|
$this->send('ListClusterSkins'); |
2271
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2272
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2273
|
|
|
|
|
|
|
} |
2274
|
|
|
|
|
|
|
|
2275
|
|
|
|
|
|
|
sub CreateClusterSkin { |
2276
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin ) = @_; |
2277
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->CreateClusterSkin($skinName)' |
2278
|
|
|
|
|
|
|
unless defined $skin; |
2279
|
|
|
|
|
|
|
|
2280
|
0
|
|
|
|
|
|
$this->send('CreateClusterSkin '.$this->printWords($skin)); |
2281
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2282
|
|
|
|
|
|
|
} |
2283
|
|
|
|
|
|
|
|
2284
|
|
|
|
|
|
|
sub RenameClusterSkin { |
2285
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin, $newName ) = @_; |
2286
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RenameClusterSkin($oldSkinName,$newSkinName)' |
2287
|
|
|
|
|
|
|
unless defined $skin && defined $newName; |
2288
|
|
|
|
|
|
|
|
2289
|
0
|
|
|
|
|
|
$this->send('RenameClusterSkin '.$this->printWords($skin).' INTO '.$this->printWords($newName)); |
2290
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2291
|
|
|
|
|
|
|
} |
2292
|
|
|
|
|
|
|
|
2293
|
|
|
|
|
|
|
sub DeleteClusterSkin { |
2294
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin ) = @_; |
2295
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->DeleteClusterSkin($skinName)' |
2296
|
|
|
|
|
|
|
unless defined $skin; |
2297
|
|
|
|
|
|
|
|
2298
|
0
|
|
|
|
|
|
$this->send('DeleteClusterSkin '.$this->printWords($skin)); |
2299
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2300
|
|
|
|
|
|
|
} |
2301
|
|
|
|
|
|
|
|
2302
|
|
|
|
|
|
|
sub ListClusterSkinFiles { |
2303
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin ) = @_; |
2304
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ListClusterSkinFiles($skinName)' |
2305
|
|
|
|
|
|
|
unless defined $skin; |
2306
|
|
|
|
|
|
|
|
2307
|
0
|
|
|
|
|
|
$this->send('ListClusterSkinFiles '.$this->printWords($skin)); |
2308
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2309
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2310
|
|
|
|
|
|
|
} |
2311
|
|
|
|
|
|
|
|
2312
|
|
|
|
|
|
|
sub ReadClusterSkinFile { |
2313
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin, $fileName ) = @_; |
2314
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->ReadClusterSkinFile($skinName,$fileName)' |
2315
|
|
|
|
|
|
|
unless defined $skin && defined $fileName; |
2316
|
|
|
|
|
|
|
|
2317
|
0
|
|
|
|
|
|
$this->send('ReadClusterSkinFile '.$this->printWords($skin).' FILE '.$this->printWords($fileName)); |
2318
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2319
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2320
|
|
|
|
|
|
|
} |
2321
|
|
|
|
|
|
|
|
2322
|
|
|
|
|
|
|
sub StoreClusterSkinFile { |
2323
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin, $fileName,$data ) = @_; |
2324
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->StoreClusterSkinFile($skinName,$fileName,$base64data)' |
|
|
|
0
|
|
|
|
|
2325
|
|
|
|
|
|
|
unless defined $skin && defined $fileName && defined $data; |
2326
|
|
|
|
|
|
|
|
2327
|
0
|
|
|
|
|
|
$this->send('StoreClusterSkinFile '.$this->printWords($skin).' FILE '.$this->printWords($fileName).' DATA ['.$data.']'); |
2328
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2329
|
|
|
|
|
|
|
} |
2330
|
|
|
|
|
|
|
|
2331
|
|
|
|
|
|
|
sub DeleteClusterSkinFile { |
2332
|
0
|
|
|
0
|
0
|
|
my ( $this, $skin, $fileName ) = @_; |
2333
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->DeleteClusterSkinFile($skinName,$fileName)' |
2334
|
|
|
|
|
|
|
unless defined $skin && defined $fileName; |
2335
|
|
|
|
|
|
|
|
2336
|
0
|
|
|
|
|
|
$this->send('StoreClusterSkinFile '.$this->printWords($skin).' FILE '.$this->printWords($fileName).' DELETE'); |
2337
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2338
|
|
|
|
|
|
|
} |
2339
|
|
|
|
|
|
|
|
2340
|
|
|
|
|
|
|
############################################# |
2341
|
|
|
|
|
|
|
# Web Interface Tuning |
2342
|
|
|
|
|
|
|
|
2343
|
|
|
|
|
|
|
sub ListWebUserInterface { |
2344
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $path) = @_; |
2345
|
|
|
|
|
|
|
|
2346
|
0
|
|
|
|
|
|
my $line = 'ListWebUserInterface'; |
2347
|
0
|
0
|
|
|
|
|
$line .= ' '.$domainName if($domainName); |
2348
|
0
|
0
|
|
|
|
|
$line .= ' PATH '.$this->printWords($path) if($path); |
2349
|
|
|
|
|
|
|
|
2350
|
0
|
|
|
|
|
|
$this->send($line); |
2351
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2352
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2353
|
|
|
|
|
|
|
} |
2354
|
|
|
|
|
|
|
|
2355
|
|
|
|
|
|
|
sub GetWebUserInterface { |
2356
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $path) = @_; |
2357
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->GetWebUserInterface($domainName, $fileName)' |
2358
|
|
|
|
|
|
|
unless defined $domainName && defined $path; |
2359
|
|
|
|
|
|
|
|
2360
|
0
|
|
|
|
|
|
my $line = 'GetWebUserInterface '.$domainName.' FILE '.$this->printWords($path); |
2361
|
0
|
|
|
|
|
|
$this->send($line); |
2362
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2363
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2364
|
|
|
|
|
|
|
} |
2365
|
|
|
|
|
|
|
|
2366
|
|
|
|
|
|
|
sub PutWebUserInterface { |
2367
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $path, $data) = @_; |
2368
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->PutWebUserInterface($domainName, $fileName, $base64data)' |
|
|
|
0
|
|
|
|
|
2369
|
|
|
|
|
|
|
unless defined $domainName && defined $path && defined $data; |
2370
|
|
|
|
|
|
|
|
2371
|
0
|
|
|
|
|
|
my $line = 'PutWebUserInterface '.$domainName; |
2372
|
0
|
|
|
|
|
|
$line .= ' FILE '.$this->printWords($path).' DATA ['.$data.']'; |
2373
|
0
|
|
|
|
|
|
$this->send($line); |
2374
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2375
|
|
|
|
|
|
|
} |
2376
|
|
|
|
|
|
|
|
2377
|
|
|
|
|
|
|
sub DeleteWebUserInterface { |
2378
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName, $path) = @_; |
2379
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->DeleteWebUserInterface($domainName, $fileName)' |
2380
|
|
|
|
|
|
|
unless defined $domainName && defined $path; |
2381
|
|
|
|
|
|
|
|
2382
|
0
|
|
|
|
|
|
my $line = 'DeleteWebUserInterface '; |
2383
|
0
|
0
|
|
|
|
|
$line .= ' '.$domainName if($domainName); |
2384
|
0
|
0
|
|
|
|
|
$line .= ' FILE '.$this->printWords($path) if($path); |
2385
|
|
|
|
|
|
|
|
2386
|
0
|
|
|
|
|
|
$this->send($line); |
2387
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2388
|
|
|
|
|
|
|
} |
2389
|
|
|
|
|
|
|
|
2390
|
|
|
|
|
|
|
sub ClearWebUserCache { |
2391
|
0
|
|
|
0
|
0
|
|
my ($this, $domainName) = @_; |
2392
|
|
|
|
|
|
|
|
2393
|
0
|
|
|
|
|
|
my $line = 'ClearWebUserCache'; |
2394
|
0
|
0
|
|
|
|
|
$line .= ' '.$domainName if($domainName); |
2395
|
|
|
|
|
|
|
|
2396
|
0
|
|
|
|
|
|
$this->send($line); |
2397
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2398
|
|
|
|
|
|
|
} |
2399
|
|
|
|
|
|
|
|
2400
|
|
|
|
|
|
|
############################################# |
2401
|
|
|
|
|
|
|
# Web Interface Integration |
2402
|
|
|
|
|
|
|
|
2403
|
|
|
|
|
|
|
sub CreateWebUserSession { |
2404
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $ipAddress, $wml,$skin,$origAddress) = @_; |
2405
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->CreateWebUserSession($accountName, $IP_Address[, "WML"[,"mySkin"]][,$origAddress )' |
2406
|
|
|
|
|
|
|
unless defined $accountName && defined $ipAddress; |
2407
|
0
|
|
|
|
|
|
my $line='CreateWebUserSession '.$accountName.' ADDRESS '.$ipAddress; |
2408
|
0
|
0
|
|
|
|
|
$line .= " FOR $origAddress" if($origAddress); |
2409
|
0
|
0
|
|
|
|
|
$line .= " $wml" if($wml); |
2410
|
0
|
0
|
|
|
|
|
$line .= " SKIN $skin" if($skin); |
2411
|
|
|
|
|
|
|
|
2412
|
0
|
|
|
|
|
|
$this->send($line); |
2413
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2414
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2415
|
|
|
|
|
|
|
} |
2416
|
|
|
|
|
|
|
|
2417
|
|
|
|
|
|
|
sub CreateXIMSSSession { |
2418
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName, $ipAddress,$origAddress) = @_; |
2419
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->CreateXIMSSSession($accountName, $IP_Address,[$origAddress] )' |
2420
|
|
|
|
|
|
|
unless defined $accountName && defined $ipAddress; |
2421
|
0
|
|
|
|
|
|
my $line='CreateXIMSSSession '.$accountName.' ADDRESS '.$ipAddress; |
2422
|
0
|
0
|
|
|
|
|
$line .= " FOR $origAddress" if($origAddress); |
2423
|
0
|
|
|
|
|
|
$this->send($line); |
2424
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2425
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2426
|
|
|
|
|
|
|
} |
2427
|
|
|
|
|
|
|
|
2428
|
|
|
|
|
|
|
sub FindWebUserSession { |
2429
|
0
|
|
|
0
|
0
|
|
my ($this, $accountName,$address) = @_; |
2430
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->FindWebUserSession($accountName [,$address])' unless defined $accountName; |
2431
|
|
|
|
|
|
|
|
2432
|
0
|
|
|
|
|
|
my $line='FindWebUserSession '.$accountName; |
2433
|
0
|
0
|
|
|
|
|
$line .= ' ADDRESS '.$address if($address); |
2434
|
|
|
|
|
|
|
|
2435
|
0
|
|
|
|
|
|
$this->send($line); |
2436
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2437
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2438
|
|
|
|
|
|
|
} |
2439
|
|
|
|
|
|
|
|
2440
|
|
|
|
|
|
|
sub GetWebUserSession { |
2441
|
0
|
|
|
0
|
0
|
|
my ($this, $sessionID,$domain) = @_; |
2442
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetWebUserSession($sessionID [,$domain])' unless defined $sessionID; |
2443
|
|
|
|
|
|
|
|
2444
|
0
|
|
|
|
|
|
my $line='GetWebUserSession '.$sessionID; |
2445
|
0
|
0
|
|
|
|
|
$line .= ' DOMAIN '.$domain if($domain); |
2446
|
|
|
|
|
|
|
|
2447
|
0
|
|
|
|
|
|
$this->send($line); |
2448
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2449
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2450
|
|
|
|
|
|
|
} |
2451
|
|
|
|
|
|
|
sub GetSession { |
2452
|
0
|
|
|
0
|
0
|
|
my ($this, $sessionID,$domain) = @_; |
2453
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetSession($sessionID [,$domain])' unless defined $sessionID; |
2454
|
|
|
|
|
|
|
|
2455
|
0
|
|
|
|
|
|
my $line='GetSession '.$sessionID; |
2456
|
0
|
0
|
|
|
|
|
$line .= ' DOMAIN '.$domain if($domain); |
2457
|
|
|
|
|
|
|
|
2458
|
0
|
|
|
|
|
|
$this->send($line); |
2459
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2460
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2461
|
|
|
|
|
|
|
} |
2462
|
|
|
|
|
|
|
|
2463
|
|
|
|
|
|
|
|
2464
|
|
|
|
|
|
|
|
2465
|
|
|
|
|
|
|
sub KillWebUserSession { |
2466
|
0
|
|
|
0
|
0
|
|
my ($this, $sessionID,$domain) = @_; |
2467
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->KillWebUserSession($sessionID [,$domain])' unless defined $sessionID; |
2468
|
0
|
|
|
|
|
|
my $line='KillWebUserSession '.$sessionID; |
2469
|
0
|
0
|
|
|
|
|
$line .= ' DOMAIN '.$domain if($domain); |
2470
|
|
|
|
|
|
|
|
2471
|
0
|
|
|
|
|
|
$this->send($line); |
2472
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2473
|
|
|
|
|
|
|
} |
2474
|
|
|
|
|
|
|
sub KillSession { |
2475
|
0
|
|
|
0
|
0
|
|
my ($this, $sessionID,$domain) = @_; |
2476
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->KillSession($sessionID [,$domain])' unless defined $sessionID; |
2477
|
0
|
|
|
|
|
|
my $line='KillSession '.$sessionID; |
2478
|
0
|
0
|
|
|
|
|
$line .= ' DOMAIN '.$domain if($domain); |
2479
|
|
|
|
|
|
|
|
2480
|
0
|
|
|
|
|
|
$this->send($line); |
2481
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2482
|
|
|
|
|
|
|
} |
2483
|
|
|
|
|
|
|
|
2484
|
|
|
|
|
|
|
############################################# |
2485
|
|
|
|
|
|
|
# Real-Time Application Administration |
2486
|
|
|
|
|
|
|
|
2487
|
|
|
|
|
|
|
sub CreateDomainPBX { |
2488
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $language ) = @_; |
2489
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->CreateDomainPBX($domainName,$language)' |
2490
|
|
|
|
|
|
|
unless defined $domain; |
2491
|
0
|
|
|
|
|
|
my $line = 'CreateDomainPBX '.$domain; |
2492
|
0
|
0
|
|
|
|
|
$line .= ' FILE '.$this->printWords($language) if($language); |
2493
|
|
|
|
|
|
|
|
2494
|
0
|
|
|
|
|
|
$this->send($line); |
2495
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2496
|
|
|
|
|
|
|
} |
2497
|
|
|
|
|
|
|
|
2498
|
|
|
|
|
|
|
sub ListDomainPBXFiles { |
2499
|
0
|
|
|
0
|
0
|
|
my ($this, $domain,$language) = @_; |
2500
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ListDomainPBXFiles($domainName,$language)' |
2501
|
|
|
|
|
|
|
unless defined $domain; |
2502
|
0
|
|
|
|
|
|
my $line = 'ListDomainPBXFiles '.$domain; |
2503
|
0
|
0
|
|
|
|
|
$line .= ' FILE '.$this->printWords($language) if($language); |
2504
|
0
|
|
|
|
|
|
$this->send($line); |
2505
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2506
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2507
|
|
|
|
|
|
|
} |
2508
|
|
|
|
|
|
|
|
2509
|
|
|
|
|
|
|
sub ReadDomainPBXFile { |
2510
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $fileName ) = @_; |
2511
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->ReadDomainPBXFile($domainName,$fileName)' |
2512
|
|
|
|
|
|
|
unless defined $domain && defined $fileName; |
2513
|
|
|
|
|
|
|
|
2514
|
0
|
|
|
|
|
|
$this->send('ReadDomainPBXFile '.$domain.' FILE '.$this->printWords($fileName)); |
2515
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2516
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2517
|
|
|
|
|
|
|
} |
2518
|
|
|
|
|
|
|
|
2519
|
|
|
|
|
|
|
sub StoreDomainPBXFile { |
2520
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $fileName,$base64data ) = @_; |
2521
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->StoreDomainPBXFile($domainName,$fileName,$base64data)' |
|
|
|
0
|
|
|
|
|
2522
|
|
|
|
|
|
|
unless defined $domain && defined $fileName && defined $base64data; |
2523
|
0
|
|
|
|
|
|
$this->send('StoreDomainPBXFile '.$domain.' FILE '.$this->printWords($fileName).' DATA ['.$base64data.']'); |
2524
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2525
|
|
|
|
|
|
|
} |
2526
|
|
|
|
|
|
|
|
2527
|
|
|
|
|
|
|
sub DeleteDomainPBXFile { |
2528
|
0
|
|
|
0
|
0
|
|
my ( $this, $domain, $fileName ) = @_; |
2529
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->DeleteDomainPBXFile($domainName,$fileName)' |
2530
|
|
|
|
|
|
|
unless defined $domain && defined $fileName; |
2531
|
|
|
|
|
|
|
|
2532
|
0
|
|
|
|
|
|
$this->send('StoreDomainPBXFile '.$domain.' FILE '.$this->printWords($fileName).' DELETE'); |
2533
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2534
|
|
|
|
|
|
|
} |
2535
|
|
|
|
|
|
|
|
2536
|
|
|
|
|
|
|
#-- |
2537
|
|
|
|
|
|
|
|
2538
|
|
|
|
|
|
|
sub CreateServerPBX { |
2539
|
0
|
|
|
0
|
0
|
|
my ( $this, $language ) = @_; |
2540
|
0
|
|
|
|
|
|
my $line = 'CreateServerPBX'; |
2541
|
0
|
0
|
|
|
|
|
$line .= $this->printWords($language) if($language); |
2542
|
0
|
|
|
|
|
|
$this->send($line); |
2543
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2544
|
|
|
|
|
|
|
} |
2545
|
|
|
|
|
|
|
|
2546
|
|
|
|
|
|
|
sub ListServerPBXFiles { |
2547
|
0
|
|
|
0
|
0
|
|
my ($this,$language) = @_; |
2548
|
|
|
|
|
|
|
|
2549
|
0
|
|
|
|
|
|
my $line = 'ListServerPBXFiles '; |
2550
|
0
|
0
|
|
|
|
|
$line .= $this->printWords($language) if($language); |
2551
|
0
|
|
|
|
|
|
$this->send($line); |
2552
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2553
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2554
|
|
|
|
|
|
|
} |
2555
|
|
|
|
|
|
|
|
2556
|
|
|
|
|
|
|
sub ReadServerPBXFile { |
2557
|
0
|
|
|
0
|
0
|
|
my ( $this, $fileName ) = @_; |
2558
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ReadServerPBXFile($fileName)' |
2559
|
|
|
|
|
|
|
unless defined $fileName; |
2560
|
|
|
|
|
|
|
|
2561
|
0
|
|
|
|
|
|
$this->send('ReadServerPBXFile '.$this->printWords($fileName)); |
2562
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2563
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2564
|
|
|
|
|
|
|
} |
2565
|
|
|
|
|
|
|
|
2566
|
|
|
|
|
|
|
sub StoreServerPBXFile { |
2567
|
0
|
|
|
0
|
0
|
|
my ( $this, $fileName,$base64data ) = @_; |
2568
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->StoreServerPBXFile($fileName,$base64data)' |
2569
|
|
|
|
|
|
|
unless defined $fileName && defined $base64data; |
2570
|
0
|
|
|
|
|
|
$this->send('StoreServerPBXFile ' .$this->printWords($fileName).' DATA ['.$base64data.']'); |
2571
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2572
|
|
|
|
|
|
|
} |
2573
|
|
|
|
|
|
|
|
2574
|
|
|
|
|
|
|
sub DeleteServerPBXFile { |
2575
|
0
|
|
|
0
|
0
|
|
my ( $this, $fileName ) = @_; |
2576
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->DeleteServerPBXFile($fileName)' |
2577
|
|
|
|
|
|
|
unless defined $fileName; |
2578
|
|
|
|
|
|
|
|
2579
|
0
|
|
|
|
|
|
$this->send('StoreServerPBXFile '.$this->printWords($fileName).' DELETE'); |
2580
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2581
|
|
|
|
|
|
|
} |
2582
|
|
|
|
|
|
|
|
2583
|
|
|
|
|
|
|
#-- |
2584
|
|
|
|
|
|
|
|
2585
|
|
|
|
|
|
|
sub CreateClusterPBX { |
2586
|
0
|
|
|
0
|
0
|
|
my ( $this, $language ) = @_; |
2587
|
0
|
|
|
|
|
|
my $line = 'CreateClusterPBX'; |
2588
|
0
|
0
|
|
|
|
|
$line .= $this->printWords($language) if($language); |
2589
|
0
|
|
|
|
|
|
$this->send($line); |
2590
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2591
|
|
|
|
|
|
|
} |
2592
|
|
|
|
|
|
|
|
2593
|
|
|
|
|
|
|
sub ListClusterPBXFiles { |
2594
|
0
|
|
|
0
|
0
|
|
my ($this,$language) = @_; |
2595
|
|
|
|
|
|
|
|
2596
|
0
|
|
|
|
|
|
my $line = 'ListClusterPBXFiles '; |
2597
|
0
|
0
|
|
|
|
|
$line .= $this->printWords($language) if($language); |
2598
|
0
|
|
|
|
|
|
$this->send($line); |
2599
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2600
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2601
|
|
|
|
|
|
|
} |
2602
|
|
|
|
|
|
|
|
2603
|
|
|
|
|
|
|
sub ReadClusterPBXFile { |
2604
|
0
|
|
|
0
|
0
|
|
my ( $this, $fileName ) = @_; |
2605
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ReadClusterPBXFile($fileName)' |
2606
|
|
|
|
|
|
|
unless defined $fileName; |
2607
|
|
|
|
|
|
|
|
2608
|
0
|
|
|
|
|
|
$this->send('ReadClusterPBXFile '.$this->printWords($fileName)); |
2609
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2610
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2611
|
|
|
|
|
|
|
} |
2612
|
|
|
|
|
|
|
|
2613
|
|
|
|
|
|
|
sub StoreClusterPBXFile { |
2614
|
0
|
|
|
0
|
0
|
|
my ( $this, $fileName,$base64data ) = @_; |
2615
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->StoreClusterPBXFile($fileName,$base64data)' |
2616
|
|
|
|
|
|
|
unless defined $fileName && defined $base64data; |
2617
|
0
|
|
|
|
|
|
$this->send('StoreClusterPBXFile ' .$this->printWords($fileName).' DATA ['.$base64data.']'); |
2618
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2619
|
|
|
|
|
|
|
} |
2620
|
|
|
|
|
|
|
|
2621
|
|
|
|
|
|
|
sub DeleteClusterPBXFile { |
2622
|
0
|
|
|
0
|
0
|
|
my ( $this, $fileName ) = @_; |
2623
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->DeleteClusterPBXFile($fileName)' |
2624
|
|
|
|
|
|
|
unless defined $fileName; |
2625
|
|
|
|
|
|
|
|
2626
|
0
|
|
|
|
|
|
$this->send('StoreClusterPBXFile '.$this->printWords($fileName).' DELETE'); |
2627
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2628
|
|
|
|
|
|
|
} |
2629
|
|
|
|
|
|
|
|
2630
|
|
|
|
|
|
|
############################################# |
2631
|
|
|
|
|
|
|
# Server Settings |
2632
|
|
|
|
|
|
|
|
2633
|
|
|
|
|
|
|
sub GetModule { |
2634
|
0
|
|
|
0
|
0
|
|
my ( $this, $moduleName ) = @_; |
2635
|
0
|
|
|
|
|
|
$this->send('GetModule '.$moduleName); |
2636
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2637
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2638
|
|
|
|
|
|
|
} |
2639
|
|
|
|
|
|
|
|
2640
|
|
|
|
|
|
|
sub UpdateModule { |
2641
|
0
|
|
|
0
|
0
|
|
my ( $this, $moduleName, $newSettings ) = @_; |
2642
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->UpdateModule($moduleName, \%newSettings)' |
2643
|
|
|
|
|
|
|
unless defined $moduleName && defined $newSettings; |
2644
|
0
|
|
|
|
|
|
$this->send ('UpdateModule '.$moduleName.' '.$this->printWords($newSettings) ); |
2645
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2646
|
|
|
|
|
|
|
} |
2647
|
|
|
|
|
|
|
|
2648
|
|
|
|
|
|
|
sub SetModule { |
2649
|
0
|
|
|
0
|
0
|
|
my ( $this, $moduleName, $newSettings ) = @_; |
2650
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->SetModule($moduleName, \%newSettings)' |
2651
|
|
|
|
|
|
|
unless defined $moduleName && defined $newSettings; |
2652
|
0
|
|
|
|
|
|
$this->send ('SetModule '.$moduleName.' '.$this->printWords($newSettings) ); |
2653
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2654
|
|
|
|
|
|
|
} |
2655
|
|
|
|
|
|
|
|
2656
|
|
|
|
|
|
|
sub GetQueueSettings { |
2657
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2658
|
0
|
|
|
|
|
|
$this->send('GetQueueSettings'); |
2659
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2660
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2661
|
|
|
|
|
|
|
} |
2662
|
|
|
|
|
|
|
sub SetQueueSettings { |
2663
|
0
|
|
|
0
|
0
|
|
my ( $this, $newSettings ) = @_; |
2664
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetQueueSettings(\%newSettings)' |
2665
|
|
|
|
|
|
|
unless defined $newSettings; |
2666
|
0
|
|
|
|
|
|
$this->send ('SetQueueSettings '.$this->printWords($newSettings) ); |
2667
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2668
|
|
|
|
|
|
|
} |
2669
|
|
|
|
|
|
|
|
2670
|
|
|
|
|
|
|
sub GetSignalSettings { |
2671
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2672
|
0
|
|
|
|
|
|
$this->send('GetSignalSettings'); |
2673
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2674
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2675
|
|
|
|
|
|
|
} |
2676
|
|
|
|
|
|
|
sub SetSignalSettings { |
2677
|
0
|
|
|
0
|
0
|
|
my ( $this, $newSettings ) = @_; |
2678
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetSignalSettings(\%newSettings)' |
2679
|
|
|
|
|
|
|
unless defined $newSettings; |
2680
|
0
|
|
|
|
|
|
$this->send ('SetSignalSettings '.$this->printWords($newSettings) ); |
2681
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2682
|
|
|
|
|
|
|
} |
2683
|
|
|
|
|
|
|
sub GetClusterSettings { |
2684
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2685
|
0
|
|
|
|
|
|
$this->send('GetClusterSettings'); |
2686
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2687
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2688
|
|
|
|
|
|
|
} |
2689
|
|
|
|
|
|
|
sub SetClusterSettings { |
2690
|
0
|
|
|
0
|
0
|
|
my ( $this, $newSettings ) = @_; |
2691
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterSettings(\%newSettings)' |
2692
|
|
|
|
|
|
|
unless defined $newSettings; |
2693
|
0
|
|
|
|
|
|
$this->send ('SetClusterSettings '.$this->printWords($newSettings) ); |
2694
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2695
|
|
|
|
|
|
|
} |
2696
|
|
|
|
|
|
|
|
2697
|
|
|
|
|
|
|
|
2698
|
|
|
|
|
|
|
sub GetLANIPs { |
2699
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2700
|
0
|
|
|
|
|
|
$this->send('GetLANIPs'); |
2701
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2702
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2703
|
|
|
|
|
|
|
} |
2704
|
|
|
|
|
|
|
|
2705
|
|
|
|
|
|
|
sub GetBlacklistedIPs { |
2706
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2707
|
0
|
|
|
|
|
|
$this->send('GetBlacklistedIPs'); |
2708
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2709
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2710
|
|
|
|
|
|
|
} |
2711
|
|
|
|
|
|
|
|
2712
|
|
|
|
|
|
|
sub GetClientIPs { |
2713
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2714
|
0
|
|
|
|
|
|
$this->send('GetClientIPs'); |
2715
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2716
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2717
|
|
|
|
|
|
|
} |
2718
|
|
|
|
|
|
|
|
2719
|
|
|
|
|
|
|
sub GetWhiteHoleIPs { |
2720
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2721
|
0
|
|
|
|
|
|
$this->send('GetWhiteHoleIPs'); |
2722
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2723
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2724
|
|
|
|
|
|
|
} |
2725
|
|
|
|
|
|
|
sub GetNATedIPs { |
2726
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2727
|
0
|
|
|
|
|
|
$this->send('GetNATedIPs'); |
2728
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2729
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2730
|
|
|
|
|
|
|
} |
2731
|
|
|
|
|
|
|
sub GetDebugIPs { |
2732
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2733
|
0
|
|
|
|
|
|
$this->send('GetDebugIPs'); |
2734
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2735
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2736
|
|
|
|
|
|
|
} |
2737
|
|
|
|
|
|
|
sub GetDeniedIPs { |
2738
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2739
|
0
|
|
|
|
|
|
$this->send('GetDeniedIPs'); |
2740
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2741
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2742
|
|
|
|
|
|
|
} |
2743
|
|
|
|
|
|
|
|
2744
|
|
|
|
|
|
|
sub GetProtection { |
2745
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2746
|
0
|
|
|
|
|
|
$this->send('GetProtection'); |
2747
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2748
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2749
|
|
|
|
|
|
|
} |
2750
|
|
|
|
|
|
|
|
2751
|
|
|
|
|
|
|
sub GetBanned { |
2752
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2753
|
0
|
|
|
|
|
|
$this->send('GetBanned'); |
2754
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2755
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2756
|
|
|
|
|
|
|
} |
2757
|
|
|
|
|
|
|
|
2758
|
|
|
|
|
|
|
sub SetLANIPs { |
2759
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2760
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetLANIPs("10.0.0.1\e192.168.0.1")' |
2761
|
|
|
|
|
|
|
unless defined $addresses; |
2762
|
0
|
|
|
|
|
|
$this->send ('SetLANIPs '.$this->printWords($addresses)); |
2763
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2764
|
|
|
|
|
|
|
} |
2765
|
|
|
|
|
|
|
|
2766
|
|
|
|
|
|
|
|
2767
|
|
|
|
|
|
|
sub SetBlacklistedIPs { |
2768
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2769
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetBlacklistedIPs("11.22.33.44\e55.66.77.88")' |
2770
|
|
|
|
|
|
|
unless defined $addresses; |
2771
|
0
|
|
|
|
|
|
$this->send ('SetBlacklistedIPs '.$this->printWords($addresses)); |
2772
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2773
|
|
|
|
|
|
|
} |
2774
|
|
|
|
|
|
|
|
2775
|
|
|
|
|
|
|
sub SetClientIPs { |
2776
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2777
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClientIPs("11.22.33.44\e55.66.77.88")' |
2778
|
|
|
|
|
|
|
unless defined $addresses; |
2779
|
0
|
|
|
|
|
|
$this->send ('SetClientIPs '.$this->printWords($addresses)); |
2780
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2781
|
|
|
|
|
|
|
} |
2782
|
|
|
|
|
|
|
|
2783
|
|
|
|
|
|
|
sub SetWhiteHoleIPs { |
2784
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2785
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetWhiteHoleIPs("11.22.33.44\e55.66.77.88")' |
2786
|
|
|
|
|
|
|
unless defined $addresses; |
2787
|
0
|
|
|
|
|
|
$this->send ('SetWhiteHoleIPs '.$this->printWords($addresses)); |
2788
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2789
|
|
|
|
|
|
|
} |
2790
|
|
|
|
|
|
|
sub SetNATedIPs { |
2791
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2792
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetNATedIPs("192.168.0.1\e10.0.0.1")' |
2793
|
|
|
|
|
|
|
unless defined $addresses; |
2794
|
0
|
|
|
|
|
|
$this->send ('SetNATedIPs '.$this->printWords($addresses)); |
2795
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2796
|
|
|
|
|
|
|
} |
2797
|
|
|
|
|
|
|
sub SetDebugIPs { |
2798
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2799
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetDebugIPs("11.22.33.44\e55.66.77.88")' |
2800
|
|
|
|
|
|
|
unless defined $addresses; |
2801
|
0
|
|
|
|
|
|
$this->send ('SetDebugIPs '.$this->printWords($addresses)); |
2802
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2803
|
|
|
|
|
|
|
} |
2804
|
|
|
|
|
|
|
sub SetDeniedIPs { |
2805
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2806
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetDeniedIPs("11.22.33.44\e55.66.77.88")' |
2807
|
|
|
|
|
|
|
unless defined $addresses; |
2808
|
0
|
|
|
|
|
|
$this->send ('SetDeniedIPs '.$this->printWords($addresses)); |
2809
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2810
|
|
|
|
|
|
|
} |
2811
|
|
|
|
|
|
|
|
2812
|
|
|
|
|
|
|
sub SetProtection { |
2813
|
0
|
|
|
0
|
0
|
|
my ( $this, $settings ) = @_; |
2814
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetProtection(\%settings)' |
2815
|
|
|
|
|
|
|
unless defined $settings; |
2816
|
0
|
|
|
|
|
|
$this->send ('SetProtection '.$this->printWords($settings)); |
2817
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2818
|
|
|
|
|
|
|
} |
2819
|
|
|
|
|
|
|
|
2820
|
|
|
|
|
|
|
sub SetBanned { |
2821
|
0
|
|
|
0
|
0
|
|
my ( $this, $settings ) = @_; |
2822
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetBanned(\%settings)' |
2823
|
|
|
|
|
|
|
unless defined $settings; |
2824
|
0
|
|
|
|
|
|
$this->send ('SetBanned '.$this->printWords($settings)); |
2825
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2826
|
|
|
|
|
|
|
} |
2827
|
|
|
|
|
|
|
|
2828
|
|
|
|
|
|
|
sub GetClusterLANIPs { |
2829
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2830
|
0
|
|
|
|
|
|
$this->send('GetClusterLANIPs'); |
2831
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2832
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2833
|
|
|
|
|
|
|
} |
2834
|
|
|
|
|
|
|
|
2835
|
|
|
|
|
|
|
sub GetClusterBlacklistedIPs { |
2836
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2837
|
0
|
|
|
|
|
|
$this->send('GetClusterBlacklistedIPs'); |
2838
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2839
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2840
|
|
|
|
|
|
|
} |
2841
|
|
|
|
|
|
|
|
2842
|
|
|
|
|
|
|
sub GetClusterClientIPs { |
2843
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2844
|
0
|
|
|
|
|
|
$this->send('GetClusterClientIPs'); |
2845
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2846
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2847
|
|
|
|
|
|
|
} |
2848
|
|
|
|
|
|
|
|
2849
|
|
|
|
|
|
|
sub GetClusterWhiteHoleIPs { |
2850
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2851
|
0
|
|
|
|
|
|
$this->send('GetClusterWhiteHoleIPs'); |
2852
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2853
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2854
|
|
|
|
|
|
|
} |
2855
|
|
|
|
|
|
|
sub GetClusterNATedIPs { |
2856
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2857
|
0
|
|
|
|
|
|
$this->send('GetClusterNATedIPs'); |
2858
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2859
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2860
|
|
|
|
|
|
|
} |
2861
|
|
|
|
|
|
|
sub GetClusterDebugIPs { |
2862
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2863
|
0
|
|
|
|
|
|
$this->send('GetClusterDebugIPs'); |
2864
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2865
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2866
|
|
|
|
|
|
|
} |
2867
|
|
|
|
|
|
|
sub GetClusterDeniedIPs { |
2868
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2869
|
0
|
|
|
|
|
|
$this->send('GetClusterDeniedIPs'); |
2870
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2871
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2872
|
|
|
|
|
|
|
} |
2873
|
|
|
|
|
|
|
|
2874
|
|
|
|
|
|
|
sub GetClusterProtection { |
2875
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2876
|
0
|
|
|
|
|
|
$this->send('GetClusterProtection'); |
2877
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2878
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2879
|
|
|
|
|
|
|
} |
2880
|
|
|
|
|
|
|
sub GetClusterBanned { |
2881
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
2882
|
0
|
|
|
|
|
|
$this->send('GetClusterBanned'); |
2883
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2884
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2885
|
|
|
|
|
|
|
} |
2886
|
|
|
|
|
|
|
|
2887
|
|
|
|
|
|
|
sub SetClusterLANIPs { |
2888
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2889
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterLANIPs("10.0.0.1\e192.168.0.1")' |
2890
|
|
|
|
|
|
|
unless defined $addresses; |
2891
|
0
|
|
|
|
|
|
$this->send ('SetClusterLANIPs '.$this->printWords($addresses)); |
2892
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2893
|
|
|
|
|
|
|
} |
2894
|
|
|
|
|
|
|
|
2895
|
|
|
|
|
|
|
sub SetClusterBlacklistedIPs { |
2896
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2897
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterBlacklistedIPs("11.22.33.44\e55.66.77.88")' |
2898
|
|
|
|
|
|
|
unless defined $addresses; |
2899
|
0
|
|
|
|
|
|
$this->send ('SetClusterBlacklistedIPs '.$this->printWords($addresses)); |
2900
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2901
|
|
|
|
|
|
|
} |
2902
|
|
|
|
|
|
|
|
2903
|
|
|
|
|
|
|
sub SetClusterClientIPs { |
2904
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2905
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterClientIPs("11.22.33.44\e55.66.77.88")' |
2906
|
|
|
|
|
|
|
unless defined $addresses; |
2907
|
0
|
|
|
|
|
|
$this->send ('SetClusterClientIPs '.$this->printWords($addresses)); |
2908
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2909
|
|
|
|
|
|
|
} |
2910
|
|
|
|
|
|
|
|
2911
|
|
|
|
|
|
|
sub SetClusterWhiteHoleIPs { |
2912
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2913
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterWhiteHoleIPs("11.22.33.44\e55.66.77.88")' |
2914
|
|
|
|
|
|
|
unless defined $addresses; |
2915
|
0
|
|
|
|
|
|
$this->send ('SetClusterWhiteHoleIPs '.$this->printWords($addresses)); |
2916
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2917
|
|
|
|
|
|
|
} |
2918
|
|
|
|
|
|
|
sub SetClusterNATedIPs { |
2919
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2920
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterNATedIPs("192.168.0.1\e10.0.0.1")' |
2921
|
|
|
|
|
|
|
unless defined $addresses; |
2922
|
0
|
|
|
|
|
|
$this->send ('SetClusterNATedIPs '.$this->printWords($addresses)); |
2923
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2924
|
|
|
|
|
|
|
} |
2925
|
|
|
|
|
|
|
sub SetClusterDebugIPs { |
2926
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2927
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterDebugIPs("11.22.33.44\e55.66.77.88")' |
2928
|
|
|
|
|
|
|
unless defined $addresses; |
2929
|
0
|
|
|
|
|
|
$this->send ('SetClusterDebugIPs '.$this->printWords($addresses)); |
2930
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2931
|
|
|
|
|
|
|
} |
2932
|
|
|
|
|
|
|
sub SetClusterDeniedIPs { |
2933
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
2934
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterDeniedIPs("11.22.33.44\e55.66.77.88")' |
2935
|
|
|
|
|
|
|
unless defined $addresses; |
2936
|
0
|
|
|
|
|
|
$this->send ('SetClusterDeniedIPs '.$this->printWords($addresses)); |
2937
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2938
|
|
|
|
|
|
|
} |
2939
|
|
|
|
|
|
|
|
2940
|
|
|
|
|
|
|
sub SetClusterProtection { |
2941
|
0
|
|
|
0
|
0
|
|
my ( $this, $settings ) = @_; |
2942
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterProtection(\%settings)' |
2943
|
|
|
|
|
|
|
unless defined $settings; |
2944
|
0
|
|
|
|
|
|
$this->send ('SetClusterProtection '.$this->printWords($settings)); |
2945
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2946
|
|
|
|
|
|
|
} |
2947
|
|
|
|
|
|
|
|
2948
|
|
|
|
|
|
|
sub GetServerRules { |
2949
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
2950
|
0
|
|
|
|
|
|
$this->send('GetServerRules'); |
2951
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2952
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2953
|
|
|
|
|
|
|
} |
2954
|
|
|
|
|
|
|
|
2955
|
|
|
|
|
|
|
sub SetServerRules { |
2956
|
0
|
|
|
0
|
0
|
|
my ($this, $rules) = @_; |
2957
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetServerRules(\@rules)' |
2958
|
|
|
|
|
|
|
unless defined $rules; |
2959
|
0
|
|
|
|
|
|
$this->send('SetServerRules '.$this->printWords($rules)); |
2960
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2961
|
|
|
|
|
|
|
} |
2962
|
|
|
|
|
|
|
|
2963
|
|
|
|
|
|
|
|
2964
|
|
|
|
|
|
|
sub GetClusterRules { |
2965
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
2966
|
0
|
|
|
|
|
|
$this->send('GetClusterRules'); |
2967
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2968
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2969
|
|
|
|
|
|
|
} |
2970
|
|
|
|
|
|
|
|
2971
|
|
|
|
|
|
|
sub SetClusterRules { |
2972
|
0
|
|
|
0
|
0
|
|
my ($this, $rules) = @_; |
2973
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterRules(\@rules)' |
2974
|
|
|
|
|
|
|
unless defined $rules; |
2975
|
0
|
|
|
|
|
|
$this->send('SetClusterRules '.$this->printWords($rules)); |
2976
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2977
|
|
|
|
|
|
|
} |
2978
|
|
|
|
|
|
|
|
2979
|
|
|
|
|
|
|
sub GetServerMailRules { |
2980
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
2981
|
0
|
|
|
|
|
|
$this->send('GetServerMailRules'); |
2982
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
2983
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
2984
|
|
|
|
|
|
|
} |
2985
|
|
|
|
|
|
|
|
2986
|
|
|
|
|
|
|
sub SetServerMailRules { |
2987
|
0
|
|
|
0
|
0
|
|
my ($this, $rules) = @_; |
2988
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetServerMailRules(\@rules)' |
2989
|
|
|
|
|
|
|
unless defined $rules; |
2990
|
0
|
|
|
|
|
|
$this->send('SetServerMailRules '.$this->printWords($rules)); |
2991
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
2992
|
|
|
|
|
|
|
} |
2993
|
|
|
|
|
|
|
|
2994
|
|
|
|
|
|
|
#sub UpdateServerMailRule { |
2995
|
|
|
|
|
|
|
# my ($this, $rule) = @_; |
2996
|
|
|
|
|
|
|
# croak 'usage CGP::CLI->UpdateServerMailRules(\@rule)' |
2997
|
|
|
|
|
|
|
# unless defined $rule; |
2998
|
|
|
|
|
|
|
# $this->send('UpdateServerMailRule '.$this->printWords($rule)); |
2999
|
|
|
|
|
|
|
# $this->_parseResponse(); |
3000
|
|
|
|
|
|
|
#} |
3001
|
|
|
|
|
|
|
|
3002
|
|
|
|
|
|
|
sub GetServerSignalRules { |
3003
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3004
|
0
|
|
|
|
|
|
$this->send('GetServerSignalRules'); |
3005
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3006
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3007
|
|
|
|
|
|
|
} |
3008
|
|
|
|
|
|
|
|
3009
|
|
|
|
|
|
|
sub SetServerSignalRules { |
3010
|
0
|
|
|
0
|
0
|
|
my ($this, $rules) = @_; |
3011
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetServerSignalRules(\@rules)' |
3012
|
|
|
|
|
|
|
unless defined $rules; |
3013
|
0
|
|
|
|
|
|
$this->send('SetServerSignalRules '.$this->printWords($rules)); |
3014
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3015
|
|
|
|
|
|
|
} |
3016
|
|
|
|
|
|
|
|
3017
|
|
|
|
|
|
|
#sub UpdateServerSignalRule { |
3018
|
|
|
|
|
|
|
# my ($this, $rule) = @_; |
3019
|
|
|
|
|
|
|
# croak 'usage CGP::CLI->UpdateServerSignalRule(\@rule)' |
3020
|
|
|
|
|
|
|
# unless defined $rule; |
3021
|
|
|
|
|
|
|
# $this->send('UpdateServerSignalRule '.$this->printWords($rule)); |
3022
|
|
|
|
|
|
|
# $this->_parseResponse(); |
3023
|
|
|
|
|
|
|
#} |
3024
|
|
|
|
|
|
|
|
3025
|
|
|
|
|
|
|
sub GetClusterMailRules { |
3026
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3027
|
0
|
|
|
|
|
|
$this->send('GetClusterMailRules'); |
3028
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3029
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3030
|
|
|
|
|
|
|
} |
3031
|
|
|
|
|
|
|
|
3032
|
|
|
|
|
|
|
sub SetClusterMailRules { |
3033
|
0
|
|
|
0
|
0
|
|
my ($this, $rules) = @_; |
3034
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterMailRules(\@rules)' |
3035
|
|
|
|
|
|
|
unless defined $rules; |
3036
|
0
|
|
|
|
|
|
$this->send('SetClusterMailRules '.$this->printWords($rules)); |
3037
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3038
|
|
|
|
|
|
|
} |
3039
|
|
|
|
|
|
|
|
3040
|
|
|
|
|
|
|
#sub UpdateClusterMailRule { |
3041
|
|
|
|
|
|
|
# my ($this, $rule) = @_; |
3042
|
|
|
|
|
|
|
# croak 'usage CGP::CLI->UpdateClusterMailRule(\@rule)' |
3043
|
|
|
|
|
|
|
# unless defined $rule; |
3044
|
|
|
|
|
|
|
# $this->send('UpdateClusterMailRule '.$this->printWords($rule)); |
3045
|
|
|
|
|
|
|
# $this->_parseResponse(); |
3046
|
|
|
|
|
|
|
#} |
3047
|
|
|
|
|
|
|
|
3048
|
|
|
|
|
|
|
sub GetClusterSignalRules { |
3049
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3050
|
0
|
|
|
|
|
|
$this->send('GetClusterSignalRules'); |
3051
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3052
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3053
|
|
|
|
|
|
|
} |
3054
|
|
|
|
|
|
|
|
3055
|
|
|
|
|
|
|
sub SetClusterSignalRules { |
3056
|
0
|
|
|
0
|
0
|
|
my ($this, $rules) = @_; |
3057
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterSignalRules(\@rules)' |
3058
|
|
|
|
|
|
|
unless defined $rules; |
3059
|
0
|
|
|
|
|
|
$this->send('SetClusterSignalRules '.$this->printWords($rules)); |
3060
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3061
|
|
|
|
|
|
|
} |
3062
|
|
|
|
|
|
|
|
3063
|
|
|
|
|
|
|
#sub UpdateClusterSignalRule { |
3064
|
|
|
|
|
|
|
# my ($this, $rule) = @_; |
3065
|
|
|
|
|
|
|
# croak 'usage CGP::CLI->UpdateClusterSignalRule(\@rule)' |
3066
|
|
|
|
|
|
|
# unless defined $rule; |
3067
|
|
|
|
|
|
|
# $this->send('UpdateClusterSignalRule '.$this->printWords($rule)); |
3068
|
|
|
|
|
|
|
# $this->_parseResponse(); |
3069
|
|
|
|
|
|
|
#} |
3070
|
|
|
|
|
|
|
|
3071
|
|
|
|
|
|
|
|
3072
|
|
|
|
|
|
|
|
3073
|
|
|
|
|
|
|
sub RefreshOSData { |
3074
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
3075
|
0
|
|
|
|
|
|
$this->send('RefreshOSData'); |
3076
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3077
|
|
|
|
|
|
|
} |
3078
|
|
|
|
|
|
|
|
3079
|
|
|
|
|
|
|
sub GetRouterTable { |
3080
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3081
|
0
|
|
|
|
|
|
$this->send('GetRouterTable'); |
3082
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3083
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3084
|
|
|
|
|
|
|
} |
3085
|
|
|
|
|
|
|
|
3086
|
|
|
|
|
|
|
sub SetRouterTable { |
3087
|
0
|
|
|
0
|
0
|
|
my ($this, $table) = @_; |
3088
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetRouterTable("=addr1\@domain.com\\e=addr2\@domain.com\\e")' |
3089
|
|
|
|
|
|
|
unless defined $table; |
3090
|
0
|
|
|
|
|
|
$this->send('SetRouterTable '.$this->printWords($table)); |
3091
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3092
|
|
|
|
|
|
|
} |
3093
|
|
|
|
|
|
|
|
3094
|
|
|
|
|
|
|
sub GetRouterSettings { |
3095
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3096
|
0
|
|
|
|
|
|
$this->send('GetRouterSettings'); |
3097
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3098
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3099
|
|
|
|
|
|
|
} |
3100
|
|
|
|
|
|
|
|
3101
|
|
|
|
|
|
|
sub SetRouterSettings { |
3102
|
0
|
|
|
0
|
0
|
|
my ($this, $settings) = @_; |
3103
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetRouterSettings(\@settings)' |
3104
|
|
|
|
|
|
|
unless defined $settings; |
3105
|
0
|
|
|
|
|
|
$this->send('SetRouterSettings '.$this->printWords($settings)); |
3106
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3107
|
|
|
|
|
|
|
} |
3108
|
|
|
|
|
|
|
|
3109
|
|
|
|
|
|
|
|
3110
|
|
|
|
|
|
|
sub GetClusterRouterTable { |
3111
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3112
|
0
|
|
|
|
|
|
$this->send('GetClusterRouterTable'); |
3113
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3114
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3115
|
|
|
|
|
|
|
} |
3116
|
|
|
|
|
|
|
|
3117
|
|
|
|
|
|
|
sub SetClusterRouterTable { |
3118
|
0
|
|
|
0
|
0
|
|
my ($this, $table) = @_; |
3119
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterRouterTable("=addr1\@domain.com\\e=addr2\@domain.com\\e")' |
3120
|
|
|
|
|
|
|
unless defined $table; |
3121
|
0
|
|
|
|
|
|
$this->send('SetClusterRouterTable '.$this->printWords($table)); |
3122
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3123
|
|
|
|
|
|
|
} |
3124
|
|
|
|
|
|
|
|
3125
|
|
|
|
|
|
|
|
3126
|
|
|
|
|
|
|
sub GetServerIntercept { |
3127
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
3128
|
0
|
|
|
|
|
|
$this->send('GetServerIntercept'); |
3129
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3130
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3131
|
|
|
|
|
|
|
} |
3132
|
|
|
|
|
|
|
sub SetServerIntercept { |
3133
|
0
|
|
|
0
|
0
|
|
my ( $this, $settings ) = @_; |
3134
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetServerIntercept(\%settings)' |
3135
|
|
|
|
|
|
|
unless defined $settings; |
3136
|
0
|
|
|
|
|
|
$this->send ('SetServerIntercept '.$this->printWords($settings)); |
3137
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3138
|
|
|
|
|
|
|
} |
3139
|
|
|
|
|
|
|
|
3140
|
|
|
|
|
|
|
sub GetClusterIntercept { |
3141
|
0
|
|
|
0
|
0
|
|
my ( $this ) = @_; |
3142
|
0
|
|
|
|
|
|
$this->send('GetClusterIntercept'); |
3143
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3144
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3145
|
|
|
|
|
|
|
} |
3146
|
|
|
|
|
|
|
sub SetClusterIntercept { |
3147
|
0
|
|
|
0
|
0
|
|
my ( $this, $settings ) = @_; |
3148
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetClusterIntercept(\%settings)' |
3149
|
|
|
|
|
|
|
unless defined $settings; |
3150
|
0
|
|
|
|
|
|
$this->send ('SetClusterIntercept '.$this->printWords($settings)); |
3151
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3152
|
|
|
|
|
|
|
} |
3153
|
|
|
|
|
|
|
|
3154
|
|
|
|
|
|
|
|
3155
|
|
|
|
|
|
|
sub Route { |
3156
|
0
|
|
|
0
|
0
|
|
my ($this, $address, $mail) = @_; |
3157
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->Route(address[,"mail"])' |
3158
|
|
|
|
|
|
|
unless defined $address; |
3159
|
0
|
|
|
|
|
|
my $line='Route '.$address; |
3160
|
0
|
0
|
|
|
|
|
$line .= ' mail' if($mail); |
3161
|
0
|
|
|
|
|
|
$this->send($line); |
3162
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3163
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3164
|
|
|
|
|
|
|
} |
3165
|
|
|
|
|
|
|
|
3166
|
|
|
|
|
|
|
############################################# |
3167
|
|
|
|
|
|
|
# Monitoring commands |
3168
|
|
|
|
|
|
|
|
3169
|
|
|
|
|
|
|
sub GetSNMPElement { |
3170
|
0
|
|
|
0
|
0
|
|
my ($this, $element) = @_; |
3171
|
0
|
|
|
|
|
|
$this->send('GetSNMPElement '.$element); |
3172
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3173
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3174
|
|
|
|
|
|
|
} |
3175
|
|
|
|
|
|
|
sub GetDialogInfo { |
3176
|
0
|
|
|
0
|
0
|
|
my ($this, $dialogID) = @_; |
3177
|
0
|
|
|
|
|
|
$this->send('GetDialogInfo '.$dialogID); |
3178
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3179
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3180
|
|
|
|
|
|
|
} |
3181
|
|
|
|
|
|
|
|
3182
|
|
|
|
|
|
|
sub Shutdown { |
3183
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3184
|
0
|
|
|
|
|
|
$this->send('SHUTDOWN'); |
3185
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3186
|
|
|
|
|
|
|
} |
3187
|
|
|
|
|
|
|
|
3188
|
|
|
|
|
|
|
############################################# |
3189
|
|
|
|
|
|
|
# Statistics commands |
3190
|
|
|
|
|
|
|
|
3191
|
|
|
|
|
|
|
sub GetAccountStat { |
3192
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $key) = @_; |
3193
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetAccountStat($account[,$key])' |
3194
|
|
|
|
|
|
|
unless defined $account; |
3195
|
0
|
|
|
|
|
|
my $line = 'GetAccountStat '.$account; |
3196
|
0
|
0
|
|
|
|
|
$line .= ' Key '.$key if $key; |
3197
|
0
|
|
|
|
|
|
$this->send($line); |
3198
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3199
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3200
|
|
|
|
|
|
|
} |
3201
|
|
|
|
|
|
|
|
3202
|
|
|
|
|
|
|
sub ResetAccountStat { |
3203
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $key) = @_; |
3204
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ResetAccountStat($account[,$key])' |
3205
|
|
|
|
|
|
|
unless defined $account; |
3206
|
0
|
|
|
|
|
|
my $line = 'ResetAccountStat '.$account; |
3207
|
0
|
0
|
|
|
|
|
$line .= ' Key '.$key if $key; |
3208
|
0
|
|
|
|
|
|
$this->send($line); |
3209
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3210
|
|
|
|
|
|
|
} |
3211
|
|
|
|
|
|
|
|
3212
|
|
|
|
|
|
|
sub GetDomainStat { |
3213
|
0
|
|
|
0
|
0
|
|
my ($this, $domain, $key) = @_; |
3214
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->GetDomainStat($domain[,$key])' |
3215
|
|
|
|
|
|
|
unless defined $domain; |
3216
|
0
|
|
|
|
|
|
my $line = 'GetDomainStat '.$domain; |
3217
|
0
|
0
|
|
|
|
|
$line .= ' Key '.$key if $key; |
3218
|
0
|
|
|
|
|
|
$this->send($line); |
3219
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3220
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3221
|
|
|
|
|
|
|
} |
3222
|
|
|
|
|
|
|
|
3223
|
|
|
|
|
|
|
sub ResetDomainStat { |
3224
|
0
|
|
|
0
|
0
|
|
my ($this, $domain, $key) = @_; |
3225
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ResetDomainStat($domain[,$key])' |
3226
|
|
|
|
|
|
|
unless defined $domain; |
3227
|
0
|
|
|
|
|
|
my $line = 'ResetDomainStat '.$domain; |
3228
|
0
|
0
|
|
|
|
|
$line .= ' Key '.$key if $key; |
3229
|
0
|
|
|
|
|
|
$this->send($line); |
3230
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3231
|
|
|
|
|
|
|
} |
3232
|
|
|
|
|
|
|
|
3233
|
|
|
|
|
|
|
############################################# |
3234
|
|
|
|
|
|
|
# Miscellaneous commands |
3235
|
|
|
|
|
|
|
|
3236
|
|
|
|
|
|
|
sub WriteLog { |
3237
|
0
|
|
|
0
|
0
|
|
my ($this, $level, $msg) = @_; |
3238
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->WriteLog($level,$message)' |
3239
|
|
|
|
|
|
|
unless defined $level && defined $msg; |
3240
|
0
|
|
|
|
|
|
$this->send('WriteLog '.$level.' '.$this->printWords($msg)); |
3241
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3242
|
|
|
|
|
|
|
} |
3243
|
|
|
|
|
|
|
sub ReleaseSMTPQueue { |
3244
|
0
|
|
|
0
|
0
|
|
my ($this, $queue) = @_; |
3245
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->ReleaseSMTPQueue($queueName)' |
3246
|
|
|
|
|
|
|
unless defined $queue; |
3247
|
0
|
|
|
|
|
|
$this->send('ReleaseSMTPQueue '.$this->printWords($queue)); |
3248
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3249
|
|
|
|
|
|
|
} |
3250
|
|
|
|
|
|
|
sub RejectQueueMessage { |
3251
|
0
|
|
|
0
|
0
|
|
my ($this, $msg, $text) = @_; |
3252
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->RejectQueueMessage($msgID [,$errorText])' |
3253
|
|
|
|
|
|
|
unless defined $msg; |
3254
|
0
|
|
|
|
|
|
my $line = 'RejectQueueMessage '.$msg; |
3255
|
0
|
0
|
|
|
|
|
$line .= $this->printWords($text) if $text; |
3256
|
0
|
|
|
|
|
|
$this->send($line); |
3257
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3258
|
|
|
|
|
|
|
} |
3259
|
|
|
|
|
|
|
sub GetMessageQueueInfo { |
3260
|
0
|
|
|
0
|
0
|
|
my ($this, $moduleName, $queueName) = @_; |
3261
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->GetMessageQueueInfo($moduleName,$queueName)' |
3262
|
|
|
|
|
|
|
unless (defined $moduleName && defined $queueName); |
3263
|
0
|
|
|
|
|
|
my $line = 'GetMessageQueueInfo '.$moduleName.' QUEUE '.$this->printWords($queueName); |
3264
|
0
|
|
|
|
|
|
$this->send($line); |
3265
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3266
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3267
|
|
|
|
|
|
|
} |
3268
|
|
|
|
|
|
|
|
3269
|
|
|
|
|
|
|
sub GetCurrentController { |
3270
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
3271
|
0
|
|
|
|
|
|
$this->send('GetCurrentController'); |
3272
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3273
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3274
|
|
|
|
|
|
|
} |
3275
|
|
|
|
|
|
|
sub GetTempClientIPs { |
3276
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
3277
|
0
|
|
|
|
|
|
$this->send('GetTempClientIPs'); |
3278
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3279
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3280
|
|
|
|
|
|
|
} |
3281
|
|
|
|
|
|
|
sub GetTempBlacklistedIPs { |
3282
|
0
|
|
|
0
|
0
|
|
my ($this) = @_; |
3283
|
0
|
|
|
|
|
|
$this->send('GetTempBlacklistedIPs'); |
3284
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3285
|
0
|
|
|
|
|
|
$this->parseWords($this->getWords); |
3286
|
|
|
|
|
|
|
} |
3287
|
|
|
|
|
|
|
sub SetTempBlacklistedIPs { |
3288
|
0
|
|
|
0
|
0
|
|
my ( $this, $addresses ) = @_; |
3289
|
0
|
0
|
|
|
|
|
croak 'usage CGP::CLI->SetTempBlacklistedIPs("111.11.1.1\e222.2.2.2")' |
3290
|
|
|
|
|
|
|
unless defined $addresses; |
3291
|
0
|
|
|
|
|
|
$this->send ('SetTempBlacklistedIPs '.$this->printWords($addresses)); |
3292
|
0
|
|
|
|
|
|
$this->_parseResponse(); |
3293
|
|
|
|
|
|
|
} |
3294
|
|
|
|
|
|
|
|
3295
|
|
|
|
|
|
|
sub RemoveAccountSubset { |
3296
|
0
|
|
|
0
|
0
|
|
my ($this, $account, $subset) = @_; |
3297
|
0
|
0
|
0
|
|
|
|
croak 'usage CGP::CLI->RemoveAccountSubset($account,$subset)' |
3298
|
|
|
|
|
|
|
unless defined $account && defined $subset; |
3299
|
0
|
|
|
|
|
|
$this->send('RemoveAccountSubset '.$account.' SUBSET '.$this->printWords($subset)); |
3300
|
0
|
0
|
|
|
|
|
return undef unless $this->_parseResponse(); |
3301
|
|
|
|
|
|
|
} |
3302
|
|
|
|
|
|
|
|
3303
|
|
|
|
|
|
|
|
3304
|
|
|
|
|
|
|
######################################################################### |
3305
|
|
|
|
|
|
|
######################################################################### |
3306
|
|
|
|
|
|
|
## Internal routines |
3307
|
|
|
|
|
|
|
|
3308
|
|
|
|
|
|
|
sub _setStrangeError |
3309
|
|
|
|
|
|
|
{ |
3310
|
0
|
|
|
0
|
|
|
my ($this, $line, $code) = @_; |
3311
|
0
|
0
|
|
|
|
|
if ($code) |
3312
|
|
|
|
|
|
|
{ |
3313
|
0
|
|
|
|
|
|
$this->{errCode} = $code; |
3314
|
|
|
|
|
|
|
} |
3315
|
|
|
|
|
|
|
else |
3316
|
|
|
|
|
|
|
{ |
3317
|
0
|
|
|
|
|
|
$this->{errCode} = $CGP::CLI_CODE_STRANGE; |
3318
|
|
|
|
|
|
|
} |
3319
|
0
|
|
|
|
|
|
$this->{errMsg} = $line; |
3320
|
0
|
|
|
|
|
|
return 0; |
3321
|
|
|
|
|
|
|
} |
3322
|
|
|
|
|
|
|
|
3323
|
|
|
|
|
|
|
sub _parseResponse |
3324
|
|
|
|
|
|
|
{ |
3325
|
0
|
|
|
0
|
|
|
my $this = shift; |
3326
|
|
|
|
|
|
|
|
3327
|
0
|
|
|
|
|
|
my $responseLine = $this->{theSocket}->getline(); |
3328
|
|
|
|
|
|
|
|
3329
|
|
|
|
|
|
|
|
3330
|
0
|
0
|
|
|
|
|
print STDERR "CGP::CLI->_parseResponse::responseLine = $responseLine\n\n" |
3331
|
|
|
|
|
|
|
if $this->{'debug'}; |
3332
|
|
|
|
|
|
|
|
3333
|
0
|
|
|
|
|
|
$responseLine =~ /^(\d+)\s(.*)$/; |
3334
|
0
|
0
|
|
|
|
|
return $this->_setStrangeError($responseLine) unless ($1); |
3335
|
0
|
|
|
|
|
|
$this->{errCode} = $1; |
3336
|
0
|
0
|
|
|
|
|
if($1 == $CGP::CLI_CODE_OK_INLINE) { |
3337
|
0
|
|
|
|
|
|
$this->{'inlineResponse'} = $2; |
3338
|
0
|
|
|
|
|
|
$this->{errMsg} = 'OK'; |
3339
|
|
|
|
|
|
|
} else { |
3340
|
0
|
|
|
|
|
|
$this->{errMsg} = $2; |
3341
|
0
|
|
|
|
|
|
chomp($this->{errMsg}); |
3342
|
0
|
|
|
|
|
|
$this->{errMsg} =~ s/\r$//; |
3343
|
|
|
|
|
|
|
} |
3344
|
0
|
|
|
|
|
|
$this->{'lastAccess'}=time(); |
3345
|
0
|
|
|
|
|
|
$this->isSuccess; |
3346
|
|
|
|
|
|
|
} |
3347
|
|
|
|
|
|
|
|
3348
|
|
|
|
|
|
|
sub convertOutput { |
3349
|
0
|
|
|
0
|
0
|
|
my $data = $_[0]; |
3350
|
0
|
|
|
|
|
|
my $translate = $_[1]; |
3351
|
0
|
0
|
|
|
|
|
if(!defined($data)) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
3352
|
0
|
|
|
|
|
|
return '#NULL#'; |
3353
|
|
|
|
|
|
|
} elsif(ref($data) eq 'HASH') { |
3354
|
0
|
|
|
|
|
|
my $outp='{'; |
3355
|
|
|
|
|
|
|
#$outp.="\n"; |
3356
|
0
|
|
|
|
|
|
foreach (sort keys %$data) { |
3357
|
0
|
|
|
|
|
|
my $value=@$data{$_}; |
3358
|
0
|
|
|
|
|
|
$outp .= convertOutput($_,$translate).'='.convertOutput($value,$translate).';'; |
3359
|
|
|
|
|
|
|
#$outp.="\n"; |
3360
|
|
|
|
|
|
|
} |
3361
|
0
|
|
|
|
|
|
$outp.= '}'; |
3362
|
|
|
|
|
|
|
#$outp.="\n"; |
3363
|
0
|
|
|
|
|
|
return $outp; |
3364
|
|
|
|
|
|
|
} elsif(ref($data) eq 'ARRAY') { |
3365
|
0
|
|
|
|
|
|
my $outp='('; |
3366
|
0
|
|
|
|
|
|
my $first=1; |
3367
|
0
|
|
|
|
|
|
foreach (@$data) { |
3368
|
0
|
0
|
|
|
|
|
if(!$first) { $outp.=','; } else { $first=0; } |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3369
|
0
|
|
|
|
|
|
$outp.=convertOutput($_,$translate); |
3370
|
|
|
|
|
|
|
} |
3371
|
0
|
|
|
|
|
|
$outp.= ')'; |
3372
|
0
|
|
|
|
|
|
return $outp; |
3373
|
|
|
|
|
|
|
} else { |
3374
|
0
|
0
|
0
|
|
|
|
if($data =~ /[\W_]/ || $data eq '') { |
3375
|
0
|
0
|
|
|
|
|
if($translate) { |
3376
|
0
|
|
|
|
|
|
$data =~ s/\\((?![enr\d]))/\\\\$1/g; |
3377
|
0
|
|
|
|
|
|
$data =~ s/\"/\\\"/g; |
3378
|
|
|
|
|
|
|
} |
3379
|
0
|
|
|
|
|
|
$data =~ s/([\x00-\x1F\x7F])/'\\'.('0'x(3-length(ord($1)))).ord($1)/ge; |
|
0
|
|
|
|
|
|
|
3380
|
|
|
|
|
|
|
|
3381
|
0
|
|
|
|
|
|
return '"' . $data . '"'; |
3382
|
|
|
|
|
|
|
} else { |
3383
|
0
|
|
|
|
|
|
return $data; |
3384
|
|
|
|
|
|
|
} |
3385
|
|
|
|
|
|
|
} |
3386
|
|
|
|
|
|
|
} |
3387
|
|
|
|
|
|
|
|
3388
|
|
|
|
|
|
|
sub printWords { |
3389
|
0
|
|
|
0
|
0
|
|
my ($this,$data)= @_; |
3390
|
0
|
|
|
|
|
|
return convertOutput($data,$this->{'translateStrings'}); |
3391
|
|
|
|
|
|
|
} |
3392
|
|
|
|
|
|
|
|
3393
|
|
|
|
|
|
|
sub strip |
3394
|
|
|
|
|
|
|
{ |
3395
|
0
|
|
|
0
|
0
|
|
my $line = shift; |
3396
|
0
|
|
|
|
|
|
$line =~ s/^\s+//; |
3397
|
0
|
|
|
|
|
|
$line =~ s/\s+$//; |
3398
|
0
|
|
|
|
|
|
return $line; |
3399
|
|
|
|
|
|
|
} |
3400
|
|
|
|
|
|
|
|
3401
|
|
|
|
|
|
|
sub getWords { |
3402
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3403
|
0
|
0
|
|
|
|
|
if($this->{errCode} == $CGP::CLI_CODE_OK_INLINE) { |
3404
|
0
|
|
|
|
|
|
return $this->{'inlineResponse'}; |
3405
|
|
|
|
|
|
|
} |
3406
|
0
|
|
|
|
|
|
my ($bag, $line) = ('', ''); |
3407
|
0
|
|
|
|
|
|
my $firstLine = 1; |
3408
|
0
|
|
|
|
|
|
my $lastLine = ''; |
3409
|
0
|
|
|
|
|
|
while (1) { |
3410
|
0
|
|
|
|
|
|
$line = $this->{theSocket}->getline(); |
3411
|
0
|
|
|
|
|
|
chomp $line; |
3412
|
0
|
|
|
|
|
|
$line = strip($line); |
3413
|
0
|
0
|
|
|
|
|
if($firstLine) { |
3414
|
0
|
|
|
|
|
|
$line =~ /^(.)/; |
3415
|
0
|
0
|
|
|
|
|
if ($1) { |
3416
|
0
|
0
|
|
|
|
|
$lastLine = '\)' if $1 eq '('; |
3417
|
0
|
0
|
|
|
|
|
$lastLine = '\}' if $1 eq '{'; |
3418
|
0
|
|
|
|
|
|
$lastLine = $lastLine . '$'; |
3419
|
0
|
|
|
|
|
|
$firstLine = 0; |
3420
|
|
|
|
|
|
|
} |
3421
|
|
|
|
|
|
|
} |
3422
|
0
|
|
|
|
|
|
$bag .= $line; |
3423
|
0
|
0
|
|
|
|
|
last if $line =~ /$lastLine/; |
3424
|
|
|
|
|
|
|
} |
3425
|
0
|
|
|
|
|
|
return $bag; |
3426
|
|
|
|
|
|
|
} |
3427
|
|
|
|
|
|
|
|
3428
|
|
|
|
|
|
|
|
3429
|
|
|
|
|
|
|
sub send { |
3430
|
0
|
|
|
0
|
0
|
|
my ($this, $command) = @_; |
3431
|
|
|
|
|
|
|
|
3432
|
0
|
0
|
0
|
|
|
|
if(time()-$this->{'lastAccess'} > $CGP::TIMEOUT || |
|
|
|
0
|
|
|
|
|
3433
|
|
|
|
|
|
|
!($this->{theSocket}) || |
3434
|
|
|
|
|
|
|
$this->{theSocket}->error()) { |
3435
|
0
|
0
|
|
|
|
|
$this->{theSocket}->shutdown(SHUT_RDWR) if($this->{theSocket}); |
3436
|
0
|
0
|
|
|
|
|
unless($this->connect()) { |
3437
|
0
|
|
|
|
|
|
die "Failure: Can't reopen CLI connection"; |
3438
|
|
|
|
|
|
|
} |
3439
|
|
|
|
|
|
|
} |
3440
|
|
|
|
|
|
|
|
3441
|
0
|
|
|
|
|
|
$this->{currentCGateCommand} = $command; |
3442
|
0
|
0
|
|
|
|
|
print STDERR ref($this) . "->send($command)\n\n" |
3443
|
|
|
|
|
|
|
if $this->{'debug'}; |
3444
|
0
|
|
|
|
|
|
$this->{'lastAccess'}=time(); |
3445
|
0
|
|
|
|
|
|
print {$this->{theSocket}} $command."\012"; |
|
0
|
|
|
|
|
|
|
3446
|
|
|
|
|
|
|
} |
3447
|
|
|
|
|
|
|
|
3448
|
|
|
|
|
|
|
|
3449
|
|
|
|
|
|
|
########################### |
3450
|
|
|
|
|
|
|
|
3451
|
|
|
|
|
|
|
sub skipSpaces { |
3452
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3453
|
0
|
|
0
|
|
|
|
while($this->{'span'} < $this->{'len'} && substr($this->{'data'},$this->{'span'},1) =~ /\s/) { ++$this->{'span'}; } |
|
0
|
|
|
|
|
|
|
3454
|
|
|
|
|
|
|
} |
3455
|
|
|
|
|
|
|
|
3456
|
|
|
|
|
|
|
sub readWord { |
3457
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3458
|
0
|
|
|
|
|
|
my $isQuoted=0; |
3459
|
0
|
|
|
|
|
|
my $isBlock=0; |
3460
|
0
|
|
|
|
|
|
my $result=""; |
3461
|
|
|
|
|
|
|
|
3462
|
0
|
|
|
|
|
|
$this->skipSpaces(); |
3463
|
0
|
0
|
|
|
|
|
if(substr($this->{'data'},$this->{'span'},1) eq '"') { |
|
|
0
|
|
|
|
|
|
3464
|
0
|
|
|
|
|
|
$isQuoted=1; ++$this->{'span'}; |
|
0
|
|
|
|
|
|
|
3465
|
|
|
|
|
|
|
} elsif(substr($this->{'data'},$this->{'span'},1) eq '[') { |
3466
|
0
|
|
|
|
|
|
$isBlock=1; |
3467
|
|
|
|
|
|
|
} |
3468
|
0
|
|
|
|
|
|
while($this->{'span'} < $this->{'len'}) { |
3469
|
0
|
|
|
|
|
|
my $ch=substr($this->{'data'},$this->{'span'},1); |
3470
|
|
|
|
|
|
|
|
3471
|
0
|
0
|
|
|
|
|
if($isQuoted) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
3472
|
0
|
0
|
|
|
|
|
if($ch eq '\\') { |
|
|
0
|
|
|
|
|
|
3473
|
0
|
0
|
|
|
|
|
if(substr($this->{'data'},$this->{'span'}+1,3) =~ /^(?:\"|\\|\d\d\d)/) { |
3474
|
0
|
|
|
|
|
|
$ch=substr($this->{'data'},++$this->{'span'},3); |
3475
|
0
|
0
|
|
|
|
|
if($ch =~ /\d\d\d/) { |
3476
|
0
|
|
|
|
|
|
$this->{'span'}+=2; |
3477
|
0
|
|
|
|
|
|
$ch=chr($ch); |
3478
|
|
|
|
|
|
|
} else { |
3479
|
0
|
|
|
|
|
|
$ch=substr($ch,0,1); |
3480
|
0
|
0
|
|
|
|
|
$ch='\\'.$ch unless($this->{'translateStrings'}); |
3481
|
|
|
|
|
|
|
} |
3482
|
|
|
|
|
|
|
} |
3483
|
|
|
|
|
|
|
} elsif($ch eq '"') { |
3484
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3485
|
0
|
|
|
|
|
|
$this->skipSpaces(); |
3486
|
0
|
0
|
|
|
|
|
if(substr($this->{'data'},$this->{'span'},1) eq '"') { |
3487
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3488
|
|
|
|
|
|
|
} else { |
3489
|
0
|
|
|
|
|
|
last; |
3490
|
|
|
|
|
|
|
} |
3491
|
|
|
|
|
|
|
} |
3492
|
|
|
|
|
|
|
} elsif($isBlock) { |
3493
|
0
|
0
|
|
|
|
|
if($ch eq ']') { |
3494
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3495
|
0
|
|
|
|
|
|
$this->skipSpaces(); |
3496
|
0
|
0
|
|
|
|
|
if(substr($this->{'data'},$this->{'span'},1) eq '[') { |
3497
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3498
|
|
|
|
|
|
|
} else { |
3499
|
0
|
|
|
|
|
|
$result .= ']'; |
3500
|
0
|
|
|
|
|
|
last; |
3501
|
|
|
|
|
|
|
} |
3502
|
|
|
|
|
|
|
|
3503
|
|
|
|
|
|
|
} |
3504
|
|
|
|
|
|
|
} elsif($ch =~ /[-a-zA-Z0-9\x80-\xff_\.\@\!\#\%\:]/) { |
3505
|
|
|
|
|
|
|
} else { |
3506
|
0
|
|
|
|
|
|
last; |
3507
|
|
|
|
|
|
|
} |
3508
|
0
|
|
|
|
|
|
$result .= $ch; |
3509
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3510
|
|
|
|
|
|
|
} |
3511
|
0
|
|
|
|
|
|
return $result; |
3512
|
|
|
|
|
|
|
} |
3513
|
|
|
|
|
|
|
|
3514
|
|
|
|
|
|
|
|
3515
|
|
|
|
|
|
|
sub readKey() { |
3516
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3517
|
0
|
|
|
|
|
|
return $this->readWord(); |
3518
|
|
|
|
|
|
|
} |
3519
|
|
|
|
|
|
|
|
3520
|
|
|
|
|
|
|
|
3521
|
|
|
|
|
|
|
sub readValue() { |
3522
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3523
|
0
|
|
|
|
|
|
$this->skipSpaces(); |
3524
|
0
|
|
|
|
|
|
my $ch=substr($this->{'data'},$this->{'span'},1); |
3525
|
0
|
0
|
|
|
|
|
if($ch eq '{') { |
|
|
0
|
|
|
|
|
|
3526
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3527
|
0
|
|
|
|
|
|
return $this->readDictionary(); |
3528
|
|
|
|
|
|
|
} elsif($ch eq '(') { |
3529
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3530
|
0
|
|
|
|
|
|
return $this->readArray(); |
3531
|
|
|
|
|
|
|
} else { |
3532
|
0
|
|
|
|
|
|
return $this->readWord(); |
3533
|
|
|
|
|
|
|
} |
3534
|
|
|
|
|
|
|
} |
3535
|
|
|
|
|
|
|
|
3536
|
|
|
|
|
|
|
sub readArray() { |
3537
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3538
|
0
|
|
|
|
|
|
my $result=[]; |
3539
|
0
|
|
|
|
|
|
while($this->{'span'}<$this->{'len'}) { |
3540
|
0
|
|
|
|
|
|
$this->skipSpaces(); |
3541
|
0
|
0
|
|
|
|
|
if(substr($this->{'data'},$this->{'span'},1) eq ')') { |
3542
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3543
|
0
|
|
|
|
|
|
last; |
3544
|
|
|
|
|
|
|
} else { |
3545
|
0
|
|
|
|
|
|
my $theValue=$this->readValue(); |
3546
|
0
|
|
|
|
|
|
$this->skipSpaces(); |
3547
|
0
|
|
|
|
|
|
push(@$result,$theValue); |
3548
|
0
|
0
|
|
|
|
|
if(substr($this->{'data'},$this->{'span'},1) eq ',') { |
|
|
0
|
|
|
|
|
|
3549
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3550
|
|
|
|
|
|
|
} elsif(substr($this->{'data'},$this->{'span'},1) eq ')') { |
3551
|
|
|
|
|
|
|
} else { |
3552
|
0
|
|
|
|
|
|
croak "CGPro output format error:",substr($this->{'data'},$this->{'span'},10); |
3553
|
|
|
|
|
|
|
} |
3554
|
|
|
|
|
|
|
} |
3555
|
|
|
|
|
|
|
} |
3556
|
0
|
|
|
|
|
|
return $result; |
3557
|
|
|
|
|
|
|
} |
3558
|
|
|
|
|
|
|
|
3559
|
|
|
|
|
|
|
sub readDictionary { |
3560
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3561
|
0
|
|
|
|
|
|
my $result={}; |
3562
|
0
|
|
|
|
|
|
while($this->{'span'} < $this->{'len'}) { |
3563
|
0
|
|
|
|
|
|
$this->skipSpaces(); |
3564
|
0
|
0
|
|
|
|
|
if(substr($this->{'data'},$this->{'span'},1) eq '}') { |
3565
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3566
|
0
|
|
|
|
|
|
last; |
3567
|
|
|
|
|
|
|
} else { |
3568
|
0
|
|
|
|
|
|
my $theKey=$this->readKey(); |
3569
|
0
|
|
|
|
|
|
$this->skipSpaces(); |
3570
|
0
|
0
|
|
|
|
|
if(substr($this->{'data'},$this->{'span'},1) ne '=') { croak "CGPro output format error:",substr($this->{'data'},$this->{'span'},10); } |
|
0
|
|
|
|
|
|
|
3571
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3572
|
0
|
|
|
|
|
|
@$result{$theKey}=$this->readValue(); |
3573
|
0
|
|
|
|
|
|
$this->skipSpaces(); |
3574
|
0
|
0
|
|
|
|
|
if(substr($this->{'data'},$this->{'span'},1) ne ';') { croak "CGPro output format error:",substr($this->{'data'},$this->{'span'},10); } |
|
0
|
|
|
|
|
|
|
3575
|
0
|
|
|
|
|
|
++$this->{'span'}; |
3576
|
|
|
|
|
|
|
} |
3577
|
|
|
|
|
|
|
} |
3578
|
0
|
|
|
|
|
|
return $result; |
3579
|
|
|
|
|
|
|
} |
3580
|
|
|
|
|
|
|
|
3581
|
|
|
|
|
|
|
sub parseWords { |
3582
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
3583
|
|
|
|
|
|
|
|
3584
|
0
|
|
|
|
|
|
$this->{'data'}=shift; |
3585
|
0
|
|
|
|
|
|
$this->{'span'}=0; |
3586
|
0
|
|
|
|
|
|
$this->{'len'}=length($this->{'data'}); |
3587
|
0
|
|
|
|
|
|
return $this->readValue(); |
3588
|
|
|
|
|
|
|
} |
3589
|
|
|
|
|
|
|
|
3590
|
|
|
|
|
|
|
1; |
3591
|
|
|
|
|
|
|
|
3592
|
|
|
|
|
|
|
=pod |
3593
|
|
|
|
|
|
|
|
3594
|
|
|
|
|
|
|
=head1 NAME |
3595
|
|
|
|
|
|
|
|
3596
|
|
|
|
|
|
|
CGP::CLI |
3597
|
|
|
|
|
|
|
|
3598
|
|
|
|
|
|
|
=head1 SYNOPSIS |
3599
|
|
|
|
|
|
|
|
3600
|
|
|
|
|
|
|
See http://www.stalker.com/CGPerl/ |
3601
|
|
|
|
|
|
|
|
3602
|
|
|
|
|
|
|
=head1 DESCRIPTION |
3603
|
|
|
|
|
|
|
|
3604
|
|
|
|
|
|
|
CommunigatePro Command Line Interface perl module. |
3605
|
|
|
|
|
|
|
|
3606
|
|
|
|
|
|
|
This is Stalker's CLI.pm packaged for CPAN. |
3607
|
|
|
|
|
|
|
The original CLI.pm file is available from Stalker's website at: |
3608
|
|
|
|
|
|
|
|
3609
|
|
|
|
|
|
|
http://www.stalker.com/CGPerl/CLI.pm |
3610
|
|
|
|
|
|
|
|
3611
|
|
|
|
|
|
|
The only changes are the addition of the VERSION variable for MakeMaker |
3612
|
|
|
|
|
|
|
and this short POD at the end. |
3613
|
|
|
|
|
|
|
|
3614
|
|
|
|
|
|
|
=head1 AUTHOR |
3615
|
|
|
|
|
|
|
|
3616
|
|
|
|
|
|
|
Stalker, Inc. |
3617
|
|
|
|
|
|
|
|
3618
|
|
|
|
|
|
|
=cut |