├── composer.json ├── LICENSE.md ├── .gitignore ├── README.md ├── tests └── ISPConfigWSTest.php └── src └── ISPConfigWS.php /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" :"pemedina/ispconfig-wrapper", 3 | "description" :"A simple wrapper for ISPConfig 3 Remote API. ", 4 | "keywords" :[ 5 | "PHP", 6 | "ISPConfig3", 7 | "wrapper" 8 | ], 9 | "license" :"MIT", 10 | "minimum-stability" :"dev", 11 | "authors" :[ 12 | { 13 | "name" :"Pablo Medina", 14 | "homepage" :"https://github.com/pemedina/ispconfig-wrapper", 15 | "email" :"pablo.medina@fastmail.com" 16 | } 17 | ], 18 | "autoload" :{ 19 | "psr-4" :{ 20 | "ISPConfigWrapper\\" :"src/" 21 | } 22 | }, 23 | "require" :{ 24 | "php" :">=7.4", 25 | "ext-soap" :"*", 26 | "ext-json" :"*" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Pablo E. Medina 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Composer ### 4 | composer.phar 5 | /vendor/ 6 | 7 | # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control 8 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 9 | # composer.lock 10 | 11 | ### OSX ### 12 | .DS_Store 13 | .AppleDouble 14 | .LSOverride 15 | 16 | # Icon must end with two \r 17 | Icon 18 | 19 | 20 | # Thumbnails 21 | ._* 22 | 23 | # Files that might appear on external disk 24 | .Spotlight-V100 25 | .Trashes 26 | 27 | # Directories potentially created on remote AFP share 28 | .AppleDB 29 | .AppleDesktop 30 | Network Trash Folder 31 | Temporary Items 32 | .apdisk 33 | 34 | 35 | ### Intellij ### 36 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 37 | 38 | *.iml 39 | 40 | ## Directory-based project format: 41 | .idea/ 42 | # if you remove the above rule, at least ignore the following: 43 | 44 | # User-specific stuff: 45 | # .idea/workspace.xml 46 | # .idea/tasks.xml 47 | # .idea/dictionaries 48 | 49 | # Sensitive or high-churn files: 50 | # .idea/dataSources.ids 51 | # .idea/dataSources.xml 52 | # .idea/sqlDataSources.xml 53 | # .idea/dynamic.xml 54 | # .idea/uiDesigner.xml 55 | 56 | # Gradle: 57 | # .idea/gradle.xml 58 | # .idea/libraries 59 | 60 | # Mongo Explorer plugin: 61 | # .idea/mongoSettings.xml 62 | 63 | ## File-based project format: 64 | *.ipr 65 | *.iws 66 | 67 | ## Plugin-specific files: 68 | 69 | # IntelliJ 70 | out/ 71 | 72 | # mpeltonen/sbt-idea plugin 73 | .idea_modules/ 74 | 75 | # JIRA plugin 76 | atlassian-ide-plugin.xml 77 | 78 | # Crashlytics plugin (for Android Studio and IntelliJ) 79 | com_crashlytics_export_strings.xml 80 | crashlytics.properties 81 | crashlytics-build.properties 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ISPConfig 3 remoting API Wrapper 2 | 3 | ## Introduction 4 | 5 | A simple wrapper for ispconfig3 remote API. 6 | 7 | Designed to interoperate with ISPConfig 3, it aims to provide an expressive yet simple interface to perform all actions provided by the API. 8 | 9 | [![Latest Stable Version](http://poser.pugx.org/pemedina/ispconfig-wrapper/v?style=for-the-badge)](https://packagist.org/packages/pemedina/ispconfig-wrapper) [![Total Downloads](http://poser.pugx.org/pemedina/ispconfig-wrapper/downloads?style=for-the-badge)](https://packagist.org/packages/pemedina/ispconfig-wrapper) [![Latest Unstable Version](http://poser.pugx.org/pemedina/ispconfig-wrapper/v/unstable?style=for-the-badge)](https://packagist.org/packages/pemedina/ispconfig-wrapper) [![License](http://poser.pugx.org/pemedina/ispconfig-wrapper/license?style=for-the-badge)](https://packagist.org/packages/pemedina/ispconfig-wrapper?style=for-the-badge) [![PHP Version Require](http://poser.pugx.org/pemedina/ispconfig-wrapper/require/php?style=for-the-badge)](https://packagist.org/packages/pemedina/ispconfig-wrapper) 10 | 11 | ## Requirements 12 | 13 | * PHP >= 5.3.0 (with [soap](http://se2.php.net/soap) support) 14 | 15 | ## Getting started 16 | 17 | The library acts as a proxy between ISPConfig 3 SOAP server and your app. All functions are renamed to a more expressive (IMHO) camelCase syntax. IT *doesn't* do any validation, just proxies every request to the related SOAP call. 18 | The *only* change is that every response is returned as a json encoded array. 19 | 20 | + Exceptions are trapped and converted to json, wrapped as `errors`. 21 | + Single value responses are converted to json , wrapped as `result`. 22 | + Array responses are converted to json. 23 | 24 | ## Composer 25 | 26 | ```bash 27 | $ composer require pemedina/ispconfig-wrapper 1.* 28 | ``` 29 | 30 | ## Usage 31 | 32 | The wrapper can be included & used on any PHP application. 33 | 34 | ## Examples 35 | 36 | ### Expressive syntax. 37 | 38 | ``` php 39 | 'http://192.168.0.55/remote/index.php', 43 | 'uri' => 'http://192.168.0.55/remote/', 44 | 'exceptions' => 0) 45 | ) 46 | ); 47 | 48 | // Login 49 | $webService 50 | ->with(array('loginUser' => 'admin', 'loginPass' => 'password')) 51 | ->login(); 52 | 53 | 54 | $result = $webService 55 | ->with(array('client_id' => 5)) 56 | ->getClient() 57 | ->response(); 58 | 59 | print_r json_decode( $result )); 60 | 61 | // Single call 62 | 63 | $result = $webService 64 | ->with(array('loginUser' => 'admin', 'loginPass' => 'password', 'password' => 'newPass', 'client_id' => 5)) 65 | ->changeClientPassword() 66 | ->response(); 67 | 68 | print_r json_decode( $result )); 69 | ``` 70 | 71 | ### Standard Usage. 72 | 73 | ``` php 74 | 75 | 'http://192.168.0.55/remote/index.php', 79 | 'uri' => 'http://192.168.0.55/remote/', 80 | 'exceptions' => 0) 81 | ) 82 | ); 83 | 84 | $loginDetails = array('loginUser' => 'admin', 'loginPass' => 'password'); 85 | $webService->setParameters( $loginDetails ); 86 | $webService->login(); 87 | ... 88 | ... 89 | $parameters = array('client_id' => 5); 90 | $webService->setParameters( $parameters ); 91 | $webService->getClient(); 92 | 93 | print_r json_decode( $webService->getResponse() )); 94 | ``` 95 | 96 | ## Feedback and questions 97 | 98 | Found a bug or missing a feature? Don't hesitate to create a new issue here on GitHub. 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /tests/ISPConfigWSTest.php: -------------------------------------------------------------------------------- 1 | webService = $this->getMockBuilder('\SoapClient') 208 | ->setMethods( self::$webServiceMethods) 209 | ->disableOriginalConstructor() 210 | ->getMock(); 211 | } 212 | 213 | public function testLoginOk() 214 | { 215 | $this->webService->expects($this->any()) 216 | ->method('login') 217 | ->will($this->returnValue('foo')); 218 | 219 | $wrapper = new ISPConfigWS($this->webService); 220 | $this->assertSame($wrapper, $wrapper->login()); 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /src/ISPConfigWS.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://opensource.org/licenses/mit-license.php The MIT License 12 | */ 13 | class ISPConfigWS 14 | { 15 | /** 16 | * Holds the SOAPclient object. 17 | * 18 | * access protected; 19 | * 20 | * @var \SOAPclient|null 21 | */ 22 | protected ?SOAPclient $client = null; 23 | 24 | /** 25 | * Holds the SOAP session ID. 26 | * 27 | * access protected; 28 | * 29 | * @var int 30 | */ 31 | protected string $sessionId; 32 | /** 33 | * Holds the ISPConfig login details. 34 | * 35 | * access private; 36 | * 37 | * @var array 38 | */ 39 | private array $config; 40 | 41 | /** 42 | * Holds the SOAP response. 43 | * 44 | * access private; 45 | * 46 | * @var mixed 47 | */ 48 | private $wsResponse; 49 | 50 | /** 51 | * Holds the parameters used for SOAP requests. 52 | * 53 | * access private; 54 | * 55 | * @var array 56 | */ 57 | private array $params; 58 | 59 | /** 60 | * @throws \SoapFault 61 | */ 62 | public function __construct(array $config = array()) 63 | { 64 | if (count($config) !== 0) { 65 | $this->init($config); 66 | } 67 | } 68 | 69 | /** 70 | * @param array $config 71 | * 72 | * @throws \SoapFault 73 | */ 74 | public function init(array $config = array()) 75 | { 76 | if (count($config) !== 0) { 77 | $this->config = $config; 78 | } 79 | 80 | $opts = array( 81 | 'ssl' => array('verify_peer' => false, 'verify_peer_name' => false) 82 | ); 83 | 84 | 85 | $this->client = new SoapClient( 86 | null, 87 | array('location' => $this->config['host'].'/remote/index.php', 88 | 'uri' => $this->config['host'].'/remote/', 89 | 'trace' => 1, 90 | 'allow_self_siged' => 1, 91 | 'exceptions' => 0, 92 | 'stream_context' => stream_context_create($opts) 93 | ) 94 | ); 95 | 96 | $this->sessionId = $this->client->login($this->config['user'], $this->config['pass']); 97 | } 98 | 99 | /** 100 | * Holds the SOAPclient, creating it if needed. 101 | * 102 | * @return void 103 | * @throws \SoapFault 104 | */ 105 | private function ws(): SOAPclient 106 | { 107 | if ($this->client instanceof SoapClient) { 108 | return $this->client; 109 | } 110 | 111 | $this->init(); 112 | 113 | } 114 | 115 | /** 116 | * Alias for getResponse. 117 | * 118 | * @return string 119 | */ 120 | public function response(): string 121 | { 122 | return $this->getResponse(); 123 | } 124 | 125 | /** 126 | * Get the API ID. 127 | * 128 | * @return string Returns "self" 129 | */ 130 | public function getResponse(): string 131 | { 132 | if (is_soap_fault($this->wsResponse)) { 133 | return json_encode( 134 | array('error' => array( 135 | 'code' => $this->wsResponse->faultcode, 136 | 'message' => $this->wsResponse->faultstring, 137 | )), JSON_FORCE_OBJECT 138 | ); 139 | } 140 | 141 | if (!is_array($this->wsResponse)) { 142 | return json_encode(array('result' => $this->wsResponse), JSON_FORCE_OBJECT); 143 | } 144 | 145 | return json_encode($this->wsResponse, JSON_FORCE_OBJECT); 146 | } 147 | 148 | /** 149 | * Alias for setParams. 150 | * 151 | * @param $params 152 | * 153 | * @return $this 154 | */ 155 | public function with($params): ISPConfigWS 156 | { 157 | $this->setParams($params); 158 | 159 | return $this; 160 | } 161 | 162 | /** 163 | * Set the parameters used for SOAP calls. 164 | * 165 | * @param array $params 166 | * 167 | * @internal param mixed $params 168 | */ 169 | public function setParams(array $params) 170 | { 171 | $this->params = $params; 172 | } 173 | 174 | public function getFunctionsList(): ISPConfigWS 175 | { 176 | $this->wsResponse = $this->ws()->get_function_list($this->sessionId); 177 | 178 | return $this; 179 | } 180 | 181 | /** 182 | * @return $this 183 | * @throws \SoapFault 184 | * @throws \SoapFault 185 | */ 186 | public function addClient(): ISPConfigWS 187 | { 188 | $reseller_id = $this->extractParameter('reseller_id'); 189 | $this->wsResponse = $this->ws()->client_add($this->sessionId, $reseller_id, $this->params); 190 | 191 | return $this; 192 | } 193 | 194 | /** 195 | * Extracts a parameter from $params and remove it from $params array. 196 | * 197 | * @param $param 198 | * 199 | * @return mixed 200 | */ 201 | private function extractParameter($param) 202 | { 203 | $parameter = array_key_exists($param, $this->params) ? $this->params[$param] : false; 204 | unset($this->params[$param]); 205 | 206 | return $parameter; 207 | } 208 | 209 | /** 210 | * @return $this 211 | * @throws \SoapFault 212 | * @throws \SoapFault 213 | */ 214 | public function changeClientPassword(): ISPConfigWS 215 | { 216 | $client_id = $this->extractParameter('client_id'); 217 | $password = $this->extractParameter('password'); 218 | $this->wsResponse = $this->ws()->client_change_password($this->sessionId, $client_id, $password); 219 | 220 | return $this; 221 | } 222 | 223 | /** 224 | * @return $this 225 | * @throws \SoapFault 226 | * @throws \SoapFault 227 | */ 228 | public function deleteClient(): ISPConfigWS 229 | { 230 | $client_id = $this->extractParameter('client_id'); 231 | $this->wsResponse = $this->ws()->client_delete($this->sessionId, $client_id); 232 | 233 | return $this; 234 | } 235 | 236 | /** 237 | * @return $this 238 | * @throws \SoapFault 239 | * @throws \SoapFault 240 | */ 241 | public function getClient(): ISPConfigWS 242 | { 243 | $client_id = $this->extractParameter('client_id'); 244 | $this->wsResponse = $this->ws()->client_get($this->sessionId, $client_id); 245 | 246 | return $this; 247 | } 248 | 249 | /** 250 | * @return $this 251 | * @throws \SoapFault 252 | * @throws \SoapFault 253 | */ 254 | public function getClientByUsername(): ISPConfigWS 255 | { 256 | $username = $this->extractParameter('username'); 257 | $this->wsResponse = $this->ws()->client_get_by_username($this->sessionId, $username); 258 | 259 | return $this; 260 | } 261 | 262 | /** 263 | * @return $this 264 | * @throws \SoapFault 265 | */ 266 | public function getClientID(): ISPConfigWS 267 | { 268 | $user_id = $this->extractParameter('user_id'); 269 | $this->wsResponse = $this->ws()->client_get_id($this->sessionId, $user_id); 270 | 271 | return $this; 272 | } 273 | 274 | /** 275 | * @return $this 276 | * @throws \SoapFault 277 | * @throws \SoapFault 278 | */ 279 | public function getClientSites(): ISPConfigWS 280 | { 281 | $user_id = $this->extractParameter('user_id'); 282 | $this->wsResponse = $this->ws()->client_get_sites_by_user($this->sessionId, $user_id); 283 | 284 | return $this; 285 | } 286 | 287 | /** 288 | * @return $this 289 | * @throws \SoapFault 290 | * @throws \SoapFault 291 | */ 292 | public function getClientTemplates(): ISPConfigWS 293 | { 294 | $user_id = $this->extractParameter('user_id'); 295 | $this->wsResponse = $this->ws()->client_templates_get_all($this->sessionId, $user_id); 296 | 297 | return $this; 298 | } 299 | 300 | /** 301 | * @return $this 302 | * @throws \SoapFault 303 | * @throws \SoapFault 304 | */ 305 | public function updateClient(): ISPConfigWS 306 | { 307 | $client_id = $this->extractParameter('client_id'); 308 | $resellerId = $this->extractParameter('reseller_id'); 309 | 310 | $this->wsResponse = $this->ws()->client_add($this->sessionId, $client_id, $resellerId, $this->params); 311 | 312 | return $this; 313 | } 314 | 315 | /** 316 | * @return $this 317 | * @throws \SoapFault 318 | * @throws \SoapFault 319 | */ 320 | public function addDnsRecord(): ISPConfigWS 321 | { 322 | $client_id = $this->extractParameter('client_id'); 323 | $call = 'dns_'.$this->params['type'].'_add'; 324 | 325 | $this->wsResponse = $this->ws()->{$call}($this->sessionId, $client_id, $this->params); 326 | 327 | return $this; 328 | } 329 | 330 | /** 331 | * @return $this 332 | * @throws \SoapFault 333 | * @throws \SoapFault 334 | */ 335 | public function deleteDnsRecord(): ISPConfigWS 336 | { 337 | $client_id = $this->extractParameter('client_id'); 338 | $call = 'dns_'.$this->params['type'].'_delete'; 339 | $this->wsResponse = $this->ws()->{$call}($this->sessionId, $client_id, $this->params); 340 | 341 | return $this; 342 | } 343 | 344 | /** 345 | * @return $this 346 | * @throws \SoapFault 347 | * @throws \SoapFault 348 | */ 349 | public function getDnsRecord(): ISPConfigWS 350 | { 351 | $client_id = $this->extractParameter('client_id'); 352 | $call = 'dns_'.$this->params['type'].'_get'; 353 | 354 | $this->wsResponse = $this->ws()->$call($this->sessionId, $client_id, $this->params); 355 | 356 | return $this; 357 | } 358 | 359 | /** 360 | * @return $this 361 | * @throws \SoapFault 362 | * @throws \SoapFault 363 | */ 364 | public function updateDnsRecord(): ISPConfigWS 365 | { 366 | $client_id = $this->extractParameter('client_id'); 367 | $call = 'dns_'.$this->params['type'].'_update'; 368 | 369 | $this->wsResponse = $this->ws()->$call($this->sessionId, $client_id, $this->params); 370 | 371 | return $this; 372 | } 373 | 374 | /** 375 | * @return $this 376 | * @throws \SoapFault 377 | * @throws \SoapFault 378 | */ 379 | public function addDnsZone(): ISPConfigWS 380 | { 381 | $client_id = $this->extractParameter('client_id'); 382 | $this->wsResponse = $this->ws()->dns_zone_add($this->sessionId, $client_id, $this->params); 383 | 384 | return $this; 385 | } 386 | 387 | /** 388 | * @return $this 389 | * @throws \SoapFault 390 | * @throws \SoapFault 391 | */ 392 | public function deleteDnsZone(): ISPConfigWS 393 | { 394 | $zone_id = $this->extractParameter('zone_id'); 395 | $this->wsResponse = $this->ws()->dns_zone_delete($this->sessionId, $zone_id); 396 | 397 | return $this; 398 | } 399 | 400 | /** 401 | * @return $this 402 | * @throws \SoapFault 403 | * @throws \SoapFault 404 | */ 405 | public function getDnsZone(): ISPConfigWS 406 | { 407 | $zone_id = $this->extractParameter('zone_id'); 408 | $this->wsResponse = $this->ws()->dns_zone_get($this->sessionId, $zone_id); 409 | 410 | return $this; 411 | } 412 | 413 | /** 414 | * @return $this 415 | * @throws \SoapFault 416 | * @throws \SoapFault 417 | */ 418 | public function getDnsZonesByUser(): ISPConfigWS 419 | { 420 | $client_id = $this->extractParameter('client_id'); 421 | $server_id = $this->extractParameter('server_id'); 422 | $this->wsResponse = $this->ws()->dns_zone_get_by_user($this->sessionId, $client_id, $server_id); 423 | 424 | return $this; 425 | } 426 | 427 | /** 428 | * @return $this 429 | * @throws \SoapFault 430 | * @throws \SoapFault 431 | */ 432 | public function setDnsZoneStatus(): ISPConfigWS 433 | { 434 | $zone_id = $this->extractParameter('zone_id'); 435 | $status = $this->extractParameter('status'); 436 | 437 | $this->wsResponse = $this->ws()->dns_zone_set_status($this->sessionId, $zone_id, $status); 438 | 439 | return $this; 440 | } 441 | 442 | /** 443 | * @return $this 444 | * @throws \SoapFault 445 | * @throws \SoapFault 446 | */ 447 | public function updateDnsZone(): ISPConfigWS 448 | { 449 | $client_id = $this->extractParameter('client_id'); 450 | $zone_id = $this->extractParameter('zone_id'); 451 | $this->wsResponse = $this->ws()->dns_zone_update($this->sessionId, $client_id, $zone_id, $this->params); 452 | 453 | return $this; 454 | } 455 | 456 | /** 457 | * @return $this 458 | * @throws \SoapFault 459 | * @throws \SoapFault 460 | */ 461 | public function addDnsDomain(): ISPConfigWS 462 | { 463 | $client_id = $this->extractParameter('client_id'); 464 | $this->wsResponse = $this->ws()->domains_domain_add($this->sessionId, $client_id, $this->params); 465 | 466 | return $this; 467 | } 468 | 469 | /** 470 | * @return $this 471 | * @throws \SoapFault 472 | * @throws \SoapFault 473 | */ 474 | public function deleteDnsDomain(): ISPConfigWS 475 | { 476 | $domain_id = $this->extractParameter('domain_id'); 477 | $this->wsResponse = $this->ws()->domains_domain_delete($this->sessionId, $domain_id); 478 | 479 | return $this; 480 | } 481 | 482 | /** 483 | * @return $this 484 | * @throws \SoapFault 485 | * @throws \SoapFault 486 | */ 487 | public function getDnsDomain(): ISPConfigWS 488 | { 489 | $domain_id = $this->extractParameter('domain_id'); 490 | $this->wsResponse = $this->ws()->domains_domain_get($this->sessionId, $domain_id); 491 | 492 | return $this; 493 | } 494 | 495 | /** 496 | * @return $this 497 | * @throws \SoapFault 498 | * @throws \SoapFault 499 | */ 500 | public function getUserDnsDomains(): ISPConfigWS 501 | { 502 | $user_id = $this->extractParameter('user_id'); 503 | $this->wsResponse = $this->ws()->domains_get_all_by_user($this->sessionId, $user_id); 504 | 505 | return $this; 506 | } 507 | 508 | /** 509 | * @return $this 510 | * @throws \SoapFault 511 | * @throws \SoapFault 512 | */ 513 | public function addMailAlias(): ISPConfigWS 514 | { 515 | $client_id = $this->extractParameter('client_id'); 516 | $this->wsResponse = $this->ws()->mail_alias_add($this->sessionId, $client_id, $this->params); 517 | 518 | return $this; 519 | } 520 | 521 | /** 522 | * @return $this 523 | * @throws \SoapFault 524 | * @throws \SoapFault 525 | */ 526 | public function deleteMailAlias(): ISPConfigWS 527 | { 528 | $primary_id = $this->extractParameter('alias_id'); 529 | $this->wsResponse = $this->ws()->mail_alias_delete($this->sessionId, $primary_id); 530 | 531 | return $this; 532 | } 533 | 534 | /** 535 | * @return $this 536 | * @throws \SoapFault 537 | * @throws \SoapFault 538 | */ 539 | public function getMailAlias(): ISPConfigWS 540 | { 541 | $primary_id = $this->extractParameter('alias_id'); 542 | $this->wsResponse = $this->ws()->mail_alias_get($this->sessionId, $primary_id); 543 | 544 | return $this; 545 | } 546 | 547 | /** 548 | * @return $this 549 | * @throws \SoapFault 550 | * @throws \SoapFault 551 | */ 552 | public function updateMailAlias(): ISPConfigWS 553 | { 554 | $client_id = $this->extractParameter('client_id'); 555 | $primary_id = $this->extractParameter('alias_id'); 556 | $this->wsResponse = $this->ws()->mail_alias_update($this->sessionId, $client_id, $primary_id, $this->params); 557 | 558 | return $this; 559 | } 560 | 561 | /** 562 | * @return $this 563 | * @throws \SoapFault 564 | * @throws \SoapFault 565 | */ 566 | public function addMailBlacklist(): ISPConfigWS 567 | { 568 | $client_id = $this->extractParameter('client_id'); 569 | $this->wsResponse = $this->ws()->mail_blacklist_add($this->sessionId, $client_id, $this->params); 570 | 571 | return $this; 572 | } 573 | 574 | /** 575 | * @return $this 576 | * @throws \SoapFault 577 | * @throws \SoapFault 578 | */ 579 | public function deleteMailBlacklist(): ISPConfigWS 580 | { 581 | $primary_id = $this->extractParameter('blacklist_id'); 582 | $this->wsResponse = $this->ws()->mail_blacklist_delete($this->sessionId, $primary_id); 583 | 584 | return $this; 585 | } 586 | 587 | /** 588 | * @return $this 589 | * @throws \SoapFault 590 | * @throws \SoapFault 591 | */ 592 | public function getMailBlacklist(): ISPConfigWS 593 | { 594 | $primary_id = $this->extractParameter('blacklist_id'); 595 | $this->wsResponse = $this->ws()->mail_blacklist_get($this->sessionId, $primary_id); 596 | 597 | return $this; 598 | } 599 | 600 | /** 601 | * @return $this 602 | * @throws \SoapFault 603 | * @throws \SoapFault 604 | */ 605 | public function updateMailBlacklist(): ISPConfigWS 606 | { 607 | $client_id = $this->extractParameter('client_id'); 608 | $primary_id = $this->extractParameter('blacklist_id'); 609 | $this->wsResponse = $this->ws()->mail_blacklist_update($this->sessionId, $client_id, $primary_id, $this->params); 610 | 611 | return $this; 612 | } 613 | 614 | /** 615 | * @return $this 616 | * @throws \SoapFault 617 | * @throws \SoapFault 618 | */ 619 | public function addMailCatchall(): ISPConfigWS 620 | { 621 | $client_id = $this->extractParameter('client_id'); 622 | $this->wsResponse = $this->ws()->mail_catchall_add($this->sessionId, $client_id, $this->params); 623 | 624 | return $this; 625 | } 626 | 627 | /** 628 | * @return $this 629 | * @throws \SoapFault 630 | * @throws \SoapFault 631 | */ 632 | public function deleteMailCatchall(): ISPConfigWS 633 | { 634 | $primary_id = $this->extractParameter('catchall_id'); 635 | $this->wsResponse = $this->ws()->mail_catchall_delete($this->sessionId, $primary_id); 636 | 637 | return $this; 638 | } 639 | 640 | /** 641 | * @return $this 642 | * @throws \SoapFault 643 | * @throws \SoapFault 644 | */ 645 | public function getMailCatchall(): ISPConfigWS 646 | { 647 | $primary_id = $this->extractParameter('catchall_id'); 648 | $this->wsResponse = $this->ws()->mail_catchall_get($this->sessionId, $primary_id); 649 | 650 | return $this; 651 | } 652 | 653 | /** 654 | * @return $this 655 | * @throws \SoapFault 656 | * @throws \SoapFault 657 | */ 658 | public function updateMailCatchall(): ISPConfigWS 659 | { 660 | $client_id = $this->extractParameter('client_id'); 661 | $primary_id = $this->extractParameter('catchall_id'); 662 | $this->wsResponse = $this->ws()->mail_catchall_update($this->sessionId, $client_id, $primary_id, $this->params); 663 | 664 | return $this; 665 | } 666 | 667 | /** 668 | * @return $this 669 | * @throws \SoapFault 670 | * @throws \SoapFault 671 | */ 672 | public function addMailDomain(): ISPConfigWS 673 | { 674 | $client_id = $this->extractParameter('client_id'); 675 | $this->wsResponse = $this->ws()->mail_domain_add($this->sessionId, $client_id, $this->params); 676 | 677 | return $this; 678 | } 679 | 680 | /** 681 | * @return $this 682 | * @throws \SoapFault 683 | * @throws \SoapFault 684 | */ 685 | public function deleteMailDomain(): ISPConfigWS 686 | { 687 | $primary_id = $this->extractParameter('domain_id'); 688 | $this->wsResponse = $this->ws()->mail_domain_delete($this->sessionId, $primary_id); 689 | 690 | return $this; 691 | } 692 | 693 | /** 694 | * @return $this 695 | * @throws \SoapFault 696 | * @throws \SoapFault 697 | */ 698 | public function getMailDomain(): ISPConfigWS 699 | { 700 | $primary_id = $this->extractParameter('domain_id'); 701 | $this->wsResponse = $this->ws()->mail_domain_get($this->sessionId, $primary_id); 702 | 703 | return $this; 704 | } 705 | 706 | /** 707 | * @return $this 708 | * @throws \SoapFault 709 | * @throws \SoapFault 710 | */ 711 | public function getMailDomainByDomain(): ISPConfigWS 712 | { 713 | $domain = $this->extractParameter('domain_name'); 714 | $this->wsResponse = $this->ws()->mail_domain_get_by_domain($this->sessionId, $domain); 715 | 716 | return $this; 717 | } 718 | 719 | /** 720 | * @return $this 721 | * @throws \SoapFault 722 | * @throws \SoapFault 723 | */ 724 | public function updateMailDomain(): ISPConfigWS 725 | { 726 | $client_id = $this->extractParameter('client_id'); 727 | $primary_id = $this->extractParameter('domain_id'); 728 | $this->wsResponse = $this->ws()->mail_domain_update($this->sessionId, $client_id, $primary_id, $this->params); 729 | 730 | return $this; 731 | } 732 | 733 | /** 734 | * @return $this 735 | * @throws \SoapFault 736 | * @throws \SoapFault 737 | */ 738 | public function addMailFetchMail(): ISPConfigWS 739 | { 740 | $client_id = $this->extractParameter('client_id'); 741 | $this->wsResponse = $this->ws()->mail_fetchmail_add($this->sessionId, $client_id, $this->params); 742 | 743 | return $this; 744 | } 745 | 746 | /** 747 | * @return $this 748 | * @throws \SoapFault 749 | * @throws \SoapFault 750 | */ 751 | public function deleteMailFetchmal(): ISPConfigWS 752 | { 753 | $primary_id = $this->extractParameter('fetchmail_id'); 754 | $this->wsResponse = $this->ws()->mail_fetchmail_delete($this->sessionId, $primary_id); 755 | 756 | return $this; 757 | } 758 | 759 | /** 760 | * @return $this 761 | * @throws \SoapFault 762 | * @throws \SoapFault 763 | */ 764 | public function getMailFetchmail(): ISPConfigWS 765 | { 766 | $primary_id = $this->extractParameter('fetchmail_id'); 767 | $this->wsResponse = $this->ws()->mail_fetchmail_get($this->sessionId, $primary_id); 768 | 769 | return $this; 770 | } 771 | 772 | /** 773 | * @return $this 774 | * @throws \SoapFault 775 | * @throws \SoapFault 776 | */ 777 | public function updateMailFetchmail(): ISPConfigWS 778 | { 779 | $client_id = $this->extractParameter('client_id'); 780 | $primary_id = $this->extractParameter('fetchmail_id'); 781 | $this->wsResponse = $this->ws()->mail_fetchmail_update($this->sessionId, $client_id, $primary_id, $this->params); 782 | 783 | return $this; 784 | } 785 | 786 | /** 787 | * @return $this 788 | * @throws \SoapFault 789 | * @throws \SoapFault 790 | */ 791 | public function addMailForward(): ISPConfigWS 792 | { 793 | $client_id = $this->extractParameter('client_id'); 794 | $this->wsResponse = $this->ws()->mail_forward_add($this->sessionId, $client_id, $this->params); 795 | 796 | return $this; 797 | } 798 | 799 | /** 800 | * @return $this 801 | * @throws \SoapFault 802 | * @throws \SoapFault 803 | */ 804 | public function deleteMailForward(): ISPConfigWS 805 | { 806 | $primary_id = $this->extractParameter('forward_id'); 807 | $this->wsResponse = $this->ws()->mail_forward_delete($this->sessionId, $primary_id); 808 | 809 | return $this; 810 | } 811 | 812 | /** 813 | * @return $this 814 | * @throws \SoapFault 815 | * @throws \SoapFault 816 | */ 817 | public function getMailForward(): ISPConfigWS 818 | { 819 | $primary_id = $this->extractParameter('forward_id'); 820 | $this->wsResponse = $this->ws()->mail_forward_get($this->sessionId, $primary_id); 821 | 822 | return $this; 823 | } 824 | 825 | /** 826 | * @return $this 827 | * @throws \SoapFault 828 | * @throws \SoapFault 829 | */ 830 | public function updateMailForward(): ISPConfigWS 831 | { 832 | $client_id = $this->extractParameter('client_id'); 833 | $primary_id = $this->extractParameter('forward_id'); 834 | $this->wsResponse = $this->ws()->mail_forward_update($this->sessionId, $client_id, $primary_id, $this->params); 835 | 836 | return $this; 837 | } 838 | 839 | /** 840 | * @return $this 841 | * @throws \SoapFault 842 | * @throws \SoapFault 843 | */ 844 | public function addMailinglist(): ISPConfigWS 845 | { 846 | $client_id = $this->extractParameter('client_id'); 847 | $this->wsResponse = $this->ws()->mail_mailinglist_add($this->sessionId, $client_id, $this->params); 848 | 849 | return $this; 850 | } 851 | 852 | /** 853 | * @return $this 854 | * @throws \SoapFault 855 | * @throws \SoapFault 856 | */ 857 | public function deleteMailinglist(): ISPConfigWS 858 | { 859 | $primary_id = $this->extractParameter('mailinglist_id'); 860 | $this->wsResponse = $this->ws()->mail_mailinglist_delete($this->sessionId, $primary_id); 861 | 862 | return $this; 863 | } 864 | 865 | /** 866 | * @return $this 867 | * @throws \SoapFault 868 | * @throws \SoapFault 869 | */ 870 | public function getMailinglist(): ISPConfigWS 871 | { 872 | $primary_id = $this->extractParameter('mailinglist_id'); 873 | $this->wsResponse = $this->ws()->mail_mailinglist_get($this->sessionId, $primary_id); 874 | 875 | return $this; 876 | } 877 | 878 | /** 879 | * @return $this 880 | * @throws \SoapFault 881 | * @throws \SoapFault 882 | */ 883 | public function updateMailinglist(): ISPConfigWS 884 | { 885 | $client_id = $this->extractParameter('client_id'); 886 | $primary_id = $this->extractParameter('mailinglist_id'); 887 | $this->wsResponse = $this->ws()->mail_mailinglist_update($this->sessionId, $client_id, $primary_id, $this->params); 888 | 889 | return $this; 890 | } 891 | 892 | /** 893 | * @return $this 894 | * @throws \SoapFault 895 | * @throws \SoapFault 896 | */ 897 | public function addMailPolicy(): ISPConfigWS 898 | { 899 | $client_id = $this->extractParameter('client_id'); 900 | $this->wsResponse = $this->ws()->mail_policy_add($this->sessionId, $client_id, $this->params); 901 | 902 | return $this; 903 | } 904 | 905 | /** 906 | * @return $this 907 | * @throws \SoapFault 908 | * @throws \SoapFault 909 | */ 910 | public function deleteMailPolicy(): ISPConfigWS 911 | { 912 | $primary_id = $this->extractParameter('policy_id'); 913 | $this->wsResponse = $this->ws()->mail_policy_delete($this->sessionId, $primary_id); 914 | 915 | return $this; 916 | } 917 | 918 | /** 919 | * @return $this 920 | * @throws \SoapFault 921 | * @throws \SoapFault 922 | */ 923 | public function getMailPolicy(): ISPConfigWS 924 | { 925 | $primary_id = $this->extractParameter('policy_id'); 926 | $this->wsResponse = $this->ws()->mail_policy_get($this->sessionId, $primary_id); 927 | 928 | return $this; 929 | } 930 | 931 | /** 932 | * @return $this 933 | * @throws \SoapFault 934 | * @throws \SoapFault 935 | */ 936 | public function updateMailPolicy(): ISPConfigWS 937 | { 938 | $client_id = $this->extractParameter('client_id'); 939 | $primary_id = $this->extractParameter('policy_id'); 940 | $this->wsResponse = $this->ws()->mail_policy_update($this->sessionId, $client_id, $primary_id, $this->params); 941 | 942 | return $this; 943 | } 944 | 945 | /** 946 | * @return $this 947 | * @throws \SoapFault 948 | * @throws \SoapFault 949 | */ 950 | public function addSpamfilterBlacklist(): ISPConfigWS 951 | { 952 | $client_id = $this->extractParameter('client_id'); 953 | $this->wsResponse = $this->ws()->mail_spamfilter_blacklist_add($this->sessionId, $client_id, $this->params); 954 | 955 | return $this; 956 | } 957 | 958 | /** 959 | * @return $this 960 | * @throws \SoapFault 961 | * @throws \SoapFault 962 | */ 963 | public function deleteSpamfilterBlacklist(): ISPConfigWS 964 | { 965 | $primary_id = $this->extractParameter('spamfilterblacklist_id'); 966 | $this->wsResponse = $this->ws()->mail_spamfilter_blacklist_delete($this->sessionId, $primary_id); 967 | 968 | return $this; 969 | } 970 | 971 | /** 972 | * @return $this 973 | * @throws \SoapFault 974 | * @throws \SoapFault 975 | */ 976 | public function getSpamfilterBlacklist(): ISPConfigWS 977 | { 978 | $primary_id = $this->extractParameter('spamfilterblacklist_id'); 979 | $this->wsResponse = $this->ws()->mail_spamfilter_blacklist_get($this->sessionId, $primary_id); 980 | 981 | return $this; 982 | } 983 | 984 | /** 985 | * @return $this 986 | * @throws \SoapFault 987 | * @throws \SoapFault 988 | */ 989 | public function updateSpamfilterBlacklist(): ISPConfigWS 990 | { 991 | $client_id = $this->extractParameter('client_id'); 992 | $primary_id = $this->extractParameter('spamfilterblacklist_id'); 993 | $this->wsResponse = $this->ws()->mail_spamfilter_blacklist_update($this->sessionId, $client_id, $primary_id, $this->params); 994 | 995 | return $this; 996 | } 997 | 998 | /** 999 | * @return $this 1000 | * @throws \SoapFault 1001 | * @throws \SoapFault 1002 | */ 1003 | public function addSpamfilterUser(): ISPConfigWS 1004 | { 1005 | $client_id = $this->extractParameter('client_id'); 1006 | $this->wsResponse = $this->ws()->mail_spamfilter_user_add($this->sessionId, $client_id, $this->params); 1007 | 1008 | return $this; 1009 | } 1010 | 1011 | /** 1012 | * @return $this 1013 | * @throws \SoapFault 1014 | * @throws \SoapFault 1015 | */ 1016 | public function deleteSpamfilterUser(): ISPConfigWS 1017 | { 1018 | $primary_id = $this->extractParameter('spamfilteruser_id'); 1019 | $this->wsResponse = $this->ws()->mail_spamfilter_user_delete($this->sessionId, $primary_id); 1020 | 1021 | return $this; 1022 | } 1023 | 1024 | /** 1025 | * @return $this 1026 | * @throws \SoapFault 1027 | * @throws \SoapFault 1028 | */ 1029 | public function getSpamfilterUser(): ISPConfigWS 1030 | { 1031 | $primary_id = $this->extractParameter('spamfilteruser_id'); 1032 | $this->wsResponse = $this->ws()->mail_spamfilter_user_get($this->sessionId, $primary_id); 1033 | 1034 | return $this; 1035 | } 1036 | 1037 | /** 1038 | * @return $this 1039 | * @throws \SoapFault 1040 | * @throws \SoapFault 1041 | */ 1042 | public function updateSpamfilterUser(): ISPConfigWS 1043 | { 1044 | $client_id = $this->extractParameter('client_id'); 1045 | $primary_id = $this->extractParameter('spamfilteruser_id'); 1046 | $this->wsResponse = $this->ws()->mail_spamfilter_user_update($this->sessionId, $client_id, $primary_id, $this->params); 1047 | 1048 | return $this; 1049 | } 1050 | 1051 | /** 1052 | * @return $this 1053 | * @throws \SoapFault 1054 | * @throws \SoapFault 1055 | */ 1056 | public function addSpamfilterWhitelist(): ISPConfigWS 1057 | { 1058 | $client_id = $this->extractParameter('client_id'); 1059 | $this->wsResponse = $this->ws()->mail_spamfilter_whitelist_add($this->sessionId, $client_id, $this->params); 1060 | 1061 | return $this; 1062 | } 1063 | 1064 | /** 1065 | * @return $this 1066 | * @throws \SoapFault 1067 | * @throws \SoapFault 1068 | */ 1069 | public function deleteSpamfilterWhitelist(): ISPConfigWS 1070 | { 1071 | $primary_id = $this->extractParameter('spamfilterwhitelist_id'); 1072 | $this->wsResponse = $this->ws()->mail_spamfilter_whitelist_delete($this->sessionId, $primary_id); 1073 | 1074 | return $this; 1075 | } 1076 | 1077 | /** 1078 | * @return $this 1079 | * @throws \SoapFault 1080 | * @throws \SoapFault 1081 | */ 1082 | public function getSpamfilterWhitelist(): ISPConfigWS 1083 | { 1084 | $primary_id = $this->extractParameter('spamfilterwhitelist_id'); 1085 | $this->wsResponse = $this->ws()->mail_spamfilter_whitelist_get($this->sessionId, $primary_id); 1086 | 1087 | return $this; 1088 | } 1089 | 1090 | /** 1091 | * @return $this 1092 | * @throws \SoapFault 1093 | * @throws \SoapFault 1094 | */ 1095 | public function updateSpamfilterWhitelist(): ISPConfigWS 1096 | { 1097 | $client_id = $this->extractParameter('client_id'); 1098 | $primary_id = $this->extractParameter('spamfilterwhitelist_id'); 1099 | $this->wsResponse = $this->ws()->mail_spamfilter_whitelist_update($this->sessionId, $client_id, $primary_id, $this->params); 1100 | 1101 | return $this; 1102 | } 1103 | 1104 | /** 1105 | * @return $this 1106 | * @throws \SoapFault 1107 | * @throws \SoapFault 1108 | */ 1109 | public function addMailTransport(): ISPConfigWS 1110 | { 1111 | $client_id = $this->extractParameter('client_id'); 1112 | $this->wsResponse = $this->ws()->mail_transport_add($this->sessionId, $client_id, $this->params); 1113 | 1114 | return $this; 1115 | } 1116 | 1117 | /** 1118 | * @return $this 1119 | * @throws \SoapFault 1120 | * @throws \SoapFault 1121 | */ 1122 | public function deleteMailTransport(): ISPConfigWS 1123 | { 1124 | $primary_id = $this->extractParameter('transport_id'); 1125 | $this->wsResponse = $this->ws()->mail_transport_delete($this->sessionId, $primary_id); 1126 | 1127 | return $this; 1128 | } 1129 | 1130 | /** 1131 | * @return $this 1132 | * @throws \SoapFault 1133 | * @throws \SoapFault 1134 | */ 1135 | public function getMailTransport(): ISPConfigWS 1136 | { 1137 | $primary_id = $this->extractParameter('transport_id'); 1138 | $this->wsResponse = $this->ws()->mail_transport_get($this->sessionId, $primary_id); 1139 | 1140 | return $this; 1141 | } 1142 | 1143 | /** 1144 | * @return $this 1145 | * @throws \SoapFault 1146 | * @throws \SoapFault 1147 | */ 1148 | public function updateMailTransport(): ISPConfigWS 1149 | { 1150 | $client_id = $this->extractParameter('client_id'); 1151 | $primary_id = $this->extractParameter('transport_id'); 1152 | $this->wsResponse = $this->ws()->mail_transport_update($this->sessionId, $client_id, $primary_id, $this->params); 1153 | 1154 | return $this; 1155 | } 1156 | 1157 | /** 1158 | * @return $this 1159 | * @throws \SoapFault 1160 | * @throws \SoapFault 1161 | */ 1162 | public function addMailuser(): ISPConfigWS 1163 | { 1164 | $client_id = $this->extractParameter('client_id'); 1165 | $this->wsResponse = $this->ws()->mail_user_add($this->sessionId, $client_id, $this->params); 1166 | 1167 | return $this; 1168 | } 1169 | 1170 | /** 1171 | * @return $this 1172 | * @throws \SoapFault 1173 | * @throws \SoapFault 1174 | */ 1175 | public function deleteMailUser(): ISPConfigWS 1176 | { 1177 | $primary_id = $this->extractParameter('user_id'); 1178 | $this->wsResponse = $this->ws()->mail_user_delete($this->sessionId, $primary_id); 1179 | 1180 | return $this; 1181 | } 1182 | 1183 | /** 1184 | * @return $this 1185 | * @throws \SoapFault 1186 | * @throws \SoapFault 1187 | */ 1188 | public function getMailUser(): ISPConfigWS 1189 | { 1190 | $primary_id = $this->extractParameter('user_id'); 1191 | $this->wsResponse = $this->ws()->mail_user_get($this->sessionId, $primary_id); 1192 | 1193 | return $this; 1194 | } 1195 | 1196 | /** 1197 | * @return $this 1198 | * @throws \SoapFault 1199 | * @throws \SoapFault 1200 | */ 1201 | public function updateMailUser(): ISPConfigWS 1202 | { 1203 | $client_id = $this->extractParameter('client_id'); 1204 | $primary_id = $this->extractParameter('user_id'); 1205 | $this->wsResponse = $this->ws()->mail_user_update($this->sessionId, $client_id, $primary_id, $this->params); 1206 | 1207 | return $this; 1208 | } 1209 | 1210 | /** 1211 | * @return $this 1212 | * @throws \SoapFault 1213 | * @throws \SoapFault 1214 | */ 1215 | public function addMailUserFilter(): ISPConfigWS 1216 | { 1217 | $client_id = $this->extractParameter('client_id'); 1218 | $this->wsResponse = $this->ws()->mail_user_filter_add($this->sessionId, $client_id, $this->params); 1219 | 1220 | return $this; 1221 | } 1222 | 1223 | /** 1224 | * @return $this 1225 | * @throws \SoapFault 1226 | * @throws \SoapFault 1227 | */ 1228 | public function deleteMailUserfilter(): ISPConfigWS 1229 | { 1230 | $primary_id = $this->extractParameter('userfilter_id'); 1231 | $this->wsResponse = $this->ws()->mail_user_filter_delete($this->sessionId, $primary_id); 1232 | 1233 | return $this; 1234 | } 1235 | 1236 | /** 1237 | * @return $this 1238 | * @throws \SoapFault 1239 | * @throws \SoapFault 1240 | */ 1241 | public function getMailUserFilter(): ISPConfigWS 1242 | { 1243 | $primary_id = $this->extractParameter('userfilter_id'); 1244 | $this->wsResponse = $this->ws()->mail_user_filter_get($this->sessionId, $primary_id); 1245 | 1246 | return $this; 1247 | } 1248 | 1249 | /** 1250 | * @return $this 1251 | * @throws \SoapFault 1252 | * @throws \SoapFault 1253 | */ 1254 | public function updateMailUserfilter(): ISPConfigWS 1255 | { 1256 | $client_id = $this->extractParameter('client_id'); 1257 | $primary_id = $this->extractParameter('userfilter_id'); 1258 | $this->wsResponse = $this->ws()->mail_user_filter_update($this->sessionId, $client_id, $primary_id, $this->params); 1259 | 1260 | return $this; 1261 | } 1262 | 1263 | /** 1264 | * @return $this 1265 | * @throws \SoapFault 1266 | * @throws \SoapFault 1267 | */ 1268 | public function addMailWhitelist(): ISPConfigWS 1269 | { 1270 | $client_id = $this->extractParameter('client_id'); 1271 | $this->wsResponse = $this->ws()->mail_whitelist_add($this->sessionId, $client_id, $this->params); 1272 | 1273 | return $this; 1274 | } 1275 | 1276 | /** 1277 | * @return $this 1278 | * @throws \SoapFault 1279 | * @throws \SoapFault 1280 | */ 1281 | public function deleteMailWhitelist(): ISPConfigWS 1282 | { 1283 | $primary_id = $this->extractParameter('whitelist_id'); 1284 | $this->wsResponse = $this->ws()->mail_whitelist_delete($this->sessionId, $primary_id); 1285 | 1286 | return $this; 1287 | } 1288 | 1289 | /** 1290 | * @return $this 1291 | * @throws \SoapFault 1292 | * @throws \SoapFault 1293 | */ 1294 | public function getMailWhitelist(): ISPConfigWS 1295 | { 1296 | $primary_id = $this->extractParameter('whitelist_id'); 1297 | $this->wsResponse = $this->ws()->mail_whitelist_get($this->sessionId, $primary_id); 1298 | 1299 | return $this; 1300 | } 1301 | 1302 | /** 1303 | * @return $this 1304 | * @throws \SoapFault 1305 | * @throws \SoapFault 1306 | */ 1307 | public function updateMailWhitelist(): ISPConfigWS 1308 | { 1309 | $client_id = $this->extractParameter('client_id'); 1310 | $primary_id = $this->extractParameter('whitelist_id'); 1311 | $this->wsResponse = $this->ws()->mail_whitelist_update($this->sessionId, $client_id, $primary_id, $this->params); 1312 | 1313 | return $this; 1314 | } 1315 | 1316 | /** 1317 | * @return $this 1318 | * @throws \SoapFault 1319 | * @throws \SoapFault 1320 | */ 1321 | public function getServer(): ISPConfigWS 1322 | { 1323 | $server_id = $this->extractParameter('server_id'); 1324 | $this->wsResponse = $this->ws()->server_get($this->sessionId, $server_id); 1325 | 1326 | return $this; 1327 | } 1328 | 1329 | /** 1330 | * @return $this 1331 | * @throws \SoapFault 1332 | * @throws \SoapFault 1333 | */ 1334 | public function getServerByIp(): ISPConfigWS 1335 | { 1336 | $ip_address = $this->extractParameter('ip_address'); 1337 | $this->wsResponse = $this->ws()->server_get_serverid_by_ip($this->sessionId, $ip_address); 1338 | 1339 | return $this; 1340 | } 1341 | 1342 | /** 1343 | * @return $this 1344 | * @throws \SoapFault 1345 | * @throws \SoapFault 1346 | */ 1347 | public function addCron(): ISPConfigWS 1348 | { 1349 | $client_id = $this->extractParameter('client_id'); 1350 | $this->wsResponse = $this->ws()->sites_cron_add($this->sessionId, $client_id, $this->params); 1351 | 1352 | return $this; 1353 | } 1354 | 1355 | /** 1356 | * @return $this 1357 | * @throws \SoapFault 1358 | * @throws \SoapFault 1359 | */ 1360 | public function deleteCron(): ISPConfigWS 1361 | { 1362 | $cron_id = $this->extractParameter('cron_id'); 1363 | $this->wsResponse = $this->ws()->sites_cron_delete($this->sessionId, $cron_id); 1364 | 1365 | return $this; 1366 | } 1367 | 1368 | /** 1369 | * @return $this 1370 | * @throws \SoapFault 1371 | * @throws \SoapFault 1372 | */ 1373 | public function getCron(): ISPConfigWS 1374 | { 1375 | $cron_id = $this->extractParameter('cron_id'); 1376 | $this->wsResponse = $this->ws()->sites_cron_get($this->sessionId, $cron_id); 1377 | 1378 | return $this; 1379 | } 1380 | 1381 | /** 1382 | * @return $this 1383 | * @throws \SoapFault 1384 | * @throws \SoapFault 1385 | */ 1386 | public function updateCron(): ISPConfigWS 1387 | { 1388 | $client_id = $this->extractParameter('client_id'); 1389 | $cron_id = $this->extractParameter('cron_id'); 1390 | $this->wsResponse = $this->ws()->sites_cron_update($this->sessionId, $client_id, $cron_id, $this->params); 1391 | 1392 | return $this; 1393 | } 1394 | 1395 | /** 1396 | * @return $this 1397 | * @throws \SoapFault 1398 | * @throws \SoapFault 1399 | */ 1400 | public function addDatabase(): ISPConfigWS 1401 | { 1402 | $client_id = $this->extractParameter('client_id'); 1403 | $this->wsResponse = $this->ws()->sites_database_add($this->sessionId, $client_id, $this->params); 1404 | 1405 | return $this; 1406 | } 1407 | 1408 | /** 1409 | * @return $this 1410 | * @throws \SoapFault 1411 | * @throws \SoapFault 1412 | */ 1413 | public function deleteDatabase(): ISPConfigWS 1414 | { 1415 | $primary_id = $this->extractParameter('database_id'); 1416 | $this->wsResponse = $this->ws()->sites_database_delete($this->sessionId, $primary_id); 1417 | 1418 | return $this; 1419 | } 1420 | 1421 | /** 1422 | * @return $this 1423 | * @throws \SoapFault 1424 | * @throws \SoapFault 1425 | */ 1426 | public function getDatabase(): ISPConfigWS 1427 | { 1428 | $primary_id = $this->extractParameter('database_id'); 1429 | $this->wsResponse = $this->ws()->sites_database_get($this->sessionId, $primary_id); 1430 | 1431 | return $this; 1432 | } 1433 | 1434 | /** 1435 | * @return $this 1436 | * @throws \SoapFault 1437 | * @throws \SoapFault 1438 | */ 1439 | public function getDatabasesByUser(): ISPConfigWS 1440 | { 1441 | $client_id = $this->extractParameter('client_id'); 1442 | $this->wsResponse = $this->ws()->sites_database_get_all_by_user($this->sessionId, $client_id); 1443 | 1444 | return $this; 1445 | } 1446 | 1447 | /** 1448 | * @return $this 1449 | * @throws \SoapFault 1450 | * @throws \SoapFault 1451 | */ 1452 | public function updateDatabase(): ISPConfigWS 1453 | { 1454 | $client_id = $this->extractParameter('client_id'); 1455 | $primary_id = $this->extractParameter('database_id'); 1456 | $this->wsResponse = $this->ws()->sites_database_update($this->sessionId, $client_id, $primary_id, $this->params); 1457 | 1458 | return $this; 1459 | } 1460 | 1461 | /** 1462 | * @return $this 1463 | * @throws \SoapFault 1464 | * @throws \SoapFault 1465 | */ 1466 | public function addDatabaseUser(): ISPConfigWS 1467 | { 1468 | $client_id = $this->extractParameter('client_id'); 1469 | $this->wsResponse = $this->ws()->sites_database_user_add($this->sessionId, $client_id, $this->params); 1470 | 1471 | return $this; 1472 | } 1473 | 1474 | /** 1475 | * @return $this 1476 | * @throws \SoapFault 1477 | * @throws \SoapFault 1478 | */ 1479 | public function deleteDatabaseUser(): ISPConfigWS 1480 | { 1481 | $primary_id = $this->extractParameter('databaseuser_id'); 1482 | $this->wsResponse = $this->ws()->sites_database_user_delete($this->sessionId, $primary_id); 1483 | 1484 | return $this; 1485 | } 1486 | 1487 | /** 1488 | * @return $this 1489 | * @throws \SoapFault 1490 | * @throws \SoapFault 1491 | */ 1492 | public function getDatabaseUser(): ISPConfigWS 1493 | { 1494 | $primary_id = $this->extractParameter('databaseuser_id'); 1495 | $this->wsResponse = $this->ws()->sites_database_user_get($this->sessionId, $primary_id); 1496 | 1497 | return $this; 1498 | } 1499 | 1500 | /** 1501 | * @return $this 1502 | * @throws \SoapFault 1503 | * @throws \SoapFault 1504 | */ 1505 | public function updateDatabaseUser(): ISPConfigWS 1506 | { 1507 | $client_id = $this->extractParameter('client_id'); 1508 | $primary_id = $this->extractParameter('databaseuser_id'); 1509 | $this->wsResponse = $this->ws()->sites_database_user_update($this->sessionId, $client_id, $primary_id, $this->params); 1510 | 1511 | return $this; 1512 | } 1513 | 1514 | /** 1515 | * @return $this 1516 | * @throws \SoapFault 1517 | * @throws \SoapFault 1518 | */ 1519 | public function addFtpUser(): ISPConfigWS 1520 | { 1521 | $client_id = $this->extractParameter('client_id'); 1522 | $this->wsResponse = $this->ws()->sites_ftp_user_add($this->sessionId, $client_id, $this->params); 1523 | 1524 | return $this; 1525 | } 1526 | 1527 | /** 1528 | * @return $this 1529 | * @throws \SoapFault 1530 | * @throws \SoapFault 1531 | */ 1532 | public function deleteFtpUser(): ISPConfigWS 1533 | { 1534 | $primary_id = $this->extractParameter('ftpuser_id'); 1535 | $this->wsResponse = $this->ws()->sites_ftp_user_delete($this->sessionId, $primary_id); 1536 | 1537 | return $this; 1538 | } 1539 | 1540 | /** 1541 | * @return $this 1542 | * @throws \SoapFault 1543 | * @throws \SoapFault 1544 | */ 1545 | public function getFtpUser(): ISPConfigWS 1546 | { 1547 | $primary_id = $this->extractParameter('ftpuser_id'); 1548 | $this->wsResponse = $this->ws()->sites_ftp_user_get($this->sessionId, $primary_id); 1549 | 1550 | return $this; 1551 | } 1552 | 1553 | /** 1554 | * @return $this 1555 | * @throws \SoapFault 1556 | * @throws \SoapFault 1557 | */ 1558 | public function updateFtpUser(): ISPConfigWS 1559 | { 1560 | $client_id = $this->extractParameter('client_id'); 1561 | $primary_id = $this->extractParameter('ftpuser_id'); 1562 | $this->wsResponse = $this->ws()->sites_ftp_user_update($this->sessionId, $client_id, $primary_id, $this->params); 1563 | 1564 | return $this; 1565 | } 1566 | 1567 | /** 1568 | * @return $this 1569 | * @throws \SoapFault 1570 | * @throws \SoapFault 1571 | */ 1572 | public function addShellUser(): ISPConfigWS 1573 | { 1574 | $client_id = $this->extractParameter('client_id'); 1575 | $this->wsResponse = $this->ws()->sites_shell_user_add($this->sessionId, $client_id, $this->params); 1576 | 1577 | return $this; 1578 | } 1579 | 1580 | /** 1581 | * @return $this 1582 | * @throws \SoapFault 1583 | * @throws \SoapFault 1584 | */ 1585 | public function deleteShellUser(): ISPConfigWS 1586 | { 1587 | $primary_id = $this->extractParameter('shelluser_id'); 1588 | $this->wsResponse = $this->ws()->sites_shell_user_delete($this->sessionId, $primary_id); 1589 | 1590 | return $this; 1591 | } 1592 | 1593 | /** 1594 | * @return $this 1595 | * @throws \SoapFault 1596 | * @throws \SoapFault 1597 | */ 1598 | public function getShellUser(): ISPConfigWS 1599 | { 1600 | $primary_id = $this->extractParameter('shelluser_id'); 1601 | $this->wsResponse = $this->ws()->sites_shell_user_get($this->sessionId, $primary_id); 1602 | 1603 | return $this; 1604 | } 1605 | 1606 | /** 1607 | * @return $this 1608 | * @throws \SoapFault 1609 | * @throws \SoapFault 1610 | */ 1611 | public function updateShellUser(): ISPConfigWS 1612 | { 1613 | $client_id = $this->extractParameter('client_id'); 1614 | $primary_id = $this->extractParameter('shelluser_id'); 1615 | $this->wsResponse = $this->ws()->sites_shell_user_update($this->sessionId, $client_id, $primary_id, $this->params); 1616 | 1617 | return $this; 1618 | } 1619 | 1620 | /** 1621 | * @return $this 1622 | * @throws \SoapFault 1623 | * @throws \SoapFault 1624 | */ 1625 | public function addAliasDomain(): ISPConfigWS 1626 | { 1627 | $client_id = $this->extractParameter('client_id'); 1628 | 1629 | $this->wsResponse = $this->ws()->sites_web_aliasdomain_add($this->sessionId, $client_id, $this->params); 1630 | 1631 | return $this; 1632 | } 1633 | 1634 | /** 1635 | * @return $this 1636 | * @throws \SoapFault 1637 | * @throws \SoapFault 1638 | */ 1639 | public function deleteAliasDomain(): ISPConfigWS 1640 | { 1641 | $primary_id = $this->extractParameter('aliasdomain_id'); 1642 | $this->wsResponse = $this->ws()->sites_web_aliasdomain_delete($this->sessionId, $primary_id); 1643 | 1644 | return $this; 1645 | } 1646 | 1647 | /** 1648 | * @return $this 1649 | * @throws \SoapFault 1650 | * @throws \SoapFault 1651 | */ 1652 | public function getAliasDomain(): ISPConfigWS 1653 | { 1654 | $primary_id = $this->extractParameter('aliasdomain_id'); 1655 | $this->wsResponse = $this->ws()->sites_web_aliasdomain_get($this->sessionId, $primary_id); 1656 | 1657 | return $this; 1658 | } 1659 | 1660 | /** 1661 | * @return $this 1662 | * @throws \SoapFault 1663 | * @throws \SoapFault 1664 | */ 1665 | public function updateAliasDomain(): ISPConfigWS 1666 | { 1667 | $client_id = $this->extractParameter('client_id'); 1668 | $primary_id = $this->extractParameter('aliasdomain_id'); 1669 | $this->wsResponse = $this->ws()->sites_web_aliasdomain_update($this->sessionId, $client_id, $primary_id, $this->params); 1670 | 1671 | return $this; 1672 | } 1673 | 1674 | /** 1675 | * @return $this 1676 | * @throws \SoapFault 1677 | * @throws \SoapFault 1678 | */ 1679 | public function addWebDomain(): ISPConfigWS 1680 | { 1681 | $client_id = $this->extractParameter('client_id'); 1682 | $this->wsResponse = $this->ws()->sites_web_domain_add($this->sessionId, $client_id, $this->params); 1683 | 1684 | return $this; 1685 | } 1686 | 1687 | /** 1688 | * @return $this 1689 | * @throws \SoapFault 1690 | * @throws \SoapFault 1691 | */ 1692 | public function deleteWebDomain(): ISPConfigWS 1693 | { 1694 | $primary_id = $this->extractParameter('domain_id'); 1695 | $this->wsResponse = $this->ws()->sites_web_domain_delete($this->sessionId, $primary_id); 1696 | 1697 | return $this; 1698 | } 1699 | 1700 | /** 1701 | * @return $this 1702 | * @throws \SoapFault 1703 | * @throws \SoapFault 1704 | */ 1705 | public function getWebDomain(): ISPConfigWS 1706 | { 1707 | $primary_id = $this->extractParameter('domain_id'); 1708 | $this->wsResponse = $this->ws()->sites_web_domain_get($this->sessionId, $primary_id); 1709 | 1710 | return $this; 1711 | } 1712 | 1713 | /** 1714 | * @return $this 1715 | * @throws \SoapFault 1716 | * @throws \SoapFault 1717 | */ 1718 | public function setWebDomainStatus(): ISPConfigWS 1719 | { 1720 | $primary_id = $this->extractParameter('domain_id'); 1721 | $status = $this->extractParameter('status'); 1722 | $this->wsResponse = $this->ws()->sites_web_domain_set_status($this->sessionId, $primary_id, $status); 1723 | 1724 | return $this; 1725 | } 1726 | 1727 | /** 1728 | * @return $this 1729 | * @throws \SoapFault 1730 | * @throws \SoapFault 1731 | */ 1732 | public function updateWebDomain(): ISPConfigWS 1733 | { 1734 | $client_id = $this->extractParameter('client_id'); 1735 | $primary_id = $this->extractParameter('domain_id'); 1736 | $this->wsResponse = $this->ws()->sites_web_domain_update($this->sessionId, $client_id, $primary_id, $this->params); 1737 | 1738 | return $this; 1739 | } 1740 | 1741 | /** 1742 | * @return $this 1743 | * @throws \SoapFault 1744 | * @throws \SoapFault 1745 | */ 1746 | public function addWebSubdomain(): ISPConfigWS 1747 | { 1748 | $client_id = $this->extractParameter('client_id'); 1749 | $this->wsResponse = $this->ws()->sites_web_subdomain_add($this->sessionId, $client_id, $this->params); 1750 | 1751 | return $this; 1752 | } 1753 | 1754 | /** 1755 | * @return $this 1756 | * @throws \SoapFault 1757 | * @throws \SoapFault 1758 | */ 1759 | public function deleteWebsubdomain(): ISPConfigWS 1760 | { 1761 | $subdomain_id = $this->extractParameter('subdomain_id'); 1762 | $this->wsResponse = $this->ws()->sites_web_subdomain_delete($this->sessionId, $subdomain_id); 1763 | 1764 | return $this; 1765 | } 1766 | 1767 | /** 1768 | * @return $this 1769 | * @throws \SoapFault 1770 | * @throws \SoapFault 1771 | */ 1772 | public function getWebSubdomain(): ISPConfigWS 1773 | { 1774 | $subdomain_id = $this->extractParameter('subdomain_id'); 1775 | $this->wsResponse = $this->ws()->sites_web_subdomain_get($this->sessionId, $subdomain_id); 1776 | 1777 | return $this; 1778 | } 1779 | 1780 | /** 1781 | * @return $this 1782 | * @throws \SoapFault 1783 | * @throws \SoapFault 1784 | */ 1785 | public function updateWebSubdomain(): ISPConfigWS 1786 | { 1787 | $client_id = $this->extractParameter('client_id'); 1788 | $subdomain_id = $this->extractParameter('subdomain_id'); 1789 | $this->wsResponse = $this->ws()->sites_web_subdomain_update($this->sessionId, $client_id, $subdomain_id, $this->params); 1790 | 1791 | return $this; 1792 | } 1793 | 1794 | /** 1795 | * 1796 | */ 1797 | public function logout() 1798 | { 1799 | $this->ws()->logout($this->sessionId); 1800 | } 1801 | } 1802 | --------------------------------------------------------------------------------