diff options
-rw-r--r-- | authfas.module | 5 |
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 |