summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2009-10-21 08:47:40 +0000
committerthomascube <thomas@roundcube.net>2009-10-21 08:47:40 +0000
commitf5d61d845f8cfce4c7b559a900df846947e45b00 (patch)
tree01284cc95acf4c039c1f4d750c920e985691bc55 /plugins
parentefe93ad11610fcfd42c76a1cdddb07be00f8cf1b (diff)
Revert r3038 and allow to specify the port as value of force_https
Diffstat (limited to 'plugins')
-rw-r--r--plugins/force_https/force_https.php38
1 files changed, 0 insertions, 38 deletions
diff --git a/plugins/force_https/force_https.php b/plugins/force_https/force_https.php
deleted file mode 100644
index 67552570e..000000000
--- a/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;
- }
-}
-
-?>