diff --git a/admin/backup.php b/admin/backup.php index eb66316c6..0d6891f55 100644 --- a/admin/backup.php +++ b/admin/backup.php @@ -187,8 +187,8 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
-
diff --git a/admin/modals/api/api_key_add.php b/admin/modals/api/api_key_add.php index e3b55ce2c..653a197d6 100644 --- a/admin/modals/api/api_key_add.php +++ b/admin/modals/api/api_key_add.php @@ -74,7 +74,7 @@ ob_start();
- +
@@ -83,7 +83,7 @@ ob_start();
- +

diff --git a/agent/asset.php b/agent/asset.php index a698d806e..5449e03b8 100644 --- a/agent/asset.php +++ b/agent/asset.php @@ -432,7 +432,7 @@ if (mysqli_num_rows($sql) == 0) {

Network

-
+
IP
@@ -463,7 +463,7 @@ if (mysqli_num_rows($sql) == 0) {

Hardware

-
+
Model
@@ -537,7 +537,7 @@ if (mysqli_num_rows($sql) == 0) { Nobody -
+
@@ -789,7 +789,7 @@ if (mysqli_num_rows($sql) == 0) { - + diff --git a/agent/client_overview.php b/agent/client_overview.php index 5c87ab2b9..932e7a935 100644 --- a/agent/client_overview.php +++ b/agent/client_overview.php @@ -198,7 +198,7 @@ $money_format = function ($amount) use ($currency_format, $client_currency_code,
- +
@@ -230,7 +230,7 @@ $money_format = function ($amount) use ($currency_format, $client_currency_code, - +
@@ -245,7 +245,7 @@ $money_format = function ($amount) use ($currency_format, $client_currency_code, - + @@ -253,7 +253,7 @@ $money_format = function ($amount) use ($currency_format, $client_currency_code, OTP - +
diff --git a/agent/clients.php b/agent/clients.php index f7acda9c0..36c16988f 100644 --- a/agent/clients.php +++ b/agent/clients.php @@ -537,7 +537,7 @@ $total_leads = intval($row['leads']); Email - + diff --git a/agent/contact.php b/agent/contact.php index 8723edb69..5495019a2 100644 --- a/agent/contact.php +++ b/agent/contact.php @@ -222,7 +222,7 @@ if (isset($_GET['contact_id'])) {
-
+
">
@@ -395,7 +395,7 @@ if (isset($_GET['contact_id'])) { if (empty($asset_ip)) { $asset_ip_display = "-"; } else { - $asset_ip_display = "$asset_ip"; + $asset_ip_display = "$asset_ip"; } $asset_nat_ip = escapeHtml($row['interface_nat_ip']); $asset_ipv6 = escapeHtml($row['interface_ipv6']); @@ -533,14 +533,14 @@ if (isset($_GET['contact_id'])) { if (empty($credential_uri)) { $credential_uri_display = "-"; } else { - $credential_uri_display = "$credential_uri"; + $credential_uri_display = "$credential_uri"; } $credential_uri_2 = escapeHtml($row['credential_uri_2']); $credential_username = escapeHtml(decryptCredentialEntry($row['credential_username'])); if (empty($credential_username)) { $credential_username_display = "-"; } else { - $credential_username_display = "$credential_username"; + $credential_username_display = "$credential_username"; } $credential_otp_secret = escapeHtml($row['credential_otp_secret']); if (empty($credential_otp_secret)) { @@ -566,7 +566,7 @@ if (isset($_GET['contact_id'])) { - + diff --git a/agent/contacts.php b/agent/contacts.php index e85426713..edb6a6499 100644 --- a/agent/contacts.php +++ b/agent/contacts.php @@ -362,7 +362,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); if (empty($contact_email)) { $contact_email_display = ""; } else { - $contact_email_display = "
$contact_email
"; + $contact_email_display = "
$contact_email
"; } $contact_info_display = "$contact_phone_display $contact_mobile_display $contact_email_display"; if (empty($contact_info_display)) { diff --git a/agent/credentials.php b/agent/credentials.php index 6c0c064aa..b49486730 100644 --- a/agent/credentials.php +++ b/agent/credentials.php @@ -318,14 +318,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); if (empty($credential_uri)) { $credential_uri_display = "-"; } else { - $credential_uri_display = "" . truncate($credential_uri,40) . ""; + $credential_uri_display = "" . truncate($credential_uri,40) . ""; } $credential_uri_2 = escapeUrl($row['credential_uri_2']); $credential_username = escapeHtml(decryptCredentialEntry($row['credential_username'])); if (empty($credential_username)) { $credential_username_display = "-"; } else { - $credential_username_display = "$credential_username"; + $credential_username_display = "$credential_username"; } $credential_otp_secret = escapeHtml($row['credential_otp_secret']); if (empty($credential_otp_secret)) { @@ -415,7 +415,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - + diff --git a/agent/global_search.php b/agent/global_search.php index d6049c499..a7c109637 100644 --- a/agent/global_search.php +++ b/agent/global_search.php @@ -184,11 +184,11 @@ function searchResultBadge($badge) { ?>
- +
- +
diff --git a/agent/includes/client_details.php b/agent/includes/client_details.php index b56f0994b..fd6cd1fe7 100644 --- a/agent/includes/client_details.php +++ b/agent/includes/client_details.php @@ -27,7 +27,7 @@ $location_map_query = rawurlencode(html_entity_decode(trim("$location_address $l - + diff --git a/agent/js/share_modal.js b/agent/js/share_modal.js index 7a9ff6f24..080d11986 100644 --- a/agent/js/share_modal.js +++ b/agent/js/share_modal.js @@ -43,8 +43,14 @@ function generateShareLink() { document.getElementById("div_share_link_output").hidden = false; document.getElementById("share_link").value = response; - // Copy link to clipboard - navigator.clipboard.writeText(response); + // Copy it straight away - itflowCopyText (js/app.js) also works + // on a plain-HTTP install, where navigator.clipboard is missing + // and this used to throw + const copyButton = document.getElementById("share_link_copy"); + itflowCopyText(response, copyButton).then( + function () { flashTooltip(copyButton, 'Copied!'); }, + function () {} + ); } ); } diff --git a/agent/modals/asset/asset.php b/agent/modals/asset/asset.php index 0d0f6a661..708711133 100644 --- a/agent/modals/asset/asset.php +++ b/agent/modals/asset/asset.php @@ -264,7 +264,7 @@ ob_start();
-
+
@@ -401,7 +401,7 @@ ob_start(); - - + diff --git a/agent/modals/contact/contact.php b/agent/modals/contact/contact.php index b4a724a4e..e4b3a1cd1 100644 --- a/agent/modals/contact/contact.php +++ b/agent/modals/contact/contact.php @@ -244,9 +244,7 @@ ob_start();
- +
@@ -532,7 +530,7 @@ ob_start(); if (empty($credential_username)) { $credential_username_display = "-"; } else { - $credential_username_display = "$credential_username "; + $credential_username_display = "$credential_username "; } $credential_otp_secret = escapeHtml($row['credential_otp_secret']); @@ -550,9 +548,7 @@ ob_start(); - + diff --git a/agent/modals/credential/credential_edit.php b/agent/modals/credential/credential_edit.php index 8e496e8cb..f7546bb82 100644 --- a/agent/modals/credential/credential_edit.php +++ b/agent/modals/credential/credential_edit.php @@ -112,7 +112,7 @@ ob_start(); - +
@@ -132,7 +132,7 @@ ob_start(); - +
@@ -142,7 +142,7 @@ ob_start(); - + diff --git a/agent/modals/share_modal.php b/agent/modals/share_modal.php index c8779a01f..742fd40ca 100644 --- a/agent/modals/share_modal.php +++ b/agent/modals/share_modal.php @@ -70,7 +70,10 @@ diff --git a/agent/user/mfa_enforcement.php b/agent/user/mfa_enforcement.php index 6c5021fe4..3a63e4236 100644 --- a/agent/user/mfa_enforcement.php +++ b/agent/user/mfa_enforcement.php @@ -72,9 +72,9 @@ $data = "otpauth://totp/ITFlow:$session_email?secret=$token"; -

+

- +

diff --git a/agent/user/modals/user_mfa_modal.php b/agent/user/modals/user_mfa_modal.php index 1a1090c05..7b0b2126c 100644 --- a/agent/user/modals/user_mfa_modal.php +++ b/agent/user/modals/user_mfa_modal.php @@ -26,8 +26,8 @@ $data = "otpauth://totp/ITFlow:$session_email?secret=$token";
-

Secret: - +

Secret: +

diff --git a/agent/vendors.php b/agent/vendors.php index e14886b39..3ef74ce05 100644 --- a/agent/vendors.php +++ b/agent/vendors.php @@ -178,7 +178,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $vendor_email = escapeHtml($row['vendor_email']); $vendor_website = escapeHtml($row['vendor_website']); if ($vendor_website) { - $vendor_website_display = "$vendor_website "; + $vendor_website_display = "$vendor_website "; } else { $vendor_website_display = "-"; } diff --git a/css/itflow_custom.css b/css/itflow_custom.css index 700ea00da..84fe31225 100644 --- a/css/itflow_custom.css +++ b/css/itflow_custom.css @@ -3638,7 +3638,13 @@ img.itflow-asset-icon { line-height: 1.4; } -/* Copy button beside an IP / MAC / serial - quiet until the row is pointed at */ +/* Copy button beside a value - an IP, MAC, serial, email, username, URI or a + password. Quiet until the row or line it sits in is pointed at: a table row, + a list-group row, a quick-look line, or just its own parent element. + .itflow-copy-always keeps it showing where copying is the point (an MFA + secret). Markup: + + Copy buttons attached to an input stay input-group buttons. */ .itflow-copy { margin-left: .3rem; padding: 0 .15rem; @@ -3650,6 +3656,9 @@ img.itflow-asset-icon { transition: opacity .12s ease-in-out; } tr:hover .itflow-copy, +.list-group-item:hover .itflow-copy, +.itflow-glance-item:hover .itflow-copy, +:hover > .itflow-copy, .itflow-copy-always .itflow-copy, .itflow-copy:focus-visible { opacity: 1; diff --git a/js/app.js b/js/app.js index b822d9126..d4d68102e 100644 --- a/js/app.js +++ b/js/app.js @@ -607,8 +607,11 @@ function itflowInit() { }); // Copy buttons: any element with class="clipboardjs" and its text in - // data-clipboard-text. That is ClipboardJS's markup contract, kept so none of - // the call sites change - the library itself is no longer used here. + // data-clipboard-text, or the field to copy from in data-clipboard-target. + // That is ClipboardJS's markup contract, kept so none of the call sites + // change - the library itself is no longer used here. Beside a value they + // are the small .itflow-copy icon that shows when its row is pointed at + // (css/itflow_custom.css); beside an input, an input-group button. // // ClipboardJS copies by selecting a hidden textarea. Under Bootstrap 5 that // textarea has to be inside the open modal or the focus trap pulls focus @@ -632,7 +635,12 @@ function itflowInit() { const trigger = this; const target = itflowCopyFeedbackTarget(trigger); - const text = trigger.getAttribute('data-clipboard-text') || ''; + // data-clipboard-target="input[name=uri]" copies what is in that + // field now - in its own input group first - rather than the value + // the page was drawn with, so an edited field copies the edit + const source = trigger.getAttribute('data-clipboard-target'); + const field = source ? ((trigger.closest('.input-group') || document).querySelector(source) || document.querySelector(source)) : null; + const text = field ? (field.value || '') : (trigger.getAttribute('data-clipboard-text') || ''); // An empty field would otherwise wipe whatever is on the clipboard if (text === '') {