summaryrefslogtreecommitdiffstats
path: root/authfas.module
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2010-07-17 17:23:59 -0400
committerPaul W. Frields <stickster@gmail.com>2010-07-17 17:23:59 -0400
commit7b1503cf89273dcf9d372e65386817dd0ce57003 (patch)
tree28f30468adbd967b59af026d475493f5bc45e8a7 /authfas.module
parentb35307dee29ab18b8fcba7e0b42c4e51b6ebdf8b (diff)
downloaddrupal-authfas-6x-7b1503cf89273dcf9d372e65386817dd0ce57003.tar.gz
drupal-authfas-6x-7b1503cf89273dcf9d372e65386817dd0ce57003.tar.xz
drupal-authfas-6x-7b1503cf89273dcf9d372e65386817dd0ce57003.zip
Split error conditions
Diffstat (limited to 'authfas.module')
-rw-r--r--authfas.module5
1 files changed, 4 insertions, 1 deletions
diff --git a/authfas.module b/authfas.module
index 5a7963f..9c79d70 100644
--- a/authfas.module
+++ b/authfas.module
@@ -135,6 +135,9 @@ function authfas_fas_login($username, $password, $url, $headers) {
// #curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
// #curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$response = json_decode(curl_exec($ch), true);
+ if (!$response) {
+ drupal_set_message(t('No JSON response available, check AuthFAS settings.'), 'error');
+ }
curl_close ($ch);
return $response;
@@ -152,7 +155,7 @@ function authfas_admin_validate($form, &$form_state) {
$response = authfas_fas_login($username, $password, 'https://'.$fasurl.'/json/', 'Accept: application/json;');
if (!isset($response["help"])) {
- form_set_error("authfas_fasurl", t('No JSON interface present at https://'.$fasurl.'/json/ or could not verify username "'.$username.'".'));
+ form_set_error("authfas_fasurl", t('Could not verify FAS username "'.$username.'".'));
return FALSE;
}
// else we're peachy