From c50636727361a153b5ed5f445ab6afed9497e663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Fri, 17 Jan 2025 03:04:31 +0100 Subject: [PATCH] replace password-handling with hint also add hint to email-field --- saml/saml.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/saml/saml.php b/saml/saml.php index 7fdafc1e..81a6bfcc 100755 --- a/saml/saml.php +++ b/saml/saml.php @@ -78,26 +78,32 @@ function saml_install() function saml_footer(string &$body) { $fragment = addslashes(BBCode::convertForUriId(User::getSystemUriId(), DI::config()->get('saml', 'settings_statement'))); + $samlhint = DI::l10n()->t('managed via SAML authentication'); $body .= << var target=$("#settings-nickname-desc"); if (target.length) { target.append("

$fragment

"); } document.getElementById('id_email').setAttribute('readonly', 'readonly'); -if ( document.getElementById('password-settings') != null ) { - document.getElementById('password-settings').remove(); -} +var saml_hint = document.createElement("span"); +var saml_hint_text = document.createTextNode('$samlhint'); +saml_hint.appendChild(saml_hint_text); +document.getElementById('id_email').parentNode.insertBefore(saml_hint, document.getElementById('id_email').nextSibling); +// Frio theme if ( document.getElementById('password-settings-collapse') != null ) { - document.getElementById('password-settings-collapse').remove(); + document.getElementById('password-settings-collapse').replaceChildren(saml_hint.cloneNode(true)); } if ( document.getElementById('id_mpassword_wrapper') != null ) { + document.getElementById('id_mpassword_wrapper').parentNode.appendChild(saml_hint.cloneNode(true)); document.getElementById('id_mpassword_wrapper').remove(); + document.getElementById('id_email').nextElementSibling.classList.add('help-block'); } +// Vier theme if ( document.getElementById('wrapper_mpassword') != null ) { document.getElementById('wrapper_mpassword').remove(); + document.getElementById('id_email').nextElementSibling.classList.add('field_help'); } if ( document.getElementById('wrapper_password') != null ) { - document.getElementById('wrapper_password').parentNode.parentNode.children[0].remove(); - document.getElementById('wrapper_password').parentNode.remove(); + document.getElementById('wrapper_password').parentNode.replaceChildren(saml_hint.cloneNode(true)); } EOL;