-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmodrecord.php
More file actions
28 lines (23 loc) · 1.31 KB
/
modrecord.php
File metadata and controls
28 lines (23 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once 'header.inc.php';
$token=trim(escapeshellarg($_REQUEST["txtToken"])," '");
$acctnum=trim(escapeshellarg($_REQUEST["txtAcct"])," '");
$domainid=trim(escapeshellarg($_REQUEST["txtDomain"])," '");
$recid=trim(escapeshellarg($_REQUEST["txtId"])," '");
$name=trim(escapeshellarg($_REQUEST["txtName"])," '");
$type=trim(escapeshellarg($_REQUEST["txtType"])," '");
$data=trim(escapeshellarg($_REQUEST["txtData"])," '");
$priority=trim(escapeshellarg($_REQUEST["txtPriority"])," '");
$TTL=trim(escapeshellarg($_REQUEST["txtTTL"])," '");
$comment=trim(escapeshellarg($_REQUEST["txtComment"])," '");
$resp=shell_exec('curl -X PUT -s -k -d \'{"name":"'.$name.'"'.(empty($data)?'':',"data":"'.$data.'"').(empty($TTL)?'':',"ttl":'.$TTL).(empty($priority)?'':', "priority":'.$priority).(empty($comment)?'':',"comment":"'.$comment.'"').'}\' -H "X-Auth-Token: '.$token.'" -H "Content-Type: application/json" https://dns.api.rackspacecloud.com/v1.0/'.$acctnum.'/domains/'.$domainid.'/records/'.$recid.' 2>&1');
?>
<p>Add record request submitted</p>
<button name="btnBack" type="reset" onClick="history.go(-1);">Back</button>
<?php
//debugging output
echo "<hr/>Raw response:<br/>";
echo "<div style=\"border: 1px solid #000; height: 9em; overflow: auto; margin: 0.5em;\">";
echo nl2br($resp);
echo "</div>";
require_once 'footer.inc.php';