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:
Michael Kaufmann (d00p)
2011-02-16 14:01:37 +01:00
parent 460e153c6f
commit d2fe9be860
3 changed files with 48 additions and 13 deletions

View File

@@ -41,6 +41,14 @@ class nginx
protected $vhost_root_autoindex = false;
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)
{
$this->db = $db;
@@ -409,13 +417,15 @@ class nginx
$vhost_content.= $this->getLogFiles($domain);
$vhost_content.= $this->getWebroot($domain, $ssl_vhost);
$vhost_content.= $this->create_pathOptions($domain);
//$vhost_content.= $this->create_htaccess($domain);
$vhost_content.= $this->composePhpOptions($domain);
$vhost_content.= $this->getStats($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->getStats($domain);
if ($domain['specialsettings'] != "") {
$vhost_content.= $domain['specialsettings'] . "\n";
if ($domain['specialsettings'] != "") {
$vhost_content.= $domain['specialsettings'] . "\n";
}
}
}
$vhost_content.= '}' . "\n\n";
@@ -585,10 +595,12 @@ class nginx
{
$webroot_text.= "\t".'# Using docroot for deactivated users...' . "\n";
$webroot_text.= "\t".'root '.$this->settings['system']['deactivateddocroot'].';'."\n";
$this->_deactivated = true;
}
else
{
$webroot_text.= "\t".'root '.makeCorrectDir($domain['documentroot']).';'."\n";
$this->_deactivated = false;
}
$webroot_text.= "\t".'location / {'."\n";