| | |
| | |
|
| | |
|
| | | // Loading the template
|
| | | $app->uses('tpl');
|
| | | $app->uses('tpl,validate_dns');
|
| | | $app->tpl->newTemplate("form.tpl.htm");
|
| | | $app->tpl->setInclude('content_tpl','templates/dns_wizard.htm');
|
| | |
|
| | | // import variables
|
| | | $template_id = (isset($_POST['template_id']))?intval($_POST['template_id']):1;
|
| | | $server_id = (isset($_POST['server_id']))?intval($_POST['server_id']):1;
|
| | | $sys_groupid = (isset($_POST['client_group_id']))?intval($_POST['client_group_id']):0;
|
| | |
|
| | | // get the correct server_id
|
| | | if($_SESSION['s']['user']['typ'] == 'admin') {
|
| | | $server_id = (isset($_POST['server_id']))?intval($_POST['server_id']):1;
|
| | | } else {
|
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"];
|
| | | $client = $app->db->queryOneRecord("SELECT default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
|
| | | $server_id = $client["default_dnsserver"];
|
| | | }
|
| | |
|
| | |
|
| | | // Load the templates
|
| | | $records = $app->db->queryAllRecords("SELECT * FROM dns_template WHERE visible = 'y'");
|
| | | $records = $app->db->queryAllRecords("SELECT * FROM dns_template WHERE visible = 'Y'");
|
| | | $template_id_option = '';
|
| | | foreach($records as $rec){
|
| | | $checked = ($rec['template_id'] == $template_id)?' SELECTED':'';
|
| | |
| | | $minimum = $app->db->quote($vars['minimum']);
|
| | | $ttl = $app->db->quote($vars['ttl']);
|
| | | $xfer = $app->db->quote($vars['xfer']);
|
| | | $serial = $app->validate_dns->increase_serial(0);
|
| | |
|
| | | $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `origin`, `ns`, `mbox`, `serial`, `refresh`, `retry`, `expire`, `minimum`, `ttl`, `active`, `xfer`) VALUES
|
| | | ('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$origin', '$ns', '$mbox', '1', '$refresh', '$retry', '$expire', '$minimum', '$ttl', 'Y', '$xfer')";
|
| | | ('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$origin', '$ns', '$mbox', '$serial', '$refresh', '$retry', '$expire', '$minimum', '$ttl', 'Y', '$xfer')";
|
| | | $dns_soa_id = $app->db->datalogInsert('dns_soa', $insert_data, 'id');
|
| | |
|
| | | // Insert the dns_rr records
|