Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. /*
  3. Plugin Name: HTTPS mode
  4. Description: allows optional HTTPS use on bbPress forums (when HTTPS available)
  5. */
  6.  
  7. add_filter( 'bb_get_uri', 'https_mode',1,3);
  8. add_filter( 'bb_get_option_uri','https_mode',1);
  9.  
  10. function https_mode($uri,$resource='',$context='') {
  11. if (!empty($_SERVER['HTTPS'])) {
  12.     if (strpos($uri,'bb-admin/')===0) {$uri=bb_get_option('uri').$uri;}
  13.     elseif (strpos($uri,'http://')===0) {$uri=str_replace('http://','https://',$uri);}
  14.  }
  15. return $uri;
  16. }
  17.  
  18. function bb_validate_auth_cookie( $cookie = '', $scheme = 'auth' ) {  // disable secure_auth
  19.     global $wp_auth_object;
  20.     return $wp_auth_object->validate_auth_cookie( $cookie, $scheme );
  21. }
  22.  
  23. ?>