[GH-ISSUE #150] Ability to use cname in template #98

Closed
opened 2026-02-28 01:20:58 +03:00 by kerem · 3 comments
Owner

Originally created by @webvanced on GitHub (Jun 26, 2017).
Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/150

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].

            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.

Originally created by @webvanced on GitHub (Jun 26, 2017). Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/150 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]. ``` 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.
kerem closed this issue 2026-02-28 01:20:58 +03:00
Author
Owner

@tuxis-ie commented on GitHub (Jun 26, 2017):

Thanks. Can you turn this into a PR?

<!-- gh-comment-id:311035651 --> @tuxis-ie commented on GitHub (Jun 26, 2017): Thanks. Can you turn this into a PR?
Author
Owner

@webvanced commented on GitHub (Jul 11, 2017):

Hi, created the pull request.

<!-- gh-comment-id:314358706 --> @webvanced commented on GitHub (Jul 11, 2017): Hi, created the pull request.
Author
Owner

@tuxis-ie commented on GitHub (Aug 7, 2017):

Merged #153

<!-- gh-comment-id:320603190 --> @tuxis-ie commented on GitHub (Aug 7, 2017): Merged #153
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nsedit#98
No description provided.