Merged d00ps and my branch, renamed SysCP -> Froxlor in installer
This commit is contained in:
@@ -30,10 +30,10 @@ class apache
|
||||
private $logger = false;
|
||||
private $debugHandler = false;
|
||||
private $idnaConvert = false;
|
||||
private $settings = array();
|
||||
|
||||
// protected
|
||||
|
||||
protected $settings = array();
|
||||
protected $known_vhostfilenames = array();
|
||||
protected $known_diroptionsfilenames = array();
|
||||
protected $known_htpasswdsfilenames = array();
|
||||
@@ -49,10 +49,11 @@ class apache
|
||||
$this->idnaConvert = $idnaConvert;
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
/*
|
||||
* We compose the namevirtualhost entries
|
||||
*/
|
||||
|
||||
protected function getDB()
|
||||
{
|
||||
return $this->db;
|
||||
}
|
||||
|
||||
public function reload()
|
||||
{
|
||||
|
||||
@@ -242,7 +242,7 @@ class apache_fcgid extends apache
|
||||
|
||||
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);
|
||||
$this->php_configs_cache[$php_config_id] = $this->getDB()->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$php_config_id);
|
||||
}
|
||||
|
||||
return $this->php_configs_cache[$php_config_id];
|
||||
@@ -254,7 +254,7 @@ class apache_fcgid extends apache
|
||||
|
||||
if(!isset($this->admin_cache[$adminid]))
|
||||
{
|
||||
$this->admin_cache[$adminid] = $this->db->query_first("SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = " . (int)$adminid);
|
||||
$this->admin_cache[$adminid] = $this->getDB()->query_first("SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = " . (int)$adminid);
|
||||
}
|
||||
|
||||
return $this->admin_cache[$adminid];
|
||||
|
||||
@@ -33,17 +33,18 @@ class lighttpd
|
||||
private $logger = false;
|
||||
private $debugHandler = false;
|
||||
private $idnaConvert = false;
|
||||
private $settings = array();
|
||||
|
||||
// protected
|
||||
|
||||
public $needed_htpasswds = array();
|
||||
public $auth_backend_loaded = false;
|
||||
public $htpasswd_files = array();
|
||||
public $mod_accesslog_loaded = "0";
|
||||
protected $settings = array();
|
||||
protected $lighttpd_data = array();
|
||||
protected $needed_htpasswds = array();
|
||||
protected $auth_backend_loaded = false;
|
||||
protected $htpasswd_files = array();
|
||||
protected $mod_accesslog_loaded = "0";
|
||||
|
||||
function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
|
||||
|
||||
public function __construct($db, $logger, $debugHandler, $idnaConvert, $settings)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->logger = $logger;
|
||||
@@ -52,6 +53,11 @@ class lighttpd
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
protected function getDB()
|
||||
{
|
||||
return $this->db;
|
||||
}
|
||||
|
||||
public function reload()
|
||||
{
|
||||
fwrite($this->debugHandler, ' lighttpd::reload: reloading lighttpd' . "\n");
|
||||
@@ -80,6 +86,12 @@ 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_froxlor_ipandport_' . trim(str_replace(':', '.', $row_ipsandports['ip']), '.') . '.' . $row_ipsandports['port'] . '.conf');
|
||||
|
||||
if(!isset($this->lighttpd_data[$vhosts_filename]))
|
||||
{
|
||||
$this->lighttpd_data[$vhosts_filename] = '';
|
||||
}
|
||||
|
||||
$this->lighttpd_data[$vhost_filename].= '$SERVER["socket"] == "' . $ip . ':' . $port . '" {' . "\n";
|
||||
|
||||
if($row_ipsandports['listen_statement'] == '1')
|
||||
@@ -87,7 +99,7 @@ class lighttpd
|
||||
$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";
|
||||
@@ -153,11 +165,11 @@ class lighttpd
|
||||
return $htaccess_text;
|
||||
}
|
||||
|
||||
function createVirtualHosts()
|
||||
public function createVirtualHosts()
|
||||
{
|
||||
}
|
||||
|
||||
function createFileDirOptions()
|
||||
public function createFileDirOptions()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -575,7 +587,7 @@ class lighttpd
|
||||
}
|
||||
}
|
||||
|
||||
private function wipeOutOldConfigs()
|
||||
protected function wipeOutOldConfigs()
|
||||
{
|
||||
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']);
|
||||
|
||||
@@ -72,22 +72,22 @@ class lighttpd_fcgid extends lighttpd
|
||||
{
|
||||
$php_options_text.= "\t".'".'.$f_extension.'" => ('."\n";
|
||||
$php_options_text.= "\t\t".'"localhost" => ('."\n";
|
||||
$php_options_text.= "\t\t".'"socket" => "/var/run/lighttpd/'.$domain['loginname'].'-php.socket",'."\n";
|
||||
$php_options_text.= "\t\t".'"socket" => "/var/run/lighttpd/'.$domain['loginname'].'-'.$domain['domain'].'-php.socket",'."\n";
|
||||
$php_options_text.= "\t\t".'"bin-path" => "'.$phpconfig['binary'].' -c '.$phpini_filename.'",'."\n";
|
||||
$php_options_text.= "\t\t".'"bin-environment" => ('."\n";
|
||||
if((int)$domain['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$domain['mod_fcgid_starter'] . '"'."\n";
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$domain['mod_fcgid_starter'] . '",'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$phpconfig['mod_fcgid_starter'] != - 1)
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$phpconfig['mod_fcgid_starter'] . '"'."\n";
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$phpconfig['mod_fcgid_starter'] . '",'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$this->settings['system']['mod_fcgid_starter'] . '"'."\n";
|
||||
$php_options_text.= "\t\t\t".'"PHP_FCGI_CHILDREN" => "' . (int)$this->settings['system']['mod_fcgid_starter'] . '",'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ class lighttpd_fcgid extends lighttpd
|
||||
|
||||
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);
|
||||
$this->php_configs_cache[$php_config_id] = $this->getDB()->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$php_config_id);
|
||||
}
|
||||
|
||||
return $this->php_configs_cache[$php_config_id];
|
||||
@@ -276,7 +276,7 @@ class lighttpd_fcgid extends lighttpd
|
||||
|
||||
if(!isset($this->admin_cache[$adminid]))
|
||||
{
|
||||
$this->admin_cache[$adminid] = $this->db->query_first("SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = " . (int)$adminid);
|
||||
$this->admin_cache[$adminid] = $this->getDB()->query_first("SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = " . (int)$adminid);
|
||||
}
|
||||
|
||||
return $this->admin_cache[$adminid];
|
||||
|
||||
Reference in New Issue
Block a user