mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-20 20:13:40 +03:00
Prepare $name in such a way that it always works. With or without dot, with or without a domainname
This commit is contained in:
parent
92e9f8c6af
commit
2418fc2f60
1 changed files with 3 additions and 4 deletions
|
@ -202,12 +202,11 @@ if ($action == "list" or $action== "listslaves") {
|
|||
_do_curl("/servers/:serverid:/zones/".$_POST['id'], array(), 'delete');
|
||||
_jtable_respond(null, 'delete');
|
||||
} elseif ($action == "createrecord" or $action == "editrecord") {
|
||||
if ($action == "createrecord") {
|
||||
$name = $_POST['name'].'.'.$_POST['domain'];
|
||||
$records = getrecords_by_name_type($_GET['zoneurl'], $name, $_POST['type']);
|
||||
} elseif ($action == "editrecord") {
|
||||
$name = $_POST['name'];
|
||||
$name = (!preg_match("/\.".$_POST['domain']."\.?$/", $_POST['name'])) ? $_POST['name'].'.'.$_POST['domain'] : $_POST['name'];
|
||||
$name = preg_replace("/\.$/", "", $name);
|
||||
$records = array();
|
||||
if ($action == "createrecord") {
|
||||
$records = getrecords_by_name_type($_GET['zoneurl'], $name, $_POST['type']);
|
||||
}
|
||||
|
||||
$records =_create_record($name, $records, $_POST, $_GET['zoneurl']);
|
||||
|
|
Loading…
Add table
Reference in a new issue