Skip to content

Commit

Permalink
Added requirements to alma in relation to WAYF
Browse files Browse the repository at this point in the history
  • Loading branch information
cableman committed Dec 13, 2013
1 parent 0854e54 commit 1b419b7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions alma.install
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@ function alma_requirements($phase) {
);
}

if ($phase == 'runtime') {
$requirements['alma'] = array(
'title' => $t('Alma'),
'value' => $t('Alma configured'),
'severity' => REQUIREMENT_OK,
);
if (!variable_get('alma_base_url', FALSE) || !variable_get('ting_agency', FALSE)) {
$requirements['alma']['value'] = $t('Alma not configured');
$requirements['alma']['description'] = $t('Alma is not properly configured, please visit <a href="@link">the settings page</a>.', array('@link' => url('admin/config/ding/provider/alma')));
$requirements['alma']['severity'] = REQUIREMENT_ERROR;
}
$requirements['alma_wayf'] = array(
'title' => $t('Alma WAYF'),
'value' => $t('Alma WAYF configured'),
'severity' => REQUIREMENT_OK,
);
if (!variable_get('wayf_hash', FALSE)) {
$requirements['alma']['value'] = $t('Alma WAYF not configured');
$requirements['alma']['description'] = $t('Alma WAYF is not properly configured, you need to set $conf[\'wayf_hash\'] in setttings.php.');
$requirements['alma']['severity'] = REQUIREMENT_ERROR;
}
}

return $requirements;
}

Expand Down
4 changes: 2 additions & 2 deletions includes/alma.wayf.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* login.
*/
function alma_wayf_login_credentials($authentication_attributes) {
$hash = variable_get('alma_wayf_hash', '');
$hash = variable_get('wayf_hash', '');
$credentials = array();

if ($hash) {
Expand All @@ -22,7 +22,7 @@ function alma_wayf_login_credentials($authentication_attributes) {
}
else {
// Set message that hash value was not found.
watchdog('alma', 'The WAYF hash value has not been set in setting.php as $conf[\'alma_wayf_hash\'] and WAYF login will fail', WATCHDOG_ERROR);
watchdog('alma', 'The WAYF hash value has not been set in setting.php as $conf[\'wayf_hash\'] and WAYF login will fail.', WATCHDOG_ERROR);
}

return $credentials;
Expand Down

0 comments on commit 1b419b7

Please sign in to comment.