Commit 7897855f authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1722435: Don't bother running the saml cron if not needed"

parents 8b2c6107 6f74c6b6
......@@ -368,10 +368,17 @@ class PluginAuthSaml extends PluginAuth {
* in a similar way to as if we had configured a simplesamlphp web cron
*/
public static function auth_saml_refresh_cron() {
Metarefresh::metadata_refresh_hook();
// we only want to run this if there are any saml instances containing the metarefresh_metadata_url
if ($urls = get_records_sql_array("SELECT ai.id FROM {auth_instance} ai
JOIN {auth_instance_config} aic ON aic.instance = ai.id
WHERE ai.authname = 'saml'
AND ai.active = 1
AND aic.field = 'metarefresh_metadata_url'
AND (aic.value IS NOT NULL and aic.value != '')", array())) {
Metarefresh::metadata_refresh_hook();
}
}
public static function can_be_disabled() {
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment