Advertisement
Guest User

Untitled

a guest
Jun 15th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <?
  2. // USAGE: dyndns.php?record=RECORD_NAME&user=USER&password=PASSWORD[&content=CONTENT][&ttl=TTL][&prio=PRIO][&type=TYPE]
  3.  
  4. session_start();
  5. $_SESSION['userlogin'] = $_GET['user'];
  6. $_SESSION['userpwd'] = $_GET['password'];
  7. session_write_close();
  8.  
  9. require_once("inc/toolkit.inc.php");
  10. include_once("inc/header.inc.php");
  11.  
  12. function get_record_id_from_name($record) {
  13. global $db;
  14. $type = isset($_GET['type'])? $_GET['type']: "A"; // default type A
  15. $query = "SELECT id FROM records WHERE name = " . $db->quote($record, 'text') . " AND type = " . $db->quote($type, 'text');
  16. $rid = $db->queryOne($query);
  17. return $rid;
  18. }
  19.  
  20. $record = $_GET['record'];
  21.  
  22. $rid = get_record_id_from_name($record);
  23. $zid = get_zone_id_from_record_id($rid);
  24.  
  25. $_GET['id'] = $_POST['rid'] = $rid;
  26. $_GET['domain'] = $_POST['zid'] = $zid;
  27. $_POST['name'] = $_GET['record'];
  28. $_POST['type'] = isset($_GET['type'])? $_GET['type']: "A"; // default type A
  29. $_POST['prio'] = isset($_GET['prio'])? $_GET['prio']: 0; // default priorioty 0
  30. $_POST['content'] = isset($_GET['content'])? $_GET['content']: $_SERVER['REMOTE_ADDR']; // default content remote addr
  31. $_POST['ttl'] = isset($_GET['ttl'])? $_GET['ttl']: 900; // default time to live 900
  32. $_POST['commit'] = "Commit changes";
  33.  
  34. include("edit_record.php");
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement