migrate more stuff to new Settings class, refs #1325
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -17,8 +17,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
global $settings;
|
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'dkim' => array(
|
'dkim' => array(
|
||||||
@@ -82,8 +80,8 @@ return array(
|
|||||||
),
|
),
|
||||||
'dkim_keylength' => array(
|
'dkim_keylength' => array(
|
||||||
'label' => array(
|
'label' => array(
|
||||||
'title' => $lng['dkim']['dkim_keylength']['title'],
|
'title' => $lng['dkim']['dkim_keylength']['title'],
|
||||||
'description' => sprintf($lng['dkim']['dkim_keylength']['description'],$settings['dkim']['dkim_prefix'])
|
'description' => sprintf($lng['dkim']['dkim_keylength']['description'],Settings::Get('dkim.dkim_prefix'))
|
||||||
),
|
),
|
||||||
'settinggroup' => 'dkim',
|
'settinggroup' => 'dkim',
|
||||||
'varname' => 'dkim_keylength',
|
'varname' => 'dkim_keylength',
|
||||||
@@ -133,4 +131,4 @@ return array(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -21,13 +21,12 @@ if (isFroxlorVersion('0.9-r0')) {
|
|||||||
showUpdateStep("Performing database updates");
|
showUpdateStep("Performing database updates");
|
||||||
|
|
||||||
// add missing database-updates if necessary (old: update/update_database.php)
|
// add missing database-updates if necessary (old: update/update_database.php)
|
||||||
if (isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 1) {
|
if (Settings::Get('system.dbversion') !== null && (int)Settings::Get('system.dbversion') < 1) {
|
||||||
Database::query("
|
Database::query("
|
||||||
ALTER TABLE `panel_databases` ADD `dbserver` INT( 11 ) UNSIGNED NOT NULL default '0';"
|
ALTER TABLE `panel_databases` ADD `dbserver` INT( 11 ) UNSIGNED NOT NULL default '0';"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if(isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 2)
|
if (Settings::Get('system.dbversion') !== null && (int)Settings::Get('system.dbversion') < 2) {
|
||||||
{
|
|
||||||
Database::query("ALTER TABLE `panel_ipsandports` CHANGE `ssl_cert` `ssl_cert_file` VARCHAR( 255 ) NOT NULL,
|
Database::query("ALTER TABLE `panel_ipsandports` CHANGE `ssl_cert` `ssl_cert_file` VARCHAR( 255 ) NOT NULL,
|
||||||
ADD `ssl_key_file` VARCHAR( 255 ) NOT NULL,
|
ADD `ssl_key_file` VARCHAR( 255 ) NOT NULL,
|
||||||
ADD `ssl_ca_file` VARCHAR( 255 ) NOT NULL,
|
ADD `ssl_ca_file` VARCHAR( 255 ) NOT NULL,
|
||||||
@@ -181,22 +180,19 @@ if (isFroxlorVersion('0.9-r0')) {
|
|||||||
|
|
||||||
if (isFroxlorVersion('0.9-r1')) {
|
if (isFroxlorVersion('0.9-r1')) {
|
||||||
showUpdateStep("Updating from 0.9-r1 to 0.9-r2", false);
|
showUpdateStep("Updating from 0.9-r1 to 0.9-r2", false);
|
||||||
showUpdateStep("Updating settings table");
|
|
||||||
|
|
||||||
|
showUpdateStep("Updating settings table");
|
||||||
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'use_spf', '0');");
|
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'use_spf', '0');");
|
||||||
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'spf_entry', '@ IN TXT \"v=spf1 a mx -all\"');");
|
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'spf_entry', '@ IN TXT \"v=spf1 a mx -all\"');");
|
||||||
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'froxlor_graphic' WHERE `varname` = 'syscp_graphic'");
|
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'froxlor_graphic' WHERE `varname` = 'syscp_graphic'");
|
||||||
|
|
||||||
if(isset($settings['admin']['syscp_graphic'])
|
if (Settings::Get('admin.syscp_graphic') !== null
|
||||||
&& $settings['admin']['syscp_graphic'] != ''
|
&& Settings::Get('admin.syscp_graphic') != ''
|
||||||
){
|
){
|
||||||
$settings['admin']['froxlor_graphic'] = $settings['admin']['syscp_graphic'];
|
Settings::Set('admin.froxlor_graphic', Settings::Get('admin.syscp_graphic'));
|
||||||
|
} else {
|
||||||
|
Settings::Set('admin.froxlor_graphic', 'images/header.gif');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$settings['admin']['froxlor_graphic'] = 'images/header.gif';
|
|
||||||
}
|
|
||||||
|
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
updateToVersion('0.9-r2');
|
updateToVersion('0.9-r2');
|
||||||
@@ -236,19 +232,19 @@ if (isFroxlorVersion('0.9-r3')) {
|
|||||||
|
|
||||||
// checking for active ticket-module
|
// checking for active ticket-module
|
||||||
$ticket_active = 0;
|
$ticket_active = 0;
|
||||||
if ((int)$settings['ticket']['enabled'] == 1) {
|
if ((int)Settings::Get('ticket.enabled') == 1) {
|
||||||
$ticket_active = 1;
|
$ticket_active = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// checking for active aps-module
|
// checking for active aps-module
|
||||||
$aps_active = 0;
|
$aps_active = 0;
|
||||||
if ((int)$settings['aps']['aps_active'] == 1) {
|
if ((int)Settings::Get('aps.aps_active') == 1) {
|
||||||
$aps_active = 1;
|
$aps_active = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// checking for active autoresponder-module
|
// checking for active autoresponder-module
|
||||||
$ar_active = 0;
|
$ar_active = 0;
|
||||||
if ((int)$settings['autoresponder']['autoresponder_active'] == 1) {
|
if ((int)Settings::Get('autoresponder.autoresponder_active') == 1) {
|
||||||
$ar_active = 1;
|
$ar_active = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,7 +293,7 @@ if (isFroxlorVersion('0.9.1')) {
|
|||||||
|
|
||||||
if (isset($result['latestguid'])
|
if (isset($result['latestguid'])
|
||||||
&& (int)$result['latestguid'] > 0
|
&& (int)$result['latestguid'] > 0
|
||||||
&& $result['latestguid'] != $settings['system']['lastguid']
|
&& $result['latestguid'] != Settings::Get('system.lastguid')
|
||||||
) {
|
) {
|
||||||
checkLastGuid();
|
checkLastGuid();
|
||||||
lastStepStatus(1, 'fixed');
|
lastStepStatus(1, 'fixed');
|
||||||
@@ -399,22 +395,22 @@ if (isFroxlorVersion('0.9.4')) {
|
|||||||
* because we already had this back in older versions.
|
* because we already had this back in older versions.
|
||||||
* To not confuse Froxlor, we just update old settings.
|
* To not confuse Froxlor, we just update old settings.
|
||||||
*/
|
*/
|
||||||
if(isset($settings['system']['awstats_path'])
|
if(Settings::Get('system.awstats_path') !== null
|
||||||
&& $settings['system']['awstats_path'] != ''
|
&& Settings::Get('system.awstats_path') != ''
|
||||||
) {
|
) {
|
||||||
showUpdateStep("Updating awstats path setting");
|
showUpdateStep("Updating awstats path setting");
|
||||||
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/usr/bin/' WHERE `settinggroup` = 'system' AND `varname` = 'awstats_path';");
|
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/usr/bin/' WHERE `settinggroup` = 'system' AND `varname` = 'awstats_path';");
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
}
|
}
|
||||||
elseif(!isset($settings['system']['awstats_path']))
|
elseif(Settings::Get('system.awstats_path') == null)
|
||||||
{
|
{
|
||||||
showUpdateStep("Adding new awstats path setting");
|
showUpdateStep("Adding new awstats path setting");
|
||||||
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_path', '/usr/bin/');");
|
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_path', '/usr/bin/');");
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($settings['system']['awstats_domain_file'])
|
if(Settings::Get('system.awstats_domain_file') !== null
|
||||||
&& $settings['system']['awstats_domain_file'] != ''
|
&& Settings::Get('system.awstats_domain_file') != ''
|
||||||
) {
|
) {
|
||||||
showUpdateStep("Updating awstats configuration path setting");
|
showUpdateStep("Updating awstats configuration path setting");
|
||||||
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'awstats_conf' WHERE `varname` = 'awstats_domain_file';");
|
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'awstats_conf' WHERE `varname` = 'awstats_domain_file';");
|
||||||
@@ -635,7 +631,7 @@ if (isFroxlorVersion('0.9.6-svn5')) {
|
|||||||
while ($row_ftp_users = $result_ftp_users_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($row_ftp_users = $result_ftp_users_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$result_ftp_quota_stmt = Database::query("
|
$result_ftp_quota_stmt = Database::query("
|
||||||
SELECT diskspace_used FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
SELECT diskspace_used FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||||
WHERE loginname = SUBSTRING_INDEX('" . $row_ftp_users['username'] . "', '" . $settings['customer']['ftpprefix'] . "', 1);"
|
WHERE loginname = SUBSTRING_INDEX('" . $row_ftp_users['username'] . "', '" . Settings::Get('customer.ftpprefix') . "', 1);"
|
||||||
);
|
);
|
||||||
$row_ftp_quota = $result_ftp_quota_stmt->fetch(PDO::FETCH_ASSOC);
|
$row_ftp_quota = $result_ftp_quota_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
Database::query("INSERT INTO `ftp_quotatallies` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $row_ftp_users['username'] . "', 'user', '" . $row_ftp_quota[0] . "'*1024, '0', '0', '0', '0', '0');");
|
Database::query("INSERT INTO `ftp_quotatallies` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $row_ftp_users['username'] . "', 'user', '" . $row_ftp_quota[0] . "'*1024, '0', '0', '0', '0', '0');");
|
||||||
@@ -697,13 +693,13 @@ if (isFroxlorVersion('0.9.6')) {
|
|||||||
|
|
||||||
// need to fix default-error-copy-and-paste-shizzle
|
// need to fix default-error-copy-and-paste-shizzle
|
||||||
showUpdateStep("Checking if anything is ok with the default-error-handler");
|
showUpdateStep("Checking if anything is ok with the default-error-handler");
|
||||||
if (!isset($settings['defaultwebsrverrhandler']['err404'])) {
|
if (Settings::Get('defaultwebsrverrhandler.err404') == null) {
|
||||||
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err404', '');");
|
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err404', '');");
|
||||||
}
|
}
|
||||||
if (!isset($settings['defaultwebsrverrhandler']['err403'])) {
|
if (Settings::Get('defaultwebsrverrhandler.err403') == null) {
|
||||||
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err403', '');");
|
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err403', '');");
|
||||||
}
|
}
|
||||||
if (!isset($settings['defaultwebsrverrhandler']['err401'])) {
|
if (Settings::Get('defaultwebsrverrhandler.err401') == null) {
|
||||||
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err401', '');");
|
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err401', '');");
|
||||||
}
|
}
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
@@ -1009,7 +1005,7 @@ if (isFroxlorVersion('0.9.12-svn3')) {
|
|||||||
|
|
||||||
showUpdateStep("Updating from 0.9.12-svn3 to 0.9.12-svn4", false);
|
showUpdateStep("Updating from 0.9.12-svn3 to 0.9.12-svn4", false);
|
||||||
|
|
||||||
$update_awstats_awstatspath = isset($_POST['update_awstats_awstatspath']) ? makeCorrectDir($_POST['update_awstats_awstatspath']) : $settings['system']['awstats_path'];
|
$update_awstats_awstatspath = isset($_POST['update_awstats_awstatspath']) ? makeCorrectDir($_POST['update_awstats_awstatspath']) : Settings::Get('system.awstats_path');
|
||||||
|
|
||||||
showUpdateStep("Adding new settings for awstats");
|
showUpdateStep("Adding new settings for awstats");
|
||||||
$stmt = Database::prepare("
|
$stmt = Database::prepare("
|
||||||
@@ -1066,7 +1062,7 @@ if (isFroxlorVersion('0.9.12')) {
|
|||||||
Database::query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` ADD `email_autoresponder_used` int(5) NOT NULL default '0' AFTER `email_autoresponder`;");
|
Database::query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` ADD `email_autoresponder_used` int(5) NOT NULL default '0' AFTER `email_autoresponder`;");
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
if ((int)$settings['autoresponder']['autoresponder_active'] == 1) {
|
if ((int)Settings::Get('autoresponder.autoresponder_active') == 1) {
|
||||||
$update_autoresponder_default = isset($_POST['update_autoresponder_default']) ? intval_ressource($_POST['update_autoresponder_default']) : 0;
|
$update_autoresponder_default = isset($_POST['update_autoresponder_default']) ? intval_ressource($_POST['update_autoresponder_default']) : 0;
|
||||||
if (isset($_POST['update_autoresponder_default_ul'])) {
|
if (isset($_POST['update_autoresponder_default_ul'])) {
|
||||||
$update_autoresponder_default = -1;
|
$update_autoresponder_default = -1;
|
||||||
@@ -1121,9 +1117,9 @@ if (isFroxlorVersion('0.9.14-svn1')) {
|
|||||||
if (isFroxlorVersion('0.9.13.1')) {
|
if (isFroxlorVersion('0.9.13.1')) {
|
||||||
showUpdateStep("Updating from 0.9.13.1 to 0.9.14-svn2", false);
|
showUpdateStep("Updating from 0.9.13.1 to 0.9.14-svn2", false);
|
||||||
|
|
||||||
if ($settings['ticket']['enabled'] == '1') {
|
if (Settings::Get('ticket.enabled') == '1') {
|
||||||
showUpdateStep("Setting INTERVAL for used-tickets cronjob");
|
showUpdateStep("Setting INTERVAL for used-tickets cronjob");
|
||||||
setCycleOfCronjob(null, null, $settings['ticket']['reset_cycle'], null);
|
setCycleOfCronjob(null, null, Settings::Get('ticket.reset_cycle'), null);
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
}
|
}
|
||||||
updateToVersion('0.9.14-svn2');
|
updateToVersion('0.9.14-svn2');
|
||||||
@@ -1132,7 +1128,7 @@ if (isFroxlorVersion('0.9.13.1')) {
|
|||||||
if (isFroxlorVersion('0.9.14-svn2')) {
|
if (isFroxlorVersion('0.9.14-svn2')) {
|
||||||
showUpdateStep("Updating from 0.9.14-svn2 to 0.9.14-svn3", false);
|
showUpdateStep("Updating from 0.9.14-svn2 to 0.9.14-svn3", false);
|
||||||
|
|
||||||
$update_awstats_icons = isset($_POST['update_awstats_icons']) ? makeCorrectDir($_POST['update_awstats_icons']) : $settings['system']['awstats_icons'];
|
$update_awstats_icons = isset($_POST['update_awstats_icons']) ? makeCorrectDir($_POST['update_awstats_icons']) : Settings::Get('system.awstats_icons');
|
||||||
|
|
||||||
showUpdateStep("Adding AWStats icons path to the settings");
|
showUpdateStep("Adding AWStats icons path to the settings");
|
||||||
$stmt = Database::prepare("
|
$stmt = Database::prepare("
|
||||||
@@ -1504,7 +1500,7 @@ if (isFroxlorVersion('0.9.17')) {
|
|||||||
`varname` = 'httpgroup',
|
`varname` = 'httpgroup',
|
||||||
`value` = :value"
|
`value` = :value"
|
||||||
);
|
);
|
||||||
Database::pexecute($stmt, array('value' => $settings['system']['httpuser']));
|
Database::pexecute($stmt, array('value' => Settings::Get('system.httpuser')));
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1984,7 +1980,7 @@ if (isFroxlorVersion('0.9.28-svn3')) {
|
|||||||
showUpdateStep('Setting replacement for the discontinued and removed Classic theme (if active)', true);
|
showUpdateStep('Setting replacement for the discontinued and removed Classic theme (if active)', true);
|
||||||
|
|
||||||
// Updating default theme setting
|
// Updating default theme setting
|
||||||
if ($settings['panel']['default_theme'] == 'Classic') {
|
if (Settings::Get('panel.default_theme') == 'Classic') {
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
|
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
|
||||||
`value` = :theme
|
`value` = :theme
|
||||||
@@ -2159,7 +2155,7 @@ if (isFroxlorVersion('0.9.28.1')) {
|
|||||||
// don't advertise security questions - just set a default silently
|
// don't advertise security questions - just set a default silently
|
||||||
Database::query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'passwordcryptfunc', '1');");
|
Database::query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'passwordcryptfunc', '1');");
|
||||||
|
|
||||||
$fastcgiparams = $settings['nginx']['fastcgiparams'];
|
$fastcgiparams = Settings::Get('nginx.fastcgiparams');
|
||||||
// check the faulty value explicitly
|
// check the faulty value explicitly
|
||||||
if ($fastcgiparams == '/etc/nginx/fastcgi_params/') {
|
if ($fastcgiparams == '/etc/nginx/fastcgi_params/') {
|
||||||
$fastcgiparams = makeCorrectFile(substr($fastcgiparams,0,-1));
|
$fastcgiparams = makeCorrectFile(substr($fastcgiparams,0,-1));
|
||||||
@@ -2272,9 +2268,9 @@ if (isFroxlorVersion('0.9.29-dev4')) {
|
|||||||
`varname` = :varname,
|
`varname` = :varname,
|
||||||
`value` = :value"
|
`value` = :value"
|
||||||
);
|
);
|
||||||
$dval = (isset($settings['system']['mod_fcgid_defaultini']) ? $settings['system']['mod_fcgid_defaultini'] : '1');
|
$dval = (Settings::Get('system.mod_fcgid_defaultini') !== null ? Settings::Get('system.mod_fcgid_defaultini') : '1');
|
||||||
Database::pexecute($stmt, array('varname' => 'defaultini', 'value' => $dval));
|
Database::pexecute($stmt, array('varname' => 'defaultini', 'value' => $dval));
|
||||||
$dval = (isset($settings['system']['mod_fcgid_ownvhost']) ? $settings['system']['mod_fcgid_ownvhost'] : '1');
|
$dval = (Settings::Get('system.mod_fcgid_ownvhost') !== null ? Settings::Get('system.mod_fcgid_ownvhost') : '1');
|
||||||
Database::pexecute($stmt, array('varname' => 'vhost_defaultini', 'value' => $dval));
|
Database::pexecute($stmt, array('varname' => 'vhost_defaultini', 'value' => $dval));
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
@@ -2434,11 +2430,11 @@ if (isFroxlorVersion('0.9.31-dev1')) {
|
|||||||
INSERT INTO `".TABLE_PANEL_SETTINGS."` SET `settinggroup` = 'phpfpm', `varname` = 'fastcgi_ipcdir', `value` = :value
|
INSERT INTO `".TABLE_PANEL_SETTINGS."` SET `settinggroup` = 'phpfpm', `varname` = 'fastcgi_ipcdir', `value` = :value
|
||||||
");
|
");
|
||||||
$params = array();
|
$params = array();
|
||||||
if ($settings['system']['webserver'] == 'apache2') {
|
if (Settings::Get('system.webserver') == 'apache2') {
|
||||||
$params['value'] = '/var/lib/apache2/fastcgi/';
|
$params['value'] = '/var/lib/apache2/fastcgi/';
|
||||||
} elseif ($settings['system']['webserver'] == 'lighttpd') {
|
} elseif (Settings::Get('system.webserver') == 'lighttpd') {
|
||||||
$params['value'] = '/var/run/lighttpd/';
|
$params['value'] = '/var/run/lighttpd/';
|
||||||
} elseif ($settings['system']['webserver'] == 'nginx') {
|
} elseif (Settings::Get('system.webserver') == 'nginx') {
|
||||||
$params['value'] = '/var/run/nginx/';
|
$params['value'] = '/var/run/nginx/';
|
||||||
}
|
}
|
||||||
Database::pexecute($ins_stmt, $params);
|
Database::pexecute($ins_stmt, $params);
|
||||||
@@ -2548,13 +2544,13 @@ if (isFroxlorVersion('0.9.31-rc2')) {
|
|||||||
");
|
");
|
||||||
$frxvhostconfid = Database::lastInsertId();
|
$frxvhostconfid = Database::lastInsertId();
|
||||||
// update default vhosts-config for froxlor if they are on the system-default
|
// update default vhosts-config for froxlor if they are on the system-default
|
||||||
if ($settings['system']['mod_fcgid_defaultini_ownvhost'] == '1') {
|
if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == '1') {
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = :value WHERE `settinggroup` = 'system' AND `varname` = 'mod_fcgid_defaultini_ownvhost'
|
UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = :value WHERE `settinggroup` = 'system' AND `varname` = 'mod_fcgid_defaultini_ownvhost'
|
||||||
");
|
");
|
||||||
Database::pexecute($upd_stmt, array('value' => $frxvhostconfid));
|
Database::pexecute($upd_stmt, array('value' => $frxvhostconfid));
|
||||||
}
|
}
|
||||||
if ($settings['phpfpm']['vhost_defaultini'] == '1') {
|
if (Settings::Get('phpfpm.vhost_defaultini') == '1') {
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = :value WHERE `settinggroup` = 'phpfpm' AND `varname` = 'vhost_defaultini'
|
UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = :value WHERE `settinggroup` = 'phpfpm' AND `varname` = 'vhost_defaultini'
|
||||||
");
|
");
|
||||||
@@ -2613,7 +2609,7 @@ if (isFroxlorVersion('0.9.31')) {
|
|||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
showUpdateStep("Updating ftp-groups entries");
|
showUpdateStep("Updating ftp-groups entries");
|
||||||
Database::query("UPDATE `".TABLE_FTP_GROUPS."` SET `members` = CONCAT(`members`, ',".$settings['system']['httpuser']."');");
|
Database::query("UPDATE `".TABLE_FTP_GROUPS."` SET `members` = CONCAT(`members`, ',".Settings::Get('system.httpuser')."');");
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
updateToVersion('0.9.32-dev1');
|
updateToVersion('0.9.32-dev1');
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
$updateto = '0.9-r0';
|
$updateto = '0.9-r0';
|
||||||
$frontend = 'froxlor';
|
$frontend = 'froxlor';
|
||||||
|
|
||||||
showUpdateStep("Upgrading SysCP ".$settings['panel']['version']." to Froxlor ". $updateto, false);
|
showUpdateStep("Upgrading SysCP ".Settings::Get('panel.version')." to Froxlor ". $updateto, false);
|
||||||
updateToVersion($updateto);
|
updateToVersion($updateto);
|
||||||
|
|
||||||
// add field frontend
|
// add field frontend
|
||||||
@@ -27,4 +27,4 @@ Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` SET
|
|||||||
`varname` = 'frontend',
|
`varname` = 'frontend',
|
||||||
`value` = 'froxlor'"
|
`value` = 'froxlor'"
|
||||||
);
|
);
|
||||||
$settings['panel']['frontend'] = $frontend;
|
Settings::Set('panel.frontend', $frontend);
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
|
||||||
{
|
|
||||||
global $settings, $lng;
|
global $lng;
|
||||||
|
|
||||||
if(versionInUpdate($current_version, '0.9.4-svn2'))
|
if(versionInUpdate($current_version, '0.9.4-svn2'))
|
||||||
{
|
{
|
||||||
@@ -42,11 +42,11 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
|
|
||||||
if(versionInUpdate($current_version, '0.9.6-svn2'))
|
if(versionInUpdate($current_version, '0.9.6-svn2'))
|
||||||
{
|
{
|
||||||
if(!PHPMailer::ValidateAddress($settings['panel']['adminmail']))
|
if(!PHPMailer::ValidateAddress(Settings::Get('panel.adminmail')))
|
||||||
{
|
{
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'Froxlor uses a newer version of the phpMailerClass and determined that your current admin-mail address is invalid.';
|
$description = 'Froxlor uses a newer version of the phpMailerClass and determined that your current admin-mail address is invalid.';
|
||||||
$question = '<strong>Please specify a new admin-email address:</strong> <input type="text" class="text" name="update_adminmail" value="'.$settings['panel']['adminmail'].'" />';
|
$question = '<strong>Please specify a new admin-email address:</strong> <input type="text" class="text" name="update_adminmail" value="'.Settings::Get('panel.adminmail').'" />';
|
||||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
$description = 'You now have the possibility to define default error-documents for your webserver which replace the default webserver error-messages.';
|
$description = 'You now have the possibility to define default error-documents for your webserver which replace the default webserver error-messages.';
|
||||||
$question = '<strong>Do you want to enable default error-documents?:</strong> ';
|
$question = '<strong>Do you want to enable default error-documents?:</strong> ';
|
||||||
$question .= makeyesno('update_deferr_enable', '1', '0', '0').'<br /><br />';
|
$question .= makeyesno('update_deferr_enable', '1', '0', '0').'<br /><br />';
|
||||||
if($settings['system']['webserver'] == 'apache2')
|
if(Settings::Get('system.webserver') == 'apache2')
|
||||||
{
|
{
|
||||||
$question .= 'Path/URL for error 500: <input type="text" class="text" name="update_deferr_500" /><br /><br />';
|
$question .= 'Path/URL for error 500: <input type="text" class="text" name="update_deferr_500" /><br /><br />';
|
||||||
$question .= 'Path/URL for error 401: <input type="text" class="text" name="update_deferr_401" /><br /><br />';
|
$question .= 'Path/URL for error 401: <input type="text" class="text" name="update_deferr_401" /><br /><br />';
|
||||||
@@ -244,7 +244,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
|
|
||||||
if(versionInUpdate($current_version, '0.9.12-svn1'))
|
if(versionInUpdate($current_version, '0.9.12-svn1'))
|
||||||
{
|
{
|
||||||
if($settings['system']['mod_fcgid'] == 1)
|
if(Settings::Get('system.mod_fcgid') == 1)
|
||||||
{
|
{
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'You can chose whether you want Froxlor to use FCGID itself too now.';
|
$description = 'You can chose whether you want Froxlor to use FCGID itself too now.';
|
||||||
@@ -273,19 +273,19 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
|
|
||||||
if(versionInUpdate($current_version, '0.9.12-svn4'))
|
if(versionInUpdate($current_version, '0.9.12-svn4'))
|
||||||
{
|
{
|
||||||
if((int)$settings['system']['awstats_enabled'] == 1)
|
if((int)Settings::Get('system.awstats_enabled') == 1)
|
||||||
{
|
{
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'Due to different paths of awstats_buildstaticpages.pl and awstats.pl you can set a different path for awstats.pl now.';
|
$description = 'Due to different paths of awstats_buildstaticpages.pl and awstats.pl you can set a different path for awstats.pl now.';
|
||||||
$question = '<strong>Path to \'awstats.pl\'?:</strong> ';
|
$question = '<strong>Path to \'awstats.pl\'?:</strong> ';
|
||||||
$question.= '<input type="text" class="text" name="update_awstats_awstatspath" value="'.$settings['system']['awstats_path'].'" /><br />';
|
$question.= '<input type="text" class="text" name="update_awstats_awstatspath" value="'.Settings::Get('system.awstats_path').'" /><br />';
|
||||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(versionInUpdate($current_version, '0.9.13-svn1'))
|
if(versionInUpdate($current_version, '0.9.13-svn1'))
|
||||||
{
|
{
|
||||||
if((int)$settings['autoresponder']['autoresponder_active'] == 1)
|
if((int)Settings::Get('autoresponder.autoresponder_active') == 1)
|
||||||
{
|
{
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'Froxlor can now limit the number of autoresponder-entries for each user. Here you can set the value which will be available for each customer (Of course you can change the value for each customer separately after the update).';
|
$description = 'Froxlor can now limit the number of autoresponder-entries for each user. Here you can set the value which will be available for each customer (Of course you can change the value for each customer separately after the update).';
|
||||||
@@ -297,7 +297,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
|
|
||||||
if(versionInUpdate($current_version, '0.9.13.1'))
|
if(versionInUpdate($current_version, '0.9.13.1'))
|
||||||
{
|
{
|
||||||
if((int)$settings['system']['mod_fcgid_ownvhost'] == 1)
|
if((int)Settings::Get('system.mod_fcgid_ownvhost') == 1)
|
||||||
{
|
{
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'You have FCGID for Froxlor itself activated. You can now specify a PHP-configuration for this.';
|
$description = 'You have FCGID for Froxlor itself activated. You can now specify a PHP-configuration for this.';
|
||||||
@@ -316,24 +316,24 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
|
|
||||||
if(versionInUpdate($current_version, '0.9.14-svn3'))
|
if(versionInUpdate($current_version, '0.9.14-svn3'))
|
||||||
{
|
{
|
||||||
if((int)$settings['system']['awstats_enabled'] == 1)
|
if((int)Settings::Get('system.awstats_enabled') == 1)
|
||||||
{
|
{
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'To have icons in AWStats statistic-pages please enter the path to AWStats icons folder.';
|
$description = 'To have icons in AWStats statistic-pages please enter the path to AWStats icons folder.';
|
||||||
$question = '<strong>Path to AWSTats icons folder:</strong> ';
|
$question = '<strong>Path to AWSTats icons folder:</strong> ';
|
||||||
$question.= '<input type="text" class="text" name="update_awstats_icons" value="'.$settings['system']['awstats_icons'].'" />';
|
$question.= '<input type="text" class="text" name="update_awstats_icons" value="'.Settings::Get('system.awstats_icons').'" />';
|
||||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(versionInUpdate($current_version, '0.9.14-svn4'))
|
if(versionInUpdate($current_version, '0.9.14-svn4'))
|
||||||
{
|
{
|
||||||
if((int)$settings['system']['use_ssl'] == 1)
|
if((int)Settings::Get('system.use_ssl') == 1)
|
||||||
{
|
{
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'Froxlor now has the possibility to set \'SSLCertificateChainFile\' for the apache webserver.';
|
$description = 'Froxlor now has the possibility to set \'SSLCertificateChainFile\' for the apache webserver.';
|
||||||
$question = '<strong>Enter filename (leave empty for none):</strong> ';
|
$question = '<strong>Enter filename (leave empty for none):</strong> ';
|
||||||
$question.= '<input type="text" class="text" name="update_ssl_cert_chainfile" value="'.$settings['system']['ssl_cert_chainfile'].'" />';
|
$question.= '<input type="text" class="text" name="update_ssl_cert_chainfile" value="'.Settings::Get('system.ssl_cert_chainfile').'" />';
|
||||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -390,7 +390,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
|
|
||||||
if(versionInUpdate($current_version, '0.9.16-svn2'))
|
if(versionInUpdate($current_version, '0.9.16-svn2'))
|
||||||
{
|
{
|
||||||
if((int)$settings['phpfpm']['enabled'] == 1)
|
if((int)Settings::Get('phpfpm.enabled') == 1)
|
||||||
{
|
{
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'You can chose whether you want Froxlor to use PHP-FPM itself too now.';
|
$description = 'You can chose whether you want Froxlor to use PHP-FPM itself too now.';
|
||||||
@@ -398,9 +398,9 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
$question.= makeyesno('update_phpfpm_enabled_ownvhost', '1', '0', '0').'<br /><br />';
|
$question.= makeyesno('update_phpfpm_enabled_ownvhost', '1', '0', '0').'<br /><br />';
|
||||||
$question.= '<strong>If \'yes\', please specify local user/group (have to exist, Froxlor does not add them automatically):</strong><br /><br />';
|
$question.= '<strong>If \'yes\', please specify local user/group (have to exist, Froxlor does not add them automatically):</strong><br /><br />';
|
||||||
$question.= 'Local user: ';
|
$question.= 'Local user: ';
|
||||||
$question.= '<input type="text" class="text" name="update_phpfpm_httpuser" value="'.$settings['system']['mod_fcgid_httpuser'].'" /><br /><br />';
|
$question.= '<input type="text" class="text" name="update_phpfpm_httpuser" value="'.Settings::Get('system.mod_fcgid_httpuser').'" /><br /><br />';
|
||||||
$question.= 'Local group: ';
|
$question.= 'Local group: ';
|
||||||
$question.= '<input type="text" class="text" name="update_phpfpm_httpgroup" value="'.$settings['system']['mod_fcgid_httpgroup'].'" /><br />';
|
$question.= '<input type="text" class="text" name="update_phpfpm_httpgroup" value="'.Settings::Get('system.mod_fcgid_httpgroup').'" /><br />';
|
||||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,7 +457,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
|
|
||||||
if (versionInUpdate($current_version, '0.9.28-svn6')) {
|
if (versionInUpdate($current_version, '0.9.28-svn6')) {
|
||||||
|
|
||||||
if ($settings['system']['webserver'] == 'apache2') {
|
if (Settings::Get('system.webserver') == 'apache2') {
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in ordner to use it.<br />';
|
$description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in ordner to use it.<br />';
|
||||||
$description.= '<pre>LoadModule authz_core_module modules/mod_authz_core.so
|
$description.= '<pre>LoadModule authz_core_module modules/mod_authz_core.so
|
||||||
@@ -465,7 +465,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
$question = '<strong>Do you want to enable the Apache-2.4 modification?:</strong> ';
|
$question = '<strong>Do you want to enable the Apache-2.4 modification?:</strong> ';
|
||||||
$question.= makeyesno('update_system_apache24', '1', '0', '0');
|
$question.= makeyesno('update_system_apache24', '1', '0', '0');
|
||||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
} elseif ($settings['system']['webserver'] == 'nginx') {
|
} elseif (Settings::Get('system.webserver') == 'nginx') {
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'The path to nginx\'s fastcgi_params file is now customizable.<br /><br />';
|
$description = 'The path to nginx\'s fastcgi_params file is now customizable.<br /><br />';
|
||||||
$question = '<strong>Please enter full path to you nginx/fastcgi_params file (including filename):</strong> ';
|
$question = '<strong>Please enter full path to you nginx/fastcgi_params file (including filename):</strong> ';
|
||||||
@@ -494,8 +494,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
$description = 'Froxlor changed the default parameter-set of sendmail (php.ini)<br />';
|
$description = 'Froxlor changed the default parameter-set of sendmail (php.ini)<br />';
|
||||||
$description .= 'sendmail_path = "/usr/sbin/sendmail -t <strong>-i</strong> -f {CUSTOMER_EMAIL}"<br /><br />';
|
$description .= 'sendmail_path = "/usr/sbin/sendmail -t <strong>-i</strong> -f {CUSTOMER_EMAIL}"<br /><br />';
|
||||||
$description .= 'If you don\'t have any problems with sending mails, you don\'t need to change this';
|
$description .= 'If you don\'t have any problems with sending mails, you don\'t need to change this';
|
||||||
if ($settings['system']['mod_fcgid'] == '1'
|
if (Settings::Get('system.mod_fcgid') == '1'
|
||||||
|| $settings['phpfpm']['enabled'] == '1'
|
|| Settings::Get('phpfpm.enabled') == '1'
|
||||||
) {
|
) {
|
||||||
// information about removal of php's safe_mode
|
// information about removal of php's safe_mode
|
||||||
$description .= '<br /><br />The php safe_mode flag has been removed as current versions of PHP<br />';
|
$description .= '<br /><br />The php safe_mode flag has been removed as current versions of PHP<br />';
|
||||||
@@ -509,8 +509,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
|
|
||||||
if (versionInUpdate($current_version, '0.9.29-dev1')) {
|
if (versionInUpdate($current_version, '0.9.29-dev1')) {
|
||||||
// we only need to ask if fcgid|php-fpm is enabled
|
// we only need to ask if fcgid|php-fpm is enabled
|
||||||
if ($settings['system']['mod_fcgid'] == '1'
|
if (Settings::Get('system.mod_fcgid') == '1'
|
||||||
|| $settings['phpfpm']['enabled'] == '1'
|
|| Settings::Get('phpfpm.enabled') == '1'
|
||||||
) {
|
) {
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'Standard-subdomains can now be hidden from the php-configuration overview.<br />';
|
$description = 'Standard-subdomains can now be hidden from the php-configuration overview.<br />';
|
||||||
@@ -555,8 +555,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
// let the apache+fpm users know that they MUST change their config
|
// let the apache+fpm users know that they MUST change their config
|
||||||
// for the domains / webserver to work after the update
|
// for the domains / webserver to work after the update
|
||||||
if (versionInUpdate($current_version, '0.9.30-dev1')) {
|
if (versionInUpdate($current_version, '0.9.30-dev1')) {
|
||||||
if ($settings['system']['webserver'] == 'apache2'
|
if (Settings::Get('system.webserver') == 'apache2'
|
||||||
&& $settings['phpfpm']['enabled'] == '1'
|
&& Settings::Get('phpfpm.enabled') == '1'
|
||||||
) {
|
) {
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'The PHP-FPM implementation for apache2 has changed. Please look for the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) within /etc/apache2/ and change it as shown below:<br /><br />';
|
$description = 'The PHP-FPM implementation for apache2 has changed. Please look for the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) within /etc/apache2/ and change it as shown below:<br /><br />';
|
||||||
@@ -575,8 +575,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (versionInUpdate($current_version, '0.9.31-dev2')) {
|
if (versionInUpdate($current_version, '0.9.31-dev2')) {
|
||||||
if ($settings['system']['webserver'] == 'apache2'
|
if (Settings::Get('system.webserver') == 'apache2'
|
||||||
&& $settings['phpfpm']['enabled'] == '1'
|
&& Settings::Get('phpfpm.enabled') == '1'
|
||||||
) {
|
) {
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'The FPM socket directory is now a setting in froxlor. Its default is <b>/var/lib/apache2/fastcgi/</b>.<br/>If you are using <b>/var/run/apache2</b> in the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) please correct this path accordingly<br />';
|
$description = 'The FPM socket directory is now a setting in froxlor. Its default is <b>/var/lib/apache2/fastcgi/</b>.<br/>If you are using <b>/var/run/apache2</b> in the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) please correct this path accordingly<br />';
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'), $settings);
|
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'));
|
||||||
|
|
||||||
$updatelogfile = validateUpdateLogFile(makeCorrectFile(dirname(__FILE__).'/update.log'));
|
$updatelogfile = validateUpdateLogFile(makeCorrectFile(dirname(__FILE__).'/update.log'));
|
||||||
$filelog = FileLogger::getInstanceOf(array('loginname' => 'updater'), $settings);
|
$filelog = FileLogger::getInstanceOf(array('loginname' => 'updater'));
|
||||||
$filelog->setLogFile($updatelogfile);
|
$filelog->setLogFile($updatelogfile);
|
||||||
|
|
||||||
// if first writing does not work we'll stop, tell the user to fix it
|
// if first writing does not work we'll stop, tell the user to fix it
|
||||||
|
|||||||
@@ -19,31 +19,33 @@
|
|||||||
|
|
||||||
$configcommand = array();
|
$configcommand = array();
|
||||||
|
|
||||||
if(isConfigDir($settings['system']['apacheconf_vhost']))
|
if (isConfigDir(Settings::Get('system.apacheconf_vhost'))) {
|
||||||
{
|
$configcommand['vhost'] = 'mkdir -p ' . Settings::Get('system.apacheconf_vhost');
|
||||||
$configcommand['vhost'] = 'mkdir -p ' . $settings['system']['apacheconf_vhost'];
|
$configcommand['include'] = 'echo -e "\\nInclude ' . makeCorrectDir(Settings::Get('system.apacheconf_vhost')) . '*.conf" >> ' . makeCorrectFile(makeCorrectDir('/etc/apache2/httpd.conf'));
|
||||||
$configcommand['include'] = 'echo -e "\\nInclude ' . makeCorrectDir($settings['system']['apacheconf_vhost']) . '*.conf" >> ' . makeCorrectFile(makeCorrectDir('/etc/apache2/httpd.conf'));
|
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude_shell "cat ' . makeCorrectDir(Settings::Get('system.apacheconf_vhost')) . '*.conf"\' >> /etc/lighttpd/lighttpd.conf';
|
||||||
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude_shell "cat ' . makeCorrectDir($settings['system']['apacheconf_vhost']) . '*.conf"\' >> /etc/lighttpd/lighttpd.conf';
|
} else {
|
||||||
}
|
$configcommand['vhost'] = 'touch ' . Settings::Get('system.apacheconf_vhost');
|
||||||
else
|
$configcommand['include'] = 'echo -e "\\nInclude ' . Settings::Get('system.apacheconf_vhost') . '" >> ' . makeCorrectFile('/etc/apache2/httpd.conf');
|
||||||
{
|
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude "' . Settings::Get('system.apacheconf_vhost') . '"\' >> /etc/lighttpd/lighttpd.conf';
|
||||||
$configcommand['vhost'] = 'touch ' . $settings['system']['apacheconf_vhost'];
|
|
||||||
$configcommand['include'] = 'echo -e "\\nInclude ' . $settings['system']['apacheconf_vhost'] . '" >> ' . makeCorrectFile('/etc/apache2/httpd.conf');
|
|
||||||
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude "' . $settings['system']['apacheconf_vhost'] . '"\' >> /etc/lighttpd/lighttpd.conf';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isConfigDir($settings['system']['apacheconf_diroptions']))
|
if (isConfigDir(Settings::Get('system.apacheconf_diroptions'))) {
|
||||||
{
|
$configcommand['diroptions'] = 'mkdir -p ' . Settings::Get('system.apacheconf_diroptions');
|
||||||
$configcommand['diroptions'] = 'mkdir -p ' . $settings['system']['apacheconf_diroptions'];
|
$configcommand['d_inclighty'] = 'echo -e \'\\ninclude_shell "cat ' . makeCorrectDir(Settings::Get('system.apacheconf_diroptions')) . '*.conf"\' >> /etc/lighttpd/lighttpd.conf';
|
||||||
$configcommand['d_inclighty'] = 'echo -e \'\\ninclude_shell "cat ' . makeCorrectDir($settings['system']['apacheconf_diroptions']) . '*.conf"\' >> /etc/lighttpd/lighttpd.conf';
|
} else {
|
||||||
}
|
$configcommand['diroptions'] = 'touch ' . Settings::Get('system.apacheconf_diroptions');
|
||||||
else
|
$configcommand['d_inclighty'] = 'echo -e \'\\ninclude "' . Settings::Get('system.apacheconf_diroptions') . '"\' >> /etc/lighttpd/lighttpd.conf';
|
||||||
{
|
|
||||||
$configcommand['diroptions'] = 'touch ' . $settings['system']['apacheconf_diroptions'];
|
|
||||||
$configcommand['d_inclighty'] = 'echo -e \'\\ninclude "' . $settings['system']['apacheconf_diroptions'] . '"\' >> /etc/lighttpd/lighttpd.conf';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cfgPath = 'lib/configfiles/';
|
$cfgPath = 'lib/configfiles/';
|
||||||
$configfiles = Array();
|
$configfiles = array();
|
||||||
$configfiles = array_merge(include $cfgPath . 'wheezy.inc.php', include $cfgPath . 'squeeze.inc.php', include $cfgPath . 'precise.inc.php', include $cfgPath . 'lucid.inc.php', include $cfgPath . 'gentoo.inc.php', include $cfgPath . 'suse11.inc.php', include $cfgPath . 'sle10.inc.php', include $cfgPath . 'freebsd.inc.php');
|
$configfiles = array_merge(
|
||||||
|
include $cfgPath . 'wheezy.inc.php',
|
||||||
|
include $cfgPath . 'squeeze.inc.php',
|
||||||
|
include $cfgPath . 'precise.inc.php',
|
||||||
|
include $cfgPath . 'lucid.inc.php',
|
||||||
|
include $cfgPath . 'gentoo.inc.php',
|
||||||
|
include $cfgPath . 'suse11.inc.php',
|
||||||
|
include $cfgPath . 'sle10.inc.php',
|
||||||
|
include $cfgPath . 'freebsd.inc.php'
|
||||||
|
);
|
||||||
|
|||||||
@@ -127,11 +127,12 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fwrite($debugHandler, 'Database-connection established' . "\n");
|
fwrite($debugHandler, 'Database-connection established' . "\n");
|
||||||
|
|
||||||
|
// TODO remove when fully migrated to new Settings class
|
||||||
$result_stmt = Database::query("
|
$result_stmt = Database::query("
|
||||||
SELECT `settingid`, `settinggroup`, `varname`, `value`
|
SELECT `settingid`, `settinggroup`, `varname`, `value`
|
||||||
FROM `" . TABLE_PANEL_SETTINGS . "`
|
FROM `" . TABLE_PANEL_SETTINGS . "`
|
||||||
");
|
");
|
||||||
|
|
||||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$settings[$row['settinggroup']][$row['varname']] = $row['value'];
|
$settings[$row['settinggroup']][$row['varname']] = $row['value'];
|
||||||
}
|
}
|
||||||
@@ -140,26 +141,37 @@ unset($row);
|
|||||||
fwrite($debugHandler, 'Froxlor settings have been loaded from the database' . "\n");
|
fwrite($debugHandler, 'Froxlor settings have been loaded from the database' . "\n");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* if settings['system']['mod_fcgid_ownvhost'] is set, we have to check
|
* if using fcgid or fpm for froxlor-vhost itself, we have to check
|
||||||
* whether the permission of the files are still correct
|
* whether the permission of the files are still correct
|
||||||
*/
|
*/
|
||||||
if ((int)$settings['system']['mod_fcgid'] == 1
|
fwrite($debugHandler, 'Checking froxlor file permissions');
|
||||||
&& (int)$settings['system']['mod_fcgid_ownvhost'] == 1
|
$_mypath = makeCorrectDir(FROXLOR_INSTALL_DIR);
|
||||||
|
|
||||||
|
if (((int)Settings::Get('system.mod_fcgid') == 1 && (int)Settings::Get('system.mod_fcgid_ownvhost') == 1)
|
||||||
|
|| ((int)Settings::Get('phpfpm.enabled') == 1 && (int)Settings::Get('phpfpm.enabled_ownvhost') == 1)
|
||||||
) {
|
) {
|
||||||
fwrite($debugHandler, 'Checking froxlor file permissions');
|
$user = Settings::Get('system.mod_fcgid_httpuser');
|
||||||
$mypath = makeCorrectDir(FROXLOR_INSTALL_DIR);
|
$group = Settings::Get('system.mod_fcgid_httpgroup');
|
||||||
$user = $settings['system']['mod_fcgid_httpuser'];
|
|
||||||
$group = $settings['system']['mod_fcgid_httpgroup'];
|
if (Settings::Get('phpfpm.enabled') == 1) {
|
||||||
|
$user = Settings::Get('phpfpm.vhost_httpuser');
|
||||||
|
$group = Settings::Get('phpfpm.vhost_httpgroup');
|
||||||
|
}
|
||||||
// all the files and folders have to belong to the local user
|
// all the files and folders have to belong to the local user
|
||||||
// now because we also use fcgid for our own vhost
|
// now because we also use fcgid for our own vhost
|
||||||
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
|
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($_mypath));
|
||||||
|
} else {
|
||||||
|
// back to webserver permission
|
||||||
|
$user = Settings::Get('system.httpuser');
|
||||||
|
$group = Settings::Get('system.httpgroup');
|
||||||
|
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($_mypath));
|
||||||
}
|
}
|
||||||
|
|
||||||
// be sure HTMLPurifier's cache folder is writable
|
// be sure HTMLPurifier's cache folder is writable
|
||||||
safe_exec('chmod -R 0755 '.escapeshellarg(dirname(__FILE__).'/classes/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer'));
|
safe_exec('chmod -R 0755 '.escapeshellarg(dirname(__FILE__).'/classes/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer'));
|
||||||
|
|
||||||
if (!isset($settings['panel']['version'])
|
if (Settings::Get('panel.version') == null
|
||||||
|| $settings['panel']['version'] != $version
|
|| Settings::Get('panel.version') != $version
|
||||||
) {
|
) {
|
||||||
/**
|
/**
|
||||||
* Do not proceed further if the Database version is not the same as the script version
|
* Do not proceed further if the Database version is not the same as the script version
|
||||||
@@ -168,18 +180,18 @@ if (!isset($settings['panel']['version'])
|
|||||||
unlink($lockfile);
|
unlink($lockfile);
|
||||||
$errormessage = "Version of file doesnt match version of database. Exiting...\n\n";
|
$errormessage = "Version of file doesnt match version of database. Exiting...\n\n";
|
||||||
$errormessage.= "Possible reason: Froxlor update\n";
|
$errormessage.= "Possible reason: Froxlor update\n";
|
||||||
$errormessage.= "Information: Current version in database: ".$settings['panel']['version']." - version of Froxlor files: ".$version."\n";
|
$errormessage.= "Information: Current version in database: ".Settings::Get('panel.version')." - version of Froxlor files: ".$version."\n";
|
||||||
$errormessage.= "Solution: Please visit your Foxlor admin interface for further information.\n";
|
$errormessage.= "Solution: Please visit your Foxlor admin interface for further information.\n";
|
||||||
die($errormessage);
|
die($errormessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite($debugHandler, 'Froxlor version and database version are correct' . "\n");
|
fwrite($debugHandler, 'Froxlor version and database version are correct' . "\n");
|
||||||
|
|
||||||
$cronscriptDebug = ($settings['system']['debug_cron'] == '1') ? true : false;
|
$cronscriptDebug = (Settings::Get('system.debug_cron') == '1') ? true : false;
|
||||||
|
|
||||||
// Create a new idna converter
|
// Create a new idna converter
|
||||||
$idna_convert = new idna_convert_wrapper();
|
$idna_convert = new idna_convert_wrapper();
|
||||||
|
|
||||||
// Initialize logging
|
// Initialize logging
|
||||||
$cronlog = FroxlorLogger::getInstanceOf(array('loginname' => 'cronjob'), $settings);
|
$cronlog = FroxlorLogger::getInstanceOf(array('loginname' => 'cronjob'));
|
||||||
fwrite($debugHandler, 'Logger has been included' . "\n");
|
fwrite($debugHandler, 'Logger has been included' . "\n");
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($settings['logger']['log_cron'] == '1') {
|
if (Settings::Get('logger.log_cron') == '1') {
|
||||||
$cronlog->setCronLog(0);
|
$cronlog->setCronLog(0);
|
||||||
fwrite($debugHandler, 'Logging for cron has been shutdown' . "\n");
|
fwrite($debugHandler, 'Logging for cron has been shutdown' . "\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,38 +26,23 @@
|
|||||||
*
|
*
|
||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
function isConfigDir($dir, $ifexists = false) {
|
||||||
function isConfigDir($dir, $ifexists = false)
|
if (file_exists($dir)) {
|
||||||
{
|
if (is_dir($dir)) {
|
||||||
if(file_exists($dir))
|
|
||||||
{
|
|
||||||
if(is_dir($dir))
|
|
||||||
{
|
|
||||||
$returnval = true;
|
$returnval = true;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$returnval = false;
|
$returnval = false;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
if (!$ifexists) {
|
||||||
{
|
if (substr($dir, -1) == '/') {
|
||||||
if(!$ifexists)
|
|
||||||
{
|
|
||||||
if(substr($dir, -1) == '/')
|
|
||||||
{
|
|
||||||
$returnval = true;
|
$returnval = true;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$returnval = false;
|
$returnval = false;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$returnval = false;
|
$returnval = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnval;
|
return $returnval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
*/
|
*/
|
||||||
function makeCryptPassword ($password) {
|
function makeCryptPassword ($password) {
|
||||||
|
|
||||||
$type = isset(Settings::Get('system.passwordcryptfunc')) ? (int)Settings::Get('system.passwordcryptfunc') : 1;
|
$type = Settings::Get('system.passwordcryptfunc') !== null ? (int)Settings::Get('system.passwordcryptfunc') : 1;
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|||||||
23
lib/init.php
23
lib/init.php
@@ -145,6 +145,7 @@ if (get_magic_quotes_gpc()) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Selects settings from MySQL-Table
|
* Selects settings from MySQL-Table
|
||||||
|
* TODO remove when completely migrated to new Settings class
|
||||||
*/
|
*/
|
||||||
$settings_data = loadConfigArrayDir('actions/admin/settings/');
|
$settings_data = loadConfigArrayDir('actions/admin/settings/');
|
||||||
$settings = loadSettings($settings_data);
|
$settings = loadSettings($settings_data);
|
||||||
@@ -176,7 +177,7 @@ if (isset($_POST['s'])) {
|
|||||||
$nosession = 1;
|
$nosession = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$timediff = time() - $settings['session']['sessiontimeout'];
|
$timediff = time() - Settings::Get('session.sessiontimeout');
|
||||||
$del_stmt = Database::prepare("
|
$del_stmt = Database::prepare("
|
||||||
DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `lastactivity` < :timediff
|
DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `lastactivity` < :timediff
|
||||||
");
|
");
|
||||||
@@ -270,7 +271,7 @@ foreach ($langs as $key => $value) {
|
|||||||
|
|
||||||
// set default langauge before anything else to
|
// set default langauge before anything else to
|
||||||
// ensure that we can display messages
|
// ensure that we can display messages
|
||||||
$language = $settings['panel']['standardlanguage'];
|
$language = Settings::Get('panel.standardlanguage');
|
||||||
|
|
||||||
if (isset($userinfo['language']) && isset($languages[$userinfo['language']])) {
|
if (isset($userinfo['language']) && isset($languages[$userinfo['language']])) {
|
||||||
// default: use language from session, #277
|
// default: use language from session, #277
|
||||||
@@ -299,7 +300,7 @@ if (isset($userinfo['language']) && isset($languages[$userinfo['language']])) {
|
|||||||
|
|
||||||
// if HTTP_ACCEPT_LANGUAGES has no valid langs, use default (very unlikely)
|
// if HTTP_ACCEPT_LANGUAGES has no valid langs, use default (very unlikely)
|
||||||
if (!strlen($language)>0) {
|
if (!strlen($language)>0) {
|
||||||
$language = $settings['panel']['standardlanguage'];
|
$language = Settings::Get('panel.standardlanguage');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,7 +330,7 @@ $linker = new linker('index.php', $s);
|
|||||||
/**
|
/**
|
||||||
* global Theme-variable
|
* global Theme-variable
|
||||||
*/
|
*/
|
||||||
$theme = isset($settings['panel']['default_theme']) ? $settings['panel']['default_theme'] : 'Sparkle';
|
$theme = (Settings::Get('panel.default_theme') !== null) ? Settings::Get('panel.default_theme') : 'Sparkle';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* overwrite with customer/admin theme if defined
|
* overwrite with customer/admin theme if defined
|
||||||
@@ -374,7 +375,7 @@ if (isset($userinfo['loginname'])
|
|||||||
) {
|
) {
|
||||||
$lng['menue']['main']['username'].= $userinfo['loginname'];
|
$lng['menue']['main']['username'].= $userinfo['loginname'];
|
||||||
//Initialize logging
|
//Initialize logging
|
||||||
$log = FroxlorLogger::getInstanceOf($userinfo, $settings);
|
$log = FroxlorLogger::getInstanceOf($userinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -428,7 +429,7 @@ if (AREA == 'admin' || AREA == 'customer') {
|
|||||||
*/
|
*/
|
||||||
$awaitingtickets = 0;
|
$awaitingtickets = 0;
|
||||||
$awaitingtickets_text = '';
|
$awaitingtickets_text = '';
|
||||||
if ($settings['ticket']['enabled'] == '1') {
|
if (Settings::Get('ticket.enabled') == '1') {
|
||||||
|
|
||||||
$opentickets = 0;
|
$opentickets = 0;
|
||||||
|
|
||||||
@@ -460,7 +461,7 @@ if ($settings['ticket']['enabled'] == '1') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$webfont = str_replace('+', ' ', $settings['panel']['webfont']);
|
$webfont = str_replace('+', ' ', Settings::Get('panel.webfont'));
|
||||||
eval("\$header = \"" . getTemplate('header', '1') . "\";");
|
eval("\$header = \"" . getTemplate('header', '1') . "\";");
|
||||||
|
|
||||||
$current_year = date('Y', time());
|
$current_year = date('Y', time());
|
||||||
@@ -496,10 +497,10 @@ if ($page == '') {
|
|||||||
$mail = new PHPMailer(true);
|
$mail = new PHPMailer(true);
|
||||||
$mail->CharSet = "UTF-8";
|
$mail->CharSet = "UTF-8";
|
||||||
|
|
||||||
if (PHPMailer::ValidateAddress($settings['panel']['adminmail']) !== false) {
|
if (PHPMailer::ValidateAddress(Settings::Get('panel.adminmail')) !== false) {
|
||||||
// set return-to address and custom sender-name, see #76
|
// set return-to address and custom sender-name, see #76
|
||||||
$mail->SetFrom($settings['panel']['adminmail'], $settings['panel']['adminmail_defname']);
|
$mail->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
|
||||||
if ($settings['panel']['adminmail_return'] != '') {
|
if (Settings::Get('panel.adminmail_return') != '') {
|
||||||
$mail->AddReplyTo($settings['panel']['adminmail_return'], $settings['panel']['adminmail_defname']);
|
$mail->AddReplyTo(Settings::Get('panel.adminmail_return'), Settings::Get('panel.adminmail_defname'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,14 +86,6 @@ while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
|
|||||||
} else {
|
} else {
|
||||||
echo "Please check you Webserver settings\n";
|
echo "Please check you Webserver settings\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* FIXME
|
|
||||||
* as we might have a change from mod_php to fcgid/fpm or the other way around
|
|
||||||
* we need to check customer directory permissions
|
|
||||||
* -> 0.9.31
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user