Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- // USAGE: dyndns.php?record=RECORD_NAME&user=USER&password=PASSWORD[&content=CONTENT][&ttl=TTL][&prio=PRIO][&type=TYPE]
- session_start();
- $_SESSION['userlogin'] = $_GET['user'];
- $_SESSION['userpwd'] = $_GET['password'];
- session_write_close();
- require_once("inc/toolkit.inc.php");
- include_once("inc/header.inc.php");
- function get_record_id_from_name($record) {
- global $db;
- $type = isset($_GET['type'])? $_GET['type']: "A"; // default type A
- $query = "SELECT id FROM records WHERE name = " . $db->quote($record, 'text') . " AND type = " . $db->quote($type, 'text');
- $rid = $db->queryOne($query);
- return $rid;
- }
- $record = $_GET['record'];
- $rid = get_record_id_from_name($record);
- $zid = get_zone_id_from_record_id($rid);
- $_GET['id'] = $_POST['rid'] = $rid;
- $_GET['domain'] = $_POST['zid'] = $zid;
- $_POST['name'] = $_GET['record'];
- $_POST['type'] = isset($_GET['type'])? $_GET['type']: "A"; // default type A
- $_POST['prio'] = isset($_GET['prio'])? $_GET['prio']: 0; // default priorioty 0
- $_POST['content'] = isset($_GET['content'])? $_GET['content']: $_SERVER['REMOTE_ADDR']; // default content remote addr
- $_POST['ttl'] = isset($_GET['ttl'])? $_GET['ttl']: 900; // default time to live 900
- $_POST['commit'] = "Commit changes";
- include("edit_record.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement