Esempio n. 1
0
 /**
  * Creates a url with the given uri, including the base url
  *
  * @param   string  $uri            The uri to create the URL for
  * @param   array   $variables      Some variables for the URL
  * @param   array   $get_variables  Any GET urls to append via a query string
  * @param   bool    $secure         If false, force http. If true, force https
  * @return  string
  */
 public static function create($uri = null, $variables = array(), $get_variables = array(), $secure = null)
 {
     if (is_null($secure) && FBD_SSL_MODE) {
         $secure = Site_Util::check_ssl_required_uri($uri, FBD_SSL_MODE == 'ALL');
     }
     return parent::create($uri, $variables, $get_variables, $secure);
 }
Esempio n. 2
0
 protected function check_ssl_required_request_and_redirect()
 {
     if (IS_SSL) {
         return;
     }
     if (!FBD_SSL_MODE || !in_array(FBD_SSL_MODE, array('ALL', 'PARTIAL'))) {
         return;
     }
     $ssl_url = Uri::create(Uri::string_with_query(), array(), array(), true);
     if (FBD_SSL_MODE == 'ALL') {
         Response::redirect($ssl_url);
     }
     $module = Site_Util::get_module_name();
     if ($module && in_array($module, conf('ssl_required.modules'))) {
         Response::redirect($ssl_url);
     }
     if (Site_Util::check_ssl_required_uri(Uri::string(), false, false)) {
         Response::redirect($ssl_url);
     }
 }