mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-19 20:09:14 +03:00
Added support for CNAME's to zone in templates
This commit is contained in:
parent
382ca51db1
commit
1f2225cf6d
2 changed files with 13 additions and 4 deletions
|
@ -35,10 +35,18 @@ $templates[] = array(
|
||||||
'name' => 'Tuxis',
|
'name' => 'Tuxis',
|
||||||
'owner' => 'username', # Set to 'public' to make it available to all users
|
'owner' => 'username', # Set to 'public' to make it available to all users
|
||||||
'records' => array(
|
'records' => array(
|
||||||
array(
|
array(
|
||||||
'name' => '',
|
'name' => '',
|
||||||
'type' => 'MX',
|
'type' => 'MX',
|
||||||
'content' => '200 mx2.tuxis.nl')
|
'content' => '200 mx2.tuxis.nl'),
|
||||||
|
array(
|
||||||
|
'name' => '',
|
||||||
|
'type' => 'A',
|
||||||
|
'content' => '1.2.3.4'),
|
||||||
|
array(
|
||||||
|
'name' => 'www',
|
||||||
|
'type' => 'CNAME',
|
||||||
|
'content' => '[zonename]')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -331,6 +331,7 @@ case "create":
|
||||||
|
|
||||||
foreach ($template['records'] as $record) {
|
foreach ($template['records'] as $record) {
|
||||||
$name = $record['name'] != '' ? join(Array($record['name'],'.',$zonename)) : $zonename;
|
$name = $record['name'] != '' ? join(Array($record['name'],'.',$zonename)) : $zonename;
|
||||||
|
$record['content'] = str_replace("[zonename]", $zonename, $record['content']);
|
||||||
$zone->addRecord($name, $record['type'], $record['content']);
|
$zone->addRecord($name, $record['type'], $record['content']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue