Marius Burkard
2016-07-08 9bcd2fd54728b9e634442f584268da03acaea633
commit | author | age
413d3b 1 <?php
T 2
b1a6a5 3 require 'soap_config.php';
413d3b 4
T 5
6 $client = new SoapClient(null, array('location' => $soap_location,
b1a6a5 7         'uri'      => $soap_uri,
MC 8         'trace' => 1,
9         'exceptions' => 1));
413d3b 10
T 11
12 try {
b1a6a5 13     if($session_id = $client->login($username, $password)) {
413d3b 14         echo 'Logged successfull. Session ID:'.$session_id.'<br />';
T 15     }
16
17     //* Parameters
18     $client_id = 0;
19     $domain_id = 1;
20
21
22     //* Get the web domain record
23     $domain_record = $client->sites_web_domain_get($session_id, $domain_id);
24
25     //* Change parameters
26     $domain_record['active'] = 'n';
27     $domain_record['document_root'] = '/web/doc';
28     $domain_record['allow_override'] = 'All';
29     $domain_record['php_open_basedir'] = '/php';
b1a6a5 30
413d3b 31     $affected_rows = $client->sites_web_domain_update($session_id, $client_id, $domain_id, $domain_record);
T 32
33     echo "Number of records that have been changed in the database: ".$affected_rows."<br>";
b1a6a5 34
413d3b 35     if($client->logout($session_id)) {
T 36         echo 'Logged out.<br />';
37     }
b1a6a5 38
MC 39
413d3b 40 } catch (SoapFault $e) {
T 41     echo $client->__getLastResponse();
42     die('SOAP Error: '.$e->getMessage());
43 }
44
45 ?>