Closed webvanced closed 7 years ago
Hi,
It would be nice to be able to add a cname to the zonename in the template. I made a small modification to the code to make this work. Would be nice to have this in the nsedit source.
Example template config: array( 'name' => '', 'type' => 'A', 'content' => '1.2.3.4' ), array( 'name' => '', 'type' => 'CNAME', 'content' => '[zonename]' )
array( 'name' => '', 'type' => 'A', 'content' => '1.2.3.4' ), array( 'name' => '', 'type' => 'CNAME', 'content' => '[zonename]' )
In zones change add below 333 a line that replaces [zonenname].
foreach ($template['records'] as $record) { $name = $record['name'] != '' ? join(Array($record['name'],'.',$zonename)) : $zonename; $record['content'] = str_replace("[zonename]", $zonename, $record['content']); $zone->addRecord($name, $record['type'], $record['content']); }
Thanx for the good work.
Thanks. Can you turn this into a PR?
Hi, created the pull request.
Merged #153
Hi,
It would be nice to be able to add a cname to the zonename in the template. I made a small modification to the code to make this work. Would be nice to have this in the nsedit source.
Example template config:
array( 'name' => '', 'type' => 'A', 'content' => '1.2.3.4' ), array( 'name' => '', 'type' => 'CNAME', 'content' => '[zonename]' )
In zones change add below 333 a line that replaces [zonenname].
Thanx for the good work.