示例#1
0
            $smarty->display('header.tpl');
            $smarty->display('edit_record.tpl');
            $smarty->display('footer.tpl');
            exit;
        } else {
            // Update record
            if ($_REQUEST['type'] == 'AAAA' || $_REQUEST['type'] == 'AAAA+PTR') {
                $address = uncompress_ipv6($_REQUEST['address']);
            } else {
                $address = $_REQUEST['address'];
            }
            if (strlen($_REQUEST['weight'])) {
                $weightstring = "weight=" . $_REQUEST['weight'] . ",";
            } else {
                $weightstring = null;
            }
            if (strlen($_REQUEST['port'])) {
                $portstring = "port=" . $_REQUEST['port'] . ",";
            } else {
                $portstring = null;
            }
            $q = "update records set " . "host='{$name}'," . "val='" . $address . "'," . "distance='" . $_REQUEST['distance'] . "'," . $weightstring . $portstring . "ttl='" . $_REQUEST['ttl'] . "' " . "where record_id='" . $_REQUEST['record_id'] . "' and domain_id='" . get_dom_id($domain) . "'";
            $pdo->query($q) or die(print_r($pdo->errorInfo()));
            set_msg("Record updated successfully!");
            header("Location: {$base_url}&mode=records&domain=" . urlencode($domain));
            exit;
        }
    } else {
        die("Error: illegal records_mode");
    }
}
示例#2
0
文件: domains.php 项目: shupp/VegaDNS
         set_msg_err("Error: could not do axfr-get for " . htmlentities($domain, ENT_QUOTES) . ":<br>" . htmlentities($out_array[0], ENT_QUOTES));
         $smarty->display('header.tpl');
         require 'src/import_form.php';
         $smarty->display('footer.tpl');
         exit;
     }
 }
 // ADD TO SQL
 while (list($key, $line) = each($domains_array)) {
     $domain = $line['domain'];
     // add domain first and get the id
     $params = array(':domain' => $domain);
     $q = "insert into domains (domain,status) values(:domain, 'active')";
     $stmt = $pdo->prepare($q);
     $stmt->execute($params) or die(print_r($stmt->errorInfo()));
     $domain_id = get_dom_id($domain);
     $skip_ns = 'FALSE';
     if (isset($_REQUEST['default_ns']) && $_REQUEST['default_ns'] == 'on') {
         $skip_ns = 'TRUE';
         if (is_array($def_ns)) {
             foreach ($def_ns as $ns) {
                 $host = preg_replace('/DOMAIN/', $domain, $ns['host']);
                 $params = array(':host' => $host, ':val' => $ns['val']);
                 $q = "insert into records\n                        (domain_id,host,type,val,distance,ttl)\n                        values(\n                        {$domain_id},\n                        :host,\n                        'N',\n                        :val,\n                        '" . $ns['distance'] . "',\n                        '" . $ns['ttl'] . "')";
                 $stmt = $pdo->prepare($q);
                 $stmt->execute($params) or die(print_r($stmt->errorInfo()));
                 $counter++;
             }
         }
     }
     while (list($line_key, $value) = each($line)) {