do not generate any unnecessary webserver configuration-lines for deactivated users, fixes #599
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -41,6 +41,14 @@ class apache
|
|||||||
protected $diroptions_data = array();
|
protected $diroptions_data = array();
|
||||||
protected $htpasswds_data = array();
|
protected $htpasswds_data = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* indicator whether a customer is deactivated or not
|
||||||
|
* if yes, only the webroot will be generated
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $_deactivated = false;
|
||||||
|
|
||||||
public function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
|
public function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@@ -481,10 +489,12 @@ class apache
|
|||||||
{
|
{
|
||||||
$webroot_text.= ' # Using docroot for deactivated users...' . "\n";
|
$webroot_text.= ' # Using docroot for deactivated users...' . "\n";
|
||||||
$webroot_text.= ' DocumentRoot "' . $this->settings['system']['deactivateddocroot'] . "\"\n";
|
$webroot_text.= ' DocumentRoot "' . $this->settings['system']['deactivateddocroot'] . "\"\n";
|
||||||
|
$this->_deactivated = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$webroot_text.= ' DocumentRoot "' . $domain['documentroot'] . "\"\n";
|
$webroot_text.= ' DocumentRoot "' . $domain['documentroot'] . "\"\n";
|
||||||
|
$this->_deactivated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $webroot_text;
|
return $webroot_text;
|
||||||
@@ -820,8 +830,10 @@ class apache
|
|||||||
|
|
||||||
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true, true);
|
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true, true);
|
||||||
$vhost_content.= $this->getWebroot($domain);
|
$vhost_content.= $this->getWebroot($domain);
|
||||||
$vhost_content.= $this->composePhpOptions($domain);
|
if ($this->_deactivated == false) {
|
||||||
$vhost_content.= $this->getStats($domain);
|
$vhost_content.= $this->composePhpOptions($domain);
|
||||||
|
$vhost_content.= $this->getStats($domain);
|
||||||
|
}
|
||||||
$vhost_content.= $this->getLogfiles($domain);
|
$vhost_content.= $this->getLogfiles($domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,13 @@ class lighttpd
|
|||||||
protected $htpasswd_files = array();
|
protected $htpasswd_files = array();
|
||||||
protected $mod_accesslog_loaded = "0";
|
protected $mod_accesslog_loaded = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* indicator whether a customer is deactivated or not
|
||||||
|
* if yes, only the webroot will be generated
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $_deactivated = false;
|
||||||
|
|
||||||
public function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
|
public function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
|
||||||
{
|
{
|
||||||
@@ -468,12 +475,14 @@ class lighttpd
|
|||||||
$vhost_content.= $this->getWebroot($domain, $ssl_vhost);
|
$vhost_content.= $this->getWebroot($domain, $ssl_vhost);
|
||||||
if(!$only_webroot)
|
if(!$only_webroot)
|
||||||
{
|
{
|
||||||
$vhost_content.= $this->create_htaccess($domain);
|
if ($this->_deactivated == false) {
|
||||||
$vhost_content.= $this->create_pathOptions($domain);
|
$vhost_content.= $this->create_htaccess($domain);
|
||||||
$vhost_content.= $this->composePhpOptions($domain);
|
$vhost_content.= $this->create_pathOptions($domain);
|
||||||
$vhost_content.= $this->getStats($domain);
|
$vhost_content.= $this->composePhpOptions($domain);
|
||||||
|
$vhost_content.= $this->getStats($domain);
|
||||||
|
$vhost_content.= $this->getSslSettings($domain, $ssl_vhost);
|
||||||
|
}
|
||||||
$vhost_content.= $this->getLogFiles($domain);
|
$vhost_content.= $this->getLogFiles($domain);
|
||||||
$vhost_content.= $this->getSslSettings($domain, $ssl_vhost);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -825,6 +834,7 @@ class lighttpd
|
|||||||
{
|
{
|
||||||
$webroot_text.= ' # Using docroot for deactivated users...' . "\n";
|
$webroot_text.= ' # Using docroot for deactivated users...' . "\n";
|
||||||
$webroot_text.= ' server.document-root = "' . $this->settings['system']['deactivateddocroot'] . "\"\n";
|
$webroot_text.= ' server.document-root = "' . $this->settings['system']['deactivateddocroot'] . "\"\n";
|
||||||
|
$this->_deactivated = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -851,6 +861,7 @@ class lighttpd
|
|||||||
{
|
{
|
||||||
$webroot_text.= ' server.document-root = "' . makeCorrectDir($domain['documentroot']) . "\"\n";
|
$webroot_text.= ' server.document-root = "' . makeCorrectDir($domain['documentroot']) . "\"\n";
|
||||||
}
|
}
|
||||||
|
$this->_deactivated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $webroot_text;
|
return $webroot_text;
|
||||||
|
|||||||
@@ -41,6 +41,14 @@ class nginx
|
|||||||
protected $vhost_root_autoindex = false;
|
protected $vhost_root_autoindex = false;
|
||||||
protected $known_vhostfilenames = array();
|
protected $known_vhostfilenames = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* indicator whether a customer is deactivated or not
|
||||||
|
* if yes, only the webroot will be generated
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $_deactivated = false;
|
||||||
|
|
||||||
public function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
|
public function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@@ -409,13 +417,15 @@ class nginx
|
|||||||
|
|
||||||
$vhost_content.= $this->getLogFiles($domain);
|
$vhost_content.= $this->getLogFiles($domain);
|
||||||
$vhost_content.= $this->getWebroot($domain, $ssl_vhost);
|
$vhost_content.= $this->getWebroot($domain, $ssl_vhost);
|
||||||
$vhost_content.= $this->create_pathOptions($domain);
|
if ($this->_deactivated == false) {
|
||||||
//$vhost_content.= $this->create_htaccess($domain);
|
$vhost_content.= $this->create_pathOptions($domain);
|
||||||
$vhost_content.= $this->composePhpOptions($domain);
|
// $vhost_content.= $this->create_htaccess($domain);
|
||||||
$vhost_content.= $this->getStats($domain);
|
$vhost_content.= $this->composePhpOptions($domain);
|
||||||
|
$vhost_content.= $this->getStats($domain);
|
||||||
|
|
||||||
if ($domain['specialsettings'] != "") {
|
if ($domain['specialsettings'] != "") {
|
||||||
$vhost_content.= $domain['specialsettings'] . "\n";
|
$vhost_content.= $domain['specialsettings'] . "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$vhost_content.= '}' . "\n\n";
|
$vhost_content.= '}' . "\n\n";
|
||||||
@@ -585,10 +595,12 @@ class nginx
|
|||||||
{
|
{
|
||||||
$webroot_text.= "\t".'# Using docroot for deactivated users...' . "\n";
|
$webroot_text.= "\t".'# Using docroot for deactivated users...' . "\n";
|
||||||
$webroot_text.= "\t".'root '.$this->settings['system']['deactivateddocroot'].';'."\n";
|
$webroot_text.= "\t".'root '.$this->settings['system']['deactivateddocroot'].';'."\n";
|
||||||
|
$this->_deactivated = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$webroot_text.= "\t".'root '.makeCorrectDir($domain['documentroot']).';'."\n";
|
$webroot_text.= "\t".'root '.makeCorrectDir($domain['documentroot']).';'."\n";
|
||||||
|
$this->_deactivated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$webroot_text.= "\t".'location / {'."\n";
|
$webroot_text.= "\t".'location / {'."\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user