diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index 4374639d..2efe6544 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -441,7 +441,15 @@ class lighttpd $vhost_content = ''; $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'])) { $vhost_content.= ' url.redirect = (' . "\n"; diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 44ed87d9..73214539 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -391,6 +391,14 @@ class nginx $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'])) { $vhost_content.= "\t".'rewrite ^(.*) '.$this->idnaConvert->encode($domain['documentroot']).'$1 permanent;'."\n"; diff --git a/scripts/jobs/cron_traffic_report.php b/scripts/jobs/cron_traffic_report.php index 5fd46474..dfa4d56f 100644 --- a/scripts/jobs/cron_traffic_report.php +++ b/scripts/jobs/cron_traffic_report.php @@ -23,8 +23,6 @@ $yesterday = time() - (60 * 60 * 24); /** * Initialize the mailingsystem */ - -require (dirname(__FILE__) . '/../lib/class.phpmailer.php'); $mail = new PHPMailer(true); $mail->SetFrom($settings['panel']['adminmail'], 'Froxlor Administrator'); @@ -49,7 +47,7 @@ while($row = $db->fetch_array($result)) { $replace_arr = array( 'NAME' => $row['name'], - 'TRAFFIC' => $row['traffic'], + 'TRAFFIC' => ($row['traffic'] / 1024), /* traffic is stored in KB, template uses MB */ 'TRAFFICUSED' => $row['traffic_used'] ); $lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "` @@ -128,7 +126,7 @@ while($row = $db->fetch_array($result)) { $replace_arr = array( 'NAME' => $row['name'], - 'TRAFFIC' => $row['traffic'], + 'TRAFFIC' => ($row['traffic'] / 1024), /* traffic is stored in KB, template uses MB */ 'TRAFFICUSED' => $row['traffic_used_total'] ); $lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`