Investigation Completed.
I talked with Jason (lead developer) about this and we came to the realization that this is an issue with the certain setup you have on your server. For some reason your PHP_AUTH_USER and PHP_AUTH_PW server varibles (which should be set when a User puts in their Username/Password on the prompt) is not being set in PHP. It is, however, being set in Apache, and we found a way to use this to add the values to the $_SERVER array.
To do this I added these two lines to your WordPress .htaccess file:
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
This gives us a PHP $_SERVER variable that contains the information from the prompt. Right now s2Member is not capable of using this variable, so I also added the following code to your s2-hacks.php file to make the use of this variable possible:
function s2hack_remote_auth_write_server_vars() {
if (isset($_SERVER['HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION'], $matches)) {
list($name, $password) = explode(':', base64_decode($matches[1]));
$_SERVER['PHP_AUTH_USER'] = esc_html($name);
$_SERVER['PHP_AUTH_PW'] = esc_html($password);
}
if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['REDIRECT_HTTP_AUTHORIZATION'], $matches)) {
list($name, $password) = explode(':', base64_decode($matches[1]));
$_SERVER['PHP_AUTH_USER'] = esc_html($name);
$_SERVER['PHP_AUTH_PW'] = esc_html($password);
}
}
add_action('ws_plugin__s2member_during_check_file_remote_authorization_before', 's2hack_remote_auth_write_server_vars');
We will be adding a check for this variable in the next maintenance release of s2Member, at which point you can remove this code from your s2-hacks.php file. You will, however, need to leave the code in your .htaccess file for s2Member to work correctly.
In the future, if another User has this problem as well, you need to put the two lines I put in this User’s main .htaccess file into yours as well.
You are now good-to-go.