Commit 6d0b231f authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1650963: Hide SAML warnings to be hidden if plugin is not active



behatnotneeded

Change-Id: I3d961abd70ff4a2f585767a3ece5a8681ef74647
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 08b6177d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -293,6 +293,10 @@ class PluginAuthSaml extends PluginAuth {
        return true;
    }

    public static function is_active() {
        return get_field('auth_installed', 'active', 'name', 'saml');
    }

    public static function has_config() {
        return true;
    }
+16 −15
Original line number Diff line number Diff line
@@ -1501,6 +1501,7 @@ function site_warnings() {
        $warnings[] = get_string('noreplyaddressmissingorinvalid', 'error', get_config('wwwroot') . 'admin/site/options.php?fs=emailsettings');
    }

    if (PluginAuthSaml::is_active()) {
        // Check if the saml plugin config needs updating
        if (record_exists_select('auth_config', "plugin = ? AND field = ?", array('saml', 'simplesamlphplib'))) {
            $warnings[] = get_string('obsoletesamlplugin', 'auth.saml', get_config('wwwroot') . 'admin/extensions/pluginconfig.php?plugintype=auth&pluginname=saml');
@@ -1513,11 +1514,11 @@ function site_warnings() {
                                      SELECT instance FROM {auth_instance_config} aic
                                      WHERE aic.field = ?
                  ) AND ai.authname = ?", array('institutionidpentityid', 'saml'))) {

            foreach ($samls as $saml) {
                $warnings[] = get_string('obsoletesamlinstance', 'auth.saml', get_config('wwwroot') . 'admin/users/addauthority.php?id=' . $saml->id . '&edit=1&i=' . $saml->name . '&p=saml', $saml->instancename, $saml->displayname);
            }
        }
    }

    // Check that the GD library has support for jpg, png and gif at least
    $gdinfo = gd_info();