Marius Burkard
2016-04-20 4569cae57f127afd093794310ccd290d2d9fdf36
commit | author | age
3dbcc3 1 <?php
T 2
3 /*
4 Copyright (c) 2008, Till Brehm, projektfarm Gmbh
5 All rights reserved.
6
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9
10     * Redistributions of source code must retain the above copyright notice,
11       this list of conditions and the following disclaimer.
12     * Redistributions in binary form must reproduce the above copyright notice,
13       this list of conditions and the following disclaimer in the documentation
14       and/or other materials provided with the distribution.
15     * Neither the name of ISPConfig nor the names of its contributors
16       may be used to endorse or promote products derived from this software without
17       specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
b1a6a5 31 require_once '../../lib/config.inc.php';
MC 32 require_once '../../lib/app.inc.php';
3dbcc3 33
T 34 //* Check permissions for module
35 $app->auth->check_module_permissions('dns');
36
37
38 // Loading the template
39 $app->uses('tpl,validate_dns');
40 $app->tpl->newTemplate("form.tpl.htm");
b1a6a5 41 $app->tpl->setInclude('content_tpl', 'templates/dns_wizard.htm');
44d2a7 42 $app->load_language_file('/web/dns/lib/lang/'.$_SESSION['s']['language'].'_dns_wizard.lng');
3dbcc3 43
T 44 // import variables
65ea2e 45 $template_id = (isset($_POST['template_id']))?$app->functions->intval($_POST['template_id']):0;
M 46 $sys_groupid = (isset($_POST['client_group_id']))?$app->functions->intval($_POST['client_group_id']):0;
3dbcc3 47
T 48 // get the correct server_id
bd6659 49 if (isset($_POST['server_id'])) {
SJ 50     $server_id = $app->functions->intval($_POST['server_id']);
51     $post_server_id = true;
1a2cbf 52 } elseif (isset($_POST['server_id_value'])) {
MC 53     $server_id = $app->functions->intval($_POST['server_id_value']);
54     $post_server_id = true;
3dbcc3 55 } else {
41d7d1 56     $settings = $app->getconf->get_global_config('dns');
SC 57     $server_id = $app->functions->intval($settings['default_dnsserver']);
bd6659 58     $post_server_id = false;
SJ 59 }
3dbcc3 60
T 61 // Load the templates
222ea2 62 $records = $app->db->queryAllRecords("SELECT * FROM dns_template WHERE visible = 'Y' ORDER BY name ASC");
3dbcc3 63 $template_id_option = '';
T 64 $n = 0;
65 foreach($records as $rec){
66     $checked = ($rec['template_id'] == $template_id)?' SELECTED':'';
67     $template_id_option .= '<option value="'.$rec['template_id'].'"'.$checked.'>'.$rec['name'].'</option>';
68     if($n == 0 && $template_id == 0) $template_id = $rec['template_id'];
69     $n++;
70 }
71 unset($n);
b1a6a5 72 $app->tpl->setVar("template_id_option", $template_id_option);
3dbcc3 73
3e94c8 74 $app->uses('ini_parser,getconf');
SC 75 $domains_settings = $app->getconf->get_global_config('domains');
76
3dbcc3 77 // If the user is administrator
T 78 if($_SESSION['s']['user']['typ'] == 'admin') {
b1a6a5 79
3dbcc3 80     // Load the list of servers
0da7c5 81     $records = $app->db->queryAllRecords("SELECT server_id, server_name FROM server WHERE mirror_server_id = 0 AND dns_server = 1 ORDER BY server_name");
3dbcc3 82     $server_id_option = '';
T 83     foreach($records as $rec){
84         $checked = ($rec['server_id'] == $server_id)?' SELECTED':'';
85         $server_id_option .= '<option value="'.$rec['server_id'].'"'.$checked.'>'.$rec['server_name'].'</option>';
86     }
b1a6a5 87     $app->tpl->setVar("server_id", $server_id_option);
MC 88
3e94c8 89     if ($domains_settings['use_domain_module'] != 'y') {
SC 90         // load the list of clients
91         $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
92         $clients = $app->db->queryAllRecords($sql);
93         $client_select = '';
94         if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
95         if(is_array($clients)) {
96             foreach( $clients as $client) {
97                 $selected = ($client["groupid"] == $sys_groupid)?'SELECTED':'';
98                 $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n";
99             }
3dbcc3 100         }
T 101
3e94c8 102         $app->tpl->setVar("client_group_id", $client_select);
SC 103     }
3dbcc3 104 }
T 105
0fd51f 106 if ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
b1a6a5 107
0fd51f 108     // Get the limits of the client
604c0c 109     $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
cc7a82 110     $client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
0fd51f 111
b1a6a5 112
3e94c8 113     if ($domains_settings['use_domain_module'] != 'y') {
SC 114         // load the list of clients
cc7a82 115         $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ? ORDER BY client.company_name, client.contact_name, sys_group.name";
MC 116         $clients = $app->db->queryAllRecords($sql, $client['client_id']);
117         $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client['client_id']);
3e94c8 118         $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>';
SC 119         if(is_array($clients)) {
120             foreach( $clients as $client) {
121                 $selected = ($client["groupid"] == $sys_groupid)?'SELECTED':'';
122                 $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n";
123             }
0fd51f 124         }
T 125
3e94c8 126         $app->tpl->setVar("client_group_id", $client_select);
SC 127     }
0fd51f 128 }
T 129
bd6659 130 if($_SESSION["s"]["user"]["typ"] != 'admin')
775c05 131 {
MC 132     $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
cc7a82 133     $client_dns = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
bd6659 134
SJ 135     $client_dns['dns_servers_ids'] = explode(',', $client_dns['dns_servers']);
136
137     $only_one_server = count($client_dns['dns_servers_ids']) === 1;
138     $app->tpl->setVar('only_one_server', $only_one_server);
139
140     if ($only_one_server) {
141         $app->tpl->setVar('server_id_value', $client_dns['dns_servers_ids'][0]);
142     }
143
cc7a82 144     $sql = "SELECT server_id, server_name FROM server WHERE server_id IN ?";
MC 145     $dns_servers = $app->db->queryAllRecords($sql, $client_dns['dns_servers_ids']);
bd6659 146
SJ 147     $options_dns_servers = "";
148
149     foreach ($dns_servers as $dns_server) {
75b7fc 150         $options_dns_servers .= '<option value="'.$dns_server['server_id'].'"'.($_POST['server_id'] == $dns_server['server_id'] ? ' selected="selected"' : '').'>'.$dns_server['server_name'].'</option>';
bd6659 151     }
SJ 152
153     $app->tpl->setVar("server_id", $options_dns_servers);
154     unset($options_dns_servers);
155
156 }
0fd51f 157
cc7a82 158 $template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE template_id = ?", $template_id);
b1a6a5 159 $fields = explode(',', $template_record['fields']);
3dbcc3 160 if(is_array($fields)) {
T 161     foreach($fields as $field) {
b1a6a5 162         $app->tpl->setVar($field."_VISIBLE", 1);
3dbcc3 163         $field = strtolower($field);
b1a6a5 164         $app->tpl->setVar($field, $_POST[$field]);
3dbcc3 165     }
T 166 }
167
021ef6 168 /*
SC 169  * Now we have to check, if we should use the domain-module to select the domain
170  * or not
171  */
3e94c8 172 if ($domains_settings['use_domain_module'] == 'y') {
021ef6 173     /*
SC 174      * The domain-module is in use.
175     */
9ec304 176     $domains = $app->tools_sites->getDomainModuleDomains("dns_soa");
021ef6 177     $domain_select = '';
SC 178     if(is_array($domains) && sizeof($domains) > 0) {
179         /* We have domains in the list, so create the drop-down-list */
180         foreach( $domains as $domain) {
181             $domain_select .= "<option value=" . $domain['domain_id'] ;
182             if ($domain['domain'] == $_POST['domain']) {
183                 $domain_select .= " selected";
184             }
185             $domain_select .= ">" . $app->functions->idn_decode($domain['domain']) . ".</option>\r\n";
186         }
187     }
188     else {
189         /*
190          * We have no domains in the domain-list. This means, we can not add ANY new domain.
191          * To avoid, that the variable "domain_option" is empty and so the user can
192          * free enter a domain, we have to create a empty option!
193         */
194         $domain_select .= "<option value=''></option>\r\n";
195     }
196     $app->tpl->setVar("domain_option", $domain_select);
197 }
198
3dbcc3 199 if($_POST['create'] == 1) {
69a57d 200     
TB 201     //* CSRF Check
202     $app->auth->csrf_token_check();
203     
3dbcc3 204     $error = '';
b1a6a5 205
015dff 206     if ($post_server_id)
bd6659 207     {
c6d29c 208         $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
cc7a82 209         $client = $app->db->queryOneRecord("SELECT dns_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
bd6659 210
SJ 211         $client['dns_servers_ids'] = explode(',', $client['dns_servers']);
212
213         // Check if chosen server is in authorized servers for this client
214         if (!(is_array($client['dns_servers_ids']) && in_array($server_id, $client['dns_servers_ids'])) && $_SESSION["s"]["user"]["typ"] != 'admin') {
215             $error .= $app->lng('error_not_allowed_server_id').'<br />';
216         }
217     }
218     else
219     {
220         $error .= $app->lng('error_no_server_id').'<br />';
221     }
015dff 222
992797 223     // apply filters
MC 224     if(isset($_POST['domain']) && $_POST['domain'] != ''){
021ef6 225         /* check if the domain module is used - and check if the selected domain can be used! */
3e94c8 226         if ($domains_settings['use_domain_module'] == 'y') {
SC 227             if ($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
228                 $_POST['client_group_id'] = $app->tools_sites->getClientIdForDomain($_POST['domain']);
229             }
021ef6 230             $domain_check = $app->tools_sites->checkDomainModuleDomain($_POST['domain']);
SC 231             if(!$domain_check) {
232                 // invalid domain selected
233                 $_POST['domain'] = '';
234             } else {
235                 $_POST['domain'] = $domain_check;
236             }
237         } else {
238             $_POST['domain'] = $app->functions->idn_encode($_POST['domain']);
239             $_POST['domain'] = strtolower($_POST['domain']);
240         }
992797 241     }
MC 242     if(isset($_POST['ns1']) && $_POST['ns1'] != ''){
243         $_POST['ns1'] = $app->functions->idn_encode($_POST['ns1']);
244         $_POST['ns1'] = strtolower($_POST['ns1']);
245     }
246     if(isset($_POST['ns2']) && $_POST['ns2'] != ''){
247         $_POST['ns2'] = $app->functions->idn_encode($_POST['ns2']);
248         $_POST['ns2'] = strtolower($_POST['ns2']);
249     }
250     if(isset($_POST['email']) && $_POST['email'] != ''){
251         $_POST['email'] = $app->functions->idn_encode($_POST['email']);
252         $_POST['email'] = strtolower($_POST['email']);
253     }
b1a6a5 254
MC 255
44d2a7 256     if(isset($_POST['domain']) && $_POST['domain'] == '') $error .= $app->lng('error_domain_empty').'<br />';
b1a6a5 257     elseif(isset($_POST['domain']) && !preg_match('/^[\w\.\-]{2,64}\.[a-zA-Z0-9\-]{2,30}$/', $_POST['domain'])) $error .= $app->lng('error_domain_regex').'<br />';
72695f 258
44d2a7 259     if(isset($_POST['ip']) && $_POST['ip'] == '') $error .= $app->lng('error_ip_empty').'<br />';
72695f 260
604d25 261     if(isset($_POST['ipv6']) && $_POST['ipv6'] == '') $error .= $app->lng('error_ipv6_empty').'<br />';
CS 262
44d2a7 263     if(isset($_POST['ns1']) && $_POST['ns1'] == '') $error .= $app->lng('error_ns1_empty').'<br />';
b1a6a5 264     elseif(isset($_POST['ns1']) && !preg_match('/^[\w\.\-]{2,64}\.[a-zA-Z0-9]{2,30}$/', $_POST['ns1'])) $error .= $app->lng('error_ns1_regex').'<br />';
72695f 265
44d2a7 266     if(isset($_POST['ns2']) && $_POST['ns2'] == '') $error .= $app->lng('error_ns2_empty').'<br />';
b1a6a5 267     elseif(isset($_POST['ns2']) && !preg_match('/^[\w\.\-]{2,64}\.[a-zA-Z0-9]{2,30}$/', $_POST['ns2'])) $error .= $app->lng('error_ns2_regex').'<br />';
72695f 268
44d2a7 269     if(isset($_POST['email']) && $_POST['email'] == '') $error .= $app->lng('error_email_empty').'<br />';
b1a6a5 270     elseif(isset($_POST['email']) && !preg_match('/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z0-9\-]{2,30}$/i', $_POST['email'])) $error .= $app->lng('error_email_regex').'<br />';
MC 271
10b4c8 272     // make sure that the record belongs to the client group and not the admin group when admin inserts it
721fb2 273     if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($_POST['client_group_id'])) {
65ea2e 274         $sys_groupid = $app->functions->intval($_POST['client_group_id']);
721fb2 275     } elseif($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($_POST['client_group_id'])) {
65ea2e 276         $sys_groupid = $app->functions->intval($_POST['client_group_id']);
721fb2 277     } else {
T 278         $sys_groupid = $_SESSION["s"]["user"]["default_group"];
279     }
b1a6a5 280
8fb58f 281     $tform_def_file = "form/dns_soa.tform.php";
T 282     $app->uses('tform');
283     $app->tform->loadFormDef($tform_def_file);
b1a6a5 284
616d34 285     if($_SESSION['s']['user']['typ'] != 'admin') {
T 286         if(!$app->tform->checkClientLimit('limit_dns_zone')) {
287             $error .= $app->tform->wordbook["limit_dns_zone_txt"];
288         }
289         if(!$app->tform->checkResellerLimit('limit_dns_zone')) {
290             $error .= $app->tform->wordbook["limit_dns_zone_txt"];
291         }
3cebc3 292     }
b1a6a5 293
MC 294
3dbcc3 295     // replace template placeholders
T 296     $tpl_content = $template_record['template'];
b1a6a5 297     if($_POST['domain'] != '') $tpl_content = str_replace('{DOMAIN}', $_POST['domain'], $tpl_content);
MC 298     if($_POST['ip'] != '') $tpl_content = str_replace('{IP}', $_POST['ip'], $tpl_content);
604d25 299     if($_POST['ipv6'] != '') $tpl_content = str_replace('{IPV6}',$_POST['ipv6'],$tpl_content);
b1a6a5 300     if($_POST['ns1'] != '') $tpl_content = str_replace('{NS1}', $_POST['ns1'], $tpl_content);
MC 301     if($_POST['ns2'] != '') $tpl_content = str_replace('{NS2}', $_POST['ns2'], $tpl_content);
302     if($_POST['email'] != '') $tpl_content = str_replace('{EMAIL}', $_POST['email'], $tpl_content);
28cd07 303     $enable_dnssec = (($_POST['dnssec'] == 'Y') ? 'Y' : 'N');
b1a6a5 304     if(isset($_POST['dkim']) && preg_match('/^[\w\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,30}[\.]{0,1}$/', $_POST['domain'])) {
5588af 305         $sql = $app->db->queryOneRecord("SELECT dkim_public, dkim_selector FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ".$app->tform->getAuthSQL('r'), $_POST['domain']);
76be2b 306         $public_key = $sql['dkim_public'];
b1a6a5 307         if ($public_key!='') {
76be2b 308             if (empty($sql['dkim_selector'])) $sql['dkim_selector'] = 'default';
FS 309             $dns_record=str_replace(array("\r\n", "\n", "\r", "-----BEGIN PUBLIC KEY-----", "-----END PUBLIC KEY-----"), '', $public_key);
310             $tpl_content .= "\n".'TXT|'.$sql['dkim_selector'].'._domainkey.'.$_POST['domain'].'.|v=DKIM1; t=s; p='.$dns_record;
b1a6a5 311         }
MC 312     }
313
992797 314     // Parse the template
b1a6a5 315     $tpl_rows = explode("\n", $tpl_content);
3dbcc3 316     $section = '';
T 317     $vars = array();
d63cea 318     $vars['xfer']='';
3dbcc3 319     $dns_rr = array();
T 320     foreach($tpl_rows as $row) {
321         $row = trim($row);
b1a6a5 322         if(substr($row, 0, 1) == '[') {
3dbcc3 323             if($row == '[ZONE]') {
T 324                 $section = 'zone';
325             } elseif($row == '[DNS_RECORDS]') {
326                 $section = 'dns_records';
327             } else {
328                 die('Unknown section type');
329             }
330         } else {
331             if($row != '') {
332                 // Handle zone section
333                 if($section == 'zone') {
b1a6a5 334                     $parts = explode('=', $row);
3dbcc3 335                     $key = trim($parts[0]);
T 336                     $val = trim($parts[1]);
337                     if($key != '') $vars[$key] = $val;
338                 }
339                 // Handle DNS Record rows
340                 if($section == 'dns_records') {
b1a6a5 341                     $parts = explode('|', $row);
3dbcc3 342                     $dns_rr[] = array(
3a11d2 343                         'name' => $parts[1],
MC 344                         'type' => $parts[0],
345                         'data' => $parts[2],
346                         'aux'  => $parts[3],
347                         'ttl'  => $parts[4]
3dbcc3 348                     );
T 349                 }
350             }
351         }
b1a6a5 352
3dbcc3 353     } // end foreach
b1a6a5 354
44d2a7 355     if($vars['origin'] == '') $error .= $app->lng('error_origin_empty').'<br />';
T 356     if($vars['ns'] == '') $error .= $app->lng('error_ns_empty').'<br />';
357     if($vars['mbox'] == '') $error .= $app->lng('error_mbox_empty').'<br />';
358     if($vars['refresh'] == '') $error .= $app->lng('error_refresh_empty').'<br />';
359     if($vars['retry'] == '') $error .= $app->lng('error_retry_empty').'<br />';
360     if($vars['expire'] == '') $error .= $app->lng('error_expire_empty').'<br />';
361     if($vars['minimum'] == '') $error .= $app->lng('error_minimum_empty').'<br />';
362     if($vars['ttl'] == '') $error .= $app->lng('error_ttl_empty').'<br />';
b1a6a5 363
3dbcc3 364     if($error == '') {
T 365         // Insert the soa record
366         $sys_userid = $_SESSION['s']['user']['userid'];
3a11d2 367         $origin = $vars['origin'];
MC 368         $ns = $vars['ns'];
369         $mbox = str_replace('@', '.', $vars['mbox']);
370         $refresh = $vars['refresh'];
371         $retry = $vars['retry'];
372         $expire = $vars['expire'];
373         $minimum = $vars['minimum'];
374         $ttl = $vars['ttl'];
375         $xfer = $vars['xfer'];
376         $also_notify = $vars['also_notify'];
377         $update_acl = $vars['update_acl'];
3dbcc3 378         $serial = $app->validate_dns->increase_serial(0);
b1a6a5 379
3a11d2 380         $insert_data = array(
MC 381             "sys_userid" => $sys_userid,
382             "sys_groupid" => $sys_groupid,
383             "sys_perm_user" => 'riud',
384             "sys_perm_group" => 'riud',
385             "sys_perm_other" => '',
386             "server_id" => $server_id,
387             "origin" => $origin,
388             "ns" => $ns,
389             "mbox" => $mbox,
390             "serial" => $serial,
391             "refresh" => $refresh,
392             "retry" => $retry,
393             "expire" => $expire,
394             "minimum" => $minimum,
395             "ttl" => $ttl,
396             "active" => 'Y',
397             "xfer" => $xfer,
398             "also_notify" => $also_notify,
28cd07 399             "update_acl" => $update_acl,
AT 400             "dnssec_wanted" => $enable_dnssec
3a11d2 401         );
3dbcc3 402         $dns_soa_id = $app->db->datalogInsert('dns_soa', $insert_data, 'id');
b1a6a5 403
3dbcc3 404         // Insert the dns_rr records
T 405         if(is_array($dns_rr) && $dns_soa_id > 0) {
406             foreach($dns_rr as $rr) {
3a11d2 407                 $insert_data = array(
MC 408                     "sys_userid" => $sys_userid,
409                     "sys_groupid" => $sys_groupid,
410                     "sys_perm_user" => 'riud',
411                     "sys_perm_group" => 'riud',
412                     "sys_perm_other" => '',
413                     "server_id" => $server_id,
414                     "zone" => $dns_soa_id,
415                     "name" => $rr['name'],
416                     "type" => $rr['type'],
417                     "data" => $rr['data'],
418                     "aux" => $rr['aux'],
419                     "ttl" => $rr['ttl'],
420                     "active" => 'Y'
421                 );
3dbcc3 422                 $dns_rr_id = $app->db->datalogInsert('dns_rr', $insert_data, 'id');
T 423             }
424         }
b1a6a5 425
3dbcc3 426         header("Location: dns_soa_list.php");
T 427         exit;
b1a6a5 428
3dbcc3 429     } else {
b1a6a5 430         $app->tpl->setVar("error", $error);
3dbcc3 431     }
b1a6a5 432
3dbcc3 433 }
T 434
435
436
b1a6a5 437 $app->tpl->setVar("title", 'DNS Wizard');
3dbcc3 438
69a57d 439 //* SET csrf token
TB 440 $csrf_token = $app->auth->csrf_token_get('dns_wizard');
441 $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']);
442 $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']);
443
3dbcc3 444 $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dns_wizard.lng';
b1a6a5 445 include $lng_file;
3dbcc3 446 $app->tpl->setVar($wb);
T 447
448 $app->tpl_defaults();
992797 449 $app->tpl->pparse();
MC 450
451
e95eee 452 ?>