Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

Commit

Permalink
Fixes #43- {IP} placeholder not assigned
Browse files Browse the repository at this point in the history
Fixed issue with the module not detecting the IP address for the dns
zone and added error check which rolls back changes in the event of an
error.
  • Loading branch information
cwispy committed Mar 5, 2020
1 parent 3ba1b91 commit 62f4651
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ispcfg3.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,15 @@ function ispcfg3_CreateAccount(array $params ) {
$svr = $tmpl['web_servers'];
logModuleCall( 'ispconfig', 'CreatePostDomainAdd', $svr, $ispcparams, '', '');

$zoneip = $client->server_get( $svr );
$tmpip = $zoneip['server']['ip_address'];
$zoneip = $client->server_get( $svr, 'server' );
$tmpip = $zoneip['response'][1]['ip_address'];

if ( empty( $tmpip ) ) {

$client->client_delete_everything( $client_id );
return "Webserver IP Address not found.";
end;
}

logModuleCall('ispconfig','CreatePreDNSZone',$domain,'DNS Template '.$client_id['response']." ".$dnstemplate." ".$domain." ".$tmpip." ".$nameserver1." ".$nameserver2." ".$soaemail,'','');
$dns_id = $client->dns_templatezone_add( $client_id, $dnstemplate, $domain, $tmpip, $nameserver1, $nameserver2, $soaemail );
Expand Down

0 comments on commit 62f4651

Please sign in to comment.