From 7b1503cf89273dcf9d372e65386817dd0ce57003 Mon Sep 17 00:00:00 2001 From: "Paul W. Frields" Date: Sat, 17 Jul 2010 17:23:59 -0400 Subject: Split error conditions --- authfas.module | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'authfas.module') 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 -- cgit