Exemple #1
0
 /**
  * Returns true if this appears to be a secure HTTPS connection
  *
  * @return bool
  */
 public static function isHttps()
 {
     return Core_Url::getCurrentScheme() === 'https' || Zend_Registry::get('config')->General->assume_secure_protocol;
 }
Exemple #2
0
 /**
  * Check force_ssl_login and redirect if connection isn't secure and not    using a reverse proxy
  *
  * @param none
  * @return void
  */
 protected function checkForceSslLogin()
 {
     $forceSslLogin = Zend_Registry::get('config')->General->force_ssl_login;
     if ($forceSslLogin) {
         $reverseProxy = Zend_Registry::get('config')->General->reverse_proxy;
         if (!(Core_Url::getCurrentScheme() == 'https' || $reverseProxy)) {
             $url = 'https://' . Core_Url::getCurrentHost() . Core_Url::getCurrentScriptName() . Core_Url::getCurrentQueryString();
             Core_Url::redirectToUrl($url);
         }
     }
 }