diff --git a/client_domains.php b/client_domains.php
index b91c9983..215b8083 100644
--- a/client_domains.php
+++ b/client_domains.php
@@ -95,6 +95,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
while ($row = mysqli_fetch_array($sql)) {
$domain_id = intval($row['domain_id']);
$domain_name = nullable_htmlentities($row['domain_name']);
+ $domain_description = nullable_htmlentities($row['domain_description']);
$domain_registrar = intval($row['domain_registrar']);
$domain_webhost = intval($row['domain_webhost']);
$domain_expire = nullable_htmlentities($row['domain_expire']);
@@ -119,7 +120,17 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
)" data-target="#editDomainModal"> |
+
+ )" data-target="#editDomainModal">
+
+
+ |
|
|
|
diff --git a/js/domain_edit_modal.js b/js/domain_edit_modal.js
index c045869c..e8a0b4d0 100644
--- a/js/domain_edit_modal.js
+++ b/js/domain_edit_modal.js
@@ -17,6 +17,7 @@ function populateDomainEditModal(client_id, domain_id) {
document.getElementById("editDomainHeader").innerText = domain.domain_name;
document.getElementById("editDomainId").value = domain_id;
document.getElementById("editDomainName").value = domain.domain_name;
+ document.getElementById("editDomainDescription").value = domain.domain_description;
document.getElementById("editDomainExpire").value = domain.domain_expire;
document.getElementById("editDomainNotes").value = domain.domain_notes;
document.getElementById("editDomainIP").value = domain.domain_ip;
diff --git a/post/domain.php b/post/domain.php
index e1a2d9ed..1fd4c99c 100644
--- a/post/domain.php
+++ b/post/domain.php
@@ -10,6 +10,7 @@ if (isset($_POST['add_domain'])) {
$client_id = intval($_POST['client_id']);
$name = preg_replace("(^https?://)", "", sanitizeInput($_POST['name']));
+ $description = sanitizeInput($_POST['description']);
$registrar = intval($_POST['registrar']);
$webhost = intval($_POST['webhost']);
$extended_log_description = '';
@@ -38,7 +39,7 @@ if (isset($_POST['add_domain'])) {
$whois = sanitizeInput($records['whois']);
// Add domain record
- 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_txt = '$txt', domain_raw_whois = '$whois', domain_notes = '$notes', domain_client_id = $client_id");
+ mysqli_query($mysqli,"INSERT INTO domains SET domain_name = '$name', domain_description = '$description', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = $expire, domain_ip = '$a', domain_name_servers = '$ns', domain_mail_servers = '$mx', domain_txt = '$txt', domain_raw_whois = '$whois', domain_notes = '$notes', domain_client_id = $client_id");
// Get inserted ID (for linking certificate, if exists)
$domain_id = mysqli_insert_id($mysqli);
@@ -69,6 +70,7 @@ if (isset($_POST['edit_domain'])) {
$domain_id = intval($_POST['domain_id']);
$name = preg_replace("(^https?://)", "", sanitizeInput($_POST['name']));
+ $description = sanitizeInput($_POST['description']);
$registrar = intval($_POST['registrar']);
$webhost = intval($_POST['webhost']);
$expire = sanitizeInput($_POST['expire']);
@@ -102,7 +104,7 @@ if (isset($_POST['edit_domain'])) {
$txt = sanitizeInput($records['txt']);
$whois = sanitizeInput($records['whois']);
- 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_txt = '$txt', domain_raw_whois = '$whois', domain_notes = '$notes' WHERE domain_id = $domain_id");
+ mysqli_query($mysqli,"UPDATE domains SET domain_name = '$name', domain_description = '$description', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = $expire, domain_ip = '$a', domain_name_servers = '$ns', domain_mail_servers = '$mx', domain_txt = '$txt', domain_raw_whois = '$whois', domain_notes = '$notes' WHERE domain_id = $domain_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Domain', log_action = 'Modify', log_description = '$session_name modified domain $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $domain_id");
@@ -191,12 +193,12 @@ if (isset($_POST['export_client_domains_csv'])) {
$f = fopen('php://memory', 'w');
//set column headers
- $fields = array('Domain', 'Registrar', 'Web Host', 'Expiration Date');
+ $fields = array('Domain', 'Description', 'Registrar', 'Web Host', 'Expiration Date');
fputcsv($f, $fields, $delimiter);
//output each row of the data, format line as csv and write to file pointer
while($row = $sql->fetch_assoc()) {
- $lineData = array($row['domain_name'], $row['domain_registrar'], $row['domain_webhost'], $row['domain_expire']);
+ $lineData = array($row['domain_name'], $row['domain_description'], $row['domain_registrar'], $row['domain_webhost'], $row['domain_expire']);
fputcsv($f, $lineData, $delimiter);
}