rework saml addon

fix #1587
remove css-side hiding of elements, which was broken.
remove them or make them readonly via javascript
This commit is contained in:
Jakobus Schürz 2025-01-15 10:42:08 +01:00
parent 44d2079da2
commit cbc6dc9caf
2 changed files with 4 additions and 6 deletions

View file

@ -1 +0,0 @@
#settings-form > div:first-of-type, #settings-form > h2:first-of-type, #wrapper_mpassword, #wrapper_email { display: none !important; }

View file

@ -75,11 +75,6 @@ function saml_install()
Hook::register('footer', __FILE__, 'saml_footer');
}
function saml_head(string &$body)
{
DI::page()->registerStylesheet(__DIR__ . '/saml.css');
}
function saml_footer(string &$body)
{
$fragment = addslashes(BBCode::convertForUriId(User::getSystemUriId(), DI::config()->get('saml', 'settings_statement')));
@ -87,6 +82,10 @@ function saml_footer(string &$body)
<script>
var target=$("#settings-nickname-desc");
if (target.length) { target.append("<p>$fragment</p>"); }
document.getElementById('id_email').setAttribute('readonly', 'readonly');
document.getElementById('password-settings').remove();
document.getElementById('password-settings-collapse').remove();
document.getElementById('id_mpassword_wrapper').remove();
</script>
EOL;
}