Changeset f5d61d84 in github


Ignore:
Timestamp:
Oct 21, 2009 4:47:40 AM (4 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
6020c3d
Parents:
efe93ad
Message:

Revert r3038 and allow to specify the port as value of force_https

Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • config/main.inc.php.dist

    re4acbbd rf5d61d84  
    4949// possible units: s, m, h, d, w 
    5050$rcmail_config['message_cache_lifetime'] = '10d'; 
     51 
     52// enforce connections over https 
     53// with this option enabled, all non-secure connections will be redirected. 
     54// set the port for the ssl connection as value of this option if it differs from the default 443 
     55$rcmail_config['force_https'] = FALSE; 
    5156 
    5257// automatically create a new RoundCube user when log-in the first time. 
  • index.php

    rb571339 rf5d61d84  
    6262if ($RCMAIL->action=='error' && !empty($_GET['_code'])) { 
    6363  raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE); 
     64} 
     65 
     66// check if https is required (for login) and redirect if necessary 
     67if (empty($_SESSION['user_id']) && ($force_https = $RCMAIL->config->get('force_https', false))) { 
     68  $https_port = is_bool($force_https) ? 443 : $force_https; 
     69  if (!(isset($_SERVER['HTTPS']) || $_SERVER['SERVER_PORT'] == $use_https || $RCMAIL->config->get('use_https'))) { 
     70    header('Location: https://' . $_SERVER['HTTP_HOST'] . ($https_port != 443 ? ':' . $https_port : '') . $_SERVER['REQUEST_URI']); 
     71    exit; 
     72  } 
    6473} 
    6574 
Note: See TracChangeset for help on using the changeset viewer.