Marius Cramer
2015-08-06 37b29231e47a0c4458dc1c15d98588f16f07e1e2
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     }
b1a6a5 16
413d3b 17     //* Set the function parameters.
T 18     $client_id = 2;
19     $params = array(
b1a6a5 20         'server_id' => 1,
MC 21         'origin' => 'test.intt.',
22         'ns' => 'one',
23         'mbox' => 'zonemaster.test.tld.',
24         'serial' => '1',
25         'refresh' => '28800',
26         'retry' => '7200',
27         'expire' => '604800',
b41803 28         'minimum' => '3600',
MC 29         'ttl' => '3600',
b1a6a5 30         'active' => 'y',
MC 31         'xfer' => '',
32         'also_notify' => '',
33         'update_acl' => '',
34     );
35
413d3b 36     $id = $client->dns_zone_add($session_id, $client_id, $params);
T 37
38     echo "DNS ID: ".$id."<br>";
b1a6a5 39
413d3b 40     if($client->logout($session_id)) {
T 41         echo 'Logged out.<br />';
42     }
b1a6a5 43
MC 44
413d3b 45 } catch (SoapFault $e) {
T 46     echo $client->__getLastResponse();
47     die('SOAP Error: '.$e->getMessage());
48 }
49
50 ?>