Merging my branch and d00ps branches to trunk

This commit is contained in:
Florian Aders (EleRas)
2010-01-22 07:43:29 +00:00
parent 8c55dd6c21
commit eeec43ebd7
119 changed files with 1137 additions and 1589 deletions

View File

@@ -2924,7 +2924,7 @@ class ApsParser
$Groupname = '';
}
$Value = GetInstallationValue($PackageId, $CustomerId, strval($Setting['id']));
$Value = self::GetInstallationValue($PackageId, $CustomerId, strval($Setting['id']));
if($Value)
{

View File

@@ -135,7 +135,7 @@ class ticket
private function readData()
{
if(isset($this->tid)
&& $this->tid != - 1)
&& $this->tid != - 1)
{
$_ticket = $this->db->query_first('SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = "' . $this->tid . '"');
$this->Set('customer', $_ticket['customerid'], true, false);
@@ -161,7 +161,7 @@ class ticket
public function Insert()
{
$this->db->query("INSERT INTO `" . TABLE_PANEL_TICKETS . "`
$this->db->query("INSERT INTO `" . TABLE_PANEL_TICKETS . "`
(`customerid`,
`adminid`,
`category`,
@@ -201,7 +201,7 @@ class ticket
{
// Update "main" ticket
$this->db->query('UPDATE `' . TABLE_PANEL_TICKETS . '` SET
$this->db->query('UPDATE `' . TABLE_PANEL_TICKETS . '` SET
`priority` = "' . (int)$this->Get('priority') . '",
`lastchange` = "' . (int)$this->Get('lastchange') . '",
`status` = "' . (int)$this->Get('status') . '",
@@ -256,7 +256,7 @@ class ticket
{
// Get e-mail message for customer
$usr = $this->db->query_first('SELECT `name`, `firstname`, `email`
$usr = $this->db->query_first('SELECT `name`, `firstname`, `email`
FROM `' . TABLE_PANEL_CUSTOMERS . '`
WHERE `customerid` = "' . (int)$customerid . '"');
$replace_arr = array(
@@ -272,13 +272,13 @@ class ticket
);
}
$result = $this->db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
$result = $this->db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
WHERE `adminid`=\'' . (int)$this->userinfo['adminid'] . '\'
AND `language`=\'' . $this->db->escape($this->userinfo['def_language']) . '\'
AND `templategroup`=\'mails\'
AND `varname`=\'' . $template_subject . '\'');
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $default_subject), $replace_arr));
$result = $this->db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
$result = $this->db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
WHERE `adminid`=\'' . (int)$this->userinfo['adminid'] . '\'
AND `language`=\'' . $this->db->escape($this->userinfo['def_language']) . '\'
AND `templategroup`=\'mails\'
@@ -325,7 +325,7 @@ class ticket
static public function addCategory($_db, $_category = null, $_admin = 1)
{
if($_category != null
&& $_category != '')
&& $_category != '')
{
$_db->query('INSERT INTO `' . TABLE_PANEL_TICKET_CATS . '` (`name`, `adminid`) VALUES ("' . $_db->escape($_category) . '", "' . (int)$_admin . '")');
return true;
@@ -341,10 +341,10 @@ class ticket
static public function editCategory($_db, $_category = null, $_id = 0)
{
if($_category != null
&& $_category != ''
&& $_id != 0)
&& $_category != ''
&& $_id != 0)
{
$_db->query('UPDATE `' . TABLE_PANEL_TICKET_CATS . '` SET `name` = "' . $_db->escape($_category) . '"
$_db->query('UPDATE `' . TABLE_PANEL_TICKET_CATS . '` SET `name` = "' . $_db->escape($_category) . '"
WHERE `id` = "' . (int)$_id . '"');
return true;
}
@@ -360,7 +360,7 @@ class ticket
{
if($_id != 0)
{
$result = $_db->query_first('SELECT COUNT(`id`) as `numtickets` FROM `' . TABLE_PANEL_TICKETS . '`
$result = $_db->query_first('SELECT COUNT(`id`) as `numtickets` FROM `' . TABLE_PANEL_TICKETS . '`
WHERE `category` = "' . (int)$_id . '"');
if($result['numtickets'] == "0")
@@ -402,7 +402,7 @@ class ticket
{
$archived = array();
$counter = 0;
$result = $_db->query('SELECT *,
$result = $_db->query('SELECT *,
(SELECT COUNT(`sub`.`id`)
FROM `' . TABLE_PANEL_TICKETS . '` `sub`
WHERE `sub`.`answerto` = `main`.`id`) as `ticket_answers`
@@ -446,42 +446,42 @@ class ticket
static public function getArchiveSearchStatement($subject = NULL, $priority = NULL, $fromdate = NULL, $todate = NULL, $message = NULL, $customer = - 1, $admin = 1, $categories = NULL)
{
$query = 'SELECT `main`.*,
$query = 'SELECT `main`.*,
(SELECT COUNT(`sub`.`id`) FROM `' . TABLE_PANEL_TICKETS . '` `sub`
WHERE `sub`.`answerto` = `main`.`id`) as `ticket_answers`
FROM `' . TABLE_PANEL_TICKETS . '` `main`
WHERE `main`.`archived` = "1" AND `main`.`answerto` = "0" AND `main`.`adminid` = "' . (int)$admin . '"';
if($subject != NULL
&& $subject != '')
&& $subject != '')
{
$query.= 'AND `main`.`subject` LIKE "%' . $subject . '%" ';
}
if($priority != NULL
&& isset($priority[0])
&& $priority[0] != '')
&& isset($priority[0])
&& $priority[0] != '')
{
if(isset($priority[1])
&& $priority[1] != '')
&& $priority[1] != '')
{
if(isset($priority[2])
&& $priority[2] != '')
&& $priority[2] != '')
{
$query.= 'AND (`main`.`priority` = "1"
$query.= 'AND (`main`.`priority` = "1"
OR `main`.`priority` = "2"
OR `main`.`priority` = "3") ';
}
else
{
$query.= 'AND (`main`.`priority` = "1"
$query.= 'AND (`main`.`priority` = "1"
OR `main`.`priority` = "2") ';
}
}
elseif(isset($priority[2])
&& $priority[2] != '')
&& $priority[2] != '')
{
$query.= 'AND (`main`.`priority` = "1"
$query.= 'AND (`main`.`priority` = "1"
OR `main`.`priority` = "3") ';
}
else
@@ -490,13 +490,13 @@ class ticket
}
}
elseif($priority != NULL
&& isset($priority[1])
&& $priority[1] != '')
&& isset($priority[1])
&& $priority[1] != '')
{
if(isset($priority[2])
&& $priority[2] != '')
&& $priority[2] != '')
{
$query.= 'AND (`main`.`priority` = "2"
$query.= 'AND (`main`.`priority` = "2"
OR `main`.`priority` = "3") ';
}
else
@@ -507,26 +507,26 @@ class ticket
elseif($priority != NULL)
{
if(isset($priority[3])
&& $priority[3] != '')
&& $priority[3] != '')
{
$query.= 'AND `main`.`priority` = "3" ';
}
}
if($fromdate != NULL
&& $fromdate > 0)
&& $fromdate > 0)
{
$query.= 'AND `main`.`lastchange` > "' . $fromdate . '" ';
}
if($todate != NULL
&& $todate > 0)
&& $todate > 0)
{
$query.= 'AND `main`.`lastchange` < "' . $todate . '" ';
}
if($message != NULL
&& $message != '')
&& $message != '')
{
$query.= 'AND `main`.`message` LIKE "%' . $message . '%" ';
}
@@ -546,7 +546,7 @@ class ticket
foreach($categories as $catid)
{
if(isset($catid)
&& $catid > 0)
&& $catid > 0)
{
$query.= '`main`.`category` = "' . $catid . '" OR ';
}
@@ -605,6 +605,27 @@ class ticket
}
}
private function convertLatin1ToHtml($str)
{
$html_entities = array (
"<EFBFBD>" => "&Auml;",
"<EFBFBD>" => "&auml;",
"<EFBFBD>" => "&Ouml;",
"<EFBFBD>" => "&ouml;",
"<EFBFBD>" => "&Uuml;",
"<EFBFBD>" => "&uuml;",
"<EFBFBD>" => "&szlig;"
/*
* @TODO continue this table for all the special-characters
*/
);
foreach ($html_entities as $key => $value) {
$str = str_replace($key, $value, $str);
}
return $str;
}
/**
* Get a data-var
*/
@@ -643,7 +664,7 @@ class ticket
public function Set($_var = '', $_value = '', $_vartrusted = false, $_valuetrusted = false)
{
if($_var != ''
&& $_value != '')
&& $_value != '')
{
if(!$_vartrusted)
{
@@ -655,6 +676,11 @@ class ticket
$_value = htmlspecialchars($_value);
}
if(strtolower($_var) == 'message' || strtolower($_var) == 'subject')
{
$_value = $this->convertLatin1ToHtml($_value);
}
$this->t_data[$_var] = $_value;
}
}

