bb_ssl_redirect

Forces redirection to an SSL page when required.

Description

bb_ssl_redirect(); 

Usage

  1. if ( !function_exists( 'bb_ssl_redirect' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-core.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bb_ssl_redirect(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. function bb_ssl_redirect() 
  2. $page = bb_get_location(); 
  3.  
  4.  
  5. if ( BB_IS_ADMIN ) { 
  6. if ( !force_ssl_admin() ) { 
  7. return; 
  8. } else { 
  9. switch ( $page ) { 
  10. case 'login-page': 
  11. case 'register-page': 
  12. if ( !force_ssl_login() ) { 
  13. return; 
  14. break; 
  15. case 'profile-page': 
  16. global $self; 
  17. if ( $self == 'profile-edit.php' ) { 
  18. if ( !force_ssl_login() ) { 
  19. return; 
  20. } else { 
  21. return; 
  22. break; 
  23. default: 
  24. return; 
  25. break; 
  26.  
  27. if ( is_ssl() ) { 
  28. return; 
  29.  
  30. $uri_ssl = parse_url( bb_get_option( 'uri_ssl' ) ); 
  31. $uri = $uri_ssl['scheme'] . '://' . $uri_ssl['host'] . $_SERVER['REQUEST_URI']; 
  32. bb_safe_redirect( $uri ); 
  33. exit;