<?php
/*
Plugin Name: HTTPS mode
Description: allows optional HTTPS use on bbPress forums (when HTTPS available)
*/
add_filter( 'bb_get_uri', 'https_mode',1,3);
add_filter( 'bb_get_option_uri','https_mode',1);
function https_mode($uri,$resource='',$context='') {
if (!empty($_SERVER['HTTPS'])) {
if (strpos($uri,'bb-admin/')===0) {$uri=bb_get_option('uri').$uri;}
elseif (strpos($uri,'http://')===0) {$uri=str_replace('http://','https://',$uri);}
}
return $uri;
}
function bb_validate_auth_cookie( $cookie = '', $scheme = 'auth' ) { // disable secure_auth
global $wp_auth_object;
return $wp_auth_object->validate_auth_cookie( $cookie, $scheme );
}
?>