diff --git a/CHANGELOG.md b/CHANGELOG.md index 159503751..89c3300da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -215,6 +215,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Linking: Link - along the top of a record's page, on its tabs and in quick looks - opens a list right under it instead of a window. What's linked already is ticked: tick to link, untick to unlink, and it's saved when you click Done or anywhere else, with one message for what changed. It covers documents, files, assets, contacts, licenses, credentials, vendors, services, locations, domains and certificates, a contact's assets and credentials and an asset's credentials, a project's and a service's tickets, a ticket's services and its related tickets. A document's or file's Link lists every kind it can be linked to, in groups. Tickets are no longer added to a project by typing their numbers - tick them in the list (open ones and those closed in the last 90 days), or change the project on the ticket. - Sign-in codes: the 6-digit code - signing in with two-step sign-in, setting it up (yours, or a contact's in the client portal), and the code emailed for a shared link - goes in six boxes, three and three. Paste or let your phone or password manager fill it, "123 456" too, and it goes as soon as the sixth digit is in - no need to click the button. A wrong code turns the boxes red. On the sign-in page Remember this browser now comes before the code, so tick it first. +- Browser autofill: Chrome, Edge and other Chromium browsers no longer offer your own name, email, phone or address in forms about clients - a new client's contact, a contact, a location - and Bitwarden, 1Password, LastPass and Dashlane no longer offer your ITFlow login in a credential's username and password, or anywhere else you type someone else's details or secrets, nor ask to save them. Your own profile, password change and two-step sign-in still work with your password manager. ### Bug Fixes @@ -424,6 +425,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Tab rows: `js/tab_fold.js` (loaded by `includes/footer.php`) folds the tabs that don't fit into a More dropdown, from the end, never the `.active` one - in `.nav.itflow-asset-tabs` (or a `.nav` inside an `.itflow-asset-tabs` card header), `.nav.itflow-asset-pills`, `.nav.itflow-asset-form-tabs` and any `.nav.itflow-tabs-foldable` (added to the kinds in Admin > Categories and Tags and to the mail settings tabs). A tab is a `.nav-link` of the row or the `.nav-item` around one; rows in a window are set up on `shown.bs.modal`, and a row laid out as a column, or not on screen yet, is left as it is. Folded tabs stay in place with `.itflow-tab-folded`, so Bootstrap's tabs and page scripts keep working on them; More is a `.nav-link.dropdown-toggle` (left out by Bootstrap's tabs and by `agent/js/tickets_live.js`), and its items are built on `show.bs.dropdown` - a link for a tab with an href, otherwise a button that clicks the tab. The row gets `.itflow-tabs-fold` (one line, overflow visible, min-width 0, its tabs `nowrap`), and fits again on resize, font load and any change to its tabs (a MutationObserver - counts updated in place, the open tab changing). - Link picker: `functions/link_picker.php` (`linkPickerButton()`, `linkPickerSource()`, `linkPickerOptions()`, `linkPickerSave()`, `LINK_PICKER_OWN` for the links that aren't `LINK_RELATIONS` pairs), `js/link_picker.js`, and `agent/ajax.php` `link_picker` (GET: the options, linked ones selected) and `link_picker_save` (POST `add[]` and `remove[]`; `flash=1` keeps the message for the page it reloads). It opens the select picker on a hidden multiple `
diff --git a/agent/user/user_security.php b/agent/user/user_security.php index e748527c0..db8050a2b 100644 --- a/agent/user/user_security.php +++ b/agent/user/user_security.php @@ -24,7 +24,7 @@ $remember_days = max(1, intval($config_login_remember_me_expire));

Password

-
+
diff --git a/includes/footer.php b/includes/footer.php index 724af8528..7190185b5 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -58,6 +58,12 @@ comment - and all of those still run well after this block. */ ?> + + + + + diff --git a/js/autofill_off.js b/js/autofill_off.js new file mode 100644 index 000000000..23d86a4e2 --- /dev/null +++ b/js/autofill_off.js @@ -0,0 +1,81 @@ +/* + * Keeps the browser's autofill and password managers out of ITFlow's forms. + * What agents type here is about clients, their people and their logins - not + * about the agent - so Chrome or Edge offering the agent's own name, email, + * phone or address, or Bitwarden, 1Password, LastPass or Dashlane offering the + * agent's ITFlow login, only fills in the wrong thing. + * + * Each field gets: + * - an autocomplete value no browser knows, so Chromium browsers offer nothing. + * They ignore autocomplete="off" for names and addresses, but not this. + * - new-password on a password field instead, so the saved ITFlow login isn't + * offered. + * - each password manager's own attribute for leaving a field alone, which also + * stops them offering to save what's typed. + * + * Left as they are: + * - fields asking for the agent's own password or code (current-password, + * username, one-time-code); + * - fields with another real autocomplete value someone chose on purpose; + * - anything inside [data-autofill] - the agent's own profile and password + * change. + * + * Fields on the page are done straight away, and any added later (windows, + * quick add) as they arrive - and again if a script sets autocomplete="off" + * on one afterwards. Agent and admin pages only (includes/footer.php). + */ +(function () { + 'use strict'; + + const SELECTOR = 'input, textarea, select'; + const SKIP_TYPES = ['hidden', 'checkbox', 'radio', 'file', 'submit', 'button', 'reset', 'image', 'range', 'color']; + const NONE = 'itflow-none'; + + function guard(field) { + if ((field.tagName === 'INPUT' && SKIP_TYPES.indexOf(field.type) !== -1) + || field.closest('[data-autofill]')) { + return; + } + const current = (field.getAttribute('autocomplete') || '').trim().toLowerCase(); + if (current !== '' && current !== 'off' && current !== 'new-password') { + return; + } + const value = field.type === 'password' || current === 'new-password' ? 'new-password' : NONE; + if (current !== value) { + field.setAttribute('autocomplete', value); + } + if (field.hasAttribute('data-autofill-off')) { + return; + } + field.setAttribute('data-1p-ignore', ''); + field.setAttribute('data-lpignore', 'true'); + field.setAttribute('data-bwignore', 'true'); + field.setAttribute('data-form-type', 'other'); + field.setAttribute('data-autofill-off', ''); + } + + function guardWithin(node) { + if (node.nodeType !== 1) { + return; + } + if (node.matches(SELECTOR)) { + guard(node); + } + node.querySelectorAll(SELECTOR).forEach(guard); + } + + guardWithin(document.documentElement); + + // New fields, and a field's script setting autocomplete="off" on it again (js/autocomplete.js) + new MutationObserver(function (mutations) { + mutations.forEach(function (mutation) { + if (mutation.type === 'attributes') { + if (mutation.target.hasAttribute('data-autofill-off')) { + guard(mutation.target); + } + return; + } + mutation.addedNodes.forEach(guardWithin); + }); + }).observe(document.documentElement, { childList: true, subtree: true, attributes: true, attributeFilter: ['autocomplete'] }); +})();