diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-10-27 09:43:39 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-10-27 09:43:39 +0000 |
| commit | dc6ed34b205582fc82a27b7e344722e33a237f97 (patch) | |
| tree | 2cb19d9c840a00ec461653f4201cb3bcf1f0656d /roundcubemail/program/include/main.inc | |
| parent | ab00504451bbbcaefe05966fbe1100da35af55b0 (diff) | |
- Fix $_SERVER['HTTPS'] check for SSL forcing on IIS (#1486243) + fix port check
git-svn-id: https://svn.roundcube.net/trunk@3063 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/main.inc')
| -rw-r--r-- | roundcubemail/program/include/main.inc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index 06d7780d1..aa0d3fa26 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/program/include/main.inc @@ -1401,6 +1401,27 @@ function rcube_html_editor($mode='') /** + * Check if working in SSL mode + * + * @param integer HTTPS port number + * @param boolean Enables 'use_https' option checking + */ +function rcube_https_check($port=null, $use_https=true) +{ + global $RCMAIL; + + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') + return true; + if ($port && $_SERVER['SERVER_PORT'] == $port) + return true; + if ($use_https && $RCMAIL->config->get('use_https')) + return true; + + return false; +} + + +/** * E-mail address validation */ function check_email($email) |
