+ * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package System
- * @version $Id: cron_init.php 2724 2009-06-07 14:18:02Z flo $
+ * @version $Id: $
*/
if(@php_sapi_name() != 'cli'
@@ -25,25 +25,25 @@ if(@php_sapi_name() != 'cli'
$cronscriptDebug = false;
$lockdir = '/var/run/';
-$lockFilename = 'syscp_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
+$lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
$lockfName = $lockFilename . getmypid();
$lockfile = $lockdir . $lockfName;
-// guess the syscp installation path
+// guess the froxlor installation path
// normally you should not need to modify this script anymore, if your
-// syscp installation isn't in /var/www/syscp
+// froxlor installation isn't in /var/www/froxlor
$pathtophpfiles = dirname(dirname(__FILE__));
-// should the syscp installation guessing not work correctly,
+// should the froxlor installation guessing not work correctly,
// uncomment the following line, and put your path in there!
-//$pathtophpfiles = '/var/www/syscp/';
+//$pathtophpfiles = '/var/www/froxlor/';
// create and open the lockfile!
$keepLockFile = false;
$debugHandler = fopen($lockfile, 'w');
fwrite($debugHandler, 'Setting Lockfile to ' . $lockfile . "\n");
-fwrite($debugHandler, 'Setting SysCP installation path to ' . $pathtophpfiles . "\n");
+fwrite($debugHandler, 'Setting Froxlor installation path to ' . $pathtophpfiles . "\n");
// open the lockfile directory and scan for existing lockfiles
@@ -168,7 +168,7 @@ if($db->link_id == 0)
fclose($debugHandler);
unlink($lockfile);
- die('SysCP can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...');
+ die('Froxlor can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...');
}
fwrite($debugHandler, 'Database-connection established' . "\n");
@@ -183,10 +183,10 @@ while($row = $db->fetch_array($result))
unset($row);
unset($result);
-fwrite($debugHandler, 'SysCP Settings has been loaded from the database' . "\n");
+fwrite($debugHandler, 'Froxlor Settings has been loaded from the database' . "\n");
-if(!isset($settings['system']['dbversion'])
- || $settings['system']['dbversion'] != $dbversion)
+if(!isset($settings['panel']['version'])
+ || $settings['panel']['version'] != $version)
{
/**
* Do not proceed further if the Database version is not the same as the script version
@@ -197,7 +197,7 @@ if(!isset($settings['system']['dbversion'])
die('Version of File doesnt match Version of Database. Exiting...');
}
-fwrite($debugHandler, 'SysCP Version and Database Version are correct' . "\n");
+fwrite($debugHandler, 'Froxlor Version and Database Version are correct' . "\n");
$cronbasedir = makeCorrectDir($pathtophpfiles . '/scripts/');
$crondir = new DirectoryIterator($cronbasedir);
@@ -238,6 +238,12 @@ if(isset($inc_crons[0]))
unset($file, $crondir, $cronname, $cronscriptFullName, $cronfilename, $cronbasedir);
fwrite($debugHandler, 'Functions have been included' . "\n");
+/**
+ * Create a new idna converter
+ */
+
+$idna_convert = new idna_convert_wrapper();
+
/**
* Initialize logging
*/
diff --git a/lib/functions/syscp/function.createAWStatsConf.php b/lib/functions/syscp/function.createAWStatsConf.php
index 14ee707d..973c19b3 100644
--- a/lib/functions/syscp/function.createAWStatsConf.php
+++ b/lib/functions/syscp/function.createAWStatsConf.php
@@ -52,7 +52,7 @@ function createAWStatsConf($logFile, $siteDomain, $hostAliases)
// File names
$domain_file = '/etc/awstats/awstats.' . $siteDomain . '.conf';
- $model_file = '/etc/awstats/awstats.model.conf.syscp';
+ $model_file = '/etc/awstats/awstats.model.conf.froxlor';
// Test if the file exists
diff --git a/lib/functions/syscp/function.inserttask.php b/lib/functions/syscp/function.inserttask.php
index 096332a9..3cd5505e 100644
--- a/lib/functions/syscp/function.inserttask.php
+++ b/lib/functions/syscp/function.inserttask.php
@@ -52,16 +52,22 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
$doupdate = true;
}
- // Taken from https://wiki.syscp.org/contrib/realtime
-
if($doupdate === true
&& (int)$settings['system']['realtime_port'] !== 0)
{
$timeout = 15;
- $socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
+ $socket = @socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
if($socket !== false)
{
+ // create the request packet
+ $packet = chr(0) . chr(1) . 'RUN' . chr(0);
+ // UDP is connectionless, so we just send on it.
+ @socket_sendto($socket, $packet, strlen($packet), 0x100, '127.0.0.1', (int)$settings['system']['realtime_port']);
+
+ /*
+ * this is for TCP-Connections
+ *
$time = time();
while(!@socket_connect($socket, '127.0.0.1', (int)$settings['system']['realtime_port']))
@@ -80,7 +86,7 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
continue;
}
}
-
+ */
@socket_close($socket);
}
}
diff --git a/lng/english.lng.php b/lng/english.lng.php
index eaa4a14f..ad6781cc 100644
--- a/lng/english.lng.php
+++ b/lng/english.lng.php
@@ -252,7 +252,7 @@ $lng['question']['extras_reallydelete'] = 'Do you really want to delete the dire
$lng['question']['extras_reallydelete_pathoptions'] = 'Do you really want to delete the path options for %s?';
$lng['question']['ftp_reallydelete'] = 'Do you really want to delete the FTP account %s?';
$lng['question']['mysql_reallydelete'] = 'Do you really want to delete the database %s? This cannot be undone!';
-$lng['question']['admin_configs_reallyrebuild'] = 'Do you really want to rebuild your apache and bind config files?';
+$lng['question']['admin_configs_reallyrebuild'] = 'Do you really want to rebuild all config files?';
/**
* Mails
@@ -1218,10 +1218,6 @@ $lng['admin']['webserver'] = 'Webserver';
$lng['error']['admin_domain_emailsystemhostname'] = 'The server-hostname cannot be used as email-domain.';
$lng['aps']['license_link'] = 'Link to the license';
-// ADDED IN 1.4.2.1
-$lng['admin']['thankyou'] = 'Thank you';
-$lng['admin']['contributors'] = 'All these people contributed to the Froxlor Project (no particular order)';
-
// ADDED IN 1.4.2.1-1
$lng['mysql']['mysql_server'] = 'MySQL-Server';
@@ -1245,4 +1241,11 @@ $lng['error']['errorwhensaving'] = 'An error occured when saving the field %s';
$lng['success']['success'] = 'Information';
$lng['success']['clickheretocontinue'] = 'Click here to continue';
$lng['success']['settingssaved'] = 'The settings have been successfully saved.';
-?>
\ No newline at end of file
+
+// ADDED IN FROXLOR 0.9
+
+$lng['admin']['spfsettings'] = 'Domain SPF settings';
+$lng['spf']['use_spf'] = 'Activate SPF for domains?';
+$lng['spf']['spf_entry'] = 'SPF entry for all domains';
+
+?>
diff --git a/lng/german.lng.php b/lng/german.lng.php
index d84d7f56..b6243033 100644
--- a/lng/german.lng.php
+++ b/lng/german.lng.php
@@ -252,7 +252,7 @@ $lng['question']['extras_reallydelete'] = 'Wollen Sie den Verzeichnisschutz f&uu
$lng['question']['extras_reallydelete_pathoptions'] = 'Wollen Sie die Optionen für den Pfad %s wirklich löschen?';
$lng['question']['ftp_reallydelete'] = 'Wollen Sie das FTP-Benutzerkonto %s wirklich löschen?';
$lng['question']['mysql_reallydelete'] = 'Wollen Sie die Datenbank %s wirklich löschen? ACHTUNG! Alle Daten gehen unwiderruflich verloren!';
-$lng['question']['admin_configs_reallyrebuild'] = 'Wollen Sie wirklich Ihre Apache und Bind Konfigurationsdateien neu erstellen lassen?';
+$lng['question']['admin_configs_reallyrebuild'] = 'Wollen Sie wirklich alle Konfigurationsdateien neu erstellen lassen?';
/**
* Mails
@@ -270,7 +270,7 @@ $lng['mails']['createcustomer']['subject'] = 'Kontoinformationen';
$lng['admin']['overview'] = 'Übersicht';
$lng['admin']['ressourcedetails'] = 'Verbrauchte Ressourcen';
$lng['admin']['systemdetails'] = 'Systemdetails';
-$lng['admin']['syscpdetails'] = 'SysCP-Details';
+$lng['admin']['syscpdetails'] = 'Froxlor-Details';
$lng['admin']['installedversion'] = 'Installierte Version';
$lng['admin']['latestversion'] = 'Neueste Version';
$lng['admin']['lookfornewversion']['clickhere'] = 'per Webservice abfragen';
@@ -1222,8 +1222,10 @@ $lng['admin']['webserver'] = 'Webserver';
$lng['error']['admin_domain_emailsystemhostname'] = 'Der Server-Hostname kann leider nicht als E-Mail-Domain verwendet werden.';
$lng['aps']['license_link'] = 'Link zur Lizenz';
-// ADDED IN 1.4.2.1
-$lng['admin']['thankyou'] = 'Vielen Dank';
-$lng['admin']['contributors'] = 'Diese Leute haben zum Froxlor Projekt beigetragen (keine besondere Ordnung)';
+// ADDED IN FROXLOR 0.9
-?>
\ No newline at end of file
+$lng['admin']['spfsettings'] = 'Domain SPF Einstellungen';
+$lng['spf']['use_spf'] = 'Aktiviere SPF für Domains?';
+$lng['spf']['spf_entry'] = 'SPF Eintrag für alle Domains';
+
+?>
diff --git a/scripts/cron_tasks.inc.dns.10.bind.php b/scripts/cron_tasks.inc.dns.10.bind.php
index f954e8ff..c6d2b028 100644
--- a/scripts/cron_tasks.inc.dns.10.bind.php
+++ b/scripts/cron_tasks.inc.dns.10.bind.php
@@ -79,8 +79,8 @@ class bind
public function writeConfigs()
{
- fwrite($this->debugHandler, ' cron_tasks: Task4 started - Rebuilding syscp_bind.conf' . "\n");
- $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 started - Rebuilding syscp_bind.conf');
+ fwrite($this->debugHandler, ' cron_tasks: Task4 started - Rebuilding froxlor_bind.conf' . "\n");
+ $this->logger->logAction(CRON_ACTION, LOG_INFO, 'Task4 started - Rebuilding froxlor_bind.conf');
if(!file_exists(makeCorrectDir($this->settings['system']['bindconf_directory'] . '/domains/')))
{
@@ -90,7 +90,7 @@ class bind
$known_filenames = array();
- $bindconf_file = '# ' . $this->settings['system']['bindconf_directory'] . 'syscp_bind.conf' . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n" . "\n";
+ $bindconf_file = '# ' . $this->settings['system']['bindconf_directory'] . 'froxlor_bind.conf' . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n" . "\n";
$result_domains = $this->db->query("SELECT `d`.`id`, `d`.`domain`, `d`.`iswildcarddomain`, `d`.`customerid`, `d`.`zonefile`, `d`.`bindserial`, `d`.`dkim`, `d`.`dkim_id`, `d`.`dkim_pubkey`, `ip`.`ip`, `c`.`loginname`, `c`.`guid` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) LEFT JOIN `" . TABLE_PANEL_IPSANDPORTS . "` AS `ip` ON(`d`.`ipandport`=`ip`.`id`) WHERE `d`.`isbinddomain` = '1' ORDER BY `d`.`domain` ASC");
while($domain = $this->db->fetch_array($result_domains))
@@ -131,11 +131,11 @@ class bind
$bindconf_file.= "\n";
}
- $bindconf_file_handler = fopen(makeCorrectFile($this->settings['system']['bindconf_directory'] . '/syscp_bind.conf'), 'w');
+ $bindconf_file_handler = fopen(makeCorrectFile($this->settings['system']['bindconf_directory'] . '/froxlor_bind.conf'), 'w');
fwrite($bindconf_file_handler, $bindconf_file);
fclose($bindconf_file_handler);
- fwrite($this->debugHandler, ' cron_tasks: Task4 - syscp_bind.conf written' . "\n");
- $this->logger->logAction(CRON_ACTION, LOG_INFO, 'syscp_bind.conf written');
+ fwrite($this->debugHandler, ' cron_tasks: Task4 - froxlor_bind.conf written' . "\n");
+ $this->logger->logAction(CRON_ACTION, LOG_INFO, 'froxlor_bind.conf written');
safe_exec($this->settings['system']['bindreload_command']);
fwrite($this->debugHandler, ' cron_tasks: Task4 - Bind9 reloaded' . "\n");
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'Bind9 reloaded');
@@ -216,7 +216,14 @@ class bind
}
}
- $zonefile.= '@ IN TXT "v=spf1 a mx -all"' . "\n";
+ /*
+ * @TODO domain-based spf-settings
+ */
+ if($this->settings['spf']['use_spf'] == '1'
+ /*&& $domain['spf'] == '1' */)
+ {
+ $zonefile.= $this->settings['spf']['spf_entry'] . "\n";
+ }
if($this->settings['dkim']['use_dkim'] == '1'
&& $domain['dkim'] == '1'
diff --git a/scripts/cron_tasks.inc.http.10.apache.php b/scripts/cron_tasks.inc.http.10.apache.php
index c330d591..645c649f 100644
--- a/scripts/cron_tasks.inc.http.10.apache.php
+++ b/scripts/cron_tasks.inc.http.10.apache.php
@@ -26,10 +26,14 @@ if(@php_sapi_name() != 'cli'
class apache
{
- protected $db = false;
- protected $logger = false;
- protected $debugHandler = false;
- protected $settings = array();
+ private $db = false;
+ private $logger = false;
+ private $debugHandler = false;
+ private $idnaConvert = false;
+ private $settings = array();
+
+ // protected
+
protected $known_vhostfilenames = array();
protected $known_diroptionsfilenames = array();
protected $known_htpasswdsfilenames = array();
@@ -37,11 +41,12 @@ class apache
protected $diroptions_data = array();
protected $htpasswds_data = array();
- public function __construct($db, $logger, $debugHandler, $settings)
+ public function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
{
$this->db = $db;
$this->logger = $logger;
$this->debugHandler = $debugHandler;
+ $this->idnaConvert = $idnaConvert;
$this->settings = $settings;
}
@@ -293,7 +298,7 @@ class apache
if($this->settings['system']['awstats_enabled'] == '1')
{
- $stats_text.= createAWStatsVhost($domain['domain']);
+ $stats_text.= createAWStatsVhost($domain['domain'], $this->settings);
}
}
else
@@ -302,7 +307,7 @@ class apache
if($this->settings['system']['awstats_enabled'] == '1')
{
- $stats_text.= createAWStatsVhost($domain['parentdomain']);
+ $stats_text.= createAWStatsVhost($domain['parentdomain'], $this->settings);
}
}
}
@@ -315,7 +320,7 @@ class apache
if($this->settings['system']['awstats_enabled'] == '1')
{
- $stats_text.= createAWStatsVhost($domain['domain']);
+ $stats_text.= createAWStatsVhost($domain['domain'], $this->settings);
}
}
@@ -482,7 +487,7 @@ class apache
if(preg_match('/^https?\:\/\//', $domain['documentroot']))
{
- $vhost_content.= ' Redirect 301 / ' . $domain['documentroot'] . "\n";
+ $vhost_content.= ' Redirect 301 / ' . $this->idnaConvert->encode($domain['documentroot']) . "\n";
}
else
{
diff --git a/scripts/cron_tasks.inc.http.20.lighttpd.php b/scripts/cron_tasks.inc.http.20.lighttpd.php
index e94e53c1..971492ed 100644
--- a/scripts/cron_tasks.inc.http.20.lighttpd.php
+++ b/scripts/cron_tasks.inc.http.20.lighttpd.php
@@ -32,6 +32,7 @@ class lighttpd
private $db = false;
private $logger = false;
private $debugHandler = false;
+ private $idnaConvert = false;
private $settings = array();
// protected
@@ -42,11 +43,12 @@ class lighttpd
public $mod_accesslog_loaded = "0";
protected $lighttpd_data = array();
- function __construct($db, $logger, $debugHandler, $settings)
+ function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
{
$this->db = $db;
$this->logger = $logger;
$this->debugHandler = $debugHandler;
+ $this->idnaConvert = $idnaConvert;
$this->settings = $settings;
}
@@ -77,7 +79,7 @@ class lighttpd
fwrite($this->debugHandler, ' lighttpd::createIpPort: creating ip/port settings for ' . $ip . ":" . $port . "\n");
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'creating ip/port settings for ' . $ip . ":" . $port);
- $vhost_filename = makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/10_syscp_ipandport_' . trim(str_replace(':', '.', $row_ipsandports['ip']), '.') . '.' . $row_ipsandports['port'] . '.conf');
+ $vhost_filename = makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/10_froxlor_ipandport_' . trim(str_replace(':', '.', $row_ipsandports['ip']), '.') . '.' . $row_ipsandports['port'] . '.conf');
$this->lighttpd_data[$vhost_filename].= '$SERVER["socket"] == "' . $ip . ':' . $port . '" {' . "\n";
if($row_ipsandports['listen_statement'] == '1')
@@ -159,6 +161,10 @@ class lighttpd
{
}
+ protected function composePhpOptions()
+ {
+ }
+
protected function createLighttpdHosts($ip, $port, $ssl, $vhost_filename)
{
$query = "SELECT * FROM " . TABLE_PANEL_IPSANDPORTS . " WHERE `ip`='" . $ip . "' AND `port`='" . $port . "'";
@@ -235,6 +241,7 @@ class lighttpd
$vhost_content.= $this->getWebroot($domain, $ssl_vhost);
$vhost_content.= $this->create_htaccess($domain);
$vhost_content.= $this->create_pathOptions($domain);
+ $vhost_content.= $this->composePhpOptions($domain);
$vhost_content.= $this->getLogFiles($domain);
$vhost_content.= '}' . "\n";
return $vhost_content;
@@ -393,6 +400,7 @@ class lighttpd
}
else
{
+ $server_string[] = $domain_name;
}
}
@@ -445,7 +453,13 @@ class lighttpd
}
unset($data);
- $servernames_text = '$HTTP["host"] =~ "' . $servernames_text . '"';
+
+ if($servernames_text != '') {
+ $servernames_text = '$HTTP["host"] =~ "' . $servernames_text . '"';
+ } else {
+ $servernames_text = '$HTTP["host"] == "' . $domain['domain'] . '"';
+ }
+
return $servernames_text;
}
@@ -464,11 +478,21 @@ class lighttpd
if($ssl === false
&& $domain['ssl_redirect'] == '1')
{
- $webroot_text.= ' url.redirect = ( "^/(.*)" => "https://' . $domain['domain'] . '/$1" )' . "\n";
+ $redirect_domain = $this->idnaConvert->encode('https://' . $domain['domain']);
+ $webroot_text.= ' url.redirect = ('."\n";
+ $webroot_text.= "\t" . '"^/(.*)" => "' . $redirect_domain . '/$1",' . "\n";
+ $webroot_text.= "\t" . '"" => "' . $redirect_domain . '",' . "\n";
+ $webroot_text.= "\t" . '"/" => "' . $redirect_domain . '"' . "\n";
+ $webroot_text.= ' )'."\n";
}
elseif(preg_match("#^https?://#i", $domain['documentroot']))
{
- $webroot_text.= ' url.redirect = ( "^/(.*)" => "' . $domain['documentroot'] . '/$1" )' . "\n";
+ $redirect_domain = $this->idnaConvert->encode($domain['documentroot']);
+ $webroot_text.= ' url.redirect = ('."\n";
+ $webroot_text.= "\t" . '"^/(.*)" => "' . $redirect_domain . '/$1",' . "\n";
+ $webroot_text.= "\t" . '"" => "' . $redirect_domain . '",' . "\n";
+ $webroot_text.= "\t" . '"/" => "' . $redirect_domain . '"' . "\n";
+ $webroot_text.= ' )'."\n";
}
else
{
@@ -553,7 +577,7 @@ class lighttpd
private function wipeOutOldConfigs()
{
- fwrite($this->debugHandler, ' apache::wipeOutOldConfigs: cleaning ' . $this->settings['system']['apacheconf_vhost'] . "\n");
+ fwrite($this->debugHandler, ' lighttpd::wipeOutOldConfigs: cleaning ' . $this->settings['system']['apacheconf_vhost'] . "\n");
$this->logger->logAction(CRON_ACTION, LOG_INFO, "cleaning " . $this->settings['system']['apacheconf_vhost']);
if(isConfigDir($this->settings['system']['apacheconf_vhost'])
@@ -567,10 +591,10 @@ class lighttpd
if($vhost_filename != '.'
&& $vhost_filename != '..'
&& !in_array($vhost_filename, $this->known_filenames)
- && preg_match('/^(10|20|30)_syscp_ipandport_(.+)\.conf$/', $vhost_filename)
+ && preg_match('/^(10|20|30)_froxlor_ipandport_(.+)\.conf$/', $vhost_filename)
&& file_exists(makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/' . $vhost_filename)))
{
- fwrite($this->debugHandler, ' apache::wipeOutOldConfigs: unlinking ' . $vhost_filename . "\n");
+ fwrite($this->debugHandler, ' lighttpd::wipeOutOldConfigs: unlinking ' . $vhost_filename . "\n");
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . $vhost_filename);
unlink(makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/' . $vhost_filename));
}
diff --git a/scripts/cron_tasks.inc.http.25.lighttpd_fcgid.php b/scripts/cron_tasks.inc.http.25.lighttpd_fcgid.php
index 37000117..9ee73056 100644
--- a/scripts/cron_tasks.inc.http.25.lighttpd_fcgid.php
+++ b/scripts/cron_tasks.inc.http.25.lighttpd_fcgid.php
@@ -28,261 +28,10 @@ if(@php_sapi_name() != 'cli'
class lighttpd_fcgid extends lighttpd
{
- private $db = false;
- private $logger = false;
- private $debugHandler = false;
- private $settings = array();
+ private $php_configs_cache = array();
+ private $admin_cache = array();
- // protected
-
- public $needed_htpasswds = array();
- public $auth_backend_loaded = false;
- public $htpasswd_files = array();
- public $mod_accesslog_loaded = "0";
- protected $lighttpd_data = array();
-
- function __construct($db, $logger, $debugHandler, $settings)
- {
- $this->db = $db;
- $this->logger = $logger;
- $this->debugHandler = $debugHandler;
- $this->settings = $settings;
- }
-
- public function reload()
- {
- fwrite($this->debugHandler, ' lighttpd::reload: reloading lighttpd' . "\n");
- $this->logger->logAction(CRON_ACTION, LOG_INFO, 'reloading apache');
- safe_exec($this->settings['system']['apachereload_command']);
- }
-
- public function createIpPort()
- {
- $query = "SELECT `id`, `ip`, `port`, `listen_statement`, `namevirtualhost_statement`, `vhostcontainer`, " . " `vhostcontainer_servername_statement`, `specialsettings`, `ssl`, `ssl_cert_file` " . " FROM `" . TABLE_PANEL_IPSANDPORTS . "` ORDER BY `ip` ASC, `port` ASC";
- $result_ipsandports = $this->db->query($query);
-
- while($row_ipsandports = $this->db->fetch_array($result_ipsandports))
- {
- if(filter_var($row_ipsandports['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
- {
- $ip = '[' . $row_ipsandports['ip'] . ']';
- $port = $row_ipsandports['port'];
- }
- else
- {
- $ip = $row_ipsandports['ip'];
- $port = $row_ipsandports['port'];
- }
-
- fwrite($this->debugHandler, ' lighttpd::createIpPort: creating ip/port settings for ' . $ip . ":" . $port . "\n");
- $this->logger->logAction(CRON_ACTION, LOG_INFO, 'creating ip/port settings for ' . $ip . ":" . $port);
- $vhost_filename = makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/10_syscp_ipandport_' . trim(str_replace(':', '.', $row_ipsandports['ip']), '.') . '.' . $row_ipsandports['port'] . '.conf');
- $this->lighttpd_data[$vhost_filename].= '$SERVER["socket"] == "' . $ip . ':' . $port . '" {' . "\n";
-
- if($row_ipsandports['listen_statement'] == '1')
- {
- $this->lighttpd_data[$vhost_filename].= 'server.port = ' . $port . "\n";
- $this->lighttpd_data[$vhost_filename].= 'server.bind = "' . $ip . '"' . "\n";
- }
-
- if($row_ipsandports['ssl'] == '1')
- {
- $this->lighttpd_data[$vhost_filename].= 'ssl.engine = "enable"' . "\n";
- $this->lighttpd_data[$vhost_filename].= 'ssl.pemfile = "' . $row_ipsandports['ssl_cert_file'] . '"' . "\n";
- }
-
- $this->createLighttpdHosts($row_ipsandports['ip'], $row_ipsandports['port'], $row_ipsandports['ssl'], $vhost_filename);
- $this->lighttpd_data[$vhost_filename].= $this->needed_htpasswds[$row_ipsandports['id']] . "\n";
- $this->lighttpd_data[$vhost_filename].= '}' . "\n";
- }
- }
-
- protected function create_htaccess($domain)
- {
- $needed_htpasswds = array();
- $htpasswd_query = "SELECT * FROM " . TABLE_PANEL_HTPASSWDS . " WHERE `path` LIKE '" . $domain['documentroot'] . "%'";
- $result_htpasswds = $this->db->query($htpasswd_query);
-
- while($row_htpasswds = $this->db->fetch_array($result_htpasswds))
- {
- $filename = $row_htpasswds['customerid'] . '-' . md5($row_htpasswds['path']) . '.htpasswd';
-
- if(!in_array($row_htpasswds['path'], $needed_htpasswds))
- {
- if(empty($needed_htpasswds))
- {
- $auth_backend_loaded[$domain['ipandport']] = 'yes';
-
- if(!$this->auth_backend_loaded)
- {
- $htaccess_text.= ' auth.backend = "htpasswd"' . "\n";
- }
-
- $htaccess_text.= ' auth.backend.htpasswd.userfile = "' . makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $filename) . '"' . "\n";
- $htaccess_text.= ' auth.require = ( ' . "\n";
- }
- else
- {
- $htaccess_text.= ' ,' . "\n";
- }
-
- if(!strstr($this->needed_htpasswds[$filename], $row_htpasswds['username'] . ':' . $row_htpasswds['password']))
- {
- $this->needed_htpasswds[$filename].= $row_htpasswds['username'] . ':' . $row_htpasswds['password'] . "\n";
- }
-
- $needed_htpasswds[] = $row_htpasswds['path'];
- $htaccess_path = substr($row_htpasswds['path'], strlen($domain['documentroot']) - 1);
- $htaccess_text.= ' "' . makeCorrectDir($htaccess_path) . '" =>' . "\n";
- $htaccess_text.= ' (' . "\n";
- $htaccess_text.= ' "method" => "basic",' . "\n";
- $htaccess_text.= ' "realm" => "Restricted Area",' . "\n";
- $htaccess_text.= ' "require" => "user=' . $row_htpasswds[username] . '"' . "\n";
- $htaccess_text.= ' )' . "\n";
- }
- }
-
- if(strlen(trim($htaccess_text)) > 0)
- {
- $htaccess_text.= ' )' . "\n";
- }
-
- return $htaccess_text;
- }
-
- function createVirtualHosts()
- {
- }
-
- function createFileDirOptions()
- {
- }
-
- protected function createLighttpdHosts($ip, $port, $ssl, $vhost_filename)
- {
- $query = "SELECT * FROM " . TABLE_PANEL_IPSANDPORTS . " WHERE `ip`='" . $ip . "' AND `port`='" . $port . "'";
- $ipandport = $this->db->query_first($query);
-
- if($ssl == '0')
- {
- $query2 = "SELECT `d`.`id`, `d`.`domain`, `d`.`customerid`, `d`.`documentroot`, `d`.`ssl`, " . "`d`.`parentdomainid`, `d`.`ipandport`, `d`.`ssl_ipandport`, `d`.`ssl_redirect`, " . "`d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`wwwserveralias`, `d`.`openbasedir`, `d`.`openbasedir_path`, " . "`d`.`safemode`, `d`.`speciallogfile`, `d`.`specialsettings`, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, " . "`c`.`guid`, `c`.`email`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`phpenabled` AS `phpenabled` " . "FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) " . "LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`) " . "WHERE `d`.`ipandport`='" . $ipandport['id'] . "' " . "ORDER BY `d`.`iswildcarddomain`, `d`.`domain` ASC";
- }
- else
- {
- $query2.= "SELECT `d`.`id`, `d`.`domain`, `d`.`customerid`, `d`.`documentroot`, `d`.`ssl`, " . "`d`.`parentdomainid`, `d`.`ipandport`, `d`.`ssl_ipandport`, `d`.`ssl_redirect`, " . "`d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`wwwserveralias`, `d`.`openbasedir`, `d`.`openbasedir_path`, " . "`d`.`safemode`, `d`.`speciallogfile`, `d`.`specialsettings`, `pd`.`domain` AS `parentdomain`, `c`.`loginname`, " . "`c`.`guid`, `c`.`email`, `c`.`documentroot` AS `customerroot`, `c`.`deactivated`, `c`.`phpenabled` AS `phpenabled` " . "FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) " . "LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`) " . "WHERE `d`.`ssl_ipandport`='" . $ipandport['id'] . "' " . "ORDER BY `d`.`iswildcarddomain`, `d`.`domain` ASC";
- }
-
- $result_domains = $this->db->query($query2);
-
- while($domain = $this->db->fetch_array($result_domains))
- {
- $query = "SELECT * FROM " . TABLE_PANEL_IPSANDPORTS . " WHERE `id`='" . $domain['ipandport'] . "'";
- $ipandport = $this->db->query_first($query);
- $domain['ip'] = $ipandport['ip'];
- $domain['port'] = $ipandport['port'];
- $domain['ssl_cert_file'] = $ipandport['ssl_cert_file'];
-
- if(!empty($this->lighttpd_data[$vhost_filename]))
- {
- if($ssl == '1')
- {
- $ssl_vhost = true;
- }
- else
- {
- $ssl_vhost = false;
- }
-
- $this->lighttpd_data[$vhost_filename].= $this->getVhostContent($domain, $ssl_vhost);
- }
- }
- }
-
- protected function getVhostContent($domain, $ssl_vhost = false)
- {
- if($ssl_vhost === true
- && $domain['ssl'] != '1')
- {
- return '';
- }
-
- if($ssl_vhost === true
- && $domain['ssl'] == '1')
- {
- $query = "SELECT * FROM " . TABLE_PANEL_IPSANDPORTS . " WHERE `id`='" . $domain['ssl_ipandport'] . "'";
- }
- else
- {
- $query = "SELECT * FROM " . TABLE_PANEL_IPSANDPORTS . " WHERE `id`='" . $domain['ipandport'] . "'";
- }
-
- $ipandport = $this->db->query_first($query);
- $domain['ip'] = $ipandport['ip'];
- $domain['port'] = $ipandport['port'];
- $domain['ssl_cert_file'] = $ipandport['ssl_cert_file'];
-
- if(filter_var($domain['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
- {
- $ipport = '[' . $domain['ip'] . ']:' . $domain['port'];
- }
- else
- {
- $ipport = $domain['ip'] . ':' . $domain['port'];
- }
-
- $vhost_content.= $this->getServerNames($domain) . " {\n";
- $vhost_content.= $this->getWebroot($domain, $ssl_vhost);
- $vhost_content.= $this->create_htaccess($domain);
- $vhost_content.= $this->create_pathOptions($domain);
- $vhost_content.= $this->create_Fcgid($domain);
- $vhost_content.= $this->getLogFiles($domain);
- $vhost_content.= '}' . "\n";
- return $vhost_content;
- }
-
- protected function getLogFiles($domain)
- {
- $logfiles_text = '';
-
- if($this->settings['system']['mod_log_sql'] == 1)
- {
- // We are using mod_log_sql (http://www.outoforder.cc/projects/apache/mod_log_sql/)
- // TODO: See how we are able emulate the error_log
- }
- else
- {
- // The normal access/error - logging is enabled
-
- $filename = $this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-error.log';
-
- if(!is_file($filename))
- {
- $ourFileHandle = fopen($filename, 'w') or die("can't open file");
- fclose($ourFileHandle);
- }
-
- chown($filename, $this->settings[system]['httpuser']);
- chgrp($filename, $this->settings[system]['httpgroup']);
-
- //access log
-
- $filename = $this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log';
-
- if(!is_file($filename))
- {
- $ourFileHandle = fopen($filename, 'w') or die("can't open file");
- fclose($ourFileHandle);
- }
-
- $logfiles_text.= ' accesslog.filename = "' . $filename . '"' . "\n";
- chown($filename, $this->settings[system]['httpuser']);
- chgrp($filename, $this->settings[system]['httpgroup']);
- }
-
- return $logfiles_text;
- }
-
- protected function create_Fcgid($domain)
+ protected function composePhpOptions($domain)
{
$php_options_text = '';
@@ -502,300 +251,35 @@ class lighttpd_fcgid extends lighttpd
return $php_options_text;
}
- protected function create_pathOptions($domain)
+ private function getPhpConfig($php_config_id)
{
- $query = "SELECT * FROM " . TABLE_PANEL_HTACCESS . " WHERE `path` LIKE '" . $domain['documentroot'] . "%'";
- $result = $this->db->query($query);
+ $php_config_id = intval($php_config_id);
- $path_options = '';
- $error_string = '';
+ // If domain has no config, we will use the default one.
- while($row = $this->db->fetch_array($result))
+ if($php_config_id == 0)
{
- if(!empty($row['error404path']))
- {
- $error_string.= ' server.error-handler-404 = "' . makeCorrectFile($row['documentroot'] . '/' . $row['error404path']) . '"' . "\n";
- }
-
- if($row['options_indexes'] != '0')
- {
- $path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
-
- // We need to remove the last slash, otherwise the regex wouldn't work
-
- $path = substr($path, 0, -1);
- $path_options.= '$HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
- $path_options.= "\t" . 'dir-listing.activate = "enable"' . "\n";
- if(!empty($error_string))
- {
- $path_options.= $error_string;
- // reset $error_string here to prevent duplicate entries
- $error_string = '';
- }
- $path_options.= '}' . "\n";
- }
- else
- {
- $path_options = $error_string;
- }
+ $php_config_id = 1;
}
- return $path_options;
+ if(!isset($this->php_configs_cache[$php_config_id]))
+ {
+ $this->php_configs_cache[$php_config_id] = $this->db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$php_config_id);
+ }
+
+ return $this->php_configs_cache[$php_config_id];
}
- protected function getDirOptions($domain)
+ private function getAdminData($adminid)
{
- $query = "SELECT * FROM " . TABLE_PANEL_HTPASSWDS . " WHERE `customerid`='" . $domain[customerid] . "'";
- $result = $this->db->query($query);
+ $adminid = intval($adminid);
- while($row_htpasswds = $this->db->fetch_array($result))
+ if(!isset($this->admin_cache[$adminid]))
{
- if($auth_backend_loaded[$domain['ipandport']] != 'yes'
- && $auth_backend_loaded[$domain['ssl_ipandport']] != 'yes')
- {
- $filename = $domain['customerid'] . '.htpasswd';
-
- if($this->auth_backend_loaded[$domain['ipandport']] != 'yes')
- {
- $auth_backend_loaded[$domain['ipandport']] = 'yes';
- $diroption_text.= 'auth.backend = "htpasswd"' . "\n";
- $diroption_text.= 'auth.backend.htpasswd.userfile = "' . makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $filename) . '"' . "\n";
- $this->needed_htpasswds[$filename] = $row_htpasswds['username'] . ':' . $row_htpasswds['password'] . "\n";
- $diroption_text.= 'auth.require = ( ' . "\n";
- $previous_domain_id = '1';
- }
- elseif($this->auth_backend_loaded[$domain['ssl_ipandport']] != 'yes')
- {
- $auth_backend_loaded[$domain['ssl_ipandport']] = 'yes';
- $diroption_text.= 'auth.backend= "htpasswd"' . "\n";
- $diroption_text.= 'auth.backend.htpasswd.userfile = "' . makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $filename) . '"' . "\n";
- $this->needed_htpasswds[$filename] = $row_htpasswds['username'] . ':' . $row_htpasswds['password'] . "\n";
- $diroption_text.= 'auth.require = ( ' . "\n";
- $previous_domain_id = '1';
- }
- }
-
- $diroption_text.= '"' . $row_htpasswds['path'] . '" =>' . "\n";
- $diroption_text.= '(' . "\n";
- $diroption_text.= ' "method" => "basic",' . "\n";
- $diroption_text.= ' "realm" => "Restricted Area",' . "\n";
- $diroption_text.= ' "require" => "user=' . $row_htpasswds['username'] . '"' . "\n";
- $diroption_text.= ')' . "\n";
-
- if($this->auth_backend_loaded[$domain['ssl_ipandport']] == 'yes')
- {
- $this->needed_htpasswds[$domain['ssl_ipandport']].= $diroption_text;
- }
-
- if($this->auth_backend_loaded[$domain['ipandport']] != 'yes')
- {
- $this->needed_htpasswds[$domain['ipandport']].= $diroption_text;
- }
+ $this->admin_cache[$adminid] = $this->db->query_first("SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = " . (int)$adminid);
}
- return ' auth.backend.htpasswd.userfile = "' . makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $filename) . '"' . "\n";
- }
-
- protected function getServerNames($domain)
- {
- $server_string = array();
- $domain_name = ereg_replace('\.', '\.', $domain['domain']);
-
- if($domain['iswildcarddomain'] == '1')
- {
- $server_string[] = '(^|\.)' . $domain_name . '$';
- }
- else
- {
- if($domain['wwwserveralias'] == '1')
- {
- $server_string[] = '^(www\.|)' . $domain_name . '$';
- }
- else
- {
- }
- }
-
- $alias_domains = $this->db->query('SELECT `domain`, `iswildcarddomain`, `wwwserveralias` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `aliasdomain`=\'' . $domain['id'] . '\'');
-
- while(($alias_domain = $this->db->fetch_array($alias_domains)) !== false)
- {
- $alias_domain_name = ereg_replace('\.', '\.', $alias_domain['domain']);
-
- if($alias_domain['iswildcarddomain'] == '1')
- {
- $server_string[] = '(^|\.)' . $alias_domain_name . '$';
- }
- else
- {
- if($alias_domain['wwwserveralias'] == '1')
- {
- $server_string[] = '^(www.)?' . $alias_domain_name;
- }
- else
- {
- $server_string[] = $alias_domain_name;
- }
- }
- }
-
- for ($i = 0;$i < sizeof($server_string);$i++)
- {
- $data = $server_string[$i];
-
- if(sizeof($server_string) > 1)
- {
- if($i == 0)
- {
- $servernames_text = '(' . $data . '|';
- }
- elseif(sizeof($server_string) - 1 == $i)
- {
- $servernames_text.= $data . ')';
- }
- else
- {
- $servernames_text.= $data . '|';
- }
- }
- else
- {
- $servernames_text = $data;
- }
- }
-
- unset($data);
- $servernames_text = '$HTTP["host"] =~ "' . $servernames_text . '"';
- return $servernames_text;
- }
-
- protected function getWebroot($domain, $ssl)
- {
- $webroot_text = '';
-
- if($domain['deactivated'] == '1'
- && $this->settings['system']['deactivateddocroot'] != '')
- {
- $webroot_text.= ' # Using docroot for deactivated users...' . "\n";
- $webroot_text.= ' server.document-root = "' . $this->settings['system']['deactivateddocroot'] . "\"\n";
- }
- else
- {
- if($ssl === false
- && $domain['ssl_redirect'] == '1')
- {
- $webroot_text.= ' url.redirect = ( "^/(.*)" => "https://' . $domain['domain'] . '/$1" )' . "\n";
- }
- elseif(preg_match("#^https?://#i", $domain['documentroot']))
- {
- $webroot_text.= ' url.redirect = ( "^/(.*)" => "' . $domain['documentroot'] . '/$1" )' . "\n";
- }
- else
- {
- $webroot_text.= ' server.document-root = "' . makeCorrectDir($domain['documentroot']) . "\"\n";
- }
- }
-
- return $webroot_text;
- }
-
- public function writeConfigs()
- {
- fwrite($this->debugHandler, ' lighttpd::writeConfigs: rebuilding ' . $this->settings['system']['apacheconf_vhost'] . "\n");
- $this->logger->logAction(CRON_ACTION, LOG_INFO, "rebuilding " . $this->settings['system']['apacheconf_vhost']);
-
- if(!isConfigDir($this->settings['system']['apacheconf_vhost']))
- {
- // Save one big file
-
- foreach($this->lighttpd_data as $vhosts_filename => $vhost_content)
- {
- $vhosts_file.= $vhost_content . "\n\n";
- }
-
- $vhosts_filename = $this->settings['system']['apacheconf_vhost'];
-
- // Apply header
-
- $vhosts_file = '# ' . basename($vhosts_filename) . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n" . "\n" . $vhosts_file;
- $vhosts_file_handler = fopen($vhosts_filename, 'w');
- fwrite($vhosts_file_handler, $vhosts_file);
- fclose($vhosts_file_handler);
- }
- else
- {
- if(!file_exists($this->settings['system']['apacheconf_vhost']))
- {
- fwrite($this->debugHandler, ' lighttpd::writeConfigs: mkdir ' . escapeshellarg(makeCorrectDir($this->settings['system']['apacheconf_vhost'])) . "\n");
- $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'mkdir ' . escapeshellarg(makeCorrectDir($this->settings['system']['apacheconf_vhost'])));
- safe_exec('mkdir ' . escapeshellarg(makeCorrectDir($this->settings['system']['apacheconf_vhost'])));
- }
-
- // Write a single file for every vhost
-
- foreach($this->lighttpd_data as $vhosts_filename => $vhosts_file)
- {
- $this->known_filenames[] = basename($vhosts_filename);
-
- // Apply header
-
- $vhosts_file = '# ' . basename($vhosts_filename) . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" . '# Do NOT manually edit this file, all changes will be deleted after the next domain change at the panel.' . "\n" . "\n" . $vhosts_file;
-
- if(!empty($vhosts_filename))
- {
- $vhosts_file_handler = fopen($vhosts_filename, 'w');
- fwrite($vhosts_file_handler, $vhosts_file);
- fclose($vhosts_file_handler);
- }
- }
-
- $this->wipeOutOldConfigs();
- }
-
- // Write the diroptions
-
- if(isConfigDir($this->settings['system']['apacheconf_htpasswddir']))
- {
- foreach($this->needed_htpasswds as $key => $data)
- {
- if(!is_dir($this->settings['system']['apacheconf_htpasswddir']))
- {
- mkdir($this->settings['system']['apacheconf_htpasswddir']);
- }
-
- $filename = $this->settings['system']['apacheconf_htpasswddir'] . '/' . $key;
- $htpasswd_handler = fopen($filename, 'w');
- fwrite($htpasswd_handler, $data);
- fclose($htpasswd_handler);
- }
- }
- }
-
- private function wipeOutOldConfigs()
- {
- fwrite($this->debugHandler, ' apache::wipeOutOldConfigs: cleaning ' . $this->settings['system']['apacheconf_vhost'] . "\n");
- $this->logger->logAction(CRON_ACTION, LOG_INFO, "cleaning " . $this->settings['system']['apacheconf_vhost']);
-
- if(isConfigDir($this->settings['system']['apacheconf_vhost'])
- && file_exists($this->settings['system']['apacheconf_vhost'])
- && is_dir($this->settings['system']['apacheconf_vhost']))
- {
- $vhost_file_dirhandle = opendir($this->settings['system']['apacheconf_vhost']);
-
- while(false !== ($vhost_filename = readdir($vhost_file_dirhandle)))
- {
- if($vhost_filename != '.'
- && $vhost_filename != '..'
- && !in_array($vhost_filename, $this->known_filenames)
- && preg_match('/^(10|20|30)_syscp_ipandport_(.+)\.conf$/', $vhost_filename)
- && file_exists(makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/' . $vhost_filename)))
- {
- fwrite($this->debugHandler, ' apache::wipeOutOldConfigs: unlinking ' . $vhost_filename . "\n");
- $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . $vhost_filename);
- unlink(makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/' . $vhost_filename));
- }
- }
- }
+ return $this->admin_cache[$adminid];
}
}
diff --git a/scripts/cron_tasks.php b/scripts/cron_tasks.php
index 74cde5f5..3f01cd00 100644
--- a/scripts/cron_tasks.php
+++ b/scripts/cron_tasks.php
@@ -53,28 +53,47 @@ while($row = $db->fetch_array($result_tasks))
if($row['type'] == '1')
{
+ //dhr: cleanout froxlor-generated awstats configs prior to re-creation
+ if ($settings[system][awstats_enabled] == '1')
+ {
+ $awstatsclean[header] = "## GENERATED BY FROXLOR\n";
+ $awstatsclean[path] = '/etc/awstats';
+ $awstatsclean[dir] = dir($awstatsclean[path]);
+ while($awstatsclean[entry] = $awstatsclean[dir]->read()) {
+ $awstatsclean[fullentry] = $awstatsclean[path].'/'.$awstatsclean[entry];
+ $awstatsclean[fh] = fopen($awstatsclean[fullentry], 'r');
+ $awstatsclean[headerRead] = fgets($awstatsclean[fh], strlen($awstatsclean[header])+1);
+ fclose($awstatsclean[fh]);
+ if($awstatsclean[headerRead] == $awstatsclean[header]) {
+ @unlink($awstatsclean[fullentry]);
+ }
+ }
+ unset($awstatsclean);
+ }
+ //end dhr
+
if(!isset($webserver))
{
if($settings['system']['webserver'] == "apache2")
{
if($settings['system']['mod_fcgid'] == 1)
{
- $webserver = new apache_fcgid($db, $cronlog, $debugHandler, $settings);
+ $webserver = new apache_fcgid($db, $cronlog, $debugHandler, $idna_convert, $settings);
}
else
{
- $webserver = new apache($db, $cronlog, $debugHandler, $settings);
+ $webserver = new apache($db, $cronlog, $debugHandler, $idna_convert, $settings);
}
}
elseif($settings['system']['webserver'] == "lighttpd")
{
if($settings['system']['mod_fcgid'] == 1)
{
- $webserver = new lighttpd_fcgid($db, $cronlog, $debugHandler, $settings);
+ $webserver = new lighttpd_fcgid($db, $cronlog, $debugHandler, $idna_convert, $settings);
}
else
- {
- $webserver = new lighttpd($db, $cronlog, $debugHandler, $settings);
+ {
+ $webserver = new lighttpd($db, $cronlog, $debugHandler, $idna_convert, $settings);
}
}
}
diff --git a/templates/admin/admins/admins_add.tpl b/templates/admin/admins/admins_add.tpl
index 0c105267..497956f4 100644
--- a/templates/admin/admins/admins_add.tpl
+++ b/templates/admin/admins/admins_add.tpl
@@ -86,7 +86,7 @@ $header
{$lng['customer']['traffic']}: *
- {$traffic_ul}
+ {$traffic_ul}
{$lng['customer']['subdomains']}: *
diff --git a/templates/admin/admins/admins_edit.tpl b/templates/admin/admins/admins_edit.tpl
index 6d45d515..dad9bb7a 100644
--- a/templates/admin/admins/admins_edit.tpl
+++ b/templates/admin/admins/admins_edit.tpl
@@ -104,7 +104,7 @@ $header
{$lng['customer']['traffic']}: *
- {$traffic_ul}
+ {$traffic_ul}
{$lng['customer']['subdomains']}: *
diff --git a/templates/admin/customers/customers_add.tpl b/templates/admin/customers/customers_add.tpl
index 66dc042a..2b2d4e0c 100644
--- a/templates/admin/customers/customers_add.tpl
+++ b/templates/admin/customers/customers_add.tpl
@@ -98,7 +98,7 @@ $header
{$lng['customer']['traffic']}: *
- {$traffic_ul}
+ {$traffic_ul}
{$lng['customer']['subdomains']}: *
diff --git a/templates/admin/customers/customers_customer.tpl b/templates/admin/customers/customers_customer.tpl
index 90b6849c..4b2e4b72 100644
--- a/templates/admin/customers/customers_customer.tpl
+++ b/templates/admin/customers/customers_customer.tpl
@@ -12,6 +12,6 @@
{$row['mysqls_used']} /{$row['mysqls']} {$row['ftps_used']} /{$row['ftps']}
{$row['emails_used']} /{$row['emails']} {$row['subdomains_used']} /{$row['subdomains']}
{$row['email_accounts_used']} /{$row['email_accounts']} {$row['email_forwarders_used']} /{$row['email_forwarders']}
- {$lng['panel']['yes']}{$lng['panel']['no']} {$lng['panel']['yes']}{$lng['panel']['no']}
- {$lng['panel']['edit']} {$lng['panel']['delete']} {$lng['customer']['create_contract']}
+ {$lng['panel']['yes']}{$lng['panel']['no']}
+ {$lng['panel']['edit']} {$lng['panel']['delete']}
diff --git a/templates/admin/customers/customers_edit.tpl b/templates/admin/customers/customers_edit.tpl
index 0c2e4038..04cab678 100644
--- a/templates/admin/customers/customers_edit.tpl
+++ b/templates/admin/customers/customers_edit.tpl
@@ -104,7 +104,7 @@ $header
{$lng['customer']['traffic']}: *
- {$traffic_ul}
+ {$traffic_ul}
{$lng['customer']['subdomains']}: *
diff --git a/templates/admin/index/index.tpl b/templates/admin/index/index.tpl
index 98c36c46..084e7615 100644
--- a/templates/admin/index/index.tpl
+++ b/templates/admin/index/index.tpl
@@ -142,12 +142,6 @@ $header
$lookfornewversion_addinfo
-
- {$lng['admin']['thankyou']}
-
-
- {$lng['admin']['contributors']}: Florian Lippert, Tim Zielosko, Martin Burchert, Ron Brand, Michael Duergner, Wolfgang Ziegler, Patrick Brueckner, Florian Aders, Luca Longinotti, Manuel Bernhardt, Janky Jay, Thomas Peterhans, Benjamin Börngen-Schmidt, Philipp Haefelfinger, Michael Kaufmannk, Sven Skrabal
-