|
Lines 1-25
Link Here
|
| 1 |
--- inc/templates.inc.php.orig 2010-12-10 23:26:28.839400000 +0200 |
|
|
| 2 |
+++ inc/templates.inc.php 2011-05-30 12:39:13.319768001 +0300 |
| 3 |
@@ -312,7 +312,7 @@ |
| 4 |
|
| 5 |
// Add a zone template from zone / another template. |
| 6 |
|
| 7 |
-function add_zone_templ_save_as($template_name, $description, $userid, $records) { |
| 8 |
+function add_zone_templ_save_as($template_name, $description, $userid, $records, $domain = null) { |
| 9 |
global $db; |
| 10 |
|
| 11 |
if (!(verify_permission('zone_master_add'))) { |
| 12 |
@@ -339,9 +339,12 @@ |
| 13 |
$content = $db->quote($record['content'], 'text'); |
| 14 |
} |
| 15 |
|
| 16 |
+ $name = $domain ? preg_replace('/'.$domain.'/', '[ZONE]',$record['name']) : $record['name']; |
| 17 |
+ $content = $domain ? preg_replace('/'.$domain.'/', '[ZONE]',$content) : $content; |
| 18 |
+ |
| 19 |
$query2 = "INSERT INTO zone_templ_records (zone_templ_id, name, type, content, ttl, prio) VALUES (" |
| 20 |
. $db->quote($zone_templ_id, 'integer') . "," |
| 21 |
- . $db->quote($record['name'], 'text') . "," |
| 22 |
+ . $db->quote($name, 'text') . "," |
| 23 |
. $db->quote($record['type'], 'text') . "," |
| 24 |
. $content . "," |
| 25 |
. $db->quote($record['ttl'], 'integer') . "," |