summaryrefslogtreecommitdiffstats
path: root/authfas.module
diff options
context:
space:
mode:
Diffstat (limited to 'authfas.module')
-rw-r--r--authfas.module9
1 files changed, 6 insertions, 3 deletions
diff --git a/authfas.module b/authfas.module
index 434df8c..560998e 100644
--- a/authfas.module
+++ b/authfas.module
@@ -124,10 +124,13 @@ function authfas_admin_validate($form, &$form_state) {
$ch = curl_init();
$fasurl = $form_state['values']['authfas_fasurl'];
+ $username = $form_state['values']['fas_username'];
+ $password = $form_state['values']['fas_password'];
// Expect a JSON interface to be present
- curl_setopt($ch, CURLOPT_URL, 'https://' . $fasurl . '/json');
+ curl_setopt($ch, CURLOPT_URL, 'https://'.$fasurl.'/json/');
curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, "Auth_FAS 0.9");
+ curl_setopt($ch, CURLOPT_USERAGENT, "Drupal AuthFAS 0.1");
+ curl_setopt($ch, CURLOPT_POSTFIELDS, "username=".urlencode($username)."&user_name=".urlencode($username)."&password=".urlencode($password)."&login=Login");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// The following two lines need to be enabled when using a test FAS
// with an invalid cert. Otherwise they should be commented (or
@@ -138,7 +141,7 @@ function authfas_admin_validate($form, &$form_state) {
curl_close ($ch);
if (!isset($response["help"])) {
- form_set_error("authfas_fasurl", 'No JSON interface present at https://' .$fasurl. '/json');
+ form_set_error("authfas_fasurl", 'No JSON interface present at https://'.$fasurl.'/json/ or could not verify username "'.$username.'".');
return FALSE;
}
return TRUE;