@@ -79,31 +79,31 @@ discard block |
||
79 | 79 | 'api.chunk.start' => $page * $limit |
80 | 80 | ]; |
81 | 81 | |
82 | - if ( ! empty($options['limit'])) { |
|
82 | + if (!empty($options['limit'])) { |
|
83 | 83 | $params['api.chunk.size'] = intval($options['limit']); |
84 | 84 | } |
85 | 85 | |
86 | - if ( ! empty($options['page'])) { |
|
86 | + if (!empty($options['page'])) { |
|
87 | 87 | $params['api.chunk.start'] = intval($options['page']) * $params['api.chunk.size']; |
88 | 88 | } |
89 | 89 | |
90 | - if ( ! empty($searchType) && ! in_array($searchType, ["domain", "owner", "user", "ip", "package"])) { |
|
90 | + if (!empty($searchType) && !in_array($searchType, ["domain", "owner", "user", "ip", "package"])) { |
|
91 | 91 | throw new \InvalidArgumentException("`searchType` must be one of these - domain, owner, user, ip, package"); |
92 | 92 | } |
93 | 93 | |
94 | - if ( ! empty($options['searchmethod']) && ! in_array($options['searchmethod'], ["exact", "regex"])) { |
|
94 | + if (!empty($options['searchmethod']) && !in_array($options['searchmethod'], ["exact", "regex"])) { |
|
95 | 95 | throw new \InvalidArgumentException("options[searchmethod] must be either `regex` or `exact`"); |
96 | 96 | } |
97 | 97 | |
98 | - if ( ! empty($options['want'])) { |
|
98 | + if (!empty($options['want'])) { |
|
99 | 99 | $params['want'] = $options['want']; |
100 | 100 | } |
101 | 101 | |
102 | - if ( ! empty($searchType)) { |
|
102 | + if (!empty($searchType)) { |
|
103 | 103 | $params['searchtype'] = $searchType; |
104 | 104 | } |
105 | 105 | |
106 | - if ( ! empty($keyword)) { |
|
106 | + if (!empty($keyword)) { |
|
107 | 107 | $params['search'] = $keyword; |
108 | 108 | empty($searchType) ? $params['searchtype'] = "user" : null; |
109 | 109 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | throw ClientExceptions::invalidArgument("You must provide either a username or a domain or both"); |
146 | 146 | } |
147 | 147 | |
148 | - if ( ! empty($user) && ! empty($domain)) { |
|
148 | + if (!empty($user) && !empty($domain)) { |
|
149 | 149 | throw ClientExceptions::invalidArgument( |
150 | 150 | "You must provide only one argument either user OR domain (not both)" |
151 | 151 | ); |
@@ -153,11 +153,11 @@ discard block |
||
153 | 153 | |
154 | 154 | $params = []; |
155 | 155 | |
156 | - if ( ! empty($user)) { |
|
156 | + if (!empty($user)) { |
|
157 | 157 | $params['user'] = $user; |
158 | 158 | } |
159 | 159 | |
160 | - if ( ! empty($domain)) { |
|
160 | + if (!empty($domain)) { |
|
161 | 161 | $params['domain'] = $domain; |
162 | 162 | } |
163 | 163 | |
@@ -168,11 +168,11 @@ discard block |
||
168 | 168 | |
169 | 169 | if ($result['status'] === 0) { |
170 | 170 | throw ClientExceptions::recordNotFound( |
171 | - ! empty($result['statusmsg']) ? $result['statusmsg'] : "Record not found" |
|
171 | + !empty($result['statusmsg']) ? $result['statusmsg'] : "Record not found" |
|
172 | 172 | ); |
173 | 173 | } |
174 | 174 | |
175 | - if ( ! empty($result['acct']) && is_array($result['acct'])) { |
|
175 | + if (!empty($result['acct']) && is_array($result['acct'])) { |
|
176 | 176 | return Account::buildFromArray($result['acct'][0]); |
177 | 177 | } |
178 | 178 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | $result = $this->client->sendRequest("/json-api/applist", 'GET', []); |
200 | 200 | |
201 | - if ( ! empty($result['app']) && sizeof($result['app']) > 0) { |
|
201 | + if (!empty($result['app']) && sizeof($result['app']) > 0) { |
|
202 | 202 | return $result['app']; |
203 | 203 | } |
204 | 204 | |
@@ -233,18 +233,18 @@ discard block |
||
233 | 233 | $params = []; |
234 | 234 | $params['username'] = $account->getUser(); |
235 | 235 | $params['domain'] = $account->getDomain(); |
236 | - ! empty($account->getPlanName()) ? $params['plan'] = $account->getPlanName() : null; |
|
237 | - ! empty($options['pkgname']) ? $params['pkgname'] = $options['pkgname'] : null; |
|
238 | - if ( ! empty($options['savepkg'])) { |
|
239 | - if ( ! in_array(intval($options['savepkg']), [0, 1])) { |
|
236 | + !empty($account->getPlanName()) ? $params['plan'] = $account->getPlanName() : null; |
|
237 | + !empty($options['pkgname']) ? $params['pkgname'] = $options['pkgname'] : null; |
|
238 | + if (!empty($options['savepkg'])) { |
|
239 | + if (!in_array(intval($options['savepkg']), [0, 1])) { |
|
240 | 240 | throw new ClientExceptions("`savepkg` must be either 0 or 1"); |
241 | 241 | } |
242 | 242 | |
243 | 243 | $params['savepkg'] = $options['savepkg']; |
244 | 244 | } |
245 | 245 | |
246 | - ! empty($options['featurelist']) ? $params['featurelist'] = $options['featurelist'] : null; |
|
247 | - if ( ! empty($account->getDiskLimit())) { |
|
246 | + !empty($options['featurelist']) ? $params['featurelist'] = $options['featurelist'] : null; |
|
247 | + if (!empty($account->getDiskLimit())) { |
|
248 | 248 | if ($account->getDiskLimit() === -1) { |
249 | 249 | $params['quota'] = 0; |
250 | 250 | } else { |
@@ -252,17 +252,17 @@ discard block |
||
252 | 252 | } |
253 | 253 | } |
254 | 254 | |
255 | - ! empty($account->getPassword()) ? $params['password'] = $account->getPassword() : null; |
|
256 | - ! empty($account->getIpAddress()) ? $params['ip'] = $account->getIpAddress() : null; |
|
257 | - ! empty($account->isCgiEnable()) ? $params['cgi'] = (int)$account->isCgiEnable() : null; |
|
258 | - ! empty($account->isSpamAssassinEnable()) ? |
|
259 | - $params['spamassassin'] = (int)$account->isSpamAssassinEnable() |
|
255 | + !empty($account->getPassword()) ? $params['password'] = $account->getPassword() : null; |
|
256 | + !empty($account->getIpAddress()) ? $params['ip'] = $account->getIpAddress() : null; |
|
257 | + !empty($account->isCgiEnable()) ? $params['cgi'] = (int) $account->isCgiEnable() : null; |
|
258 | + !empty($account->isSpamAssassinEnable()) ? |
|
259 | + $params['spamassassin'] = (int) $account->isSpamAssassinEnable() |
|
260 | 260 | : null; |
261 | - ! empty($account->isFrontPageEnable()) ? $params['frontpage'] = (int)$account->isFrontPageEnable() : null; |
|
262 | - ! empty($account->getShell()) ? $params['hasshell'] = 1 : null; |
|
263 | - ! empty($account->getEmail()) ? $params['contactemail'] = 1 : null; |
|
264 | - ! empty($account->getEmail()) ? $params['contactemail'] = 1 : null; |
|
265 | - ! empty($account->getTheme()) ? $params['cpmod'] = 1 : null; |
|
261 | + !empty($account->isFrontPageEnable()) ? $params['frontpage'] = (int) $account->isFrontPageEnable() : null; |
|
262 | + !empty($account->getShell()) ? $params['hasshell'] = 1 : null; |
|
263 | + !empty($account->getEmail()) ? $params['contactemail'] = 1 : null; |
|
264 | + !empty($account->getEmail()) ? $params['contactemail'] = 1 : null; |
|
265 | + !empty($account->getTheme()) ? $params['cpmod'] = 1 : null; |
|
266 | 266 | |
267 | 267 | if ($account->getMaxFTP() === -1) { |
268 | 268 | $params['maxftp'] = "unlimited"; |
@@ -312,18 +312,18 @@ discard block |
||
312 | 312 | $params['bwlimit'] = intval($account->getBandwidthLimit()); |
313 | 313 | } |
314 | 314 | |
315 | - ! empty($options['customip']) ? $params['customip'] = $options['customip'] : null; |
|
315 | + !empty($options['customip']) ? $params['customip'] = $options['customip'] : null; |
|
316 | 316 | |
317 | - ! empty($account->getLanguagePreference()) ? $params['language'] = $account->getLanguagePreference() : null; |
|
317 | + !empty($account->getLanguagePreference()) ? $params['language'] = $account->getLanguagePreference() : null; |
|
318 | 318 | |
319 | - ! empty($options['useregns']) ? $params['useregns'] = $options['useregns'] : null; |
|
320 | - ! empty($options['reseller']) ? $params['reseller'] = (int)$options['reseller'] : null; |
|
321 | - ! empty($options['forcedns']) ? $params['forcedns'] = (int)$options['forcedns'] : null; |
|
319 | + !empty($options['useregns']) ? $params['useregns'] = $options['useregns'] : null; |
|
320 | + !empty($options['reseller']) ? $params['reseller'] = (int) $options['reseller'] : null; |
|
321 | + !empty($options['forcedns']) ? $params['forcedns'] = (int) $options['forcedns'] : null; |
|
322 | 322 | |
323 | - ! empty($account->getMailboxFormat()) ? $params['mailbox_format'] = $account->getMailboxFormat() : null; |
|
323 | + !empty($account->getMailboxFormat()) ? $params['mailbox_format'] = $account->getMailboxFormat() : null; |
|
324 | 324 | |
325 | - if ( ! empty($options['mxcheck'])) { |
|
326 | - if ( ! in_array($options['mxcheck'], ['local', 'secondary', 'remote', 'auto'])) { |
|
325 | + if (!empty($options['mxcheck'])) { |
|
326 | + if (!in_array($options['mxcheck'], ['local', 'secondary', 'remote', 'auto'])) { |
|
327 | 327 | throw new ClientExceptions("options[mxcheck] parameters must be one of local, secondary, remote, auto"); |
328 | 328 | } |
329 | 329 | |
@@ -348,27 +348,27 @@ discard block |
||
348 | 348 | $params['max_defer_fail_percentage'] = intval($account->getMaxDeferFailMailPercentage()); |
349 | 349 | } |
350 | 350 | |
351 | - ! empty($account->getUid()) ? $params['uid'] = $account->getUid() : null; |
|
352 | - ! empty($account->getPartition()) ? $params['homedir'] = $account->getPartition() : null; |
|
353 | - ! empty($options['dkim']) ? $params['dkim'] = intval($options['dkim']) : null; |
|
354 | - ! empty($options['spf']) ? $params['spf'] = intval($options['spf']) : null; |
|
355 | - ! empty($account->getOwner()) ? $params['owner'] = $account->getOwner() : null; |
|
351 | + !empty($account->getUid()) ? $params['uid'] = $account->getUid() : null; |
|
352 | + !empty($account->getPartition()) ? $params['homedir'] = $account->getPartition() : null; |
|
353 | + !empty($options['dkim']) ? $params['dkim'] = intval($options['dkim']) : null; |
|
354 | + !empty($options['spf']) ? $params['spf'] = intval($options['spf']) : null; |
|
355 | + !empty($account->getOwner()) ? $params['owner'] = $account->getOwner() : null; |
|
356 | 356 | |
357 | 357 | $result = $this->client->sendRequest("/json-api/createacct", "GET", $params); |
358 | 358 | |
359 | - if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ |
|
359 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 0) { |
|
360 | 360 | throw new ClientExceptions($result['metadata']['reason']); |
361 | 361 | } |
362 | 362 | |
363 | - if ( ! empty($result) && ! empty($result['result'][0]) && $result['result'][0]['status'] === 0) { |
|
363 | + if (!empty($result) && !empty($result['result'][0]) && $result['result'][0]['status'] === 0) { |
|
364 | 364 | throw new ClientExceptions($result['result'][0]['statusmsg']); |
365 | 365 | } |
366 | 366 | |
367 | - if ( ! empty($result) && ! empty($result['result'][0]) && $result['result'][0]['status'] === 1) { |
|
367 | + if (!empty($result) && !empty($result['result'][0]) && $result['result'][0]['status'] === 1) { |
|
368 | 368 | return ['result' => $result['result'][0]['options'], 'raw_output' => $result['result'][0]['rawout']]; |
369 | 369 | } |
370 | 370 | |
371 | - if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ |
|
371 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
372 | 372 | return ['result' => $result['data'], 'raw_output' => $result['metadata']['output']['raw']]; |
373 | 373 | } |
374 | 374 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | $userData = $result['userdata']; |
405 | 405 | $domainUser = new DomainUser(); |
406 | - $domainUser->setHasCGI((bool)$userData['hascgi']); |
|
406 | + $domainUser->setHasCGI((bool) $userData['hascgi']); |
|
407 | 407 | $domainUser->setServerName($userData['servername']); |
408 | 408 | $domainUser->setOwner($userData['owner']); |
409 | 409 | $domainUser->setScriptAlias($userData['scriptalias']); |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | $domainUser->setGroup($userData['group']); |
414 | 414 | $domainUser->setIpAddress($userData['ip']); |
415 | 415 | $domainUser->setPort($userData['port']); |
416 | - $domainUser->setPhpOpenBaseDirectoryProtect((bool)$userData['phpopenbasedirprotect']); |
|
416 | + $domainUser->setPhpOpenBaseDirectoryProtect((bool) $userData['phpopenbasedirprotect']); |
|
417 | 417 | |
418 | 418 | if ($userData['usecanonicalname'] === "Off") { |
419 | 419 | $domainUser->setUseCanonicalName(false); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | throw new ClientExceptions($result['metadata']['reason']); |
482 | 482 | } |
483 | 483 | |
484 | - if ( ! empty($result['data'])) { |
|
484 | + if (!empty($result['data'])) { |
|
485 | 485 | return $result['updated']; |
486 | 486 | } |
487 | 487 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | return null; |
508 | 508 | } |
509 | 509 | |
510 | - if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
510 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
511 | 511 | $domains = $result['data']['domains']; |
512 | 512 | |
513 | 513 | $domainList = []; |
@@ -522,9 +522,9 @@ discard block |
||
522 | 522 | $do->setPhpVersion($domain['php_version']); |
523 | 523 | $do->setUserOwner($domain['user_owner']); |
524 | 524 | $do->setDomainType($domain['domain_type']); |
525 | - $do->setIpv6IsDedicated((bool)$domain['ipv6_is_dedicated']); |
|
525 | + $do->setIpv6IsDedicated((bool) $domain['ipv6_is_dedicated']); |
|
526 | 526 | $do->setIpv4($domain['ipv4']); |
527 | - $do->setModSecurityEnabled((bool)$domain['modsecurity_enabled']); |
|
527 | + $do->setModSecurityEnabled((bool) $domain['modsecurity_enabled']); |
|
528 | 528 | $do->setDocRoot($domain['docroot']); |
529 | 529 | $domainList[] = $do; |
530 | 530 | } |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | { |
556 | 556 | $params = ['user' => $user]; |
557 | 557 | $result = $this->client->sendRequest("/json-api/has_digest_auth", "GET", $params); |
558 | - if ( ! empty($result['data'])) { |
|
558 | + if (!empty($result['data'])) { |
|
559 | 559 | return $result['data']['digestauth'] === 1 ? true : false; |
560 | 560 | } |
561 | 561 | |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | { |
578 | 578 | $params = ['user' => $user]; |
579 | 579 | $result = $this->client->sendRequest("/json-api/has_mycnf_for_cpuser", "GET", $params); |
580 | - if ( ! empty($result['data'])) { |
|
580 | + if (!empty($result['data'])) { |
|
581 | 581 | return $result['data']['has_mycnf_for_cpuser'] === 1 ? true : false; |
582 | 582 | } |
583 | 583 | |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | { |
601 | 601 | $params = ['user' => $user, 'bwlimit' => intval($bwlimit)]; |
602 | 602 | $result = $this->client->sendRequest("/json-api/limitbw", "GET", $params); |
603 | - if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
603 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
604 | 604 | return $result['data']['bwlimits'][0]; |
605 | 605 | } |
606 | 606 | |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | public function getUsers() |
621 | 621 | { |
622 | 622 | $result = $this->client->sendRequest("/json-api/list_users", "GET", []); |
623 | - if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
623 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
624 | 624 | return $result['data']['users']; |
625 | 625 | } |
626 | 626 | |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | public function getLockedAccounts() |
642 | 642 | { |
643 | 643 | $result = $this->client->sendRequest("/json-api/listlockedaccounts", "GET", []); |
644 | - if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
644 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
645 | 645 | return $result['data']['account']; |
646 | 646 | } |
647 | 647 | |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | public function getSuspendedAccounts() |
662 | 662 | { |
663 | 663 | $result = $this->client->sendRequest("/json-api/listsuspended", "GET", []); |
664 | - if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
664 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
665 | 665 | $suspendList = $result['data']['account']; |
666 | 666 | |
667 | 667 | $lists = []; |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | $sa = new SuspendedAccount(); |
670 | 670 | $sa->setUser($item['user']); |
671 | 671 | $sa->setOwner($item['owner']); |
672 | - $sa->setIsLocked((bool)$item['is_locked']); |
|
672 | + $sa->setIsLocked((bool) $item['is_locked']); |
|
673 | 673 | $sa->setReason($item['reason']); |
674 | 674 | $sa->setTime(DateTime::createFromFormat("D M j H:i:s Y", $item['time'])); |
675 | 675 | $lists[] = $sa; |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | */ |
699 | 699 | public function modifyAccount(Account $account) |
700 | 700 | { |
701 | - if(empty($account->getUser())){ |
|
701 | + if (empty($account->getUser())) { |
|
702 | 702 | throw ClientExceptions::invalidArgument("You must provide username to modify account"); |
703 | 703 | } |
704 | 704 | |
@@ -706,103 +706,103 @@ discard block |
||
706 | 706 | 'user' => $account->getUser() |
707 | 707 | ]; |
708 | 708 | |
709 | - if($account->isBackupEnabled()){ |
|
709 | + if ($account->isBackupEnabled()) { |
|
710 | 710 | $params['BACKUP'] = 1; |
711 | 711 | } |
712 | 712 | |
713 | - if($account->getBandwidthLimit() === -1){ |
|
713 | + if ($account->getBandwidthLimit() === -1) { |
|
714 | 714 | $params['BWLIMIT'] = "unlimited"; |
715 | 715 | } |
716 | 716 | |
717 | - if(!empty($account->getDomain())){ |
|
717 | + if (!empty($account->getDomain())) { |
|
718 | 718 | $params['DNS'] = $account->getDomain(); |
719 | 719 | } |
720 | 720 | |
721 | - if(!empty($account->isCgiEnable())){ |
|
721 | + if (!empty($account->isCgiEnable())) { |
|
722 | 722 | $params['HASCGI'] = (int) $account->isCgiEnable(); |
723 | 723 | } |
724 | 724 | |
725 | - if(!empty($account->getMaxAddonDomains())){ |
|
725 | + if (!empty($account->getMaxAddonDomains())) { |
|
726 | 726 | $params['MAXADDON'] = $account->getMaxAddonDomains() === -1 ? "unlimited" : intval($account->getMaxAddonDomains()); |
727 | 727 | } |
728 | 728 | |
729 | - if(!empty($account->getMaxFTP())){ |
|
729 | + if (!empty($account->getMaxFTP())) { |
|
730 | 730 | $params['MAXFTP'] = $account->getMaxFTP() === -1 ? "unlimited" : intval($account->getMaxFTP()); |
731 | 731 | } |
732 | 732 | |
733 | - if(!empty($account->getMaxMailingList())){ |
|
733 | + if (!empty($account->getMaxMailingList())) { |
|
734 | 734 | $params['MAXLST'] = $account->getMaxMailingList() === -1 ? "unlimited" : intval($account->getMaxMailingList()); |
735 | 735 | } |
736 | 736 | |
737 | - if(!empty($account->getMaxParkedDomains())){ |
|
737 | + if (!empty($account->getMaxParkedDomains())) { |
|
738 | 738 | $params['MAXPARK'] = $account->getMaxParkedDomains() === -1 ? "unlimited" : intval($account->getMaxParkedDomains()); |
739 | 739 | } |
740 | 740 | |
741 | - if(!empty($account->getMaxPOP())){ |
|
741 | + if (!empty($account->getMaxPOP())) { |
|
742 | 742 | $params['MAXPOP'] = $account->getMaxPOP() === -1 ? "unlimited" : null; |
743 | 743 | } |
744 | 744 | |
745 | - if(!empty($account->getMaxSQL())){ |
|
745 | + if (!empty($account->getMaxSQL())) { |
|
746 | 746 | $params['MAXSQL'] = $account->getMaxSQL() === -1 ? "unlimited" : intval($account->getMaxSQL()); |
747 | 747 | } |
748 | 748 | |
749 | - if(!empty($account->getMaxSubDomain())){ |
|
749 | + if (!empty($account->getMaxSubDomain())) { |
|
750 | 750 | $params['MAXSUB'] = $account->getMaxSubDomain() === -1 ? "unlimited" : intval($account->getMaxSubDomain()); |
751 | 751 | } |
752 | 752 | |
753 | - if(!empty($account->getMaxEmailPerHour())){ |
|
753 | + if (!empty($account->getMaxEmailPerHour())) { |
|
754 | 754 | $params['MAX_EMAIL_PER_HOUR'] = $account->getMaxEmailPerHour() === -1 ? "unlimited" : intval($account->getMaxEmailPerHour()); |
755 | 755 | } |
756 | - if(!empty($account->getMaxEmailAccountQuota())){ |
|
756 | + if (!empty($account->getMaxEmailAccountQuota())) { |
|
757 | 757 | $params['MAX_EMAILACCT_QUOTA'] = $account->getMaxEmailAccountQuota() === -1 ? "unlimited" : intval($account->getMaxDeferFailMailPercentage()); |
758 | 758 | } |
759 | 759 | |
760 | - if(!empty($account->getMaxDeferFailMailPercentage())){ |
|
760 | + if (!empty($account->getMaxDeferFailMailPercentage())) { |
|
761 | 761 | $params['MAX_DEFER_FAIL_PERCENTAGE'] = $account->getMaxDeferFailMailPercentage() === -1 ? "unlimited" : intval($account->getMaxDeferFailMailPercentage()); |
762 | 762 | } |
763 | 763 | |
764 | - if(!empty($account->getOwner())){ |
|
764 | + if (!empty($account->getOwner())) { |
|
765 | 765 | $params['owner'] = $account->getOwner(); |
766 | 766 | } |
767 | 767 | |
768 | - if(!empty($account->getDiskLimit())){ |
|
768 | + if (!empty($account->getDiskLimit())) { |
|
769 | 769 | $params['QUOTA'] = $account->getDiskLimit() === -1 ? "unlimited" : intval($account->getDiskLimit()); |
770 | 770 | } |
771 | 771 | |
772 | - if($account->isSpamAssassinEnable()){ |
|
772 | + if ($account->isSpamAssassinEnable()) { |
|
773 | 773 | $params['spamassassin'] = (int) $account->isSpamAssassinEnable(); |
774 | 774 | } |
775 | 775 | |
776 | - if($account->isFrontPageEnable()){ |
|
776 | + if ($account->isFrontPageEnable()) { |
|
777 | 777 | $params['frontpage'] = (int) $account->isFrontPageEnable(); |
778 | 778 | } |
779 | 779 | |
780 | - if(!empty($account->getTheme())){ |
|
780 | + if (!empty($account->getTheme())) { |
|
781 | 781 | $params['RS'] = $account->getTheme(); |
782 | 782 | } |
783 | 783 | |
784 | - if(!empty($account->getIpAddress())){ |
|
784 | + if (!empty($account->getIpAddress())) { |
|
785 | 785 | $params['IP'] = $account->getIpAddress(); |
786 | 786 | } |
787 | 787 | |
788 | - if(!empty($account->getLanguagePreference())){ |
|
788 | + if (!empty($account->getLanguagePreference())) { |
|
789 | 789 | $params['LANG'] = $account->getLanguagePreference(); |
790 | 790 | } |
791 | 791 | |
792 | - if(!empty($account->getMailboxFormat())){ |
|
792 | + if (!empty($account->getMailboxFormat())) { |
|
793 | 793 | $params['MAILBOX_FORMAT'] = $account->getMailboxFormat(); |
794 | 794 | } |
795 | 795 | |
796 | - if(is_bool($account->isOutgoingMailSuspended())){ |
|
796 | + if (is_bool($account->isOutgoingMailSuspended())) { |
|
797 | 797 | $params['OUTGOING_EMAIL_SUSPENDED'] = (int) $account->isOutgoingMailSuspended(); |
798 | 798 | } |
799 | 799 | |
800 | 800 | $result = $this->client->sendRequest("/json-api/modifyacct", "GET", $params); |
801 | - if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ |
|
801 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
802 | 802 | return true; |
803 | 803 | } |
804 | 804 | |
805 | - if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ |
|
805 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 0) { |
|
806 | 806 | throw new ClientExceptions($result['metadata']['reason']); |
807 | 807 | } |
808 | 808 | |
@@ -829,21 +829,21 @@ discard block |
||
829 | 829 | 'password' => $newPassword |
830 | 830 | ]; |
831 | 831 | |
832 | - if(isset($digestAuth)){ |
|
832 | + if (isset($digestAuth)) { |
|
833 | 833 | $params['digestauth'] = (int) $digestAuth; |
834 | 834 | } |
835 | 835 | |
836 | - if(isset($dbPassUpdate)){ |
|
836 | + if (isset($dbPassUpdate)) { |
|
837 | 837 | $params['db_pass_update'] = (int) $dbPassUpdate; |
838 | 838 | } |
839 | 839 | |
840 | 840 | $result = $this->client->sendRequest("/json-api/passwd", "GET", $params); |
841 | 841 | |
842 | - if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ |
|
842 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 0) { |
|
843 | 843 | throw new ClientExceptions($result['metadata']['reason']); |
844 | 844 | } |
845 | 845 | |
846 | - if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ |
|
846 | + if (!empty($result['metadata']) && $result['metadata']['result'] === 1) { |
|
847 | 847 | return $result['data']['app']; |
848 | 848 | } |
849 | 849 |