git.schokokeks.org
Repositories
Help
Report an Issue
webinterface.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
0d0cc0d
Branches
Tags
master
ticket
webinterface.git
modules
dns
dns_record_save.php
Erlaube *useraccounts* das edtieren von DNS-records
bernd
commited
0d0cc0d
at 2010-05-06 14:49:17
dns_record_save.php
Blame
History
Raw
<?php require_once('inc/base.php'); require_once('inc/debug.php'); global $debugmode; require_once('inc/security.php'); require_role(ROLE_SYSTEMUSER); require_once('dnsinclude.php'); $section = 'dns_dns'; $record = NULL; $id = NULL; if ($_REQUEST['id'] == 'new') { $record = blank_dns_record($_REQUEST['type']); } else { $id = (int) $_REQUEST['id']; $record = get_dns_record($id); } if (isset($_GET['action']) && ($_GET['action'] == 'delete')) { $sure = user_is_sure(); if ($sure === NULL) { $domain = new Domain((int) $record['domain']); $fqdn = $domain->fqdn; if ($record['hostname']) { $fqdn = $record['hostname'].'.'.$fqdn; } are_you_sure("action=delete&id={$id}", "Möchten Sie den ".strtoupper($record['type'])."-Record für ".$fqdn." wirklich löschen?"); } elseif ($sure === true) { delete_dns_record($id); if (! $debugmode) header("Location: dns_domain?dom=".$record['domain']); } elseif ($sure === false) { if (! $debugmode) header("Location: dns_domain?dom=".$record['domain']); } } else { // Sicherheitsprüfungen passieren im Backend $record['hostname'] = $_REQUEST['hostname']; $record['domain'] = (int) $_REQUEST['domain']; $record['ip'] = (isset($_REQUEST['ip']) ? $_REQUEST['ip'] : ''); $record['data'] = $_REQUEST['data']; $record['dyndns'] = (isset($_REQUEST['dyndns']) ? (int) $_REQUEST['dyndns'] : ''); $record['spec'] = (isset($_REQUEST['spec']) ? (int) $_REQUEST['spec'] : ''); $record['ttl'] = (int) $_REQUEST['ttl']; save_dns_record($id, $record); if (!$debugmode) header('Location: dns_domain?dom='.$record['domain']); }