catalyst / moodle-auth_saml2

SAML done 100% in Moodle, fast, simple, secure
https://moodle.org/plugins/auth_saml2
71 stars 134 forks source link

Overriding Default i/user icon with graphic and/or different graphic #79

Open dustinbrisebois opened 7 years ago

dustinbrisebois commented 7 years ago

Current code for auth.php is:

        return array(
            array(
                'url'  => $wantsurl,
                'icon' => new pix_icon('i/user', 'Login'),
                'name' => (!empty($conf->idpname) ? $conf->idpname : $conf->idpdefaultname),
            ),
        );

This should either point to a customizable icon choice AND/OR an overlay graphic instead of the text given.

danowar2k commented 4 years ago

The current auth_saml2 version (2019022100) doesn't work with Moodle 3.2.x anymore.

Reason: https://github.com/catalyst/moodle-auth_saml2/blob/49190cb29d06711df6c963f64402e4fe909614f6/auth.php#L200-L204

The returned idplist may contain an idp where $idp["icon"] is a string. Moodle 3.2.x expects that to always be an instance of pix_icon.

So at this moment, your plugin's version.php https://github.com/catalyst/moodle-auth_saml2/blob/master/version.php is not correct.

This results in:

Fehler: Argument 1 passed to renderer_base::render() must implement interface renderable, string given, called in [dirroot]/blocks/login/block_login.php on line 125
Debug info: 
Error code: generalexceptionmessage
Stack trace:
line 196 of /lib/outputrenderers.php: TypeError thrown
line 125 of /blocks/login/block_login.php: call to renderer_base->render()
line 288 of /blocks/moodleblock.class.php: call to block_login->get_content()
line 230 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
line 1187 of /lib/blocklib.php: call to block_base->get_content_for_output()
line 1239 of /lib/blocklib.php: call to block_manager->create_block_contents()
line 356 of /lib/blocklib.php: call to block_manager->ensure_content_created()
line 3941 of /lib/outputrenderers.php: call to block_manager->region_has_content()
line 3989 of /lib/outputrenderers.php: call to core_renderer->body_css_classes()
line 24 of /theme/feu_clean_base/layout/columns3.php: call to core_renderer->body_attributes()
line 1110 of /lib/outputrenderers.php: call to include()
line 1040 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
line 53 of /theme/feu_clean/classes/output/core_renderer.php: call to core_renderer->header()
line 114 of /index.php: call to theme_feu_clean\output\core_renderer->header()

Is this comment here ok or should I report a separate issue?