mirror of https://github.com/itflow-org/itflow
Fix domain edit for .eu and other domains.
This commit is contained in:
parent
7d0813a163
commit
f47c5cca84
|
|
@ -55,6 +55,14 @@ if ($row) {
|
|||
$txt = sanitizeInput($records['txt']);
|
||||
$whois = sanitizeInput($records['whois']);
|
||||
|
||||
if (
|
||||
$expire === 'NULL'
|
||||
&& $row['domain_expire'] !== null
|
||||
&& (new DateTime($row['domain_expire'])) >= (new DateTime())
|
||||
) {
|
||||
$expire = $row['domain_expire'];
|
||||
}
|
||||
|
||||
// Update the domain
|
||||
mysqli_query($mysqli, "UPDATE domains SET domain_name = '$domain_name', domain_expire = '$expire', domain_ip = '$a', domain_name_servers = '$ns', domain_mail_servers = '$mx', domain_txt = '$txt', domain_raw_whois = '$whois' WHERE domain_id = $domain_id");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -380,9 +380,12 @@ function getDomainExpirationDate($name) {
|
|||
if (is_array($response['expiration_date'])) {
|
||||
$expiry = new DateTime($response['expiration_date'][1]);
|
||||
}
|
||||
else {
|
||||
elseif (isset($response['expiration_date'])) {
|
||||
$expiry = new DateTime($response['expiration_date']);
|
||||
}
|
||||
else {
|
||||
return "NULL";
|
||||
}
|
||||
|
||||
return $expiry->format('Y-m-d');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,15 +70,13 @@ if (isset($_POST['edit_domain'])) {
|
|||
$registrar = intval($_POST['registrar']);
|
||||
$webhost = intval($_POST['webhost']);
|
||||
$expire = sanitizeInput($_POST['expire']);
|
||||
if (empty($expire)) {
|
||||
$expire = "NULL";
|
||||
} else {
|
||||
$expire = "'" . $expire . "'";
|
||||
}
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
||||
// Update domain expiry date
|
||||
$expire = getDomainExpirationDate($name);
|
||||
if (empty($expire) || (new DateTime($expire)) < (new DateTime())) {
|
||||
// Update domain expiry date
|
||||
$expire = getDomainExpirationDate($name);
|
||||
}
|
||||
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
||||
// Update NS, MX, A and WHOIS records/data
|
||||
$records = getDomainRecords($name);
|
||||
|
|
|
|||
Loading…
Reference in New Issue