Working on a solution to the Anti-IIS Google Checkout. Not working yet, but here is the progress. Maybe someone knows what I'm doing wrong?
The idea is that it would eventually work on a Windows (IIS) server with LDAP installed. php.ini would also have to have LDAP enabled.
Around Line 104, responsehandler.php
PHP Code:
if(MODULE_PAYMENT_GOOGLECHECKOUT_CGI != 'True') {
if(dirname($_SERVER['SERVER_SOFTWARE'])=='Microsoft-IIS'){
$ldap='<ldap server address here>';
$connect="";
// connect to LDAP server
if (!($connect=@ldap_connect($ldap))) {
error_func('Unable to connect to LDAP server.');
exit(1);
}
// bind to LDAP server
else if (!($bind=@ldap_bind($connect, $merchant_id, $merchant_key))) {
error_func('Windows authentication failed.');
exit(1);
}
else{
$compare_mer_id=$merchant_id;
$compare_mer_key=$merchang_key;
}
}
else if(isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW'])) {
$compare_mer_id = $HTTP_SERVER_VARS['PHP_AUTH_USER'];
$compare_mer_key = $HTTP_SERVER_VARS['PHP_AUTH_PW'];
} else {
//Apache server authentication err
error_func("HTTP Basic Authentication failed. Can't retrive Merchant Id/Key, Installed over CGI??\n");
exit(1);
}
if($compare_mer_id != $merchant_id || $compare_mer_key != $merchant_key) {
error_func("HTTP Basic Authentication failed. Wrong Merchant Id/Key Validation\n");
exit(1);
}
}
Bookmarks