View File

@@ -61,7 +61,7 @@ return Array(
'label' => 'PowerDNS',
'files' => Array(
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
'etc_powerdns_pdns-syscp.conf' => '/etc/powerdns/pdns_syscp.conf',
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
),
'restart' => Array(
'/etc/init.d/pdns restart'
@@ -121,14 +121,14 @@ return Array(
),
'files' => Array(
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
'etc_exim4_conf.d_auth_30_syscp-config' => '/etc/exim4/conf.d/auth/30_syscp-config',
'etc_exim4_conf.d_main_10_syscp-config_options' => '/etc/exim4/conf.d/main/10_syscp-config_options',
'etc_exim4_conf.d_router_180_syscp-config' => '/etc/exim4/conf.d/router/180_syscp-config',
'etc_exim4_conf.d_transport_30_syscp-config' => '/etc/exim4/conf.d/transport/30_syscp-config'
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
),
'commands_2' => Array(
'chmod o-rx /var/lib/exim4',
'chmod o-rx /etc/exim4/conf.d/main/10_syscp-config_options'
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
),
'restart' => Array(
'/etc/init.d/exim4 restart'
@@ -210,20 +210,19 @@ return Array(
'cron' => Array(
'label' => 'Crond (cronscript)',
'files' => Array(
'etc_cron.d_syscp' => '/etc/cron.d/syscp'
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
),
'restart' => Array(
'/etc/init.d/cron restart'
)
),
'xinetd' => Array(
'label' => 'xinet.d (syscp updates in realtime)',
'label' => 'xinet.d (froxlor updates in realtime)',
'commands' => Array(
'apt-get install xinetd',
'echo -e "syscp ' . $settings['system']['realtime_port'] . '/tcp # SysCP Realtime" >> /etc/services'
'apt-get install xinetd'
),
'files' => Array(
'etc_xinet.d_syscp' => '/etc/xinetd.d/syscp'
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
@@ -232,12 +231,12 @@ return Array(
'awstats' => Array(
'label' => 'Awstats',
'files' => Array(
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.syscp' : 'etc_awstats_awstats.model.conf.syscp') => '/etc/awstats/awstats.model.conf.syscp',
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_syscp-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/syscp-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
),
'commands' => Array(
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"syscp-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
),
'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')

View File

@@ -220,18 +220,12 @@ milter_default_action = accept\n" >> /etc/postfix/main.cf'
'cron' => Array(
'label' => 'Crond (cronscript)',
'files' => Array(
'etc_php_syscp-cronjob_php.ini' => '/etc/php/syscp-cronjob/php.ini',
'etc_cron.d_syscp' => '/etc/cron.d/syscp'
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
),
'commands' => Array(
'touch /etc/cron.d/syscp',
'chown root:0 /etc/cron.d/syscp',
'chmod 0640 /etc/cron.d/syscp',
'mkdir -p /etc/php/syscp-cronjob',
'touch /etc/php/syscp-cronjob/php.ini',
'chown -R root:0 /etc/php/syscp-cronjob',
'chmod 0750 /etc/php/syscp-cronjob',
'chmod 0640 /etc/php/syscp-cronjob/php.ini'
'touch /etc/cron.d/froxlor',
'chown root:0 /etc/cron.d/froxlor',
'chmod 0640 /etc/cron.d/froxlor',
),
'restart' => Array(
'rc-update add vixie-cron default',
@@ -239,13 +233,12 @@ milter_default_action = accept\n" >> /etc/postfix/main.cf'
)
),
'xinetd' => Array(
'label' => 'xinet.d (syscp updates in realtime)',
'label' => 'xinet.d (froxlor updates in realtime)',
'commands' => Array(
'emerge -av xinetd',
'echo -e "syscp ' . $settings['system']['realtime_port'] . '/tcp # SysCP Realtime" >> /etc/services'
'emerge -av xinetd'
),
'files' => Array(
'etc_xinet.d_syscp' => '/etc/xinetd.d/syscp'
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
@@ -254,12 +247,12 @@ milter_default_action = accept\n" >> /etc/postfix/main.cf'
'awstats' => Array(
'label' => 'Awstats',
'files' => Array(
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.syscp' : 'etc_awstats_awstats.model.conf.syscp') => '/etc/awstats/awstats.model.conf.syscp',
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_syscp-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/syscp-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
),
'commands' => Array(
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"syscp-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
),
'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')

View File

@@ -60,7 +60,7 @@ return Array(
'label' => 'PowerDNS',
'files' => Array(
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
'etc_powerdns_pdns-syscp.conf' => '/etc/powerdns/pdns_syscp.conf',
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
),
'restart' => Array(
'/etc/init.d/pdns restart'
@@ -121,14 +121,14 @@ return Array(
),
'files' => Array(
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
'etc_exim4_conf.d_auth_30_syscp-config' => '/etc/exim4/conf.d/auth/30_syscp-config',
'etc_exim4_conf.d_main_10_syscp-config_options' => '/etc/exim4/conf.d/main/10_syscp-config_options',
'etc_exim4_conf.d_router_180_syscp-config' => '/etc/exim4/conf.d/router/180_syscp-config',
'etc_exim4_conf.d_transport_30_syscp-config' => '/etc/exim4/conf.d/transport/30_syscp-config'
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
),
'commands_2' => Array(
'chmod o-rx /var/lib/exim4',
'chmod o-rx /etc/exim4/conf.d/main/10_syscp-config_options'
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
),
'restart' => Array(
'/etc/init.d/exim4 restart'
@@ -204,20 +204,19 @@ return Array(
'cron' => Array(
'label' => 'Crond (cronscript)',
'files' => Array(
'etc_cron.d_syscp' => '/etc/cron.d/syscp'
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
),
'restart' => Array(
'/etc/init.d/cron restart'
)
),
'xinetd' => Array(
'label' => 'xinet.d (syscp updates in realtime)',
'label' => 'xinet.d (froxlor updates in realtime)',
'commands' => Array(
'apt-get install xinetd',
'echo -e "syscp ' . $settings['system']['realtime_port'] . '/tcp # SysCP Realtime" >> /etc/services'
'apt-get install xinetd'
),
'files' => Array(
'etc_xinet.d_syscp' => '/etc/xinetd.d/syscp'
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
@@ -226,12 +225,12 @@ return Array(
'awstats' => Array(
'label' => 'Awstats',
'files' => Array(
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.syscp' : 'etc_awstats_awstats.model.conf.syscp') => '/etc/awstats/awstats.model.conf.syscp',
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_syscp-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/syscp-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
),
'commands' => Array(
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"syscp-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
),
'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')

View File

@@ -61,7 +61,7 @@ return Array(
'label' => 'PowerDNS',
'files' => Array(
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
'etc_powerdns_pdns-syscp.conf' => '/etc/powerdns/pdns_syscp.conf',
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
),
'restart' => Array(
'/etc/init.d/pdns restart'
@@ -121,14 +121,14 @@ return Array(
),
'files' => Array(
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
'etc_exim4_conf.d_auth_30_syscp-config' => '/etc/exim4/conf.d/auth/30_syscp-config',
'etc_exim4_conf.d_main_10_syscp-config_options' => '/etc/exim4/conf.d/main/10_syscp-config_options',
'etc_exim4_conf.d_router_180_syscp-config' => '/etc/exim4/conf.d/router/180_syscp-config',
'etc_exim4_conf.d_transport_30_syscp-config' => '/etc/exim4/conf.d/transport/30_syscp-config'
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
),
'commands_2' => Array(
'chmod o-rx /var/lib/exim4',
'chmod o-rx /etc/exim4/conf.d/main/10_syscp-config_options'
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
),
'restart' => Array(
'/etc/init.d/exim4 restart'
@@ -211,20 +211,19 @@ return Array(
'cron' => Array(
'label' => 'Crond (cronscript)',
'files' => Array(
'etc_cron.d_syscp' => '/etc/cron.d/syscp'
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
),
'restart' => Array(
'/etc/init.d/cron restart'
)
),
'xinetd' => Array(
'label' => 'xinet.d (syscp updates in realtime)',
'label' => 'xinet.d (froxlor updates in realtime)',
'commands' => Array(
'apt-get install xinetd',
'echo -e "syscp ' . $settings['system']['realtime_port'] . '/tcp # SysCP Realtime" >> /etc/services'
'apt-get install xinetd'
),
'files' => Array(
'etc_xinet.d_syscp' => '/etc/xinetd.d/syscp'
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
@@ -233,12 +232,12 @@ return Array(
'awstats' => Array(
'label' => 'Awstats',
'files' => Array(
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.syscp' : 'etc_awstats_awstats.model.conf.syscp') => '/etc/awstats/awstats.model.conf.syscp',
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_syscp-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/syscp-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
),
'commands' => Array(
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"syscp-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
),
'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')

View File

@@ -110,7 +110,7 @@ return Array(
'cron' => Array(
'label' => 'Crond (cronscript)',
'files' => Array(
'etc_cron.d_syscp' => '/etc/cron.d/syscp'
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
),
'restart' => Array(
'/etc/init.d/cron restart'
@@ -119,12 +119,12 @@ return Array(
'awstats' => Array(
'label' => 'Awstats',
'files' => Array(
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.syscp' : 'etc_awstats_awstats.model.conf.syscp') => '/etc/awstats/awstats.model.conf.syscp',
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_syscp-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/syscp-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
),
'commands' => Array(
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"syscp-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
),
'restart' => Array(
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')

View File

@@ -1,19 +1,19 @@
<?php
/**
* This file is part of the SysCP project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* This file is part of the Froxlor project.
* Copyright (c) 2009-2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Florian Lippert <flo@syscp.org>
* @author Florian Aders <eleras@syscp.org>
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
* @author Michael Kaufmann <d00p@froxlor.org>
* @author Florian Aders <eleras@froxlor.org>
* @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
*/

View File

@@ -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

View File

@@ -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);
}
}