Skip to content

Commit

Permalink
Update IP address only a requested A record (not all existing in that…
Browse files Browse the repository at this point in the history
… zone).
  • Loading branch information
Edmondas Girkantas committed Sep 30, 2012
1 parent 3b1411d commit 9e5e964
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dynamic_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function status_exit($status) {
}

$username = safe($_SERVER['PHP_AUTH_USER']);
// FIXME: supports only md5 hashes
$password = md5(safe($_SERVER['PHP_AUTH_PW']));
$hostname = safe($_REQUEST['hostname']);
$ip = safe($_REQUEST['myip']);
Expand All @@ -99,7 +100,8 @@ function status_exit($status) {

while ($row2 = $result->fetchRow()) {
if ($hostname == $row2['name']){
$updatequery ="UPDATE records SET content ='{$ip}' where domain_id='{$row["domain_id"]}' and type='A'";
//$updatequery ="UPDATE records SET content ='{$ip}' where domain_id='{$row["domain_id"]}' and type='A'";
$updatequery ="UPDATE records SET content ='{$ip}' where name='{$row2["name"]}' and type='A'";
$query = $db->query($updatequery);
$domainunauth = "-1";
}
Expand Down

0 comments on commit 9e5e964

Please sign in to comment.