diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-10-21 08:47:40 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-10-21 08:47:40 +0000 |
| commit | 971464522bc359af8629c003dffbe05388f169b3 (patch) | |
| tree | bb8908403ca3b801235cb7aece7f01a0f0935766 /roundcubemail/plugins/force_https | |
| parent | 23ed1163672cf6db4b464a4084e9b616dd75b20f (diff) | |
Revert r3038 and allow to specify the port as value of force_https
git-svn-id: https://svn.roundcube.net/trunk@3049 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/plugins/force_https')
| -rw-r--r-- | roundcubemail/plugins/force_https/force_https.php | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/roundcubemail/plugins/force_https/force_https.php b/roundcubemail/plugins/force_https/force_https.php deleted file mode 100644 index 67552570e..000000000 --- a/roundcubemail/plugins/force_https/force_https.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/** - * Enforce secure HTTPs connection for login - * - * Configuration: - * // Port for https connection - * $rcmail_config['force_https_port'] = 443; - * - * @version 1.0 - * @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl> - */ -class force_https extends rcube_plugin -{ - function init() - { - $this->add_hook('startup', array($this, 'redirect')); - } - - function redirect($args) - { - $config = rcmail::get_instance()->config; - - $port = (int) $config->get('force_https_port', 443); - - // check if https is required (for login) and redirect if necessary - if (empty($_SESSION['user_id']) && !$config->get('use_https') - && (!isset($_SERVER['HTTPS']) || $_SERVER['SERVER_PORT'] != $port)) - { - header('Location: https://' . $_SERVER['HTTP_HOST'] . ($port != 443 ? ":$port" : '') . $_SERVER['REQUEST_URI']); - exit; - } - - return $args; - } -} - -?> |
