auto-format all files; add table-definitions to test-bootstrap file

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-21 12:24:07 +01:00
parent 1ff784198c
commit 97b5439c0d
209 changed files with 6840 additions and 4534 deletions

1
.gitignore vendored
View File

@@ -16,3 +16,4 @@ logs/*
!templates/Sparkle/ !templates/Sparkle/
!templates/misc/ !templates/misc/
templates/Froxlor/assets/img/logo_custom.png templates/Froxlor/assets/img/logo_custom.png
vendor/

10
2fa.php
View File

@@ -50,7 +50,7 @@ if ($action == 'delete') {
\Froxlor\UI\Response::standard_success($lng['2fa']['2fa_removed']); \Froxlor\UI\Response::standard_success($lng['2fa']['2fa_removed']);
} elseif ($action == 'add') { } elseif ($action == 'add') {
$type = isset($_POST['type_2fa']) ? $_POST['type_2fa'] : '0'; $type = isset($_POST['type_2fa']) ? $_POST['type_2fa'] : '0';
if ($type == 0 || $type == 1) { if ($type == 0 || $type == 1) {
$data = ""; $data = "";
} }
@@ -69,7 +69,7 @@ if ($action == 'delete') {
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed 2fa::overview"); $log->logAction(USR_ACTION, LOG_NOTICE, "viewed 2fa::overview");
if ($userinfo['type_2fa'] == '0') { if ($userinfo['type_2fa'] == '0') {
// available types // available types
$type_select_values = array( $type_select_values = array(
0 => '-', 0 => '-',
@@ -80,11 +80,9 @@ if ($userinfo['type_2fa'] == '0') {
foreach ($type_select_values as $_val => $_type) { foreach ($type_select_values as $_val => $_type) {
$type_select .= makeoption($_type, $_val); $type_select .= makeoption($_type, $_val);
} }
} } elseif ($userinfo['type_2fa'] == '1') {
elseif ($userinfo['type_2fa'] == '1') {
// email 2fa enabled // email 2fa enabled
} } elseif ($userinfo['type_2fa'] == '2') {
elseif ($userinfo['type_2fa'] == '2') {
// authenticator 2fa enabled // authenticator 2fa enabled
$ga_qrcode = $tfa->getQRCodeImageAsDataUri($userinfo['loginname'], $userinfo['data_2fa']); $ga_qrcode = $tfa->getQRCodeImageAsDataUri($userinfo['loginname'], $userinfo['data_2fa']);
} }

View File

@@ -16,40 +16,45 @@
* @package Language * @package Language
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'panel' => array( 'panel' => array(
'title' => $lng['admin']['panelsettings'], 'title' => $lng['admin']['panelsettings'],
'fields' => array( 'fields' => array(
'panel_standardlanguage' => array( 'panel_standardlanguage' => array(
'label' => array('title' => $lng['login']['language'], 'description' => $lng['serversettings']['language']['description']), 'label' => array(
'title' => $lng['login']['language'],
'description' => $lng['serversettings']['language']['description']
),
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'standardlanguage', 'varname' => 'standardlanguage',
'type' => 'option', 'type' => 'option',
'default' => 'English', 'default' => 'English',
'option_mode' => 'one', 'option_mode' => 'one',
'option_options_method' => 'getLanguages', 'option_options_method' => 'getLanguages',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_default_theme' => array( 'panel_default_theme' => array(
'label' => array('title' => $lng['panel']['theme'], 'description' => $lng['serversettings']['default_theme']), 'label' => array(
'title' => $lng['panel']['theme'],
'description' => $lng['serversettings']['default_theme']
),
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'default_theme', 'varname' => 'default_theme',
'type' => 'option', 'type' => 'option',
'default' => 'Froxlor', 'default' => 'Froxlor',
'option_mode' => 'one', 'option_mode' => 'one',
'option_options_method' => 'getThemes', 'option_options_method' => 'getThemes',
'save_method' => 'storeSettingDefaultTheme', 'save_method' => 'storeSettingDefaultTheme'
), ),
'panel_allow_theme_change_customer' => array( 'panel_allow_theme_change_customer' => array(
'label' => $lng['serversettings']['panel_allow_theme_change_customer'], 'label' => $lng['serversettings']['panel_allow_theme_change_customer'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'allow_theme_change_customer', 'varname' => 'allow_theme_change_customer',
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_allow_theme_change_admin' => array( 'panel_allow_theme_change_admin' => array(
'label' => $lng['serversettings']['panel_allow_theme_change_admin'], 'label' => $lng['serversettings']['panel_allow_theme_change_admin'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -57,23 +62,23 @@ return array(
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'
), ),
'panel_natsorting' => array( 'panel_natsorting' => array(
'label' => $lng['serversettings']['natsorting'], 'label' => $lng['serversettings']['natsorting'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'natsorting', 'varname' => 'natsorting',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_no_robots' => array( 'panel_no_robots' => array(
'label' => $lng['serversettings']['no_robots'], 'label' => $lng['serversettings']['no_robots'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'no_robots', 'varname' => 'no_robots',
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_paging' => array( 'panel_paging' => array(
'label' => $lng['serversettings']['paging'], 'label' => $lng['serversettings']['paging'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -81,8 +86,8 @@ return array(
'type' => 'int', 'type' => 'int',
'int_min' => 0, 'int_min' => 0,
'default' => 0, 'default' => 0,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_pathedit' => array( 'panel_pathedit' => array(
'label' => $lng['serversettings']['pathedit'], 'label' => $lng['serversettings']['pathedit'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -90,9 +95,12 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => 'Manual', 'default' => 'Manual',
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array('Manual' => $lng['serversettings']['manual'], 'Dropdown' => $lng['serversettings']['dropdown']), 'option_options' => array(
'save_method' => 'storeSettingField', 'Manual' => $lng['serversettings']['manual'],
'Dropdown' => $lng['serversettings']['dropdown']
), ),
'save_method' => 'storeSettingField'
),
'panel_adminmail' => array( 'panel_adminmail' => array(
'label' => $lng['serversettings']['adminmail'], 'label' => $lng['serversettings']['adminmail'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -101,16 +109,16 @@ return array(
'string_type' => 'mail', 'string_type' => 'mail',
'string_emptyallowed' => false, 'string_emptyallowed' => false,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_adminmail_defname' => array( 'panel_adminmail_defname' => array(
'label' => $lng['serversettings']['adminmail_defname'], 'label' => $lng['serversettings']['adminmail_defname'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'adminmail_defname', 'varname' => 'adminmail_defname',
'type' => 'string', 'type' => 'string',
'default' => 'Froxlor Administrator', 'default' => 'Froxlor Administrator',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_adminmail_return' => array( 'panel_adminmail_return' => array(
'label' => $lng['serversettings']['adminmail_return'], 'label' => $lng['serversettings']['adminmail_return'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -119,8 +127,8 @@ return array(
'string_type' => 'mail', 'string_type' => 'mail',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_decimal_places' => array( 'panel_decimal_places' => array(
'label' => $lng['serversettings']['decimal_places'], 'label' => $lng['serversettings']['decimal_places'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -129,8 +137,8 @@ return array(
'int_min' => 0, 'int_min' => 0,
'int_max' => 15, 'int_max' => 15,
'default' => 4, 'default' => 4,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_phpmyadmin_url' => array( 'panel_phpmyadmin_url' => array(
'label' => $lng['serversettings']['phpmyadmin_url'], 'label' => $lng['serversettings']['phpmyadmin_url'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -139,8 +147,8 @@ return array(
'string_type' => 'url', 'string_type' => 'url',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_webmail_url' => array( 'panel_webmail_url' => array(
'label' => $lng['serversettings']['webmail_url'], 'label' => $lng['serversettings']['webmail_url'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -149,8 +157,8 @@ return array(
'string_type' => 'url', 'string_type' => 'url',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_webftp_url' => array( 'panel_webftp_url' => array(
'label' => $lng['serversettings']['webftp_url'], 'label' => $lng['serversettings']['webftp_url'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -159,40 +167,40 @@ return array(
'string_type' => 'url', 'string_type' => 'url',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'admin_show_version_login' => array( 'admin_show_version_login' => array(
'label' => $lng['admin']['show_version_login'], 'label' => $lng['admin']['show_version_login'],
'settinggroup' => 'admin', 'settinggroup' => 'admin',
'varname' => 'show_version_login', 'varname' => 'show_version_login',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'admin_show_version_footer' => array( 'admin_show_version_footer' => array(
'label' => $lng['admin']['show_version_footer'], 'label' => $lng['admin']['show_version_footer'],
'settinggroup' => 'admin', 'settinggroup' => 'admin',
'varname' => 'show_version_footer', 'varname' => 'show_version_footer',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'admin_show_news_feed' => array( 'admin_show_news_feed' => array(
'label' => $lng['admin']['show_news_feed'], 'label' => $lng['admin']['show_news_feed'],
'settinggroup' => 'admin', 'settinggroup' => 'admin',
'varname' => 'show_news_feed', 'varname' => 'show_news_feed',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'customer_show_news_feed' => array( 'customer_show_news_feed' => array(
'label' => $lng['admin']['customer_show_news_feed'], 'label' => $lng['admin']['customer_show_news_feed'],
'settinggroup' => 'customer', 'settinggroup' => 'customer',
'varname' => 'show_news_feed', 'varname' => 'show_news_feed',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'customer_news_feed_url' => array( 'customer_news_feed_url' => array(
'label' => $lng['admin']['customer_news_feed_url'], 'label' => $lng['admin']['customer_news_feed_url'],
'settinggroup' => 'customer', 'settinggroup' => 'customer',
@@ -201,32 +209,32 @@ return array(
'string_type' => 'url', 'string_type' => 'url',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_allow_domain_change_admin' => array( 'panel_allow_domain_change_admin' => array(
'label' => $lng['serversettings']['panel_allow_domain_change_admin'], 'label' => $lng['serversettings']['panel_allow_domain_change_admin'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'allow_domain_change_admin', 'varname' => 'allow_domain_change_admin',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_allow_domain_change_customer' => array( 'panel_allow_domain_change_customer' => array(
'label' => $lng['serversettings']['panel_allow_domain_change_customer'], 'label' => $lng['serversettings']['panel_allow_domain_change_customer'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'allow_domain_change_customer', 'varname' => 'allow_domain_change_customer',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_phpconfigs_hidestdsubdomain' => array( 'panel_phpconfigs_hidestdsubdomain' => array(
'label' => $lng['serversettings']['panel_phpconfigs_hidestdsubdomain'], 'label' => $lng['serversettings']['panel_phpconfigs_hidestdsubdomain'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'phpconfigs_hidestdsubdomain', 'varname' => 'phpconfigs_hidestdsubdomain',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_customer_hide_options' => array( 'panel_customer_hide_options' => array(
'label' => $lng['serversettings']['panel_customer_hide_options'], 'label' => $lng['serversettings']['panel_customer_hide_options'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -236,25 +244,25 @@ return array(
'option_mode' => 'multiple', 'option_mode' => 'multiple',
'option_emptyallowed' => true, 'option_emptyallowed' => true,
'option_options' => array( 'option_options' => array(
'email' => $lng['menue']['email']['email'], 'email' => $lng['menue']['email']['email'],
'mysql' => $lng['menue']['mysql']['mysql'], 'mysql' => $lng['menue']['mysql']['mysql'],
'domains' => $lng['menue']['domains']['domains'], 'domains' => $lng['menue']['domains']['domains'],
'ftp' => $lng['menue']['ftp']['ftp'], 'ftp' => $lng['menue']['ftp']['ftp'],
'extras' => $lng['menue']['extras']['extras'], 'extras' => $lng['menue']['extras']['extras'],
'extras.directoryprotection' => $lng['menue']['extras']['extras']." / ".$lng['menue']['extras']['directoryprotection'], 'extras.directoryprotection' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['directoryprotection'],
'extras.pathoptions' => $lng['menue']['extras']['extras']." / ".$lng['menue']['extras']['pathoptions'], 'extras.pathoptions' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['pathoptions'],
'extras.logger' => $lng['menue']['extras']['extras']." / ".$lng['menue']['logger']['logger'], 'extras.logger' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['logger']['logger'],
'extras.backup' => $lng['menue']['extras']['extras']." / ".$lng['menue']['extras']['backup'], 'extras.backup' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['backup'],
'traffic' => $lng['menue']['traffic']['traffic'], 'traffic' => $lng['menue']['traffic']['traffic'],
'traffic.http' => $lng['menue']['traffic']['traffic']." / HTTP", 'traffic.http' => $lng['menue']['traffic']['traffic'] . " / HTTP",
'traffic.ftp' => $lng['menue']['traffic']['traffic']." / FTP", 'traffic.ftp' => $lng['menue']['traffic']['traffic'] . " / FTP",
'traffic.mail' => $lng['menue']['traffic']['traffic']." / Mail", 'traffic.mail' => $lng['menue']['traffic']['traffic'] . " / Mail"
), ),
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), )
), )
), )
), )
); );
?> ?>

View File

@@ -16,7 +16,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'accounts' => array( 'accounts' => array(
@@ -28,47 +27,47 @@ return array(
'varname' => 'sessiontimeout', 'varname' => 'sessiontimeout',
'type' => 'int', 'type' => 'int',
'default' => 600, 'default' => 600,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'session_allow_multiple_login' => array( 'session_allow_multiple_login' => array(
'label' => $lng['serversettings']['session_allow_multiple_login'], 'label' => $lng['serversettings']['session_allow_multiple_login'],
'settinggroup' => 'session', 'settinggroup' => 'session',
'varname' => 'allow_multiple_login', 'varname' => 'allow_multiple_login',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'login_domain_login' => array( 'login_domain_login' => array(
'label' => $lng['serversettings']['login_domain_login'], 'label' => $lng['serversettings']['login_domain_login'],
'settinggroup' => 'login', 'settinggroup' => 'login',
'varname' => 'domain_login', 'varname' => 'domain_login',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'login_maxloginattempts' => array( 'login_maxloginattempts' => array(
'label' => $lng['serversettings']['maxloginattempts'], 'label' => $lng['serversettings']['maxloginattempts'],
'settinggroup' => 'login', 'settinggroup' => 'login',
'varname' => 'maxloginattempts', 'varname' => 'maxloginattempts',
'type' => 'int', 'type' => 'int',
'default' => 3, 'default' => 3,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'login_deactivatetime' => array( 'login_deactivatetime' => array(
'label' => $lng['serversettings']['deactivatetime'], 'label' => $lng['serversettings']['deactivatetime'],
'settinggroup' => 'login', 'settinggroup' => 'login',
'varname' => 'deactivatetime', 'varname' => 'deactivatetime',
'type' => 'int', 'type' => 'int',
'default' => 900, 'default' => 900,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'2fa_enabled' => array( '2fa_enabled' => array(
'label' => $lng['2fa']['2fa_enabled'], 'label' => $lng['2fa']['2fa_enabled'],
'settinggroup' => '2fa', 'settinggroup' => '2fa',
'varname' => 'enabled', 'varname' => 'enabled',
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_password_min_length' => array( 'panel_password_min_length' => array(
'label' => $lng['serversettings']['panel_password_min_length'], 'label' => $lng['serversettings']['panel_password_min_length'],
@@ -76,56 +75,56 @@ return array(
'varname' => 'password_min_length', 'varname' => 'password_min_length',
'type' => 'int', 'type' => 'int',
'default' => 0, 'default' => 0,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_password_alpha_lower' => array( 'panel_password_alpha_lower' => array(
'label' => $lng['serversettings']['panel_password_alpha_lower'], 'label' => $lng['serversettings']['panel_password_alpha_lower'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'password_alpha_lower', 'varname' => 'password_alpha_lower',
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_password_alpha_upper' => array( 'panel_password_alpha_upper' => array(
'label' => $lng['serversettings']['panel_password_alpha_upper'], 'label' => $lng['serversettings']['panel_password_alpha_upper'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'password_alpha_upper', 'varname' => 'password_alpha_upper',
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_password_numeric' => array( 'panel_password_numeric' => array(
'label' => $lng['serversettings']['panel_password_numeric'], 'label' => $lng['serversettings']['panel_password_numeric'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'password_numeric', 'varname' => 'password_numeric',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_password_special_char_required' => array( 'panel_password_special_char_required' => array(
'label' => $lng['serversettings']['panel_password_special_char_required'], 'label' => $lng['serversettings']['panel_password_special_char_required'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'password_special_char_required', 'varname' => 'password_special_char_required',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_password_special_char' => array( 'panel_password_special_char' => array(
'label' => $lng['serversettings']['panel_password_special_char'], 'label' => $lng['serversettings']['panel_password_special_char'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'password_special_char', 'varname' => 'password_special_char',
'type' => 'string', 'type' => 'string',
'default' => '!?<>§$%+#=@', 'default' => '!?<>§$%+#=@',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_password_regex' => array( 'panel_password_regex' => array(
'label' => $lng['serversettings']['panel_password_regex'], 'label' => $lng['serversettings']['panel_password_regex'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'password_regex', 'varname' => 'password_regex',
'type' => 'string', 'type' => 'string',
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'customer_accountprefix' => array( 'customer_accountprefix' => array(
'label' => $lng['serversettings']['accountprefix'], 'label' => $lng['serversettings']['accountprefix'],
'settinggroup' => 'customer', 'settinggroup' => 'customer',
@@ -133,9 +132,11 @@ return array(
'type' => 'string', 'type' => 'string',
'default' => '', 'default' => '',
'plausibility_check_method' => array( 'plausibility_check_method' => array(
'\\Froxlor\\Validate\\Check', 'checkUsername'), '\\Froxlor\\Validate\\Check',
'save_method' => 'storeSettingField', 'checkUsername'
), ),
'save_method' => 'storeSettingField'
),
'customer_mysqlprefix' => array( 'customer_mysqlprefix' => array(
'label' => $lng['serversettings']['mysqlprefix'], 'label' => $lng['serversettings']['mysqlprefix'],
'settinggroup' => 'customer', 'settinggroup' => 'customer',
@@ -143,25 +144,27 @@ return array(
'type' => 'string', 'type' => 'string',
'default' => '', 'default' => '',
'plausibility_check_method' => array( 'plausibility_check_method' => array(
'\\Froxlor\\Validate\\Check', 'checkUsername'), '\\Froxlor\\Validate\\Check',
'save_method' => 'storeSettingField', 'checkUsername'
), ),
'save_method' => 'storeSettingField'
),
'customer_ftpprefix' => array( 'customer_ftpprefix' => array(
'label' => $lng['serversettings']['ftpprefix'], 'label' => $lng['serversettings']['ftpprefix'],
'settinggroup' => 'customer', 'settinggroup' => 'customer',
'varname' => 'ftpprefix', 'varname' => 'ftpprefix',
'type' => 'string', 'type' => 'string',
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'customer_ftpatdomain' => array( 'customer_ftpatdomain' => array(
'label' => $lng['serversettings']['ftpdomain'], 'label' => $lng['serversettings']['ftpdomain'],
'settinggroup' => 'customer', 'settinggroup' => 'customer',
'varname' => 'ftpatdomain', 'varname' => 'ftpatdomain',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_allow_preset' => array( 'panel_allow_preset' => array(
'label' => $lng['serversettings']['allow_password_reset'], 'label' => $lng['serversettings']['allow_password_reset'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -170,14 +173,14 @@ return array(
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'dependency' => array( 'dependency' => array(
'fieldname' => 'panel_allow_preset_admin', 'fieldname' => 'panel_allow_preset_admin',
'fielddata' => array( 'fielddata' => array(
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'allow_preset_admin', 'varname' => 'allow_preset_admin'
), ),
'onlyif' => 0 'onlyif' => 0
) )
), ),
'panel_allow_preset_admin' => array( 'panel_allow_preset_admin' => array(
'label' => $lng['serversettings']['allow_password_reset_admin'], 'label' => $lng['serversettings']['allow_password_reset_admin'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
@@ -186,12 +189,12 @@ return array(
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'dependency' => array( 'dependency' => array(
'fieldname' => 'panel_allow_preset', 'fieldname' => 'panel_allow_preset',
'fielddata' => array( 'fielddata' => array(
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'allow_preset', 'varname' => 'allow_preset'
), ),
'onlyif' => 1 'onlyif' => 1
) )
), ),
'system_backupenabled' => array( 'system_backupenabled' => array(
@@ -202,9 +205,9 @@ return array(
'default' => false, 'default' => false,
'cronmodule' => 'froxlor/backup', 'cronmodule' => 'froxlor/backup',
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'
), )
), )
), )
) )
); );

View File

@@ -14,7 +14,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'crond' => array( 'crond' => array(
@@ -27,40 +26,40 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'file', 'string_type' => 'file',
'default' => '/etc/cron.d/froxlor', 'default' => '/etc/cron.d/froxlor',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_croncmdline' => array( 'system_croncmdline' => array(
'label' => $lng['serversettings']['system_croncmdline'], 'label' => $lng['serversettings']['system_croncmdline'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'croncmdline', 'varname' => 'croncmdline',
'type' => 'string', 'type' => 'string',
'default' => '/usr/bin/nice -n 5 /usr/bin/php -q', 'default' => '/usr/bin/nice -n 5 /usr/bin/php -q',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_crondreload' => array( 'system_crondreload' => array(
'label' => $lng['serversettings']['system_crondreload'], 'label' => $lng['serversettings']['system_crondreload'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'crondreload', 'varname' => 'crondreload',
'type' => 'string', 'type' => 'string',
'default' => '/etc/init.d/cron reload', 'default' => '/etc/init.d/cron reload',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_cron_allowautoupdate' => array( 'system_cron_allowautoupdate' => array(
'label' => $lng['serversettings']['system_cron_allowautoupdate'], 'label' => $lng['serversettings']['system_cron_allowautoupdate'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'cron_allowautoupdate', 'varname' => 'cron_allowautoupdate',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_debug_cron' => array( 'system_debug_cron' => array(
'label' => $lng['serversettings']['cron']['debug'], 'label' => $lng['serversettings']['cron']['debug'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'debug_cron', 'varname' => 'debug_cron',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
) )
) )
) )
) )

View File

@@ -14,7 +14,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'perl' => array( 'perl' => array(
@@ -27,8 +26,10 @@ return array(
'type' => 'string', 'type' => 'string',
'default' => '/usr/bin/perl', 'default' => '/usr/bin/perl',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'websrv_avail' => array('lighttpd') 'websrv_avail' => array(
), 'lighttpd'
)
),
'system_perl_suexecworkaround' => array( 'system_perl_suexecworkaround' => array(
'label' => $lng['serversettings']['perl']['suexecworkaround'], 'label' => $lng['serversettings']['perl']['suexecworkaround'],
'settinggroup' => 'perl', 'settinggroup' => 'perl',
@@ -36,8 +37,10 @@ return array(
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'websrv_avail' => array('apache2') 'websrv_avail' => array(
), 'apache2'
)
),
'system_perl_suexeccgipath' => array( 'system_perl_suexeccgipath' => array(
'label' => $lng['serversettings']['perl']['suexeccgipath'], 'label' => $lng['serversettings']['perl']['suexeccgipath'],
'settinggroup' => 'perl', 'settinggroup' => 'perl',
@@ -46,8 +49,10 @@ return array(
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/var/www/cgi-bin/', 'default' => '/var/www/cgi-bin/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'websrv_avail' => array('apache2') 'websrv_avail' => array(
), 'apache2'
)
),
'perl_server' => array( 'perl_server' => array(
'label' => $lng['serversettings']['perl_server'], 'label' => $lng['serversettings']['perl_server'],
'settinggroup' => 'serversettings', 'settinggroup' => 'serversettings',
@@ -55,11 +60,13 @@ return array(
'type' => 'string', 'type' => 'string',
'default' => 'unix:/var/run/nginx/cgiwrap-dispatch.sock', 'default' => 'unix:/var/run/nginx/cgiwrap-dispatch.sock',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'websrv_avail' => array('nginx') 'websrv_avail' => array(
), 'nginx'
), )
), )
), )
); )
)
);
?> ?>

View File

@@ -16,7 +16,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'statistics' => array( 'statistics' => array(
@@ -29,17 +28,21 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => 2, 'default' => 2,
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array(0 => $lng['admin']['webalizer']['normal'], 1 => $lng['admin']['webalizer']['quiet'], 2 => $lng['admin']['webalizer']['veryquiet']), 'option_options' => array(
'save_method' => 'storeSettingField', 0 => $lng['admin']['webalizer']['normal'],
1 => $lng['admin']['webalizer']['quiet'],
2 => $lng['admin']['webalizer']['veryquiet']
), ),
'save_method' => 'storeSettingField'
),
'system_awstats_enabled' => array( 'system_awstats_enabled' => array(
'label' => $lng['serversettings']['awstats_enabled'], 'label' => $lng['serversettings']['awstats_enabled'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'awstats_enabled', 'varname' => 'awstats_enabled',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_awstats_path' => array( 'system_awstats_path' => array(
'label' => $lng['serversettings']['awstats_path'], 'label' => $lng['serversettings']['awstats_path'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -47,8 +50,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/bin/', 'default' => '/usr/bin/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_awstats_awstatspath' => array( 'system_awstats_awstatspath' => array(
'label' => $lng['serversettings']['awstats_awstatspath'], 'label' => $lng['serversettings']['awstats_awstatspath'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -56,8 +59,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/bin/', 'default' => '/usr/bin/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_awstats_conf' => array( 'system_awstats_conf' => array(
'label' => $lng['serversettings']['awstats_conf'], 'label' => $lng['serversettings']['awstats_conf'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -65,8 +68,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/etc/awstats/', 'default' => '/etc/awstats/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_awstats_icons' => array( 'system_awstats_icons' => array(
'label' => $lng['serversettings']['awstats_icons'], 'label' => $lng['serversettings']['awstats_icons'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -74,11 +77,11 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/share/awstats/icon/', 'default' => '/usr/share/awstats/icon/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
)
) )
) )
) )
); )
);
?> ?>

View File

@@ -16,7 +16,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'mail' => array( 'mail' => array(
@@ -30,8 +29,8 @@ return array(
'default' => 2000, 'default' => 2000,
'int_min' => 1, 'int_min' => 1,
'int_max' => 65535, 'int_max' => 65535,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_vmail_gid' => array( 'system_vmail_gid' => array(
'label' => $lng['serversettings']['vmail_gid'], 'label' => $lng['serversettings']['vmail_gid'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -40,8 +39,8 @@ return array(
'default' => 2000, 'default' => 2000,
'int_min' => 1, 'int_min' => 1,
'int_max' => 65535, 'int_max' => 65535,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_vmail_homedir' => array( 'system_vmail_homedir' => array(
'label' => $lng['serversettings']['vmail_homedir'], 'label' => $lng['serversettings']['vmail_homedir'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -49,8 +48,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/var/customers/mail/', 'default' => '/var/customers/mail/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_vmail_maildirname' => array( 'system_vmail_maildirname' => array(
'label' => $lng['serversettings']['vmail_maildirname'], 'label' => $lng['serversettings']['vmail_maildirname'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -59,48 +58,48 @@ return array(
'string_type' => 'dir', 'string_type' => 'dir',
'default' => 'Maildir', 'default' => 'Maildir',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'panel_sendalternativemail' => array( 'panel_sendalternativemail' => array(
'label' => $lng['serversettings']['sendalternativemail'], 'label' => $lng['serversettings']['sendalternativemail'],
'settinggroup' => 'panel', 'settinggroup' => 'panel',
'varname' => 'sendalternativemail', 'varname' => 'sendalternativemail',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_mail_quota_enabled' => array( 'system_mail_quota_enabled' => array(
'label' => $lng['serversettings']['mail_quota_enabled'], 'label' => $lng['serversettings']['mail_quota_enabled'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'mail_quota_enabled', 'varname' => 'mail_quota_enabled',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_mail_quota' => array( 'system_mail_quota' => array(
'label' => $lng['serversettings']['mail_quota'], 'label' => $lng['serversettings']['mail_quota'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'mail_quota', 'varname' => 'mail_quota',
'type' => 'int', 'type' => 'int',
'default' => 100, 'default' => 100,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_catchall_enabled' => array( 'system_catchall_enabled' => array(
'label' => $lng['serversettings']['catchall_enabled'], 'label' => $lng['serversettings']['catchall_enabled'],
'settinggroup' => 'catchall', 'settinggroup' => 'catchall',
'varname' => 'catchall_enabled', 'varname' => 'catchall_enabled',
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingResetCatchall', 'save_method' => 'storeSettingResetCatchall'
), ),
'system_mailtraffic_enabled' => array( 'system_mailtraffic_enabled' => array(
'label' => $lng['serversettings']['mailtraffic_enabled'], 'label' => $lng['serversettings']['mailtraffic_enabled'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'mailtraffic_enabled', 'varname' => 'mailtraffic_enabled',
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_mdaserver' => array( 'system_mdaserver' => array(
'label' => $lng['serversettings']['mdaserver'], 'label' => $lng['serversettings']['mdaserver'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -108,9 +107,12 @@ return array(
'type' => 'option', 'type' => 'option',
'option_mode' => 'one', 'option_mode' => 'one',
'default' => 'dovecot', 'default' => 'dovecot',
'option_options' => array('courier' => 'Courier', 'dovecot' => 'Dovecot'), 'option_options' => array(
'save_method' => 'storeSettingField', 'courier' => 'Courier',
'dovecot' => 'Dovecot'
), ),
'save_method' => 'storeSettingField'
),
'system_mdalog' => array( 'system_mdalog' => array(
'label' => $lng['serversettings']['mdalog'], 'label' => $lng['serversettings']['mdalog'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -119,8 +121,8 @@ return array(
'string_type' => 'file', 'string_type' => 'file',
'default' => '/var/log/mail.log', 'default' => '/var/log/mail.log',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_mtaserver' => array( 'system_mtaserver' => array(
'label' => $lng['serversettings']['mtaserver'], 'label' => $lng['serversettings']['mtaserver'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -128,9 +130,12 @@ return array(
'type' => 'option', 'type' => 'option',
'option_mode' => 'one', 'option_mode' => 'one',
'default' => 'postfix', 'default' => 'postfix',
'option_options' => array('exim4' => 'Exim4', 'postfix' => 'Postfix'), 'option_options' => array(
'save_method' => 'storeSettingField', 'exim4' => 'Exim4',
'postfix' => 'Postfix'
), ),
'save_method' => 'storeSettingField'
),
'system_mtalog' => array( 'system_mtalog' => array(
'label' => $lng['serversettings']['mtalog'], 'label' => $lng['serversettings']['mtalog'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -139,11 +144,11 @@ return array(
'string_type' => 'file', 'string_type' => 'file',
'default' => '/var/log/mail.log', 'default' => '/var/log/mail.log',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), )
), )
), )
), )
); );
?> ?>

View File

@@ -16,10 +16,9 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'ftpserver' => array( 'ftpserver' => array(
'title' => $lng['admin']['ftpserversettings'], 'title' => $lng['admin']['ftpserversettings'],
'fields' => array( 'fields' => array(
'ftpserver' => array( 'ftpserver' => array(
@@ -29,11 +28,14 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => 'proftpd', 'default' => 'proftpd',
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array('proftpd' => 'Proftpd', 'pureftpd' => 'Pureftpd'), 'option_options' => array(
'save_method' => 'storeSettingField', 'proftpd' => 'Proftpd',
), 'pureftpd' => 'Pureftpd'
), ),
), 'save_method' => 'storeSettingField'
)
)
)
) )
); );

View File

@@ -16,7 +16,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'nameserver' => array( 'nameserver' => array(
@@ -30,7 +29,7 @@ return array(
'default' => true, 'default' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'overview_option' => true 'overview_option' => true
), ),
'system_dnsenabled' => array( 'system_dnsenabled' => array(
'label' => $lng['serversettings']['dnseditorenable'], 'label' => $lng['serversettings']['dnseditorenable'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -38,7 +37,7 @@ return array(
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'
), ),
'system_dns_server' => array( 'system_dns_server' => array(
'label' => $lng['serversettings']['dns_server'], 'label' => $lng['serversettings']['dns_server'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -46,7 +45,10 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => 'bind', 'default' => 'bind',
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array('Bind' => 'Bind9', 'PowerDNS' => 'PowerDNS'), 'option_options' => array(
'Bind' => 'Bind9',
'PowerDNS' => 'PowerDNS'
),
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'
), ),
'system_bindconf_directory' => array( 'system_bindconf_directory' => array(
@@ -56,16 +58,16 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/etc/bind/', 'default' => '/etc/bind/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_bindreload_command' => array( 'system_bindreload_command' => array(
'label' => $lng['serversettings']['bindreload_command'], 'label' => $lng['serversettings']['bindreload_command'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'bindreload_command', 'varname' => 'bindreload_command',
'type' => 'string', 'type' => 'string',
'default' => '/etc/init.d/bind9 reload', 'default' => '/etc/init.d/bind9 reload',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_nameservers' => array( 'system_nameservers' => array(
'label' => $lng['serversettings']['nameservers'], 'label' => $lng['serversettings']['nameservers'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -74,8 +76,8 @@ return array(
'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i', 'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingFieldInsertBindTask', 'save_method' => 'storeSettingFieldInsertBindTask'
), ),
'system_mxservers' => array( 'system_mxservers' => array(
'label' => $lng['serversettings']['mxservers'], 'label' => $lng['serversettings']['mxservers'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -84,8 +86,8 @@ return array(
'string_regexp' => '/^(([0-9]+ [a-z0-9\-\._]+, ?)*[0-9]+ [a-z0-9\-\._]+)?$/i', 'string_regexp' => '/^(([0-9]+ [a-z0-9\-\._]+, ?)*[0-9]+ [a-z0-9\-\._]+)?$/i',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_axfrservers' => array( 'system_axfrservers' => array(
'label' => $lng['serversettings']['axfrservers'], 'label' => $lng['serversettings']['axfrservers'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -95,7 +97,7 @@ return array(
'string_delimiter' => ',', 'string_delimiter' => ',',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_dns_createmailentry' => array( 'system_dns_createmailentry' => array(
'label' => $lng['serversettings']['mail_also_with_mxservers'], 'label' => $lng['serversettings']['mail_also_with_mxservers'],
@@ -104,7 +106,7 @@ return array(
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'
), ),
'system_defaultttl' => array( 'system_defaultttl' => array(
'label' => $lng['serversettings']['defaultttl'], 'label' => $lng['serversettings']['defaultttl'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -113,9 +115,9 @@ return array(
'default' => 604800, /* 1 week */ 'default' => 604800, /* 1 week */
'int_min' => 3600, /* 1 hour */ 'int_min' => 3600, /* 1 hour */
'int_max' => 2147483647, /* integer max */ 'int_max' => 2147483647, /* integer max */
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), )
), )
), )
), )
); );

View File

@@ -16,7 +16,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'logging' => array( 'logging' => array(
@@ -30,7 +29,7 @@ return array(
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'overview_option' => true 'overview_option' => true
), ),
'logger_severity' => array( 'logger_severity' => array(
'label' => $lng['serversettings']['logger']['severity'], 'label' => $lng['serversettings']['logger']['severity'],
'settinggroup' => 'logger', 'settinggroup' => 'logger',
@@ -38,9 +37,12 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => 1, 'default' => 1,
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array(1 => $lng['admin']['logger']['normal'], 2 => $lng['admin']['logger']['paranoid']), 'option_options' => array(
'save_method' => 'storeSettingField', 1 => $lng['admin']['logger']['normal'],
2 => $lng['admin']['logger']['paranoid']
), ),
'save_method' => 'storeSettingField'
),
'logger_logtypes' => array( 'logger_logtypes' => array(
'label' => $lng['serversettings']['logger']['types'], 'label' => $lng['serversettings']['logger']['types'],
'settinggroup' => 'logger', 'settinggroup' => 'logger',
@@ -48,9 +50,13 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => 'syslog,mysql', 'default' => 'syslog,mysql',
'option_mode' => 'multiple', 'option_mode' => 'multiple',
'option_options' => array('syslog' => 'syslog', 'file' => 'file', 'mysql' => 'mysql'), 'option_options' => array(
'save_method' => 'storeSettingField', 'syslog' => 'syslog',
'file' => 'file',
'mysql' => 'mysql'
), ),
'save_method' => 'storeSettingField'
),
'logger_logfile' => array( 'logger_logfile' => array(
'label' => $lng['serversettings']['logger']['logfile'], 'label' => $lng['serversettings']['logger']['logfile'],
'settinggroup' => 'logger', 'settinggroup' => 'logger',
@@ -59,8 +65,8 @@ return array(
'string_type' => 'file', 'string_type' => 'file',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'logger_log_cron' => array( 'logger_log_cron' => array(
'label' => $lng['serversettings']['logger']['logcron'], 'label' => $lng['serversettings']['logger']['logcron'],
'settinggroup' => 'logger', 'settinggroup' => 'logger',
@@ -69,15 +75,15 @@ return array(
'default' => 0, 'default' => 0,
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array( 'option_options' => array(
0 => $lng['serversettings']['logger']['logcronoption']['never'], 0 => $lng['serversettings']['logger']['logcronoption']['never'],
1 => $lng['serversettings']['logger']['logcronoption']['once'], 1 => $lng['serversettings']['logger']['logcronoption']['once'],
2 => $lng['serversettings']['logger']['logcronoption']['always'] 2 => $lng['serversettings']['logger']['logcronoption']['always']
),
'save_method' => 'storeSettingField',
), ),
), 'save_method' => 'storeSettingField'
), )
)
) )
); )
);
?> ?>

View File

@@ -16,7 +16,6 @@
* @package \Froxlor\Settings * @package \Froxlor\Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'dkim' => array( 'dkim' => array(
@@ -30,7 +29,7 @@ return array(
'default' => false, 'default' => false,
'save_method' => 'storeSettingFieldInsertBindTask', 'save_method' => 'storeSettingFieldInsertBindTask',
'overview_option' => true 'overview_option' => true
), ),
'dkim_prefix' => array( 'dkim_prefix' => array(
'label' => $lng['dkim']['dkim_prefix'], 'label' => $lng['dkim']['dkim_prefix'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',
@@ -38,8 +37,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/etc/postfix/dkim/', 'default' => '/etc/postfix/dkim/',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'dkim_domains' => array( 'dkim_domains' => array(
'label' => $lng['dkim']['dkim_domains'], 'label' => $lng['dkim']['dkim_domains'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',
@@ -47,8 +46,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_regexp' => '/^[a-z0-9\._]+$/i', 'string_regexp' => '/^[a-z0-9\._]+$/i',
'default' => 'domains', 'default' => 'domains',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'dkim_dkimkeys' => array( 'dkim_dkimkeys' => array(
'label' => $lng['dkim']['dkim_dkimkeys'], 'label' => $lng['dkim']['dkim_dkimkeys'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',
@@ -56,8 +55,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_regexp' => '/^[a-z0-9\._]+$/i', 'string_regexp' => '/^[a-z0-9\._]+$/i',
'default' => 'dkim-keys.conf', 'default' => 'dkim-keys.conf',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'dkim_algorithm' => array( 'dkim_algorithm' => array(
'label' => $lng['dkim']['dkim_algorithm'], 'label' => $lng['dkim']['dkim_algorithm'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',
@@ -65,9 +64,13 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => 'all', 'default' => 'all',
'option_mode' => 'multiple', 'option_mode' => 'multiple',
'option_options' => array('all' => 'All', 'sha1' => 'SHA1', 'sha256' => 'SHA256'), 'option_options' => array(
'save_method' => 'storeSettingFieldInsertBindTask', 'all' => 'All',
'sha1' => 'SHA1',
'sha256' => 'SHA256'
), ),
'save_method' => 'storeSettingFieldInsertBindTask'
),
'dkim_servicetype' => array( 'dkim_servicetype' => array(
'label' => $lng['dkim']['dkim_servicetype'], 'label' => $lng['dkim']['dkim_servicetype'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',
@@ -75,9 +78,12 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => '0', 'default' => '0',
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array('0' => 'All', '1' => 'E-Mail'), 'option_options' => array(
'save_method' => 'storeSettingFieldInsertBindTask', '0' => 'All',
'1' => 'E-Mail'
), ),
'save_method' => 'storeSettingFieldInsertBindTask'
),
'dkim_keylength' => array( 'dkim_keylength' => array(
'label' => array( 'label' => array(
'title' => $lng['dkim']['dkim_keylength']['title'], 'title' => $lng['dkim']['dkim_keylength']['title'],
@@ -88,9 +94,12 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => '1024', 'default' => '1024',
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array('1024' => '1024 Bit', '2048' => '2048 Bit'), 'option_options' => array(
'save_method' => 'storeSettingFieldInsertBindTask', '1024' => '1024 Bit',
'2048' => '2048 Bit'
), ),
'save_method' => 'storeSettingFieldInsertBindTask'
),
'dkim_notes' => array( 'dkim_notes' => array(
'label' => $lng['dkim']['dkim_notes'], 'label' => $lng['dkim']['dkim_notes'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',
@@ -98,16 +107,16 @@ return array(
'type' => 'string', 'type' => 'string',
'string_regexp' => '/^[a-z0-9\._]+$/i', 'string_regexp' => '/^[a-z0-9\._]+$/i',
'default' => '', 'default' => '',
'save_method' => 'storeSettingFieldInsertBindTask', 'save_method' => 'storeSettingFieldInsertBindTask'
), ),
'dkim_add_adsp' => array( 'dkim_add_adsp' => array(
'label' => $lng['dkim']['dkim_add_adsp'], 'label' => $lng['dkim']['dkim_add_adsp'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',
'varname' => 'dkim_add_adsp', 'varname' => 'dkim_add_adsp',
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingFieldInsertBindTask', 'save_method' => 'storeSettingFieldInsertBindTask'
), ),
'dkim_add_adsppolicy' => array( 'dkim_add_adsppolicy' => array(
'label' => $lng['dkim']['dkim_add_adsppolicy'], 'label' => $lng['dkim']['dkim_add_adsppolicy'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',
@@ -115,20 +124,24 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => '1', 'default' => '1',
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array('0' => 'Unknown', '1' => 'All', '2' => 'Discardable'), 'option_options' => array(
'save_method' => 'storeSettingFieldInsertBindTask', '0' => 'Unknown',
'1' => 'All',
'2' => 'Discardable'
), ),
'save_method' => 'storeSettingFieldInsertBindTask'
),
'dkimrestart_command' => array( 'dkimrestart_command' => array(
'label' => $lng['dkim']['dkimrestart_command'], 'label' => $lng['dkim']['dkimrestart_command'],
'settinggroup' => 'dkim', 'settinggroup' => 'dkim',
'varname' => 'dkimrestart_command', 'varname' => 'dkimrestart_command',
'type' => 'string', 'type' => 'string',
'default' => '/etc/init.d/dkim-filter restart', 'default' => '/etc/init.d/dkim-filter restart',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), )
), )
), )
), )
); );
?> ?>

View File

@@ -14,7 +14,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'spf' => array( 'spf' => array(
@@ -28,7 +27,7 @@ return array(
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
'overview_option' => true 'overview_option' => true
), ),
'spf_entry' => array( 'spf_entry' => array(
'label' => $lng['spf']['spf_entry'], 'label' => $lng['spf']['spf_entry'],
'settinggroup' => 'spf', 'settinggroup' => 'spf',
@@ -36,10 +35,10 @@ return array(
'type' => 'string', 'type' => 'string',
'default' => '"v=spf1 a mx -all"', 'default' => '"v=spf1 a mx -all"',
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'
)
) )
) )
) )
); )
);
?> ?>

View File

@@ -16,7 +16,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'security' => array( 'security' => array(
@@ -28,16 +27,16 @@ return array(
'varname' => 'unix_names', 'varname' => 'unix_names',
'type' => 'bool', 'type' => 'bool',
'default' => true, 'default' => true,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_mailpwcleartext' => array( 'system_mailpwcleartext' => array(
'label' => $lng['serversettings']['mailpwcleartext'], 'label' => $lng['serversettings']['mailpwcleartext'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'mailpwcleartext', 'varname' => 'mailpwcleartext',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_passwordcryptfunc' => array( 'system_passwordcryptfunc' => array(
'label' => $lng['serversettings']['passwordcryptfunc'], 'label' => $lng['serversettings']['passwordcryptfunc'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -45,33 +44,36 @@ return array(
'type' => 'option', 'type' => 'option',
'default' => 0, 'default' => 0,
'option_mode' => 'one', 'option_mode' => 'one',
'option_options_method' => array('\\Froxlor\\System\\Crypt', 'getAvailablePasswordHashes'), 'option_options_method' => array(
'save_method' => 'storeSettingField', '\\Froxlor\\System\\Crypt',
'getAvailablePasswordHashes'
), ),
'save_method' => 'storeSettingField'
),
'system_allow_error_report_admin' => array( 'system_allow_error_report_admin' => array(
'label' => $lng['serversettings']['allow_error_report_admin'], 'label' => $lng['serversettings']['allow_error_report_admin'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'allow_error_report_admin', 'varname' => 'allow_error_report_admin',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_allow_error_report_customer' => array( 'system_allow_error_report_customer' => array(
'label' => $lng['serversettings']['allow_error_report_customer'], 'label' => $lng['serversettings']['allow_error_report_customer'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'allow_error_report_customer', 'varname' => 'allow_error_report_customer',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_allow_customer_shell' => array( 'system_allow_customer_shell' => array(
'label' => $lng['serversettings']['allow_allow_customer_shell'], 'label' => $lng['serversettings']['allow_allow_customer_shell'],
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'allow_customer_shell', 'varname' => 'allow_customer_shell',
'type' => 'bool', 'type' => 'bool',
'default' => false, 'default' => false,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_available_shells' => array( 'system_available_shells' => array(
'label' => $lng['serversettings']['available_shells'], 'label' => $lng['serversettings']['available_shells'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -79,9 +81,9 @@ return array(
'type' => 'string', 'type' => 'string',
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
)
) )
) )
) )
); )
);

View File

@@ -13,7 +13,6 @@
* @package Settings * @package Settings
* *
*/ */
return array( return array(
'groups' => array( 'groups' => array(
'diskquota' => array( 'diskquota' => array(
@@ -34,7 +33,7 @@ return array(
'varname' => 'diskquota_repquota_path', 'varname' => 'diskquota_repquota_path',
'type' => 'string', 'type' => 'string',
'default' => '/usr/sbin/repquota', 'default' => '/usr/sbin/repquota',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'diskquota_quotatool_path' => array( 'diskquota_quotatool_path' => array(
'label' => $lng['serversettings']['diskquota_quotatool_path']['description'], 'label' => $lng['serversettings']['diskquota_quotatool_path']['description'],
@@ -42,7 +41,7 @@ return array(
'varname' => 'diskquota_quotatool_path', 'varname' => 'diskquota_quotatool_path',
'type' => 'string', 'type' => 'string',
'default' => '/usr/bin/quotatool', 'default' => '/usr/bin/quotatool',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'diskquota_customer_partition' => array( 'diskquota_customer_partition' => array(
'label' => $lng['serversettings']['diskquota_customer_partition']['description'], 'label' => $lng['serversettings']['diskquota_customer_partition']['description'],
@@ -50,11 +49,11 @@ return array(
'varname' => 'diskquota_customer_partition', 'varname' => 'diskquota_customer_partition',
'type' => 'string', 'type' => 'string',
'default' => '/dev/root', 'default' => '/dev/root',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), )
), )
), )
), )
); );
?> ?>

View File

@@ -1,415 +1,440 @@
<?php <?php
/* /*
+----------------------------------------------------------------------+ * +----------------------------------------------------------------------+
| APC | * | APC |
+----------------------------------------------------------------------+ * +----------------------------------------------------------------------+
| Copyright (c) 2006-2011 The PHP Group | * | Copyright (c) 2006-2011 The PHP Group |
+----------------------------------------------------------------------+ * +----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, | * | This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is | * | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: | * | available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt | * | http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to | * | If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to | * | obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. | * | license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+ * +----------------------------------------------------------------------+
| Authors: Ralf Becker <beckerr@php.net> | * | Authors: Ralf Becker <beckerr@php.net> |
| Rasmus Lerdorf <rasmus@php.net> | * | Rasmus Lerdorf <rasmus@php.net> |
| Ilia Alshanetsky <ilia@prohost.org> | * | Ilia Alshanetsky <ilia@prohost.org> |
+----------------------------------------------------------------------+ * +----------------------------------------------------------------------+
*
All other licensing and usage conditions are those of the PHP Group. * All other licensing and usage conditions are those of the PHP Group.
*
Based on https://github.com/krakjoe/apcu/blob/master/apc.php * Based on https://github.com/krakjoe/apcu/blob/master/apc.php
Implemented into Froxlor: Janos Muzsi <muzsij@hypernics.hu> * Implemented into Froxlor: Janos Muzsi <muzsij@hypernics.hu>
*
*/ */
define('AREA', 'admin'); define('AREA', 'admin');
require './lib/init.php'; require './lib/init.php';
$horizontal_bar_size = 950; // 1280px window width $horizontal_bar_size = 950; // 1280px window width
if ($action == 'delete' && if ($action == 'delete' && function_exists('apcu_clear_cache') && $userinfo['change_serversettings'] == '1') {
function_exists('apcu_clear_cache') && apcu_clear_cache();
$userinfo['change_serversettings'] == '1' $log->logAction(ADM_ACTION, LOG_INFO, "cleared APCu cache");
) { header('Location: ' . $linker->getLink(array(
apcu_clear_cache(); 'section' => 'apcuinfo',
$log->logAction(ADM_ACTION, LOG_INFO, "cleared APCu cache"); 'page' => 'showinfo'
header('Location: ' . $linker->getLink(array('section' => 'apcuinfo', 'page' => 'showinfo'))); )));
exit(); exit();
} }
if (!function_exists('apcu_cache_info') || if (! function_exists('apcu_cache_info') || ! function_exists('apcu_sma_info')) {
!function_exists('apcu_sma_info') \Froxlor\UI\Response::standard_error($lng['error']['no_apcuinfo']);
) {
\Froxlor\UI\Response::standard_error($lng['error']['no_apcuinfo']);
} }
if ($page == 'showinfo' if ($page == 'showinfo') {
) { $cache = apcu_cache_info();
$cache = apcu_cache_info(); $mem = apcu_sma_info();
$mem = apcu_sma_info(); $time = time();
$time = time(); $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_apcuinfo");
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_apcuinfo");
$passtime = $time - $cache['start_time'] > 0 ? $time - $cache['start_time'] : 1; // zero division $passtime = $time - $cache['start_time'] > 0 ? $time - $cache['start_time'] : 1; // zero division
$mem_size = $mem['num_seg'] * $mem['seg_size']; $mem_size = $mem['num_seg'] * $mem['seg_size'];
$mem_avail = $mem['avail_mem']; $mem_avail = $mem['avail_mem'];
$mem_used = $mem_size - $mem_avail; $mem_used = $mem_size - $mem_avail;
$seg_size = bsize($mem['seg_size']); $seg_size = bsize($mem['seg_size']);
$sharedmem = sprintf($lng['apcuinfo']['sharedmemval'], $mem['num_seg'], $seg_size, $cache['memory_type']); $sharedmem = sprintf($lng['apcuinfo']['sharedmemval'], $mem['num_seg'], $seg_size, $cache['memory_type']);
$req_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits'] + $cache['num_misses']) / $passtime) : 0); $req_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits'] + $cache['num_misses']) / $passtime) : 0);
$hit_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits']) / $passtime) : 0); $hit_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits']) / $passtime) : 0);
$miss_rate_user = sprintf("%.2f", $cache['num_misses'] ? (($cache['num_misses']) / $passtime) : 0); $miss_rate_user = sprintf("%.2f", $cache['num_misses'] ? (($cache['num_misses']) / $passtime) : 0);
$insert_rate_user = sprintf("%.2f", $cache['num_inserts'] ? (($cache['num_inserts']) / $passtime) : 0); $insert_rate_user = sprintf("%.2f", $cache['num_inserts'] ? (($cache['num_inserts']) / $passtime) : 0);
$apcversion = phpversion('apcu'); $apcversion = phpversion('apcu');
$phpversion = phpversion(); $phpversion = phpversion();
$number_vars = $cache['num_entries']; $number_vars = $cache['num_entries'];
$starttime = date('Y-m-d H:i:s', $cache['start_time']); $starttime = date('Y-m-d H:i:s', $cache['start_time']);
$uptime_duration = duration($cache['start_time']); $uptime_duration = duration($cache['start_time']);
$size_vars = bsize($cache['mem_size']); $size_vars = bsize($cache['mem_size']);
// check for possible empty values that are used in the templates // check for possible empty values that are used in the templates
if (!isset($cache['file_upload_progress'])) { if (! isset($cache['file_upload_progress'])) {
$cache['file_upload_progress'] = $lng['logger']['unknown']; $cache['file_upload_progress'] = $lng['logger']['unknown'];
} }
if (!isset($cache['num_expunges'])) { if (! isset($cache['num_expunges'])) {
$cache['num_expunges'] = $lng['logger']['unknown']; $cache['num_expunges'] = $lng['logger']['unknown'];
} }
$runtimelines = ''; $runtimelines = '';
foreach (ini_get_all('apcu') as $name => $v) { foreach (ini_get_all('apcu') as $name => $v) {
$value = $v['local_value']; $value = $v['local_value'];
eval("\$runtimelines.=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/runtime_line") . "\";"); eval("\$runtimelines.=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/runtime_line") . "\";");
} }
$freemem = bsize($mem_avail) . sprintf(" (%.1f%%)", $mem_avail * 100 / $mem_size); $freemem = bsize($mem_avail) . sprintf(" (%.1f%%)", $mem_avail * 100 / $mem_size);
$usedmem = bsize($mem_used) . sprintf(" (%.1f%%)", $mem_used * 100 / $mem_size); $usedmem = bsize($mem_used) . sprintf(" (%.1f%%)", $mem_used * 100 / $mem_size);
$hits = $cache['num_hits'] . @sprintf(" (%.1f%%)", $cache['num_hits'] * 100 / ($cache['num_hits'] + $cache['num_misses'])); $hits = $cache['num_hits'] . @sprintf(" (%.1f%%)", $cache['num_hits'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
$misses = $cache['num_misses'] . @sprintf(" (%.1f%%)", $cache['num_misses'] * 100 / ($cache['num_hits'] + $cache['num_misses'])); $misses = $cache['num_misses'] . @sprintf(" (%.1f%%)", $cache['num_misses'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
// Fragementation: (freeseg - 1) / total_seg // Fragementation: (freeseg - 1) / total_seg
$nseg = $freeseg = $fragsize = $freetotal = 0; $nseg = $freeseg = $fragsize = $freetotal = 0;
for ($i = 0; $i < $mem['num_seg']; $i++) { for ($i = 0; $i < $mem['num_seg']; $i ++) {
$ptr = 0; $ptr = 0;
foreach ($mem['block_lists'][$i] as $block) { foreach ($mem['block_lists'][$i] as $block) {
if ($block['offset'] != $ptr) { if ($block['offset'] != $ptr) {
++$nseg; ++ $nseg;
} }
$ptr = $block['offset'] + $block['size']; $ptr = $block['offset'] + $block['size'];
/* Only consider blocks <5M for the fragmentation % */ /* Only consider blocks <5M for the fragmentation % */
if ($block['size'] < (5 * 1024 * 1024)) if ($block['size'] < (5 * 1024 * 1024))
$fragsize+=$block['size']; $fragsize += $block['size'];
$freetotal+=$block['size']; $freetotal += $block['size'];
} }
$freeseg += count($mem['block_lists'][$i]); $freeseg += count($mem['block_lists'][$i]);
} }
if ($freeseg > 1) { if ($freeseg > 1) {
$frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize / $freetotal) * 100, bsize($fragsize), bsize($freetotal), $freeseg); $frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize / $freetotal) * 100, bsize($fragsize), bsize($freetotal), $freeseg);
} else { } else {
$frag = "0%"; $frag = "0%";
} }
foreach (ini_get_all('apcu') as $name => $v) { foreach (ini_get_all('apcu') as $name => $v) {
$value = $v['local_value']; $value = $v['local_value'];
} }
$img_src1 = ''; $img_src1 = '';
$img_src2 = ''; $img_src2 = '';
$img_src3 = ''; $img_src3 = '';
if (graphics_avail()) { if (graphics_avail()) {
$img_src = $linker->getLink(array('section' => 'apcuinfo', 'page' => 'img1', 'action' => mt_rand(0, 1000000))); $img_src = $linker->getLink(array(
eval("\$img_src1=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";"); 'section' => 'apcuinfo',
$img_src = $linker->getLink(array('section' => 'apcuinfo', 'page' => 'img2', 'action' => mt_rand(0, 1000000))); 'page' => 'img1',
eval("\$img_src2=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";"); 'action' => mt_rand(0, 1000000)
$img_src = $linker->getLink(array('section' => 'apcuinfo', 'page' => 'img3', 'action' => mt_rand(0, 1000000))); ));
eval("\$img_src3=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";"); eval("\$img_src1=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";");
} $img_src = $linker->getLink(array(
'section' => 'apcuinfo',
'page' => 'img2',
'action' => mt_rand(0, 1000000)
));
eval("\$img_src2=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";");
$img_src = $linker->getLink(array(
'section' => 'apcuinfo',
'page' => 'img3',
'action' => mt_rand(0, 1000000)
));
eval("\$img_src3=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";");
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/showinfo") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/showinfo") . "\";");
} elseif ($page == 'img1') {
} elseif ($page == 'img1'
) {
$mem = apcu_sma_info(); $mem = apcu_sma_info();
$size = 460; $size = 460;
$image = imagecreate($size + 5, $size + 5); $image = imagecreate($size + 5, $size + 5);
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); $col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30); $col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60); $col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
$col_black = imagecolorallocate($image, 0, 0, 0); $col_black = imagecolorallocate($image, 0, 0, 0);
imagecolortransparent($image, $col_white); imagecolortransparent($image, $col_white);
$s = $mem['num_seg'] * $mem['seg_size']; $s = $mem['num_seg'] * $mem['seg_size'];
$a = $mem['avail_mem']; $a = $mem['avail_mem'];
$x = $y = $size / 2; $x = $y = $size / 2;
$fuzz = 0.000001; $fuzz = 0.000001;
// This block of code creates the pie chart. It is a lot more complex than you // This block of code creates the pie chart. It is a lot more complex than you
// would expect because we try to visualize any memory fragmentation as well. // would expect because we try to visualize any memory fragmentation as well.
$angle_from = 0; $angle_from = 0;
$string_placement = array(); $string_placement = array();
for ($i = 0; $i < $mem['num_seg']; $i++) { for ($i = 0; $i < $mem['num_seg']; $i ++) {
$ptr = 0; $ptr = 0;
$free = $mem['block_lists'][$i]; $free = $mem['block_lists'][$i];
uasort($free, 'block_sort'); uasort($free, 'block_sort');
foreach ($free as $block) { foreach ($free as $block) {
if ($block['offset'] != $ptr) { // Used block if ($block['offset'] != $ptr) { // Used block
$angle_to = $angle_from + ($block['offset'] - $ptr) / $s; $angle_to = $angle_from + ($block['offset'] - $ptr) / $s;
if (($angle_to + $fuzz) > 1) if (($angle_to + $fuzz) > 1)
$angle_to = 1; $angle_to = 1;
if (($angle_to * 360) - ($angle_from * 360) >= 1) { if (($angle_to * 360) - ($angle_from * 360) >= 1) {
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red); fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
if (($angle_to - $angle_from) > 0.05) { if (($angle_to - $angle_from) > 0.05) {
array_push($string_placement, array($angle_from, $angle_to)); array_push($string_placement, array(
} $angle_from,
} $angle_to
$angle_from = $angle_to; ));
} }
$angle_to = $angle_from + ($block['size']) / $s; }
if (($angle_to + $fuzz) > 1) $angle_from = $angle_to;
$angle_to = 1; }
if (($angle_to * 360) - ($angle_from * 360) >= 1) { $angle_to = $angle_from + ($block['size']) / $s;
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_green); if (($angle_to + $fuzz) > 1)
if (($angle_to - $angle_from) > 0.05) { $angle_to = 1;
array_push($string_placement, array($angle_from, $angle_to)); if (($angle_to * 360) - ($angle_from * 360) >= 1) {
} fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_green);
} if (($angle_to - $angle_from) > 0.05) {
$angle_from = $angle_to; array_push($string_placement, array(
$ptr = $block['offset'] + $block['size']; $angle_from,
} $angle_to
if ($ptr < $mem['seg_size']) { // memory at the end ));
$angle_to = $angle_from + ($mem['seg_size'] - $ptr) / $s; }
if (($angle_to + $fuzz) > 1) }
$angle_to = 1; $angle_from = $angle_to;
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red); $ptr = $block['offset'] + $block['size'];
if (($angle_to - $angle_from) > 0.05) { }
array_push($string_placement, array($angle_from, $angle_to)); if ($ptr < $mem['seg_size']) { // memory at the end
} $angle_to = $angle_from + ($mem['seg_size'] - $ptr) / $s;
} if (($angle_to + $fuzz) > 1)
} $angle_to = 1;
foreach ($string_placement as $angle) { fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
text_arc($image, $x, $y, $size, $angle[0] * 360, $angle[1] * 360, $col_black, bsize($s * ($angle[1] - $angle[0]))); if (($angle_to - $angle_from) > 0.05) {
} array_push($string_placement, array(
$angle_from,
$angle_to
));
}
}
}
foreach ($string_placement as $angle) {
text_arc($image, $x, $y, $size, $angle[0] * 360, $angle[1] * 360, $col_black, bsize($s * ($angle[1] - $angle[0])));
}
header("Content-type: image/png"); header("Content-type: image/png");
imagepng($image); imagepng($image);
exit; exit();
} elseif ($page == 'img2' } elseif ($page == 'img2') {
) {
$cache = apcu_cache_info(); $cache = apcu_cache_info();
$size = $horizontal_bar_size; $size = $horizontal_bar_size;
$image = imagecreate($size + 5, 140); $image = imagecreate($size + 5, 140);
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); $col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30); $col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60); $col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
$col_black = imagecolorallocate($image, 0, 0, 0); $col_black = imagecolorallocate($image, 0, 0, 0);
imagecolortransparent($image, $col_white); imagecolortransparent($image, $col_white);
$s = $cache['num_hits'] + $cache['num_misses']; $s = $cache['num_hits'] + $cache['num_misses'];
$a = $cache['num_hits']; $a = $cache['num_hits'];
fill_box($image, 1, 10, $s ? ($a * ($size - 21) / $s) : $size, 50, $col_black, $col_green/* , sprintf("%.1f%%", $s ? $cache['num_hits'] * 100 / $s : 0) */); fill_box($image, 1, 10, $s ? ($a * ($size - 21) / $s) : $size, 50, $col_black, $col_green /* , sprintf("%.1f%%", $s ? $cache['num_hits'] * 100 / $s : 0) */
fill_box($image, 1, 80, $s ? max(4, ($s - $a) * ($size - 21) / $s) : $size, 50, $col_black, $col_red/* , sprintf("%.1f%%", $s ? $cache['num_misses'] * 100 / $s : 0) */); );
fill_box($image, 1, 80, $s ? max(4, ($s - $a) * ($size - 21) / $s) : $size, 50, $col_black, $col_red /* , sprintf("%.1f%%", $s ? $cache['num_misses'] * 100 / $s : 0) */
);
header("Content-type: image/png"); header("Content-type: image/png");
imagepng($image); imagepng($image);
exit; exit();
} elseif ($page == 'img3' } elseif ($page == 'img3') {
) {
$mem = apcu_sma_info(); $mem = apcu_sma_info();
$size = $horizontal_bar_size; $size = $horizontal_bar_size;
$image = imagecreate($size, 70); $image = imagecreate($size, 70);
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); $col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30); $col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60); $col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
$col_black = imagecolorallocate($image, 0, 0, 0); $col_black = imagecolorallocate($image, 0, 0, 0);
imagecolortransparent($image, $col_white); imagecolortransparent($image, $col_white);
$s = $mem['num_seg'] * $mem['seg_size']; $s = $mem['num_seg'] * $mem['seg_size'];
$a = $mem['avail_mem']; $a = $mem['avail_mem'];
$x = 10; $x = 10;
$y = 0; $y = 0;
// This block of code creates the bar chart. It is a lot more complex than you // This block of code creates the bar chart. It is a lot more complex than you
// would expect because we try to visualize any memory fragmentation as well. // would expect because we try to visualize any memory fragmentation as well.
for ($i = 0; $i < $mem['num_seg']; $i++) { for ($i = 0; $i < $mem['num_seg']; $i ++) {
$ptr = 0; $ptr = 0;
$free = $mem['block_lists'][$i]; $free = $mem['block_lists'][$i];
uasort($free, 'block_sort'); uasort($free, 'block_sort');
foreach ($free as $block) { foreach ($free as $block) {
if ($block['offset'] != $ptr) { // Used block if ($block['offset'] != $ptr) { // Used block
$h = ($size - 5) * ($block['offset'] - $ptr) / $s; $h = ($size - 5) * ($block['offset'] - $ptr) / $s;
if ($h > 0) { if ($h > 0) {
fill_box($image, $y, $x, $h, 50, $col_black, $col_red); fill_box($image, $y, $x, $h, 50, $col_black, $col_red);
} }
$y+=$h; $y += $h;
} }
$h = ($size - 5) * ($block['size']) / $s; $h = ($size - 5) * ($block['size']) / $s;
if ($h > 0) { if ($h > 0) {
fill_box($image, $y, $x, $h, 50, $col_black, $col_green); fill_box($image, $y, $x, $h, 50, $col_black, $col_green);
} }
$y+=$h; $y += $h;
$ptr = $block['offset'] + $block['size']; $ptr = $block['offset'] + $block['size'];
} }
if ($ptr < $mem['seg_size']) { // memory at the end if ($ptr < $mem['seg_size']) { // memory at the end
$h = ($size - 5) * ($mem['seg_size'] - $ptr) / $s; $h = ($size - 5) * ($mem['seg_size'] - $ptr) / $s;
if ($h > 0) { if ($h > 0) {
fill_box($image, $y, $x, $h, 50, $col_black, $col_red, bsize($mem['seg_size'] - $ptr), $j++); fill_box($image, $y, $x, $h, 50, $col_black, $col_red, bsize($mem['seg_size'] - $ptr), $j ++);
} }
} }
} }
header("Content-type: image/png"); header("Content-type: image/png");
imagepng($image); imagepng($image);
exit; exit();
} }
function graphics_avail() { function graphics_avail()
return extension_loaded('gd'); {
return extension_loaded('gd');
} }
// pretty printer for byte values // pretty printer for byte values
// //
function bsize($s) { function bsize($s)
foreach (array('', 'K', 'M', 'G') as $i => $k) { {
if ($s < 1024) foreach (array(
break; '',
$s/=1024; 'K',
} 'M',
return sprintf("%5.1f %sBytes", $s, $k); 'G'
) as $i => $k) {
if ($s < 1024)
break;
$s /= 1024;
}
return sprintf("%5.1f %sBytes", $s, $k);
} }
function duration($ts) { function duration($ts)
global $time; {
$years = (int) ((($time - $ts) / (7 * 86400)) / 52.177457); global $time;
$rem = (int) (($time - $ts) - ($years * 52.177457 * 7 * 86400)); $years = (int) ((($time - $ts) / (7 * 86400)) / 52.177457);
$weeks = (int) (($rem) / (7 * 86400)); $rem = (int) (($time - $ts) - ($years * 52.177457 * 7 * 86400));
$days = (int) (($rem) / 86400) - $weeks * 7; $weeks = (int) (($rem) / (7 * 86400));
$hours = (int) (($rem) / 3600) - $days * 24 - $weeks * 7 * 24; $days = (int) (($rem) / 86400) - $weeks * 7;
$mins = (int) (($rem) / 60) - $hours * 60 - $days * 24 * 60 - $weeks * 7 * 24 * 60; $hours = (int) (($rem) / 3600) - $days * 24 - $weeks * 7 * 24;
$str = ''; $mins = (int) (($rem) / 60) - $hours * 60 - $days * 24 * 60 - $weeks * 7 * 24 * 60;
if ($years == 1) $str = '';
$str .= "$years year, "; if ($years == 1)
if ($years > 1) $str .= "$years year, ";
$str .= "$years years, "; if ($years > 1)
if ($weeks == 1) $str .= "$years years, ";
$str .= "$weeks week, "; if ($weeks == 1)
if ($weeks > 1) $str .= "$weeks week, ";
$str .= "$weeks weeks, "; if ($weeks > 1)
if ($days == 1) $str .= "$weeks weeks, ";
$str .= "$days day,"; if ($days == 1)
if ($days > 1) $str .= "$days day,";
$str .= "$days days,"; if ($days > 1)
if ($hours == 1) $str .= "$days days,";
$str .= " $hours hour and"; if ($hours == 1)
if ($hours > 1) $str .= " $hours hour and";
$str .= " $hours hours and"; if ($hours > 1)
if ($mins == 1) $str .= " $hours hours and";
$str .= " 1 minute"; if ($mins == 1)
else $str .= " 1 minute";
$str .= " $mins minutes"; else
return $str; $str .= " $mins minutes";
return $str;
} }
function block_sort($array1, $array2) { function block_sort($array1, $array2)
if ($array1['offset'] > $array2['offset']) { {
return 1; if ($array1['offset'] > $array2['offset']) {
} else { return 1;
return -1; } else {
} return - 1;
}
} }
function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $color2, $text = '', $placeindex = 0) { function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $color2, $text = '', $placeindex = 0)
$r = $diameter / 2; {
$w = deg2rad((360 + $start + ($end - $start) / 2) % 360); $r = $diameter / 2;
$w = deg2rad((360 + $start + ($end - $start) / 2) % 360);
if (function_exists("imagefilledarc")) {
if (function_exists("imagefilledarc")) { // exists only if GD 2.0.1 is available
// exists only if GD 2.0.1 is available imagefilledarc($im, $centerX + 1, $centerY + 1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE);
imagefilledarc($im, $centerX + 1, $centerY + 1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE); imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE);
imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE); imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL | IMG_ARC_EDGED);
imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL | IMG_ARC_EDGED); } else {
} else { imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2);
imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2); imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start + 1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start + 1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end - 1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end - 1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); imagefill($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $color2);
imagefill($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $color2); }
} if ($text) {
if ($text) { if ($placeindex > 0) {
if ($placeindex > 0) { imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1);
imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1); imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1);
imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1); } else {
} else { imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1);
imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1); }
} }
}
} }
function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $text, $placeindex = 0) { function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $text, $placeindex = 0)
$r = $diameter / 2; {
$w = deg2rad((360 + $start + ($end - $start) / 2) % 360); $r = $diameter / 2;
$w = deg2rad((360 + $start + ($end - $start) / 2) % 360);
if ($placeindex > 0) { if ($placeindex > 0) {
imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1); imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1);
imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1); imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1);
} else { } else {
imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1); imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1);
} }
} }
function fill_box($im, $x, $y, $w, $h, $color1, $color2, $text = '', $placeindex = '') { function fill_box($im, $x, $y, $w, $h, $color1, $color2, $text = '', $placeindex = '')
global $col_black; {
$x1 = $x + $w - 1; global $col_black;
$y1 = $y + $h - 1; $x1 = $x + $w - 1;
$y1 = $y + $h - 1;
imagerectangle($im, $x, $y1, $x1 + 1, $y + 1, $col_black); imagerectangle($im, $x, $y1, $x1 + 1, $y + 1, $col_black);
if ($y1 > $y) if ($y1 > $y)
imagefilledrectangle($im, $x, $y, $x1, $y1, $color2); imagefilledrectangle($im, $x, $y, $x1, $y1, $color2);
else else
imagefilledrectangle($im, $x, $y1, $x1, $y, $color2); imagefilledrectangle($im, $x, $y1, $x1, $y, $color2);
imagerectangle($im, $x, $y1, $x1, $y, $color1); imagerectangle($im, $x, $y1, $x1, $y, $color1);
if ($text) { if ($text) {
if ($placeindex > 0) { if ($placeindex > 0) {
if ($placeindex < 16) { if ($placeindex < 16) {
$px = 5; $px = 5;
$py = $placeindex * 12 + 6; $py = $placeindex * 12 + 6;
imagefilledrectangle($im, $px + 90, $py + 3, $px + 90 - 4, $py - 3, $color2); imagefilledrectangle($im, $px + 90, $py + 3, $px + 90 - 4, $py - 3, $color2);
imageline($im, $x, $y + $h / 2, $px + 90, $py, $color2); imageline($im, $x, $y + $h / 2, $px + 90, $py, $color2);
imagestring($im, 2, $px, $py - 6, $text, $color1); imagestring($im, 2, $px, $py - 6, $text, $color1);
} else { } else {
if ($placeindex < 31) { if ($placeindex < 31) {
$px = $x + 40 * 2; $px = $x + 40 * 2;
$py = ($placeindex - 15) * 12 + 6; $py = ($placeindex - 15) * 12 + 6;
} else { } else {
$px = $x + 40 * 2 + 100 * intval(($placeindex - 15) / 15); $px = $x + 40 * 2 + 100 * intval(($placeindex - 15) / 15);
$py = ($placeindex % 15) * 12 + 6; $py = ($placeindex % 15) * 12 + 6;
} }
imagefilledrectangle($im, $px, $py + 3, $px - 4, $py - 3, $color2); imagefilledrectangle($im, $px, $py + 3, $px - 4, $py - 3, $color2);
imageline($im, $x + $w, $y + $h / 2, $px, $py, $color2); imageline($im, $x + $w, $y + $h / 2, $px, $py, $color2);
imagestring($im, 2, $px + 2, $py - 6, $text, $color1); imagestring($im, 2, $px + 2, $py - 6, $text, $color1);
} }
} else { } else {
imagestring($im, 4, $x + 5, $y1 - 16, $text, $color1); imagestring($im, 4, $x + 5, $y1 - 16, $text, $color1);
} }
} }
} }

View File

@@ -20,7 +20,7 @@
define('AREA', 'admin'); define('AREA', 'admin');
require './lib/init.php'; require './lib/init.php';
use \Froxlor\Http\HttpClient; use Froxlor\Http\HttpClient;
// define update-uri // define update-uri
define('UPDATE_URI', "https://version.froxlor.org/Froxlor/api/" . $version); define('UPDATE_URI', "https://version.froxlor.org/Froxlor/api/" . $version);
@@ -38,26 +38,26 @@ if (! extension_loaded('zip')) {
// display initial version check // display initial version check
if ($page == 'overview') { if ($page == 'overview') {
// log our actions // log our actions
$log->logAction(ADM_ACTION, LOG_NOTICE, "checking auto-update"); $log->logAction(ADM_ACTION, LOG_NOTICE, "checking auto-update");
// check for new version // check for new version
$latestversion = HttpClient::urlGet(UPDATE_URI); $latestversion = HttpClient::urlGet(UPDATE_URI);
$latestversion = explode('|', $latestversion); $latestversion = explode('|', $latestversion);
if (is_array($latestversion) && count($latestversion) >= 1) { if (is_array($latestversion) && count($latestversion) >= 1) {
$_version = $latestversion[0]; $_version = $latestversion[0];
$_message = isset($latestversion[1]) ? $latestversion[1] : ''; $_message = isset($latestversion[1]) ? $latestversion[1] : '';
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes'); $_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
// add the branding so debian guys are not gettings confused // add the branding so debian guys are not gettings confused
// about their version-number // about their version-number
$version_label = $_version . $branding; $version_label = $_version . $branding;
$version_link = $_link; $version_link = $_link;
$message_addinfo = $_message; $message_addinfo = $_message;
// not numeric -> error-message // not numeric -> error-message
if (! preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) { if (! preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
// check for customized version to not output // check for customized version to not output
@@ -74,7 +74,7 @@ if ($page == 'overview') {
// nothing new // nothing new
$isnewerversion = 0; $isnewerversion = 0;
} }
// anzeige über version-status mit ggfls. formular // anzeige über version-status mit ggfls. formular
// zum update schritt #1 -> download // zum update schritt #1 -> download
if ($isnewerversion == 1) { if ($isnewerversion == 1) {
@@ -90,34 +90,34 @@ if ($page == 'overview') {
\Froxlor\UI\Response::standard_error('customized_version'); \Froxlor\UI\Response::standard_error('customized_version');
} }
} }
}// download the new archive } // download the new archive
elseif ($page == 'getdownload') { elseif ($page == 'getdownload') {
// retrieve the new version from the form // retrieve the new version from the form
$newversion = isset($_POST['newversion']) ? $_POST['newversion'] : null; $newversion = isset($_POST['newversion']) ? $_POST['newversion'] : null;
// valid? // valid?
if ($newversion !== null) { if ($newversion !== null) {
// define files to get // define files to get
$toLoad = str_replace('{version}', $newversion, RELEASE_URI); $toLoad = str_replace('{version}', $newversion, RELEASE_URI);
$toCheck = str_replace('{version}', $newversion, CHECKSUM_URI); $toCheck = str_replace('{version}', $newversion, CHECKSUM_URI);
// check for local destination folder // check for local destination folder
if (! is_dir(FROXLOR_INSTALL_DIR . '/updates/')) { if (! is_dir(FROXLOR_INSTALL_DIR . '/updates/')) {
mkdir(FROXLOR_INSTALL_DIR . '/updates/'); mkdir(FROXLOR_INSTALL_DIR . '/updates/');
} }
// name archive // name archive
$localArchive = FROXLOR_INSTALL_DIR . '/updates/' . basename($toLoad); $localArchive = FROXLOR_INSTALL_DIR . '/updates/' . basename($toLoad);
$log->logAction(ADM_ACTION, LOG_NOTICE, "Downloading " . $toLoad . " to " . $localArchive); $log->logAction(ADM_ACTION, LOG_NOTICE, "Downloading " . $toLoad . " to " . $localArchive);
// remove old archive // remove old archive
if (file_exists($localArchive)) { if (file_exists($localArchive)) {
@unlink($localArchive); @unlink($localArchive);
} }
// get archive data // get archive data
try { try {
HttpClient::fileGet($toLoad, $localArchive); HttpClient::fileGet($toLoad, $localArchive);
@@ -128,7 +128,7 @@ elseif ($page == 'getdownload') {
'errno' => 4 'errno' => 4
)); ));
} }
// validate the integrity of the downloaded file // validate the integrity of the downloaded file
$_shouldsum = HttpClient::urlGet($toCheck); $_shouldsum = HttpClient::urlGet($toCheck);
if (! empty($_shouldsum)) { if (! empty($_shouldsum)) {
@@ -138,7 +138,7 @@ elseif ($page == 'getdownload') {
$shouldsum = null; $shouldsum = null;
} }
$filesum = hash_file('sha256', $localArchive); $filesum = hash_file('sha256', $localArchive);
if ($filesum != $shouldsum) { if ($filesum != $shouldsum) {
\Froxlor\UI\Response::redirectTo($filename, array( \Froxlor\UI\Response::redirectTo($filename, array(
's' => $s, 's' => $s,
@@ -146,7 +146,7 @@ elseif ($page == 'getdownload') {
'errno' => 9 'errno' => 9
)); ));
} }
// to the next step // to the next step
\Froxlor\UI\Response::redirectTo($filename, array( \Froxlor\UI\Response::redirectTo($filename, array(
's' => $s, 's' => $s,
@@ -159,12 +159,12 @@ elseif ($page == 'getdownload') {
'page' => 'error', 'page' => 'error',
'errno' => 6 'errno' => 6
)); ));
}// extract and install new version } // extract and install new version
elseif ($page == 'extract') { elseif ($page == 'extract') {
$toExtract = isset($_GET['archive']) ? $_GET['archive'] : null; $toExtract = isset($_GET['archive']) ? $_GET['archive'] : null;
$localArchive = FROXLOR_INSTALL_DIR . '/updates/' . $toExtract; $localArchive = FROXLOR_INSTALL_DIR . '/updates/' . $toExtract;
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
// decompress from zip // decompress from zip
$zip = new ZipArchive(); $zip = new ZipArchive();
@@ -183,13 +183,13 @@ elseif ($page == 'extract') {
'errno' => 8 'errno' => 8
)); ));
} }
// redirect to update-page? // redirect to update-page?
\Froxlor\UI\Response::redirectTo('admin_updates.php', array( \Froxlor\UI\Response::redirectTo('admin_updates.php', array(
's' => $s 's' => $s
)); ));
} }
if (! file_exists($localArchive)) { if (! file_exists($localArchive)) {
\Froxlor\UI\Response::redirectTo($filename, array( \Froxlor\UI\Response::redirectTo($filename, array(
's' => $s, 's' => $s,
@@ -197,18 +197,17 @@ elseif ($page == 'extract') {
'errno' => 7 'errno' => 7
)); ));
} }
$text = 'Extract downloaded archive "' . $toExtract . '"?'; $text = 'Extract downloaded archive "' . $toExtract . '"?';
$hiddenparams = ''; $hiddenparams = '';
$yesfile = $filename . '?s=' . $s . '&amp;page=extract&amp;archive=' . $toExtract; $yesfile = $filename . '?s=' . $s . '&amp;page=extract&amp;archive=' . $toExtract;
eval("echo \"" . \Froxlor\UI\Template::getTemplate("misc/question_yesno", true) . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("misc/question_yesno", true) . "\";");
} } // display error
// display error
elseif ($page == 'error') { elseif ($page == 'error') {
// retrieve error-number via url-parameter // retrieve error-number via url-parameter
$errno = isset($_GET['errno']) ? (int) $_GET['errno'] : 0; $errno = isset($_GET['errno']) ? (int) $_GET['errno'] : 0;
// 2 = no Zlib // 2 = no Zlib
// 3 = custom version detected // 3 = custom version detected
// 4 = could not store archive to local hdd // 4 = could not store archive to local hdd

View File

@@ -22,8 +22,7 @@ use Froxlor\Settings;
if ($userinfo['change_serversettings'] == '1') { if ($userinfo['change_serversettings'] == '1') {
if ($action == 'setconfigured') if ($action == 'setconfigured') {
{
Settings::Set('panel.is_configured', '1', true); Settings::Set('panel.is_configured', '1', true);
\Froxlor\UI\Response::redirectTo('admin_configfiles.php', array( \Froxlor\UI\Response::redirectTo('admin_configfiles.php', array(
's' => $s 's' => $s
@@ -31,12 +30,9 @@ if ($userinfo['change_serversettings'] == '1') {
} }
$customer_tmpdir = '/tmp/'; $customer_tmpdir = '/tmp/';
if (Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_tmpdir') != '') if (Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_tmpdir') != '') {
{
$customer_tmpdir = Settings::Get('system.mod_fcgid_tmpdir'); $customer_tmpdir = Settings::Get('system.mod_fcgid_tmpdir');
} } elseif (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.tmpdir') != '') {
elseif (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.tmpdir') != '')
{
$customer_tmpdir = Settings::Get('phpfpm.tmpdir'); $customer_tmpdir = Settings::Get('phpfpm.tmpdir');
} }
@@ -93,9 +89,9 @@ if ($userinfo['change_serversettings'] == '1') {
if ($distribution != "") { if ($distribution != "") {
if (!file_exists($config_dir . '/' . $distribution . ".xml")) { if (! file_exists($config_dir . '/' . $distribution . ".xml")) {
trigger_error("Unknown distribution, are you playing around with the URL?"); trigger_error("Unknown distribution, are you playing around with the URL?");
exit; exit();
} }
// create configparser object // create configparser object
@@ -109,9 +105,9 @@ if ($userinfo['change_serversettings'] == '1') {
if ($service != "") { if ($service != "") {
if (!isset($services[$service])) { if (! isset($services[$service])) {
trigger_error("Unknown service, are you playing around with the URL?"); trigger_error("Unknown service, are you playing around with the URL?");
exit; exit();
} }
$daemons = $services[$service]->getDaemons(); $daemons = $services[$service]->getDaemons();
@@ -157,9 +153,9 @@ if ($userinfo['change_serversettings'] == '1') {
if ($distribution != "" && $service != "" && $daemon != "") { if ($distribution != "" && $service != "" && $daemon != "") {
if (!isset($daemons[$daemon])) { if (! isset($daemons[$daemon])) {
trigger_error("Unknown daemon, are you playing around with the URL?"); trigger_error("Unknown daemon, are you playing around with the URL?");
exit; exit();
} }
$confarr = $daemons[$daemon]->getConfig(); $confarr = $daemons[$daemon]->getConfig();

View File

@@ -35,9 +35,9 @@ if ($page == 'ipsandports' || $page == 'overview') {
$is_nginx = ($websrv == 'nginx'); $is_nginx = ($websrv == 'nginx');
$is_apache = ($websrv == 'apache2'); $is_apache = ($websrv == 'apache2');
$is_apache24 = $is_apache && (Settings::Get('system.apache24') === '1'); $is_apache24 = $is_apache && (Settings::Get('system.apache24') === '1');
if ($action == '') { if ($action == '') {
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_ipsandports"); $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_ipsandports");
$fields = array( $fields = array(
'ip' => $lng['admin']['ipsandports']['ip'], 'ip' => $lng['admin']['ipsandports']['ip'],
@@ -54,9 +54,9 @@ if ($page == 'ipsandports' || $page == 'overview') {
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s); $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
$i = 0; $i = 0;
$count = 0; $count = 0;
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if ($paging->checkDisplay($i)) { if ($paging->checkDisplay($i)) {
$row = htmlentities_array($row); $row = htmlentities_array($row);
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
@@ -77,10 +77,10 @@ if ($page == 'ipsandports' || $page == 'overview') {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
if (isset($result['id']) && $result['id'] == $id) { if (isset($result['id']) && $result['id'] == $id) {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
IpsAndPorts::getLocal($userinfo, array( IpsAndPorts::getLocal($userinfo, array(
'id' => $id 'id' => $id
@@ -88,7 +88,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array( \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page, 'page' => $page,
's' => $s 's' => $s
@@ -113,13 +113,13 @@ if ($page == 'ipsandports' || $page == 'overview') {
's' => $s 's' => $s
)); ));
} else { } else {
$ipsandports_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php'; $ipsandports_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php';
$ipsandports_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($ipsandports_add_data); $ipsandports_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($ipsandports_add_data);
$title = $ipsandports_add_data['ipsandports_add']['title']; $title = $ipsandports_add_data['ipsandports_add']['title'];
$image = $ipsandports_add_data['ipsandports_add']['image']; $image = $ipsandports_add_data['ipsandports_add']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_add") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_add") . "\";");
} }
} elseif ($action == 'edit' && $id != 0) { } elseif ($action == 'edit' && $id != 0) {
@@ -131,29 +131,29 @@ if ($page == 'ipsandports' || $page == 'overview') {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
if ($result['ip'] != '') { if ($result['ip'] != '') {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
IpsAndPorts::getLocal($userinfo, $_POST)->update(); IpsAndPorts::getLocal($userinfo, $_POST)->update();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array( \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page, 'page' => $page,
's' => $s 's' => $s
)); ));
} else { } else {
$result = htmlentities_array($result); $result = htmlentities_array($result);
$ipsandports_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php'; $ipsandports_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php';
$ipsandports_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($ipsandports_edit_data); $ipsandports_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($ipsandports_edit_data);
$title = $ipsandports_edit_data['ipsandports_edit']['title']; $title = $ipsandports_edit_data['ipsandports_edit']['title'];
$image = $ipsandports_edit_data['ipsandports_edit']['image']; $image = $ipsandports_edit_data['ipsandports_edit']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_edit") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_edit") . "\";");
} }
} }

View File

@@ -16,15 +16,12 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'admin'); define('AREA', 'admin');
require './lib/init.php'; require './lib/init.php';
use Froxlor\Database\Database; use Froxlor\Database\Database;
if ($page == 'log' if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
&& $userinfo['change_serversettings'] == '1'
) {
if ($action == '') { if ($action == '') {
$fields = array( $fields = array(
'date' => $lng['logger']['date'], 'date' => $lng['logger']['date'],
@@ -46,17 +43,13 @@ if ($page == 'log'
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if (!isset($clog[$row['action']]) if (! isset($clog[$row['action']]) || ! is_array($clog[$row['action']])) {
|| !is_array($clog[$row['action']])
) {
$clog[$row['action']] = array(); $clog[$row['action']] = array();
} }
$clog[$row['action']][$row['logid']] = $row; $clog[$row['action']][$row['logid']] = $row;
} }
if ($paging->sortfield == 'date' if ($paging->sortfield == 'date' && $paging->sortorder == 'desc') {
&& $paging->sortorder == 'desc'
) {
krsort($clog); krsort($clog);
} else { } else {
ksort($clog); ksort($clog);
@@ -70,65 +63,69 @@ if ($page == 'log'
$_action = 0; $_action = 0;
foreach ($logrows as $row) { foreach ($logrows as $row) {
// if ($paging->checkDisplay($i)) { // if ($paging->checkDisplay($i)) {
$row = htmlentities_array($row); $row = htmlentities_array($row);
$row['date'] = date("d.m.y H:i:s", $row['date']); $row['date'] = date("d.m.y H:i:s", $row['date']);
if ($_action != $action) { if ($_action != $action) {
switch ($action) { switch ($action) {
case USR_ACTION: case USR_ACTION:
$_action = $lng['admin']['customer']; $_action = $lng['admin']['customer'];
break; break;
case RES_ACTION: case RES_ACTION:
$_action = $lng['logger']['reseller']; $_action = $lng['logger']['reseller'];
break; break;
case ADM_ACTION: case ADM_ACTION:
$_action = $lng['logger']['admin']; $_action = $lng['logger']['admin'];
break; break;
case CRON_ACTION: case CRON_ACTION:
$_action = $lng['logger']['cron']; $_action = $lng['logger']['cron'];
break; break;
case LOGIN_ACTION: case LOGIN_ACTION:
$_action = $lng['logger']['login']; $_action = $lng['logger']['login'];
break; break;
case LOG_ERROR: case LOG_ERROR:
$_action = $lng['logger']['intern']; $_action = $lng['logger']['intern'];
break; break;
default: default:
$_action = $lng['logger']['unknown']; $_action = $lng['logger']['unknown'];
break; break;
}
$row['action'] = $_action;
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_action') . "\";");
} }
$log_count++; $row['action'] = $_action;
$row['type'] = getLogLevelDesc($row['type']); eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_action') . "\";");
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_log') . "\";"); }
$count++;
$_action = $action; $log_count ++;
$row['type'] = getLogLevelDesc($row['type']);
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_log') . "\";");
$count ++;
$_action = $action;
// } // }
$i++; $i ++;
} }
$i++; $i ++;
} }
eval("echo \"" . \Froxlor\UI\Template::getTemplate('logger/logger') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('logger/logger') . "\";");
} elseif ($action == 'truncate') { } elseif ($action == 'truncate') {
if (isset($_POST['send']) if (isset($_POST['send']) && $_POST['send'] == 'send') {
&& $_POST['send'] == 'send'
) {
$truncatedate = time() - (60 * 10); $truncatedate = time() - (60 * 10);
$trunc_stmt = Database::prepare(" $trunc_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < :trunc" DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < :trunc");
); Database::pexecute($trunc_stmt, array(
Database::pexecute($trunc_stmt, array('trunc' => $truncatedate)); 'trunc' => $truncatedate
));
$log->logAction(ADM_ACTION, LOG_WARNING, 'truncated the system-log (mysql)'); $log->logAction(ADM_ACTION, LOG_WARNING, 'truncated the system-log (mysql)');
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
ask_yesno('logger_reallytruncate', $filename, array('page' => $page, 'action' => $action), TABLE_PANEL_LOG); ask_yesno('logger_reallytruncate', $filename, array(
'page' => $page,
'action' => $action
), TABLE_PANEL_LOG);
} }
} }
} }

View File

@@ -16,7 +16,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'admin'); define('AREA', 'admin');
require './lib/init.php'; require './lib/init.php';
@@ -32,12 +31,8 @@ if ($page == 'message') {
if ($action == '') { if ($action == '') {
$log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed panel_message'); $log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed panel_message');
if (isset($_POST['send']) if (isset($_POST['send']) && $_POST['send'] == 'send') {
&& $_POST['send'] == 'send' if ($_POST['receipient'] == 0 && $userinfo['customers_see_all'] == '1') {
) {
if ($_POST['receipient'] == 0
&& $userinfo['customers_see_all'] == '1'
) {
$log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to admins'); $log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to admins');
$result = Database::query('SELECT `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`"); $result = Database::query('SELECT `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`");
} elseif ($_POST['receipient'] == 1) { } elseif ($_POST['receipient'] == 1) {
@@ -48,9 +43,10 @@ if ($page == 'message') {
$log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to customers'); $log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to customers');
$result = Database::prepare(' $result = Database::prepare('
SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "` SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`
WHERE `adminid` = :adminid" WHERE `adminid` = :adminid");
); Database::pexecute($result, array(
Database::pexecute($result, array('adminid' => $userinfo['adminid'])); 'adminid' => $userinfo['adminid']
));
} }
} else { } else {
\Froxlor\UI\Response::standard_error('noreceipientsgiven'); \Froxlor\UI\Response::standard_error('noreceipientsgiven');
@@ -59,7 +55,7 @@ if ($page == 'message') {
$subject = $_POST['subject']; $subject = $_POST['subject'];
$message = wordwrap($_POST['message'], 70); $message = wordwrap($_POST['message'], 70);
if (!empty($message)) { if (! empty($message)) {
$mailcounter = 0; $mailcounter = 0;
$mail->Body = $message; $mail->Body = $message;
$mail->Subject = $subject; $mail->Subject = $subject;
@@ -68,11 +64,15 @@ if ($page == 'message') {
$row['firstname'] = isset($row['firstname']) ? $row['firstname'] : ''; $row['firstname'] = isset($row['firstname']) ? $row['firstname'] : '';
$row['company'] = isset($row['company']) ? $row['company'] : ''; $row['company'] = isset($row['company']) ? $row['company'] : '';
$mail->AddAddress($row['email'], getCorrectUserSalutation(array('firstname' => $row['firstname'], 'name' => $row['name'], 'company' => $row['company']))); $mail->AddAddress($row['email'], getCorrectUserSalutation(array(
'firstname' => $row['firstname'],
'name' => $row['name'],
'company' => $row['company']
)));
$mail->From = $userinfo['email']; $mail->From = $userinfo['email'];
$mail->FromName = (isset($userinfo['firstname']) ? $userinfo['firstname'] . ' ' : '') . $userinfo['name']; $mail->FromName = (isset($userinfo['firstname']) ? $userinfo['firstname'] . ' ' : '') . $userinfo['name'];
if (!$mail->Send()) { if (! $mail->Send()) {
if ($mail->ErrorInfo != '') { if ($mail->ErrorInfo != '') {
$mailerr_msg = $mail->ErrorInfo; $mailerr_msg = $mail->ErrorInfo;
} else { } else {
@@ -83,11 +83,16 @@ if ($page == 'message') {
\Froxlor\UI\Response::standard_error('errorsendingmail', $row['email']); \Froxlor\UI\Response::standard_error('errorsendingmail', $row['email']);
} }
$mailcounter++; $mailcounter ++;
$mail->ClearAddresses(); $mail->ClearAddresses();
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s, 'action' => 'showsuccess', 'sentitems' => $mailcounter)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s,
'action' => 'showsuccess',
'sentitems' => $mailcounter
));
} else { } else {
\Froxlor\UI\Response::standard_error('nomessagetosend'); \Froxlor\UI\Response::standard_error('nomessagetosend');
} }
@@ -97,14 +102,13 @@ if ($page == 'message') {
if ($action == 'showsuccess') { if ($action == 'showsuccess') {
$success = 1; $success = 1;
$sentitems = isset($_GET['sentitems']) ? (int)$_GET['sentitems'] : 0; $sentitems = isset($_GET['sentitems']) ? (int) $_GET['sentitems'] : 0;
if ($sentitems == 0) { if ($sentitems == 0) {
$successmessage = $lng['message']['noreceipients']; $successmessage = $lng['message']['noreceipients'];
} else { } else {
$successmessage = str_replace('%s', $sentitems, $lng['message']['success']); $successmessage = str_replace('%s', $sentitems, $lng['message']['success']);
} }
} else { } else {
$success = 0; $success = 0;
$sentitems = 0; $sentitems = 0;
@@ -115,7 +119,7 @@ if ($page == 'message') {
$receipients = ''; $receipients = '';
if ($userinfo['customers_see_all'] == '1') { if ($userinfo['customers_see_all'] == '1') {
$receipients.= makeoption($lng['panel']['reseller'], 0); $receipients .= makeoption($lng['panel']['reseller'], 0);
} }
$receipients .= makeoption($lng['panel']['customer'], 1); $receipients .= makeoption($lng['panel']['customer'], 1);

View File

@@ -17,142 +17,140 @@
* Based on https://github.com/amnuts/opcache-gui * Based on https://github.com/amnuts/opcache-gui
* *
*/ */
define('AREA', 'admin'); define('AREA', 'admin');
require './lib/init.php'; require './lib/init.php';
if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') {
if ($action == 'reset' && opcache_reset();
function_exists('opcache_reset') && $log->logAction(ADM_ACTION, LOG_INFO, "reseted OPcache");
$userinfo['change_serversettings'] == '1' header('Location: ' . $linker->getLink(array(
) { 'section' => 'opcacheinfo',
opcache_reset(); 'page' => 'showinfo'
$log->logAction(ADM_ACTION, LOG_INFO, "reseted OPcache"); )));
header('Location: ' . $linker->getLink(array('section' => 'opcacheinfo', 'page' => 'showinfo'))); exit();
exit();
} }
if (!function_exists('opcache_get_configuration') if (! function_exists('opcache_get_configuration')) {
) { \Froxlor\UI\Response::standard_error($lng['error']['no_opcacheinfo']);
\Froxlor\UI\Response::standard_error($lng['error']['no_opcacheinfo']);
} }
if ($page == 'showinfo' if ($page == 'showinfo') {
) {
$opcache_info = opcache_get_configuration();
$opcache_status = opcache_get_status(false);
$time = time();
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed OPcache info");
$runtimelines = '';
if (isset($opcache_info['directives']) && is_array($opcache_info['directives'])) {
foreach ($opcache_info['directives'] as $name => $value) {
$linkname= str_replace('_', '-', $name);
if ($name=='opcache.optimization_level' && is_integer($value)) {
$value='0x'.dechex($value);
}
if ($name=='opcache.memory_consumption' && is_integer($value) && $value%(1024*1024)==0) {
$value=$value/(1024*1024);
}
if ($value===null || $value==='') {
$value=$lng['opcacheinfo']['novalue'];
}
if ($value===true) {
$value=$lng['opcacheinfo']['true'];
}
if ($value===false) {
$value=$lng['opcacheinfo']['false'];
}
if (is_integer($value)) {
$value=number_format($value,0,'.',' ');
}
$name=str_replace('_', ' ', $name);
eval("\$runtimelines.=\"" . \Froxlor\UI\Template::getTemplate("settings/opcacheinfo/runtime_line") . "\";");
}
}
$cachehits=@$opcache_status['opcache_statistics']['hits'] ?: 0;
$cachemiss=@$opcache_status['opcache_statistics']['misses'] ?: 0;
$blacklistmiss=@$opcache_status['opcache_statistics']['blacklist_misses'] ?: 0;
$cachetotal=$cachehits+$cachemiss+$blacklistmiss;
$general=array(
'version' => (isset($opcache_info['version']['opcache_product_name']) ? $opcache_info['version']['opcache_product_name'].' ' : '').$opcache_info['version']['version'],
'phpversion' => phpversion(),
'start_time' => @$opcache_status['opcache_statistics']['start_time'] ? date('Y-m-d H:i:s',$opcache_status['opcache_statistics']['start_time']) : '',
'last_restart_time' => @$opcache_status['opcache_statistics']['last_restart_time'] ? date('Y-m-d H:i:s',$opcache_status['opcache_statistics']['last_restart_time']) : $lng['opcacheinfo']['never'],
'oom_restarts' => number_format(@$opcache_status['opcache_statistics']['oom_restarts'] ?: 0,0,'.',' '),
'hash_restarts' => number_format(@$opcache_status['opcache_statistics']['hash_restarts'] ?: 0,0,'.',' '),
'manual_restarts' => number_format(@$opcache_status['opcache_statistics']['manual_restarts'] ?: 0,0,'.',' '),
'status' => (@$opcache_status['restart_in_progress'] ? $lng['opcacheinfo']['restartinprogress'] :
(@$opcache_status['restart_pending'] ? $lng['opcacheinfo']['restartpending'] :
(@$opcache_status['cache_full'] ? $lng['opcacheinfo']['cachefull'] :
(@$opcache_status['opcache_enabled'] ? $lng['opcacheinfo']['enabled'] : $lng['opcacheinfo']['novalue'])))),
'cachedscripts' => number_format(@$opcache_status['opcache_statistics']['num_cached_scripts'] ?: 0,0,'.',' '),
'cachehits' => number_format($cachehits,0,'.',' ') . ($cachetotal>0 ? sprintf(" (%.1f %%)", $cachehits/($cachetotal)*100) : ''),
'cachemiss' => number_format($cachemiss,0,'.',' ') . ($cachetotal>0 ? sprintf(" (%.1f %%)", $cachemiss/($cachetotal)*100) : ''),
'blacklistmiss' => number_format($blacklistmiss,0,'.',' ') . ($cachetotal>0 ? sprintf(" (%.1f %%)", $blacklistmiss/($cachetotal)*100) : ''),
);
$usedmem=@$opcache_status['memory_usage']['used_memory'] ?: 0;
$usedmemstr=bsize($usedmem);
$freemem=@$opcache_status['memory_usage']['free_memory'] ?: 0;
$freememstr=bsize($freemem);
$totalmem=$usedmem+$freemem;
$wastedmem=@$opcache_status['memory_usage']['wasted_memory'] ?: 0;
$wastedmemstr=bsize($wastedmem);
if ($totalmem) {
$memory=array(
'total' => bsize($totalmem),
'used' => $usedmemstr . ($totalmem>0 ? sprintf(" (%.1f %%)", $usedmem/($totalmem)*100) : ''),
'free' => $freememstr . ($totalmem>0 ? sprintf(" (%.1f %%)", $freemem/($totalmem)*100) : ''),
'wasted' => $wastedmemstr . ($totalmem>0 ? sprintf(" (%.1f %%)", $wastedmem/($totalmem)*100) : ''),
);
}
if (isset($opcache_status['interned_strings_usage'])) {
$usedstring=@$opcache_status['interned_strings_usage']['used_memory'] ?: 0;
$usedstringstr=bsize($usedstring);
$freestring=@$opcache_status['interned_strings_usage']['free_memory'] ?: 0;
$freestringstr=bsize($freestring);
$totalstring=$usedstring+$freestring;
$stringbuffer=array(
'total' => bsize($totalstring),
'used' => $usedstringstr . ($totalstring>0 ? sprintf(" (%.1f %%)", $usedstring/$totalstring*100) : ''),
'free' => $freestringstr . ($totalstring>0 ? sprintf(" (%.1f %%)", $freestring/$totalstring*100) : ''),
'strcount' => number_format(@$opcache_status['interned_strings_usage']['number_of_strings'] ?: 0,0,'.',' '),
);
}
$usedkey=@$opcache_status['opcache_statistics']['num_cached_keys'] ?: 0; $opcache_info = opcache_get_configuration();
$usedkeystr=number_format($usedkey,0,'.',' '); $opcache_status = opcache_get_status(false);
$totalkey=@$opcache_status['opcache_statistics']['max_cached_keys'] ?: 0; $time = time();
$wastedkey=$usedkey - (@$opcache_status['opcache_statistics']['num_cached_scripts'] ?: 0); $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed OPcache info");
if (isset($opcache_status['opcache_statistics'])) {
$keystat=array( $runtimelines = '';
'total' => number_format($totalkey,0,'.',' '), if (isset($opcache_info['directives']) && is_array($opcache_info['directives'])) {
'used' => $usedkeystr . ($totalkey>0 ? sprintf(" (%.1f %%)", $usedkey/($totalkey)*100) : ''), foreach ($opcache_info['directives'] as $name => $value) {
'wasted' => number_format($wastedkey,0,'.',' ') . ($totalkey>0 ? sprintf(" (%.1f %%)", $wastedkey/($totalkey)*100) : ''), $linkname = str_replace('_', '-', $name);
); if ($name == 'opcache.optimization_level' && is_integer($value)) {
} $value = '0x' . dechex($value);
}
$blacklistlines = ''; if ($name == 'opcache.memory_consumption' && is_integer($value) && $value % (1024 * 1024) == 0) {
if (isset($opcache_info['blacklist']) && is_array($opcache_info['blacklist'])) { $value = $value / (1024 * 1024);
foreach ($opcache_info['blacklist'] as $value) { }
eval("\$blacklistlines.=\"" . \Froxlor\UI\Template::getTemplate("settings/opcacheinfo/blacklist_line") . "\";"); if ($value === null || $value === '') {
} $value = $lng['opcacheinfo']['novalue'];
} }
if ($value === true) {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/opcacheinfo/showinfo") . "\";"); $value = $lng['opcacheinfo']['true'];
}
if ($value === false) {
$value = $lng['opcacheinfo']['false'];
}
if (is_integer($value)) {
$value = number_format($value, 0, '.', ' ');
}
$name = str_replace('_', ' ', $name);
eval("\$runtimelines.=\"" . \Froxlor\UI\Template::getTemplate("settings/opcacheinfo/runtime_line") . "\";");
}
}
$cachehits = @$opcache_status['opcache_statistics']['hits'] ?: 0;
$cachemiss = @$opcache_status['opcache_statistics']['misses'] ?: 0;
$blacklistmiss = @$opcache_status['opcache_statistics']['blacklist_misses'] ?: 0;
$cachetotal = $cachehits + $cachemiss + $blacklistmiss;
$general = array(
'version' => (isset($opcache_info['version']['opcache_product_name']) ? $opcache_info['version']['opcache_product_name'] . ' ' : '') . $opcache_info['version']['version'],
'phpversion' => phpversion(),
'start_time' => @$opcache_status['opcache_statistics']['start_time'] ? date('Y-m-d H:i:s', $opcache_status['opcache_statistics']['start_time']) : '',
'last_restart_time' => @$opcache_status['opcache_statistics']['last_restart_time'] ? date('Y-m-d H:i:s', $opcache_status['opcache_statistics']['last_restart_time']) : $lng['opcacheinfo']['never'],
'oom_restarts' => number_format(@$opcache_status['opcache_statistics']['oom_restarts'] ?: 0, 0, '.', ' '),
'hash_restarts' => number_format(@$opcache_status['opcache_statistics']['hash_restarts'] ?: 0, 0, '.', ' '),
'manual_restarts' => number_format(@$opcache_status['opcache_statistics']['manual_restarts'] ?: 0, 0, '.', ' '),
'status' => (@$opcache_status['restart_in_progress'] ? $lng['opcacheinfo']['restartinprogress'] : (@$opcache_status['restart_pending'] ? $lng['opcacheinfo']['restartpending'] : (@$opcache_status['cache_full'] ? $lng['opcacheinfo']['cachefull'] : (@$opcache_status['opcache_enabled'] ? $lng['opcacheinfo']['enabled'] : $lng['opcacheinfo']['novalue'])))),
'cachedscripts' => number_format(@$opcache_status['opcache_statistics']['num_cached_scripts'] ?: 0, 0, '.', ' '),
'cachehits' => number_format($cachehits, 0, '.', ' ') . ($cachetotal > 0 ? sprintf(" (%.1f %%)", $cachehits / ($cachetotal) * 100) : ''),
'cachemiss' => number_format($cachemiss, 0, '.', ' ') . ($cachetotal > 0 ? sprintf(" (%.1f %%)", $cachemiss / ($cachetotal) * 100) : ''),
'blacklistmiss' => number_format($blacklistmiss, 0, '.', ' ') . ($cachetotal > 0 ? sprintf(" (%.1f %%)", $blacklistmiss / ($cachetotal) * 100) : '')
);
$usedmem = @$opcache_status['memory_usage']['used_memory'] ?: 0;
$usedmemstr = bsize($usedmem);
$freemem = @$opcache_status['memory_usage']['free_memory'] ?: 0;
$freememstr = bsize($freemem);
$totalmem = $usedmem + $freemem;
$wastedmem = @$opcache_status['memory_usage']['wasted_memory'] ?: 0;
$wastedmemstr = bsize($wastedmem);
if ($totalmem) {
$memory = array(
'total' => bsize($totalmem),
'used' => $usedmemstr . ($totalmem > 0 ? sprintf(" (%.1f %%)", $usedmem / ($totalmem) * 100) : ''),
'free' => $freememstr . ($totalmem > 0 ? sprintf(" (%.1f %%)", $freemem / ($totalmem) * 100) : ''),
'wasted' => $wastedmemstr . ($totalmem > 0 ? sprintf(" (%.1f %%)", $wastedmem / ($totalmem) * 100) : '')
);
}
if (isset($opcache_status['interned_strings_usage'])) {
$usedstring = @$opcache_status['interned_strings_usage']['used_memory'] ?: 0;
$usedstringstr = bsize($usedstring);
$freestring = @$opcache_status['interned_strings_usage']['free_memory'] ?: 0;
$freestringstr = bsize($freestring);
$totalstring = $usedstring + $freestring;
$stringbuffer = array(
'total' => bsize($totalstring),
'used' => $usedstringstr . ($totalstring > 0 ? sprintf(" (%.1f %%)", $usedstring / $totalstring * 100) : ''),
'free' => $freestringstr . ($totalstring > 0 ? sprintf(" (%.1f %%)", $freestring / $totalstring * 100) : ''),
'strcount' => number_format(@$opcache_status['interned_strings_usage']['number_of_strings'] ?: 0, 0, '.', ' ')
);
}
$usedkey = @$opcache_status['opcache_statistics']['num_cached_keys'] ?: 0;
$usedkeystr = number_format($usedkey, 0, '.', ' ');
$totalkey = @$opcache_status['opcache_statistics']['max_cached_keys'] ?: 0;
$wastedkey = $usedkey - (@$opcache_status['opcache_statistics']['num_cached_scripts'] ?: 0);
if (isset($opcache_status['opcache_statistics'])) {
$keystat = array(
'total' => number_format($totalkey, 0, '.', ' '),
'used' => $usedkeystr . ($totalkey > 0 ? sprintf(" (%.1f %%)", $usedkey / ($totalkey) * 100) : ''),
'wasted' => number_format($wastedkey, 0, '.', ' ') . ($totalkey > 0 ? sprintf(" (%.1f %%)", $wastedkey / ($totalkey) * 100) : '')
);
}
$blacklistlines = '';
if (isset($opcache_info['blacklist']) && is_array($opcache_info['blacklist'])) {
foreach ($opcache_info['blacklist'] as $value) {
eval("\$blacklistlines.=\"" . \Froxlor\UI\Template::getTemplate("settings/opcacheinfo/blacklist_line") . "\";");
}
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/opcacheinfo/showinfo") . "\";");
} }
function bsize($s) { function bsize($s)
foreach (array('', 'K', 'M', 'G') as $i => $k) { {
if ($s < 1024) foreach (array(
break; '',
$s/=1024; 'K',
} 'M',
return sprintf("%5.1f %sBytes", $s, $k); 'G'
) as $i => $k) {
if ($s < 1024)
break;
$s /= 1024;
}
return sprintf("%5.1f %sBytes", $s, $k);
} }

View File

@@ -30,9 +30,9 @@ if (isset($_POST['id'])) {
} }
if ($page == 'overview') { if ($page == 'overview') {
if ($action == '') { if ($action == '') {
try { try {
$json_result = PhpSettings::getLocal($userinfo, array( $json_result = PhpSettings::getLocal($userinfo, array(
'with_subdomains' => true 'with_subdomains' => true
@@ -54,21 +54,21 @@ if ($page == 'overview') {
foreach ($row['domains'] as $configdomain) { foreach ($row['domains'] as $configdomain) {
$domains .= $configdomain . "<br>"; $domains .= $configdomain . "<br>";
} }
$count++; $count ++;
if ($subdomains_count == 0 && empty($domains)) { if ($subdomains_count == 0 && empty($domains)) {
$domains = $lng['admin']['phpsettings']['notused']; $domains = $lng['admin']['phpsettings']['notused'];
} }
eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_overview") . "\";"); eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_overview") . "\";");
} }
} }
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview") . "\";");
} }
if ($action == 'add') { if ($action == 'add') {
if ((int) $userinfo['change_serversettings'] == 1) { if ((int) $userinfo['change_serversettings'] == 1) {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
PhpSettings::getLocal($userinfo, $_POST)->add(); PhpSettings::getLocal($userinfo, $_POST)->add();
@@ -80,10 +80,10 @@ if ($page == 'overview') {
's' => $s 's' => $s
)); ));
} else { } else {
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1"); $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
$result = $result_stmt->fetch(PDO::FETCH_ASSOC); $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
$fpmconfigs = ''; $fpmconfigs = '';
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC"); $configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) { while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
@@ -91,37 +91,41 @@ if ($page == 'overview') {
} }
$pm_select = makeoption('static', 'static', 'static', true, true); $pm_select = makeoption('static', 'static', 'static', true, true);
$pm_select.= makeoption('dynamic', 'dynamic', 'static', true, true); $pm_select .= makeoption('dynamic', 'dynamic', 'static', true, true);
$pm_select.= makeoption('ondemand', 'ondemand', 'static', true, true); $pm_select .= makeoption('ondemand', 'ondemand', 'static', true, true);
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php'; $phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
$phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data); $phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data);
$title = $phpconfig_add_data['phpconfig_add']['title']; $title = $phpconfig_add_data['phpconfig_add']['title'];
$image = $phpconfig_add_data['phpconfig_add']['image']; $image = $phpconfig_add_data['phpconfig_add']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_add") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_add") . "\";");
} }
} else { } else {
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid'); \Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
} }
} }
if ($action == 'delete') { if ($action == 'delete') {
try { try {
$json_result = PhpSettings::getLocal($userinfo, array('id' => $id))->get(); $json_result = PhpSettings::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config
{ {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
PhpSettings::getLocal($userinfo, array('id' => $id))->delete(); PhpSettings::getLocal($userinfo, array(
'id' => $id
))->delete();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
@@ -140,18 +144,20 @@ if ($page == 'overview') {
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid'); \Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
} }
} }
if ($action == 'edit') { if ($action == 'edit') {
try { try {
$json_result = PhpSettings::getLocal($userinfo, array('id' => $id))->get(); $json_result = PhpSettings::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) { if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
PhpSettings::getLocal($userinfo, $_POST)->update(); PhpSettings::getLocal($userinfo, $_POST)->update();
@@ -163,7 +169,7 @@ if ($page == 'overview') {
's' => $s 's' => $s
)); ));
} else { } else {
$fpmconfigs = ''; $fpmconfigs = '';
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC"); $configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) { while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
@@ -171,15 +177,15 @@ if ($page == 'overview') {
} }
$pm_select = makeoption('static', 'static', $result['pm'], true, true); $pm_select = makeoption('static', 'static', $result['pm'], true, true);
$pm_select.= makeoption('dynamic', 'dynamic', $result['pm'], true, true); $pm_select .= makeoption('dynamic', 'dynamic', $result['pm'], true, true);
$pm_select.= makeoption('ondemand', 'ondemand', $result['pm'], true, true); $pm_select .= makeoption('ondemand', 'ondemand', $result['pm'], true, true);
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php'; $phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
$phpconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_edit_data); $phpconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_edit_data);
$title = $phpconfig_edit_data['phpconfig_edit']['title']; $title = $phpconfig_edit_data['phpconfig_edit']['title'];
$image = $phpconfig_edit_data['phpconfig_edit']['image']; $image = $phpconfig_edit_data['phpconfig_edit']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_edit") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/overview_edit") . "\";");
} }
} else { } else {
@@ -187,7 +193,7 @@ if ($page == 'overview') {
} }
} }
} elseif ($page == 'fpmdaemons') { } elseif ($page == 'fpmdaemons') {
if ($action == '') { if ($action == '') {
try { try {
@@ -196,7 +202,7 @@ if ($page == 'overview') {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$tablecontent = ''; $tablecontent = '';
$count = 0; $count = 0;
if (isset($result['count']) && $result['count'] > 0) { if (isset($result['count']) && $result['count'] > 0) {
@@ -205,17 +211,17 @@ if ($page == 'overview') {
foreach ($row['configs'] as $configused) { foreach ($row['configs'] as $configused) {
$configs .= $configused . "<br>"; $configs .= $configused . "<br>";
} }
$count++; $count ++;
eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons_overview") . "\";"); eval("\$tablecontent.=\"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons_overview") . "\";");
} }
} }
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmdaemons") . "\";");
} }
if ($action == 'add') { if ($action == 'add') {
if ((int) $userinfo['change_serversettings'] == 1) { if ((int) $userinfo['change_serversettings'] == 1) {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
FpmDaemons::getLocal($userinfo, $_POST)->add(); FpmDaemons::getLocal($userinfo, $_POST)->add();
@@ -227,37 +233,39 @@ if ($page == 'overview') {
's' => $s 's' => $s
)); ));
} else { } else {
$pm_select = makeoption('static', 'static', 'static', true, true); $pm_select = makeoption('static', 'static', 'static', true, true);
$pm_select .= makeoption('dynamic', 'dynamic', 'static', true, true); $pm_select .= makeoption('dynamic', 'dynamic', 'static', true, true);
$pm_select .= makeoption('ondemand', 'ondemand', 'static', true, true); $pm_select .= makeoption('ondemand', 'ondemand', 'static', true, true);
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php'; $fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
$fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data); $fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data);
$title = $fpmconfig_add_data['fpmconfig_add']['title']; $title = $fpmconfig_add_data['fpmconfig_add']['title'];
$image = $fpmconfig_add_data['fpmconfig_add']['image']; $image = $fpmconfig_add_data['fpmconfig_add']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_add") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_add") . "\";");
} }
} else { } else {
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid'); \Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
} }
} }
if ($action == 'delete') { if ($action == 'delete') {
try { try {
$json_result = FpmDaemons::getLocal($userinfo, array('id' => $id))->get(); $json_result = FpmDaemons::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
if ($id == 1) { if ($id == 1) {
\Froxlor\UI\Response::standard_error('cannotdeletedefaultphpconfig'); \Froxlor\UI\Response::standard_error('cannotdeletedefaultphpconfig');
} }
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config
{ {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
@@ -281,18 +289,20 @@ if ($page == 'overview') {
\Froxlor\UI\Response::standard_error('nopermissionsorinvalidid'); \Froxlor\UI\Response::standard_error('nopermissionsorinvalidid');
} }
} }
if ($action == 'edit') { if ($action == 'edit') {
try { try {
$json_result = FpmDaemons::getLocal($userinfo, array('id' => $id))->get(); $json_result = FpmDaemons::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) { if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
FpmDaemons::getLocal($userinfo, $_POST)->update(); FpmDaemons::getLocal($userinfo, $_POST)->update();
@@ -304,17 +314,17 @@ if ($page == 'overview') {
's' => $s 's' => $s
)); ));
} else { } else {
$pm_select = makeoption('static', 'static', $result['pm'], true, true); $pm_select = makeoption('static', 'static', $result['pm'], true, true);
$pm_select .= makeoption('dynamic', 'dynamic', $result['pm'], true, true); $pm_select .= makeoption('dynamic', 'dynamic', $result['pm'], true, true);
$pm_select .= makeoption('ondemand', 'ondemand', $result['pm'], true, true); $pm_select .= makeoption('ondemand', 'ondemand', $result['pm'], true, true);
$fpmconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php'; $fpmconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php';
$fpmconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_edit_data); $fpmconfig_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_edit_data);
$title = $fpmconfig_edit_data['fpmconfig_edit']['title']; $title = $fpmconfig_edit_data['fpmconfig_edit']['title'];
$image = $fpmconfig_edit_data['fpmconfig_edit']['image']; $image = $fpmconfig_edit_data['fpmconfig_edit']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_edit") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("phpconfig/fpmconfig_edit") . "\";");
} }
} else { } else {

View File

@@ -16,7 +16,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'admin'); define('AREA', 'admin');
require './lib/init.php'; require './lib/init.php';
@@ -26,16 +25,14 @@ use Froxlor\Settings as Settings;
if (isset($_POST['subjectid'])) { if (isset($_POST['subjectid'])) {
$subjectid = intval($_POST['subjectid']); $subjectid = intval($_POST['subjectid']);
$mailbodyid = intval($_POST['mailbodyid']); $mailbodyid = intval($_POST['mailbodyid']);
} elseif (isset($_GET['subjectid'])) {
} elseif(isset($_GET['subjectid'])) {
$subjectid = intval($_GET['subjectid']); $subjectid = intval($_GET['subjectid']);
$mailbodyid = intval($_GET['mailbodyid']); $mailbodyid = intval($_GET['mailbodyid']);
} }
if (isset($_POST['id'])) { if (isset($_POST['id'])) {
$id = intval($_POST['id']); $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
} elseif(isset($_GET['id'])) {
$id = intval($_GET['id']); $id = intval($_GET['id']);
} }
@@ -48,11 +45,8 @@ $available_templates = array(
); );
// only show templates of features that are enabled #1191 // only show templates of features that are enabled #1191
if ((int)Settings::Get('system.report_enable') == 1) { if ((int) Settings::Get('system.report_enable') == 1) {
array_push($available_templates, array_push($available_templates, 'trafficmaxpercent', 'diskmaxpercent');
'trafficmaxpercent',
'diskmaxpercent'
);
} }
$file_templates = array( $file_templates = array(
@@ -60,7 +54,7 @@ $file_templates = array(
); );
if ($action == '') { if ($action == '') {
//email templates // email templates
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_templates"); $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_templates");
if (Settings::Get('panel.sendalternativemail') == 1) { if (Settings::Get('panel.sendalternativemail') == 1) {
@@ -71,9 +65,10 @@ if ($action == '') {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `id`, `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT `id`, `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `templategroup`='mails' WHERE `adminid` = :adminid AND `templategroup`='mails'
ORDER BY `language`, `varname`" ORDER BY `language`, `varname`");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'])); 'adminid' => $userinfo['adminid']
));
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$parts = array(); $parts = array();
@@ -98,9 +93,11 @@ if ($action == '') {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `language`= :lang WHERE `adminid` = :adminid AND `language`= :lang
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'" AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language_name)); 'adminid' => $userinfo['adminid'],
'lang' => $language_name
));
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$templates_done[] = str_replace('_subject', '', $row['varname']); $templates_done[] = str_replace('_subject', '', $row['varname']);
@@ -111,14 +108,15 @@ if ($action == '') {
} }
} }
//filetemplates // filetemplates
$filetemplates = ''; $filetemplates = '';
$filetemplateadd = false; $filetemplateadd = false;
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `templategroup`='files'" WHERE `adminid` = :adminid AND `templategroup`='files'");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'])); 'adminid' => $userinfo['adminid']
));
if (Database::num_rows() != count($file_templates)) { if (Database::num_rows() != count($file_templates)) {
$filetemplateadd = true; $filetemplateadd = true;
@@ -128,84 +126,87 @@ if ($action == '') {
eval("\$filetemplates.=\"" . \Froxlor\UI\Template::getTemplate("templates/templates_filetemplate") . "\";"); eval("\$filetemplates.=\"" . \Froxlor\UI\Template::getTemplate("templates/templates_filetemplate") . "\";");
} }
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates") . "\";");
} elseif ($action == 'delete' && $subjectid != 0 && $mailbodyid != 0) {
} elseif($action == 'delete' // email templates
&& $subjectid != 0
&& $mailbodyid != 0
) {
//email templates
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :id" WHERE `adminid` = :adminid AND `id` = :id");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $subjectid)); 'adminid' => $userinfo['adminid'],
'id' => $subjectid
));
$result = $result_stmt->fetch(PDO::FETCH_ASSOC); $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
if ($result['varname'] != '') { if ($result['varname'] != '') {
if (isset($_POST['send']) if (isset($_POST['send']) && $_POST['send'] == 'send') {
&& $_POST['send'] == 'send'
) {
$del_stmt = Database::prepare(" $del_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_TEMPLATES . "` DELETE FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid WHERE `adminid` = :adminid
AND (`id` = :ida OR `id` = :idb)" AND (`id` = :ida OR `id` = :idb)");
);
Database::pexecute($del_stmt, array( Database::pexecute($del_stmt, array(
'adminid' => $userinfo['adminid'], 'adminid' => $userinfo['adminid'],
'ida' => $subjectid, 'ida' => $subjectid,
'idb' => $mailbodyid 'idb' => $mailbodyid
)); ));
$log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])] . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])] . "'");
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
ask_yesno('admin_template_reallydelete', $filename, array('subjectid' => $subjectid, 'mailbodyid' => $mailbodyid, 'page' => $page, 'action' => $action), $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])]); ask_yesno('admin_template_reallydelete', $filename, array(
'subjectid' => $subjectid,
'mailbodyid' => $mailbodyid,
'page' => $page,
'action' => $action
), $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])]);
} }
} }
} elseif ($action == 'deletef' && $id != 0) {
} elseif($action == 'deletef' // file templates
&& $id != 0
) {
//file templates
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :id" WHERE `adminid` = :adminid AND `id` = :id");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id)); 'adminid' => $userinfo['adminid'],
'id' => $id
));
if (Database::num_rows() > 0) { if (Database::num_rows() > 0) {
$row = $result_stmt->fetch(PDO::FETCH_ASSOC); $row = $result_stmt->fetch(PDO::FETCH_ASSOC);
if (isset($_POST['send']) if (isset($_POST['send']) && $_POST['send'] == 'send') {
&& $_POST['send'] == 'send'
) {
$del_stmt = Database::prepare(" $del_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_TEMPLATES . "` DELETE FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :id" WHERE `adminid` = :adminid AND `id` = :id");
); Database::pexecute($del_stmt, array(
Database::pexecute($del_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id)); 'adminid' => $userinfo['adminid'],
'id' => $id
));
$log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $lng['admin']['templates'][$row['varname']] . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $lng['admin']['templates'][$row['varname']] . "'");
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
ask_yesno('admin_template_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $lng['admin']['templates'][$row['varname']]); ask_yesno('admin_template_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
), $lng['admin']['templates'][$row['varname']]);
} }
} else { } else {
\Froxlor\UI\Response::standard_error('templatenotfound'); \Froxlor\UI\Response::standard_error('templatenotfound');
} }
} elseif ($action == 'add') {
} elseif($action == 'add') {
if (Settings::Get('panel.sendalternativemail') == 1) { if (Settings::Get('panel.sendalternativemail') == 1) {
$available_templates[] = 'pop_success_alternative'; $available_templates[] = 'pop_success_alternative';
} }
if (isset($_POST['prepare']) if (isset($_POST['prepare']) && $_POST['prepare'] == 'prepare') {
&& $_POST['prepare'] == 'prepare' // email templates
) {
//email templates
$language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect')); $language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
$template = validate($_POST['template'], 'template'); $template = validate($_POST['template'], 'template');
@@ -224,18 +225,15 @@ if ($action == '') {
$lng = $lng_bak; $lng = $lng_bak;
$template_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.template_add.php'; $template_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.template_add.php';
$template_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($template_add_data); $template_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($template_add_data);
$title = $template_add_data['template_add']['title']; $title = $template_add_data['template_add']['title'];
$image = $template_add_data['template_add']['image']; $image = $template_add_data['template_add']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates_add_2") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates_add_2") . "\";");
} elseif (isset($_POST['send']) && $_POST['send'] == 'send') {
} elseif(isset($_POST['send']) // email templates
&& $_POST['send'] == 'send'
) {
//email templates
$language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect')); $language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
$template = validate($_POST['template'], 'template'); $template = validate($_POST['template'], 'template');
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate'); $subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
@@ -244,18 +242,19 @@ if ($action == '') {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `language` = :lang WHERE `adminid` = :adminid AND `language` = :lang
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'" AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language)); 'adminid' => $userinfo['adminid'],
'lang' => $language
));
while($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$templates[] = str_replace('_subject', '', $row['varname']); $templates[] = str_replace('_subject', '', $row['varname']);
} }
$templates = array_diff($available_templates, $templates); $templates = array_diff($available_templates, $templates);
if (array_search($template, $templates) === false) { if (array_search($template, $templates) === false) {
\Froxlor\UI\Response::standard_error('templatenotfound'); \Froxlor\UI\Response::standard_error('templatenotfound');
} else { } else {
$ins_stmt = Database::prepare(" $ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` SET INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` SET
@@ -263,14 +262,13 @@ if ($action == '') {
`language` = :lang, `language` = :lang,
`templategroup` = 'mails', `templategroup` = 'mails',
`varname` = :var, `varname` = :var,
`value` = :value" `value` = :value");
);
// mail-subject // mail-subject
$ins_data = array( $ins_data = array(
'adminid' => $userinfo['adminid'], 'adminid' => $userinfo['adminid'],
'lang' => $language, 'lang' => $language,
'var' => $template.'_subject', 'var' => $template . '_subject',
'value' => $subject 'value' => $subject
); );
Database::pexecute($ins_stmt, $ins_data); Database::pexecute($ins_stmt, $ins_data);
@@ -279,19 +277,19 @@ if ($action == '') {
$ins_data = array( $ins_data = array(
'adminid' => $userinfo['adminid'], 'adminid' => $userinfo['adminid'],
'lang' => $language, 'lang' => $language,
'var' => $template.'_mailbody', 'var' => $template . '_mailbody',
'value' => $mailbody 'value' => $mailbody
); );
Database::pexecute($ins_stmt, $ins_data); Database::pexecute($ins_stmt, $ins_data);
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $language . ' - ' . $template . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $language . ' - ' . $template . "'");
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} }
} elseif (isset($_POST['filesend']) && $_POST['filesend'] == 'filesend') {
} elseif(isset($_POST['filesend']) // file templates
&& $_POST['filesend'] == 'filesend'
) {
//file templates
$template = validate($_POST['template'], 'template'); $template = validate($_POST['template'], 'template');
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset'); $filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
@@ -301,8 +299,7 @@ if ($action == '') {
`language` = '', `language` = '',
`templategroup` = 'files', `templategroup` = 'files',
`varname` = :var, `varname` = :var,
`value` = :value" `value` = :value");
);
$ins_data = array( $ins_data = array(
'adminid' => $userinfo['adminid'], 'adminid' => $userinfo['adminid'],
@@ -312,11 +309,13 @@ if ($action == '') {
Database::pexecute($ins_stmt, $ins_data); Database::pexecute($ins_stmt, $ins_data);
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $template . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $template . "'");
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} elseif (! isset($_GET['files'])) {
} elseif(!isset($_GET['files'])) { // email templates
//email templates
$add = false; $add = false;
$language_options = ''; $language_options = '';
$template_options = ''; $template_options = '';
@@ -326,9 +325,11 @@ if ($action == '') {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `language` = :lang WHERE `adminid` = :adminid AND `language` = :lang
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'" AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language_name)); 'adminid' => $userinfo['adminid'],
'lang' => $language_name
));
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$templates[] = str_replace('_subject', '', $row['varname']); $templates[] = str_replace('_subject', '', $row['varname']);
@@ -336,12 +337,12 @@ if ($action == '') {
if (count(array_diff($available_templates, $templates)) > 0) { if (count(array_diff($available_templates, $templates)) > 0) {
$add = true; $add = true;
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true, true); $language_options .= makeoption($language_name, $language_file, $userinfo['language'], true, true);
$templates = array_diff($available_templates, $templates); $templates = array_diff($available_templates, $templates);
foreach ($templates as $template) { foreach ($templates as $template) {
$template_options.= makeoption($lng['admin']['templates'][$template], $template, NULL, true, true, $language_file) . "\n"; $template_options .= makeoption($lng['admin']['templates'][$template], $template, NULL, true, true, $language_file) . "\n";
} }
} }
} }
@@ -351,18 +352,17 @@ if ($action == '') {
} else { } else {
\Froxlor\UI\Response::standard_error('alltemplatesdefined'); \Froxlor\UI\Response::standard_error('alltemplatesdefined');
} }
} else { } else {
//filetemplates // filetemplates
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `templategroup`='files'" WHERE `adminid` = :adminid AND `templategroup`='files'");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'])); 'adminid' => $userinfo['adminid']
));
if (Database::num_rows() == count($file_templates)) { if (Database::num_rows() == count($file_templates)) {
\Froxlor\UI\Response::standard_error('alltemplatesdefined'); \Froxlor\UI\Response::standard_error('alltemplatesdefined');
} else { } else {
$templatesdefined = array(); $templatesdefined = array();
@@ -373,10 +373,10 @@ if ($action == '') {
} }
foreach (array_diff($file_templates, $templatesdefined) as $template) { foreach (array_diff($file_templates, $templatesdefined) as $template) {
$free_templates.= makeoption($lng['admin']['templates'][$template], $template, '', true); $free_templates .= makeoption($lng['admin']['templates'][$template], $template, '', true);
} }
$filetemplate_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.filetemplate_add.php'; $filetemplate_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.filetemplate_add.php';
$filetemplate_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($filetemplate_add_data); $filetemplate_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($filetemplate_add_data);
$title = $filetemplate_add_data['filetemplate_add']['title']; $title = $filetemplate_add_data['filetemplate_add']['title'];
@@ -385,32 +385,27 @@ if ($action == '') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/filetemplates_add") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/filetemplates_add") . "\";");
} }
} }
} elseif ($action == 'edit' && $subjectid != 0 && $mailbodyid != 0) {
} elseif($action == 'edit' // email templates
&& $subjectid != 0
&& $mailbodyid != 0
) {
//email templates
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :subjectid" WHERE `adminid` = :adminid AND `id` = :subjectid");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'subjectid' => $subjectid)); 'adminid' => $userinfo['adminid'],
'subjectid' => $subjectid
));
$result = $result_stmt->fetch(PDO::FETCH_ASSOC); $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
if ($result['varname'] != '') { if ($result['varname'] != '') {
if (isset($_POST['send']) if (isset($_POST['send']) && $_POST['send'] == 'send') {
&& $_POST['send'] == 'send'
) {
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate'); $subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
$mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate'); $mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
$upd_stmt = Database::prepare(" $upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET
`value` = :value `value` = :value
WHERE `adminid` = :adminid AND `id` = :id" WHERE `adminid` = :adminid AND `id` = :id");
);
// subject // subject
Database::pexecute($upd_stmt, array( Database::pexecute($upd_stmt, array(
'value' => $subject, 'value' => $subject,
@@ -425,8 +420,10 @@ if ($action == '') {
)); ));
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $result['varname'] . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $result['varname'] . "'");
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
$result = htmlentities_array($result); $result = htmlentities_array($result);
@@ -435,11 +432,12 @@ if ($action == '') {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `language`, `varname`, `value` SELECT `language`, `varname`, `value`
FROM `" . TABLE_PANEL_TEMPLATES . "` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `id` = :id" WHERE `id` = :id");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('id' => $mailbodyid)); 'id' => $mailbodyid
));
$result = $result_stmt->fetch(PDO::FETCH_ASSOC); $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
$template_name = str_replace('_mailbody', '', $result['varname']); $template_name = str_replace('_mailbody', '', $result['varname']);
// don't escape the already escaped language-string so save up before htmlentities() // don't escape the already escaped language-string so save up before htmlentities()
@@ -447,7 +445,7 @@ if ($action == '') {
$result = htmlentities_array($result); $result = htmlentities_array($result);
$mailbody = $result['value']; $mailbody = $result['value'];
$template_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.template_edit.php'; $template_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.template_edit.php';
$template_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($template_edit_data); $template_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($template_edit_data);
$title = $template_edit_data['template_edit']['title']; $title = $template_edit_data['template_edit']['title'];
@@ -456,31 +454,27 @@ if ($action == '') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates_edit") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates_edit") . "\";");
} }
} }
} elseif ($action == 'editf' && $id != 0) {
} elseif($action == 'editf' // file templates
&& $id != 0
) {
//file templates
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :id" WHERE `adminid` = :adminid AND `id` = :id");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id)); 'adminid' => $userinfo['adminid'],
'id' => $id
));
if(Database::num_rows() > 0) { if (Database::num_rows() > 0) {
$row = $result_stmt->fetch(PDO::FETCH_ASSOC); $row = $result_stmt->fetch(PDO::FETCH_ASSOC);
//filetemplates // filetemplates
if (isset($_POST['filesend']) if (isset($_POST['filesend']) && $_POST['filesend'] == 'filesend') {
&& $_POST['filesend'] == 'filesend'
) {
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset'); $filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
$upd_stmt = Database::prepare(" $upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET
`value` = :value `value` = :value
WHERE `adminid` = :adminid AND `id` = :id" WHERE `adminid` = :adminid AND `id` = :id");
);
Database::pexecute($upd_stmt, array( Database::pexecute($upd_stmt, array(
'value' => $filecontent, 'value' => $filecontent,
'adminid' => $userinfo['adminid'], 'adminid' => $userinfo['adminid'],
@@ -488,12 +482,14 @@ if ($action == '') {
)); ));
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $row['varname'] . "'"); $log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $row['varname'] . "'");
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
$row = htmlentities_array($row); $row = htmlentities_array($row);
$filetemplate_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.filetemplate_edit.php'; $filetemplate_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.filetemplate_edit.php';
$filetemplate_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($filetemplate_edit_data); $filetemplate_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($filetemplate_edit_data);
$title = $filetemplate_edit_data['filetemplate_edit']['title']; $title = $filetemplate_edit_data['filetemplate_edit']['title'];
@@ -501,7 +497,6 @@ if ($action == '') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/filetemplates_edit") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/filetemplates_edit") . "\";");
} }
} else { } else {
\Froxlor\UI\Response::standard_error('templatenotfound'); \Froxlor\UI\Response::standard_error('templatenotfound');
} }

View File

@@ -15,7 +15,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'admin'); define('AREA', 'admin');
require './lib/init.php'; require './lib/init.php';
@@ -24,7 +23,7 @@ use Froxlor\Settings as Settings;
if (isset($_POST['id'])) { if (isset($_POST['id'])) {
$id = intval($_POST['id']); $id = intval($_POST['id']);
} elseif(isset($_GET['id'])) { } elseif (isset($_GET['id'])) {
$id = intval($_GET['id']); $id = intval($_GET['id']);
} }
@@ -41,52 +40,52 @@ $months = array(
'9' => 'sep', '9' => 'sep',
'10' => 'oct', '10' => 'oct',
'11' => 'nov', '11' => 'nov',
'12' => 'dec', '12' => 'dec'
); );
if ($page == 'overview' || $page == 'customers') { if ($page == 'overview' || $page == 'customers') {
$customerview = 1; $customerview = 1;
$stats_tables = ''; $stats_tables = '';
$minyear_stmt = Database::query("SELECT `year` FROM `". TABLE_PANEL_TRAFFIC . "` ORDER BY `year` ASC LIMIT 1"); $minyear_stmt = Database::query("SELECT `year` FROM `" . TABLE_PANEL_TRAFFIC . "` ORDER BY `year` ASC LIMIT 1");
$minyear = $minyear_stmt->fetch(PDO::FETCH_ASSOC); $minyear = $minyear_stmt->fetch(PDO::FETCH_ASSOC);
if (!isset($minyear['year']) || $minyear['year'] == 0) { if (! isset($minyear['year']) || $minyear['year'] == 0) {
$maxyears = 0; $maxyears = 0;
} else { } else {
$maxyears = date("Y") - $minyear['year']; $maxyears = date("Y") - $minyear['year'];
} }
for ($years = 0; $years<=$maxyears; $years++) { for ($years = 0; $years <= $maxyears; $years ++) {
$overview['year'] = date("Y")-$years; $overview['year'] = date("Y") - $years;
$overview['type'] = $lng['traffic']['customer']; $overview['type'] = $lng['traffic']['customer'];
$domain_list = ''; $domain_list = '';
$totals = array( $totals = array(
'jan' => 0, 'jan' => 0,
'feb' => 0, 'feb' => 0,
'mar' => 0, 'mar' => 0,
'apr' => 0, 'apr' => 0,
'may' => 0, 'may' => 0,
'jun' => 0, 'jun' => 0,
'jul' => 0, 'jul' => 0,
'aug' => 0, 'aug' => 0,
'sep' => 0, 'sep' => 0,
'oct' => 0, 'oct' => 0,
'nov' => 0, 'nov' => 0,
'dec' => 0, 'dec' => 0
); );
$customer_name_list_stmt = Database::prepare(" $customer_name_list_stmt = Database::prepare("
SELECT `customerid`,`company`,`name`,`firstname` SELECT `customerid`,`company`,`name`,`firstname`
FROM `" . TABLE_PANEL_CUSTOMERS . "` FROM `" . TABLE_PANEL_CUSTOMERS . "`
WHERE `deactivated`='0'" . WHERE `deactivated`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :id") . "
($userinfo['customers_see_all'] ? '' : " AND `adminid` = :id") . " ORDER BY name");
ORDER BY name" Database::pexecute($customer_name_list_stmt, array(
); 'id' => $userinfo['adminid']
Database::pexecute($customer_name_list_stmt, array('id' => $userinfo['adminid'])); ));
while($customer_name = $customer_name_list_stmt->fetch(PDO::FETCH_ASSOC)) { while ($customer_name = $customer_name_list_stmt->fetch(PDO::FETCH_ASSOC)) {
$virtual_host = array( $virtual_host = array(
'name' => ($customer_name['company'] == '' ? $customer_name['name'] . ", " . $customer_name['firstname'] : $customer_name['company']), 'name' => ($customer_name['company'] == '' ? $customer_name['name'] . ", " . $customer_name['firstname'] : $customer_name['company']),
@@ -102,29 +101,31 @@ if ($page == 'overview' || $page == 'customers') {
'sep' => '-', 'sep' => '-',
'oct' => '-', 'oct' => '-',
'nov' => '-', 'nov' => '-',
'dec' => '-', 'dec' => '-'
); );
$traffic_list_stmt = Database::prepare(" $traffic_list_stmt = Database::prepare("
SELECT month, SUM(http+ftp_up+ftp_down+mail)*1024 AS traffic SELECT month, SUM(http+ftp_up+ftp_down+mail)*1024 AS traffic
FROM `" . TABLE_PANEL_TRAFFIC . "` FROM `" . TABLE_PANEL_TRAFFIC . "`
WHERE year = :year AND `customerid` = :id WHERE year = :year AND `customerid` = :id
GROUP BY month ORDER BY month" GROUP BY month ORDER BY month");
); Database::pexecute($traffic_list_stmt, array(
Database::pexecute($traffic_list_stmt, array('year' => (date("Y")-$years), 'id' => $customer_name['customerid'])); 'year' => (date("Y") - $years),
'id' => $customer_name['customerid']
));
while ($traffic_month = $traffic_list_stmt->fetch(PDO::FETCH_ASSOC)) { while ($traffic_month = $traffic_list_stmt->fetch(PDO::FETCH_ASSOC)) {
$virtual_host[$months[(int)$traffic_month['month']]] = \Froxlor\PhpHelper::size_readable($traffic_month['traffic'], 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s'); $virtual_host[$months[(int) $traffic_month['month']]] = \Froxlor\PhpHelper::size_readable($traffic_month['traffic'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$totals[$months[(int)$traffic_month['month']]] += $traffic_month['traffic']; $totals[$months[(int) $traffic_month['month']]] += $traffic_month['traffic'];
} }
eval("\$domain_list .= sprintf(\"%s\", \"" . \Froxlor\UI\Template::getTemplate("traffic/index_table_row") . "\");"); eval("\$domain_list .= sprintf(\"%s\", \"" . \Froxlor\UI\Template::getTemplate("traffic/index_table_row") . "\");");
} }
// sum up totals // sum up totals
$virtual_host = array( $virtual_host = array(
'name' => $lng['traffic']['months']['total'], 'name' => $lng['traffic']['months']['total']
); );
foreach ($totals as $month => $bytes) { foreach ($totals as $month => $bytes) {
$virtual_host[$month] = ($bytes == 0 ? '-' : \Froxlor\PhpHelper::size_readable($bytes, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s')); $virtual_host[$month] = ($bytes == 0 ? '-' : \Froxlor\PhpHelper::size_readable($bytes, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s'));
} }
$customerview = 0; $customerview = 0;
eval("\$total_list = sprintf(\"%s\", \"" . \Froxlor\UI\Template::getTemplate("traffic/index_table_row") . "\");"); eval("\$total_list = sprintf(\"%s\", \"" . \Froxlor\UI\Template::getTemplate("traffic/index_table_row") . "\");");

View File

@@ -14,7 +14,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'admin'); define('AREA', 'admin');
require './lib/init.php'; require './lib/init.php';
@@ -29,15 +28,11 @@ if ($page == 'overview') {
* have any version/dbversion in the database (don't know why) * have any version/dbversion in the database (don't know why)
* so we have to set them both to run a correct upgrade * so we have to set them both to run a correct upgrade
*/ */
if (!isFroxlor()) { if (! isFroxlor()) {
if (Settings::Get('panel.version') == null if (Settings::Get('panel.version') == null || Settings::Get('panel.version') == '') {
|| Settings::Get('panel.version') == ''
) {
Settings::Set('panel.version', '1.4.2.1'); Settings::Set('panel.version', '1.4.2.1');
} }
if (Settings::Get('system.dbversion') == null if (Settings::Get('system.dbversion') == null || Settings::Get('system.dbversion') == '') {
|| Settings::Get('system.dbversion') == ''
) {
/** /**
* for syscp-stable (1.4.2.1) this value has to be 0 * for syscp-stable (1.4.2.1) this value has to be 0
* so the required table-fields are added correctly * so the required table-fields are added correctly
@@ -45,12 +40,11 @@ if ($page == 'overview') {
* -> bug #54 * -> bug #54
*/ */
$result_stmt = Database::query(" $result_stmt = Database::query("
SELECT `value` FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `varname` = 'dbversion'" SELECT `value` FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `varname` = 'dbversion'");
);
$result = $result_stmt->fetch(PDO::FETCH_ASSOC); $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
if (isset($result['value'])) { if (isset($result['value'])) {
Settings::Set('system.dbversion', (int)$result['value'], false); Settings::Set('system.dbversion', (int) $result['value'], false);
} else { } else {
Settings::Set('system.dbversion', 0, false); Settings::Set('system.dbversion', 0, false);
} }
@@ -61,14 +55,8 @@ if ($page == 'overview') {
$successful_update = false; $successful_update = false;
$message = ''; $message = '';
if (isset($_POST['send']) if (isset($_POST['send']) && $_POST['send'] == 'send') {
&& $_POST['send'] == 'send' if ((isset($_POST['update_preconfig']) && isset($_POST['update_changesagreed']) && intval($_POST['update_changesagreed']) != 0) || ! isset($_POST['update_preconfig'])) {
) {
if ((isset($_POST['update_preconfig'])
&& isset($_POST['update_changesagreed'])
&& intval($_POST['update_changesagreed']) != 0)
|| !isset($_POST['update_preconfig'])
) {
eval("echo \"" . \Froxlor\UI\Template::getTemplate('update/update_start') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('update/update_start') . "\";");
include_once './install/updatesql.php'; include_once './install/updatesql.php';
@@ -86,23 +74,23 @@ if ($page == 'overview') {
} }
} }
if (!$successful_update) { if (! $successful_update) {
$current_version = Settings::Get('panel.version'); $current_version = Settings::Get('panel.version');
$current_db_version = Settings::Get('panel.db_version'); $current_db_version = Settings::Get('panel.db_version');
if (empty($current_db_version)) { if (empty($current_db_version)) {
$current_db_version = "0"; $current_db_version = "0";
} }
$new_version = $version; $new_version = $version;
$new_db_version = $dbversion; $new_db_version = $dbversion;
$ui_text = $lng['update']['update_information']['part_a']; $ui_text = $lng['update']['update_information']['part_a'];
if ($version != $current_version) { if ($version != $current_version) {
$ui_text = str_replace('%curversion', $current_version, $ui_text); $ui_text = str_replace('%curversion', $current_version, $ui_text);
$ui_text = str_replace('%newversion', $new_version, $ui_text); $ui_text = str_replace('%newversion', $new_version, $ui_text);
} else { } else {
// show db version // show db version
$ui_text = str_replace('%curversion', $current_db_version, $ui_text); $ui_text = str_replace('%curversion', $current_db_version, $ui_text);
$ui_text = str_replace('%newversion', $new_db_version, $ui_text); $ui_text = str_replace('%newversion', $new_db_version, $ui_text);
} }
$update_information = $ui_text; $update_information = $ui_text;

View File

@@ -65,7 +65,7 @@ function json_response($status, $status_message = '', $data = null)
$response['status'] = $status; $response['status'] = $status;
$response['status_message'] = $status_message; $response['status_message'] = $status_message;
$response['data'] = $data; $response['data'] = $data;
$json_response = json_encode($response, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); $json_response = json_encode($response, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
echo $json_response; echo $json_response;
exit(); exit();

View File

@@ -17,7 +17,7 @@ if (! defined('AREA')) {
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Panel * @package Panel
* @since 0.10.0 * @since 0.10.0
* *
*/ */
use Froxlor\Database as Database; use Froxlor\Database as Database;
@@ -70,8 +70,7 @@ if ($action == 'delete') {
// customer generates for himself, admins will see a customer-select-box later // customer generates for himself, admins will see a customer-select-box later
if (AREA == 'admin') { if (AREA == 'admin') {
$cid = 0; $cid = 0;
} } elseif (AREA == 'customer') {
elseif (AREA == 'customer') {
$cid = $userinfo['customerid']; $cid = $userinfo['customerid'];
} }
$key = hash('sha256', openssl_random_pseudo_bytes(64 * 64)); $key = hash('sha256', openssl_random_pseudo_bytes(64 * 64));
@@ -84,23 +83,23 @@ if ($action == 'delete') {
)); ));
$success_message = $lng['apikeys']['apikey_added']; $success_message = $lng['apikeys']['apikey_added'];
} elseif ($action == 'jqEditApiKey') { } elseif ($action == 'jqEditApiKey') {
$keyid = isset($_POST['id']) ? (int)$_POST['id'] : 0; $keyid = isset($_POST['id']) ? (int) $_POST['id'] : 0;
$allowed_from = isset($_POST['allowed_from']) ? $_POST['allowed_from'] : ""; $allowed_from = isset($_POST['allowed_from']) ? $_POST['allowed_from'] : "";
$valid_until = isset($_POST['valid_until']) ? (int)$_POST['valid_until'] : -1; $valid_until = isset($_POST['valid_until']) ? (int) $_POST['valid_until'] : - 1;
// validate allowed_from // validate allowed_from
$ip_list = array_map('trim', explode(",", $allowed_from)); $ip_list = array_map('trim', explode(",", $allowed_from));
$_check_list = $ip_list; $_check_list = $ip_list;
foreach ($_check_list as $idx => $ip) { foreach ($_check_list as $idx => $ip) {
if (validate_ip2($ip, true, 'invalidip', true, true) == false) { if (validate_ip2($ip, true, 'invalidip', true, true) == false) {
unset ($ip_list[$idx]); unset($ip_list[$idx]);
} }
} }
$ip_list = array_map('inet_ntop', array_map('inet_pton', $ip_list)); $ip_list = array_map('inet_ntop', array_map('inet_pton', $ip_list));
$allowed_from = implode(",", array_unique($ip_list)); $allowed_from = implode(",", array_unique($ip_list));
if ($valid_until <= 0 || !is_numeric($valid_until)) { if ($valid_until <= 0 || ! is_numeric($valid_until)) {
$valid_until = -1; $valid_until = - 1;
} }
$upd_stmt = Database::prepare(" $upd_stmt = Database::prepare("
@@ -110,8 +109,7 @@ if ($action == 'delete') {
"); ");
if (AREA == 'admin') { if (AREA == 'admin') {
$cid = 0; $cid = 0;
} } elseif (AREA == 'customer') {
elseif (AREA == 'customer') {
$cid = $userinfo['customerid']; $cid = $userinfo['customerid'];
} }
Database::pexecute($upd_stmt, array( Database::pexecute($upd_stmt, array(
@@ -122,7 +120,7 @@ if ($action == 'delete') {
'cid' => $cid 'cid' => $cid
)); ));
echo json_encode(true); echo json_encode(true);
exit; exit();
} }
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed api::api_keys"); $log->logAction(USR_ACTION, LOG_NOTICE, "viewed api::api_keys");
@@ -179,7 +177,7 @@ if (count($all_keys) == 0) {
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s); $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
$searchcode = $paging->getHtmlSearchCode($lng); $searchcode = $paging->getHtmlSearchCode($lng);
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s); $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
foreach ($all_keys as $idx => $key) { foreach ($all_keys as $idx => $key) {
if ($paging->checkDisplay($idx)) { if ($paging->checkDisplay($idx)) {
@@ -206,7 +204,7 @@ if (count($all_keys) == 0) {
// customer do not need links // customer do not need links
$adminCustomerLink = $key['loginname']; $adminCustomerLink = $key['loginname'];
} }
// escape stuff // escape stuff
$row = htmlentities_array($key); $row = htmlentities_array($key);

View File

@@ -19,7 +19,8 @@
depends="prepare,static-analysis-parallel,phpunit,phpdox,-check-failure" depends="prepare,static-analysis-parallel,phpunit,phpdox,-check-failure"
description="Performs static analysis (executing the tools in parallel), runs the tests, and generates project documentation" /> description="Performs static analysis (executing the tools in parallel), runs the tests, and generates project documentation" />
<target name="quick-build" depends="prepare,lint,phpunit-no-coverage" <target name="quick-build"
depends="prepare,lint,phpunit-no-coverage"
description="Performs a lint check and runs the tests (without generating code coverage reports)" /> description="Performs a lint check and runs the tests (without generating code coverage reports)" />
<target name="static-analysis" <target name="static-analysis"
@@ -41,7 +42,8 @@
</parallel> </parallel>
</target> </target>
<target name="clean" unless="clean.done" description="Cleanup build artifacts"> <target name="clean" unless="clean.done"
description="Cleanup build artifacts">
<delete dir="${basedir}/build/api" /> <delete dir="${basedir}/build/api" />
<delete dir="${basedir}/build/coverage" /> <delete dir="${basedir}/build/coverage" />
<delete dir="${basedir}/build/logs" /> <delete dir="${basedir}/build/logs" />
@@ -109,7 +111,8 @@
description="Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment."> description="Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${pdepend}" taskname="pdepend"> <exec executable="${pdepend}" taskname="pdepend">
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" /> <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" /> <arg
value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
<arg <arg
value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" /> value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
<arg path="${basedir}/lib/Froxlor" /> <arg path="${basedir}/lib/Froxlor" />
@@ -204,7 +207,8 @@
<target name="phpunit-no-coverage" unless="phpunit.done" <target name="phpunit-no-coverage" unless="phpunit.done"
depends="prepare" depends="prepare"
description="Run unit tests with PHPUnit (without generating code coverage reports)"> description="Run unit tests with PHPUnit (without generating code coverage reports)">
<exec executable="${phpunit}" failonerror="true" taskname="phpunit"> <exec executable="${phpunit}" failonerror="true"
taskname="phpunit">
<arg value="--configuration" /> <arg value="--configuration" />
<arg path="${basedir}/phpunit.xml" /> <arg path="${basedir}/phpunit.xml" />
<arg value="--testsuite" /> <arg value="--testsuite" />
@@ -215,9 +219,11 @@
<property name="phpunit.done" value="true" /> <property name="phpunit.done" value="true" />
</target> </target>
<target name="phpdox" unless="phpdox.done" depends="phploc-ci,phpcs-ci,phpmd-ci" <target name="phpdox" unless="phpdox.done"
depends="phploc-ci,phpcs-ci,phpmd-ci"
description="Generate project documentation using phpDox"> description="Generate project documentation using phpDox">
<exec executable="${phpdox}" dir="${basedir}/build" taskname="phpdox"> <exec executable="${phpdox}" dir="${basedir}/build"
taskname="phpdox">
<arg value="--file" /> <arg value="--file" />
<arg path="${basedir}/phpdox.xml" /> <arg path="${basedir}/phpdox.xml" />
</exec> </exec>

View File

@@ -1,71 +1,73 @@
{ {
"name" : "froxlor/froxlor", "name": "froxlor/froxlor",
"description" : "The server administration software for your needs. Developed by experienced server administrators, this panel simplifies the effort of managing your hosting platform.", "description": "The server administration software for your needs. Developed by experienced server administrators, this panel simplifies the effort of managing your hosting platform.",
"keywords" : [ "keywords": [
"server", "server",
"administration", "administration",
"php" "php"
], ],
"homepage" : "https://www.froxlor.org", "homepage": "https://www.froxlor.org",
"license" : "GPL-2.0-or-later", "license": "GPL-2.0-or-later",
"authors" : [{ "authors": [
"name" : "Michael Kaufmann", {
"email" : "team@froxlor.org", "name": "Michael Kaufmann",
"role" : "Lead Developer" "email": "team@froxlor.org",
}, { "role": "Lead Developer"
"name" : "Robert Förster", },
"email" : "team@froxlor.org", {
"role" : "Package Maintainer" "name": "Robert Förster",
"email": "team@froxlor.org",
"role": "Package Maintainer"
} }
], ],
"support" : { "support": {
"email" : "team@froxlor.org", "email": "team@froxlor.org",
"issues" : "https://github.com/Froxlor/Froxlor/issues", "issues": "https://github.com/Froxlor/Froxlor/issues",
"forum" : "https://forum.froxlor.org/", "forum": "https://forum.froxlor.org/",
"wiki" : "https://github.com/Froxlor/Froxlor/wiki", "wiki": "https://github.com/Froxlor/Froxlor/wiki",
"irc" : "irc://chat.freenode.net/froxlor", "irc": "irc://chat.freenode.net/froxlor",
"source" : "https://github.com/Froxlor/Froxlor", "source": "https://github.com/Froxlor/Froxlor",
"docs" : "https://github.com/Froxlor/Froxlor/wiki" "docs": "https://github.com/Froxlor/Froxlor/wiki"
}, },
"require" : { "require": {
"php" : ">=5.6", "php": ">=5.6",
"ext-session" : "*", "ext-session": "*",
"ext-ctype" : "*", "ext-ctype": "*",
"ext-pdo" : "*", "ext-pdo": "*",
"ext-pdo_mysql" : "*", "ext-pdo_mysql": "*",
"ext-simplexml" : "*", "ext-simplexml": "*",
"ext-xml" : "*", "ext-xml": "*",
"ext-filter" : "*", "ext-filter": "*",
"ext-posix" : "*", "ext-posix": "*",
"ext-mbstring" : "*", "ext-mbstring": "*",
"ext-curl" : "*", "ext-curl": "*",
"ext-json" : "*", "ext-json": "*",
"ext-openssl": "*", "ext-openssl": "*",
"mso/idna-convert" : "1.*", "mso/idna-convert": "1.*",
"phpmailer/phpmailer": "~6.0", "phpmailer/phpmailer": "~6.0",
"monolog/monolog": "^1.24", "monolog/monolog": "^1.24",
"robthree/twofactorauth": "^1.6" "robthree/twofactorauth": "^1.6"
}, },
"require-dev" : { "require-dev": {
"phpunit/phpunit" : "6.5.13", "phpunit/phpunit": "6.5.13",
"pdepend/pdepend" : "2.5.0", "pdepend/pdepend": "2.5.0",
"phpmd/phpmd" : "2.6.0", "phpmd/phpmd": "2.6.0",
"sebastian/phpcpd" : "3.0.1", "sebastian/phpcpd": "3.0.1",
"squizlabs/php_codesniffer" : "3.3.2", "squizlabs/php_codesniffer": "3.3.2",
"phploc/phploc" : "3.0.1", "phploc/phploc": "3.0.1",
"theseer/phpdox" : "0.11.2", "theseer/phpdox": "0.11.2",
"phpunit/php-invoker" : "1.1.4", "phpunit/php-invoker": "1.1.4",
"php" : ">=7.0", "php": ">=7.0",
"ext-pcntl" : "*", "ext-pcntl": "*",
"phpcompatibility/php-compatibility": "*" "phpcompatibility/php-compatibility": "*"
}, },
"suggest" : { "suggest": {
"ext-bcmath" : "*", "ext-bcmath": "*",
"ext-zip" : "*" "ext-zip": "*"
}, },
"autoload" : { "autoload": {
"psr-4" : { "psr-4": {
"Froxlor\\" : [ "Froxlor\\": [
"lib/Froxlor" "lib/Froxlor"
] ]
} }

1888
css/jquery-ui.min.css vendored

File diff suppressed because one or more lines are too long

View File

@@ -16,7 +16,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
@@ -26,7 +25,7 @@ use Froxlor\Api\Commands\SubDomains as SubDomains;
use Froxlor\Api\Commands\Certificates as Certificates; use Froxlor\Api\Commands\Certificates as Certificates;
// redirect if this customer page is hidden via settings // redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','domains')) { if (Settings::IsInList('panel.customer_hide_options', 'domains')) {
\Froxlor\UI\Response::redirectTo('customer_index.php'); \Froxlor\UI\Response::redirectTo('customer_index.php');
} }
@@ -51,9 +50,11 @@ if ($page == 'overview') {
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`
WHERE `d`.`customerid`= :customerid WHERE `d`.`customerid`= :customerid
AND `d`.`email_only`='0' AND `d`.`email_only`='0'
AND `d`.`id` <> :standardsubdomain " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit() AND `d`.`id` <> :standardsubdomain " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
); Database::pexecute($domains_stmt, array(
Database::pexecute($domains_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain'])); "customerid" => $userinfo['customerid'],
"standardsubdomain" => $userinfo['standardsubdomain']
));
$paging->setEntries(Database::num_rows()); $paging->setEntries(Database::num_rows());
$sortcode = $paging->getHtmlSortCode($lng); $sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s); $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
@@ -63,23 +64,25 @@ if ($page == 'overview') {
$parentdomains_count = 0; $parentdomains_count = 0;
$domains_count = 0; $domains_count = 0;
$domain_array = array(); $domain_array = array();
while ($row = $domains_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $domains_stmt->fetch(PDO::FETCH_ASSOC)) {
$row['domain'] = $idna_convert->decode($row['domain']); $row['domain'] = $idna_convert->decode($row['domain']);
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']); $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
$row['domainalias'] = $idna_convert->decode($row['domainalias']); $row['domainalias'] = $idna_convert->decode($row['domainalias']);
if ($row['parentdomainid'] == '0' && $row['caneditdomain'] == '1') { if ($row['parentdomainid'] == '0' && $row['caneditdomain'] == '1') {
$parentdomains_count++; $parentdomains_count ++;
} }
/** /**
* check for set ssl-certs to show different state-icons * check for set ssl-certs to show different state-icons
*/ */
// nothing (ssl_global) // nothing (ssl_global)
$row['domain_hascert'] = 0; $row['domain_hascert'] = 0;
$ssl_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_DOMAIN_SSL_SETTINGS."` WHERE `domainid` = :domainid"); $ssl_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :domainid");
Database::pexecute($ssl_stmt, array("domainid" => $row['id'])); Database::pexecute($ssl_stmt, array(
"domainid" => $row['id']
));
$ssl_result = $ssl_stmt->fetch(PDO::FETCH_ASSOC); $ssl_result = $ssl_stmt->fetch(PDO::FETCH_ASSOC);
if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') { if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') {
// own certificate (ssl_customer_green) // own certificate (ssl_customer_green)
@@ -87,8 +90,10 @@ if ($page == 'overview') {
} else { } else {
// check if it's parent has one set (shared) // check if it's parent has one set (shared)
if ($row['parentdomainid'] != 0) { if ($row['parentdomainid'] != 0) {
$ssl_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_DOMAIN_SSL_SETTINGS."` WHERE `domainid` = :domainid"); $ssl_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :domainid");
Database::pexecute($ssl_stmt, array("domainid" => $row['parentdomainid'])); Database::pexecute($ssl_stmt, array(
"domainid" => $row['parentdomainid']
));
$ssl_result = $ssl_stmt->fetch(PDO::FETCH_ASSOC); $ssl_result = $ssl_stmt->fetch(PDO::FETCH_ASSOC);
if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') { if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') {
// parent has a certificate (ssl_shared) // parent has a certificate (ssl_shared)
@@ -96,29 +101,29 @@ if ($page == 'overview') {
} }
} }
} }
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']);
if($row['termination_date'] != "") { if ($row['termination_date'] != "") {
$cdate = strtotime($row['termination_date'] . " 23:59:59"); $cdate = strtotime($row['termination_date'] . " 23:59:59");
$today = time(); $today = time();
if($cdate < $today) { if ($cdate < $today) {
$row['termination_css'] = 'domain-expired'; $row['termination_css'] = 'domain-expired';
} else { } else {
$row['termination_css'] = 'domain-canceled'; $row['termination_css'] = 'domain-canceled';
} }
} }
$domains_count++; $domains_count ++;
$domain_array[$row['domain']] = $row; $domain_array[$row['domain']] = $row;
} }
ksort($domain_array); ksort($domain_array);
$domain_id_array = array(); $domain_id_array = array();
foreach ($domain_array as $sortkey => $row) { foreach ($domain_array as $sortkey => $row) {
$domain_id_array[$row['id']] = $sortkey; $domain_id_array[$row['id']] = $sortkey;
} }
$domain_sort_array = array(); $domain_sort_array = array();
foreach ($domain_array as $sortkey => $row) { foreach ($domain_array as $sortkey => $row) {
if ($row['parentdomainid'] == 0) { if ($row['parentdomainid'] == 0) {
@@ -126,25 +131,25 @@ if ($page == 'overview') {
} else { } else {
// when searching and the results are subdomains only, we need to get // when searching and the results are subdomains only, we need to get
// the parent domain to this subdomain // the parent domain to this subdomain
if (!isset($domain_id_array[$row['parentdomainid']])) { if (! isset($domain_id_array[$row['parentdomainid']])) {
$domain_id_array[$row['parentdomainid']] = "[parent-domain]"; $domain_id_array[$row['parentdomainid']] = "[parent-domain]";
} }
$domain_sort_array[$domain_id_array[$row['parentdomainid']]][$sortkey] = $row; $domain_sort_array[$domain_id_array[$row['parentdomainid']]][$sortkey] = $row;
} }
} }
$domain_array = array(); $domain_array = array();
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'asc') { if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'asc') {
ksort($domain_sort_array); ksort($domain_sort_array);
} elseif ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') { } elseif ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
krsort($domain_sort_array); krsort($domain_sort_array);
} }
$i = 0; $i = 0;
foreach ($domain_sort_array as $sortkey => $domain_array) { foreach ($domain_sort_array as $sortkey => $domain_array) {
if ($paging->checkDisplay($i)) { if ($paging->checkDisplay($i)) {
if (isset($domain_array[$sortkey])) { if (isset($domain_array[$sortkey])) {
$row = htmlentities_array($domain_array[$sortkey]); $row = htmlentities_array($domain_array[$sortkey]);
if (Settings::Get('system.awstats_enabled') == '1') { if (Settings::Get('system.awstats_enabled') == '1') {
@@ -154,18 +159,18 @@ if ($page == 'overview') {
} }
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";"); eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";");
} }
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'asc') { if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'asc') {
ksort($domain_array); ksort($domain_array);
} elseif ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') { } elseif ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
krsort($domain_array); krsort($domain_array);
} }
foreach ($domain_array as $row) { foreach ($domain_array as $row) {
if (strpos($row['documentroot'], $userinfo['documentroot']) === 0) { if (strpos($row['documentroot'], $userinfo['documentroot']) === 0) {
$row['documentroot'] = \Froxlor\FileDir::makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['documentroot'])); $row['documentroot'] = \Froxlor\FileDir::makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['documentroot']));
} }
// get ssl-ips if activated // get ssl-ips if activated
$show_ssledit = false; $show_ssledit = false;
if (Settings::Get('system.use_ssl') == '1' && \Froxlor\Domain\Domain::domainHasSslIpPort($row['id']) && $row['caneditdomain'] == '1' && $row['letsencrypt'] == 0) { if (Settings::Get('system.use_ssl') == '1' && \Froxlor\Domain\Domain::domainHasSslIpPort($row['id']) && $row['caneditdomain'] == '1' && $row['letsencrypt'] == 0) {
@@ -175,10 +180,10 @@ if ($page == 'overview') {
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";"); eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
} }
} }
$i+= count($domain_array); $i += count($domain_array);
} }
eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domainlist") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domainlist") . "\";");
} elseif ($action == 'delete' && $id != 0) { } elseif ($action == 'delete' && $id != 0) {
try { try {
@@ -189,10 +194,12 @@ if ($page == 'overview') {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$alias_stmt = Database::prepare("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `aliasdomain` = :aliasdomain"); $alias_stmt = Database::prepare("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `aliasdomain` = :aliasdomain");
$alias_check = Database::pexecute_first($alias_stmt, array("aliasdomain" => $id)); $alias_check = Database::pexecute_first($alias_stmt, array(
"aliasdomain" => $id
));
if (isset($result['parentdomainid']) && $result['parentdomainid'] != '0' && $alias_check['count'] == 0) { if (isset($result['parentdomainid']) && $result['parentdomainid'] != '0' && $alias_check['count'] == 0) {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
@@ -200,9 +207,16 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
ask_yesno('domains_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['domain'])); ask_yesno('domains_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
), $idna_convert->decode($result['domain']));
} }
} else { } else {
\Froxlor\UI\Response::standard_error('domains_cantdeletemaindomain'); \Froxlor\UI\Response::standard_error('domains_cantdeletemaindomain');
@@ -215,22 +229,26 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
$stmt = Database::prepare("SELECT `id`, `domain`, `documentroot`, `ssl_redirect`,`isemaildomain`,`letsencrypt` FROM `" . TABLE_PANEL_DOMAINS . "` $stmt = Database::prepare("SELECT `id`, `domain`, `documentroot`, `ssl_redirect`,`isemaildomain`,`letsencrypt` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid` = :customerid WHERE `customerid` = :customerid
AND `parentdomainid` = '0' AND `parentdomainid` = '0'
AND `email_only` = '0' AND `email_only` = '0'
AND `caneditdomain` = '1' AND `caneditdomain` = '1'
ORDER BY `domain` ASC" ORDER BY `domain` ASC");
); Database::pexecute($stmt, array(
Database::pexecute($stmt, array("customerid" => $userinfo['customerid'])); "customerid" => $userinfo['customerid']
));
$domains = ''; $domains = '';
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$domains .= makeoption($idna_convert->decode($row['domain']), $row['domain']); $domains .= makeoption($idna_convert->decode($row['domain']), $row['domain']);
} }
$aliasdomains = makeoption($lng['domains']['noaliasdomain'], 0, NULL, true); $aliasdomains = makeoption($lng['domains']['noaliasdomain'], 0, NULL, true);
$domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` $domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c`
WHERE `d`.`aliasdomain` IS NULL WHERE `d`.`aliasdomain` IS NULL
@@ -239,71 +257,71 @@ if ($page == 'overview') {
AND `d`.`customerid`=`c`.`customerid` AND `d`.`customerid`=`c`.`customerid`
AND `d`.`email_only`='0' AND `d`.`email_only`='0'
AND `d`.`customerid`= :customerid AND `d`.`customerid`= :customerid
ORDER BY `d`.`domain` ASC" ORDER BY `d`.`domain` ASC");
); Database::pexecute($domains_stmt, array(
Database::pexecute($domains_stmt, array("customerid" => $userinfo['customerid'])); "customerid" => $userinfo['customerid']
));
while ($row_domain = $domains_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row_domain = $domains_stmt->fetch(PDO::FETCH_ASSOC)) {
$aliasdomains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id']); $aliasdomains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id']);
} }
$redirectcode = ''; $redirectcode = '';
if (Settings::Get('customredirect.enabled') == '1') { if (Settings::Get('customredirect.enabled') == '1') {
$codes = getRedirectCodesArray(); $codes = getRedirectCodesArray();
foreach ($codes as $rc) { foreach ($codes as $rc) {
$redirectcode .= makeoption($rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')', $rc['id']); $redirectcode .= makeoption($rc['code'] . ' (' . $lng['redirect_desc'][$rc['desc']] . ')', $rc['id']);
} }
} }
// check if we at least have one ssl-ip/port, #1179 // check if we at least have one ssl-ip/port, #1179
$ssl_ipsandports = ''; $ssl_ipsandports = '';
$ssl_ip_stmt = Database::prepare(" $ssl_ip_stmt = Database::prepare("
SELECT COUNT(*) as countSSL SELECT COUNT(*) as countSSL
FROM `".TABLE_PANEL_IPSANDPORTS."` pip FROM `" . TABLE_PANEL_IPSANDPORTS . "` pip
LEFT JOIN `".TABLE_DOMAINTOIP."` dti ON dti.id_ipandports = pip.id LEFT JOIN `" . TABLE_DOMAINTOIP . "` dti ON dti.id_ipandports = pip.id
WHERE pip.`ssl`='1' WHERE pip.`ssl`='1'
"); ");
Database::pexecute($ssl_ip_stmt); Database::pexecute($ssl_ip_stmt);
$resultX = $ssl_ip_stmt->fetch(PDO::FETCH_ASSOC); $resultX = $ssl_ip_stmt->fetch(PDO::FETCH_ASSOC);
if (isset($resultX['countSSL']) && (int)$resultX['countSSL'] > 0) { if (isset($resultX['countSSL']) && (int) $resultX['countSSL'] > 0) {
$ssl_ipsandports = 'notempty'; $ssl_ipsandports = 'notempty';
} }
$openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true); $openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true);
$pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']); $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
$phpconfigs = ''; $phpconfigs = '';
$has_phpconfigs = false; $has_phpconfigs = false;
if (isset($userinfo['allowed_phpconfigs']) && !empty($userinfo['allowed_phpconfigs'])) if (isset($userinfo['allowed_phpconfigs']) && ! empty($userinfo['allowed_phpconfigs'])) {
{
$has_phpconfigs = true; $has_phpconfigs = true;
$allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY); $allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY);
$phpconfigs_result_stmt = Database::query(" $phpconfigs_result_stmt = Database::query("
SELECT c.*, fc.description as interpreter SELECT c.*, fc.description as interpreter
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
WHERE c.id IN (".implode(", ", $allowed_cfg).") WHERE c.id IN (" . implode(", ", $allowed_cfg) . ")
"); ");
while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) {
if ((int) Settings::Get('phpfpm.enabled') == 1) { if ((int) Settings::Get('phpfpm.enabled') == 1) {
$phpconfigs .= makeoption($phpconfigs_row['description'] . " [".$phpconfigs_row['interpreter']."]", $phpconfigs_row['id'], Settings::Get('phpfpm.defaultini'), true, true); $phpconfigs .= makeoption($phpconfigs_row['description'] . " [" . $phpconfigs_row['interpreter'] . "]", $phpconfigs_row['id'], Settings::Get('phpfpm.defaultini'), true, true);
} else { } else {
$phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], Settings::Get('system.mod_fcgid_defaultini'), true, true); $phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], Settings::Get('system.mod_fcgid_defaultini'), true, true);
} }
} }
} }
$subdomain_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/domains/formfield.domains_add.php'; $subdomain_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.domains_add.php';
$subdomain_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($subdomain_add_data); $subdomain_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($subdomain_add_data);
$title = $subdomain_add_data['domain_add']['title']; $title = $subdomain_add_data['domain_add']['title'];
$image = $subdomain_add_data['domain_add']['image']; $image = $subdomain_add_data['domain_add']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domains_add") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domains_add") . "\";");
} }
} }
} elseif ($action == 'edit' && $id != 0) { } elseif ($action == 'edit' && $id != 0) {
try { try {
$json_result = SubDomains::getLocal($userinfo, array( $json_result = SubDomains::getLocal($userinfo, array(
'id' => $id 'id' => $id
@@ -312,7 +330,7 @@ if ($page == 'overview') {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
if (isset($result['customerid']) && $result['customerid'] == $userinfo['customerid']) { if (isset($result['customerid']) && $result['customerid'] == $userinfo['customerid']) {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
@@ -320,13 +338,16 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
$result['domain'] = $idna_convert->decode($result['domain']); $result['domain'] = $idna_convert->decode($result['domain']);
$domains = makeoption($lng['domains']['noaliasdomain'], 0, $result['aliasdomain'], true); $domains = makeoption($lng['domains']['noaliasdomain'], 0, $result['aliasdomain'], true);
// also check ip/port combination to be the same, #176 // also check ip/port combination to be the same, #176
$domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d` , `" . TABLE_PANEL_CUSTOMERS . "` `c` , `".TABLE_DOMAINTOIP."` `dip` $domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d` , `" . TABLE_PANEL_CUSTOMERS . "` `c` , `" . TABLE_DOMAINTOIP . "` `dip`
WHERE `d`.`aliasdomain` IS NULL WHERE `d`.`aliasdomain` IS NULL
AND `d`.`id` <> :id AND `d`.`id` <> :id
AND `c`.`standardsubdomain` <> `d`.`id` AND `c`.`standardsubdomain` <> `d`.`id`
@@ -335,17 +356,19 @@ if ($page == 'overview') {
AND `c`.`customerid` = `d`.`customerid` AND `c`.`customerid` = `d`.`customerid`
AND `d`.`id` = `dip`.`id_domain` AND `d`.`id` = `dip`.`id_domain`
AND `dip`.`id_ipandports` AND `dip`.`id_ipandports`
IN (SELECT `id_ipandports` FROM `".TABLE_DOMAINTOIP."` IN (SELECT `id_ipandports` FROM `" . TABLE_DOMAINTOIP . "`
WHERE `id_domain` = :id) WHERE `id_domain` = :id)
GROUP BY `d`.`id`, `d`.`domain` GROUP BY `d`.`id`, `d`.`domain`
ORDER BY `d`.`domain` ASC" ORDER BY `d`.`domain` ASC");
); Database::pexecute($domains_stmt, array(
Database::pexecute($domains_stmt, array("id" => $result['id'], "customerid" => $userinfo['customerid'])); "id" => $result['id'],
"customerid" => $userinfo['customerid']
));
while ($row_domain = $domains_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row_domain = $domains_stmt->fetch(PDO::FETCH_ASSOC)) {
$domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id'], $result['aliasdomain']); $domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id'], $result['aliasdomain']);
} }
if (preg_match('/^https?\:\/\//', $result['documentroot']) && validateUrl($result['documentroot'])) { if (preg_match('/^https?\:\/\//', $result['documentroot']) && validateUrl($result['documentroot'])) {
if (Settings::Get('panel.pathedit') == 'Dropdown') { if (Settings::Get('panel.pathedit') == 'Dropdown') {
$urlvalue = $result['documentroot']; $urlvalue = $result['documentroot'];
@@ -358,36 +381,38 @@ if ($page == 'overview') {
$urlvalue = ''; $urlvalue = '';
$pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $result['documentroot']); $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $result['documentroot']);
} }
$redirectcode = ''; $redirectcode = '';
if (Settings::Get('customredirect.enabled') == '1') { if (Settings::Get('customredirect.enabled') == '1') {
$def_code = getDomainRedirectId($id); $def_code = getDomainRedirectId($id);
$codes = getRedirectCodesArray(); $codes = getRedirectCodesArray();
foreach ($codes as $rc) { foreach ($codes as $rc) {
$redirectcode .= makeoption($rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')', $rc['id'], $def_code); $redirectcode .= makeoption($rc['code'] . ' (' . $lng['redirect_desc'][$rc['desc']] . ')', $rc['id'], $def_code);
} }
} }
// check if we at least have one ssl-ip/port, #1179 // check if we at least have one ssl-ip/port, #1179
$ssl_ipsandports = ''; $ssl_ipsandports = '';
$ssl_ip_stmt = Database::prepare(" $ssl_ip_stmt = Database::prepare("
SELECT COUNT(*) as countSSL SELECT COUNT(*) as countSSL
FROM `".TABLE_PANEL_IPSANDPORTS."` pip FROM `" . TABLE_PANEL_IPSANDPORTS . "` pip
LEFT JOIN `".TABLE_DOMAINTOIP."` dti ON dti.id_ipandports = pip.id LEFT JOIN `" . TABLE_DOMAINTOIP . "` dti ON dti.id_ipandports = pip.id
WHERE `dti`.`id_domain` = :id_domain AND pip.`ssl`='1' WHERE `dti`.`id_domain` = :id_domain AND pip.`ssl`='1'
"); ");
Database::pexecute($ssl_ip_stmt, array("id_domain" => $result['id'])); Database::pexecute($ssl_ip_stmt, array(
"id_domain" => $result['id']
));
$resultX = $ssl_ip_stmt->fetch(PDO::FETCH_ASSOC); $resultX = $ssl_ip_stmt->fetch(PDO::FETCH_ASSOC);
if (isset($resultX['countSSL']) && (int)$resultX['countSSL'] > 0) { if (isset($resultX['countSSL']) && (int) $resultX['countSSL'] > 0) {
$ssl_ipsandports = 'notempty'; $ssl_ipsandports = 'notempty';
} }
// Fudge the result for ssl_redirect to hide the Let's Encrypt steps // Fudge the result for ssl_redirect to hide the Let's Encrypt steps
$result['temporary_ssl_redirect'] = $result['ssl_redirect']; $result['temporary_ssl_redirect'] = $result['ssl_redirect'];
$result['ssl_redirect'] = ($result['ssl_redirect'] == 0 ? 0 : 1); $result['ssl_redirect'] = ($result['ssl_redirect'] == 0 ? 0 : 1);
$openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true); $openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true);
// create serveralias options // create serveralias options
$serveraliasoptions = ""; $serveraliasoptions = "";
$_value = '2'; $_value = '2';
@@ -399,49 +424,49 @@ if ($page == 'overview') {
$serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_wildcard'], '0', $_value, true, true); $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_wildcard'], '0', $_value, true, true);
$serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_www'], '1', $_value, true, true); $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_www'], '1', $_value, true, true);
$serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_none'], '2', $_value, true, true); $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_none'], '2', $_value, true, true);
$ips_stmt = Database::prepare("SELECT `p`.`ip` AS `ip` FROM `".TABLE_PANEL_IPSANDPORTS."` `p` $ips_stmt = Database::prepare("SELECT `p`.`ip` AS `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "` `p`
LEFT JOIN `".TABLE_DOMAINTOIP."` `dip` LEFT JOIN `" . TABLE_DOMAINTOIP . "` `dip`
ON ( `dip`.`id_ipandports` = `p`.`id` ) ON ( `dip`.`id_ipandports` = `p`.`id` )
WHERE `dip`.`id_domain` = :id_domain WHERE `dip`.`id_domain` = :id_domain
GROUP BY `p`.`ip`" GROUP BY `p`.`ip`");
); Database::pexecute($ips_stmt, array(
Database::pexecute($ips_stmt, array("id_domain" => $result['id'])); "id_domain" => $result['id']
));
$result_ipandport['ip'] = ''; $result_ipandport['ip'] = '';
while ($rowip = $ips_stmt->fetch(PDO::FETCH_ASSOC)) { while ($rowip = $ips_stmt->fetch(PDO::FETCH_ASSOC)) {
$result_ipandport['ip'] .= $rowip['ip'] . "<br />"; $result_ipandport['ip'] .= $rowip['ip'] . "<br />";
} }
$phpconfigs = ''; $phpconfigs = '';
$has_phpconfigs = false; $has_phpconfigs = false;
if (isset($userinfo['allowed_phpconfigs']) && !empty($userinfo['allowed_phpconfigs'])) if (isset($userinfo['allowed_phpconfigs']) && ! empty($userinfo['allowed_phpconfigs'])) {
{
$has_phpconfigs = true; $has_phpconfigs = true;
$allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY); $allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY);
$phpconfigs_result_stmt = Database::query(" $phpconfigs_result_stmt = Database::query("
SELECT c.*, fc.description as interpreter SELECT c.*, fc.description as interpreter
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
WHERE c.id IN (".implode(", ", $allowed_cfg).") WHERE c.id IN (" . implode(", ", $allowed_cfg) . ")
"); ");
while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) {
if ((int) Settings::Get('phpfpm.enabled') == 1) { if ((int) Settings::Get('phpfpm.enabled') == 1) {
$phpconfigs .= makeoption($phpconfigs_row['description'] . " [".$phpconfigs_row['interpreter']."]", $phpconfigs_row['id'], $result['phpsettingid'], true, true); $phpconfigs .= makeoption($phpconfigs_row['description'] . " [" . $phpconfigs_row['interpreter'] . "]", $phpconfigs_row['id'], $result['phpsettingid'], true, true);
} else { } else {
$phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true); $phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true);
} }
} }
} }
$domainip = $result_ipandport['ip']; $domainip = $result_ipandport['ip'];
$result = htmlentities_array($result); $result = htmlentities_array($result);
$subdomain_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/domains/formfield.domains_edit.php'; $subdomain_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.domains_edit.php';
$subdomain_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($subdomain_edit_data); $subdomain_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($subdomain_edit_data);
$title = $subdomain_edit_data['domain_edit']['title']; $title = $subdomain_edit_data['domain_edit']['title'];
$image = $subdomain_edit_data['domain_edit']['image']; $image = $subdomain_edit_data['domain_edit']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domains_edit") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domains_edit") . "\";");
} }
} else { } else {
@@ -449,7 +474,7 @@ if ($page == 'overview') {
} }
} }
} elseif ($page == 'domainssleditor') { } elseif ($page == 'domainssleditor') {
if ($action == '' || $action == 'view') { if ($action == '' || $action == 'view') {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
$do_insert = isset($_POST['do_insert']) ? (($_POST['do_insert'] == 1) ? true : false) : false; $do_insert = isset($_POST['do_insert']) ? (($_POST['do_insert'] == 1) ? true : false) : false;
@@ -463,17 +488,21 @@ if ($page == 'overview') {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
// back to domain overview // back to domain overview
\Froxlor\UI\Response::redirectTo($filename, array('page' => 'domains', 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => 'domains',
's' => $s
));
} }
$stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_DOMAIN_SSL_SETTINGS."` $stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
WHERE `domainid`= :domainid" WHERE `domainid`= :domainid");
); $result = Database::pexecute_first($stmt, array(
$result = Database::pexecute_first($stmt, array("domainid" => $id)); "domainid" => $id
));
$do_insert = false; $do_insert = false;
// if no entry can be found, behave like we have empty values // if no entry can be found, behave like we have empty values
if (!is_array($result) || !isset($result['ssl_cert_file'])) { if (! is_array($result) || ! isset($result['ssl_cert_file'])) {
$result = array( $result = array(
'ssl_cert_file' => '', 'ssl_cert_file' => '',
'ssl_key_file' => '', 'ssl_key_file' => '',
@@ -482,26 +511,24 @@ if ($page == 'overview') {
); );
$do_insert = true; $do_insert = true;
} }
$result = htmlentities_array($result); $result = htmlentities_array($result);
$ssleditor_data = include_once dirname(__FILE__).'/lib/formfields/customer/domains/formfield.domain_ssleditor.php'; $ssleditor_data = include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.domain_ssleditor.php';
$ssleditor_form = \Froxlor\UI\HtmlForm::genHTMLForm($ssleditor_data); $ssleditor_form = \Froxlor\UI\HtmlForm::genHTMLForm($ssleditor_data);
$title = $ssleditor_data['domain_ssleditor']['title']; $title = $ssleditor_data['domain_ssleditor']['title'];
$image = $ssleditor_data['domain_ssleditor']['image']; $image = $ssleditor_data['domain_ssleditor']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domain_ssleditor") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domain_ssleditor") . "\";");
} }
} elseif ($page == 'domaindnseditor' && $userinfo['dnsenabled'] == '1' && Settings::Get('system.dnsenabled') == '1') { } elseif ($page == 'domaindnseditor' && $userinfo['dnsenabled'] == '1' && Settings::Get('system.dnsenabled') == '1') {
require_once __DIR__.'/dns_editor.php'; require_once __DIR__ . '/dns_editor.php';
} elseif ($page == 'sslcertificates') { } elseif ($page == 'sslcertificates') {
require_once __DIR__.'/ssl_certificates.php'; require_once __DIR__ . '/ssl_certificates.php';
} elseif ($page == 'logfiles') { } elseif ($page == 'logfiles') {
require_once __DIR__.'/logfiles_viewer.php'; require_once __DIR__ . '/logfiles_viewer.php';
} }

View File

@@ -16,7 +16,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
@@ -27,7 +26,7 @@ use Froxlor\Api\Commands\EmailAccounts as EmailAccounts;
use Froxlor\Api\Commands\EmailForwarders as EmailForwarders; use Froxlor\Api\Commands\EmailForwarders as EmailForwarders;
// redirect if this customer page is hidden via settings // redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','email')) { if (Settings::IsInList('panel.customer_hide_options', 'email')) {
\Froxlor\UI\Response::redirectTo('customer_index.php'); \Froxlor\UI\Response::redirectTo('customer_index.php');
} }
@@ -52,9 +51,10 @@ if ($page == 'overview') {
$result_stmt = Database::prepare('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain`, `u`.`mboxsize` FROM `' . TABLE_MAIL_VIRTUAL . '` `m` $result_stmt = Database::prepare('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain`, `u`.`mboxsize` FROM `' . TABLE_MAIL_VIRTUAL . '` `m`
LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`) LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`)
LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`) LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`)
WHERE `m`.`customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit() WHERE `m`.`customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid'])); "customerid" => $userinfo['customerid']
));
$emailscount = Database::num_rows(); $emailscount = Database::num_rows();
$paging->setEntries($emailscount); $paging->setEntries($emailscount);
$sortcode = $paging->getHtmlSortCode($lng); $sortcode = $paging->getHtmlSortCode($lng);
@@ -64,7 +64,7 @@ if ($page == 'overview') {
$emails = array(); $emails = array();
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if (!isset($emails[$row['domain']]) || !is_array($emails[$row['domain']])) { if (! isset($emails[$row['domain']]) || ! is_array($emails[$row['domain']])) {
$emails[$row['domain']] = array(); $emails[$row['domain']] = array();
} }
@@ -96,7 +96,7 @@ if ($page == 'overview') {
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_domain") . "\";"); eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_domain") . "\";");
} }
$emails_count++; $emails_count ++;
$row['email'] = $idna_convert->decode($row['email']); $row['email'] = $idna_convert->decode($row['email']);
$row['email_full'] = $idna_convert->decode($row['email_full']); $row['email_full'] = $idna_convert->decode($row['email_full']);
$row['destination'] = explode(' ', $row['destination']); $row['destination'] = explode(' ', $row['destination']);
@@ -118,22 +118,23 @@ if ($page == 'overview') {
$row['destination'] = substr($row['destination'], 0, 32) . '... (' . $destinations_count . ')'; $row['destination'] = substr($row['destination'], 0, 32) . '... (' . $destinations_count . ')';
} }
$row['mboxsize'] = \Froxlor\PhpHelper::size_readable($row['mboxsize'], 'GiB', 'bi', '%01.' . (int)Settings::Get('panel.decimal_places') . 'f %s'); $row['mboxsize'] = \Froxlor\PhpHelper::size_readable($row['mboxsize'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$row = htmlentities_array($row); $row = htmlentities_array($row);
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_email") . "\";"); eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_email") . "\";");
$count++; $count ++;
} }
$i++; $i ++;
} }
} }
$emaildomains_count_stmt = Database::prepare("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "` $emaildomains_count_stmt = Database::prepare("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid`= :customerid WHERE `customerid`= :customerid
AND `isemaildomain`='1' ORDER BY `domain` ASC" AND `isemaildomain`='1' ORDER BY `domain` ASC");
); Database::pexecute($emaildomains_count_stmt, array(
Database::pexecute($emaildomains_count_stmt, array("customerid" => $userinfo['customerid'])); "customerid" => $userinfo['customerid']
));
$emaildomains_count = $emaildomains_count_stmt->fetch(PDO::FETCH_ASSOC); $emaildomains_count = $emaildomains_count_stmt->fetch(PDO::FETCH_ASSOC);
$emaildomains_count = $emaildomains_count['count']; $emaildomains_count = $emaildomains_count['count'];
@@ -157,14 +158,21 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
if ($result['popaccountid'] != '0') { if ($result['popaccountid'] != '0') {
$show_checkbox = true; $show_checkbox = true;
} else { } else {
$show_checkbox = false; $show_checkbox = false;
} }
ask_yesno_withcheckbox('email_reallydelete', 'admin_customer_alsoremovemail', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']), $show_checkbox); ask_yesno_withcheckbox('email_reallydelete', 'admin_customer_alsoremovemail', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
), $idna_convert->decode($result['email_full']), $show_checkbox);
} }
} }
} elseif ($action == 'add') { } elseif ($action == 'add') {
@@ -176,23 +184,29 @@ if ($page == 'overview') {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 'action' => 'edit', 'id' => $result['id'], 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
'action' => 'edit',
'id' => $result['id'],
's' => $s
));
} else { } else {
$result_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "` $result_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid`= :cid WHERE `customerid`= :cid
AND `isemaildomain`='1' AND `isemaildomain`='1'
ORDER BY `domain` ASC" ORDER BY `domain` ASC");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array("cid" => $userinfo['customerid'])); "cid" => $userinfo['customerid']
));
$domains = ''; $domains = '';
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$domains.= makeoption($idna_convert->decode($row['domain']), $row['domain']); $domains .= makeoption($idna_convert->decode($row['domain']), $row['domain']);
} }
//$iscatchall = makeyesno('iscatchall', '1', '0', '0'); // $iscatchall = makeyesno('iscatchall', '1', '0', '0');
$email_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_add.php'; $email_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_add.php';
if (Settings::Get('catchall.catchall_enabled') != '1') { if (Settings::Get('catchall.catchall_enabled') != '1') {
unset($email_add_data['emails_add']['sections']['section_a']['fields']['iscatchall']); unset($email_add_data['emails_add']['sections']['section_a']['fields']['iscatchall']);
@@ -231,7 +245,7 @@ if ($page == 'overview') {
if ($destination != $result['email_full'] && $destination != '') { if ($destination != $result['email_full'] && $destination != '') {
eval("\$forwarders.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_edit_forwarder") . "\";"); eval("\$forwarders.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_edit_forwarder") . "\";");
$forwarders_count++; $forwarders_count ++;
} }
$result['destination'][$dest_id] = $destination; $result['destination'][$dest_id] = $destination;
@@ -240,7 +254,7 @@ if ($page == 'overview') {
$destinations_count = count($result['destination']); $destinations_count = count($result['destination']);
$result = htmlentities_array($result); $result = htmlentities_array($result);
$email_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_edit.php'; $email_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_edit.php';
if (Settings::Get('catchall.catchall_enabled') != '1') { if (Settings::Get('catchall.catchall_enabled') != '1') {
unset($email_edit_data['emails_edit']['sections']['section_a']['fields']['mail_catchall']); unset($email_edit_data['emails_edit']['sections']['section_a']['fields']['mail_catchall']);
@@ -271,7 +285,12 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 'action' => 'edit', 'id' => $id, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
'action' => 'edit',
'id' => $id,
's' => $s
));
} }
} elseif ($page == 'accounts') { } elseif ($page == 'accounts') {
if ($action == 'add' && $id != 0) { if ($action == 'add' && $id != 0) {
@@ -291,11 +310,18 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => 'emails',
'action' => 'edit',
'id' => $id,
's' => $s
));
} else { } else {
if (\Froxlor\Validate\Check::checkMailAccDeletionState($result['email_full'])) { if (\Froxlor\Validate\Check::checkMailAccDeletionState($result['email_full'])) {
\Froxlor\UI\Response::standard_error(array('mailaccistobedeleted'), $result['email_full']); \Froxlor\UI\Response::standard_error(array(
'mailaccistobedeleted'
), $result['email_full']);
} }
$result['email_full'] = $idna_convert->decode($result['email_full']); $result['email_full'] = $idna_convert->decode($result['email_full']);
@@ -311,11 +337,16 @@ if ($page == 'overview') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/account_add") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/account_add") . "\";");
} }
} else { } else {
\Froxlor\UI\Response::standard_error(array('allresourcesused', 'allocatetoomuchquota'), $quota); \Froxlor\UI\Response::standard_error(array(
'allresourcesused',
'allocatetoomuchquota'
), $quota);
} }
} elseif ($action == 'changepw' && $id != 0) { } elseif ($action == 'changepw' && $id != 0) {
try { try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get(); $json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
@@ -328,12 +359,17 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => 'emails',
'action' => 'edit',
'id' => $id,
's' => $s
));
} else { } else {
$result['email_full'] = $idna_convert->decode($result['email_full']); $result['email_full'] = $idna_convert->decode($result['email_full']);
$result = htmlentities_array($result); $result = htmlentities_array($result);
$account_changepw_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php'; $account_changepw_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php';
$account_changepw_form = \Froxlor\UI\HtmlForm::genHTMLForm($account_changepw_data); $account_changepw_form = \Froxlor\UI\HtmlForm::genHTMLForm($account_changepw_data);
$title = $account_changepw_data['emails_accountchangepasswd']['title']; $title = $account_changepw_data['emails_accountchangepasswd']['title'];
@@ -344,7 +380,9 @@ if ($page == 'overview') {
} }
} elseif ($action == 'changequota' && Settings::Get('system.mail_quota_enabled') == '1' && $id != 0) { } elseif ($action == 'changequota' && Settings::Get('system.mail_quota_enabled') == '1' && $id != 0) {
try { try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get(); $json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
@@ -357,12 +395,17 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => 'emails',
'action' => 'edit',
'id' => $id,
's' => $s
));
} else { } else {
$result['email_full'] = $idna_convert->decode($result['email_full']); $result['email_full'] = $idna_convert->decode($result['email_full']);
$result = htmlentities_array($result); $result = htmlentities_array($result);
$quota_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_accountchangequota.php'; $quota_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_accountchangequota.php';
$quota_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($quota_edit_data); $quota_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($quota_edit_data);
$title = $quota_edit_data['emails_accountchangequota']['title']; $title = $quota_edit_data['emails_accountchangequota']['title'];
@@ -373,7 +416,9 @@ if ($page == 'overview') {
} }
} elseif ($action == 'delete' && $id != 0) { } elseif ($action == 'delete' && $id != 0) {
try { try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get(); $json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
@@ -386,9 +431,18 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => 'emails',
'action' => 'edit',
'id' => $id,
's' => $s
));
} else { } else {
ask_yesno_withcheckbox('email_reallydelete_account', 'admin_customer_alsoremovemail', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full'])); ask_yesno_withcheckbox('email_reallydelete_account', 'admin_customer_alsoremovemail', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
), $idna_convert->decode($result['email_full']));
} }
} }
} }
@@ -396,7 +450,9 @@ if ($page == 'overview') {
if ($action == 'add' && $id != 0) { if ($action == 'add' && $id != 0) {
if ($userinfo['email_forwarders_used'] < $userinfo['email_forwarders'] || $userinfo['email_forwarders'] == '-1') { if ($userinfo['email_forwarders_used'] < $userinfo['email_forwarders'] || $userinfo['email_forwarders'] == '-1') {
try { try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get(); $json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
@@ -409,12 +465,17 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => 'emails',
'action' => 'edit',
'id' => $id,
's' => $s
));
} else { } else {
$result['email_full'] = $idna_convert->decode($result['email_full']); $result['email_full'] = $idna_convert->decode($result['email_full']);
$result = htmlentities_array($result); $result = htmlentities_array($result);
$forwarder_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_addforwarder.php'; $forwarder_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_addforwarder.php';
$forwarder_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($forwarder_add_data); $forwarder_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($forwarder_add_data);
$title = $forwarder_add_data['emails_addforwarder']['title']; $title = $forwarder_add_data['emails_addforwarder']['title'];
@@ -428,7 +489,9 @@ if ($page == 'overview') {
} }
} elseif ($action == 'delete' && $id != 0) { } elseif ($action == 'delete' && $id != 0) {
try { try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get(); $json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
@@ -454,9 +517,19 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => 'emails',
'action' => 'edit',
'id' => $id,
's' => $s
));
} else { } else {
ask_yesno('email_reallydelete_forwarder', $filename, array('id' => $id, 'forwarderid' => $forwarderid, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']) . ' -> ' . $idna_convert->decode($forwarder)); ask_yesno('email_reallydelete_forwarder', $filename, array(
'id' => $id,
'forwarderid' => $forwarderid,
'page' => $page,
'action' => $action
), $idna_convert->decode($result['email_full']) . ' -> ' . $idna_convert->decode($forwarder));
} }
} }
} }

View File

@@ -16,7 +16,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
@@ -25,7 +24,7 @@ use Froxlor\Settings;
use Froxlor\Api\Commands\Ftps as Ftps; use Froxlor\Api\Commands\Ftps as Ftps;
// redirect if this customer page is hidden via settings // redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','ftp')) { if (Settings::IsInList('panel.customer_hide_options', 'ftp')) {
\Froxlor\UI\Response::redirectTo('customer_index.php'); \Froxlor\UI\Response::redirectTo('customer_index.php');
} }
@@ -50,9 +49,10 @@ if ($page == 'overview') {
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_FTP_USERS, $fields); $paging = new \Froxlor\UI\Paging($userinfo, TABLE_FTP_USERS, $fields);
$result_stmt = Database::prepare("SELECT `id`, `username`, `description`, `homedir`, `shell` FROM `" . TABLE_FTP_USERS . "` $result_stmt = Database::prepare("SELECT `id`, `username`, `description`, `homedir`, `shell` FROM `" . TABLE_FTP_USERS . "`
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit() WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid'])); "customerid" => $userinfo['customerid']
));
$ftps_count = Database::num_rows(); $ftps_count = Database::num_rows();
$paging->setEntries($ftps_count); $paging->setEntries($ftps_count);
$sortcode = $paging->getHtmlSortCode($lng); $sortcode = $paging->getHtmlSortCode($lng);
@@ -75,10 +75,10 @@ if ($page == 'overview') {
$row = htmlentities_array($row); $row = htmlentities_array($row);
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate('ftp/accounts_account') . "\";"); eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate('ftp/accounts_account') . "\";");
$count++; $count ++;
} }
$i++; $i ++;
} }
eval("echo \"" . \Froxlor\UI\Template::getTemplate('ftp/accounts') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('ftp/accounts') . "\";");
@@ -99,9 +99,16 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
ask_yesno_withcheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']); ask_yesno_withcheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
), $result['username']);
} }
} else { } else {
\Froxlor\UI\Response::standard_error('ftp_cantdeletemainaccount'); \Froxlor\UI\Response::standard_error('ftp_cantdeletemainaccount');
@@ -114,7 +121,10 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
$pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], '/'); $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], '/');
@@ -123,12 +133,13 @@ if ($page == 'overview') {
$domains = ''; $domains = '';
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` $result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid`= :customerid" WHERE `customerid`= :customerid");
); Database::pexecute($result_domains_stmt, array(
Database::pexecute($result_domains_stmt, array("customerid" => $userinfo['customerid'])); "customerid" => $userinfo['customerid']
));
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
$domainlist[] = $row_domain['domain']; $domainlist[] = $row_domain['domain'];
} }
sort($domainlist); sort($domainlist);
@@ -143,7 +154,7 @@ if ($page == 'overview') {
if (Settings::Get('system.allow_customer_shell') == '1') { if (Settings::Get('system.allow_customer_shell') == '1') {
$shells = makeoption("/bin/false", "/bin/false", "/bin/false"); $shells = makeoption("/bin/false", "/bin/false", "/bin/false");
$shells_avail = Settings::Get('system.available_shells'); $shells_avail = Settings::Get('system.available_shells');
if (!empty($shells_avail)) { if (! empty($shells_avail)) {
$shells_avail = explode(",", $shells_avail); $shells_avail = explode(",", $shells_avail);
$shells_avail = array_map("trim", $shells_avail); $shells_avail = array_map("trim", $shells_avail);
foreach ($shells_avail as $_shell) { foreach ($shells_avail as $_shell) {
@@ -152,9 +163,9 @@ if ($page == 'overview') {
} }
} }
//$sendinfomail = makeyesno('sendinfomail', '1', '0', '0'); // $sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
$ftp_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_add.php'; $ftp_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/ftp/formfield.ftp_add.php';
$ftp_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($ftp_add_data); $ftp_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($ftp_add_data);
$title = $ftp_add_data['ftp_add']['title']; $title = $ftp_add_data['ftp_add']['title'];
@@ -180,7 +191,10 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
if (strpos($result['homedir'], $userinfo['documentroot']) === 0) { if (strpos($result['homedir'], $userinfo['documentroot']) === 0) {
$homedir = str_replace($userinfo['documentroot'], "/", $result['homedir']); $homedir = str_replace($userinfo['documentroot'], "/", $result['homedir']);
@@ -195,9 +209,10 @@ if ($page == 'overview') {
$domains = ''; $domains = '';
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` $result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid` = :customerid" WHERE `customerid` = :customerid");
); Database::pexecute($result_domains_stmt, array(
Database::pexecute($result_domains_stmt, array("customerid" => $userinfo['customerid'])); "customerid" => $userinfo['customerid']
));
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
$domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']); $domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);
@@ -207,7 +222,7 @@ if ($page == 'overview') {
if (Settings::Get('system.allow_customer_shell') == '1') { if (Settings::Get('system.allow_customer_shell') == '1') {
$shells = makeoption("/bin/false", "/bin/false", $result['shell']); $shells = makeoption("/bin/false", "/bin/false", $result['shell']);
$shells_avail = Settings::Get('system.available_shells'); $shells_avail = Settings::Get('system.available_shells');
if (!empty($shells_avail)) { if (! empty($shells_avail)) {
$shells_avail = explode(",", $shells_avail); $shells_avail = explode(",", $shells_avail);
$shells_avail = array_map("trim", $shells_avail); $shells_avail = array_map("trim", $shells_avail);
foreach ($shells_avail as $_shell) { foreach ($shells_avail as $_shell) {
@@ -216,7 +231,7 @@ if ($page == 'overview') {
} }
} }
$ftp_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_edit.php'; $ftp_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/ftp/formfield.ftp_edit.php';
$ftp_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($ftp_edit_data); $ftp_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($ftp_edit_data);
$title = $ftp_edit_data['ftp_edit']['title']; $title = $ftp_edit_data['ftp_edit']['title'];

View File

@@ -16,7 +16,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
@@ -27,19 +26,19 @@ use Froxlor\Api\Commands\Customers as Customers;
if ($action == 'logout') { if ($action == 'logout') {
$log->logAction(USR_ACTION, LOG_NOTICE, 'logged out'); $log->logAction(USR_ACTION, LOG_NOTICE, 'logged out');
$params = array("customerid" => $userinfo['customerid']); $params = array(
"customerid" => $userinfo['customerid']
);
if (Settings::Get('session.allow_multiple_login') == '1') { if (Settings::Get('session.allow_multiple_login') == '1') {
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` $stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
WHERE `userid` = :customerid WHERE `userid` = :customerid
AND `adminsession` = '0' AND `adminsession` = '0'
AND `hash` = :hash" AND `hash` = :hash");
);
$params["hash"] = $s; $params["hash"] = $s;
} else { } else {
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` $stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
WHERE `userid` = :customerid WHERE `userid` = :customerid
AND `adminsession` = '0'" AND `adminsession` = '0'");
);
} }
Database::pexecute($stmt, $params); Database::pexecute($stmt, $params);
@@ -54,7 +53,10 @@ if ($page == 'overview') {
AND `parentdomainid` = '0' AND `parentdomainid` = '0'
AND `id` <> :standardsubdomain AND `id` <> :standardsubdomain
"); ");
Database::pexecute($domain_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain'])); Database::pexecute($domain_stmt, array(
"customerid" => $userinfo['customerid'],
"standardsubdomain" => $userinfo['standardsubdomain']
));
$domains = ''; $domains = '';
$domainArray = array(); $domainArray = array();
@@ -74,7 +76,10 @@ if ($page == 'overview') {
WHERE `customerid` = :customerid WHERE `customerid` = :customerid
AND `id` = :standardsubdomain AND `id` = :standardsubdomain
"); ");
$std_domain = Database::pexecute_first($std_domain_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain'])); $std_domain = Database::pexecute_first($std_domain_stmt, array(
"customerid" => $userinfo['customerid'],
"standardsubdomain" => $userinfo['standardsubdomain']
));
$stdsubdomain = $std_domain['domain']; $stdsubdomain = $std_domain['domain'];
} }
@@ -83,8 +88,10 @@ if ($page == 'overview') {
$month = date('M Y', $yesterday); $month = date('M Y', $yesterday);
// get disk-space usages for web, mysql and mail // get disk-space usages for web, mysql and mail
$usages_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_DISKSPACE."` WHERE `customerid` = :cid ORDER BY `stamp` DESC LIMIT 1"); $usages_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DISKSPACE . "` WHERE `customerid` = :cid ORDER BY `stamp` DESC LIMIT 1");
$usages = Database::pexecute_first($usages_stmt, array('cid' => $userinfo['customerid'])); $usages = Database::pexecute_first($usages_stmt, array(
'cid' => $userinfo['customerid']
));
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places')); $userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places'));
$userinfo['diskspace_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places')); $userinfo['diskspace_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places'));
@@ -99,17 +106,21 @@ if ($page == 'overview') {
$services_enabled = ""; $services_enabled = "";
$se = array(); $se = array();
if ($userinfo['imap'] == '1') $se[] = "IMAP"; if ($userinfo['imap'] == '1')
if ($userinfo['pop3'] == '1') $se[] = "POP3"; $se[] = "IMAP";
if ($userinfo['phpenabled'] == '1') $se[] = "PHP"; if ($userinfo['pop3'] == '1')
if ($userinfo['perlenabled'] == '1') $se[] = "Perl/CGI"; $se[] = "POP3";
if ($userinfo['phpenabled'] == '1')
$se[] = "PHP";
if ($userinfo['perlenabled'] == '1')
$se[] = "Perl/CGI";
$services_enabled = implode(", ", $se); $services_enabled = implode(", ", $se);
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/index') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/index') . "\";");
} elseif ($page == 'change_password') { } elseif ($page == 'change_password') {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
$old_password = validate($_POST['old_password'], 'old password'); $old_password = validate($_POST['old_password'], 'old password');
if (!validatePasswordLogin($userinfo,$old_password,TABLE_PANEL_CUSTOMERS,'customerid')) { if (! validatePasswordLogin($userinfo, $old_password, TABLE_PANEL_CUSTOMERS, 'customerid')) {
\Froxlor\UI\Response::standard_error('oldpasswordnotcorrect'); \Froxlor\UI\Response::standard_error('oldpasswordnotcorrect');
} }
@@ -117,17 +128,29 @@ if ($page == 'overview') {
$new_password_confirm = validatePassword($_POST['new_password_confirm'], 'new password confirm'); $new_password_confirm = validatePassword($_POST['new_password_confirm'], 'new password confirm');
if ($old_password == '') { if ($old_password == '') {
\Froxlor\UI\Response::standard_error(array('stringisempty', 'oldpassword')); \Froxlor\UI\Response::standard_error(array(
'stringisempty',
'oldpassword'
));
} elseif ($new_password == '') { } elseif ($new_password == '') {
\Froxlor\UI\Response::standard_error(array('stringisempty', 'newpassword')); \Froxlor\UI\Response::standard_error(array(
'stringisempty',
'newpassword'
));
} elseif ($new_password_confirm == '') { } elseif ($new_password_confirm == '') {
\Froxlor\UI\Response::standard_error(array('stringisempty', 'newpasswordconfirm')); \Froxlor\UI\Response::standard_error(array(
'stringisempty',
'newpasswordconfirm'
));
} elseif ($new_password != $new_password_confirm) { } elseif ($new_password != $new_password_confirm) {
\Froxlor\UI\Response::standard_error('newpasswordconfirmerror'); \Froxlor\UI\Response::standard_error('newpasswordconfirmerror');
} else { } else {
// Update user password // Update user password
try { try {
Customers::getLocal($userinfo, array('id' => $userinfo['customerid'], 'new_customer_password' => $new_password))->update(); Customers::getLocal($userinfo, array(
'id' => $userinfo['customerid'],
'new_customer_password' => $new_password
))->update();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
@@ -139,8 +162,7 @@ if ($page == 'overview') {
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "` $stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
SET `password` = :password SET `password` = :password
WHERE `customerid` = :customerid WHERE `customerid` = :customerid
AND `username` = :username" AND `username` = :username");
);
$params = array( $params = array(
"password" => $cryptPassword, "password" => $cryptPassword,
"customerid" => $userinfo['customerid'], "customerid" => $userinfo['customerid'],
@@ -162,8 +184,7 @@ if ($page == 'overview') {
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` $stmt = Database::prepare("UPDATE `" . TABLE_PANEL_HTPASSWDS . "`
SET `password` = :password SET `password` = :password
WHERE `customerid` = :customerid WHERE `customerid` = :customerid
AND `username` = :username" AND `username` = :username");
);
$params = array( $params = array(
"password" => $new_webalizer_password, "password" => $new_webalizer_password,
"customerid" => $userinfo['customerid'], "customerid" => $userinfo['customerid'],
@@ -172,7 +193,9 @@ if ($page == 'overview') {
Database::pexecute($stmt, $params); Database::pexecute($stmt, $params);
} }
\Froxlor\UI\Response::redirectTo($filename, array('s' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
's' => $s
));
} }
} else { } else {
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/change_password') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/change_password') . "\";");
@@ -182,7 +205,10 @@ if ($page == 'overview') {
$def_language = validate($_POST['def_language'], 'default language'); $def_language = validate($_POST['def_language'], 'default language');
if (isset($languages[$def_language])) { if (isset($languages[$def_language])) {
try { try {
Customers::getLocal($userinfo, array('id' => $userinfo['customerid'], 'def_language' => $def_language))->update(); Customers::getLocal($userinfo, array(
'id' => $userinfo['customerid'],
'def_language' => $def_language
))->update();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
@@ -190,12 +216,16 @@ if ($page == 'overview') {
// also update current session // also update current session
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_SESSIONS . "` $stmt = Database::prepare("UPDATE `" . TABLE_PANEL_SESSIONS . "`
SET `language` = :lang SET `language` = :lang
WHERE `hash` = :hash" WHERE `hash` = :hash");
); Database::pexecute($stmt, array(
Database::pexecute($stmt, array("lang" => $def_language, "hash" => $s)); "lang" => $def_language,
"hash" => $s
));
} }
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default language to '" . $def_language . "'"); $log->logAction(USR_ACTION, LOG_NOTICE, "changed default language to '" . $def_language . "'");
\Froxlor\UI\Response::redirectTo($filename, array('s' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
's' => $s
));
} else { } else {
$default_lang = Settings::Get('panel.standardlanguage'); $default_lang = Settings::Get('panel.standardlanguage');
if ($userinfo['def_language'] != '') { if ($userinfo['def_language'] != '') {
@@ -213,7 +243,10 @@ if ($page == 'overview') {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
$theme = validate($_POST['theme'], 'theme'); $theme = validate($_POST['theme'], 'theme');
try { try {
Customers::getLocal($userinfo, array('id' => $userinfo['customerid'], 'theme' => $theme))->update(); Customers::getLocal($userinfo, array(
'id' => $userinfo['customerid'],
'theme' => $theme
))->update();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
@@ -221,12 +254,16 @@ if ($page == 'overview') {
// also update current session // also update current session
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_SESSIONS . "` $stmt = Database::prepare("UPDATE `" . TABLE_PANEL_SESSIONS . "`
SET `theme` = :theme SET `theme` = :theme
WHERE `hash` = :hash" WHERE `hash` = :hash");
); Database::pexecute($stmt, array(
Database::pexecute($stmt, array("theme" => $theme, "hash" => $s)); "theme" => $theme,
"hash" => $s
));
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default theme to '" . $theme . "'"); $log->logAction(USR_ACTION, LOG_NOTICE, "changed default theme to '" . $theme . "'");
\Froxlor\UI\Response::redirectTo($filename, array('s' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
's' => $s
));
} else { } else {
$default_theme = Settings::Get('panel.default_theme'); $default_theme = Settings::Get('panel.default_theme');
if ($userinfo['theme'] != '') { if ($userinfo['theme'] != '') {
@@ -236,12 +273,11 @@ if ($page == 'overview') {
$theme_options = ''; $theme_options = '';
$themes_avail = getThemes(); $themes_avail = getThemes();
foreach ($themes_avail as $t => $d) { foreach ($themes_avail as $t => $d) {
$theme_options.= makeoption($d, $t, $default_theme, true); $theme_options .= makeoption($d, $t, $default_theme, true);
} }
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/change_theme') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/change_theme') . "\";");
} }
} elseif ($page == 'send_error_report' && Settings::Get('system.allow_error_report_customer') == '1') { } elseif ($page == 'send_error_report' && Settings::Get('system.allow_error_report_customer') == '1') {
// only show this if we really have an exception to report // only show this if we really have an exception to report
@@ -249,8 +285,8 @@ if ($page == 'overview') {
$errid = $_GET['errorid']; $errid = $_GET['errorid'];
// read error file // read error file
$err_dir = \Froxlor\FileDir::makeCorrectDir(FROXLOR_INSTALL_DIR."/logs/"); $err_dir = \Froxlor\FileDir::makeCorrectDir(FROXLOR_INSTALL_DIR . "/logs/");
$err_file = \Froxlor\FileDir::makeCorrectFile($err_dir."/".$errid."_sql-error.log"); $err_file = \Froxlor\FileDir::makeCorrectFile($err_dir . "/" . $errid . "_sql-error.log");
if (file_exists($err_file)) { if (file_exists($err_file)) {
@@ -269,19 +305,17 @@ if ($page == 'overview') {
$mail_body = "Dear froxlor-team,\n\n"; $mail_body = "Dear froxlor-team,\n\n";
$mail_body .= "the following error has been reported by a user:\n\n"; $mail_body .= "the following error has been reported by a user:\n\n";
$mail_body .= "-------------------------------------------------------------\n"; $mail_body .= "-------------------------------------------------------------\n";
$mail_body .= $_error['code'].' '.$_error['message']."\n\n"; $mail_body .= $_error['code'] . ' ' . $_error['message'] . "\n\n";
$mail_body .= "File: ".$_error['file'].':'.$_error['line']."\n\n"; $mail_body .= "File: " . $_error['file'] . ':' . $_error['line'] . "\n\n";
$mail_body .= "Trace:\n".trim($_error['trace'])."\n\n"; $mail_body .= "Trace:\n" . trim($_error['trace']) . "\n\n";
$mail_body .= "-------------------------------------------------------------\n\n"; $mail_body .= "-------------------------------------------------------------\n\n";
$mail_body .= "Froxlor-version: ".$version."\n"; $mail_body .= "Froxlor-version: " . $version . "\n";
$mail_body .= "DB-version: ".$dbversion."\n\n"; $mail_body .= "DB-version: " . $dbversion . "\n\n";
$mail_body .= "End of report"; $mail_body .= "End of report";
$mail_html = str_replace("\n", "<br />", $mail_body); $mail_html = str_replace("\n", "<br />", $mail_body);
// send actual report to dev-team // send actual report to dev-team
if (isset($_POST['send']) if (isset($_POST['send']) && $_POST['send'] == 'send') {
&& $_POST['send'] == 'send'
) {
// send mail and say thanks // send mail and say thanks
$_mailerror = false; $_mailerror = false;
try { try {
@@ -290,7 +324,7 @@ if ($page == 'overview') {
$mail->MsgHTML($mail_html); $mail->MsgHTML($mail_html);
$mail->AddAddress('error-reports@froxlor.org', 'Froxlor Developer Team'); $mail->AddAddress('error-reports@froxlor.org', 'Froxlor Developer Team');
$mail->Send(); $mail->Send();
} catch(\PHPMailer\PHPMailer\Exception $e) { } catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage(); $mailerr_msg = $e->errorMessage();
$_mailerror = true; $_mailerror = true;
} catch (Exception $e) { } catch (Exception $e) {
@@ -305,22 +339,25 @@ if ($page == 'overview') {
// finally remove error from fs // finally remove error from fs
@unlink($err_file); @unlink($err_file);
\Froxlor\UI\Response::redirectTo($filename, array('s' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
's' => $s
));
} }
// show a nice summary of the error-report // show a nice summary of the error-report
// before actually sending anything // before actually sending anything
eval("echo \"" . \Froxlor\UI\Template::getTemplate("index/send_error_report") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("index/send_error_report") . "\";");
} else { } else {
\Froxlor\UI\Response::redirectTo($filename, array('s' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
's' => $s
));
} }
} else { } else {
\Froxlor\UI\Response::redirectTo($filename, array('s' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
's' => $s
));
} }
} } elseif ($page == 'apikeys' && Settings::Get('api.enabled') == 1) {
elseif ($page == 'apikeys' && Settings::Get('api.enabled') == 1) {
require_once __DIR__ . '/api_keys.php'; require_once __DIR__ . '/api_keys.php';
} } elseif ($page == 'apihelp' && Settings::Get('api.enabled') == 1) {
elseif ($page == 'apihelp' && Settings::Get('api.enabled') == 1) {
require_once __DIR__ . '/apihelp.php'; require_once __DIR__ . '/apihelp.php';
} }

View File

@@ -53,21 +53,21 @@ if ($page == 'log') {
$searchcode = $paging->getHtmlSearchCode($lng); $searchcode = $paging->getHtmlSearchCode($lng);
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s); $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
$clog = array(); $clog = array();
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if (! isset($clog[$row['action']]) || ! is_array($clog[$row['action']])) { if (! isset($clog[$row['action']]) || ! is_array($clog[$row['action']])) {
$clog[$row['action']] = array(); $clog[$row['action']] = array();
} }
$clog[$row['action']][$row['logid']] = $row; $clog[$row['action']][$row['logid']] = $row;
} }
if ($paging->sortfield == 'date' && $paging->sortorder == 'desc') { if ($paging->sortfield == 'date' && $paging->sortorder == 'desc') {
krsort($clog); krsort($clog);
} else { } else {
ksort($clog); ksort($clog);
} }
$i = 0; $i = 0;
$count = 0; $count = 0;
$log_count = 0; $log_count = 0;
@@ -78,7 +78,7 @@ if ($page == 'log') {
// if ($paging->checkDisplay($i)) { // if ($paging->checkDisplay($i)) {
$row = htmlentities_array($row); $row = htmlentities_array($row);
$row['date'] = date("d.m.y H:i:s", $row['date']); $row['date'] = date("d.m.y H:i:s", $row['date']);
if ($_action != $action) { if ($_action != $action) {
switch ($action) { switch ($action) {
case USR_ACTION: case USR_ACTION:
@@ -103,11 +103,11 @@ if ($page == 'log') {
$_action = $lng['logger']['unknown']; $_action = $lng['logger']['unknown'];
break; break;
} }
$row['action'] = $_action; $row['action'] = $_action;
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_action') . "\";"); eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_action') . "\";");
} }
$log_count ++; $log_count ++;
$row['type'] = getLogLevelDesc($row['type']); $row['type'] = getLogLevelDesc($row['type']);
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_log') . "\";"); eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_log') . "\";");
@@ -118,7 +118,7 @@ if ($page == 'log') {
} }
$i ++; $i ++;
} }
eval("echo \"" . \Froxlor\UI\Template::getTemplate('logger/logger') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('logger/logger') . "\";");
} }
} }

View File

@@ -16,7 +16,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
@@ -25,7 +24,7 @@ use Froxlor\Settings;
use Froxlor\Api\Commands\Mysqls as Mysqls; use Froxlor\Api\Commands\Mysqls as Mysqls;
// redirect if this customer page is hidden via settings // redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','mysql')) { if (Settings::IsInList('panel.customer_hide_options', 'mysql')) {
\Froxlor\UI\Response::redirectTo('customer_index.php'); \Froxlor\UI\Response::redirectTo('customer_index.php');
} }
@@ -56,9 +55,10 @@ if ($page == 'overview') {
); );
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DATABASES, $fields); $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DATABASES, $fields);
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DATABASES . "` $result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DATABASES . "`
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit() WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid'])); "customerid" => $userinfo['customerid']
));
$mysqls_count = Database::num_rows(); $mysqls_count = Database::num_rows();
$paging->setEntries($mysqls_count); $paging->setEntries($mysqls_count);
@@ -70,7 +70,7 @@ if ($page == 'overview') {
$count = 0; $count = 0;
$mysqls = ''; $mysqls = '';
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `".TABLE_PANEL_DATABASES."`"); $dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `" . TABLE_PANEL_DATABASES . "`");
$dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC); $dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC);
$count_mysqlservers = $dbserver['numservers']; $count_mysqlservers = $dbserver['numservers'];
@@ -81,21 +81,21 @@ if ($page == 'overview') {
$row = htmlentities_array($row); $row = htmlentities_array($row);
$mbdata_stmt = Database::prepare("SELECT SUM(data_length + index_length) as MB FROM information_schema.TABLES $mbdata_stmt = Database::prepare("SELECT SUM(data_length + index_length) as MB FROM information_schema.TABLES
WHERE table_schema = :table_schema WHERE table_schema = :table_schema
GROUP BY table_schema" GROUP BY table_schema");
); Database::pexecute($mbdata_stmt, array(
Database::pexecute($mbdata_stmt, array("table_schema" => $row['databasename'])); "table_schema" => $row['databasename']
));
$mbdata = $mbdata_stmt->fetch(PDO::FETCH_ASSOC); $mbdata = $mbdata_stmt->fetch(PDO::FETCH_ASSOC);
$row['size'] = \Froxlor\PhpHelper::size_readable($mbdata['MB'], 'GiB', 'bi', '%01.' . (int)Settings::Get('panel.decimal_places') . 'f %s'); $row['size'] = \Froxlor\PhpHelper::size_readable($mbdata['MB'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
eval("\$mysqls.=\"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls_database') . "\";"); eval("\$mysqls.=\"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls_database') . "\";");
$count++; $count ++;
} }
$i++; $i ++;
} }
Database::needRoot(false); Database::needRoot(false);
// End root-session // End root-session
eval("echo \"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls') . "\";");
} elseif ($action == 'delete' && $id != 0) { } elseif ($action == 'delete' && $id != 0) {
try { try {
@@ -114,7 +114,7 @@ if ($page == 'overview') {
$sql_root = Database::getSqlData(); $sql_root = Database::getSqlData();
Database::needRoot(false); Database::needRoot(false);
if (!isset($sql_root[$result['dbserver']]) || !is_array($sql_root[$result['dbserver']])) { if (! isset($sql_root[$result['dbserver']]) || ! is_array($sql_root[$result['dbserver']])) {
$result['dbserver'] = 0; $result['dbserver'] = 0;
} }
@@ -124,13 +124,20 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
$dbnamedesc = $result['databasename']; $dbnamedesc = $result['databasename'];
if (isset($result['description']) && $result['description'] != '') { if (isset($result['description']) && $result['description'] != '') {
$dbnamedesc .= ' ('.$result['description'].')'; $dbnamedesc .= ' (' . $result['description'] . ')';
} }
ask_yesno('mysql_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $dbnamedesc); ask_yesno('mysql_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
), $dbnamedesc);
} }
} }
} elseif ($action == 'add') { } elseif ($action == 'add') {
@@ -141,10 +148,13 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
$dbservers_stmt = Database::query("SELECT DISTINCT `dbserver` FROM `".TABLE_PANEL_DATABASES."`"); $dbservers_stmt = Database::query("SELECT DISTINCT `dbserver` FROM `" . TABLE_PANEL_DATABASES . "`");
$mysql_servers = ''; $mysql_servers = '';
$count_mysqlservers = 0; $count_mysqlservers = 0;
while ($dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC)) { while ($dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC)) {
@@ -152,11 +162,11 @@ if ($page == 'overview') {
Database::needSqlData(); Database::needSqlData();
$sql_root = Database::getSqlData(); $sql_root = Database::getSqlData();
$mysql_servers .= makeoption($sql_root['caption'], $dbserver['dbserver']); $mysql_servers .= makeoption($sql_root['caption'], $dbserver['dbserver']);
$count_mysqlservers++; $count_mysqlservers ++;
} }
Database::needRoot(false); Database::needRoot(false);
$mysql_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_add.php'; $mysql_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/mysql/formfield.mysql_add.php';
$mysql_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($mysql_add_data); $mysql_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($mysql_add_data);
$title = $mysql_add_data['mysql_add']['title']; $title = $mysql_add_data['mysql_add']['title'];
@@ -182,10 +192,13 @@ if ($page == 'overview') {
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
\Froxlor\UI\Response::redirectTo($filename, array('page' => $page, 's' => $s)); \Froxlor\UI\Response::redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else { } else {
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `".TABLE_PANEL_DATABASES."`"); $dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `" . TABLE_PANEL_DATABASES . "`");
$dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC); $dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC);
$count_mysqlservers = $dbserver['numservers']; $count_mysqlservers = $dbserver['numservers'];
@@ -194,7 +207,7 @@ if ($page == 'overview') {
$sql_root = Database::getSqlData(); $sql_root = Database::getSqlData();
Database::needRoot(false); Database::needRoot(false);
$mysql_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_edit.php'; $mysql_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/mysql/formfield.mysql_edit.php';
$mysql_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($mysql_edit_data); $mysql_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($mysql_edit_data);
$title = $mysql_edit_data['mysql_edit']['title']; $title = $mysql_edit_data['mysql_edit']['title'];

View File

@@ -16,7 +16,6 @@
* @package Panel * @package Panel
* *
*/ */
define('AREA', 'customer'); define('AREA', 'customer');
$intrafficpage = 1; $intrafficpage = 1;
require './lib/init.php'; require './lib/init.php';
@@ -25,7 +24,7 @@ use Froxlor\Database\Database;
use Froxlor\Settings; use Froxlor\Settings;
// redirect if this customer page is hidden via settings // redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','traffic')) { if (Settings::IsInList('panel.customer_hide_options', 'traffic')) {
\Froxlor\UI\Response::redirectTo('customer_index.php'); \Froxlor\UI\Response::redirectTo('customer_index.php');
} }
@@ -39,8 +38,7 @@ if (isset($_POST['month']) && isset($_POST['year'])) {
} elseif (isset($_GET['month']) && isset($_GET['year'])) { } elseif (isset($_GET['month']) && isset($_GET['year'])) {
$month = intval($_GET['month']); $month = intval($_GET['month']);
$year = intval($_GET['year']); $year = intval($_GET['year']);
} } // BAM! $_GET???
//BAM! $_GET???
elseif (isset($_GET['page']) && $_GET['page'] == 'current') { elseif (isset($_GET['page']) && $_GET['page'] == 'current') {
if (date('d') != '01') { if (date('d') != '01') {
$month = date('m'); $month = date('m');
@@ -56,7 +54,7 @@ elseif (isset($_GET['page']) && $_GET['page'] == 'current') {
} }
} }
if (!is_null($month) && !is_null($year)) { if (! is_null($month) && ! is_null($year)) {
$traf['byte'] = 0; $traf['byte'] = 0;
$result_stmt = Database::prepare("SELECT SUM(`http`) as 'http', SUM(`ftp_up`) AS 'ftp_up', SUM(`ftp_down`) as 'ftp_down', SUM(`mail`) as 'mail', `day`, `month`, `year` $result_stmt = Database::prepare("SELECT SUM(`http`) as 'http', SUM(`ftp_up`) AS 'ftp_up', SUM(`ftp_down`) as 'ftp_down', SUM(`mail`) as 'mail', `day`, `month`, `year`
FROM `" . TABLE_PANEL_TRAFFIC . "` FROM `" . TABLE_PANEL_TRAFFIC . "`
@@ -64,8 +62,7 @@ if (!is_null($month) && !is_null($year)) {
AND `month` = :month AND `month` = :month
AND `year` = :year AND `year` = :year
GROUP BY `day` GROUP BY `day`
ORDER BY `day` DESC" ORDER BY `day` DESC");
);
$params = array( $params = array(
"customerid" => $userinfo['customerid'], "customerid" => $userinfo['customerid'],
"month" => $month, "month" => $month,
@@ -109,9 +106,9 @@ if (!is_null($month) && !is_null($year)) {
$show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year']; $show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year'];
} }
$traffic_complete['http'] = \Froxlor\PhpHelper::size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s'); $traffic_complete['http'] = \Froxlor\PhpHelper::size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$traffic_complete['ftp'] = \Froxlor\PhpHelper::size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s'); $traffic_complete['ftp'] = \Froxlor\PhpHelper::size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$traffic_complete['mail'] = \Froxlor\PhpHelper::size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s'); $traffic_complete['mail'] = \Froxlor\PhpHelper::size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_details') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_details') . "\";");
} else { } else {
@@ -119,9 +116,10 @@ if (!is_null($month) && !is_null($year)) {
FROM `" . TABLE_PANEL_TRAFFIC . "` FROM `" . TABLE_PANEL_TRAFFIC . "`
WHERE `customerid` = :customerid WHERE `customerid` = :customerid
GROUP BY `year` DESC, `month` DESC GROUP BY `year` DESC, `month` DESC
LIMIT 12" LIMIT 12");
); Database::pexecute($result_stmt, array(
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid'])); "customerid" => $userinfo['customerid']
));
$traffic_complete['http'] = 0; $traffic_complete['http'] = 0;
$traffic_complete['ftp'] = 0; $traffic_complete['ftp'] = 0;
$traffic_complete['mail'] = 0; $traffic_complete['mail'] = 0;
@@ -160,9 +158,9 @@ if (!is_null($month) && !is_null($year)) {
eval("\$traffic.=\"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_traffic') . "\";"); eval("\$traffic.=\"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_traffic') . "\";");
} }
$traffic_complete['http'] = \Froxlor\PhpHelper::size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s'); $traffic_complete['http'] = \Froxlor\PhpHelper::size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$traffic_complete['ftp'] = \Froxlor\PhpHelper::size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s'); $traffic_complete['ftp'] = \Froxlor\PhpHelper::size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$traffic_complete['mail'] = \Froxlor\PhpHelper::size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s'); $traffic_complete['mail'] = \Froxlor\PhpHelper::size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic') . "\";");
} }

View File

@@ -1,7 +1,7 @@
<?php <?php
if (! defined('AREA')) { if (! defined('AREA')) {
header("Location: index.php"); header("Location: index.php");
exit; exit();
} }
/** /**
@@ -16,7 +16,7 @@ if (! defined('AREA')) {
* @author Froxlor team <team@froxlor.org> (2016-) * @author Froxlor team <team@froxlor.org> (2016-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Panel * @package Panel
* *
*/ */
use Froxlor\Database\Database; use Froxlor\Database\Database;

View File

@@ -89,48 +89,48 @@ class FroxlorAPI
*/ */
public function request(string $command, array $params = array()): FroxlorAPI public function request(string $command, array $params = array()): FroxlorAPI
{ {
// build request array // build request array
$request = [ $request = [
'header' => [ 'header' => [
'apikey' => $this->api_key, 'apikey' => $this->api_key,
'secret' => $this->api_secret 'secret' => $this->api_secret
], ],
'body' => [ 'body' => [
'command' => $command 'command' => $command
] ]
]; ];
// add parameter to request-body if any // add parameter to request-body if any
if (! empty($params)) { if (! empty($params)) {
$request['body']['params'] = $params; $request['body']['params'] = $params;
}
// reset last data
$this->last_header = array();
$this->last_body = array();
// send actual request
$response = $this->requestCurl(json_encode($request));
// decode response
$resp = json_decode($response[1], true);
// set body to data-part of response
$this->last_body = $resp['data'];
// set header of response
$this->last_header = [
'status' => $resp['status'],
'status_message' => $resp['status_message']
];
// check for error in api response
if (isset($this->last_header['status']) && $this->last_header['status'] >= 400) {
// set last-error message
$this->last_error .= "[" . $this->last_header['status'] . "] " . $this->last_header['status_message'];
}
return $this;
} }
// reset last data
$this->last_header = array();
$this->last_body = array();
// send actual request
$response = $this->requestCurl(json_encode($request));
// decode response
$resp = json_decode($response[1], true);
// set body to data-part of response
$this->last_body = $resp['data'];
// set header of response
$this->last_header = [
'status' => $resp['status'],
'status_message' => $resp['status_message']
];
// check for error in api response
if (isset($this->last_header['status']) && $this->last_header['status'] >= 400) {
// set last-error message
$this->last_error .= "[" . $this->last_header['status'] . "] " . $this->last_header['status_message'];
}
return $this;
}
/** /**
* returns last response header * returns last response header
* *

View File

@@ -15,7 +15,6 @@
* @package Install * @package Install
* *
*/ */
require 'lib/class.FroxlorInstall.php'; require 'lib/class.FroxlorInstall.php';
$frxinstall = new FroxlorInstall(); $frxinstall = new FroxlorInstall();

View File

@@ -161,7 +161,7 @@ class FroxlorInstall
$this->_guessServerName(); $this->_guessServerName();
$this->_guessServerIP(); $this->_guessServerIP();
$this->_guessWebserver(); $this->_guessWebserver();
$this->_getPostField('mysql_host', '127.0.0.1'); $this->_getPostField('mysql_host', '127.0.0.1');
$this->_getPostField('mysql_database', 'froxlor'); $this->_getPostField('mysql_database', 'froxlor');
$this->_getPostField('mysql_unpriv_user', 'froxlor'); $this->_getPostField('mysql_unpriv_user', 'froxlor');
@@ -176,22 +176,22 @@ class FroxlorInstall
$this->_getPostField('httpuser', $posixusername['name']); $this->_getPostField('httpuser', $posixusername['name']);
$posixgroup = posix_getgrgid(posix_getgid()); $posixgroup = posix_getgrgid(posix_getgid());
$this->_getPostField('httpgroup', $posixgroup['name']); $this->_getPostField('httpgroup', $posixgroup['name']);
if ($this->_data['mysql_host'] == 'localhost' || $this->_data['mysql_host'] == '127.0.0.1') { if ($this->_data['mysql_host'] == 'localhost' || $this->_data['mysql_host'] == '127.0.0.1') {
$this->_data['mysql_access_host'] = $this->_data['mysql_host']; $this->_data['mysql_access_host'] = $this->_data['mysql_host'];
} else { } else {
$this->_data['mysql_access_host'] = $this->_data['serverip']; $this->_data['mysql_access_host'] = $this->_data['serverip'];
} }
// check system-hostname to be a FQDN // check system-hostname to be a FQDN
if ($this->_validate_ip($this->_data['servername']) !== false) { if ($this->_validate_ip($this->_data['servername']) !== false) {
$this->_data['servername'] = ''; $this->_data['servername'] = '';
} }
if (empty($this->_data['serverip']) || $this->_validate_ip($this->_data['serverip']) == false) { if (empty($this->_data['serverip']) || $this->_validate_ip($this->_data['serverip']) == false) {
return false; return false;
} }
if (isset($_POST['installstep']) && $_POST['installstep'] == '1' && $this->_data['admin_pass1'] == $this->_data['admin_pass2'] && $this->_data['admin_pass1'] != '' && $this->_data['admin_pass2'] != '' && $this->_data['mysql_unpriv_pass'] != '' && $this->_data['mysql_root_pass'] != '' && $this->_data['servername'] != '' && $this->_data['serverip'] != '' && $this->_data['httpuser'] != '' && $this->_data['httpgroup'] != '' && $this->_data['mysql_unpriv_user'] != $this->_data['mysql_root_user']) { if (isset($_POST['installstep']) && $_POST['installstep'] == '1' && $this->_data['admin_pass1'] == $this->_data['admin_pass2'] && $this->_data['admin_pass1'] != '' && $this->_data['admin_pass2'] != '' && $this->_data['mysql_unpriv_pass'] != '' && $this->_data['mysql_root_pass'] != '' && $this->_data['servername'] != '' && $this->_data['serverip'] != '' && $this->_data['httpuser'] != '' && $this->_data['httpgroup'] != '' && $this->_data['mysql_unpriv_user'] != $this->_data['mysql_root_user']) {
return true; return true;
} }
@@ -206,7 +206,7 @@ class FroxlorInstall
private function _doInstall() private function _doInstall()
{ {
$content = "<table class=\"noborder\">"; $content = "<table class=\"noborder\">";
// check for mysql-root-connection // check for mysql-root-connection
$content .= $this->_status_message('begin', $this->_lng['install']['testing_mysql']); $content .= $this->_status_message('begin', $this->_lng['install']['testing_mysql']);
@@ -234,15 +234,15 @@ class FroxlorInstall
$fatal_fail = true; $fatal_fail = true;
} }
} }
if (! $fatal_fail) { if (! $fatal_fail) {
$version_server = $db_root->getAttribute(PDO::ATTR_SERVER_VERSION); $version_server = $db_root->getAttribute(PDO::ATTR_SERVER_VERSION);
$sql_mode = 'NO_ENGINE_SUBSTITUTION'; $sql_mode = 'NO_ENGINE_SUBSTITUTION';
if (version_compare($version_server, '8.0.11', '<')) { if (version_compare($version_server, '8.0.11', '<')) {
$sql_mode .= ',NO_AUTO_CREATE_USER'; $sql_mode .= ',NO_AUTO_CREATE_USER';
} }
$db_root->exec('SET sql_mode = "'.$sql_mode.'"'); $db_root->exec('SET sql_mode = "' . $sql_mode . '"');
// ok, if we are here, the database connection is up and running // ok, if we are here, the database connection is up and running
$content .= $this->_status_message('green', "OK"); $content .= $this->_status_message('green', "OK");
// check for existing db and create backup if so // check for existing db and create backup if so
@@ -265,7 +265,7 @@ class FroxlorInstall
if (version_compare($version_server, '8.0.11', '<')) { if (version_compare($version_server, '8.0.11', '<')) {
$sql_mode .= ',NO_AUTO_CREATE_USER'; $sql_mode .= ',NO_AUTO_CREATE_USER';
} }
$db->exec('SET sql_mode = "'.$sql_mode.'"'); $db->exec('SET sql_mode = "' . $sql_mode . '"');
} catch (PDOException $e) { } catch (PDOException $e) {
// dafuq? this should have happened in _importDatabaseData() // dafuq? this should have happened in _importDatabaseData()
$content .= $this->_status_message('red', $e->getMessage()); $content .= $this->_status_message('red', $e->getMessage());
@@ -283,9 +283,9 @@ class FroxlorInstall
} }
} }
} }
$content .= "</table>"; $content .= "</table>";
// check if we have unrecoverable errors // check if we have unrecoverable errors
if ($fatal_fail || $another_fail || $this->_abort) { if ($fatal_fail || $another_fail || $this->_abort) {
// D'oh // D'oh
@@ -302,9 +302,9 @@ class FroxlorInstall
$link = '../index.php'; $link = '../index.php';
$linktext = $this->_lng['click_here_to_login']; $linktext = $this->_lng['click_here_to_login'];
} }
eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";"); eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";");
return array( return array(
'pagecontent' => $content, 'pagecontent' => $content,
'pagenavigation' => $navigation 'pagenavigation' => $navigation
@@ -317,7 +317,7 @@ class FroxlorInstall
private function _createUserdataConf() private function _createUserdataConf()
{ {
$content = ""; $content = "";
$content .= $this->_status_message('begin', $this->_lng['install']['creating_configfile']); $content .= $this->_status_message('begin', $this->_lng['install']['creating_configfile']);
$userdata = "<?php\n"; $userdata = "<?php\n";
$userdata .= "// automatically generated userdata.inc.php for Froxlor\n"; $userdata .= "// automatically generated userdata.inc.php for Froxlor\n";
@@ -332,7 +332,7 @@ class FroxlorInstall
$userdata .= "// enable debugging to browser in case of SQL errors\n"; $userdata .= "// enable debugging to browser in case of SQL errors\n";
$userdata .= "\$sql['debug'] = false;\n"; $userdata .= "\$sql['debug'] = false;\n";
$userdata .= "?>"; $userdata .= "?>";
// test if we can store the userdata.inc.php in ../lib // test if we can store the userdata.inc.php in ../lib
$userdata_file = dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php'; $userdata_file = dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php';
if ($fp = @fopen($userdata_file, 'w')) { if ($fp = @fopen($userdata_file, 'w')) {
@@ -350,7 +350,7 @@ class FroxlorInstall
$escpduserdata = nl2br(htmlspecialchars($userdata)); $escpduserdata = nl2br(htmlspecialchars($userdata));
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";"); eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";");
} }
return $content; return $content;
} }
@@ -364,9 +364,9 @@ class FroxlorInstall
private function _doDataEntries(&$db) private function _doDataEntries(&$db)
{ {
$content = ""; $content = "";
$content .= $this->_status_message('begin', $this->_lng['install']['creating_entries']); $content .= $this->_status_message('begin', $this->_lng['install']['creating_entries']);
// and lets insert the default ip and port // and lets insert the default ip and port
$stmt = $db->prepare(" $stmt = $db->prepare("
INSERT INTO `" . TABLE_PANEL_IPSANDPORTS . "` SET INSERT INTO `" . TABLE_PANEL_IPSANDPORTS . "` SET
@@ -380,7 +380,7 @@ class FroxlorInstall
'serverip' => $this->_data['serverip'] 'serverip' => $this->_data['serverip']
)); ));
$defaultip = $db->lastInsertId(); $defaultip = $db->lastInsertId();
// insert the defaultip // insert the defaultip
$upd_stmt = $db->prepare(" $upd_stmt = $db->prepare("
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
@@ -390,9 +390,9 @@ class FroxlorInstall
$upd_stmt->execute(array( $upd_stmt->execute(array(
'defaultip' => $defaultip 'defaultip' => $defaultip
)); ));
$content .= $this->_status_message('green', 'OK'); $content .= $this->_status_message('green', 'OK');
// last but not least create the main admin // last but not least create the main admin
$content .= $this->_status_message('begin', $this->_lng['install']['adding_admin_user']); $content .= $this->_status_message('begin', $this->_lng['install']['adding_admin_user']);
$ins_data = array( $ins_data = array(
@@ -425,11 +425,11 @@ class FroxlorInstall
`subdomains` = -1, `subdomains` = -1,
`traffic` = -1048576 `traffic` = -1048576
"); ");
$ins_stmt->execute($ins_data); $ins_stmt->execute($ins_data);
$content .= $this->_status_message('green', 'OK'); $content .= $this->_status_message('green', 'OK');
return $content; return $content;
} }
@@ -460,14 +460,14 @@ class FroxlorInstall
private function _doSettings(&$db) private function _doSettings(&$db)
{ {
$content = ""; $content = "";
$content .= $this->_status_message('begin', $this->_lng['install']['changing_data']); $content .= $this->_status_message('begin', $this->_lng['install']['changing_data']);
$upd_stmt = $db->prepare(" $upd_stmt = $db->prepare("
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
`value` = :value `value` = :value
WHERE `settinggroup` = :group AND `varname` = :varname WHERE `settinggroup` = :group AND `varname` = :varname
"); ");
$this->_updateSetting($upd_stmt, 'admin@' . $this->_data['servername'], 'panel', 'adminmail'); $this->_updateSetting($upd_stmt, 'admin@' . $this->_data['servername'], 'panel', 'adminmail');
$this->_updateSetting($upd_stmt, $this->_data['serverip'], 'system', 'ipaddress'); $this->_updateSetting($upd_stmt, $this->_data['serverip'], 'system', 'ipaddress');
$this->_updateSetting($upd_stmt, $this->_data['servername'], 'system', 'hostname'); $this->_updateSetting($upd_stmt, $this->_data['servername'], 'system', 'hostname');
@@ -476,7 +476,7 @@ class FroxlorInstall
$this->_updateSetting($upd_stmt, $this->_data['webserver'], 'system', 'webserver'); $this->_updateSetting($upd_stmt, $this->_data['webserver'], 'system', 'webserver');
$this->_updateSetting($upd_stmt, $this->_data['httpuser'], 'system', 'httpuser'); $this->_updateSetting($upd_stmt, $this->_data['httpuser'], 'system', 'httpuser');
$this->_updateSetting($upd_stmt, $this->_data['httpgroup'], 'system', 'httpgroup'); $this->_updateSetting($upd_stmt, $this->_data['httpgroup'], 'system', 'httpgroup');
// necessary changes for webservers != apache2 // necessary changes for webservers != apache2
if ($this->_data['webserver'] == "apache24") { if ($this->_data['webserver'] == "apache24") {
$this->_updateSetting($upd_stmt, 'apache2', 'system', 'webserver'); $this->_updateSetting($upd_stmt, 'apache2', 'system', 'webserver');
@@ -496,22 +496,22 @@ class FroxlorInstall
$this->_updateSetting($upd_stmt, '/etc/nginx/nginx.pem', 'system', 'ssl_cert_file'); $this->_updateSetting($upd_stmt, '/etc/nginx/nginx.pem', 'system', 'ssl_cert_file');
$this->_updateSetting($upd_stmt, '/var/run/', 'phpfpm', 'fastcgi_ipcdir'); $this->_updateSetting($upd_stmt, '/var/run/', 'phpfpm', 'fastcgi_ipcdir');
} }
$this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed'); $this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed');
$this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath'); $this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath');
// insert the lastcronrun to be the installation date // insert the lastcronrun to be the installation date
$this->_updateSetting($upd_stmt, time(), 'system', 'lastcronrun'); $this->_updateSetting($upd_stmt, time(), 'system', 'lastcronrun');
// set specific times for some crons (traffic only at night, etc.) // set specific times for some crons (traffic only at night, etc.)
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time())); $ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $ts . "' WHERE `cronfile` ='cron_traffic';"); $db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $ts . "' WHERE `cronfile` ='cron_traffic';");
// insert task 99 to generate a correct cron.d-file automatically // insert task 99 to generate a correct cron.d-file automatically
$db->query("INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = '99';"); $db->query("INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = '99';");
$content .= $this->_status_message('green', 'OK'); $content .= $this->_status_message('green', 'OK');
return $content; return $content;
} }
@@ -545,16 +545,16 @@ class FroxlorInstall
if (version_compare($version_server, '8.0.11', '<')) { if (version_compare($version_server, '8.0.11', '<')) {
$sql_mode .= ',NO_AUTO_CREATE_USER'; $sql_mode .= ',NO_AUTO_CREATE_USER';
} }
$db->exec('SET sql_mode = "'.$sql_mode.'"'); $db->exec('SET sql_mode = "' . $sql_mode . '"');
} catch (PDOException $e) { } catch (PDOException $e) {
$content .= $this->_status_message('red', $e->getMessage()); $content .= $this->_status_message('red', $e->getMessage());
$fatal_fail = true; $fatal_fail = true;
} }
if (! $fatal_fail) { if (! $fatal_fail) {
$content .= $this->_status_message('green', 'OK'); $content .= $this->_status_message('green', 'OK');
$content .= $this->_status_message('begin', $this->_lng['install']['importing_data']); $content .= $this->_status_message('begin', $this->_lng['install']['importing_data']);
$db_schema = dirname(dirname(__FILE__)) . '/froxlor.sql'; $db_schema = dirname(dirname(__FILE__)) . '/froxlor.sql';
$sql_query = @file_get_contents($db_schema); $sql_query = @file_get_contents($db_schema);
@@ -572,13 +572,13 @@ class FroxlorInstall
} }
} }
} }
if (! $fatal_fail) { if (! $fatal_fail) {
$content .= $this->_status_message('green', 'OK'); $content .= $this->_status_message('green', 'OK');
} }
$db = null; $db = null;
} }
return $content; return $content;
} }
@@ -592,56 +592,56 @@ class FroxlorInstall
private function _createDatabaseAndUser(&$db_root) private function _createDatabaseAndUser(&$db_root)
{ {
$content = ""; $content = "";
// so first we have to delete the database and // so first we have to delete the database and
// the user given for the unpriv-user if they exit // the user given for the unpriv-user if they exit
$content .= $this->_status_message('begin', $this->_lng['install']['prepare_db']); $content .= $this->_status_message('begin', $this->_lng['install']['prepare_db']);
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`user` WHERE `User` = :user AND `Host` = :accesshost"); $del_stmt = $db_root->prepare("DELETE FROM `mysql`.`user` WHERE `User` = :user AND `Host` = :accesshost");
$del_stmt->execute(array( $del_stmt->execute(array(
'user' => $this->_data['mysql_unpriv_user'], 'user' => $this->_data['mysql_unpriv_user'],
'accesshost' => $this->_data['mysql_access_host'] 'accesshost' => $this->_data['mysql_access_host']
)); ));
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`db` WHERE `User` = :user AND `Host` = :accesshost"); $del_stmt = $db_root->prepare("DELETE FROM `mysql`.`db` WHERE `User` = :user AND `Host` = :accesshost");
$del_stmt->execute(array( $del_stmt->execute(array(
'user' => $this->_data['mysql_unpriv_user'], 'user' => $this->_data['mysql_unpriv_user'],
'accesshost' => $this->_data['mysql_access_host'] 'accesshost' => $this->_data['mysql_access_host']
)); ));
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`tables_priv` WHERE `User` = :user AND `Host` =:accesshost"); $del_stmt = $db_root->prepare("DELETE FROM `mysql`.`tables_priv` WHERE `User` = :user AND `Host` =:accesshost");
$del_stmt->execute(array( $del_stmt->execute(array(
'user' => $this->_data['mysql_unpriv_user'], 'user' => $this->_data['mysql_unpriv_user'],
'accesshost' => $this->_data['mysql_access_host'] 'accesshost' => $this->_data['mysql_access_host']
)); ));
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`columns_priv` WHERE `User` = :user AND `Host` = :accesshost"); $del_stmt = $db_root->prepare("DELETE FROM `mysql`.`columns_priv` WHERE `User` = :user AND `Host` = :accesshost");
$del_stmt->execute(array( $del_stmt->execute(array(
'user' => $this->_data['mysql_unpriv_user'], 'user' => $this->_data['mysql_unpriv_user'],
'accesshost' => $this->_data['mysql_access_host'] 'accesshost' => $this->_data['mysql_access_host']
)); ));
$del_stmt = $db_root->prepare("DROP DATABASE IF EXISTS `" . str_replace('`', '', $this->_data['mysql_database']) . "`;"); $del_stmt = $db_root->prepare("DROP DATABASE IF EXISTS `" . str_replace('`', '', $this->_data['mysql_database']) . "`;");
$del_stmt->execute(); $del_stmt->execute();
$db_root->query("FLUSH PRIVILEGES;"); $db_root->query("FLUSH PRIVILEGES;");
$content .= $this->_status_message('green', 'OK'); $content .= $this->_status_message('green', 'OK');
// we have to create a new user and database for the froxlor unprivileged mysql access // we have to create a new user and database for the froxlor unprivileged mysql access
$content .= $this->_status_message('begin', $this->_lng['install']['create_mysqluser_and_db']); $content .= $this->_status_message('begin', $this->_lng['install']['create_mysqluser_and_db']);
$ins_stmt = $db_root->prepare("CREATE DATABASE `" . str_replace('`', '', $this->_data['mysql_database']) . "` CHARACTER SET=utf8 COLLATE=utf8_general_ci"); $ins_stmt = $db_root->prepare("CREATE DATABASE `" . str_replace('`', '', $this->_data['mysql_database']) . "` CHARACTER SET=utf8 COLLATE=utf8_general_ci");
$ins_stmt->execute(); $ins_stmt->execute();
$mysql_access_host_array = array_map('trim', explode(',', $this->_data['mysql_access_host'])); $mysql_access_host_array = array_map('trim', explode(',', $this->_data['mysql_access_host']));
if (in_array('127.0.0.1', $mysql_access_host_array) && ! in_array('localhost', $mysql_access_host_array)) { if (in_array('127.0.0.1', $mysql_access_host_array) && ! in_array('localhost', $mysql_access_host_array)) {
$mysql_access_host_array[] = 'localhost'; $mysql_access_host_array[] = 'localhost';
} }
if (! in_array('127.0.0.1', $mysql_access_host_array) && in_array('localhost', $mysql_access_host_array)) { if (! in_array('127.0.0.1', $mysql_access_host_array) && in_array('localhost', $mysql_access_host_array)) {
$mysql_access_host_array[] = '127.0.0.1'; $mysql_access_host_array[] = '127.0.0.1';
} }
$mysql_access_host_array[] = $this->_data['serverip']; $mysql_access_host_array[] = $this->_data['serverip'];
foreach ($mysql_access_host_array as $mysql_access_host) { foreach ($mysql_access_host_array as $mysql_access_host) {
$_db = str_replace('`', '', $this->_data['mysql_database']); $_db = str_replace('`', '', $this->_data['mysql_database']);
@@ -660,11 +660,11 @@ class FroxlorInstall
"password" => $this->_data['mysql_unpriv_pass'] "password" => $this->_data['mysql_unpriv_pass']
)); ));
} }
$db_root->query("FLUSH PRIVILEGES;"); $db_root->query("FLUSH PRIVILEGES;");
$this->_data['mysql_access_host'] = implode(',', $mysql_access_host_array); $this->_data['mysql_access_host'] = implode(',', $mysql_access_host_array);
$content .= $this->_status_message('green', 'OK'); $content .= $this->_status_message('green', 'OK');
return $content; return $content;
} }
@@ -678,7 +678,7 @@ class FroxlorInstall
private function _backupExistingDatabase(&$db_root) private function _backupExistingDatabase(&$db_root)
{ {
$content = ""; $content = "";
// check for existing of former database // check for existing of former database
$tables_exist = false; $tables_exist = false;
$sql = "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = :database"; $sql = "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = :database";
@@ -687,19 +687,19 @@ class FroxlorInstall
'database' => $this->_data['mysql_database'] 'database' => $this->_data['mysql_database']
)); ));
$rows = $db_root->query("SELECT FOUND_ROWS()")->fetchColumn(); $rows = $db_root->query("SELECT FOUND_ROWS()")->fetchColumn();
// check result // check result
if ($result_stmt !== false && $rows > 0) { if ($result_stmt !== false && $rows > 0) {
$tables_exist = true; $tables_exist = true;
} }
if ($tables_exist) { if ($tables_exist) {
// tell whats going on // tell whats going on
$content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']); $content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']);
// create temporary backup-filename // create temporary backup-filename
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql"; $filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
// look for mysqldump // look for mysqldump
$do_backup = false; $do_backup = false;
if (file_exists("/usr/bin/mysqldump")) { if (file_exists("/usr/bin/mysqldump")) {
@@ -709,7 +709,7 @@ class FroxlorInstall
$do_backup = true; $do_backup = true;
$mysql_dump = '/usr/local/bin/mysqldump'; $mysql_dump = '/usr/local/bin/mysqldump';
} }
if ($do_backup) { if ($do_backup) {
$command = $mysql_dump . " " . $this->_data['mysql_database'] . " -u " . $this->_data['mysql_root_user'] . " --password='" . $this->_data['mysql_root_pass'] . "' --result-file=" . $filename; $command = $mysql_dump . " " . $this->_data['mysql_database'] . " -u " . $this->_data['mysql_root_user'] . " --password='" . $this->_data['mysql_root_pass'] . "' --result-file=" . $filename;
$output = exec($command); $output = exec($command);
@@ -722,7 +722,7 @@ class FroxlorInstall
$content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']); $content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']);
} }
} }
return $content; return $content;
} }
@@ -744,7 +744,7 @@ class FroxlorInstall
} }
// get language-form-template // get language-form-template
eval("\$content .= \"" . $this->_getTemplate("lngform") . "\";"); eval("\$content .= \"" . $this->_getTemplate("lngform") . "\";");
// form-data // form-data
$formdata = ""; $formdata = "";
/** /**
@@ -784,7 +784,7 @@ class FroxlorInstall
$style = ''; $style = '';
} }
$formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password'); $formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password');
/** /**
* admin data * admin data
*/ */
@@ -808,7 +808,7 @@ class FroxlorInstall
$formdata .= $this->_getSectionItemString('admin_pass2', true, $style, 'password'); $formdata .= $this->_getSectionItemString('admin_pass2', true, $style, 'password');
// activate newsfeed? // activate newsfeed?
$formdata .= $this->_getSectionItemYesNo('activate_newsfeed', true); $formdata .= $this->_getSectionItemYesNo('activate_newsfeed', true);
/** /**
* Server data * Server data
*/ */
@@ -855,11 +855,11 @@ class FroxlorInstall
$style = ''; $style = '';
} }
$formdata .= $this->_getSectionItemString('httpgroup', true, $style); $formdata .= $this->_getSectionItemString('httpgroup', true, $style);
// get data-form-template // get data-form-template
$language = htmlspecialchars($this->_activelng); $language = htmlspecialchars($this->_activelng);
eval("\$content .= \"" . $this->_getTemplate("dataform2") . "\";"); eval("\$content .= \"" . $this->_getTemplate("dataform2") . "\";");
$navigation = ''; $navigation = '';
return array( return array(
'pagecontent' => $content, 'pagecontent' => $content,
@@ -936,15 +936,15 @@ class FroxlorInstall
*/ */
private function _requirementCheck() private function _requirementCheck()
{ {
// indicator whether we need to abort or not // indicator whether we need to abort or not
$_die = false; $_die = false;
$content = "<table class=\"noborder\">"; $content = "<table class=\"noborder\">";
// check for correct php version // check for correct php version
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']); $content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']);
if (version_compare("5.6.0", PHP_VERSION, ">=")) { if (version_compare("5.6.0", PHP_VERSION, ">=")) {
$content .= $this->_status_message('red', $this->_lng['requirements']['notfound'] . ' (' . PHP_VERSION . ')'); $content .= $this->_status_message('red', $this->_lng['requirements']['notfound'] . ' (' . PHP_VERSION . ')');
$_die = true; $_die = true;
@@ -955,10 +955,10 @@ class FroxlorInstall
$content .= $this->_status_message('green', PHP_VERSION); $content .= $this->_status_message('green', PHP_VERSION);
} }
} }
// check for php_pdo and pdo_mysql // check for php_pdo and pdo_mysql
$content .= $this->_status_message('begin', $this->_lng['requirements']['phppdo']); $content .= $this->_status_message('begin', $this->_lng['requirements']['phppdo']);
if (! extension_loaded('pdo') || in_array("mysql", PDO::getAvailableDrivers()) == false) { if (! extension_loaded('pdo') || in_array("mysql", PDO::getAvailableDrivers()) == false) {
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']); $content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
$_die = true; $_die = true;
@@ -977,16 +977,16 @@ class FroxlorInstall
// check for xml-extension // check for xml-extension
$this->_requirementCheckFor($content, $_die, 'xml', false, 'phpxml'); $this->_requirementCheckFor($content, $_die, 'xml', false, 'phpxml');
// check for filter-extension // check for filter-extension
$this->_requirementCheckFor($content, $_die, 'filter', false, 'phpfilter'); $this->_requirementCheckFor($content, $_die, 'filter', false, 'phpfilter');
// check for posix-extension // check for posix-extension
$this->_requirementCheckFor($content, $_die, 'posix', false, 'phpposix'); $this->_requirementCheckFor($content, $_die, 'posix', false, 'phpposix');
// check for mbstring-extension // check for mbstring-extension
$this->_requirementCheckFor($content, $_die, 'mbstring', false, 'phpmbstring'); $this->_requirementCheckFor($content, $_die, 'mbstring', false, 'phpmbstring');
// check for curl extension // check for curl extension
$this->_requirementCheckFor($content, $_die, 'curl', false, 'phpcurl'); $this->_requirementCheckFor($content, $_die, 'curl', false, 'phpcurl');
@@ -995,7 +995,7 @@ class FroxlorInstall
// check for bcmath extension // check for bcmath extension
$this->_requirementCheckFor($content, $_die, 'bcmath', true, 'phpbcmath', 'bcmathdescription'); $this->_requirementCheckFor($content, $_die, 'bcmath', true, 'phpbcmath', 'bcmathdescription');
// check for zip extension // check for zip extension
$this->_requirementCheckFor($content, $_die, 'zip', true, 'phpzip', 'zipdescription'); $this->_requirementCheckFor($content, $_die, 'zip', true, 'phpzip', 'zipdescription');
@@ -1007,7 +1007,7 @@ class FroxlorInstall
} else { } else {
$content .= $this->_status_message('green', 'off'); $content .= $this->_status_message('green', 'off');
} }
// check for mysqldump binary in order to backup existing database // check for mysqldump binary in order to backup existing database
$content .= $this->_status_message('begin', $this->_lng['requirements']['mysqldump']); $content .= $this->_status_message('begin', $this->_lng['requirements']['mysqldump']);
@@ -1016,9 +1016,9 @@ class FroxlorInstall
} else { } else {
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['mysqldumpmissing']); $content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['mysqldumpmissing']);
} }
$content .= "</table>"; $content .= "</table>";
// check if we have unrecoverable errors // check if we have unrecoverable errors
$navigation = ''; $navigation = '';
if ($_die) { if ($_die) {
@@ -1033,19 +1033,19 @@ class FroxlorInstall
$linktext = $this->_lng['click_here_to_continue']; $linktext = $this->_lng['click_here_to_continue'];
} }
eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";"); eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";");
return array( return array(
'pagecontent' => $content, 'pagecontent' => $content,
'pagenavigation' => $navigation 'pagenavigation' => $navigation
); );
} }
private function _requirementCheckFor(&$content, &$_die, $ext = '', $optional = false, $lng_txt = "", $lng_desc = "") private function _requirementCheckFor(&$content, &$_die, $ext = '', $optional = false, $lng_txt = "", $lng_desc = "")
{ {
$content .= $this->_status_message('begin', $this->_lng['requirements'][$lng_txt]); $content .= $this->_status_message('begin', $this->_lng['requirements'][$lng_txt]);
if (! extension_loaded($ext)) { if (! extension_loaded($ext)) {
if (!$optional) { if (! $optional) {
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']); $content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
$_die = true; $_die = true;
} else { } else {
@@ -1066,7 +1066,7 @@ class FroxlorInstall
header("Pragma: no-cache"); header("Pragma: no-cache");
header('Last-Modified: ' . gmdate('D, d M Y H:i:s \G\M\T', time())); header('Last-Modified: ' . gmdate('D, d M Y H:i:s \G\M\T', time()));
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time())); header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time()));
// ensure that default timezone is set // ensure that default timezone is set
if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get")) { if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get")) {
@date_default_timezone_set(@date_default_timezone_get()); @date_default_timezone_set(@date_default_timezone_get());
@@ -1084,7 +1084,7 @@ class FroxlorInstall
// includes the usersettings (MySQL-Username/Passwort) // includes the usersettings (MySQL-Username/Passwort)
// to test if Froxlor is already installed // to test if Froxlor is already installed
require $this->_basepath . '/lib/userdata.inc.php'; require $this->_basepath . '/lib/userdata.inc.php';
if (isset($sql) && is_array($sql)) { if (isset($sql) && is_array($sql)) {
// use sparkle theme for the notice // use sparkle theme for the notice
$installed_hint = file_get_contents($this->_basepath . '/templates/Sparkle/misc/alreadyinstalledhint.tpl'); $installed_hint = file_get_contents($this->_basepath . '/templates/Sparkle/misc/alreadyinstalledhint.tpl');
@@ -1101,7 +1101,7 @@ class FroxlorInstall
{ {
// set default // set default
$standardlanguage = 'english'; $standardlanguage = 'english';
// check either _GET or _POST // check either _GET or _POST
if (isset($_GET['language']) && isset($this->_languages[$_GET['language']])) { if (isset($_GET['language']) && isset($this->_languages[$_GET['language']])) {
$this->_activelng = $_GET['language']; $this->_activelng = $_GET['language'];
@@ -1122,7 +1122,7 @@ class FroxlorInstall
break; break;
} }
} }
// require english base language as fallback // require english base language as fallback
$lngfile = $this->_basepath . '/install/lng/' . $standardlanguage . '.lng.php'; $lngfile = $this->_basepath . '/install/lng/' . $standardlanguage . '.lng.php';
if (file_exists($lngfile)) { if (file_exists($lngfile)) {
@@ -1130,10 +1130,9 @@ class FroxlorInstall
require $lngfile; require $lngfile;
$this->_lng = $lng; $this->_lng = $lng;
} }
// require chosen language if not english // require chosen language if not english
if ($this->_activelng != $standardlanguage) if ($this->_activelng != $standardlanguage) {
{
$lngfile = $this->_basepath . '/install/lng/' . $this->_activelng . '.lng.php'; $lngfile = $this->_basepath . '/install/lng/' . $this->_activelng . '.lng.php';
if (file_exists($lngfile)) { if (file_exists($lngfile)) {
// includes file /lng/$language.lng.php if it exists // includes file /lng/$language.lng.php if it exists
@@ -1165,7 +1164,7 @@ class FroxlorInstall
} else { } else {
$templatefile = 'TEMPLATE NOT FOUND: ' . $filename; $templatefile = 'TEMPLATE NOT FOUND: ' . $filename;
} }
return $templatefile; return $templatefile;
} }
@@ -1321,17 +1320,17 @@ class FroxlorInstall
*/ */
private function _split_sql_file($sql, $delimiter) private function _split_sql_file($sql, $delimiter)
{ {
// Split up our string into "possible" SQL statements. // Split up our string into "possible" SQL statements.
$tokens = explode($delimiter, $sql); $tokens = explode($delimiter, $sql);
// try to save mem. // try to save mem.
$sql = ""; $sql = "";
$output = array(); $output = array();
// we don't actually care about the matches preg gives us. // we don't actually care about the matches preg gives us.
$matches = array(); $matches = array();
// this is faster than calling count($tokens) every time through the loop. // this is faster than calling count($tokens) every time through the loop.
$token_count = count($tokens); $token_count = count($tokens);
for ($i = 0; $i < $token_count; $i ++) { for ($i = 0; $i < $token_count; $i ++) {
@@ -1339,12 +1338,12 @@ class FroxlorInstall
if (($i != ($token_count - 1)) || (strlen($tokens[$i] > 0))) { if (($i != ($token_count - 1)) || (strlen($tokens[$i] > 0))) {
// This is the total number of single quotes in the token. // This is the total number of single quotes in the token.
$total_quotes = preg_match_all("/'/", $tokens[$i], $matches); $total_quotes = preg_match_all("/'/", $tokens[$i], $matches);
// Counts single quotes that are preceded by an odd number of backslashes, // Counts single quotes that are preceded by an odd number of backslashes,
// which means they're escaped quotes. // which means they're escaped quotes.
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$i], $matches); $escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$i], $matches);
$unescaped_quotes = $total_quotes - $escaped_quotes; $unescaped_quotes = $total_quotes - $escaped_quotes;
// If the number of unescaped quotes is even, then the delimiter // If the number of unescaped quotes is even, then the delimiter
// did NOT occur inside a string literal. // did NOT occur inside a string literal.
if (($unescaped_quotes % 2) == 0) { if (($unescaped_quotes % 2) == 0) {
@@ -1367,7 +1366,7 @@ class FroxlorInstall
// which means they're escaped quotes. // which means they're escaped quotes.
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$j], $matches); $escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$j], $matches);
$unescaped_quotes = $total_quotes - $escaped_quotes; $unescaped_quotes = $total_quotes - $escaped_quotes;
if (($unescaped_quotes % 2) == 1) { if (($unescaped_quotes % 2) == 1) {
// odd number of unescaped quotes. In combination with the previous incomplete // odd number of unescaped quotes. In combination with the previous incomplete
// statement(s), we now have a complete statement. (2 odds always make an even) // statement(s), we now have a complete statement. (2 odds always make an even)

View File

@@ -16,7 +16,6 @@
* @package Language * @package Language
* *
*/ */
$lng['requirements']['title'] = 'Checking system requirements...'; $lng['requirements']['title'] = 'Checking system requirements...';
$lng['requirements']['installed'] = 'installed'; $lng['requirements']['installed'] = 'installed';
$lng['requirements']['not_true'] = 'no'; $lng['requirements']['not_true'] = 'no';
@@ -87,8 +86,8 @@ $lng['install']['changing_data'] = 'Adjusting settings...';
$lng['install']['creating_entries'] = 'Inserting new values...'; $lng['install']['creating_entries'] = 'Inserting new values...';
$lng['install']['adding_admin_user'] = 'Creating admin-account...'; $lng['install']['adding_admin_user'] = 'Creating admin-account...';
$lng['install']['creating_configfile'] = 'Creating configfile...'; $lng['install']['creating_configfile'] = 'Creating configfile...';
$lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to '.dirname(dirname(__DIR__)).'/lib/.'; $lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to ' . dirname(dirname(__DIR__)) . '/lib/.';
$lng['install']['creating_configfile_failed'] = 'Could not create '.dirname(dirname(__DIR__)).'/lib/userdata.inc.php, please create it manually with the following content:'; $lng['install']['creating_configfile_failed'] = 'Could not create ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, please create it manually with the following content:';
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.'; $lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';
$lng['click_here_to_refresh'] = 'Click here to check again'; $lng['click_here_to_refresh'] = 'Click here to check again';

View File

@@ -16,7 +16,6 @@
* @package Language * @package Language
* *
*/ */
$lng['requirements']['title'] = 'Vérification des prérequis système...'; $lng['requirements']['title'] = 'Vérification des prérequis système...';
$lng['requirements']['installed'] = 'installé'; $lng['requirements']['installed'] = 'installé';
$lng['requirements']['not_true'] = 'non'; $lng['requirements']['not_true'] = 'non';
@@ -77,8 +76,8 @@ $lng['install']['changing_data'] = 'Ajustement des paramètres...';
$lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...'; $lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...';
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...'; $lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...'; $lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans '.dirname(dirname(__DIR__)).'/lib/.'; $lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans ' . dirname(dirname(__DIR__)) . '/lib/.';
$lng['install']['creating_configfile_failed'] = 'Impossible de créer '.dirname(dirname(__DIR__)).'/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:'; $lng['install']['creating_configfile_failed'] = 'Impossible de créer ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.'; $lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';
$lng['click_here_to_refresh'] = 'Cliquez ici pour vérifier à nouveau'; $lng['click_here_to_refresh'] = 'Cliquez ici pour vérifier à nouveau';

View File

@@ -16,7 +16,6 @@
* @package Language * @package Language
* *
*/ */
$lng['requirements']['title'] = 'Prüfe Systemvoraussetzungen...'; $lng['requirements']['title'] = 'Prüfe Systemvoraussetzungen...';
$lng['requirements']['installed'] = 'installiert'; $lng['requirements']['installed'] = 'installiert';
$lng['requirements']['not_true'] = 'nein'; $lng['requirements']['not_true'] = 'nein';
@@ -87,8 +86,8 @@ $lng['install']['changing_data'] = 'Einstellungen anpassen...';
$lng['install']['creating_entries'] = 'Trage neue Werte ein...'; $lng['install']['creating_entries'] = 'Trage neue Werte ein...';
$lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...'; $lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...';
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...'; $lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
$lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach '.dirname(dirname(__DIR__)).'/lib/ verschieben.'; $lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach ' . dirname(dirname(__DIR__)) . '/lib/ verschieben.';
$lng['install']['creating_configfile_failed'] = 'Konnte '.dirname(dirname(__DIR__)).'/lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:'; $lng['install']['creating_configfile_failed'] = 'Konnte ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.'; $lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';
$lng['click_here_to_refresh'] = 'Hier klicken, um erneut zu prüfen'; $lng['click_here_to_refresh'] = 'Hier klicken, um erneut zu prüfen';

View File

@@ -1,37 +1,65 @@
@charset "UTF-8"; @charset "UTF-8";
/* RESET */ /* RESET */
html,body,div,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,fieldset,input { margin:0; padding:0; } html, body, div, ul, ol, li, dl, dt, dd, h1, h2, h3, h4, h5, h6, pre,
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th { font-size:1em; font-weight:400; font-style:normal; } form, p, blockquote, fieldset, input {
ul,ol { list-style:none; } margin: 0;
fieldset,img { border:none; } padding: 0;
caption,th { text-align:left; } }
table { border-collapse:collapse; border-spacing:0; }
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section { display:block; } h1, h2, h3, h4, h5, h6, pre, code, address, caption, cite, code, em,
strong, th {
font-size: 1em;
font-weight: 400;
font-style: normal;
}
ul, ol {
list-style: none;
}
fieldset, img {
border: none;
}
caption, th {
text-align: left;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
article, aside, details, figcaption, figure, footer, header, hgroup,
menu, nav, section {
display: block;
}
/* TYPE */ /* TYPE */
html,body { html, body {
font:12px/18px 'Lucida Grande','Lucida Sans Unicode',Helvetica,Arial,Verdana,sans-serif; font: 12px/18px 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial,
Verdana, sans-serif;
background-color: #f5f5f5; background-color: #f5f5f5;
color:#444; color: #444;
-webkit-font-smoothing: subpixel-antialiased; -webkit-font-smoothing: subpixel-antialiased;
} }
body { body {
margin:0; margin: 0;
padding:0; padding: 0;
} }
.dark { .dark {
background-color: #e9edf0; background-color: #e9edf0;
border-bottom:1px solid #d1d5d8; border-bottom: 1px solid #d1d5d8;
} }
header img { header img {
padding:10px 0 10px 10px; padding: 10px 0 10px 10px;
} }
h1 { h1 {
display:none; display: none;
} }
h2, h3 { h2, h3 {
@@ -41,21 +69,20 @@ h2, h3 {
} }
h2 { h2 {
font-size:17px; font-size: 17px;
} }
h3 { h3 {
font-size: 15px; font-size: 15px;
} }
img { img {
border:0; border: 0;
vertical-align:middle; vertical-align: middle;
} }
td a { td a {
text-decoration:none; text-decoration: none;
} }
.bradius { .bradius {
@@ -65,19 +92,19 @@ td a {
/* FOOTER */ /* FOOTER */
footer { footer {
clear:both; clear: both;
text-align:center; text-align: center;
color: #888; color: #888;
font-size:10px !important; font-size: 10px !important;
margin: 10px 0; margin: 10px 0;
} }
footer a,footer a:active,footer a:visited { footer a, footer a:active, footer a:visited {
color: #888; color: #888;
} }
.install { .install {
background-color:#fff; background-color: #fff;
margin: 20px auto 12px; margin: 20px auto 12px;
width: 800px; width: 800px;
} }
@@ -87,14 +114,14 @@ p {
} }
.installsec { .installsec {
margin-top:10px; margin-top: 10px;
padding:0; padding: 0;
text-align:left; text-align: left;
} }
.installsec table { .installsec table {
width:100%; width: 100%;
padding:0 10px; padding: 0 10px;
margin: 15px 0 15px 0; margin: 15px 0 15px 0;
} }
@@ -106,46 +133,46 @@ p {
} }
.installsec form { .installsec form {
width:800px; width: 800px;
margin:0 auto; margin: 0 auto;
padding:10px 0 0; padding: 10px 0 0;
text-align:left; text-align: left;
} }
.installsec fieldset { .installsec fieldset {
border:0; border: 0;
float:left; float: left;
clear:left; clear: left;
width:600px; width: 600px;
margin:0 100px 10px; margin: 0 100px 10px;
padding:0; padding: 0;
} }
.installsec fieldset p, .installsec fieldset h3{ .installsec fieldset p, .installsec fieldset h3 {
clear: both; clear: both;
} }
.installsec legend { .installsec legend {
display:none; display: none;
} }
.installsec label { .installsec label {
float:left; float: left;
margin-right:0; margin-right: 0;
margin-top:8px; margin-top: 8px;
text-align:left; text-align: left;
} }
p.submit { p.submit {
text-align:right; text-align: right;
padding-right:46px; padding-right: 46px;
} }
.installsec aside { .installsec aside {
border-top:1px solid #d1d5d8; border-top: 1px solid #d1d5d8;
clear:both; clear: both;
float:none; float: none;
width:auto; width: auto;
text-align: right; text-align: right;
padding: 10px; padding: 10px;
} }
@@ -153,140 +180,143 @@ p.submit {
.line { .line {
border: 0; border: 0;
width: 800px; width: 800px;
border-bottom:1px solid #d1d5d8; border-bottom: 1px solid #d1d5d8;
} }
.messagewrapper { .messagewrapper {
width:650px; width: 650px;
margin:0 auto; margin: 0 auto;
padding:120px 0 0; padding: 120px 0 0;
overflow:hidden; overflow: hidden;
} }
.messagewrapperfull { .messagewrapperfull {
width:100%; width: 100%;
margin:0 auto; margin: 0 auto;
padding:0; padding: 0;
overflow:hidden; overflow: hidden;
} }
.overviewsearch { .overviewsearch {
position:absolute; position: absolute;
top:155px; top: 155px;
right:36px; right: 36px;
font-size:80%; font-size: 80%;
} }
.overviewadd { .overviewadd {
padding:10px; padding: 10px;
font-weight:700; font-weight: 700;
} }
/* /*
* error message display * error message display
*/ */
.errorcontainer { .errorcontainer {
background:url(../img/icons/error_big.png) 10px center no-repeat #ffedef; background: url(../img/icons/error_big.png) 10px center no-repeat
border:1px solid #ffc2ca; #ffedef;
padding:10px 10px 10px 68px!important; border: 1px solid #ffc2ca;
padding: 10px 10px 10px 68px !important;
margin: 10px 0 10px 0 !important; margin: 10px 0 10px 0 !important;
text-align:left!important; text-align: left !important;
overflow:hidden; overflow: hidden;
box-shadow: 0 0 0 black; box-shadow: 0 0 0 black;
} }
.errortitle { .errortitle {
font-weight:700; font-weight: 700;
color:#c00!important; color: #c00 !important;
} }
.error { .error {
font-weight:400!important; font-weight: 400 !important;
color:#c00!important; color: #c00 !important;
} }
/* /*
* warning message display * warning message display
*/ */
.warningcontainer,.ui-dialog { .warningcontainer, .ui-dialog {
background:url(../img/icons/warning_big.png) 10px center no-repeat #fffecc; background: url(../img/icons/warning_big.png) 10px center no-repeat
border:1px solid #f3c37e; #fffecc;
padding:10px 10px 10px 68px !important; border: 1px solid #f3c37e;
padding: 10px 10px 10px 68px !important;
margin: 10px 0 10px 0 !important; margin: 10px 0 10px 0 !important;
text-align:left!important; text-align: left !important;
overflow:hidden; overflow: hidden;
box-shadow: 0 0 0 black; box-shadow: 0 0 0 black;
} }
.ui-dialog { .ui-dialog {
padding: 10px !important; padding: 10px !important;
} }
.warningtitle,.ui-dialog-titlebar { .warningtitle, .ui-dialog-titlebar {
font-weight:700; font-weight: 700;
color:#D57D00; color: #D57D00;
} }
.warning,.ui-dialog-content { .warning, .ui-dialog-content {
color:#D57D00!important; color: #D57D00 !important;
} }
/* /*
* success message display * success message display
*/ */
.successcontainer { .successcontainer {
background:url(../img/icons/ok_big.png) 10px center no-repeat #E2F9E3; background: url(../img/icons/ok_big.png) 10px center no-repeat #E2F9E3;
border:1px solid #9C9; border: 1px solid #9C9;
padding:10px 10px 10px 68px!important; padding: 10px 10px 10px 68px !important;
margin: 10px 0 10px 0 !important; margin: 10px 0 10px 0 !important;
text-align:left!important; text-align: left !important;
overflow:hidden; overflow: hidden;
box-shadow: 0 0 0 black; box-shadow: 0 0 0 black;
} }
.successtitle { .successtitle {
font-weight:700; font-weight: 700;
color:#060!important; color: #060 !important;
} }
.success { .success {
font-weight:400!important; font-weight: 400 !important;
} }
/* /*
* neutral/info message display * neutral/info message display
*/ */
.neutralcontainer { .neutralcontainer {
background:url(../img/icons/info_big.png) 10px center no-repeat #d2eaf6; background: url(../img/icons/info_big.png) 10px center no-repeat #d2eaf6;
border:1px solid #b7d8ed; border: 1px solid #b7d8ed;
padding:10px 10px 10px 68px!important; padding: 10px 10px 10px 68px !important;
margin: 10px 0 10px 0 !important; margin: 10px 0 10px 0 !important;
text-align:left!important; text-align: left !important;
overflow:hidden; overflow: hidden;
box-shadow: 0 0 0 black; box-shadow: 0 0 0 black;
} }
.neutraltitle { .neutraltitle {
font-weight:700; font-weight: 700;
color:#3188c1!important; color: #3188c1 !important;
} }
.neutral { .neutral {
font-weight:400!important; font-weight: 400 !important;
color:#3188c1!important; color: #3188c1 !important;
} }
/* std hyperlink */ /* std hyperlink */
a,a:active,a:visited { a, a:active, a:visited {
color:#176fa1; color: #176fa1;
text-decoration:none; text-decoration: none;
} }
a:hover { a:hover {
text-decoration:underline; text-decoration: underline;
} }
.infotext { .infotext {
font-size:11px; font-size: 11px;
} }
/* /*
@@ -294,28 +324,28 @@ a:hover {
*/ */
.main { .main {
margin: 105px 10px 0 240px; margin: 105px 10px 0 240px;
background-color:#fff; background-color: #fff;
padding: 30px 30px 30px 30px; padding: 30px 30px 30px 30px;
min-height:400px; min-height: 400px;
} }
.noborder { .noborder {
width:100%; width: 100%;
border-spacing:0; border-spacing: 0;
border-collapse:separate; border-collapse: separate;
border: 0; border: 0;
} }
.noborder td { .noborder td {
border:0; border: 0;
} }
table { table {
width:100%; width: 100%;
border-spacing:0; border-spacing: 0;
border:1px solid #d1d5d8; border: 1px solid #d1d5d8;
border-collapse:separate; border-collapse: separate;
box-shadow:0 0 0 black !important; box-shadow: 0 0 0 black !important;
} }
table thead th, table th { table thead th, table th {
@@ -326,6 +356,7 @@ table thead th, table th {
background-color: #e9edf0; background-color: #e9edf0;
font-weight: bold; font-weight: bold;
} }
table thead:first-child th, table:first-child th { table thead:first-child th, table:first-child th {
border-top: none !important; border-top: none !important;
} }
@@ -333,16 +364,21 @@ table thead:first-child th, table:first-child th {
table th { table th {
border-top: 0; border-top: 0;
} }
th a:hover { th a:hover {
text-decoration: none; text-decoration: none;
} }
th a img { th a img {
} }
th a:nth-child(odd) img { th a:nth-child(odd) img {
position: relative; position: relative;
top: -5px; top: -5px;
left: 4px; left: 4px;
} }
th a:nth-child(even) img { th a:nth-child(even) img {
position: relative; position: relative;
top: 3px; top: 3px;
@@ -358,33 +394,34 @@ table thead:first-child th {
} }
table tbody td { table tbody td {
border-bottom:1px dotted #ccc; border-bottom: 1px dotted #ccc;
} }
table tbody tr:last-child td { table tbody tr:last-child td {
border-bottom: 0; border-bottom: 0;
} }
.formtable { .formtable {
width: 100%; width: 100%;
border-spacing:0; border-spacing: 0;
border:0; border: 0;
border-collapse:separate; border-collapse: separate;
margin:0 0 0; margin: 0 0 0;
} }
.formtable tbody td { .formtable tbody td {
border:0; border: 0;
border-bottom:1px dotted #ccc; border-bottom: 1px dotted #ccc;
min-height: 20px; min-height: 20px;
} }
.formtable label { .formtable label {
float:none; float: none;
display:block; display: block;
padding:0; padding: 0;
margin:0; margin: 0;
width:100%; width: 100%;
text-align:left; text-align: left;
} }
td { td {
@@ -393,47 +430,47 @@ td {
} }
table tfoot td { table tfoot td {
height:25px; height: 25px;
border-top: 1px solid #d1d5d8; border-top: 1px solid #d1d5d8;
background-color: #f2f8fa; background-color: #f2f8fa;
} }
.tfootleft { .tfootleft {
text-align:left; text-align: left;
} }
.maintitle { .maintitle {
padding-top:20px; padding-top: 20px;
} }
/* input elements */ /* input elements */
input { input {
background: #fff url(../img/text_align_left.png) no-repeat 5px 4px; background: #fff url(../img/text_align_left.png) no-repeat 5px 4px;
color: #333; color: #333;
padding:2px 4px 2px 24px; padding: 2px 4px 2px 24px;
height:22px; height: 22px;
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
margin-bottom: 5px; margin-bottom: 5px;
border-radius: 3px; border-radius: 3px;
} }
textarea { textarea {
background:#fff url(../img/text_align_left.png) no-repeat 5px 4px; background: #fff url(../img/text_align_left.png) no-repeat 5px 4px;
color: #333; color: #333;
padding:4px 4px 2px 24px; padding: 4px 4px 2px 24px;
border:1px solid #d9d9d9; border: 1px solid #d9d9d9;
margin-bottom: 5px; margin-bottom: 5px;
border-radius: 3px; border-radius: 3px;
} }
input[type="password"] { input[type="password"] {
background:#fff url(../img/password.png) no-repeat 5px 4px; background: #fff url(../img/password.png) no-repeat 5px 4px;
} }
/* /*
* BUTTONS * BUTTONS
*/ */
input[type="button"],input[type="submit"],input[type="reset"] { input[type="button"], input[type="submit"], input[type="reset"] {
margin: 0 5px; margin: 0 5px;
padding: 5px 14px; padding: 5px 14px;
outline: 0; outline: 0;
@@ -443,45 +480,56 @@ input[type="button"],input[type="submit"],input[type="reset"] {
height: 26px; height: 26px;
background-image: none; background-image: none;
} }
.loginsec input[type="button"], .loginsec input[type="submit"], .loginsec input[type="reset"] {
.loginsec input[type="button"], .loginsec input[type="submit"],
.loginsec input[type="reset"] {
margin: 0 1px; margin: 0 1px;
} }
input[type="button"]:hover,input[type="submit"]:hover,input[type="reset"]:hover {
color: #333; input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover
background-color: #dcdcdc; {
color: #333;
background-color: #dcdcdc;
} }
input[type="button"]:active,input[type="submit"]:active,input[type="reset"]:active {
-webkit-box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25); input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active
-moz-box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25); {
box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25); -webkit-box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25);
color: white !important; -moz-box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25);
box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25);
color: white !important;
} }
input[type="submit"],input[class="yesbutton"] {
color: white; input[type="submit"], input[class="yesbutton"] {
background-color: #35aa47;
}
input[type="submit"]:hover,input[class="yesbutton"]:hover {
color: white; color: white;
background-color: #1d943b;
}
input[class="submit"]:active,input[class="yesbutton"]:active {
background-color: #35aa47; background-color: #35aa47;
} }
input[class="nobutton"],input[type="reset"] {
color: white; input[type="submit"]:hover, input[class="yesbutton"]:hover {
background-color: #d84a38;
}
input[class="nobutton"]:hover,input[type="reset"]:hover {
color: white; color: white;
background-color: #c53727; background-color: #1d943b;
}
input[class="nobutton"]:active,input[type="reset"]:active {
background-color: #dd4b39;
} }
input[class="submit"]:active, input[class="yesbutton"]:active {
background-color: #35aa47;
}
input[class="nobutton"], input[type="reset"] {
color: white;
background-color: #d84a38;
}
input[class="nobutton"]:hover, input[type="reset"]:hover {
color: white;
background-color: #c53727;
}
input[class="nobutton"]:active, input[type="reset"]:active {
background-color: #dd4b39;
}
input[type="checkbox"] { input[type="checkbox"] {
background:#dae7ee; background: #dae7ee;
padding: 0; padding: 0;
margin: 0 5px 0 0; margin: 0 5px 0 0;
vertical-align: middle; vertical-align: middle;
@@ -491,72 +539,99 @@ input[type="checkbox"] {
input[type="radio"] { input[type="radio"] {
vertical-align: middle; vertical-align: middle;
margin: 0 10px 0 10px; margin: 0 10px 0 10px;
height:22px; height: 22px;
} }
select { select {
background:#fff; background: #fff;
padding:4px; padding: 4px;
color: #333; color: #333;
border:1px solid #d9d9d9; border: 1px solid #d9d9d9;
margin-bottom: 5px; margin-bottom: 5px;
min-width: 100px; min-width: 100px;
} }
select.dropdown { select.dropdown {
padding: 2px 4px 2px 24px; padding: 2px 4px 2px 24px;
height: 26px; height: 26px;
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
margin-bottom: 5px; margin-bottom: 5px;
border-radius: 3px; border-radius: 3px;
background: url(../../../../templates/Sparkle/assets/img/icons/down.png) no-repeat 9px; background: url(../../../../templates/Sparkle/assets/img/icons/down.png)
no-repeat 9px;
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
appearance: none; appearance: none;
} }
.maintable { .maintable {
width:90%; width: 90%;
} }
.update_progess { .update_progess {
padding:2em; padding: 2em;
text-align:left; text-align: left;
} }
.preconfig { .preconfig {
text-align:left; text-align: left;
margin-top:20px; margin-top: 20px;
margin-bottom:5px; margin-bottom: 5px;
margin-right:15px; margin-right: 15px;
margin-left:15px; margin-left: 15px;
} }
.preconfigitem { .preconfigitem {
padding:.15em; padding: .15em;
border-bottom:1px solid #ccc; border-bottom: 1px solid #ccc;
} }
.preconfdesc { .preconfdesc {
display:block; display: block;
margin-bottom:.5em; margin-bottom: .5em;
font-size:120%; font-size: 120%;
}
.installprogress {
width: 100%;
background-color:#e4e4e4;
height:5px;
border-bottom:1px solid #d1d5d8;
}
.installprogress .bar {
background-color: #35aa47;
height:5px;
} }
.red { color: #ff0000; } .installprogress {
.green { color: green; } width: 100%;
.orange { color: orange; } background-color: #e4e4e4;
.blue { color: blue; } height: 5px;
.install-block { width: 65%; } border-bottom: 1px solid #d1d5d8;
.install-step { width: 250px; } }
.install-h3 { text-align: center; }
.install-text { margin: 20px 20px 0 !important; } .installprogress .bar {
background-color: #35aa47;
height: 5px;
}
.red {
color: #ff0000;
}
.green {
color: green;
}
.orange {
color: orange;
}
.blue {
color: blue;
}
.install-block {
width: 65%;
}
.install-step {
width: 250px;
}
.install-h3 {
text-align: center;
}
.install-text {
margin: 20px 20px 0 !important;
}

View File

@@ -3,6 +3,7 @@ namespace Froxlor\Api\Commands;
use Froxlor\Database as Database; use Froxlor\Database as Database;
use Froxlor\Settings as Settings; use Froxlor\Settings as Settings;
/** /**
* This file is part of the Froxlor project. * This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors). * Copyright (c) 2010 the Froxlor Team (see authors).
@@ -11,12 +12,12 @@ use Froxlor\Settings as Settings;
* file that was distributed with this source code. You can also view the * file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* *
* @copyright (c) the authors * @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-) * @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package API * @package API
* @since 0.10.0 * @since 0.10.0
* *
*/ */
class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity
{ {

View File

@@ -3,7 +3,6 @@ namespace Froxlor\Api\Commands;
use Froxlor\Database as Database; use Froxlor\Database as Database;
/** /**
* This file is part of the Froxlor project. * This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors). * Copyright (c) 2010 the Froxlor Team (see authors).

View File

@@ -3,6 +3,7 @@ namespace Froxlor\Api\Commands;
use Froxlor\Database as Database; use Froxlor\Database as Database;
use Froxlor\Settings as Settings; use Froxlor\Settings as Settings;
/** /**
* This file is part of the Froxlor project. * This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors). * Copyright (c) 2010 the Froxlor Team (see authors).
@@ -11,12 +12,12 @@ use Froxlor\Settings as Settings;
* file that was distributed with this source code. You can also view the * file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* *
* @copyright (c) the authors * @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-) * @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package API * @package API
* @since 0.10.0 * @since 0.10.0
* *
*/ */
class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity
{ {

View File

@@ -1,5 +1,4 @@
<?php <?php
namespace Froxlor\Cli; namespace Froxlor\Cli;
/** /**
@@ -16,7 +15,6 @@ namespace Froxlor\Cli;
* @package Cron * @package Cron
* *
*/ */
class ConfigServicesCmd extends CmdLineHandler class ConfigServicesCmd extends CmdLineHandler
{ {

View File

@@ -2,7 +2,7 @@
namespace Froxlor\Cron\Http; namespace Froxlor\Cron\Http;
use Froxlor\Database\Database; use Froxlor\Database\Database;
use \Froxlor\Settings; use Froxlor\Settings;
use Froxlor\Cron\Http\Php\Fpm; use Froxlor\Cron\Http\Php\Fpm;
use Froxlor\Cron\Http\Php\PhpInterface; use Froxlor\Cron\Http\Php\PhpInterface;

View File

@@ -2,7 +2,7 @@
namespace Froxlor\Cron\Http; namespace Froxlor\Cron\Http;
use Froxlor\Database\Database; use Froxlor\Database\Database;
use \Froxlor\Settings; use Froxlor\Settings;
use Froxlor\Cron\Http\Php\PhpInterface; use Froxlor\Cron\Http\Php\PhpInterface;
/** /**
@@ -14,27 +14,25 @@ use Froxlor\Cron\Http\Php\PhpInterface;
* file that was distributed with this source code. You can also view the * file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* *
* @copyright (c) the authors * @copyright (c) the authors
* @author Florian Lippert <flo@syscp.org> (2003-2009) * @author Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-) * @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron * @package Cron
* *
*/ */
class ApacheFcgi extends Apache class ApacheFcgi extends Apache
{ {
protected function composePhpOptions($domain, $ssl_vhost = false) protected function composePhpOptions($domain, $ssl_vhost = false)
{ {
$php_options_text = ''; $php_options_text = '';
if($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
{
$php = new PhpInterface($domain); $php = new PhpInterface($domain);
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']); $phpconfig = $php->getPhpConfig((int) $domain['phpsettingid']);
if((int)Settings::Get('phpfpm.enabled') == 1) if ((int) Settings::Get('phpfpm.enabled') == 1) {
{
$srvName = 'fpm.external'; $srvName = 'fpm.external';
if ($domain['ssl'] == 1 && $ssl_vhost) { if ($domain['ssl'] == 1 && $ssl_vhost) {
$srvName = 'ssl-fpm.external'; $srvName = 'ssl-fpm.external';
@@ -42,116 +40,107 @@ class ApacheFcgi extends Apache
// #1317 - perl is executed via apache and therefore, when using fpm, does not know the user // #1317 - perl is executed via apache and therefore, when using fpm, does not know the user
// which perl is supposed to run as, hence the need for Suexec need // which perl is supposed to run as, hence the need for Suexec need
if (customerHasPerlEnabled($domain['customerid'])) { if (customerHasPerlEnabled($domain['customerid'])) {
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n"; $php_options_text .= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
} }
// mod_proxy stuff for apache-2.4 // mod_proxy stuff for apache-2.4
if (Settings::Get('system.apache24') == '1' if (Settings::Get('system.apache24') == '1' && Settings::Get('phpfpm.use_mod_proxy') == '1') {
&& Settings::Get('phpfpm.use_mod_proxy') == '1'
) {
$filesmatch = $phpconfig['fpm_settings']['limit_extensions']; $filesmatch = $phpconfig['fpm_settings']['limit_extensions'];
$extensions = explode(" ", $filesmatch); $extensions = explode(" ", $filesmatch);
$filesmatch = ""; $filesmatch = "";
foreach ($extensions as $ext) { foreach ($extensions as $ext) {
$filesmatch .= substr($ext, 1).'|'; $filesmatch .= substr($ext, 1) . '|';
} }
// start block, cut off last pipe and close block // start block, cut off last pipe and close block
$filesmatch = '('.str_replace(".", "\.", substr($filesmatch, 0, -1)).')'; $filesmatch = '(' . str_replace(".", "\.", substr($filesmatch, 0, - 1)) . ')';
$php_options_text.= ' <FilesMatch \.'.$filesmatch.'$>'. "\n"; $php_options_text .= ' <FilesMatch \.' . $filesmatch . '$>' . "\n";
$php_options_text.= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost'. "\n"; $php_options_text .= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost' . "\n";
$php_options_text.= ' </FilesMatch>' . "\n"; $php_options_text .= ' </FilesMatch>' . "\n";
$mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']); $mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']);
// only create the require all granted if there is not active directory-protection // only create the require all granted if there is not active directory-protection
// for this path, as this would be the first require and therefore grant all access // for this path, as this would be the first require and therefore grant all access
if ($mypath_dir->isUserProtected() == false) { if ($mypath_dir->isUserProtected() == false) {
$php_options_text.= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n"; $php_options_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
if ($phpconfig['pass_authorizationheader'] == '1') { if ($phpconfig['pass_authorizationheader'] == '1') {
$php_options_text.= ' CGIPassAuth On' . "\n"; $php_options_text .= ' CGIPassAuth On' . "\n";
} }
$php_options_text.= ' Require all granted' . "\n"; $php_options_text .= ' Require all granted' . "\n";
$php_options_text.= ' AllowOverride All' . "\n"; $php_options_text .= ' AllowOverride All' . "\n";
$php_options_text.= ' </Directory>' . "\n"; $php_options_text .= ' </Directory>' . "\n";
} elseif ($phpconfig['pass_authorizationheader'] == '1') { } elseif ($phpconfig['pass_authorizationheader'] == '1') {
// allow Pass of Authorization header // allow Pass of Authorization header
$php_options_text.= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n"; $php_options_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
$php_options_text.= ' CGIPassAuth On' . "\n"; $php_options_text .= ' CGIPassAuth On' . "\n";
$php_options_text.= ' </Directory>' . "\n"; $php_options_text .= ' </Directory>' . "\n";
} }
} else { } else {
$addheader = ""; $addheader = "";
if ($phpconfig['pass_authorizationheader'] == '1') { if ($phpconfig['pass_authorizationheader'] == '1') {
$addheader = " -pass-header Authorization"; $addheader = " -pass-header Authorization";
} }
$php_options_text.= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $phpconfig['fpm_settings']['idle_timeout'] . $addheader . "\n"; $php_options_text .= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $phpconfig['fpm_settings']['idle_timeout'] . $addheader . "\n";
$php_options_text.= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n"; $php_options_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
$filesmatch = $phpconfig['fpm_settings']['limit_extensions']; $filesmatch = $phpconfig['fpm_settings']['limit_extensions'];
$extensions = explode(" ", $filesmatch); $extensions = explode(" ", $filesmatch);
$filesmatch = ""; $filesmatch = "";
foreach ($extensions as $ext) { foreach ($extensions as $ext) {
$filesmatch .= substr($ext, 1).'|'; $filesmatch .= substr($ext, 1) . '|';
} }
// start block, cut off last pipe and close block // start block, cut off last pipe and close block
$filesmatch = '('.str_replace(".", "\.", substr($filesmatch, 0, -1)).')'; $filesmatch = '(' . str_replace(".", "\.", substr($filesmatch, 0, - 1)) . ')';
$php_options_text.= ' <FilesMatch \.'.$filesmatch.'$>'. "\n"; $php_options_text .= ' <FilesMatch \.' . $filesmatch . '$>' . "\n";
$php_options_text.= ' SetHandler php-fastcgi'. "\n"; $php_options_text .= ' SetHandler php-fastcgi' . "\n";
$php_options_text.= ' Action php-fastcgi /fastcgiphp' . "\n"; $php_options_text .= ' Action php-fastcgi /fastcgiphp' . "\n";
$php_options_text.= ' Options +ExecCGI' . "\n"; $php_options_text .= ' Options +ExecCGI' . "\n";
$php_options_text.= ' </FilesMatch>' . "\n"; $php_options_text .= ' </FilesMatch>' . "\n";
// >=apache-2.4 enabled? // >=apache-2.4 enabled?
if (Settings::Get('system.apache24') == '1') { if (Settings::Get('system.apache24') == '1') {
$mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']); $mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']);
// only create the require all granted if there is not active directory-protection // only create the require all granted if there is not active directory-protection
// for this path, as this would be the first require and therefore grant all access // for this path, as this would be the first require and therefore grant all access
if ($mypath_dir->isUserProtected() == false) { if ($mypath_dir->isUserProtected() == false) {
$php_options_text.= ' Require all granted' . "\n"; $php_options_text .= ' Require all granted' . "\n";
$php_options_text.= ' AllowOverride All' . "\n"; $php_options_text .= ' AllowOverride All' . "\n";
} }
} else { } else {
$php_options_text.= ' Order allow,deny' . "\n"; $php_options_text .= ' Order allow,deny' . "\n";
$php_options_text.= ' allow from all' . "\n"; $php_options_text .= ' allow from all' . "\n";
} }
$php_options_text.= ' </Directory>' . "\n"; $php_options_text .= ' </Directory>' . "\n";
$php_options_text.= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . $srvName . "\n"; $php_options_text .= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . $srvName . "\n";
} }
} } else {
else $php_options_text .= ' FcgidIdleTimeout ' . Settings::Get('system.mod_fcgid_idle_timeout') . "\n";
{ if ((int) Settings::Get('system.mod_fcgid_wrapper') == 0) {
$php_options_text.= ' FcgidIdleTimeout ' . Settings::Get('system.mod_fcgid_idle_timeout') . "\n"; $php_options_text .= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
if((int)Settings::Get('system.mod_fcgid_wrapper') == 0) $php_options_text .= ' ScriptAlias /php/ ' . $php->getInterface()->getConfigDir() . "\n";
{ } else {
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n"; $php_options_text .= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
$php_options_text.= ' ScriptAlias /php/ ' . $php->getInterface()->getConfigDir() . "\n"; $php_options_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
}
else
{
$php_options_text.= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
$php_options_text.= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir($domain['documentroot']) . '">' . "\n";
$file_extensions = explode(' ', $phpconfig['file_extensions']); $file_extensions = explode(' ', $phpconfig['file_extensions']);
$php_options_text.= ' <FilesMatch "\.(' . implode('|', $file_extensions) . ')$">' . "\n"; $php_options_text .= ' <FilesMatch "\.(' . implode('|', $file_extensions) . ')$">' . "\n";
$php_options_text.= ' SetHandler fcgid-script' . "\n"; $php_options_text .= ' SetHandler fcgid-script' . "\n";
foreach($file_extensions as $file_extension) foreach ($file_extensions as $file_extension) {
{ $php_options_text .= ' FcgidWrapper ' . $php->getInterface()->getStarterFile() . ' .' . $file_extension . "\n";
$php_options_text.= ' FcgidWrapper ' . $php->getInterface()->getStarterFile() . ' .' . $file_extension . "\n";
} }
$php_options_text.= ' Options +ExecCGI' . "\n"; $php_options_text .= ' Options +ExecCGI' . "\n";
$php_options_text.= ' </FilesMatch>' . "\n"; $php_options_text .= ' </FilesMatch>' . "\n";
// >=apache-2.4 enabled? // >=apache-2.4 enabled?
if (Settings::Get('system.apache24') == '1') { if (Settings::Get('system.apache24') == '1') {
$mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']); $mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']);
// only create the require all granted if there is not active directory-protection // only create the require all granted if there is not active directory-protection
// for this path, as this would be the first require and therefore grant all access // for this path, as this would be the first require and therefore grant all access
if ($mypath_dir->isUserProtected() == false) { if ($mypath_dir->isUserProtected() == false) {
$php_options_text.= ' Require all granted' . "\n"; $php_options_text .= ' Require all granted' . "\n";
$php_options_text.= ' AllowOverride All' . "\n"; $php_options_text .= ' AllowOverride All' . "\n";
} }
} else { } else {
$php_options_text.= ' Order allow,deny' . "\n"; $php_options_text .= ' Order allow,deny' . "\n";
$php_options_text.= ' allow from all' . "\n"; $php_options_text .= ' allow from all' . "\n";
} }
$php_options_text.= ' </Directory>' . "\n"; $php_options_text .= ' </Directory>' . "\n";
} }
} }
@@ -161,10 +150,8 @@ class ApacheFcgi extends Apache
// create php.ini (fpm does nothing here, as it // create php.ini (fpm does nothing here, as it
// defines ini-settings in its pool config) // defines ini-settings in its pool config)
$php->getInterface()->createIniFile($phpconfig); $php->getInterface()->createIniFile($phpconfig);
} } else {
else $php_options_text .= ' # PHP is disabled for this vHost' . "\n";
{
$php_options_text.= ' # PHP is disabled for this vHost' . "\n";
} }
return $php_options_text; return $php_options_text;
@@ -172,23 +159,16 @@ class ApacheFcgi extends Apache
public function createOwnVhostStarter() public function createOwnVhostStarter()
{ {
if (Settings::Get('system.mod_fcgid_ownvhost') == '1' if (Settings::Get('system.mod_fcgid_ownvhost') == '1' || (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.enabled_ownvhost') == '1')) {
|| (Settings::Get('phpfpm.enabled') == '1'
&& Settings::Get('phpfpm.enabled_ownvhost') == '1')
) {
$mypath = \Froxlor\Froxlor::getInstallDir(); $mypath = \Froxlor\Froxlor::getInstallDir();
if (Settings::Get('system.mod_fcgid_ownvhost') == '1') if (Settings::Get('system.mod_fcgid_ownvhost') == '1') {
{
$user = Settings::Get('system.mod_fcgid_httpuser'); $user = Settings::Get('system.mod_fcgid_httpuser');
$group = Settings::Get('system.mod_fcgid_httpgroup'); $group = Settings::Get('system.mod_fcgid_httpgroup');
} } elseif (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.enabled_ownvhost') == '1') {
elseif(Settings::Get('phpfpm.enabled') == '1'
&& Settings::Get('phpfpm.enabled_ownvhost') == '1'
) {
$user = Settings::Get('phpfpm.vhost_httpuser'); $user = Settings::Get('phpfpm.vhost_httpuser');
$group = Settings::Get('phpfpm.vhost_httpgroup'); $group = Settings::Get('phpfpm.vhost_httpgroup');
// get fpm config // get fpm config
$fpm_sel_stmt = Database::prepare(" $fpm_sel_stmt = Database::prepare("
SELECT f.id FROM `" . TABLE_PANEL_FPMDAEMONS . "` f SELECT f.id FROM `" . TABLE_PANEL_FPMDAEMONS . "` f
@@ -204,8 +184,8 @@ class ApacheFcgi extends Apache
'id' => 'none', 'id' => 'none',
'domain' => Settings::Get('system.hostname'), 'domain' => Settings::Get('system.hostname'),
'adminid' => 1, /* first admin-user (superadmin) */ 'adminid' => 1, /* first admin-user (superadmin) */
'mod_fcgid_starter' => -1, 'mod_fcgid_starter' => - 1,
'mod_fcgid_maxrequests' => -1, 'mod_fcgid_maxrequests' => - 1,
'guid' => $user, 'guid' => $user,
'openbasedir' => 0, 'openbasedir' => 0,
'email' => Settings::Get('panel.adminmail'), 'email' => Settings::Get('panel.adminmail'),

View File

@@ -1,4 +1,7 @@
<?php if (!defined('MASTER_CRONJOB')) die('You cannot access this file directly!'); <?php
if (! defined('MASTER_CRONJOB'))
die('You cannot access this file directly!');
/** /**
* This file is part of the Froxlor project. * This file is part of the Froxlor project.
@@ -8,17 +11,16 @@
* file that was distributed with this source code. You can also view the * file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* *
* @copyright (c) the authors * @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-) * @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron * @package Cron
* *
*/ */
use \Froxlor\Database; use Froxlor\Database;
use \Froxlor\Settings; use Froxlor\Settings;
if ((int)Settings::Get('system.report_webmax') > 0) if ((int) Settings::Get('system.report_webmax') > 0) {
{
/** /**
* report about diskusage for customers * report about diskusage for customers
*/ */
@@ -34,11 +36,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if (isset($row['diskspace']) if (isset($row['diskspace']) && $row['diskspace_used'] != null && $row['diskspace_used'] > 0 && (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int) Settings::Get('system.report_webmax')) {
&& $row['diskspace_used'] != null
&& $row['diskspace_used'] > 0
&& (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int)Settings::Get('system.report_webmax')
) {
$rep_userinfo = array( $rep_userinfo = array(
'name' => $row['name'], 'name' => $row['name'],
@@ -58,12 +56,16 @@ if ((int)Settings::Get('system.report_webmax') > 0)
SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "` SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
WHERE `language` = :deflang WHERE `language` = :deflang
"); ");
$lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => $row['def_language'])); $lngfile = Database::pexecute_first($lngfile_stmt, array(
'deflang' => $row['def_language']
));
if ($lngfile !== null) { if ($lngfile !== null) {
$langfile = $lngfile['file']; $langfile = $lngfile['file'];
} else { } else {
$lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => Settings::Get('panel.standardlanguage'))); $lngfile = Database::pexecute_first($lngfile_stmt, array(
'deflang' => Settings::Get('panel.standardlanguage')
));
$langfile = $lngfile['file']; $langfile = $lngfile['file'];
} }
@@ -99,7 +101,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
$mail->MsgHTML(nl2br($mail_body)); $mail->MsgHTML(nl2br($mail_body));
$mail->AddAddress($row['email'], $row['name']); $mail->AddAddress($row['email'], $row['name']);
$mail->Send(); $mail->Send();
} catch(\PHPMailer\PHPMailer\Exception $e) { } catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage(); $mailerr_msg = $e->errorMessage();
$_mailerror = true; $_mailerror = true;
} catch (Exception $e) { } catch (Exception $e) {
@@ -117,7 +119,9 @@ if ((int)Settings::Get('system.report_webmax') > 0)
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `reportsent` = '2' UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `reportsent` = '2'
WHERE `customerid` = :customerid WHERE `customerid` = :customerid
"); ");
Database::pexecute($upd_stmt, array('customerid' => $row['customerid'])); Database::pexecute($upd_stmt, array(
'customerid' => $row['customerid']
));
} }
} }
@@ -130,11 +134,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if (isset($row['diskspace']) if (isset($row['diskspace']) && $row['diskspace_used'] != null && $row['diskspace_used'] > 0 && (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int) Settings::Get('system.report_webmax')) {
&& $row['diskspace_used'] != null
&& $row['diskspace_used'] > 0
&& (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int)Settings::Get('system.report_webmax')
) {
$replace_arr = array( $replace_arr = array(
'NAME' => $row['name'], 'NAME' => $row['name'],
@@ -148,12 +148,16 @@ if ((int)Settings::Get('system.report_webmax') > 0)
SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "` SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
WHERE `language` = :deflang WHERE `language` = :deflang
"); ");
$lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => $row['def_language'])); $lngfile = Database::pexecute_first($lngfile_stmt, array(
'deflang' => $row['def_language']
));
if ($lngfile !== null) { if ($lngfile !== null) {
$langfile = $lngfile['file']; $langfile = $lngfile['file'];
} else { } else {
$lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => Settings::Get('panel.standardlanguage'))); $lngfile = Database::pexecute_first($lngfile_stmt, array(
'deflang' => Settings::Get('panel.standardlanguage')
));
$langfile = $lngfile['file']; $langfile = $lngfile['file'];
} }
@@ -189,7 +193,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
$mail->MsgHTML(nl2br($mail_body)); $mail->MsgHTML(nl2br($mail_body));
$mail->AddAddress($row['email'], $row['name']); $mail->AddAddress($row['email'], $row['name']);
$mail->Send(); $mail->Send();
} catch(\PHPMailer\PHPMailer\Exception $e) { } catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage(); $mailerr_msg = $e->errorMessage();
$_mailerror = true; $_mailerror = true;
} catch (Exception $e) { } catch (Exception $e) {
@@ -207,7 +211,9 @@ if ((int)Settings::Get('system.report_webmax') > 0)
UPDATE `" . TABLE_PANEL_ADMINS . "` SET `reportsent` = '2' UPDATE `" . TABLE_PANEL_ADMINS . "` SET `reportsent` = '2'
WHERE `adminid` = :adminid WHERE `adminid` = :adminid
"); ");
Database::pexecute($upd_stmt, array('adminid' => $row['adminid'])); Database::pexecute($upd_stmt, array(
'adminid' => $row['adminid']
));
} }
} }
} // webmax > 0 } // webmax > 0

View File

@@ -70,8 +70,9 @@ class FroxlorLogger
/** /**
* return FroxlorLogger instance * return FroxlorLogger instance
* *
* @param array $userinfo unused * @param array $userinfo
* * unused
*
* @return FroxlorLogger * @return FroxlorLogger
*/ */
public static function getInstanceOf($userinfo = null) public static function getInstanceOf($userinfo = null)

View File

@@ -5,33 +5,38 @@ use Froxlor\Settings;
class Statistics class Statistics
{ {
/** /**
* Create or modify the AWStats configuration file for the given domain. * Create or modify the AWStats configuration file for the given domain.
* Modified by Berend Dekens to allow custom configurations. * Modified by Berend Dekens to allow custom configurations.
* *
* @param logFile * @param
* @param siteDomain * logFile
* @param hostAliases * @param
* siteDomain
* @param
* hostAliases
* @return null * @return null
*/ */
public static function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot, $awstats_params = array()) { public static function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot, $awstats_params = array())
{
// Generation header // Generation header
$header = "## GENERATED BY FROXLOR\n"; $header = "## GENERATED BY FROXLOR\n";
$header2 = "## Do not remove the line above! This tells Froxlor to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure Froxlor won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n"; $header2 = "## Do not remove the line above! This tells Froxlor to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure Froxlor won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n";
$awstats_dir = \Froxlor\FileDir::makeCorrectDir($customerDocroot.'/awstats/'.$siteDomain.'/'); $awstats_dir = \Froxlor\FileDir::makeCorrectDir($customerDocroot . '/awstats/' . $siteDomain . '/');
if (!is_dir($awstats_dir)) { if (! is_dir($awstats_dir)) {
\Froxlor\FileDir::safe_exec('mkdir -p '.escapeshellarg($awstats_dir)); \Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($awstats_dir));
} }
// chown created folder, #258 // chown created folder, #258
self::makeChownWithNewStats($awstats_params); self::makeChownWithNewStats($awstats_params);
// weird but could happen... // weird but could happen...
if (!is_dir(Settings::Get('system.awstats_conf'))) { if (! is_dir(Settings::Get('system.awstats_conf'))) {
\Froxlor\FileDir::safe_exec('mkdir -p '.escapeshellarg(Settings::Get('system.awstats_conf'))); \Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(Settings::Get('system.awstats_conf')));
} }
// These are the variables we will replace // These are the variables we will replace
$regex = array( $regex = array(
'/\{LOG_FILE\}/', '/\{LOG_FILE\}/',
@@ -47,82 +52,78 @@ class Statistics
$awstats_dir, $awstats_dir,
\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_conf')) \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_conf'))
); );
// File names // File names
$domain_file = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.' . $siteDomain . '.conf'); $domain_file = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.awstats_conf') . '/awstats.' . $siteDomain . '.conf');
$model_file = \Froxlor\Froxlor::getInstallDir().'/templates/misc/awstats/awstats.froxlor.model.conf'; $model_file = \Froxlor\Froxlor::getInstallDir() . '/templates/misc/awstats/awstats.froxlor.model.conf';
$model_file = \Froxlor\FileDir::makeCorrectFile($model_file); $model_file = \Froxlor\FileDir::makeCorrectFile($model_file);
// Test if the file exists // Test if the file exists
if (file_exists($domain_file)) { if (file_exists($domain_file)) {
// Check for the generated header - if this is a manual modification we won't update // Check for the generated header - if this is a manual modification we won't update
$awstats_domain_conf = fopen($domain_file, 'r'); $awstats_domain_conf = fopen($domain_file, 'r');
if (fgets($awstats_domain_conf, strlen($header)) != $header) { if (fgets($awstats_domain_conf, strlen($header)) != $header) {
fclose($awstats_domain_conf); fclose($awstats_domain_conf);
return; return;
} }
// Close the file // Close the file
fclose($awstats_domain_conf); fclose($awstats_domain_conf);
} }
$awstats_domain_conf = fopen($domain_file, 'w'); $awstats_domain_conf = fopen($domain_file, 'w');
$awstats_model_conf = fopen($model_file, 'r'); $awstats_model_conf = fopen($model_file, 'r');
// Write the header // Write the header
fwrite($awstats_domain_conf, $header); fwrite($awstats_domain_conf, $header);
fwrite($awstats_domain_conf, preg_replace($regex, $replace, $header2)); fwrite($awstats_domain_conf, preg_replace($regex, $replace, $header2));
// Write the configuration file // Write the configuration file
while (($line = fgets($awstats_model_conf, 4096)) !== false) { while (($line = fgets($awstats_model_conf, 4096)) !== false) {
if (!preg_match('/^#/', $line) if (! preg_match('/^#/', $line) && trim($line) != '') {
&& trim($line) != '' fwrite($awstats_domain_conf, preg_replace($regex, $replace, $line));
) { }
fwrite($awstats_domain_conf, preg_replace($regex, $replace, $line));
}
} }
fclose($awstats_domain_conf); fclose($awstats_domain_conf);
fclose($awstats_model_conf); fclose($awstats_model_conf);
} }
/** /**
* chowns either awstats or webalizer folder, * chowns either awstats or webalizer folder,
* either with webserver-user or - if fcgid * either with webserver-user or - if fcgid
* is used - the customers name, #258 * is used - the customers name, #258
* *
* @param array $row array if panel_customers * @param array $row
* * array if panel_customers
*
* @return void * @return void
*/ */
public static function makeChownWithNewStats($row) { public static function makeChownWithNewStats($row)
{
// get correct user // get correct user
if ((Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') if ((Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') && isset($row['deactivated']) && $row['deactivated'] == '0') {
&& isset($row['deactivated']) $user = $row['loginname'];
&& $row['deactivated'] == '0' $group = $row['loginname'];
) { } else {
$user = $row['loginname']; $user = $row['guid'];
$group = $row['loginname']; $group = $row['guid'];
} else { }
$user = $row['guid'];
$group = $row['guid']; // get correct directory
} $dir = $row['documentroot'];
if (Settings::Get('system.awstats_enabled') == '1') {
// get correct directory $dir .= '/awstats/';
$dir = $row['documentroot']; } else {
if (Settings::Get('system.awstats_enabled') == '1') { $dir .= '/webalizer/';
$dir .= '/awstats/'; }
} else {
$dir .= '/webalizer/'; // only run chown if directory exists
} if (file_exists($dir)) {
// run chown
// only run chown if directory exists \Froxlor\FileDir::safe_exec('chown -R ' . escapeshellarg($user) . ':' . escapeshellarg($group) . ' ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
if (file_exists($dir)) { }
// run chown
\Froxlor\FileDir::safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
}
} }
} }

View File

@@ -1,10 +1,8 @@
<?php <?php
namespace Froxlor; namespace Froxlor;
use Froxlor\Database\Database; use Froxlor\Database\Database;
/** /**
* This file is part of the Froxlor project. * This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors). * Copyright (c) 2010 the Froxlor Team (see authors).
@@ -13,14 +11,14 @@ use Froxlor\Database\Database;
* file that was distributed with this source code. You can also view the * file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* *
* @copyright (c) the authors * @copyright (c) the authors
* @author Michael Kaufmann <mkaufmann@nutime.de> * @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-) * @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes * @package Classes
* *
* @since 0.9.31 * @since 0.9.31
* *
*/ */
/** /**
@@ -28,12 +26,12 @@ use Froxlor\Database\Database;
* *
* Interaction with settings from the db * Interaction with settings from the db
* *
* @copyright (c) the authors * @copyright (c) the authors
* @author Michael Kaufmann <mkaufmann@nutime.de> * @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-) * @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes * @package Classes
* *
* @method static mixed Get ($setting = null) return a setting-value by its group and varname separated by a dot (group.varname) * @method static mixed Get ($setting = null) return a setting-value by its group and varname separated by a dot (group.varname)
* @method static boolean Set ($setting = null, $value = null, $instant_save = true) update a setting / set a new value * @method static boolean Set ($setting = null, $value = null, $instant_save = true) update a setting / set a new value
* @method static boolean IsInList ($setting = null, $entry = null) tests if a setting-value that i s a comma separated list contains an entry * @method static boolean IsInList ($setting = null, $entry = null) tests if a setting-value that i s a comma separated list contains an entry
@@ -41,7 +39,8 @@ use Froxlor\Database\Database;
* @method static boolean Flush () Store all un-saved changes to the database and re-read in all settings * @method static boolean Flush () Store all un-saved changes to the database and re-read in all settings
* @method static void Stash () forget all un-saved changes to settings * @method static void Stash () forget all un-saved changes to settings
*/ */
class Settings { class Settings
{
/** /**
* current settings object * current settings object
@@ -75,12 +74,13 @@ class Settings {
/** /**
* private constructor, reads in all settings * private constructor, reads in all settings
*/ */
private function __construct() { private function __construct()
{
$this->_readSettings(); $this->_readSettings();
self::$_updatedata = array(); self::$_updatedata = array();
// prepare statement // prepare statement
self::$_updstmt = Database::prepare(" self::$_updstmt = Database::prepare("
UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = :value UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = :value
WHERE `settinggroup` = :group AND `varname` = :varname WHERE `settinggroup` = :group AND `varname` = :varname
"); ");
} }
@@ -89,7 +89,8 @@ class Settings {
* Read in all settings from the database * Read in all settings from the database
* and set the internal $_data array * and set the internal $_data array
*/ */
private function _readSettings() { private function _readSettings()
{
$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 . "`
@@ -108,11 +109,12 @@ class Settings {
* @param string $varname * @param string $varname
* @param string $value * @param string $value
*/ */
private function _storeSetting($group = null, $varname = null, $value = null) { private function _storeSetting($group = null, $varname = null, $value = null)
{
$upd_data = array( $upd_data = array(
'group' => $group, 'group' => $group,
'varname' => $varname, 'varname' => $varname,
'value' => $value 'value' => $value
); );
Database::pexecute(self::$_updstmt, $upd_data); Database::pexecute(self::$_updstmt, $upd_data);
} }
@@ -120,14 +122,16 @@ class Settings {
/** /**
* return a setting-value by its group and varname * return a setting-value by its group and varname
* *
* @param string $setting a group and a varname separated by a dot (group.varname) * @param string $setting
* * a group and a varname separated by a dot (group.varname)
*
* @return mixed * @return mixed
*/ */
public function pGet($setting = null) { public function pGet($setting = null)
{
$sstr = explode(".", $setting); $sstr = explode(".", $setting);
// no separator - do'h // no separator - do'h
if (!isset($sstr[1])) { if (! isset($sstr[1])) {
return null; return null;
} }
$result = null; $result = null;
@@ -140,35 +144,40 @@ class Settings {
/** /**
* tests if a setting-value that i s a comma separated list contains an entry * tests if a setting-value that i s a comma separated list contains an entry
* *
* @param string $setting a group and a varname separated by a dot (group.varname) * @param string $setting
* @param string $entry the entry that is expected to be in the list * a group and a varname separated by a dot (group.varname)
* * @param string $entry
* the entry that is expected to be in the list
*
* @return boolean true, if the list contains $entry * @return boolean true, if the list contains $entry
*/ */
public function pIsInList($setting = null, $entry = null) { public function pIsInList($setting = null, $entry = null)
$s=Settings::Get($setting); {
if ($s==null) { $s = Settings::Get($setting);
if ($s == null) {
return false; return false;
} }
$slist = explode(",",$s); $slist = explode(",", $s);
return in_array($entry, $slist); return in_array($entry, $slist);
} }
/** /**
* update a setting / set a new value * update a setting / set a new value
* *
* @param string $setting a group and a varname separated by a dot (group.varname) * @param string $setting
* a group and a varname separated by a dot (group.varname)
* @param string $value * @param string $value
* @param boolean $instant_save * @param boolean $instant_save
* *
* @return bool * @return bool
*/ */
public function pSet($setting = null, $value = null, $instant_save = true) { public function pSet($setting = null, $value = null, $instant_save = true)
{
// check whether the setting exists // check whether the setting exists
if (Settings::Get($setting) !== null) { if (Settings::Get($setting) !== null) {
// set new value in array // set new value in array
$sstr = explode(".", $setting); $sstr = explode(".", $setting);
if (!isset($sstr[1])) { if (! isset($sstr[1])) {
return false; return false;
} }
self::$_data[$sstr[0]][$sstr[1]] = $value; self::$_data[$sstr[0]][$sstr[1]] = $value;
@@ -177,12 +186,12 @@ class Settings {
$this->_storeSetting($sstr[0], $sstr[1], $value); $this->_storeSetting($sstr[0], $sstr[1], $value);
} else { } else {
// set temporary data for usage // set temporary data for usage
if (!isset(self::$_data[$sstr[0]]) || !is_array(self::$_data[$sstr[0]])) { if (! isset(self::$_data[$sstr[0]]) || ! is_array(self::$_data[$sstr[0]])) {
self::$_data[$sstr[0]] = array(); self::$_data[$sstr[0]] = array();
} }
self::$_data[$sstr[0]][$sstr[1]] = $value; self::$_data[$sstr[0]][$sstr[1]] = $value;
// set update-data when invoking Flush() // set update-data when invoking Flush()
if (!isset(self::$_updatedata[$sstr[0]]) || !is_array(self::$_updatedata[$sstr[0]])) { if (! isset(self::$_updatedata[$sstr[0]]) || ! is_array(self::$_updatedata[$sstr[0]])) {
self::$_updatedata[$sstr[0]] = array(); self::$_updatedata[$sstr[0]] = array();
} }
self::$_updatedata[$sstr[0]][$sstr[1]] = $value; self::$_updatedata[$sstr[0]][$sstr[1]] = $value;
@@ -195,31 +204,33 @@ class Settings {
/** /**
* add a new setting to the database (mainly used in updater) * add a new setting to the database (mainly used in updater)
* *
* @param string $setting a group and a varname separated by a dot (group.varname) * @param string $setting
* a group and a varname separated by a dot (group.varname)
* @param string $value * @param string $value
* *
* @return boolean * @return boolean
*/ */
public function pAddNew($setting = null, $value = null) { public function pAddNew($setting = null, $value = null)
{
// first check if it doesn't exist // first check if it doesn't exist
if (Settings::Get($setting) === null) { if (Settings::Get($setting) === null) {
// validate parameter // validate parameter
$sstr = explode(".", $setting); $sstr = explode(".", $setting);
if (!isset($sstr[1])) { if (! isset($sstr[1])) {
return false; return false;
} }
// prepare statement // prepare statement
$ins_stmt = Database::prepare(" $ins_stmt = Database::prepare("
INSERT INTO `".TABLE_PANEL_SETTINGS."` SET INSERT INTO `" . TABLE_PANEL_SETTINGS . "` SET
`settinggroup` = :group, `settinggroup` = :group,
`varname` = :varname, `varname` = :varname,
`value` = :value `value` = :value
"); ");
$ins_data = array( $ins_data = array(
'group' => $sstr[0], 'group' => $sstr[0],
'varname' => $sstr[1], 'varname' => $sstr[1],
'value' => $value 'value' => $value
); );
Database::pexecute($ins_stmt, $ins_data); Database::pexecute($ins_stmt, $ins_data);
// also set new value to internal array and make it available // also set new value to internal array and make it available
@@ -233,7 +244,8 @@ class Settings {
* Store all un-saved changes to the database and * Store all un-saved changes to the database and
* re-read in all settings * re-read in all settings
*/ */
public function pFlush() { public function pFlush()
{
if (is_array(self::$_updatedata) && count(self::$_updatedata) > 0) { if (is_array(self::$_updatedata) && count(self::$_updatedata) > 0) {
// save all un-saved changes to the settings // save all un-saved changes to the settings
foreach (self::$_updatedata as $group => $vargroup) { foreach (self::$_updatedata as $group => $vargroup) {
@@ -252,7 +264,8 @@ class Settings {
/** /**
* forget all un-saved changes to settings * forget all un-saved changes to settings
*/ */
public function pStash() { public function pStash()
{
// empty update array // empty update array
self::$_updatedata = array(); self::$_updatedata = array();
} }
@@ -262,7 +275,8 @@ class Settings {
* *
* @return object * @return object
*/ */
private static function getInstance() { private static function getInstance()
{
// do we got an object already? // do we got an object already?
if (self::$_obj == null) { if (self::$_obj == null) {
self::$_obj = new self(); self::$_obj = new self();
@@ -280,12 +294,16 @@ class Settings {
* *
* @return mixed * @return mixed
*/ */
public static function __callStatic($name, $args) { public static function __callStatic($name, $args)
{
// as our functions are not static and therefore cannot // as our functions are not static and therefore cannot
// be called statically, we prefix a 'p' to all of // be called statically, we prefix a 'p' to all of
// our public functions so we can use Settings::functionname() // our public functions so we can use Settings::functionname()
// which looks cooler and is easier to use // which looks cooler and is easier to use
$callback = array(self::getInstance(), "p".$name); $callback = array(
self::getInstance(),
"p" . $name
);
$result = call_user_func_array($callback, $args); $result = call_user_func_array($callback, $args);
return $result; return $result;
} }

View File

@@ -13,7 +13,7 @@ class Cronjob
* Checks if the system's last guid is not higher than the one saved * Checks if the system's last guid is not higher than the one saved
* in froxlor's database. If it's higher, froxlor needs to * in froxlor's database. If it's higher, froxlor needs to
* set its last guid to this one to avoid conflicts with libnss-users * set its last guid to this one to avoid conflicts with libnss-users
* *
* @return null * @return null
*/ */
public static function checkLastGuid() public static function checkLastGuid()

View File

@@ -137,7 +137,7 @@ class Crypt
return $available_pwdhashes; return $available_pwdhashes;
} }
/** /**
* Function validatePassword * Function validatePassword
* *
@@ -145,78 +145,37 @@ class Crypt
* we check against the length, if not matched * we check against the length, if not matched
* an error message will be output and 'exit' is called * an error message will be output and 'exit' is called
* *
* @param string $password the password to validate * @param string $password
* * the password to validate
*
* @return string either the password or an errormessage+exit * @return string either the password or an errormessage+exit
*/ */
public static function validatePassword($password = null, $json_response = false) { public static function validatePassword($password = null, $json_response = false)
{
if (Settings::Get('panel.password_min_length') > 0) { if (Settings::Get('panel.password_min_length') > 0) {
$password = validate( $password = validate($password, Settings::Get('panel.password_min_length'), '/^.{' . (int) Settings::Get('panel.password_min_length') . ',}$/D', 'notrequiredpasswordlength', array(), $json_response);
$password,
Settings::Get('panel.password_min_length'),
'/^.{'.(int)Settings::Get('panel.password_min_length').',}$/D',
'notrequiredpasswordlength',
array(),
$json_response
);
} }
if (Settings::Get('panel.password_regex') != '') { if (Settings::Get('panel.password_regex') != '') {
$password = validate( $password = validate($password, Settings::Get('panel.password_regex'), Settings::Get('panel.password_regex'), 'notrequiredpasswordcomplexity', array(), $json_response);
$password,
Settings::Get('panel.password_regex'),
Settings::Get('panel.password_regex'),
'notrequiredpasswordcomplexity',
array(),
$json_response
);
} else { } else {
if (Settings::Get('panel.password_alpha_lower')) { if (Settings::Get('panel.password_alpha_lower')) {
$password = validate( $password = validate($password, '/.*[a-z]+.*/', '/.*[a-z]+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
$password,
'/.*[a-z]+.*/',
'/.*[a-z]+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
} }
if (Settings::Get('panel.password_alpha_upper')) { if (Settings::Get('panel.password_alpha_upper')) {
$password = validate( $password = validate($password, '/.*[A-Z]+.*/', '/.*[A-Z]+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
$password,
'/.*[A-Z]+.*/',
'/.*[A-Z]+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
} }
if (Settings::Get('panel.password_numeric')) { if (Settings::Get('panel.password_numeric')) {
$password = validate( $password = validate($password, '/.*[0-9]+.*/', '/.*[0-9]+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
$password,
'/.*[0-9]+.*/',
'/.*[0-9]+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
} }
if (Settings::Get('panel.password_special_char_required')) { if (Settings::Get('panel.password_special_char_required')) {
$password = validate( $password = validate($password, '/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/', '/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
$password,
'/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/',
'/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
} }
} }
return $password; return $password;
} }
/** /**
* Function validatePasswordLogin * Function validatePasswordLogin
* *
@@ -225,22 +184,26 @@ class Crypt
* additionally it updates the hash if the system settings changed * additionally it updates the hash if the system settings changed
* or if the very old md5() sum is used * or if the very old md5() sum is used
* *
* @param array $userinfo user-data from table * @param array $userinfo
* @param string $password the password to validate * user-data from table
* @param string $table either panel_customers or panel_admins * @param string $password
* @param string $uid user-id-field in $table * the password to validate
* * @param string $table
* either panel_customers or panel_admins
* @param string $uid
* user-id-field in $table
*
* @return boolean * @return boolean
*/ */
public static function validatePasswordLogin($userinfo = null, $password = null, $table = 'panel_customers', $uid = 'customerid') { public static function validatePasswordLogin($userinfo = null, $password = null, $table = 'panel_customers', $uid = 'customerid')
{
$systype = 3; // SHA256 $systype = 3; // SHA256
if (Settings::Get('system.passwordcryptfunc') !== null) { if (Settings::Get('system.passwordcryptfunc') !== null) {
$systype = (int)Settings::Get('system.passwordcryptfunc'); $systype = (int) Settings::Get('system.passwordcryptfunc');
} }
$pwd_hash = $userinfo['password']; $pwd_hash = $userinfo['password'];
$update_hash = false; $update_hash = false;
// check for good'ole md5 // check for good'ole md5
if (strlen($pwd_hash) == 32 && ctype_xdigit($pwd_hash)) { if (strlen($pwd_hash) == 32 && ctype_xdigit($pwd_hash)) {
@@ -254,34 +217,31 @@ class Crypt
// check whether the hash needs to be updated // check whether the hash needs to be updated
$hash_type_chk = substr($pwd_hash, 0, 3); $hash_type_chk = substr($pwd_hash, 0, 3);
if (($systype == 1 && $hash_type_chk != '$1$') || // MD5 if (($systype == 1 && $hash_type_chk != '$1$') || // MD5
($systype == 2 && $hash_type_chk != '$2$') || // BLOWFISH ($systype == 2 && $hash_type_chk != '$2$') || // BLOWFISH
($systype == 3 && $hash_type_chk != '$5$') || // SHA256 ($systype == 3 && $hash_type_chk != '$5$') || // SHA256
($systype == 4 && $hash_type_chk != '$6$') // SHA512 ($systype == 4 && $hash_type_chk != '$6$')) // SHA512
) { {
$update_hash = true; $update_hash = true;
} }
} }
if ($pwd_hash == $pwd_check) { if ($pwd_hash == $pwd_check) {
// check for update of hash (only if our database is ready to handle the bigger string) // check for update of hash (only if our database is ready to handle the bigger string)
$is_ready = (version_compare2("0.9.33", \Froxlor\Froxlor::getVersion()) <= 0 ? true : false); $is_ready = (version_compare2("0.9.33", \Froxlor\Froxlor::getVersion()) <= 0 ? true : false);
if ($update_hash && $is_ready) { if ($update_hash && $is_ready) {
$upd_stmt = \Froxlor\Database\Database::prepare(" $upd_stmt = \Froxlor\Database\Database::prepare("
UPDATE " . $table . " SET `password` = :newpasswd WHERE `" . $uid . "` = :uid UPDATE " . $table . " SET `password` = :newpasswd WHERE `" . $uid . "` = :uid
"); ");
$params = array ( $params = array(
'newpasswd' => self::makeCryptPassword($password), 'newpasswd' => self::makeCryptPassword($password),
'uid' => $userinfo[$uid] 'uid' => $userinfo[$uid]
); );
\Froxlor\Database\Database::pexecute($upd_stmt, $params); \Froxlor\Database\Database::pexecute($upd_stmt, $params);
} }
return true; return true;
} }
return false; return false;
} }
} }

View File

@@ -9,20 +9,22 @@ namespace Froxlor\UI;
* file that was distributed with this source code. You can also view the * file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
* *
* @copyright (c) the authors * @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-) * @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes * @package Classes
* *
*/ */
class HtmlForm class HtmlForm
{ {
/** /**
* internal tmp-variable to store form * internal tmp-variable to store form
*
* @var string * @var string
*/ */
private static $_form = ''; private static $_form = '';
private static $_filename = ''; private static $_filename = '';
public static function genHTMLForm($data = array()) public static function genHTMLForm($data = array())
@@ -32,46 +34,43 @@ class HtmlForm
self::$_form = ''; self::$_form = '';
foreach($data as $fdata) foreach ($data as $fdata) {
{
$sections = $fdata['sections']; $sections = $fdata['sections'];
foreach($sections as $section) foreach ($sections as $section) {
{
/* /*
* here be section title & image * here be section title & image
*/ */
$title = $section['title']; $title = $section['title'];
$image = $section['image']; $image = $section['image'];
if(isset($section['visible']) && $section['visible'] === false) if (isset($section['visible']) && $section['visible'] === false) {
{
continue; continue;
} }
if (!isset($section['nobuttons']) || $section['nobuttons'] == false) { if (! isset($section['nobuttons']) || $section['nobuttons'] == false) {
eval("self::\$_form .= \"" . Template::getTemplate("misc/form/table_section", "1") . "\";"); eval("self::\$_form .= \"" . Template::getTemplate("misc/form/table_section", "1") . "\";");
} else { } else {
$nob = true; $nob = true;
} }
$nexto = false; $nexto = false;
foreach($section['fields'] as $fieldname => $fielddata) foreach ($section['fields'] as $fieldname => $fielddata) {
{ if (isset($fielddata['visible']) && $fielddata['visible'] === false) {
if(isset($fielddata['visible']) && $fielddata['visible'] === false)
{
continue; continue;
} }
if ($nexto === false || (isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to'])) { if ($nexto === false || (isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to'])) {
$label = $fielddata['label']; $label = $fielddata['label'];
$desc = (isset($fielddata['desc']) ? $fielddata['desc'] : ''); $desc = (isset($fielddata['desc']) ? $fielddata['desc'] : '');
$style = (isset($fielddata['style']) ? ' class="'.$fielddata['style'].'"' : ''); $style = (isset($fielddata['style']) ? ' class="' . $fielddata['style'] . '"' : '');
$mandatory = self::_getMandatoryFlag($fielddata); $mandatory = self::_getMandatoryFlag($fielddata);
$data_field = self::_parseDataField($fieldname, $fielddata); $data_field = self::_parseDataField($fieldname, $fielddata);
if (isset($fielddata['has_nextto'])) { if (isset($fielddata['has_nextto'])) {
$nexto = array('field' => $fieldname); $nexto = array(
$data_field.='{NEXTTOFIELD_'.$fieldname.'}'; 'field' => $fieldname
);
$data_field .= '{NEXTTOFIELD_' . $fieldname . '}';
} else { } else {
$nexto = false; $nexto = false;
} }
@@ -79,12 +78,8 @@ class HtmlForm
} else { } else {
$data_field = self::_parseDataField($fieldname, $fielddata); $data_field = self::_parseDataField($fieldname, $fielddata);
$data_field = str_replace("\t", "", $data_field); $data_field = str_replace("\t", "", $data_field);
$data_field = $fielddata['next_to_prefix'].$data_field; $data_field = $fielddata['next_to_prefix'] . $data_field;
self::$_form = str_replace( self::$_form = str_replace('{NEXTTOFIELD_' . $fielddata['next_to'] . '}', $data_field, self::$_form);
'{NEXTTOFIELD_'.$fielddata['next_to'].'}',
$data_field,
self::$_form
);
$nexto = false; $nexto = false;
} }
} }
@@ -92,7 +87,7 @@ class HtmlForm
} }
// add save/reset buttons at the end of the form // add save/reset buttons at the end of the form
if (!$nob) { if (! $nob) {
eval("self::\$_form .= \"" . Template::getTemplate("misc/form/table_end", "1") . "\";"); eval("self::\$_form .= \"" . Template::getTemplate("misc/form/table_end", "1") . "\";");
} }
@@ -101,41 +96,48 @@ class HtmlForm
private static function _parseDataField($fieldname, $data = array()) private static function _parseDataField($fieldname, $data = array())
{ {
switch($data['type']) switch ($data['type']) {
{
case 'text': case 'text':
return self::_textBox($fieldname, $data); break; return self::_textBox($fieldname, $data);
break;
case 'textul': case 'textul':
return self::_textBox($fieldname, $data, 'text', true); break; return self::_textBox($fieldname, $data, 'text', true);
break;
case 'password': case 'password':
return self::_textBox($fieldname, $data, 'password'); break; return self::_textBox($fieldname, $data, 'password');
break;
case 'hidden': case 'hidden':
return self::_textBox($fieldname, $data, 'hidden'); break; return self::_textBox($fieldname, $data, 'hidden');
break;
case 'yesno': case 'yesno':
return self::_yesnoBox($data); break; return self::_yesnoBox($data);
break;
case 'select': case 'select':
return self::_selectBox($fieldname, $data); break; return self::_selectBox($fieldname, $data);
break;
case 'label': case 'label':
return self::_labelField($data); break; return self::_labelField($data);
break;
case 'textarea': case 'textarea':
return self::_textArea($fieldname, $data); break; return self::_textArea($fieldname, $data);
break;
case 'checkbox': case 'checkbox':
return self::_checkbox($fieldname, $data); break; return self::_checkbox($fieldname, $data);
break;
case 'file': case 'file':
return self::_file($fieldname, $data); break; return self::_file($fieldname, $data);
break;
case 'int': case 'int':
return self::_int($fieldname, $data); break; return self::_int($fieldname, $data);
break;
} }
} }
private static function _getMandatoryFlag($data = array()) private static function _getMandatoryFlag($data = array())
{ {
if(isset($data['mandatory'])) if (isset($data['mandatory'])) {
{
return '&nbsp;<span class="red">*</span>'; return '&nbsp;<span class="red">*</span>';
} } elseif (isset($data['mandatory_ex'])) {
elseif(isset($data['mandatory_ex']))
{
return '&nbsp;<span class="red">**</span>'; return '&nbsp;<span class="red">**</span>';
} }
return ''; return '';
@@ -145,14 +147,14 @@ class HtmlForm
{ {
$return = ''; $return = '';
$extras = ''; $extras = '';
if(isset($data['maxlength'])) { if (isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"'; $extras .= ' maxlength="' . $data['maxlength'] . '"';
} }
if(isset($data['size'])) { if (isset($data['size'])) {
$extras .= ' size="'.$data['size'].'"'; $extras .= ' size="' . $data['size'] . '"';
} }
if(isset($data['autocomplete'])) { if (isset($data['autocomplete'])) {
$extras .= ' autocomplete="'.$data['autocomplete'].'"'; $extras .= ' autocomplete="' . $data['autocomplete'] . '"';
} }
// add support to save reloaded forms // add support to save reloaded forms
@@ -164,10 +166,9 @@ class HtmlForm
$value = ''; $value = '';
} }
$ulfield = ($unlimited == true ? '&nbsp;'.$data['ul_field'] : ''); $ulfield = ($unlimited == true ? '&nbsp;' . $data['ul_field'] : '');
if(isset($data['display']) && $data['display'] != '') if (isset($data['display']) && $data['display'] != '') {
{ $ulfield = '<strong>' . $data['display'] . '</strong>';
$ulfield = '<strong>'.$data['display'].'</strong>';
} }
eval("\$return = \"" . Template::getTemplate("misc/form/input_text", "1") . "\";"); eval("\$return = \"" . Template::getTemplate("misc/form/input_text", "1") . "\";");
@@ -178,11 +179,11 @@ class HtmlForm
{ {
$return = ''; $return = '';
$extras = ''; $extras = '';
if(isset($data['cols'])) { if (isset($data['cols'])) {
$extras .= ' cols="'.$data['cols'].'"'; $extras .= ' cols="' . $data['cols'] . '"';
} }
if(isset($data['rows'])) { if (isset($data['rows'])) {
$extras .= ' rows="'.$data['rows'].'"'; $extras .= ' rows="' . $data['rows'] . '"';
} }
// add support to save reloaded forms // add support to save reloaded forms
@@ -221,12 +222,10 @@ class HtmlForm
} }
return '<select return '<select
id="'.$fieldname.'" id="' . $fieldname . '"
name="'.$fieldname.'" name="' . $fieldname . '"
'.(isset($data['class']) ? ' class="'.$data['class'] .'" ' : '').' ' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . '
>' >' . $select_var . '</select>';
.$select_var.
'</select>';
} }
/** /**
@@ -234,32 +233,36 @@ class HtmlForm
* *
* <code> * <code>
* $data = array( * $data = array(
* 'label' => $lng['customer']['email_imap'], * 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox', * 'type' => 'checkbox',
* 'values' => array( * 'values' => array(
* array( 'label' => 'active', * array( 'label' => 'active',
* 'value' => '1' * 'value' => '1'
* ) * )
* ), * ),
* 'value' => array('1'), * 'value' => array('1'),
* 'mandatory' => true * 'mandatory' => true
* ) * )
* </code> * </code>
* *
* @param string $fieldname contains the fieldname * @param string $fieldname
* @param array $data contains the data array * contains the fieldname
* @param array $data
* contains the data array
*/ */
public static function _checkbox($fieldname = '', $data = array()) { public static function _checkbox($fieldname = '', $data = array())
{
// $data['value'] contains checked items // $data['value'] contains checked items
$checked = array(); $checked = array();
if (isset($data['value'])) { if (isset($data['value'])) {
$checked = $data['value']; $checked = $data['value'];
} }
if (isset($_SESSION['requestData'])) { if (isset($_SESSION['requestData'])) {
if(isset($_SESSION['requestData'][$fieldname])) { if (isset($_SESSION['requestData'][$fieldname])) {
$checked = array($_SESSION['requestData'][$fieldname]); $checked = array(
$_SESSION['requestData'][$fieldname]
);
} }
} }
@@ -272,12 +275,12 @@ class HtmlForm
// will contain the output // will contain the output
$output = ""; $output = "";
foreach($data['values'] as $val) { foreach ($data['values'] as $val) {
$key = $val['label']; $key = $val['label'];
// is this box checked? // is this box checked?
$isChecked = ''; $isChecked = '';
if (is_array($checked) && count($checked) > 0) { if (is_array($checked) && count($checked) > 0) {
foreach($checked as $tmp) { foreach ($checked as $tmp) {
if ($tmp == $val['value']) { if ($tmp == $val['value']) {
$isChecked = ' checked="checked" '; $isChecked = ' checked="checked" ';
break; break;
@@ -286,10 +289,10 @@ class HtmlForm
} }
$output .= '<label>'; $output .= '<label>';
if (empty($isArray)) { if (empty($isArray)) {
$output .= '<input type="hidden" name="'.$fieldname.'" value="0" />'; $output .= '<input type="hidden" name="' . $fieldname . '" value="0" />';
} }
$output .= '<input type="checkbox" name="'.$fieldname.$isArray.'" value="'.$val['value'].'" '.$isChecked.'/>'; $output .= '<input type="checkbox" name="' . $fieldname . $isArray . '" value="' . $val['value'] . '" ' . $isChecked . '/>';
$output .= $key.'</label>'; $output .= $key . '</label>';
} }
return $output; return $output;
@@ -299,8 +302,8 @@ class HtmlForm
{ {
$return = ''; $return = '';
$extras = ''; $extras = '';
if(isset($data['maxlength'])) { if (isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"'; $extras .= ' maxlength="' . $data['maxlength'] . '"';
} }
// add support to save reloaded forms // add support to save reloaded forms
@@ -312,9 +315,8 @@ class HtmlForm
$value = ''; $value = '';
} }
if(isset($data['display']) && $data['display'] != '') if (isset($data['display']) && $data['display'] != '') {
{ $ulfield = '<strong>' . $data['display'] . '</strong>';
$ulfield = '<strong>'.$data['display'].'</strong>';
} }
eval("\$return = \"" . Template::getTemplate("misc/form/input_file", "1") . "\";"); eval("\$return = \"" . Template::getTemplate("misc/form/input_file", "1") . "\";");
@@ -325,11 +327,11 @@ class HtmlForm
{ {
$return = ''; $return = '';
$extras = ''; $extras = '';
if(isset($data['int_min'])) { if (isset($data['int_min'])) {
$extras .= ' min="'.$data['int_min'].'"'; $extras .= ' min="' . $data['int_min'] . '"';
} }
if(isset($data['int_max'])) { if (isset($data['int_max'])) {
$extras .= ' max="'.$data['int_max'].'"'; $extras .= ' max="' . $data['int_max'] . '"';
} }
// add support to save reloaded forms // add support to save reloaded forms

View File

@@ -1,7 +1,7 @@
<?php <?php
namespace Froxlor\Validate\Form; namespace Froxlor\Validate\Form;
class String class Strings
{ {
public static function validateFormFieldString($fieldname, $fielddata, $newfieldvalue) public static function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)

View File

@@ -15,7 +15,6 @@
* @package AJAX * @package AJAX
* *
*/ */
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
// Load the user settings // Load the user settings
@@ -41,12 +40,12 @@ if ($action == "newsfeed") {
} else { } else {
$feed = "https://inside.froxlor.org/news/"; $feed = "https://inside.froxlor.org/news/";
} }
if (function_exists("simplexml_load_file") == false) { if (function_exists("simplexml_load_file") == false) {
outputItem("Newsfeed not available due to missing php-simplexml extension", "Please install the php-simplexml extension in order to view our newsfeed."); outputItem("Newsfeed not available due to missing php-simplexml extension", "Please install the php-simplexml extension in order to view our newsfeed.");
exit(); exit();
} }
if (function_exists('curl_version')) { if (function_exists('curl_version')) {
$output = \Froxlor\Http\HttpClient::urlGet($feed); $output = \Froxlor\Http\HttpClient::urlGet($feed);
$news = simplexml_load_string(trim($output)); $news = simplexml_load_string(trim($output));
@@ -54,17 +53,17 @@ if ($action == "newsfeed") {
outputItem("Newsfeed not available due to missing php-curl extension", "Please install the php-curl extension in order to view our newsfeed."); outputItem("Newsfeed not available due to missing php-curl extension", "Please install the php-curl extension in order to view our newsfeed.");
exit(); exit();
} }
if ($news !== false) { if ($news !== false) {
for ($i = 0; $i < 3; $i ++) { for ($i = 0; $i < 3; $i ++) {
$item = $news->channel->item[$i]; $item = $news->channel->item[$i];
$title = (string) $item->title; $title = (string) $item->title;
$link = (string) $item->link; $link = (string) $item->link;
$date = date("Y-m-d G:i", strtotime($item->pubDate)); $date = date("Y-m-d G:i", strtotime($item->pubDate));
$content = preg_replace("/[\r\n]+/", " ", strip_tags($item->description)); $content = preg_replace("/[\r\n]+/", " ", strip_tags($item->description));
$content = substr($content, 0, 150) . "..."; $content = substr($content, 0, 150) . "...";
outputItem($title, $content, $link, $date); outputItem($title, $content, $link, $date);
} }
} else { } else {
@@ -80,20 +79,20 @@ function outputItem($title, $content, $link = null, $date = null)
<div class=\"newsfeed-body clearfix\"> <div class=\"newsfeed-body clearfix\">
<div class=\"header\"> <div class=\"header\">
<strong class=\"primary-font\">"; <strong class=\"primary-font\">";
if (! empty($link)) { if (! empty($link)) {
echo "<a href=\"{$link}\" target=\"_blank\">"; echo "<a href=\"{$link}\" target=\"_blank\">";
} }
echo $title; echo $title;
if (! empty($link)) { if (! empty($link)) {
echo "</a>"; echo "</a>";
} }
echo "</strong>"; echo "</strong>";
if (! empty($date)) { if (! empty($date)) {
echo "<small class=\"pull-right text-muted\"> echo "<small class=\"pull-right text-muted\">
<i class=\"fa fa-clock-o fa-fw\"></i> {$date} <i class=\"fa fa-clock-o fa-fw\"></i> {$date}
</small>"; </small>";
} }
echo "</div> echo "</div>
<p> <p>
{$content} {$content}
</p> </p>

View File

@@ -14,14 +14,16 @@
* @package Classes * @package Classes
* *
*/ */
class htmlform class htmlform
{ {
/** /**
* internal tmp-variable to store form * internal tmp-variable to store form
*
* @var string * @var string
*/ */
private static $_form = ''; private static $_form = '';
private static $_filename = ''; private static $_filename = '';
public static function genHTMLForm($data = array()) public static function genHTMLForm($data = array())
@@ -31,46 +33,43 @@ class htmlform
self::$_form = ''; self::$_form = '';
foreach($data as $fdata) foreach ($data as $fdata) {
{
$sections = $fdata['sections']; $sections = $fdata['sections'];
foreach($sections as $section) foreach ($sections as $section) {
{
/* /*
* here be section title & image * here be section title & image
*/ */
$title = $section['title']; $title = $section['title'];
$image = $section['image']; $image = $section['image'];
if(isset($section['visible']) && $section['visible'] === false) if (isset($section['visible']) && $section['visible'] === false) {
{
continue; continue;
} }
if (!isset($section['nobuttons']) || $section['nobuttons'] == false) { if (! isset($section['nobuttons']) || $section['nobuttons'] == false) {
eval("self::\$_form .= \"" . getTemplate("misc/form/table_section", "1") . "\";"); eval("self::\$_form .= \"" . getTemplate("misc/form/table_section", "1") . "\";");
} else { } else {
$nob = true; $nob = true;
} }
$nexto = false; $nexto = false;
foreach($section['fields'] as $fieldname => $fielddata) foreach ($section['fields'] as $fieldname => $fielddata) {
{ if (isset($fielddata['visible']) && $fielddata['visible'] === false) {
if(isset($fielddata['visible']) && $fielddata['visible'] === false)
{
continue; continue;
} }
if ($nexto === false || (isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to'])) { if ($nexto === false || (isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to'])) {
$label = $fielddata['label']; $label = $fielddata['label'];
$desc = (isset($fielddata['desc']) ? $fielddata['desc'] : ''); $desc = (isset($fielddata['desc']) ? $fielddata['desc'] : '');
$style = (isset($fielddata['style']) ? ' class="'.$fielddata['style'].'"' : ''); $style = (isset($fielddata['style']) ? ' class="' . $fielddata['style'] . '"' : '');
$mandatory = self::_getMandatoryFlag($fielddata); $mandatory = self::_getMandatoryFlag($fielddata);
$data_field = self::_parseDataField($fieldname, $fielddata); $data_field = self::_parseDataField($fieldname, $fielddata);
if (isset($fielddata['has_nextto'])) { if (isset($fielddata['has_nextto'])) {
$nexto = array('field' => $fieldname); $nexto = array(
$data_field.='{NEXTTOFIELD_'.$fieldname.'}'; 'field' => $fieldname
);
$data_field .= '{NEXTTOFIELD_' . $fieldname . '}';
} else { } else {
$nexto = false; $nexto = false;
} }
@@ -78,12 +77,8 @@ class htmlform
} else { } else {
$data_field = self::_parseDataField($fieldname, $fielddata); $data_field = self::_parseDataField($fieldname, $fielddata);
$data_field = str_replace("\t", "", $data_field); $data_field = str_replace("\t", "", $data_field);
$data_field = $fielddata['next_to_prefix'].$data_field; $data_field = $fielddata['next_to_prefix'] . $data_field;
self::$_form = str_replace( self::$_form = str_replace('{NEXTTOFIELD_' . $fielddata['next_to'] . '}', $data_field, self::$_form);
'{NEXTTOFIELD_'.$fielddata['next_to'].'}',
$data_field,
self::$_form
);
$nexto = false; $nexto = false;
} }
} }
@@ -91,7 +86,7 @@ class htmlform
} }
// add save/reset buttons at the end of the form // add save/reset buttons at the end of the form
if (!$nob) { if (! $nob) {
eval("self::\$_form .= \"" . getTemplate("misc/form/table_end", "1") . "\";"); eval("self::\$_form .= \"" . getTemplate("misc/form/table_end", "1") . "\";");
} }
@@ -100,41 +95,48 @@ class htmlform
private static function _parseDataField($fieldname, $data = array()) private static function _parseDataField($fieldname, $data = array())
{ {
switch($data['type']) switch ($data['type']) {
{
case 'text': case 'text':
return self::_textBox($fieldname, $data); break; return self::_textBox($fieldname, $data);
break;
case 'textul': case 'textul':
return self::_textBox($fieldname, $data, 'text', true); break; return self::_textBox($fieldname, $data, 'text', true);
break;
case 'password': case 'password':
return self::_textBox($fieldname, $data, 'password'); break; return self::_textBox($fieldname, $data, 'password');
break;
case 'hidden': case 'hidden':
return self::_textBox($fieldname, $data, 'hidden'); break; return self::_textBox($fieldname, $data, 'hidden');
break;
case 'yesno': case 'yesno':
return self::_yesnoBox($data); break; return self::_yesnoBox($data);
break;
case 'select': case 'select':
return self::_selectBox($fieldname, $data); break; return self::_selectBox($fieldname, $data);
break;
case 'label': case 'label':
return self::_labelField($data); break; return self::_labelField($data);
break;
case 'textarea': case 'textarea':
return self::_textArea($fieldname, $data); break; return self::_textArea($fieldname, $data);
break;
case 'checkbox': case 'checkbox':
return self::_checkbox($fieldname, $data); break; return self::_checkbox($fieldname, $data);
break;
case 'file': case 'file':
return self::_file($fieldname, $data); break; return self::_file($fieldname, $data);
break;
case 'int': case 'int':
return self::_int($fieldname, $data); break; return self::_int($fieldname, $data);
break;
} }
} }
private static function _getMandatoryFlag($data = array()) private static function _getMandatoryFlag($data = array())
{ {
if(isset($data['mandatory'])) if (isset($data['mandatory'])) {
{
return '&nbsp;<span class="red">*</span>'; return '&nbsp;<span class="red">*</span>';
} } elseif (isset($data['mandatory_ex'])) {
elseif(isset($data['mandatory_ex']))
{
return '&nbsp;<span class="red">**</span>'; return '&nbsp;<span class="red">**</span>';
} }
return ''; return '';
@@ -144,14 +146,14 @@ class htmlform
{ {
$return = ''; $return = '';
$extras = ''; $extras = '';
if(isset($data['maxlength'])) { if (isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"'; $extras .= ' maxlength="' . $data['maxlength'] . '"';
} }
if(isset($data['size'])) { if (isset($data['size'])) {
$extras .= ' size="'.$data['size'].'"'; $extras .= ' size="' . $data['size'] . '"';
} }
if(isset($data['autocomplete'])) { if (isset($data['autocomplete'])) {
$extras .= ' autocomplete="'.$data['autocomplete'].'"'; $extras .= ' autocomplete="' . $data['autocomplete'] . '"';
} }
// add support to save reloaded forms // add support to save reloaded forms
@@ -163,10 +165,9 @@ class htmlform
$value = ''; $value = '';
} }
$ulfield = ($unlimited == true ? '&nbsp;'.$data['ul_field'] : ''); $ulfield = ($unlimited == true ? '&nbsp;' . $data['ul_field'] : '');
if(isset($data['display']) && $data['display'] != '') if (isset($data['display']) && $data['display'] != '') {
{ $ulfield = '<strong>' . $data['display'] . '</strong>';
$ulfield = '<strong>'.$data['display'].'</strong>';
} }
eval("\$return = \"" . getTemplate("misc/form/input_text", "1") . "\";"); eval("\$return = \"" . getTemplate("misc/form/input_text", "1") . "\";");
@@ -177,11 +178,11 @@ class htmlform
{ {
$return = ''; $return = '';
$extras = ''; $extras = '';
if(isset($data['cols'])) { if (isset($data['cols'])) {
$extras .= ' cols="'.$data['cols'].'"'; $extras .= ' cols="' . $data['cols'] . '"';
} }
if(isset($data['rows'])) { if (isset($data['rows'])) {
$extras .= ' rows="'.$data['rows'].'"'; $extras .= ' rows="' . $data['rows'] . '"';
} }
// add support to save reloaded forms // add support to save reloaded forms
@@ -220,12 +221,10 @@ class htmlform
} }
return '<select return '<select
id="'.$fieldname.'" id="' . $fieldname . '"
name="'.$fieldname.'" name="' . $fieldname . '"
'.(isset($data['class']) ? ' class="'.$data['class'] .'" ' : '').' ' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . '
>' >' . $select_var . '</select>';
.$select_var.
'</select>';
} }
/** /**
@@ -233,32 +232,36 @@ class htmlform
* *
* <code> * <code>
* $data = array( * $data = array(
* 'label' => $lng['customer']['email_imap'], * 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox', * 'type' => 'checkbox',
* 'values' => array( * 'values' => array(
* array( 'label' => 'active', * array( 'label' => 'active',
* 'value' => '1' * 'value' => '1'
* ) * )
* ), * ),
* 'value' => array('1'), * 'value' => array('1'),
* 'mandatory' => true * 'mandatory' => true
* ) * )
* </code> * </code>
* *
* @param string $fieldname contains the fieldname * @param string $fieldname
* @param array $data contains the data array * contains the fieldname
* @param array $data
* contains the data array
*/ */
public static function _checkbox($fieldname = '', $data = array()) { public static function _checkbox($fieldname = '', $data = array())
{
// $data['value'] contains checked items // $data['value'] contains checked items
$checked = array(); $checked = array();
if (isset($data['value'])) { if (isset($data['value'])) {
$checked = $data['value']; $checked = $data['value'];
} }
if (isset($_SESSION['requestData'])) { if (isset($_SESSION['requestData'])) {
if(isset($_SESSION['requestData'][$fieldname])) { if (isset($_SESSION['requestData'][$fieldname])) {
$checked = array($_SESSION['requestData'][$fieldname]); $checked = array(
$_SESSION['requestData'][$fieldname]
);
} }
} }
@@ -271,12 +274,12 @@ class htmlform
// will contain the output // will contain the output
$output = ""; $output = "";
foreach($data['values'] as $val) { foreach ($data['values'] as $val) {
$key = $val['label']; $key = $val['label'];
// is this box checked? // is this box checked?
$isChecked = ''; $isChecked = '';
if (is_array($checked) && count($checked) > 0) { if (is_array($checked) && count($checked) > 0) {
foreach($checked as $tmp) { foreach ($checked as $tmp) {
if ($tmp == $val['value']) { if ($tmp == $val['value']) {
$isChecked = ' checked="checked" '; $isChecked = ' checked="checked" ';
break; break;
@@ -285,10 +288,10 @@ class htmlform
} }
$output .= '<label>'; $output .= '<label>';
if (empty($isArray)) { if (empty($isArray)) {
$output .= '<input type="hidden" name="'.$fieldname.'" value="0" />'; $output .= '<input type="hidden" name="' . $fieldname . '" value="0" />';
} }
$output .= '<input type="checkbox" name="'.$fieldname.$isArray.'" value="'.$val['value'].'" '.$isChecked.'/>'; $output .= '<input type="checkbox" name="' . $fieldname . $isArray . '" value="' . $val['value'] . '" ' . $isChecked . '/>';
$output .= $key.'</label>'; $output .= $key . '</label>';
} }
return $output; return $output;
@@ -298,8 +301,8 @@ class htmlform
{ {
$return = ''; $return = '';
$extras = ''; $extras = '';
if(isset($data['maxlength'])) { if (isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"'; $extras .= ' maxlength="' . $data['maxlength'] . '"';
} }
// add support to save reloaded forms // add support to save reloaded forms
@@ -311,9 +314,8 @@ class htmlform
$value = ''; $value = '';
} }
if(isset($data['display']) && $data['display'] != '') if (isset($data['display']) && $data['display'] != '') {
{ $ulfield = '<strong>' . $data['display'] . '</strong>';
$ulfield = '<strong>'.$data['display'].'</strong>';
} }
eval("\$return = \"" . getTemplate("misc/form/input_file", "1") . "\";"); eval("\$return = \"" . getTemplate("misc/form/input_file", "1") . "\";");
@@ -324,11 +326,11 @@ class htmlform
{ {
$return = ''; $return = '';
$extras = ''; $extras = '';
if(isset($data['int_min'])) { if (isset($data['int_min'])) {
$extras .= ' min="'.$data['int_min'].'"'; $extras .= ' min="' . $data['int_min'] . '"';
} }
if(isset($data['int_max'])) { if (isset($data['int_max'])) {
$extras .= ' max="'.$data['int_max'].'"'; $extras .= ' max="' . $data['int_max'] . '"';
} }
// add support to save reloaded forms // add support to save reloaded forms

View File

@@ -15,19 +15,25 @@
* @package Panel * @package Panel
* *
*/ */
class linker
class linker { {
private $protocol = ''; private $protocol = '';
private $username = ''; private $username = '';
private $password = ''; private $password = '';
private $hostname = ''; private $hostname = '';
private $port = 80; private $port = 80;
private $filename = 'index.php'; private $filename = 'index.php';
private $args = array(); private $args = array();
public function __construct($file = 'index.php', $sessionid = '', $hostname = '', $protocol = '', $port = '', $username = '', $password = '') { public function __construct($file = 'index.php', $sessionid = '', $hostname = '', $protocol = '', $port = '', $username = '', $password = '')
{
// Set the basic parts of our URL // Set the basic parts of our URL
$this->protocol = $protocol; $this->protocol = $protocol;
$this->username = $username; $this->username = $username;
@@ -39,40 +45,59 @@ class linker {
$this->args['s'] = $sessionid; $this->args['s'] = $sessionid;
} }
public function __set($key, $value) { public function __set($key, $value)
{
switch (strtolower($key)) { switch (strtolower($key)) {
case 'protocol': $this->protocol = $value; break; case 'protocol':
case 'username': $this->username = $value; break; $this->protocol = $value;
case 'password': $this->password = $value; break; break;
case 'hostname': $this->hostname = $value; break; case 'username':
case 'port': $this->port = $value; break; $this->username = $value;
case 'filename': $this->filename = $value; break; break;
default: return false; case 'password':
$this->password = $value;
break;
case 'hostname':
$this->hostname = $value;
break;
case 'port':
$this->port = $value;
break;
case 'filename':
$this->filename = $value;
break;
default:
return false;
} }
return true; return true;
} }
public function add($key, $value) { public function add($key, $value)
{
// Add a new value to our parameters (overwrite = enabled) // Add a new value to our parameters (overwrite = enabled)
$this->args[$key] = $value; $this->args[$key] = $value;
} }
public function del($key) { public function del($key)
{
// If the key exists in our array -> delete it // If the key exists in our array -> delete it
if (isset($this->args[$key])) { if (isset($this->args[$key])) {
unset($this->args[$key]); unset($this->args[$key]);
} }
} }
public function delAll() { public function delAll()
{
// Just resetting the array // Just resetting the array
// Until the sessionid can be removed: save it // Until the sessionid can be removed: save it
// @TODO: Remove this // @TODO: Remove this
$this->args = array('s' => $this->args['s']); $this->args = array(
's' => $this->args['s']
);
} }
public function getLink() { public function getLink()
{
$link = ''; $link = '';
// Build the basic URL // Build the basic URL
@@ -132,7 +157,7 @@ class linker {
// Loop through arguments and add them to the link // Loop through arguments and add them to the link
foreach ($this->args as $key => $value) { foreach ($this->args as $key => $value) {
// For all but the first argument, prepend "&amp;" // For all but the first argument, prepend "&amp;"
if (substr($link, -1) != "?") { if (substr($link, - 1) != "?") {
$link .= "&"; $link .= "&";
} }

View File

@@ -19,91 +19,113 @@
/** /**
* Class to manage paging system * Class to manage paging system
*
* @package Functions * @package Functions
*/ */
class paging { class paging
{
/** /**
* Userinfo * Userinfo
*
* @var array * @var array
*/ */
private $userinfo = array(); private $userinfo = array();
/** /**
* MySQL-Table * MySQL-Table
*
* @var string * @var string
*/ */
private $table = ''; private $table = '';
/** /**
* Fields with description which should be selectable * Fields with description which should be selectable
*
* @var array * @var array
*/ */
private $fields = array(); private $fields = array();
/** /**
* Entries per page * Entries per page
*
* @var int * @var int
*/ */
private $entriesperpage = 0; private $entriesperpage = 0;
/** /**
* Number of entries of table * Number of entries of table
*
* @var int * @var int
*/ */
private $entries = 0; private $entries = 0;
/** /**
* Sortorder, asc or desc * Sortorder, asc or desc
*
* @var string * @var string
*/ */
public $sortorder = 'asc'; public $sortorder = 'asc';
/** /**
* Sortfield * Sortfield
*
* @var string * @var string
*/ */
public $sortfield = ''; public $sortfield = '';
/** /**
* Searchfield * Searchfield
*
* @var string * @var string
*/ */
private $searchfield = ''; private $searchfield = '';
/** /**
* Searchtext * Searchtext
*
* @var string * @var string
*/ */
private $searchtext = ''; private $searchtext = '';
/** /**
* Pagenumber * Pagenumber
*
* @var int * @var int
*/ */
private $pageno = 0; private $pageno = 0;
/** /**
* Switch natsorting on/off * Switch natsorting on/off
*
* @var bool * @var bool
*/ */
private $natSorting = false; private $natSorting = false;
private $_limit = 0; private $_limit = 0;
/** /**
* Class constructor. Loads settings from request or from userdata and saves them to session. * Class constructor.
* * Loads settings from request or from userdata and saves them to session.
* @param array userinfo
* @param string Name of Table
* @param array Fields, in format array( 'fieldname_in_mysql' => 'field_caption' )
* @param int *deprecated* entries per page
* @param bool *deprecated* Switch natsorting on/off (global, affects all calls of sort)
* @param int $default_field default sorting-field-index
* @param string $default_order default sorting order 'asc' or 'desc'
* *
* @param
* array userinfo
* @param
* string Name of Table
* @param
* array Fields, in format array( 'fieldname_in_mysql' => 'field_caption' )
* @param
* int *deprecated* entries per page
* @param
* bool *deprecated* Switch natsorting on/off (global, affects all calls of sort)
* @param int $default_field
* default sorting-field-index
* @param string $default_order
* default sorting order 'asc' or 'desc'
*
*/ */
public function __construct($userinfo, $table, $fields, $entriesperpage = 0, $natSorting = false, $default_field = 0, $default_order = 'asc', $limit = 0) { public function __construct($userinfo, $table, $fields, $entriesperpage = 0, $natSorting = false, $default_field = 0, $default_order = 'asc', $limit = 0)
{
// entries per page and natsorting-flag are not // entries per page and natsorting-flag are not
// passed as parameter anymore, because these are // passed as parameter anymore, because these are
@@ -113,7 +135,7 @@ class paging {
$this->userinfo = $userinfo; $this->userinfo = $userinfo;
if (!is_array($this->userinfo['lastpaging'])) { if (! is_array($this->userinfo['lastpaging'])) {
$this->userinfo['lastpaging'] = json_decode($this->userinfo['lastpaging'], true); $this->userinfo['lastpaging'] = json_decode($this->userinfo['lastpaging'], true);
} }
@@ -124,21 +146,12 @@ class paging {
$checklastpaging = (isset($this->userinfo['lastpaging']['table']) && $this->userinfo['lastpaging']['table'] == $this->table); $checklastpaging = (isset($this->userinfo['lastpaging']['table']) && $this->userinfo['lastpaging']['table'] == $this->table);
$this->userinfo['lastpaging']['table'] = $this->table; $this->userinfo['lastpaging']['table'] = $this->table;
if (isset($_REQUEST['sortorder']) if (isset($_REQUEST['sortorder']) && (strtolower($_REQUEST['sortorder']) == 'desc' || strtolower($_REQUEST['sortorder']) == 'asc')) {
&& (strtolower($_REQUEST['sortorder']) == 'desc'
|| strtolower($_REQUEST['sortorder']) == 'asc')
) {
$this->sortorder = strtolower($_REQUEST['sortorder']); $this->sortorder = strtolower($_REQUEST['sortorder']);
} else { } else {
if ($checklastpaging if ($checklastpaging && isset($this->userinfo['lastpaging']['sortorder']) && (strtolower($this->userinfo['lastpaging']['sortorder']) == 'desc' || strtolower($this->userinfo['lastpaging']['sortorder']) == 'asc')) {
&& isset($this->userinfo['lastpaging']['sortorder'])
&& (strtolower($this->userinfo['lastpaging']['sortorder']) == 'desc'
|| strtolower($this->userinfo['lastpaging']['sortorder']) == 'asc')
) {
$this->sortorder = strtolower($this->userinfo['lastpaging']['sortorder']); $this->sortorder = strtolower($this->userinfo['lastpaging']['sortorder']);
} else { } else {
$this->sortorder = $default_order; $this->sortorder = $default_order;
} }
@@ -146,15 +159,10 @@ class paging {
$this->userinfo['lastpaging']['sortorder'] = $this->sortorder; $this->userinfo['lastpaging']['sortorder'] = $this->sortorder;
if (isset($_REQUEST['sortfield']) if (isset($_REQUEST['sortfield']) && isset($fields[$_REQUEST['sortfield']])) {
&& isset($fields[$_REQUEST['sortfield']])
) {
$this->sortfield = $_REQUEST['sortfield']; $this->sortfield = $_REQUEST['sortfield'];
} else { } else {
if ($checklastpaging if ($checklastpaging && isset($this->userinfo['lastpaging']['sortfield']) && isset($fields[$this->userinfo['lastpaging']['sortfield']])) {
&& isset($this->userinfo['lastpaging']['sortfield'])
&& isset($fields[$this->userinfo['lastpaging']['sortfield']])
) {
$this->sortfield = $this->userinfo['lastpaging']['sortfield']; $this->sortfield = $this->userinfo['lastpaging']['sortfield'];
} else { } else {
$fieldnames = array_keys($fields); $fieldnames = array_keys($fields);
@@ -164,15 +172,10 @@ class paging {
$this->userinfo['lastpaging']['sortfield'] = $this->sortfield; $this->userinfo['lastpaging']['sortfield'] = $this->sortfield;
if (isset($_REQUEST['searchfield']) if (isset($_REQUEST['searchfield']) && isset($fields[$_REQUEST['searchfield']])) {
&& isset($fields[$_REQUEST['searchfield']])
) {
$this->searchfield = $_REQUEST['searchfield']; $this->searchfield = $_REQUEST['searchfield'];
} else { } else {
if ($checklastpaging if ($checklastpaging && isset($this->userinfo['lastpaging']['searchfield']) && isset($fields[$this->userinfo['lastpaging']['searchfield']])) {
&& isset($this->userinfo['lastpaging']['searchfield'])
&& isset($fields[$this->userinfo['lastpaging']['searchfield']])
) {
$this->searchfield = $this->userinfo['lastpaging']['searchfield']; $this->searchfield = $this->userinfo['lastpaging']['searchfield'];
} else { } else {
$fieldnames = array_keys($fields); $fieldnames = array_keys($fields);
@@ -182,16 +185,10 @@ class paging {
$this->userinfo['lastpaging']['searchfield'] = $this->searchfield; $this->userinfo['lastpaging']['searchfield'] = $this->searchfield;
if (isset($_REQUEST['searchtext']) if (isset($_REQUEST['searchtext']) && (preg_match('/[-_@\p{L}\p{N}*.]+$/u', $_REQUEST['searchtext']) || $_REQUEST['searchtext'] === '')) {
&& (preg_match('/[-_@\p{L}\p{N}*.]+$/u', $_REQUEST['searchtext'])
|| $_REQUEST['searchtext'] === '')
) {
$this->searchtext = trim($_REQUEST['searchtext']); $this->searchtext = trim($_REQUEST['searchtext']);
} else { } else {
if ($checklastpaging if ($checklastpaging && isset($this->userinfo['lastpaging']['searchtext']) && preg_match('/[-_@\p{L}\p{N}*.]+$/u', $this->userinfo['lastpaging']['searchtext'])) {
&& isset($this->userinfo['lastpaging']['searchtext'])
&& preg_match('/[-_@\p{L}\p{N}*.]+$/u', $this->userinfo['lastpaging']['searchtext'])
) {
$this->searchtext = $this->userinfo['lastpaging']['searchtext']; $this->searchtext = $this->userinfo['lastpaging']['searchtext'];
} else { } else {
$this->searchtext = ''; $this->searchtext = '';
@@ -200,15 +197,10 @@ class paging {
$this->userinfo['lastpaging']['searchtext'] = $this->searchtext; $this->userinfo['lastpaging']['searchtext'] = $this->searchtext;
if (isset($_REQUEST['pageno']) if (isset($_REQUEST['pageno']) && intval($_REQUEST['pageno']) != 0) {
&& intval($_REQUEST['pageno']) != 0
) {
$this->pageno = intval($_REQUEST['pageno']); $this->pageno = intval($_REQUEST['pageno']);
} else { } else {
if ($checklastpaging if ($checklastpaging && isset($this->userinfo['lastpaging']['pageno']) && intval($this->userinfo['lastpaging']['pageno']) != 0) {
&& isset($this->userinfo['lastpaging']['pageno'])
&& intval($this->userinfo['lastpaging']['pageno']) != 0
) {
$this->pageno = intval($this->userinfo['lastpaging']['pageno']); $this->pageno = intval($this->userinfo['lastpaging']['pageno']);
} else { } else {
$this->pageno = 1; $this->pageno = 1;
@@ -232,17 +224,18 @@ class paging {
'adminsession' => $userinfo['adminsession'] 'adminsession' => $userinfo['adminsession']
); );
\Froxlor\Database\Database::pexecute($upd_stmt, $upd_data); \Froxlor\Database\Database::pexecute($upd_stmt, $upd_data);
$this->_limit = $limit; $this->_limit = $limit;
} }
/** /**
* Sets number of entries and adjusts pageno if the number of entries doesn't correspond to the pageno. * Sets number of entries and adjusts pageno if the number of entries doesn't correspond to the pageno.
* *
* @param int entries * @param
* int entries
*/ */
public function setEntries($entries) { public function setEntries($entries)
{
$this->entries = $entries; $this->entries = $entries;
if (($this->pageno - 1) * $this->entriesperpage > $this->entries) { if (($this->pageno - 1) * $this->entriesperpage > $this->entries) {
@@ -255,10 +248,12 @@ class paging {
/** /**
* Checks if a row should be displayed or not, used in loops * Checks if a row should be displayed or not, used in loops
* *
* @param int number of row * @param
* int number of row
* @return bool to display or not to display, that's the question * @return bool to display or not to display, that's the question
*/ */
public function checkDisplay($count) { public function checkDisplay($count)
{
$begin = (intval($this->pageno) - 1) * intval($this->entriesperpage); $begin = (intval($this->pageno) - 1) * intval($this->entriesperpage);
$end = (intval($this->pageno) * intval($this->entriesperpage)); $end = (intval($this->pageno) * intval($this->entriesperpage));
return (($count >= $begin && $count < $end) || $this->entriesperpage == 0); return (($count >= $begin && $count < $end) || $this->entriesperpage == 0);
@@ -267,10 +262,12 @@ class paging {
/** /**
* Returns condition code for sql query * Returns condition code for sql query
* *
* @param bool should returned condition code start with WHERE (false) or AND (true)? * @param
* bool should returned condition code start with WHERE (false) or AND (true)?
* @return string the condition code * @return string the condition code
*/ */
public function getSqlWhere($append = false) { public function getSqlWhere($append = false)
{
if ($this->searchtext != '') { if ($this->searchtext != '') {
if ($append == true) { if ($append == true) {
$condition = ' AND '; $condition = ' AND ';
@@ -280,8 +277,8 @@ class paging {
$searchfield = explode('.', $this->searchfield); $searchfield = explode('.', $this->searchfield);
foreach ($searchfield as $id => $field) { foreach ($searchfield as $id => $field) {
if (substr($field, -1, 1) != '`') { if (substr($field, - 1, 1) != '`') {
$field.= '`'; $field .= '`';
} }
if ($field{0} != '`') { if ($field{0} != '`') {
@@ -292,9 +289,13 @@ class paging {
} }
$searchfield = implode('.', $searchfield); $searchfield = implode('.', $searchfield);
$ops = array('<', '>', '='); $ops = array(
'<',
'>',
'='
);
// check if we use an operator or not // check if we use an operator or not
$useOper = 0; $useOper = 0;
$oper = "="; $oper = "=";
@@ -302,32 +303,32 @@ class paging {
$useOper = 1; $useOper = 1;
$oper = substr($this->searchtext, 0, 1); $oper = substr($this->searchtext, 0, 1);
} }
// check for diskspace and whether searchtext is a number // check for diskspace and whether searchtext is a number
// in any other case the logical-operators would make no sense // in any other case the logical-operators would make no sense
if (strpos($searchfield, 'diskspace') > 0 && is_numeric(substr($this->searchtext, $useOper))) { if (strpos($searchfield, 'diskspace') > 0 && is_numeric(substr($this->searchtext, $useOper))) {
// anything with diskspace is *1024 // anything with diskspace is *1024
$searchtext = ((int)substr($this->searchtext, $useOper))*1024; $searchtext = ((int) substr($this->searchtext, $useOper)) * 1024;
$useOper = 1; $useOper = 1;
} elseif (strpos($searchfield, 'traffic') > 0 && is_numeric(substr($this->searchtext, $useOper))) { } elseif (strpos($searchfield, 'traffic') > 0 && is_numeric(substr($this->searchtext, $useOper))) {
// anything with traffic is *1024*1024 // anything with traffic is *1024*1024
$searchtext = ((int)substr($this->searchtext, $useOper))*1024*1024; $searchtext = ((int) substr($this->searchtext, $useOper)) * 1024 * 1024;
$useOper = 1; $useOper = 1;
} else { } else {
// any other field // any other field
$searchtext = substr($this->searchtext, $useOper); $searchtext = substr($this->searchtext, $useOper);
} }
if ($useOper == 1 && is_numeric(substr($this->searchtext, $useOper))) { if ($useOper == 1 && is_numeric(substr($this->searchtext, $useOper))) {
// now as we use >, < or = we use the given operator and not LIKE // now as we use >, < or = we use the given operator and not LIKE
$condition.= $searchfield . " ".$oper." " . \Froxlor\Database\Database::quote($searchtext); $condition .= $searchfield . " " . $oper . " " . \Froxlor\Database\Database::quote($searchtext);
} else { } else {
$searchtext = str_replace('*', '%', $this->searchtext); $searchtext = str_replace('*', '%', $this->searchtext);
// append wildcards if user did not enter any // append wildcards if user did not enter any
if (strpos($searchtext,'%') === false) $searchtext='%'.$searchtext.'%'; if (strpos($searchtext, '%') === false)
$condition.= $searchfield . " LIKE " . \Froxlor\Database\Database::quote($searchtext); $searchtext = '%' . $searchtext . '%';
$condition .= $searchfield . " LIKE " . \Froxlor\Database\Database::quote($searchtext);
} }
} else { } else {
$condition = ''; $condition = '';
} }
@@ -338,15 +339,16 @@ class paging {
/** /**
* Returns "order by"-code for sql query * Returns "order by"-code for sql query
* *
* @param bool Switch natsorting on/off (local, affects just this call) * @param
* bool Switch natsorting on/off (local, affects just this call)
* @return string the "order by"-code * @return string the "order by"-code
*/ */
public function getSqlOrderBy($natSorting = null) { public function getSqlOrderBy($natSorting = null)
{
$sortfield = explode('.', $this->sortfield); $sortfield = explode('.', $this->sortfield);
foreach ($sortfield as $id => $field) { foreach ($sortfield as $id => $field) {
if (substr($field, -1, 1) != '`') { if (substr($field, - 1, 1) != '`') {
$field.= '`'; $field .= '`';
} }
if ($field{0} != '`') { if ($field{0} != '`') {
@@ -359,9 +361,7 @@ class paging {
$sortfield = implode('.', $sortfield); $sortfield = implode('.', $sortfield);
$sortorder = strtoupper($this->sortorder); $sortorder = strtoupper($this->sortorder);
if ($natSorting == true if ($natSorting == true || ($natSorting === null && $this->natSorting == true)) {
|| ($natSorting === null && $this->natSorting == true)
) {
// Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556 // Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556
$sortcode = "ORDER BY CONCAT( IF( ASCII( LEFT( " . $sortfield . ", 5 ) ) > 57, $sortcode = "ORDER BY CONCAT( IF( ASCII( LEFT( " . $sortfield . ", 5 ) ) > 57,
LEFT( " . $sortfield . ", 1 ), 0 ), LEFT( " . $sortfield . ", 1 ), 0 ),
@@ -381,11 +381,11 @@ class paging {
* *
* @return string always empty * @return string always empty
*/ */
public function getSqlLimit() { public function getSqlLimit()
{
if ($this->_limit > 0) { if ($this->_limit > 0) {
$_offset = ($this->pageno - 1) * $this->_limit; $_offset = ($this->pageno - 1) * $this->_limit;
return ' LIMIT '.$_offset.','.$this->_limit; return ' LIMIT ' . $_offset . ',' . $this->_limit;
} }
/** /**
* currently not in use * currently not in use
@@ -396,22 +396,26 @@ class paging {
/** /**
* Returns html code for sorting field * Returns html code for sorting field
* *
* @param array Language array * @param
* array Language array
* @return string the html sortcode * @return string the html sortcode
*/ */
public function getHtmlSortCode($lng, $break = false) { public function getHtmlSortCode($lng, $break = false)
{
$sortcode = ''; $sortcode = '';
$fieldoptions = ''; $fieldoptions = '';
$orderoptions = ''; $orderoptions = '';
foreach ($this->fields as $fieldname => $fieldcaption) { foreach ($this->fields as $fieldname => $fieldcaption) {
$fieldoptions.= makeoption($fieldcaption, $fieldname, $this->sortfield, true, true); $fieldoptions .= makeoption($fieldcaption, $fieldname, $this->sortfield, true, true);
} }
$breakorws = ($break ? '<br />' : '&nbsp;'); $breakorws = ($break ? '<br />' : '&nbsp;');
foreach (array('asc' => $lng['panel']['ascending'], 'desc' => $lng['panel']['descending']) as $sortordertype => $sortorderdescription) { foreach (array(
$orderoptions.= makeoption($sortorderdescription, $sortordertype, $this->sortorder, true, true); 'asc' => $lng['panel']['ascending'],
'desc' => $lng['panel']['descending']
) as $sortordertype => $sortorderdescription) {
$orderoptions .= makeoption($sortorderdescription, $sortordertype, $this->sortorder, true, true);
} }
eval("\$sortcode =\"" . getTemplate("misc/htmlsortcode", '1') . "\";"); eval("\$sortcode =\"" . getTemplate("misc/htmlsortcode", '1') . "\";");
@@ -421,17 +425,17 @@ class paging {
/** /**
* Returns html code for sorting arrows * Returns html code for sorting arrows
* *
* @param string URL to use as base for links * @param
* @param string If set, only this field will be returned * string URL to use as base for links
* @param
* string If set, only this field will be returned
* @return mixed An array or a string (if field is set) of html code of arrows * @return mixed An array or a string (if field is set) of html code of arrows
*/ */
public function getHtmlArrowCode($baseurl, $field = '') { public function getHtmlArrowCode($baseurl, $field = '')
{
global $theme; global $theme;
if ($field != '' if ($field != '' && isset($this->fields[$field])) {
&& isset($this->fields[$field])
) {
$baseurl = htmlspecialchars($baseurl); $baseurl = htmlspecialchars($baseurl);
$fieldname = htmlspecialchars($field); $fieldname = htmlspecialchars($field);
eval("\$arrowcode =\"" . getTemplate("misc/htmlarrowcode", '1') . "\";"); eval("\$arrowcode =\"" . getTemplate("misc/htmlarrowcode", '1') . "\";");
@@ -450,16 +454,17 @@ class paging {
/** /**
* Returns html code for searching field * Returns html code for searching field
* *
* @param array Language array * @param
* array Language array
* @return string the html searchcode * @return string the html searchcode
*/ */
public function getHtmlSearchCode($lng) { public function getHtmlSearchCode($lng)
{
$searchcode = ''; $searchcode = '';
$fieldoptions = ''; $fieldoptions = '';
$searchtext = htmlspecialchars($this->searchtext); $searchtext = htmlspecialchars($this->searchtext);
foreach ($this->fields as $fieldname => $fieldcaption) { foreach ($this->fields as $fieldname => $fieldcaption) {
$fieldoptions.= makeoption($fieldcaption, $fieldname, $this->searchfield, true, true); $fieldoptions .= makeoption($fieldcaption, $fieldname, $this->searchfield, true, true);
} }
eval("\$searchcode =\"" . getTemplate("misc/htmlsearchcode", '1') . "\";"); eval("\$searchcode =\"" . getTemplate("misc/htmlsearchcode", '1') . "\";");
return $searchcode; return $searchcode;
@@ -468,10 +473,12 @@ class paging {
/** /**
* Returns html code for paging * Returns html code for paging
* *
* @param string URL to use as base for links * @param
* string URL to use as base for links
* @return string the html pagingcode * @return string the html pagingcode
*/ */
public function getHtmlPagingCode($baseurl) { public function getHtmlPagingCode($baseurl)
{
if ($this->entriesperpage == 0) { if ($this->entriesperpage == 0) {
return ''; return '';
} else { } else {
@@ -479,7 +486,7 @@ class paging {
} }
if ($this->entries % $this->entriesperpage != 0) { if ($this->entries % $this->entriesperpage != 0) {
$pages++; $pages ++;
} }
if ($pages > 1) { if ($pages > 1) {
@@ -495,14 +502,14 @@ class paging {
} }
$pagingcode = '<a href="' . htmlspecialchars($baseurl) . '&amp;pageno=1">&laquo;</a> <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) - 1) == 0 ? '1' : intval($this->pageno) - 1) . '">&lt;</a>&nbsp;'; $pagingcode = '<a href="' . htmlspecialchars($baseurl) . '&amp;pageno=1">&laquo;</a> <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) - 1) == 0 ? '1' : intval($this->pageno) - 1) . '">&lt;</a>&nbsp;';
for ($i = $start;$i <= $stop;$i++) { for ($i = $start; $i <= $stop; $i ++) {
if ($i != $this->pageno) { if ($i != $this->pageno) {
$pagingcode.= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . $i . '">' . $i . '</a>&nbsp;'; $pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . $i . '">' . $i . '</a>&nbsp;';
} else { } else {
$pagingcode.= ' <strong>' . $i . '</strong>&nbsp;'; $pagingcode .= ' <strong>' . $i . '</strong>&nbsp;';
} }
} }
$pagingcode.= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) + 1) > $pages ? $pages : intval($this->pageno) + 1) . '">&gt;</a> <a href="' . $baseurl . '&amp;pageno=' . $pages . '">&raquo;</a>'; $pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) + 1) > $pages ? $pages : intval($this->pageno) + 1) . '">&gt;</a> <a href="' . $baseurl . '&amp;pageno=' . $pages . '">&raquo;</a>';
} else { } else {
$pagingcode = ''; $pagingcode = '';
} }

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Gentoo" version="2.2" defaulteditor="/usr/bin/nano"> <distribution name="Gentoo" version="2.2"
defaulteditor="/usr/bin/nano">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">
@@ -915,8 +916,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -931,7 +932,8 @@ gmysql-password=
</file> </file>
<command><![CDATA[/etc/init.d/pdns restart]]></command> <command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon> </daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend"> <daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[emerge net-dns/pdns]]></install> <install><![CDATA[emerge net-dns/pdns]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600"> <file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[ <content><![CDATA[
@@ -1458,8 +1460,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
#local-ipv6=YOUR_IPv6_(if_any) #local-ipv6=YOUR_IPv6_(if_any)
bind-config=<BIND_CONFIG_PATH>named.conf bind-config=<BIND_CONFIG_PATH>named.conf
@@ -1495,8 +1497,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command> <command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands> </commands>
<files index="0"> <files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1540,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1552,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1602,8 +1604,8 @@ root: root@<SERVERNAME>
</include> </include>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# Postfix programs paths settings # Postfix programs paths settings
command_directory = /usr/sbin command_directory = /usr/sbin
@@ -1727,8 +1729,8 @@ debugger_command =
</content> </content>
</file> </file>
<include>//service[@type='smtp']/general/files[@index=0]</include> <include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/master.cf" chown="root:root"
backup="true" mode="append"> chmod="0644" backup="true" mode="append">
<content><![CDATA[ <content><![CDATA[
# Add this lines to be able to use dovecot as delivery agent # Add this lines to be able to use dovecot as delivery agent
# Dovecot LDA # Dovecot LDA
@@ -1750,8 +1752,8 @@ dovecot unix - n n - - pipe
</include> </include>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# Postfix programs paths settings # Postfix programs paths settings
command_directory = /usr/sbin command_directory = /usr/sbin
@@ -1880,8 +1882,8 @@ debugger_command =
</content> </content>
</file> </file>
<include>//service[@type='smtp']/general/files[@index=0]</include> <include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/master.cf" chown="root:root"
backup="true" mode="append"> chmod="0644" backup="true" mode="append">
<content><![CDATA[ <content><![CDATA[
# Add this lines to be able to use dovecot as delivery agent # Add this lines to be able to use dovecot as delivery agent
# Dovecot LDA # Dovecot LDA
@@ -1903,8 +1905,8 @@ dovecot unix - n n - - pipe
</include> </include>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# Postfix programs paths settings # Postfix programs paths settings
command_directory = /usr/sbin command_directory = /usr/sbin
@@ -2000,7 +2002,8 @@ debugger_command =
</content> </content>
</file> </file>
<include>//service[@type='smtp']/general/files[@index=0]</include> <include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/sasl2/smtpd.conf" chown="root:root" chmod="0600"> <file name="/etc/sasl2/smtpd.conf" chown="root:root"
chmod="0600">
<content><![CDATA[ <content><![CDATA[
pwcheck_method: auxprop pwcheck_method: auxprop
auxprop_plugin: sql auxprop_plugin: sql
@@ -2024,7 +2027,8 @@ sql_select: SELECT password_enc FROM mail_users WHERE username='%u@%r' OR email=
<!-- IMAP/POP3 services --> <!-- IMAP/POP3 services -->
<service type="mail" title="{{lng.admin.configfiles.mail}}"> <service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- Dovecot --> <!-- Dovecot -->
<daemon name="dovecot" version="2" title="Dovecot" default="true"> <daemon name="dovecot" version="2" title="Dovecot"
default="true">
<command><![CDATA[echo "net-mail/dovecot mysql managesieve sieve" >> /etc/portage/package.use]]></command> <command><![CDATA[echo "net-mail/dovecot mysql managesieve sieve" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge net-mail/dovecot]]></install> <install><![CDATA[emerge net-mail/dovecot]]></install>
<file name="/etc/dovecot/dovecot.conf" chown="root:root" <file name="/etc/dovecot/dovecot.conf" chown="root:root"
@@ -2132,8 +2136,8 @@ protocol lda {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root" <file name="/etc/dovecot/dovecot-sql.conf.ext"
chmod="0600" backup="true"> chown="root:root" chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
driver = mysql driver = mysql
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD> connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
@@ -2144,8 +2148,8 @@ iterate_query = "SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:root" <file name="/etc/dovecot/conf.d/20-managesieve.conf"
chmod="0644" backup="true"> chown="root:root" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## ManageSieve specific settings ## ManageSieve specific settings
@@ -2226,8 +2230,8 @@ protocol sieve {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/90-sieve.conf" chown="root:root" <file name="/etc/dovecot/conf.d/90-sieve.conf"
chmod="0644" backup="true"> chown="root:root" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## Settings for the Sieve interpreter ## Settings for the Sieve interpreter
@@ -2496,8 +2500,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/courier-imap/pop3d" chown="root:0" chmod="0600" <file name="/etc/courier-imap/pop3d" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
##VERSION: $Id: pop3d.dist.in,v 1.11 2004/10/30 15:39:38 mrsam Exp $ ##VERSION: $Id: pop3d.dist.in,v 1.11 2004/10/30 15:39:38 mrsam Exp $
# #
@@ -2629,8 +2633,8 @@ PRERUN=
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/courier-imap/imapd" chown="root:0" chmod="0600" <file name="/etc/courier-imap/imapd" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
##VERSION: $Id: imapd.dist.in,v 1.32 2004/11/25 04:57:04 mrsam Exp $ ##VERSION: $Id: imapd.dist.in,v 1.32 2004/11/25 04:57:04 mrsam Exp $
# #
@@ -3011,8 +3015,8 @@ PRERUN=
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/courier-imap/pop3d-ssl" chown="root:0" chmod="0600" <file name="/etc/courier-imap/pop3d-ssl" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
##VERSION: $Id: pop3d-ssl.dist.in,v 1.12 2004/10/21 00:45:35 mrsam Exp $ ##VERSION: $Id: pop3d-ssl.dist.in,v 1.12 2004/10/21 00:45:35 mrsam Exp $
# #
@@ -3203,8 +3207,8 @@ MAILDIRPATH=.maildir
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/courier-imap/imapd-ssl" chown="root:0" chmod="0600" <file name="/etc/courier-imap/imapd-ssl" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
##VERSION: $Id: imapd-ssl.dist.in,v 1.11 2004/10/21 00:45:35 mrsam Exp $ ##VERSION: $Id: imapd-ssl.dist.in,v 1.11 2004/10/21 00:45:35 mrsam Exp $
# #
@@ -3422,7 +3426,8 @@ MAILDIRPATH=.maildir
<daemon name="proftpd" title="ProFTPd" default="true"> <daemon name="proftpd" title="ProFTPd" default="true">
<command><![CDATA[echo "net-ftp/proftpd mysql" >> /etc/portage/package.use]]></command> <command><![CDATA[echo "net-ftp/proftpd mysql" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge net-ftp/proftpd]]></install> <install><![CDATA[emerge net-ftp/proftpd]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700"> <file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash <content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -3434,8 +3439,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command> <command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command> <command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands> </commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600" <file name="/etc/proftpd/proftpd.conf" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# Server settings # Server settings
ServerName "<SERVERNAME> FTP Server" ServerName "<SERVERNAME> FTP Server"
@@ -3582,8 +3587,8 @@ MISC_OTHER="-A -x -j -Z"
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pureftpd-mysql.conf" chown="root:0" chmod="0600" <file name="/etc/pureftpd-mysql.conf" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
MYSQLServer <SQL_HOST> MYSQLServer <SQL_HOST>
#MYSQLPort 3306 #MYSQLPort 3306
@@ -3607,8 +3612,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cu
<daemon name="vsftpd" title="vsftpd"> <daemon name="vsftpd" title="vsftpd">
<command><![CDATA[echo "net-ftp/vsftpd pam" >> /etc/portage/package.use]]></command> <command><![CDATA[echo "net-ftp/vsftpd pam" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge net-ftp/vsftpd sys-auth/pam_mysql]]></install> <install><![CDATA[emerge net-ftp/vsftpd sys-auth/pam_mysql]]></install>
<file name="/etc/vsftpd/vsftpd.conf" chown="root:root" chmod="0644" <file name="/etc/vsftpd/vsftpd.conf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
listen=YES listen=YES
#listen_ipv6=YES #listen_ipv6=YES
@@ -3680,7 +3685,8 @@ account required pam_mysql.so user=<SQL_UNPRIVILEGED_USER> passwd=<SQL_UN
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob --> <!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true"> <daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640"> <file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[ <content><![CDATA[
# #
@@ -3699,17 +3705,19 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command> <command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon> </daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)"> <daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[emerge www-misc/awstats]]></install> <install><![CDATA[emerge www-misc/awstats]]></install>
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[rm /etc/cron.d/awstats]]></command> <command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon> </daemon>
<!-- libnss-mysql --> <!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[emerge sys-auth/libnss-mysql]]></install> <install><![CDATA[emerge sys-auth/libnss-mysql]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600" <file name="/etc/libnss-mysql.cfg" chown="root:root"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \ getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \ FROM ftp_users \
@@ -3804,7 +3812,8 @@ aliases: files
<!-- Logrotate --> <!-- Logrotate -->
<daemon name="logrotate" title="Logrotate"> <daemon name="logrotate" title="Logrotate">
<install><![CDATA[emerge app-admin/logrotate]]></install> <install><![CDATA[emerge app-admin/logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644"> <file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
# #
# Froxlor logrotate snipet # Froxlor logrotate snipet
@@ -3858,12 +3867,13 @@ aliases: files
<content><![CDATA[# remove "-D PHP5" from /etc/conf.d/apache2]]></content> <content><![CDATA[# remove "-D PHP5" from /etc/conf.d/apache2]]></content>
</command> </command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>
<!-- PHP-FPM --> <!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)"> <daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<command><![CDATA[echo "dev-lang/php fpm" >> /etc/portage/package.use]]></command> <command><![CDATA[echo "dev-lang/php fpm" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge dev-lang/php sys-auth/libnss-mysql]]></install> <install><![CDATA[emerge dev-lang/php sys-auth/libnss-mysql]]></install>
<commands index="1"> <commands index="1">
@@ -3896,7 +3906,7 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[# remove "-D PHP5" from /etc/conf.d/apache2]]></command> <command><![CDATA[# remove "-D PHP5" from /etc/conf.d/apache2]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Debian" codename="Jessie" version="8.x" defaulteditor="/usr/bin/nano"> <distribution name="Debian" codename="Jessie"
version="8.x" defaulteditor="/usr/bin/nano">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">
@@ -43,7 +44,8 @@
</commands> </commands>
</general> </general>
<!-- HTTP Apache --> <!-- HTTP Apache -->
<daemon name="apache" version="2.4" title="Apache 2.4" default="true"> <daemon name="apache" version="2.4" title="Apache 2.4"
default="true">
<install><![CDATA[apt-get install apache2]]></install> <install><![CDATA[apt-get install apache2]]></install>
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
@@ -904,8 +906,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -920,7 +922,8 @@ gmysql-password=
</file> </file>
<command><![CDATA[/etc/init.d/pdns restart]]></command> <command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon> </daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend"> <daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600"> <file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[ <content><![CDATA[
@@ -1447,8 +1450,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
# Bind backend configuration # Bind backend configuration
@@ -1494,8 +1497,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command> <command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands> </commands>
<files index="0"> <files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1539,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1551,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1599,8 +1602,8 @@ root: root@<SERVERNAME>
</include> </include>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# Global Postfix configuration file. This file lists only a subset # Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter # of all parameters. For the syntax, and for a complete parameter
@@ -2325,8 +2328,8 @@ virtual_mailbox_limit = 0
</content> </content>
</file> </file>
<include>//service[@type='smtp']/general/files[@index=0]</include> <include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/master.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# Postfix master process configuration file. For details on the format # Postfix master process configuration file. For details on the format
@@ -2577,8 +2580,8 @@ dict {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root" <file name="/etc/dovecot/dovecot-sql.conf.ext"
chmod="0600" backup="true"> chown="root:root" chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# This file is commonly accessed via passdb {} or userdb {} section in # This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext # conf.d/auth-sql.conf.ext
@@ -3237,8 +3240,8 @@ mail_access_groups = vmail
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/10-master.conf" chown="root:0" <file name="/etc/dovecot/conf.d/10-master.conf"
chmod="0644" backup="true"> chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
#default_process_limit = 100 #default_process_limit = 100
#default_client_limit = 1000 #default_client_limit = 1000
@@ -3492,8 +3495,8 @@ protocol imap {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0" <file name="/etc/dovecot/conf.d/20-managesieve.conf"
chmod="0644" backup="true"> chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## ManageSieve specific settings ## ManageSieve specific settings
@@ -3795,8 +3798,8 @@ plugin {
</commands> </commands>
</general> </general>
<!-- Dovecot with postfix --> <!-- Dovecot with postfix -->
<daemon name="dovecot_postfix" version="2" title="Dovecot with postfix" <daemon name="dovecot_postfix" version="2"
default="true"> title="Dovecot with postfix" default="true">
<include>//service[@type='mail']/general/installs[@index=1] <include>//service[@type='mail']/general/installs[@index=1]
</include> </include>
<include>//service[@type='mail']/general/files[@index=1] <include>//service[@type='mail']/general/files[@index=1]
@@ -3805,7 +3808,8 @@ plugin {
</include> </include>
</daemon> </daemon>
<!-- Dovecot with exim4 --> <!-- Dovecot with exim4 -->
<daemon name="dovecot_exim4" version="2" title="Dovecot with exim4"> <daemon name="dovecot_exim4" version="2"
title="Dovecot with exim4">
<include>//service[@type='mail']/general/installs[@index=1] <include>//service[@type='mail']/general/installs[@index=1]
</include> </include>
<include>//service[@type='mail']/general/files[@index=1] <include>//service[@type='mail']/general/files[@index=1]
@@ -3819,7 +3823,8 @@ plugin {
<!-- Proftpd --> <!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true"> <daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install> <install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700"> <file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash <content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -3831,8 +3836,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command> <command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command> <command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands> </commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600" <file name="/etc/proftpd/proftpd.conf" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file. # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -4026,8 +4031,8 @@ Include /etc/proftpd/conf.d/
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644" <file name="/etc/proftpd/modules.conf" chown="root:0"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# This file is used to manage DSO modules and features. # This file is used to manage DSO modules and features.
@@ -4194,7 +4199,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true"> <file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
<IfModule mod_tls.c> <IfModule mod_tls.c>
TLSEngine on TLSEngine on
@@ -4226,14 +4232,15 @@ TLSVerifyClient off
<!-- Pureftpd --> <!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd"> <daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install> <install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
1000 1000
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0" <file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
/etc/pure-ftpd/db/mysql.conf /etc/pure-ftpd/db/mysql.conf
]]> ]]>
@@ -4260,8 +4267,8 @@ yes
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0" <file name="/etc/pure-ftpd/conf/PAMAuthentication"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
no no
]]> ]]>
@@ -4407,7 +4414,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
21 21
]]> ]]>
@@ -4451,7 +4459,8 @@ UPLOADGID=
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob --> <!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true"> <daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640"> <file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[ <content><![CDATA[
# #
@@ -4470,7 +4479,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command> <command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon> </daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)"> <daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command> <command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -4479,14 +4489,15 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command> <command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon> </daemon>
<!-- libnss-mysql --> <!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd <install><![CDATA[apt-get install nscd
wget http://debian.froxlor.org/pool/main/libn/libnss-mysql-bg/libnss-mysql-bg_1.5-3+frx1_amd64.deb wget http://debian.froxlor.org/pool/main/libn/libnss-mysql-bg/libnss-mysql-bg_1.5-3+frx1_amd64.deb
dpkg -i libnss-mysql-bg_1.5-3+frx1_amd64.deb dpkg -i libnss-mysql-bg_1.5-3+frx1_amd64.deb
rm libnss-mysql-bg_1.5-3+frx1_amd64.deb rm libnss-mysql-bg_1.5-3+frx1_amd64.deb
]]></install> ]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600" <file name="/etc/libnss-mysql.cfg" chown="root:root"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \ getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \ FROM ftp_users \
@@ -4584,7 +4595,8 @@ aliases: files
<visibility mode="notisdir">/etc/insserv/overrides</visibility> <visibility mode="notisdir">/etc/insserv/overrides</visibility>
<content><![CDATA[mkdir -p /etc/insserv/overrides]]></content> <content><![CDATA[mkdir -p /etc/insserv/overrides]]></content>
</command> </command>
<file name="/etc/insserv/overrides/apache2" chown="root:root" chmod="0644"> <file name="/etc/insserv/overrides/apache2" chown="root:root"
chmod="0644">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}</visibility> <visibility mode="equals" value="apache2">{{settings.system.webserver}}</visibility>
<content><![CDATA[ <content><![CDATA[
#!/bin/sh #!/bin/sh
@@ -4599,7 +4611,8 @@ aliases: files
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/insserv/overrides/lighttpd" chown="root:root" chmod="0644"> <file name="/etc/insserv/overrides/lighttpd" chown="root:root"
chmod="0644">
<visibility mode="equals" value="lighttpd">{{settings.system.webserver}}</visibility> <visibility mode="equals" value="lighttpd">{{settings.system.webserver}}</visibility>
<content><![CDATA[ <content><![CDATA[
#!/bin/sh #!/bin/sh
@@ -4616,7 +4629,8 @@ aliases: files
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/insserv/overrides/nginx" chown="root:root" chmod="0644"> <file name="/etc/insserv/overrides/nginx" chown="root:root"
chmod="0644">
<visibility mode="equals" value="nginx">{{settings.system.webserver}}</visibility> <visibility mode="equals" value="nginx">{{settings.system.webserver}}</visibility>
<content><![CDATA[ <content><![CDATA[
#!/bin/sh #!/bin/sh
@@ -4631,7 +4645,8 @@ aliases: files
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/insserv/overrides/nscd" chown="root:root" chmod="0644"> <file name="/etc/insserv/overrides/nscd" chown="root:root"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
#!/bin/sh #!/bin/sh
### BEGIN INIT INFO ### BEGIN INIT INFO
@@ -4647,7 +4662,8 @@ aliases: files
</file> </file>
</daemon> </daemon>
<!-- libnss-extrausers --> <!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install> <install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1"> <commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command> <command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -4687,7 +4703,8 @@ aliases: files
<!-- Logrotate --> <!-- Logrotate -->
<daemon name="logrotate" title="Logrotate"> <daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install> <install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644"> <file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
# #
# Froxlor logrotate snipet # Froxlor logrotate snipet
@@ -4722,12 +4739,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php5]]></command> <command><![CDATA[a2dismod php5]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>
<!-- PHP-FPM --> <!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)"> <daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<commands index="1"> <commands index="1">
<visibility mode="equals" value="apache2">{{settings.system.webserver}} <visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility> </visibility>
@@ -4765,7 +4783,7 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command> <command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Ubuntu" codename="Precise" version="12.04" defaulteditor="/usr/bin/nano" deprecated="true"> <distribution name="Ubuntu" codename="Precise"
version="12.04" defaulteditor="/usr/bin/nano" deprecated="true">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">
@@ -370,8 +371,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -386,7 +387,8 @@ gmysql-password=
</file> </file>
<command><![CDATA[/etc/init.d/pdns restart]]></command> <command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon> </daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend"> <daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600"> <file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[ <content><![CDATA[
@@ -410,8 +412,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any speficied: <AXFRSERVERS> # add these entries to the list if any speficied: <AXFRSERVERS>
@@ -453,8 +455,8 @@ local-address=<SERVERIP>,127.0.0.1
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command> <command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands> </commands>
<files index="0"> <files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -498,8 +500,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -510,8 +512,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -558,8 +560,8 @@ root: root@<SERVERNAME>
</include> </include>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## General Postfix configuration ## General Postfix configuration
# FQDN from Froxlor # FQDN from Froxlor
@@ -654,8 +656,8 @@ debugger_command =
</content> </content>
</file> </file>
<include>//service[@type='smtp']/general/files[@index=0]</include> <include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/master.cf" chown="root:root"
backup="true" mode="append"> chmod="0644" backup="true" mode="append">
<content><![CDATA[ <content><![CDATA[
# Add these lines to be able to use dovecot as delivery agent # Add these lines to be able to use dovecot as delivery agent
# Dovecot LDA # Dovecot LDA
@@ -676,8 +678,8 @@ dovecot unix - n n - - pipe
<install><![CDATA[apt-get install libsasl2-2 libsasl2-modules libsasl2-modules-sql]]></install> <install><![CDATA[apt-get install libsasl2-2 libsasl2-modules libsasl2-modules-sql]]></install>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## General Postfix configuration ## General Postfix configuration
# should be the default domain from your provider eg. "server100.provider.tld" # should be the default domain from your provider eg. "server100.provider.tld"
@@ -791,7 +793,8 @@ sql_select: SELECT password FROM mail_users WHERE username='%u@%r' OR email='%u@
<!-- IMAP/POP3 services --> <!-- IMAP/POP3 services -->
<service type="mail" title="{{lng.admin.configfiles.mail}}"> <service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- Dovecot --> <!-- Dovecot -->
<daemon name="dovecot" version="2" title="Dovecot" default="true"> <daemon name="dovecot" version="2" title="Dovecot"
default="true">
<install><![CDATA[apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix dovecot-mysql dovecot-managesieved dovecot-sieve mail-stack-delivery]]></install> <install><![CDATA[apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix dovecot-mysql dovecot-managesieved dovecot-sieve mail-stack-delivery]]></install>
<file name="/etc/dovecot/conf.d/01-mail-stack-delivery.conf" <file name="/etc/dovecot/conf.d/01-mail-stack-delivery.conf"
chown="root:root" chmod="0644" backup="true"> chown="root:root" chmod="0644" backup="true">
@@ -882,8 +885,8 @@ service auth {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/10-auth.conf" chown="root:root" <file name="/etc/dovecot/conf.d/10-auth.conf"
chmod="0640" backup="true"> chown="root:root" chmod="0640" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## Authentication processes ## Authentication processes
@@ -1015,7 +1018,8 @@ auth_mechanisms = plain login
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/auth-sql.conf.ext" chown="root:0" chmod="0644" backup="true"> <file name="/etc/dovecot/conf.d/auth-sql.conf.ext"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
passdb { passdb {
driver = sql driver = sql
@@ -1045,8 +1049,8 @@ iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
<!-- Courier --> <!-- Courier -->
<daemon name="courier" title="Courier"> <daemon name="courier" title="Courier">
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install> <install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600" <file name="/etc/courier/authdaemonrc" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $ ##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $
# #
@@ -1119,8 +1123,8 @@ authdaemonvar=/var/run/courier/authdaemon
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/courier/authmysqlrc" chown="root:0" chmod="0600" <file name="/etc/courier/authmysqlrc" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
MYSQL_SERVER <SQL_HOST> MYSQL_SERVER <SQL_HOST>
MYSQL_USERNAME <SQL_UNPRIVILEGED_USER> MYSQL_USERNAME <SQL_UNPRIVILEGED_USER>
@@ -1148,7 +1152,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
<!-- Proftpd --> <!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true"> <daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install> <install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700"> <file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash <content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -1160,8 +1165,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command> <command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command> <command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands> </commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600" <file name="/etc/proftpd/proftpd.conf" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file. # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -1296,8 +1301,8 @@ Include /etc/proftpd/tls.conf
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644" <file name="/etc/proftpd/modules.conf" chown="root:0"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# This file is used to manage DSO modules and features. # This file is used to manage DSO modules and features.
@@ -1403,7 +1408,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true"> <file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
<IfModule mod_tls.c> <IfModule mod_tls.c>
TLSEngine on TLSEngine on
@@ -1435,14 +1441,15 @@ TLSVerifyClient off
<!-- Pureftpd --> <!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd"> <daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install> <install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
1000 1000
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0" <file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
/etc/pure-ftpd/db/mysql.conf /etc/pure-ftpd/db/mysql.conf
]]> ]]>
@@ -1469,8 +1476,8 @@ yes
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0" <file name="/etc/pure-ftpd/conf/PAMAuthentication"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
no no
]]> ]]>
@@ -1500,7 +1507,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
21 21
]]> ]]>
@@ -1523,7 +1531,8 @@ UPLOADGID=
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob --> <!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true"> <daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640"> <file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[ <content><![CDATA[
# #
@@ -1542,7 +1551,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command> <command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon> </daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)"> <daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command> <command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -1551,10 +1561,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command> <command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon> </daemon>
<!-- libnss-mysql --> <!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install libnss-mysql-bg nscd]]></install> <install><![CDATA[apt-get install libnss-mysql-bg nscd]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600" <file name="/etc/libnss-mysql.cfg" chown="root:root"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \ getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \ FROM ftp_users \
@@ -1646,7 +1657,8 @@ aliases: files
<command><![CDATA[nscd --invalidate=group]]></command> <command><![CDATA[nscd --invalidate=group]]></command>
</daemon> </daemon>
<!-- libnss-extrausers --> <!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install> <install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1"> <commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command> <command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -1686,7 +1698,8 @@ aliases: files
<!-- Logrotate --> <!-- Logrotate -->
<daemon name="logrotate" title="Logrotate"> <daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install> <install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644"> <file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
# #
# Froxlor logrotate snipet # Froxlor logrotate snipet
@@ -1721,12 +1734,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php5]]></command> <command><![CDATA[a2dismod php5]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>
<!-- PHP-FPM --> <!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)"> <daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<commands index="1"> <commands index="1">
<visibility mode="equals" value="apache2">{{settings.system.webserver}} <visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility> </visibility>
@@ -1764,7 +1778,7 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command> <command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="RHEL / CentOS" version="7" defaulteditor="/usr/bin/nano"> <distribution name="RHEL / CentOS" version="7"
defaulteditor="/usr/bin/nano">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">
@@ -87,8 +88,8 @@ Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath}
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command> <command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands> </commands>
<files index="0"> <files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -132,8 +133,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -144,8 +145,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -164,16 +165,16 @@ query = SELECT gid FROM mail_users WHERE email = '%s'
</commands> </commands>
</general> </general>
<!-- postfix with dovecot --> <!-- postfix with dovecot -->
<daemon name="postfix_dovecot" version="2.10" title="Postfix with dovecot" <daemon name="postfix_dovecot" version="2.10"
default="true"> title="Postfix with dovecot" default="true">
<include>//service[@type='smtp']/general/commands[@index=1] <include>//service[@type='smtp']/general/commands[@index=1]
</include> </include>
<include>//service[@type='smtp']/general/installs[@index=1] <include>//service[@type='smtp']/general/installs[@index=1]
</include> </include>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## General Postfix configuration ## General Postfix configuration
# FQDN from Froxlor # FQDN from Froxlor
@@ -262,8 +263,8 @@ debugger_command =
</content> </content>
</file> </file>
<include>//service[@type='smtp']/general/files[@index=0]</include> <include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/master.cf" chown="root:root"
backup="true" mode="append"> chmod="0644" backup="true" mode="append">
<content><![CDATA[ <content><![CDATA[
# added for Froxlor # added for Froxlor
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient} dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
@@ -277,7 +278,8 @@ dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dove
<!-- IMAP/POP3 services --> <!-- IMAP/POP3 services -->
<service type="mail" title="{{lng.admin.configfiles.mail}}"> <service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- Dovecot --> <!-- Dovecot -->
<daemon name="dovecot" version="2.2" title="Dovecot" default="true"> <daemon name="dovecot" version="2.2" title="Dovecot"
default="true">
<install><![CDATA[yum install dovecot dovecot-mysql dovecot-pigeonhole]]></install> <install><![CDATA[yum install dovecot dovecot-mysql dovecot-pigeonhole]]></install>
<file name="/etc/dovecot/dovecot.conf" chown="root:root" <file name="/etc/dovecot/dovecot.conf" chown="root:root"
chmod="0644" backup="true"> chmod="0644" backup="true">
@@ -504,8 +506,8 @@ auth_mechanisms = plain
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/10-logging.conf" chown="root:0" <file name="/etc/dovecot/conf.d/10-logging.conf"
chmod="0644" backup="true"> chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## Log destination. ## Log destination.
@@ -1215,8 +1217,8 @@ protocol lda {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/15-mailboxes.conf" chown="root:0" <file name="/etc/dovecot/conf.d/15-mailboxes.conf"
chmod="0644" backup="true"> chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## Mailbox definitions ## Mailbox definitions
@@ -1364,8 +1366,8 @@ protocol lmtp {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0" <file name="/etc/dovecot/conf.d/20-managesieve.conf"
chmod="0644" backup="true"> chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## ManageSieve specific settings ## ManageSieve specific settings
@@ -1821,10 +1823,11 @@ iterate_query = SELECT username AS user FROM mail_users
<!-- FTP services --> <!-- FTP services -->
<service type="ftp" title="{{lng.admin.configfiles.ftp}}"> <service type="ftp" title="{{lng.admin.configfiles.ftp}}">
<!-- Proftpd --> <!-- Proftpd -->
<daemon name="proftpd" version="1.3" title="ProFTPd" default="true"> <daemon name="proftpd" version="1.3" title="ProFTPd"
default="true">
<install><![CDATA[yum install proftpd proftpd-mysql]]></install> <install><![CDATA[yum install proftpd proftpd-mysql]]></install>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600" <file name="/etc/proftpd/proftpd.conf" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# This is the ProFTPD configuration file # This is the ProFTPD configuration file
# #
@@ -2284,7 +2287,8 @@ ControlsLog /var/log/proftpd/controls.log
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob --> <!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true"> <daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640"> <file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[ <content><![CDATA[
# #
@@ -2303,17 +2307,19 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command> <command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon> </daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)"> <daemon name="awstats"
title="Awstats (webalizer alternative)">
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[rm /etc/cron.d/awstats]]></command> <command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon> </daemon>
<!-- libnss-mysql --> <!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[yum --enablerepo=extras install epel-release]]></install> <install><![CDATA[yum --enablerepo=extras install epel-release]]></install>
<install><![CDATA[yum install libnss-mysql nscd]]></install> <install><![CDATA[yum install libnss-mysql nscd]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600" <file name="/etc/libnss-mysql.cfg" chown="root:root"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \ getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \ FROM ftp_users \
@@ -2413,7 +2419,8 @@ aliases: files nisplus
<!-- Logrotate --> <!-- Logrotate -->
<daemon name="logrotate" title="Logrotate"> <daemon name="logrotate" title="Logrotate">
<install><![CDATA[yum install logrotate]]></install> <install><![CDATA[yum install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644"> <file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
# #
# Froxlor logrotate snipet # Froxlor logrotate snipet

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Debian" codename="Stretch" version="9.x" defaulteditor="/bin/nano"> <distribution name="Debian" codename="Stretch"
version="9.x" defaulteditor="/bin/nano">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">
@@ -43,7 +44,8 @@
</commands> </commands>
</general> </general>
<!-- HTTP Apache --> <!-- HTTP Apache -->
<daemon name="apache" version="2.4" title="Apache 2.4" default="true"> <daemon name="apache" version="2.4" title="Apache 2.4"
default="true">
<install><![CDATA[apt-get install apache2]]></install> <install><![CDATA[apt-get install apache2]]></install>
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
@@ -893,8 +895,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -909,7 +911,8 @@ gmysql-password=
</file> </file>
<command><![CDATA[/etc/init.d/pdns restart]]></command> <command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon> </daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend"> <daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600"> <file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[ <content><![CDATA[
@@ -1436,8 +1439,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
# Bind backend configuration # Bind backend configuration
@@ -1483,8 +1486,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command> <command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands> </commands>
<files index="0"> <files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1528,8 +1531,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1540,8 +1543,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1588,8 +1591,8 @@ root: root@<SERVERNAME>
</include> </include>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# Global Postfix configuration file. This file lists only a subset # Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter # of all parameters. For the syntax, and for a complete parameter
@@ -2334,8 +2337,8 @@ virtual_mailbox_limit = 0
</content> </content>
</file> </file>
<include>//service[@type='smtp']/general/files[@index=0]</include> <include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/master.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# Postfix master process configuration file. For details on the format # Postfix master process configuration file. For details on the format
@@ -2586,8 +2589,8 @@ dict {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root" <file name="/etc/dovecot/dovecot-sql.conf.ext"
chmod="0600" backup="true"> chown="root:root" chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# This file is commonly accessed via passdb {} or userdb {} section in # This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext # conf.d/auth-sql.conf.ext
@@ -3246,8 +3249,8 @@ mail_access_groups = vmail
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/10-master.conf" chown="root:0" <file name="/etc/dovecot/conf.d/10-master.conf"
chmod="0644" backup="true"> chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
#default_process_limit = 100 #default_process_limit = 100
#default_client_limit = 1000 #default_client_limit = 1000
@@ -3569,8 +3572,8 @@ protocol imap {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0" <file name="/etc/dovecot/conf.d/20-managesieve.conf"
chmod="0644" backup="true"> chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## ManageSieve specific settings ## ManageSieve specific settings
@@ -3872,8 +3875,8 @@ plugin {
</commands> </commands>
</general> </general>
<!-- Dovecot with postfix --> <!-- Dovecot with postfix -->
<daemon name="dovecot_postfix" version="2" title="Dovecot with postfix" <daemon name="dovecot_postfix" version="2"
default="true"> title="Dovecot with postfix" default="true">
<include>//service[@type='mail']/general/installs[@index=1] <include>//service[@type='mail']/general/installs[@index=1]
</include> </include>
<include>//service[@type='mail']/general/files[@index=1] <include>//service[@type='mail']/general/files[@index=1]
@@ -3887,7 +3890,8 @@ plugin {
<!-- Proftpd --> <!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true"> <daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install> <install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700"> <file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash <content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -3899,8 +3903,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command> <command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command> <command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands> </commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600" <file name="/etc/proftpd/proftpd.conf" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file. # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -4094,8 +4098,8 @@ Include /etc/proftpd/conf.d/
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644" <file name="/etc/proftpd/modules.conf" chown="root:0"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# This file is used to manage DSO modules and features. # This file is used to manage DSO modules and features.
@@ -4262,7 +4266,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true"> <file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
<IfModule mod_tls.c> <IfModule mod_tls.c>
TLSEngine on TLSEngine on
@@ -4294,14 +4299,15 @@ TLSVerifyClient off
<!-- Pureftpd --> <!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd"> <daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install> <install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
1000 1000
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0" <file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
/etc/pure-ftpd/db/mysql.conf /etc/pure-ftpd/db/mysql.conf
]]> ]]>
@@ -4328,8 +4334,8 @@ yes
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0" <file name="/etc/pure-ftpd/conf/PAMAuthentication"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
no no
]]> ]]>
@@ -4475,7 +4481,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
21 21
]]> ]]>
@@ -4519,7 +4526,8 @@ UPLOADGID=
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob --> <!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true"> <daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640"> <file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[ <content><![CDATA[
# #
@@ -4538,7 +4546,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command> <command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon> </daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)"> <daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command> <command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -4547,7 +4556,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command> <command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon> </daemon>
<!-- libnss-extrausers --> <!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install> <install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1"> <commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command> <command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -4587,7 +4597,8 @@ aliases: files
<!-- Logrotate --> <!-- Logrotate -->
<daemon name="logrotate" title="Logrotate"> <daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install> <install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644"> <file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
# #
# Froxlor logrotate snipet # Froxlor logrotate snipet
@@ -4622,12 +4633,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.0]]></command> <command><![CDATA[a2dismod php7.0]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>
<!-- PHP-FPM --> <!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)"> <daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<install> <install>
<visibility mode="equals" value="apache2">{{settings.system.webserver}} <visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility> </visibility>
@@ -4659,7 +4671,7 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command> <command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Ubuntu" codename="Trusty" version="14.04" defaulteditor="/usr/bin/nano"> <distribution name="Ubuntu" codename="Trusty"
version="14.04" defaulteditor="/usr/bin/nano">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">
@@ -408,8 +409,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -424,7 +425,8 @@ gmysql-password=
</file> </file>
<command><![CDATA[service pdns restart]]></command> <command><![CDATA[service pdns restart]]></command>
</daemon> </daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend"> <daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true"> <file name="/etc/powerdns/pdns.conf" backup="true">
<content><![CDATA[ <content><![CDATA[
@@ -450,8 +452,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any speficied: <AXFRSERVERS> # add these entries to the list if any speficied: <AXFRSERVERS>
@@ -493,8 +495,8 @@ local-address=<SERVERIP>,127.0.0.1
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command> <command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands> </commands>
<files index="0"> <files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -538,8 +540,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -550,8 +552,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -598,8 +600,8 @@ root: root@<SERVERNAME>
</include> </include>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## General Postfix configuration ## General Postfix configuration
# FQDN from Froxlor # FQDN from Froxlor
@@ -694,8 +696,8 @@ debugger_command =
</content> </content>
</file> </file>
<include>//service[@type='smtp']/general/files[@index=0]</include> <include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/master.cf" chown="root:root"
backup="true" mode="append"> chmod="0644" backup="true" mode="append">
<content><![CDATA[ <content><![CDATA[
# Add these lines to be able to use dovecot as delivery agent # Add these lines to be able to use dovecot as delivery agent
# Dovecot LDA # Dovecot LDA
@@ -716,8 +718,8 @@ dovecot unix - n n - - pipe
<install><![CDATA[apt-get install libsasl2-2 libsasl2-modules libsasl2-modules-sql]]></install> <install><![CDATA[apt-get install libsasl2-2 libsasl2-modules libsasl2-modules-sql]]></install>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## General Postfix configuration ## General Postfix configuration
# should be the default domain from your provider eg. "server100.provider.tld" # should be the default domain from your provider eg. "server100.provider.tld"
@@ -831,7 +833,8 @@ sql_select: SELECT password FROM mail_users WHERE username='%u@%r' OR email='%u@
<!-- IMAP/POP3 services --> <!-- IMAP/POP3 services -->
<service type="mail" title="{{lng.admin.configfiles.mail}}"> <service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- Dovecot --> <!-- Dovecot -->
<daemon name="dovecot" version="2" title="Dovecot" default="true"> <daemon name="dovecot" version="2" title="Dovecot"
default="true">
<install><![CDATA[apt-get install dovecot-imapd dovecot-pop3d dovecot-mysql mail-stack-delivery]]></install> <install><![CDATA[apt-get install dovecot-imapd dovecot-pop3d dovecot-mysql mail-stack-delivery]]></install>
<file name="/etc/dovecot/conf.d/99-mail-stack-delivery.conf" <file name="/etc/dovecot/conf.d/99-mail-stack-delivery.conf"
chown="root:root" chmod="0644" backup="true"> chown="root:root" chmod="0644" backup="true">
@@ -909,8 +912,8 @@ service auth {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/10-auth.conf" chown="root:root" <file name="/etc/dovecot/conf.d/10-auth.conf"
chmod="0644" backup="true"> chown="root:root" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## Authentication processes ## Authentication processes
@@ -1059,8 +1062,8 @@ iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
<!-- Courier --> <!-- Courier -->
<daemon name="courier" title="Courier"> <daemon name="courier" title="Courier">
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install> <install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600" <file name="/etc/courier/authdaemonrc" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $ ##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $
# #
@@ -1133,8 +1136,8 @@ authdaemonvar=/var/run/courier/authdaemon
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/courier/authmysqlrc" chown="root:0" chmod="0600" <file name="/etc/courier/authmysqlrc" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
MYSQL_SERVER <SQL_HOST> MYSQL_SERVER <SQL_HOST>
MYSQL_USERNAME <SQL_UNPRIVILEGED_USER> MYSQL_USERNAME <SQL_UNPRIVILEGED_USER>
@@ -1162,7 +1165,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
<!-- Proftpd --> <!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true"> <daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install> <install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700"> <file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash <content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -1174,8 +1178,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command> <command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command> <command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands> </commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600" <file name="/etc/proftpd/proftpd.conf" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file. # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -1310,8 +1314,8 @@ Include /etc/proftpd/tls.conf
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644" <file name="/etc/proftpd/modules.conf" chown="root:0"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# This file is used to manage DSO modules and features. # This file is used to manage DSO modules and features.
@@ -1417,7 +1421,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true"> <file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
<IfModule mod_tls.c> <IfModule mod_tls.c>
TLSEngine on TLSEngine on
@@ -1449,14 +1454,15 @@ TLSVerifyClient off
<!-- Pureftpd --> <!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd"> <daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install> <install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
1000 1000
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0" <file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
/etc/pure-ftpd/db/mysql.conf /etc/pure-ftpd/db/mysql.conf
]]> ]]>
@@ -1483,8 +1489,8 @@ yes
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0" <file name="/etc/pure-ftpd/conf/PAMAuthentication"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
no no
]]> ]]>
@@ -1514,7 +1520,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
21 21
]]> ]]>
@@ -1537,7 +1544,8 @@ UPLOADGID=
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob --> <!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true"> <daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640"> <file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[ <content><![CDATA[
# #
@@ -1556,7 +1564,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command> <command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon> </daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)"> <daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command> <command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -1565,10 +1574,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command> <command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon> </daemon>
<!-- libnss-mysql --> <!-- libnss-mysql -->
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnss"
title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install libnss-mysql-bg nscd]]></install> <install><![CDATA[apt-get install libnss-mysql-bg nscd]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600" <file name="/etc/libnss-mysql.cfg" chown="root:root"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \ getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \ FROM ftp_users \
@@ -1660,7 +1670,8 @@ aliases: files
<command><![CDATA[nscd --invalidate=group]]></command> <command><![CDATA[nscd --invalidate=group]]></command>
</daemon> </daemon>
<!-- libnss-extrausers --> <!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install> <install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1"> <commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command> <command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -1700,7 +1711,8 @@ aliases: files
<!-- Logrotate --> <!-- Logrotate -->
<daemon name="logrotate" title="Logrotate"> <daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install> <install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644"> <file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
# #
# Froxlor logrotate snipet # Froxlor logrotate snipet
@@ -1735,12 +1747,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php5]]></command> <command><![CDATA[a2dismod php5]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>
<!-- PHP-FPM --> <!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)"> <daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<commands index="1"> <commands index="1">
<visibility mode="equals" value="apache2">{{settings.system.webserver}} <visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility> </visibility>
@@ -1778,7 +1791,7 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command> <command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Ubuntu" codename="Xenial" version="16.04.x" defaulteditor="/bin/nano"> <distribution name="Ubuntu" codename="Xenial"
version="16.04.x" defaulteditor="/bin/nano">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">
@@ -43,7 +44,8 @@
</commands> </commands>
</general> </general>
<!-- HTTP Apache --> <!-- HTTP Apache -->
<daemon name="apache" version="2.4" title="Apache 2.4" default="true"> <daemon name="apache" version="2.4" title="Apache 2.4"
default="true">
<install><![CDATA[apt-get install apache2]]></install> <install><![CDATA[apt-get install apache2]]></install>
<include>//service[@type='http']/general/commands</include> <include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command> <command><![CDATA[a2dismod userdir]]></command>
@@ -904,8 +906,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -920,7 +922,8 @@ gmysql-password=
</file> </file>
<command><![CDATA[/etc/init.d/pdns restart]]></command> <command><![CDATA[/etc/init.d/pdns restart]]></command>
</daemon> </daemon>
<daemon name="powerdns_bind" title="PowerDNS via bind-backend"> <daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600"> <file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[ <content><![CDATA[
@@ -1447,8 +1450,8 @@ include-dir=/etc/powerdns/froxlor/
</content> </content>
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chmod="600"> chown="root:root" chmod="600">
<content><![CDATA[ <content><![CDATA[
# Bind backend configuration # Bind backend configuration
@@ -1494,8 +1497,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command> <command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands> </commands>
<files index="0"> <files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1539,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1551,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix" <file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chmod="0640"> chown="root:postfix" chmod="0640">
<content><![CDATA[ <content><![CDATA[
user = <SQL_UNPRIVILEGED_USER> user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD> password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1599,8 +1602,8 @@ root: root@<SERVERNAME>
</include> </include>
<include>//service[@type='smtp']/general/commands[@index=2] <include>//service[@type='smtp']/general/commands[@index=2]
</include> </include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/main.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# Global Postfix configuration file. This file lists only a subset # Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter # of all parameters. For the syntax, and for a complete parameter
@@ -2345,8 +2348,8 @@ virtual_mailbox_limit = 0
</content> </content>
</file> </file>
<include>//service[@type='smtp']/general/files[@index=0]</include> <include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644" <file name="/etc/postfix/master.cf" chown="root:root"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# Postfix master process configuration file. For details on the format # Postfix master process configuration file. For details on the format
@@ -2597,8 +2600,8 @@ dict {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root" <file name="/etc/dovecot/dovecot-sql.conf.ext"
chmod="0600" backup="true"> chown="root:root" chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# This file is commonly accessed via passdb {} or userdb {} section in # This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext # conf.d/auth-sql.conf.ext
@@ -3257,8 +3260,8 @@ mail_access_groups = vmail
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/10-master.conf" chown="root:0" <file name="/etc/dovecot/conf.d/10-master.conf"
chmod="0644" backup="true"> chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
#default_process_limit = 100 #default_process_limit = 100
#default_client_limit = 1000 #default_client_limit = 1000
@@ -3580,8 +3583,8 @@ protocol imap {
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0" <file name="/etc/dovecot/conf.d/20-managesieve.conf"
chmod="0644" backup="true"> chown="root:0" chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
## ##
## ManageSieve specific settings ## ManageSieve specific settings
@@ -3883,8 +3886,8 @@ plugin {
</commands> </commands>
</general> </general>
<!-- Dovecot with postfix --> <!-- Dovecot with postfix -->
<daemon name="dovecot_postfix" version="2" title="Dovecot with postfix" <daemon name="dovecot_postfix" version="2"
default="true"> title="Dovecot with postfix" default="true">
<include>//service[@type='mail']/general/installs[@index=1] <include>//service[@type='mail']/general/installs[@index=1]
</include> </include>
<include>//service[@type='mail']/general/files[@index=1] <include>//service[@type='mail']/general/files[@index=1]
@@ -3898,7 +3901,8 @@ plugin {
<!-- Proftpd --> <!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true"> <daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install> <install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700"> <file name="/etc/proftpd/create-cert.sh" chown="root:0"
chmod="0700">
<content><![CDATA[#!/bin/bash <content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>" [ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
@@ -3910,8 +3914,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command> <command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command> <command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands> </commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600" <file name="/etc/proftpd/proftpd.conf" chown="root:0"
backup="true"> chmod="0600" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file. # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -4105,8 +4109,8 @@ Include /etc/proftpd/conf.d/
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644" <file name="/etc/proftpd/modules.conf" chown="root:0"
backup="true"> chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
# #
# This file is used to manage DSO modules and features. # This file is used to manage DSO modules and features.
@@ -4273,7 +4277,8 @@ SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},%{5}, %{6}
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/proftpd/tls.conf" chown="root:root" chmod="0644" backup="true"> <file name="/etc/proftpd/tls.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[ <content><![CDATA[
<IfModule mod_tls.c> <IfModule mod_tls.c>
TLSEngine on TLSEngine on
@@ -4305,14 +4310,15 @@ TLSVerifyClient off
<!-- Pureftpd --> <!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd"> <daemon name="pureftpd" title="PureFTPd">
<install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install> <install><![CDATA[apt-get install pure-ftpd-common pure-ftpd-mysql]]></install>
<file name="/etc/pure-ftpd/conf/MinUID" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/MinUID" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
1000 1000
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0" <file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
/etc/pure-ftpd/db/mysql.conf /etc/pure-ftpd/db/mysql.conf
]]> ]]>
@@ -4339,8 +4345,8 @@ yes
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0" <file name="/etc/pure-ftpd/conf/PAMAuthentication"
chmod="0644"> chown="root:0" chmod="0644">
<content><![CDATA[ <content><![CDATA[
no no
]]> ]]>
@@ -4486,7 +4492,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]> ]]>
</content> </content>
</file> </file>
<file name="/etc/pure-ftpd/conf/Bind" chown="root:0" chmod="0644"> <file name="/etc/pure-ftpd/conf/Bind" chown="root:0"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
21 21
]]> ]]>
@@ -4530,7 +4537,8 @@ UPLOADGID=
<!-- System tools/services --> <!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}"> <service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob --> <!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor" mandatory="true"> <daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640"> <file name="/etc/cron.d/froxlor" chown="root:0" chmod="0640">
<content><![CDATA[ <content><![CDATA[
# #
@@ -4549,7 +4557,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command> <command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon> </daemon>
<!-- AWstats --> <!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)"> <daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install> <install><![CDATA[apt-get install awstats]]></install>
<command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command> <command><![CDATA[cp /usr/share/awstats/tools/awstats_buildstaticpages.pl {{settings.system.awstats_path}}]]></command>
<command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command> <command><![CDATA[mv {{settings.system.awstats_conf}}/awstats.conf {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
@@ -4558,7 +4567,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[rm /etc/cron.d/awstats]]></command> <command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon> </daemon>
<!-- libnss-extrausers --> <!-- libnss-extrausers -->
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)"> <daemon name="libnssextrausers"
title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install> <install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
<commands index="1"> <commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command> <command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -4598,7 +4608,8 @@ aliases: files
<!-- Logrotate --> <!-- Logrotate -->
<daemon name="logrotate" title="Logrotate"> <daemon name="logrotate" title="Logrotate">
<install><![CDATA[apt-get install logrotate]]></install> <install><![CDATA[apt-get install logrotate]]></install>
<file name="/etc/logrotate.d/froxlor" chown="root:root" chmod="0644"> <file name="/etc/logrotate.d/froxlor" chown="root:root"
chmod="0644">
<content><![CDATA[ <content><![CDATA[
# #
# Froxlor logrotate snipet # Froxlor logrotate snipet
@@ -4633,12 +4644,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.0]]></command> <command><![CDATA[a2dismod php7.0]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>
<!-- PHP-FPM --> <!-- PHP-FPM -->
<daemon name="php-fpm" title="PHP-FPM (alternative to mod_php)"> <daemon name="php-fpm"
title="PHP-FPM (alternative to mod_php)">
<install> <install>
<visibility mode="equals" value="apache2">{{settings.system.webserver}} <visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility> </visibility>
@@ -4670,7 +4682,7 @@ aliases: files
</visibility> </visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command> <command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command> <command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon> </daemon>

View File

@@ -1,5 +1,4 @@
<?php <?php
if (! defined('MASTER_CRONJOB')) if (! defined('MASTER_CRONJOB'))
die('You cannot access this file directly!'); die('You cannot access this file directly!');

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'admin_add' => array( 'admin_add' => array(
'title' => $lng['admin']['admin_add'], 'title' => $lng['admin']['admin_add'],
@@ -39,7 +38,7 @@ return array(
'label' => $lng['customer']['generated_pwd'], 'label' => $lng['customer']['generated_pwd'],
'type' => 'text', 'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(), 'value' => \Froxlor\System\Crypt::generatePassword()
), ),
'def_language' => array( 'def_language' => array(
'label' => $lng['login']['language'], 'label' => $lng['login']['language'],
@@ -74,7 +73,10 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'], 'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array() 'value' => array()
) )
@@ -93,8 +95,11 @@ return array(
'label' => $lng['admin']['change_serversettings'], 'label' => $lng['admin']['change_serversettings'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array() 'value' => array()
), ),
'customers' => array( 'customers' => array(
@@ -109,8 +114,11 @@ return array(
'label' => $lng['admin']['customers_see_all'], 'label' => $lng['admin']['customers_see_all'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array() 'value' => array()
), ),
'domains' => array( 'domains' => array(
@@ -125,16 +133,22 @@ return array(
'label' => $lng['admin']['domains_see_all'], 'label' => $lng['admin']['domains_see_all'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array() 'value' => array()
), ),
'caneditphpsettings' => array( 'caneditphpsettings' => array(
'label' => $lng['admin']['caneditphpsettings'], 'label' => $lng['admin']['caneditphpsettings'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array() 'value' => array()
), ),
'diskspace' => array( 'diskspace' => array(

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'admin_edit' => array( 'admin_edit' => array(
'title' => $lng['admin']['admin_edit'], 'title' => $lng['admin']['admin_edit'],
@@ -32,14 +31,19 @@ return array(
'deactivated' => array( 'deactivated' => array(
'label' => $lng['admin']['deactivated_user'], 'label' => $lng['admin']['deactivated_user'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => array($result['deactivated']), 'value' => '1'
)
),
'value' => array(
$result['deactivated']
),
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
), ),
'admin_password' => array( 'admin_password' => array(
'label' => $lng['login']['password'].'&nbsp;('.$lng['panel']['emptyfornochanges'].')', 'label' => $lng['login']['password'] . '&nbsp;(' . $lng['panel']['emptyfornochanges'] . ')',
'type' => 'password', 'type' => 'password',
'autocomplete' => 'off', 'autocomplete' => 'off',
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
@@ -88,9 +92,14 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'], 'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['custom_notes_show']) 'value' => array(
$result['custom_notes_show']
)
) )
) )
), ),
@@ -107,10 +116,15 @@ return array(
'change_serversettings' => array( 'change_serversettings' => array(
'label' => $lng['admin']['change_serversettings'], 'label' => $lng['admin']['change_serversettings'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => array($result['change_serversettings']) 'value' => '1'
)
),
'value' => array(
$result['change_serversettings']
)
), ),
'customers' => array( 'customers' => array(
'label' => $lng['admin']['customers'], 'label' => $lng['admin']['customers'],
@@ -123,10 +137,15 @@ return array(
'customers_see_all' => array( 'customers_see_all' => array(
'label' => $lng['admin']['customers_see_all'], 'label' => $lng['admin']['customers_see_all'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => array($result['customers_see_all']) 'value' => '1'
)
),
'value' => array(
$result['customers_see_all']
)
), ),
'domains' => array( 'domains' => array(
'label' => $lng['admin']['domains'], 'label' => $lng['admin']['domains'],
@@ -139,18 +158,28 @@ return array(
'domains_see_all' => array( 'domains_see_all' => array(
'label' => $lng['admin']['domains_see_all'], 'label' => $lng['admin']['domains_see_all'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => array($result['domains_see_all']) 'value' => '1'
)
),
'value' => array(
$result['domains_see_all']
)
), ),
'caneditphpsettings' => array( 'caneditphpsettings' => array(
'label' => $lng['admin']['caneditphpsettings'], 'label' => $lng['admin']['caneditphpsettings'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => array($result['caneditphpsettings']) 'value' => '1'
)
),
'value' => array(
$result['caneditphpsettings']
)
), ),
'diskspace' => array( 'diskspace' => array(
'label' => $lng['customer']['diskspace'], 'label' => $lng['customer']['diskspace'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'cronjobs_edit' => array( 'cronjobs_edit' => array(
'title' => $lng['admin']['cronjob_edit'], 'title' => $lng['admin']['cronjob_edit'],
@@ -33,9 +32,14 @@ return array(
'label' => $lng['admin']['activated'], 'label' => $lng['admin']['activated'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => array($result['isactive']) 'value' => '1'
)
),
'value' => array(
$result['isactive']
)
), ),
'interval_value' => array( 'interval_value' => array(
'label' => $lng['cronjob']['cronjobintervalv'], 'label' => $lng['cronjob']['cronjobintervalv'],

View File

@@ -159,7 +159,7 @@ return array(
) )
), ),
'section_cpre' => array( 'section_cpre' => array(
'visible' => !empty($hosting_plans), 'visible' => ! empty($hosting_plans),
'title' => $lng['admin']['plans']['use_plan'], 'title' => $lng['admin']['plans']['use_plan'],
'image' => 'icons/user_add.png', 'image' => 'icons/user_add.png',
'fields' => array( 'fields' => array(

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'customer_edit' => array( 'customer_edit' => array(
'title' => $lng['admin']['customer_edit'], 'title' => $lng['admin']['customer_edit'],
@@ -35,23 +34,33 @@ return array(
'value' => $result['documentroot'] 'value' => $result['documentroot']
), ),
'createstdsubdomain' => array( 'createstdsubdomain' => array(
'label' => $lng['admin']['stdsubdomain_add'].'?', 'label' => $lng['admin']['stdsubdomain_add'] . '?',
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array(($result['standardsubdomain'] != '0') ? '1' : '0') 'value' => array(
($result['standardsubdomain'] != '0') ? '1' : '0'
)
), ),
'deactivated' => array( 'deactivated' => array(
'label' => $lng['admin']['deactivated_user'], 'label' => $lng['admin']['deactivated_user'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['deactivated']) 'value' => array(
$result['deactivated']
)
), ),
'new_customer_password' => array( 'new_customer_password' => array(
'label' => $lng['login']['password'].'&nbsp;('.$lng['panel']['emptyfornochanges'].')', 'label' => $lng['login']['password'] . '&nbsp;(' . $lng['panel']['emptyfornochanges'] . ')',
'type' => 'password', 'type' => 'password',
'autocomplete' => 'off' 'autocomplete' => 'off'
), ),
@@ -59,7 +68,7 @@ return array(
'label' => $lng['customer']['generated_pwd'], 'label' => $lng['customer']['generated_pwd'],
'type' => 'text', 'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(), 'value' => \Froxlor\System\Crypt::generatePassword()
), ),
'def_language' => array( 'def_language' => array(
'label' => $lng['login']['language'], 'label' => $lng['login']['language'],
@@ -144,14 +153,19 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'], 'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['custom_notes_show']) 'value' => array(
$result['custom_notes_show']
)
) )
) )
), ),
'section_cpre' => array( 'section_cpre' => array(
'visible' => !empty($hosting_plans), 'visible' => ! empty($hosting_plans),
'title' => $lng['admin']['plans']['use_plan'], 'title' => $lng['admin']['plans']['use_plan'],
'image' => 'icons/user_add.png', 'image' => 'icons/user_add.png',
'fields' => array( 'fields' => array(
@@ -227,18 +241,28 @@ return array(
'label' => $lng['customer']['email_imap'], 'label' => $lng['customer']['email_imap'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['imap']
), ),
'value' => array($result['imap']),
'mandatory' => true 'mandatory' => true
), ),
'email_pop3' => array( 'email_pop3' => array(
'label' => $lng['customer']['email_pop3'], 'label' => $lng['customer']['email_pop3'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['pop3']
), ),
'value' => array($result['pop3']),
'mandatory' => true 'mandatory' => true
), ),
'ftps' => array( 'ftps' => array(
@@ -257,36 +281,51 @@ return array(
'ul_field' => $mysqls_ul 'ul_field' => $mysqls_ul
), ),
'phpenabled' => array( 'phpenabled' => array(
'label' => $lng['admin']['phpenabled'].'?', 'label' => $lng['admin']['phpenabled'] . '?',
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['phpenabled']) 'value' => array(
$result['phpenabled']
)
), ),
'allowed_phpconfigs' => array( 'allowed_phpconfigs' => array(
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false), 'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false),
'label' => $lng['admin']['phpsettings']['title'], 'label' => $lng['admin']['phpsettings']['title'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => $phpconfigs, 'values' => $phpconfigs,
'value' => isset($result['allowed_phpconfigs']) && !empty($result['allowed_phpconfigs']) ? json_decode($result['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY) : array(), 'value' => isset($result['allowed_phpconfigs']) && ! empty($result['allowed_phpconfigs']) ? json_decode($result['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY) : array(),
'is_array' => 1 'is_array' => 1
), ),
'perlenabled' => array( 'perlenabled' => array(
'label' => $lng['admin']['perlenabled'].'?', 'label' => $lng['admin']['perlenabled'] . '?',
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['perlenabled']) 'value' => array(
$result['perlenabled']
)
), ),
'dnsenabled' => array( 'dnsenabled' => array(
'label' => $lng['admin']['dnsenabled'].'?', 'label' => $lng['admin']['dnsenabled'] . '?',
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['dnsenabled']
), ),
'value' => array($result['dnsenabled']),
'visible' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false) 'visible' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false)
), ),
'logviewenabled' => array( 'logviewenabled' => array(
@@ -298,7 +337,9 @@ return array(
'value' => '1' 'value' => '1'
) )
), ),
'value' => array($result['logviewenabled']) 'value' => array(
$result['logviewenabled']
)
) )
) )
), ),

View File

@@ -155,7 +155,9 @@ return array(
'value' => '1' 'value' => '1'
) )
), ),
'value' => array('1') 'value' => array(
'1'
)
), ),
'writeerrorlog' => array( 'writeerrorlog' => array(
'label' => $lng['admin']['writeerrorlog']['title'], 'label' => $lng['admin']['writeerrorlog']['title'],
@@ -167,7 +169,9 @@ return array(
'value' => '1' 'value' => '1'
) )
), ),
'value' => array('1') 'value' => array(
'1'
)
) )
) )
), ),
@@ -216,7 +220,7 @@ return array(
'desc' => $lng['admin']['domain_http2']['description'], 'desc' => $lng['admin']['domain_http2']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ( array(
'label' => $lng['panel']['yes'], 'label' => $lng['panel']['yes'],
'value' => '1' 'value' => '1'
) )
@@ -265,22 +269,18 @@ return array(
'value' => array() 'value' => array()
), ),
'ocsp_stapling' => array( 'ocsp_stapling' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) && 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd',
\Froxlor\Settings::Get('system.webserver') != 'lighttpd',
'label' => $lng['admin']['domain_ocsp_stapling']['title'], 'label' => $lng['admin']['domain_ocsp_stapling']['title'],
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . 'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . (\Froxlor\Settings::Get('system.webserver') == 'nginx' ? $lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] : ""),
(\Froxlor\Settings::Get('system.webserver') == 'nginx' ?
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] :
""),
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ( array(
'label' => $lng['panel']['yes'], 'label' => $lng['panel']['yes'],
'value' => '1' 'value' => '1'
) )
), ),
'value' => array() 'value' => array()
), )
) )
), ),
'section_c' => array( 'section_c' => array(

View File

@@ -187,7 +187,9 @@ return array(
'value' => '1' 'value' => '1'
) )
), ),
'value' => array($result['writeaccesslog']) 'value' => array(
$result['writeaccesslog']
)
), ),
'writeerrorlog' => array( 'writeerrorlog' => array(
'label' => $lng['admin']['writeerrorlog']['title'], 'label' => $lng['admin']['writeerrorlog']['title'],
@@ -199,7 +201,9 @@ return array(
'value' => '1' 'value' => '1'
) )
), ),
'value' => array($result['writeerrorlog']) 'value' => array(
$result['writeerrorlog']
)
) )
) )
), ),
@@ -252,7 +256,7 @@ return array(
'desc' => $lng['admin']['domain_http2']['description'], 'desc' => $lng['admin']['domain_http2']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ( array(
'label' => $lng['panel']['yes'], 'label' => $lng['panel']['yes'],
'value' => '1' 'value' => '1'
) )
@@ -307,16 +311,12 @@ return array(
) )
), ),
'ocsp_stapling' => array( 'ocsp_stapling' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) && 'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd',
\Froxlor\Settings::Get('system.webserver') != 'lighttpd',
'label' => $lng['admin']['domain_ocsp_stapling']['title'], 'label' => $lng['admin']['domain_ocsp_stapling']['title'],
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . 'desc' => $lng['admin']['domain_ocsp_stapling']['description'] . (\Froxlor\Settings::Get('system.webserver') == 'nginx' ? $lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] : ""),
(\Froxlor\Settings::Get('system.webserver') == 'nginx' ?
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] :
""),
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ( array(
'label' => $lng['panel']['yes'], 'label' => $lng['panel']['yes'],
'value' => '1' 'value' => '1'
) )
@@ -324,7 +324,7 @@ return array(
'value' => array( 'value' => array(
$result['ocsp_stapling'] $result['ocsp_stapling']
) )
), )
) )
), ),
'section_c' => array( 'section_c' => array(

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'domain_import' => array( 'domain_import' => array(
'title' => $lng['domains']['domain_import'], 'title' => $lng['domains']['domain_import'],
@@ -28,7 +27,7 @@ return array(
'label' => $lng['admin']['customer'], 'label' => $lng['admin']['customer'],
'type' => 'select', 'type' => 'select',
'select_var' => $customers, 'select_var' => $customers,
'mandatory' => true, 'mandatory' => true
), ),
'separator' => array( 'separator' => array(
'label' => $lng['domains']['import_separator'], 'label' => $lng['domains']['import_separator'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'ipsandports_add' => array( 'ipsandports_add' => array(
'title' => $lng['admin']['ipsandports']['add'], 'title' => $lng['admin']['ipsandports']['add'],
@@ -40,30 +39,45 @@ return array(
'image' => 'icons/ipsports_add.png', 'image' => 'icons/ipsports_add.png',
'fields' => array( 'fields' => array(
'listen_statement' => array( 'listen_statement' => array(
'visible' => !$is_nginx, 'visible' => ! $is_nginx,
'label' => $lng['admin']['ipsandports']['create_listen_statement'], 'label' => $lng['admin']['ipsandports']['create_listen_statement'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array('1') 'value' => array(
'1'
)
), ),
'namevirtualhost_statement' => array( 'namevirtualhost_statement' => array(
'visible' => $is_apache && !$is_apache24, 'visible' => $is_apache && ! $is_apache24,
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'], 'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array('1') 'value' => array(
'1'
)
), ),
'vhostcontainer' => array( 'vhostcontainer' => array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'], 'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array('1') 'value' => array(
'1'
)
), ),
'docroot' => array( 'docroot' => array(
'label' => $lng['admin']['ipsandports']['docroot']['title'], 'label' => $lng['admin']['ipsandports']['docroot']['title'],
@@ -83,9 +97,14 @@ return array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'], 'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array('1') 'value' => array(
'1'
)
) )
) )
), ),
@@ -112,7 +131,10 @@ return array(
'label' => $lng['admin']['ipsandports']['enable_ssl'], 'label' => $lng['admin']['ipsandports']['enable_ssl'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array() 'value' => array()
), ),

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'ipsandports_edit' => array( 'ipsandports_edit' => array(
'title' => $lng['admin']['ipsandports']['edit'], 'title' => $lng['admin']['ipsandports']['edit'],
@@ -42,30 +41,45 @@ return array(
'image' => 'icons/ipsports_edit.png', 'image' => 'icons/ipsports_edit.png',
'fields' => array( 'fields' => array(
'listen_statement' => array( 'listen_statement' => array(
'visible' => !$is_nginx, 'visible' => ! $is_nginx,
'label' => $lng['admin']['ipsandports']['create_listen_statement'], 'label' => $lng['admin']['ipsandports']['create_listen_statement'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['listen_statement']) 'value' => array(
$result['listen_statement']
)
), ),
'namevirtualhost_statement' => array( 'namevirtualhost_statement' => array(
'visible' => $is_apache && !$is_apache24, 'visible' => $is_apache && ! $is_apache24,
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'], 'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['namevirtualhost_statement']) 'value' => array(
$result['namevirtualhost_statement']
)
), ),
'vhostcontainer' => array( 'vhostcontainer' => array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'], 'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['vhostcontainer']) 'value' => array(
$result['vhostcontainer']
)
), ),
'docroot' => array( 'docroot' => array(
'label' => $lng['admin']['ipsandports']['docroot']['title'], 'label' => $lng['admin']['ipsandports']['docroot']['title'],
@@ -87,9 +101,14 @@ return array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'], 'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['vhostcontainer_servername_statement']) 'value' => array(
$result['vhostcontainer_servername_statement']
)
) )
) )
), ),
@@ -117,9 +136,14 @@ return array(
'label' => $lng['admin']['ipsandports']['enable_ssl'], 'label' => $lng['admin']['ipsandports']['enable_ssl'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['ssl']) 'value' => array(
$result['ssl']
)
), ),
'ssl_cert_file' => array( 'ssl_cert_file' => array(
'label' => $lng['admin']['ipsandports']['ssl_cert_file'], 'label' => $lng['admin']['ipsandports']['ssl_cert_file'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'fpmconfig_add' => array( 'fpmconfig_add' => array(
'title' => $lng['admin']['phpsettings']['addsettings'], 'title' => $lng['admin']['phpsettings']['addsettings'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'fpmconfig_edit' => array( 'fpmconfig_edit' => array(
'title' => $lng['admin']['phpsettings']['editsettings'], 'title' => $lng['admin']['phpsettings']['editsettings'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'phpconfig_add' => array( 'phpconfig_add' => array(
'title' => $lng['admin']['phpsettings']['addsettings'], 'title' => $lng['admin']['phpsettings']['addsettings'],
@@ -60,19 +59,22 @@ return array(
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'type' => 'text' 'type' => 'text'
), ),
'mod_fcgid_umask' => array( 'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'], 'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text', 'type' => 'text',
'maxlength' => 3, 'maxlength' => 3,
'value' => '022' 'value' => '022'
), ),
'phpfpm_enable_slowlog' => array( 'phpfpm_enable_slowlog' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['enable_slowlog'], 'label' => $lng['admin']['phpsettings']['enable_slowlog'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array() 'value' => array()
), ),
@@ -95,7 +97,10 @@ return array(
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'], 'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array() 'value' => array()
), ),
@@ -104,7 +109,10 @@ return array(
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'], 'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array() 'value' => array()
), ),
@@ -118,49 +126,49 @@ return array(
'max_children' => array( 'max_children' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => 1 'value' => 1
), ),
'start_servers' => array( 'start_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => 20 'value' => 20
), ),
'min_spare_servers' => array( 'min_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => 5 'value' => 5
), ),
'max_spare_servers' => array( 'max_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => 35 'value' => 35
), ),
'max_requests' => array( 'max_requests' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => 0 'value' => 0
), ),
'idle_timeout' => array( 'idle_timeout' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => 30 'value' => 30
), ),
'limit_extensions' => array( 'limit_extensions' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'text', 'type' => 'text',
'value' => '.php' 'value' => '.php'
), ),

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'phpconfig_edit' => array( 'phpconfig_edit' => array(
'title' => $lng['admin']['phpsettings']['editsettings'], 'title' => $lng['admin']['phpsettings']['editsettings'],
@@ -55,29 +54,34 @@ return array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_starter']['title'], 'label' => $lng['admin']['mod_fcgid_starter']['title'],
'type' => 'text', 'type' => 'text',
'value' => ((int)$result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '') 'value' => ((int) $result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
), ),
'mod_fcgid_maxrequests' => array( 'mod_fcgid_maxrequests' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'], 'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'type' => 'text', 'type' => 'text',
'value' => ((int)$result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '') 'value' => ((int) $result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => $result['mod_fcgid_umask']
), ),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => $result['mod_fcgid_umask']
),
'phpfpm_enable_slowlog' => array( 'phpfpm_enable_slowlog' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['admin']['phpsettings']['enable_slowlog'], 'label' => $lng['admin']['phpsettings']['enable_slowlog'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['fpm_slowlog']) 'value' => array(
$result['fpm_slowlog']
)
), ),
'phpfpm_reqtermtimeout' => array( 'phpfpm_reqtermtimeout' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
@@ -98,17 +102,27 @@ return array(
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'], 'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['pass_authorizationheader']) 'value' => array(
$result['pass_authorizationheader']
)
), ),
'override_fpmconfig' => array( 'override_fpmconfig' => array(
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'], 'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['override_fpmconfig']) 'value' => array(
$result['override_fpmconfig']
)
), ),
'pm' => array( 'pm' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
@@ -120,49 +134,49 @@ return array(
'max_children' => array( 'max_children' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => $result['max_children'] 'value' => $result['max_children']
), ),
'start_servers' => array( 'start_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => $result['start_servers'] 'value' => $result['start_servers']
), ),
'min_spare_servers' => array( 'min_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => $result['min_spare_servers'] 'value' => $result['min_spare_servers']
), ),
'max_spare_servers' => array( 'max_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => $result['max_spare_servers'] 'value' => $result['max_spare_servers']
), ),
'max_requests' => array( 'max_requests' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => $result['max_requests'] 'value' => $result['max_requests']
), ),
'idle_timeout' => array( 'idle_timeout' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => $result['idle_timeout'] 'value' => $result['idle_timeout']
), ),
'limit_extensions' => array( 'limit_extensions' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'text', 'type' => 'text',
'value' => $result['limit_extensions'] 'value' => $result['limit_extensions']
), ),

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'plans_add' => array( 'plans_add' => array(
'title' => $lng['admin']['plans']['add'], 'title' => $lng['admin']['plans']['add'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'plans_edit' => array( 'plans_edit' => array(
'title' => $lng['admin']['plans']['edit'], 'title' => $lng['admin']['plans']['edit'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'filetemplate_add' => array( 'filetemplate_add' => array(
'title' => $lng['admin']['templates']['template_add'], 'title' => $lng['admin']['templates']['template_add'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'filetemplate_edit' => array( 'filetemplate_edit' => array(
'title' => $lng['admin']['templates']['template_edit'], 'title' => $lng['admin']['templates']['template_edit'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'template_add' => array( 'template_add' => array(
'title' => $lng['admin']['templates']['template_add'], 'title' => $lng['admin']['templates']['template_add'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'template_edit' => array( 'template_edit' => array(
'title' => $lng['admin']['templates']['template_edit'], 'title' => $lng['admin']['templates']['template_edit'],

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'domain_ssleditor' => array( 'domain_ssleditor' => array(
'title' => $lng['panel']['ssleditor'], 'title' => $lng['panel']['ssleditor'],
@@ -45,7 +44,7 @@ return array(
'ssl_cert_chainfile' => array( 'ssl_cert_chainfile' => array(
'style' => 'align-top', 'style' => 'align-top',
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile_content'], 'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile_content'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'].$lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'], 'desc' => $lng['admin']['ipsandports']['ssl_paste_description'] . $lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'],
'type' => 'textarea', 'type' => 'textarea',
'cols' => 100, 'cols' => 100,
'rows' => 15, 'rows' => 15,
@@ -54,7 +53,7 @@ return array(
'ssl_ca_file' => array( 'ssl_ca_file' => array(
'style' => 'align-top', 'style' => 'align-top',
'label' => $lng['admin']['ipsandports']['ssl_ca_file_content'], 'label' => $lng['admin']['ipsandports']['ssl_ca_file_content'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'].$lng['admin']['ipsandports']['ssl_ca_file_content_desc'], 'desc' => $lng['admin']['ipsandports']['ssl_paste_description'] . $lng['admin']['ipsandports']['ssl_ca_file_content_desc'],
'type' => 'textarea', 'type' => 'textarea',
'cols' => 100, 'cols' => 100,
'rows' => 15, 'rows' => 15,

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'domain_add' => array( 'domain_add' => array(
'title' => $lng['domains']['subdomain_add'], 'title' => $lng['domains']['subdomain_add'],
@@ -43,7 +42,7 @@ return array(
), ),
'path' => array( 'path' => array(
'label' => $lng['panel']['path'], 'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null).(isset($pathSelect['note']) ? $pathSelect['note'].'<br />'.$pathSelect['value'] : ''), 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? $pathSelect['note'] . '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'], 'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'], 'select_var' => $pathSelect['value'],
'value' => $pathSelect['value'] 'value' => $pathSelect['value']
@@ -89,7 +88,10 @@ return array(
'desc' => $lng['domains']['ssl_redirect']['description'], 'desc' => $lng['domains']['ssl_redirect']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array() 'value' => array()
), ),
@@ -99,7 +101,10 @@ return array(
'desc' => $lng['customer']['letsencrypt']['description'], 'desc' => $lng['customer']['letsencrypt']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array() 'value' => array()
), ),
@@ -116,7 +121,10 @@ return array(
'desc' => $lng['admin']['domain_hsts_incsub']['description'], 'desc' => $lng['admin']['domain_hsts_incsub']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array() 'value' => array()
), ),
@@ -125,12 +133,15 @@ return array(
'desc' => $lng['admin']['domain_hsts_preload']['description'], 'desc' => $lng['admin']['domain_hsts_preload']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array() 'value' => array()
), )
), )
), )
) )
) )
); );

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'domain_edit' => array( 'domain_edit' => array(
'title' => $lng['domains']['subdomain_edit'], 'title' => $lng['domains']['subdomain_edit'],
@@ -42,7 +41,7 @@ return array(
), ),
'path' => array( 'path' => array(
'label' => $lng['panel']['path'], 'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''), 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'], 'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'], 'select_var' => $pathSelect['value'],
'value' => $pathSelect['value'] 'value' => $pathSelect['value']
@@ -68,13 +67,18 @@ return array(
'select_var' => $serveraliasoptions 'select_var' => $serveraliasoptions
), ),
'isemaildomain' => array( 'isemaildomain' => array(
'visible' => ((( $result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2' ) && $result['parentdomainid'] != '0') ? true : false), 'visible' => ((($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0') ? true : false),
'label' => 'Emaildomain', 'label' => 'Emaildomain',
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => array($result['isemaildomain']) 'value' => '1'
)
),
'value' => array(
$result['isemaildomain']
)
), ),
'openbasedir_path' => array( 'openbasedir_path' => array(
'visible' => ($result['openbasedir'] == '1') ? true : false, 'visible' => ($result['openbasedir'] == '1') ? true : false,
@@ -100,9 +104,14 @@ return array(
'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''), 'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''),
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['ssl_redirect']) 'value' => array(
$result['ssl_redirect']
)
), ),
'letsencrypt' => array( 'letsencrypt' => array(
'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false, 'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false,
@@ -110,9 +119,14 @@ return array(
'desc' => $lng['customer']['letsencrypt']['description'], 'desc' => $lng['customer']['letsencrypt']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['letsencrypt']) 'value' => array(
$result['letsencrypt']
)
), ),
'hsts_maxage' => array( 'hsts_maxage' => array(
'label' => $lng['admin']['domain_hsts_maxage']['title'], 'label' => $lng['admin']['domain_hsts_maxage']['title'],
@@ -127,21 +141,31 @@ return array(
'desc' => $lng['admin']['domain_hsts_incsub']['description'], 'desc' => $lng['admin']['domain_hsts_incsub']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['hsts_sub']) 'value' => array(
$result['hsts_sub']
)
), ),
'hsts_preload' => array( 'hsts_preload' => array(
'label' => $lng['admin']['domain_hsts_preload']['title'], 'label' => $lng['admin']['domain_hsts_preload']['title'],
'desc' => $lng['admin']['domain_hsts_preload']['description'], 'desc' => $lng['admin']['domain_hsts_preload']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
), ),
'value' => array($result['hsts_preload']) 'value' => array(
), $result['hsts_preload']
)
)
) )
), )
) )
) )
); );

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'emails_accountchangepasswd' => array( 'emails_accountchangepasswd' => array(
'title' => $lng['menue']['main']['changepassword'], 'title' => $lng['menue']['main']['changepassword'],
@@ -38,7 +37,7 @@ return array(
'label' => $lng['customer']['generated_pwd'], 'label' => $lng['customer']['generated_pwd'],
'type' => 'text', 'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(), 'value' => \Froxlor\System\Crypt::generatePassword()
) )
) )
) )

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'emails_accountchangequota' => array( 'emails_accountchangequota' => array(
'title' => $lng['emails']['quota_edit'], 'title' => $lng['emails']['quota_edit'],
@@ -30,7 +29,7 @@ return array(
'value' => $result['email_full'] 'value' => $result['email_full']
), ),
'email_quota' => array( 'email_quota' => array(
'label' => $lng['emails']['quota'].' (MiB)', 'label' => $lng['emails']['quota'] . ' (MiB)',
'type' => 'text', 'type' => 'text',
'value' => $result['quota'] 'value' => $result['quota']
) )

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'emails_add' => array( 'emails_add' => array(
'title' => $lng['emails']['emails_add'], 'title' => $lng['emails']['emails_add'],
@@ -40,8 +39,11 @@ return array(
'label' => $lng['emails']['iscatchall'], 'label' => $lng['emails']['iscatchall'],
'type' => 'checkbox', 'type' => 'checkbox',
'values' => array( 'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1') array(
), 'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array() 'value' => array()
) )
) )

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'emails_addaccount' => array( 'emails_addaccount' => array(
'title' => $lng['emails']['account_add'], 'title' => $lng['emails']['account_add'],
@@ -38,7 +37,7 @@ return array(
'label' => $lng['customer']['generated_pwd'], 'label' => $lng['customer']['generated_pwd'],
'type' => 'text', 'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(), 'value' => \Froxlor\System\Crypt::generatePassword()
), ),
'email_quota' => array( 'email_quota' => array(
'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false), 'visible' => (\Froxlor\Settings::Get('system.mail_quota_enabled') == '1' ? true : false),

View File

@@ -14,7 +14,6 @@
* @package Formfields * @package Formfields
* *
*/ */
return array( return array(
'emails_addforwarder' => array( 'emails_addforwarder' => array(
'title' => $lng['emails']['forwarder_add'], 'title' => $lng['emails']['forwarder_add'],

Some files were not shown because too many files have changed in this diff Show More