mirror of
https://github.com/itflow-org/itflow
synced 2026-03-09 15:24:51 +00:00
@@ -72,6 +72,16 @@
|
|||||||
|
|
||||||
<div class="tab-pane fade" id="pills-records">
|
<div class="tab-pane fade" id="pills-records">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Domain IP(s)</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-project-diagram"></i></span>
|
||||||
|
</div>
|
||||||
|
<textarea class="form-control" id="editDomainIP" name="domain_ip" rows="1" disabled></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Name Servers</label>
|
<label>Name Servers</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -89,7 +99,7 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-mail-bulk"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-mail-bulk"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<textarea class="form-control" id="editMailServers" name="mail_servers" disabled></textarea>
|
<textarea class="form-control" id="editMailServers" name="mail_servers" rows="1" disabled></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ include("client_domain_add_modal.php");
|
|||||||
document.getElementById("editDomainId").value = domain_id;
|
document.getElementById("editDomainId").value = domain_id;
|
||||||
document.getElementById("editDomainName").value = domain.domain_name;
|
document.getElementById("editDomainName").value = domain.domain_name;
|
||||||
document.getElementById("editExpire").value = domain.domain_expire;
|
document.getElementById("editExpire").value = domain.domain_expire;
|
||||||
|
document.getElementById("editDomainIP").value = domain.domain_ip;
|
||||||
document.getElementById("editNameServers").value = domain.domain_name_servers;
|
document.getElementById("editNameServers").value = domain.domain_name_servers;
|
||||||
document.getElementById("editMailServers").value = domain.domain_mail_servers;
|
document.getElementById("editMailServers").value = domain.domain_mail_servers;
|
||||||
document.getElementById("editRawWhois").value = domain.domain_raw_whois;
|
document.getElementById("editRawWhois").value = domain.domain_raw_whois;
|
||||||
|
|||||||
7
db.sql
7
db.sql
@@ -431,9 +431,10 @@ CREATE TABLE `domains` (
|
|||||||
`domain_id` int(11) NOT NULL AUTO_INCREMENT,
|
`domain_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`domain_name` varchar(200) NOT NULL,
|
`domain_name` varchar(200) NOT NULL,
|
||||||
`domain_expire` date DEFAULT NULL,
|
`domain_expire` date DEFAULT NULL,
|
||||||
`domain_name_servers` VARCHAR(255) NULL DEFAULT NULL,
|
`domain_ip` varchar(255) DEFAULT NULL,
|
||||||
`domain_mail_servers` VARCHAR(255) NULL DEFAULT NULL,
|
`domain_name_servers` varchar(255) DEFAULT NULL,
|
||||||
`domain_raw_whois` TEXT NULL DEFAULT NULL,
|
`domain_mail_servers` varchar(255) DEFAULT NULL,
|
||||||
|
`domain_raw_whois` text DEFAULT NULL,
|
||||||
`domain_created_at` datetime NOT NULL,
|
`domain_created_at` datetime NOT NULL,
|
||||||
`domain_updated_at` datetime DEFAULT NULL,
|
`domain_updated_at` datetime DEFAULT NULL,
|
||||||
`domain_archived_at` datetime DEFAULT NULL,
|
`domain_archived_at` datetime DEFAULT NULL,
|
||||||
|
|||||||
48
post.php
48
post.php
@@ -5283,17 +5283,27 @@ if(isset($_POST['add_domain'])){
|
|||||||
// NS, MX and WHOIS data
|
// NS, MX and WHOIS data
|
||||||
if(filter_var($name, FILTER_VALIDATE_DOMAIN) && (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')){
|
if(filter_var($name, FILTER_VALIDATE_DOMAIN) && (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')){
|
||||||
$domain = escapeshellarg($name);
|
$domain = escapeshellarg($name);
|
||||||
|
$a = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short $domain")));
|
||||||
$ns = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short NS $domain")));
|
$ns = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short NS $domain")));
|
||||||
$mx = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short MX $domain")));
|
$mx = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short MX $domain")));
|
||||||
$whois = trim(strip_tags(mysqli_real_escape_string($mysqli,shell_exec("whois -H $domain | sed 's/ //g' | head -30"))));
|
$whois = trim(strip_tags(mysqli_real_escape_string($mysqli,shell_exec("whois -H $domain | sed 's/ //g' | head -30"))));
|
||||||
|
|
||||||
|
// Get expiry date for com/org/net domains - This is very hacky. An API would be better.
|
||||||
|
if(!empty($whois && $expire == '0000-00-00')){
|
||||||
|
if(substr($_POST['name'], -3) == 'com' OR substr($_POST['name'], -3) == 'org' OR substr($_POST['name'], -3) == 'net'){
|
||||||
|
$pos = strpos($whois, 'Registry Expiry Date:');
|
||||||
|
$expire = substr($whois, $pos+22,10);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$ns = '';
|
$a = '';
|
||||||
$mx = '';
|
$ns = '';
|
||||||
$whois = '';
|
$mx = '';
|
||||||
|
$whois = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO domains SET domain_name = '$name', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = '$expire', domain_name_servers = '$ns', domain_mail_servers = '$mx', domain_raw_whois = '$whois', domain_created_at = NOW(), domain_client_id = $client_id, company_id = $session_company_id");
|
mysqli_query($mysqli,"INSERT INTO domains SET domain_name = '$name', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = '$expire', domain_ip = '$a', domain_name_servers = '$ns', domain_mail_servers = '$mx', domain_raw_whois = '$whois', domain_created_at = NOW(), domain_client_id = $client_id, company_id = $session_company_id");
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Domain', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, log_user_id = $session_user_id");
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Domain', log_action = 'Created', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, log_user_id = $session_user_id");
|
||||||
@@ -5312,23 +5322,33 @@ if(isset($_POST['edit_domain'])){
|
|||||||
$webhost = intval($_POST['webhost']);
|
$webhost = intval($_POST['webhost']);
|
||||||
$expire = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['expire'])));
|
$expire = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['expire'])));
|
||||||
if(empty($expire)){
|
if(empty($expire)){
|
||||||
$expire = "0000-00-00";
|
$expire = "0000-00-00";
|
||||||
}
|
}
|
||||||
|
|
||||||
// NS, MX and WHOIS data
|
// A, NS, MX and WHOIS data
|
||||||
if(filter_var($name, FILTER_VALIDATE_DOMAIN) && (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')){
|
if(filter_var($name, FILTER_VALIDATE_DOMAIN) && (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')){
|
||||||
$domain = escapeshellarg($name);
|
$domain = escapeshellarg($name);
|
||||||
$ns = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short NS $domain")));
|
$a = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short $domain")));
|
||||||
$mx = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short MX $domain")));
|
$ns = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short NS $domain")));
|
||||||
$whois = trim(strip_tags(mysqli_real_escape_string($mysqli,shell_exec("whois -H $domain | sed 's/ //g' | head -30"))));
|
$mx = strip_tags(mysqli_real_escape_string($mysqli,shell_exec("dig +short MX $domain")));
|
||||||
|
$whois = trim(strip_tags(mysqli_real_escape_string($mysqli,shell_exec("whois -H $domain | sed 's/ //g' | head -30"))));
|
||||||
|
|
||||||
|
// Get expiry date for com/org/net domains - This is very hacky. An API would be better.
|
||||||
|
if(!empty($whois)){
|
||||||
|
if(substr($_POST['name'], -3) == 'com' OR substr($_POST['name'], -3) == 'org' OR substr($_POST['name'], -3) == 'net'){
|
||||||
|
$pos = strpos($whois, 'Registry Expiry Date:');
|
||||||
|
$expire = substr($whois, $pos+22,10);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$ns = '';
|
$a = '';
|
||||||
$mx = '';
|
$ns = '';
|
||||||
$whois = '';
|
$mx = '';
|
||||||
|
$whois = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE domains SET domain_name = '$name', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = '$expire', domain_name_servers = '$ns', domain_mail_servers = '$mx', domain_raw_whois = '$whois', domain_updated_at = NOW() WHERE domain_id = $domain_id AND company_id = $session_company_id");
|
mysqli_query($mysqli,"UPDATE domains SET domain_name = '$name', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = '$expire', domain_ip = '$a', domain_name_servers = '$ns', domain_mail_servers = '$mx', domain_raw_whois = '$whois', domain_updated_at = NOW() WHERE domain_id = $domain_id AND company_id = $session_company_id");
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Domain', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, log_user_id = $session_user_id");
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Domain', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), company_id = $session_company_id, log_user_id = $session_user_id");
|
||||||
|
|||||||
Reference in New Issue
Block a user