summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2010-07-15 21:58:13 -0400
committerPaul W. Frields <stickster@gmail.com>2010-07-15 21:58:13 -0400
commit312e19c82070c38a91f1e7437efdaefe1c4c41c5 (patch)
treeb95d25743a2193ae82937c1632f7f7e15e6bcd95
parentda789c107d2fe1238ba7e64902c96d02b7bd4cfa (diff)
downloaddrupal-authfas-6x-312e19c82070c38a91f1e7437efdaefe1c4c41c5.tar.gz
drupal-authfas-6x-312e19c82070c38a91f1e7437efdaefe1c4c41c5.tar.xz
drupal-authfas-6x-312e19c82070c38a91f1e7437efdaefe1c4c41c5.zip
Thanks Toshio for cURL recommendations
-rw-r--r--authfas.module6
1 files changed, 4 insertions, 2 deletions
diff --git a/authfas.module b/authfas.module
index 810cb98..5c72f2d 100644
--- a/authfas.module
+++ b/authfas.module
@@ -133,8 +133,10 @@ function authfas_admin_validate($form, &$form_state) {
// Expect a JSON interface to be present
curl_setopt($ch, CURLOPT_URL, 'https://'.$fasurl.'/json/');
curl_setopt($ch, CURLOPT_POST, 1);
- 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_POSTFIELDS, "user_name=".urlencode($username)."&password=".urlencode($password)."&login=Login");
+ curl_setopt($ch, CURLOPT_HEADERS, "user-agent: Drupal AuthFAS 0.1; Accept: application/json;");
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
+ curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
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