]> git.mxchange.org Git - friendica-addons.git/commitdiff
rework saml addon
authorJakobus Schürz <jakobus.schuerz@home.arpa>
Wed, 15 Jan 2025 09:42:08 +0000 (10:42 +0100)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 23 Jan 2025 13:31:49 +0000 (14:31 +0100)
fix #1587
remove css-side hiding of elements, which was broken.
remove them or make them readonly via javascript

saml/saml.css [deleted file]
saml/saml.php

diff --git a/saml/saml.css b/saml/saml.css
deleted file mode 100644 (file)
index 087633c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#settings-form > div:first-of-type, #settings-form > h2:first-of-type, #wrapper_mpassword, #wrapper_email { display: none !important; }
index 9f065355c2f99573f9a795f574d8638395125f4e..f3dd17742df12ebc36995295bf9785de2a00a5e1 100755 (executable)
@@ -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;
 }