From 3863fe1060144630fb7dc33fa9de925a4db018c8 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Mon, 6 Apr 2009 10:13:30 -0400 Subject: [PATCH] requireSecureConnection doesn't belong inside the Crypt class --- framework/Crypt/lib/Horde/Crypt.php | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/framework/Crypt/lib/Horde/Crypt.php b/framework/Crypt/lib/Horde/Crypt.php index 5fb272e72..33fa1192d 100644 --- a/framework/Crypt/lib/Horde/Crypt.php +++ b/framework/Crypt/lib/Horde/Crypt.php @@ -96,42 +96,6 @@ class Horde_Crypt } /** - * Throws exception if not using a secure connection. - * - * @throws Horde_Exception - */ - public function requireSecureConnection() - { - if ($GLOBALS['browser']->usingSSLConnection()) { - return; - } - - if (!empty($GLOBALS['conf']['safe_ips'])) { - if (reset($GLOBALS['conf']['safe_ips']) == '*') { - return; - } - - /* $_SERVER['HTTP_X_FORWARDED_FOR'] is user data and not - * reliable. We dont' consult it for safe IPs. We also - * have to assume that if it is present, the user is - * coming through a proxy server. If so, we don't count - * any non-SSL connection as safe, no matter the source - * IP. */ - if (!isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { - $remote_addr = $_SERVER['REMOTE_ADDR']; - foreach ($GLOBALS['conf']['safe_ips'] as $safe_ip) { - $safe_ip = preg_replace('/(\.0)*$/', '', $safe_ip); - if (strpos($remote_addr, $safe_ip) === 0) { - return; - } - } - } - } - - throw new Horde_Exception (_("The encryption features require a secure web connection.")); - } - - /** * Encrypt the requested data. * This method should be provided by all classes that extend Horde_Crypt. * -- 2.11.0