Commit b441986d authored by Donal McMullan's avatar Donal McMullan

Rewrite of auth_get_authtype_for_institution to get auth instances for the

institution
parent c5e90209
......@@ -381,16 +381,22 @@ function auth_setup () {
}
/**
* Given an institution, returns the authentication method used by it.
* Given an institution, returns the authentication methods used by it.
*
* @return string
* @param string $institution Name of the institution
* @return array Array of auth instance records
*/
function auth_get_authtype_for_institution($institution) {
function auth_get_auth_instances_for_institution($institution) {
static $cache = array();
if (isset($cache[$institution])) {
return $cache[$institution];
if (!isset($cache[$institution])) {
$cache[$institution] = get_records_array('auth_instance', 'institution', $institution, 'priority, instancename', 'id, instancename, priority, authname');
if(empty($cache[$institution])) {
return false;
}
}
return $cache[$institution] = get_field('institution', 'authplugin', 'name', $institution);
return $cache[$institution];
}
/**
......
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