respect ssl_redirect setting for domains, fixes #542

This commit is contained in:
Michael Kaufmann (d00p)
2011-01-09 16:25:32 +00:00
parent bffa8817d9
commit cc4637095d
3 changed files with 19 additions and 5 deletions

View File

@@ -442,6 +442,14 @@ class lighttpd
$vhost_content = ''; $vhost_content = '';
$vhost_content.= $this->getServerNames($domain) . " {\n"; $vhost_content.= $this->getServerNames($domain) . " {\n";
// respect ssl_redirect settings, #542
if($ssl_vhost == false
&& $domain['ssl'] == '1'
&& $domain['ssl_redirect'] == '1'
) {
$domain['documentroot'] = 'https://' . $domain['domain'] . '/';
}
if(preg_match('/^https?\:\/\//', $domain['documentroot'])) if(preg_match('/^https?\:\/\//', $domain['documentroot']))
{ {
$vhost_content.= ' url.redirect = (' . "\n"; $vhost_content.= ' url.redirect = (' . "\n";

View File

@@ -391,6 +391,14 @@ class nginx
$vhost_content.= $this->getServerNames($domain); $vhost_content.= $this->getServerNames($domain);
// respect ssl_redirect settings, #542
if($ssl_vhost == false
&& $domain['ssl'] == '1'
&& $domain['ssl_redirect'] == '1'
) {
$domain['documentroot'] = 'https://' . $domain['domain'] . '/';
}
if(preg_match('/^https?\:\/\//', $domain['documentroot'])) if(preg_match('/^https?\:\/\//', $domain['documentroot']))
{ {
$vhost_content.= "\t".'rewrite ^(.*) '.$this->idnaConvert->encode($domain['documentroot']).'$1 permanent;'."\n"; $vhost_content.= "\t".'rewrite ^(.*) '.$this->idnaConvert->encode($domain['documentroot']).'$1 permanent;'."\n";

View File

@@ -23,8 +23,6 @@ $yesterday = time() - (60 * 60 * 24);
/** /**
* Initialize the mailingsystem * Initialize the mailingsystem
*/ */
require (dirname(__FILE__) . '/../lib/class.phpmailer.php');
$mail = new PHPMailer(true); $mail = new PHPMailer(true);
$mail->SetFrom($settings['panel']['adminmail'], 'Froxlor Administrator'); $mail->SetFrom($settings['panel']['adminmail'], 'Froxlor Administrator');
@@ -49,7 +47,7 @@ while($row = $db->fetch_array($result))
{ {
$replace_arr = array( $replace_arr = array(
'NAME' => $row['name'], 'NAME' => $row['name'],
'TRAFFIC' => $row['traffic'], 'TRAFFIC' => ($row['traffic'] / 1024), /* traffic is stored in KB, template uses MB */
'TRAFFICUSED' => $row['traffic_used'] 'TRAFFICUSED' => $row['traffic_used']
); );
$lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "` $lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
@@ -128,7 +126,7 @@ while($row = $db->fetch_array($result))
{ {
$replace_arr = array( $replace_arr = array(
'NAME' => $row['name'], 'NAME' => $row['name'],
'TRAFFIC' => $row['traffic'], 'TRAFFIC' => ($row['traffic'] / 1024), /* traffic is stored in KB, template uses MB */
'TRAFFICUSED' => $row['traffic_used_total'] 'TRAFFICUSED' => $row['traffic_used_total']
); );
$lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "` $lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`