Commit 874c0129 authored by Robert Lyon's avatar Robert Lyon

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

behatnotneeded

Change-Id: I221b08af2015712163fcbfca6e0a3962e932615b
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 6f74c6b6)
parent 43fec5f1
......@@ -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