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/misc/
templates/Froxlor/assets/img/logo_custom.png
vendor/

View File

@@ -80,11 +80,9 @@ if ($userinfo['type_2fa'] == '0') {
foreach ($type_select_values as $_val => $_type) {
$type_select .= makeoption($_type, $_val);
}
}
elseif ($userinfo['type_2fa'] == '1') {
} elseif ($userinfo['type_2fa'] == '1') {
// email 2fa enabled
}
elseif ($userinfo['type_2fa'] == '2') {
} elseif ($userinfo['type_2fa'] == '2') {
// authenticator 2fa enabled
$ga_qrcode = $tfa->getQRCodeImageAsDataUri($userinfo['loginname'], $userinfo['data_2fa']);
}

View File

@@ -16,31 +16,36 @@
* @package Language
*
*/
return array(
'groups' => array(
'panel' => array(
'title' => $lng['admin']['panelsettings'],
'fields' => 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',
'varname' => 'standardlanguage',
'type' => 'option',
'default' => 'English',
'option_mode' => 'one',
'option_options_method' => 'getLanguages',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'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',
'varname' => 'default_theme',
'type' => 'option',
'default' => 'Froxlor',
'option_mode' => 'one',
'option_options_method' => 'getThemes',
'save_method' => 'storeSettingDefaultTheme',
'save_method' => 'storeSettingDefaultTheme'
),
'panel_allow_theme_change_customer' => array(
'label' => $lng['serversettings']['panel_allow_theme_change_customer'],
@@ -48,7 +53,7 @@ return array(
'varname' => 'allow_theme_change_customer',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_allow_theme_change_admin' => array(
'label' => $lng['serversettings']['panel_allow_theme_change_admin'],
@@ -64,7 +69,7 @@ return array(
'varname' => 'natsorting',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_no_robots' => array(
'label' => $lng['serversettings']['no_robots'],
@@ -72,7 +77,7 @@ return array(
'varname' => 'no_robots',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_paging' => array(
'label' => $lng['serversettings']['paging'],
@@ -81,7 +86,7 @@ return array(
'type' => 'int',
'int_min' => 0,
'default' => 0,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_pathedit' => array(
'label' => $lng['serversettings']['pathedit'],
@@ -90,8 +95,11 @@ return array(
'type' => 'option',
'default' => 'Manual',
'option_mode' => 'one',
'option_options' => array('Manual' => $lng['serversettings']['manual'], 'Dropdown' => $lng['serversettings']['dropdown']),
'save_method' => 'storeSettingField',
'option_options' => array(
'Manual' => $lng['serversettings']['manual'],
'Dropdown' => $lng['serversettings']['dropdown']
),
'save_method' => 'storeSettingField'
),
'panel_adminmail' => array(
'label' => $lng['serversettings']['adminmail'],
@@ -101,7 +109,7 @@ return array(
'string_type' => 'mail',
'string_emptyallowed' => false,
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_adminmail_defname' => array(
'label' => $lng['serversettings']['adminmail_defname'],
@@ -109,7 +117,7 @@ return array(
'varname' => 'adminmail_defname',
'type' => 'string',
'default' => 'Froxlor Administrator',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_adminmail_return' => array(
'label' => $lng['serversettings']['adminmail_return'],
@@ -119,7 +127,7 @@ return array(
'string_type' => 'mail',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_decimal_places' => array(
'label' => $lng['serversettings']['decimal_places'],
@@ -129,7 +137,7 @@ return array(
'int_min' => 0,
'int_max' => 15,
'default' => 4,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_phpmyadmin_url' => array(
'label' => $lng['serversettings']['phpmyadmin_url'],
@@ -139,7 +147,7 @@ return array(
'string_type' => 'url',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_webmail_url' => array(
'label' => $lng['serversettings']['webmail_url'],
@@ -149,7 +157,7 @@ return array(
'string_type' => 'url',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_webftp_url' => array(
'label' => $lng['serversettings']['webftp_url'],
@@ -159,7 +167,7 @@ return array(
'string_type' => 'url',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'admin_show_version_login' => array(
'label' => $lng['admin']['show_version_login'],
@@ -167,7 +175,7 @@ return array(
'varname' => 'show_version_login',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'admin_show_version_footer' => array(
'label' => $lng['admin']['show_version_footer'],
@@ -175,7 +183,7 @@ return array(
'varname' => 'show_version_footer',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'admin_show_news_feed' => array(
'label' => $lng['admin']['show_news_feed'],
@@ -183,7 +191,7 @@ return array(
'varname' => 'show_news_feed',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'customer_show_news_feed' => array(
'label' => $lng['admin']['customer_show_news_feed'],
@@ -191,7 +199,7 @@ return array(
'varname' => 'show_news_feed',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'customer_news_feed_url' => array(
'label' => $lng['admin']['customer_news_feed_url'],
@@ -201,7 +209,7 @@ return array(
'string_type' => 'url',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_allow_domain_change_admin' => array(
'label' => $lng['serversettings']['panel_allow_domain_change_admin'],
@@ -209,7 +217,7 @@ return array(
'varname' => 'allow_domain_change_admin',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_allow_domain_change_customer' => array(
'label' => $lng['serversettings']['panel_allow_domain_change_customer'],
@@ -217,7 +225,7 @@ return array(
'varname' => 'allow_domain_change_customer',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_phpconfigs_hidestdsubdomain' => array(
'label' => $lng['serversettings']['panel_phpconfigs_hidestdsubdomain'],
@@ -225,7 +233,7 @@ return array(
'varname' => 'phpconfigs_hidestdsubdomain',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_customer_hide_options' => array(
'label' => $lng['serversettings']['panel_customer_hide_options'],
@@ -248,13 +256,13 @@ return array(
'traffic' => $lng['menue']['traffic']['traffic'],
'traffic.http' => $lng['menue']['traffic']['traffic'] . " / HTTP",
'traffic.ftp' => $lng['menue']['traffic']['traffic'] . " / FTP",
'traffic.mail' => $lng['menue']['traffic']['traffic']." / Mail",
),
'save_method' => 'storeSettingField',
),
),
),
'traffic.mail' => $lng['menue']['traffic']['traffic'] . " / Mail"
),
'save_method' => 'storeSettingField'
)
)
)
)
);
?>

View File

@@ -16,7 +16,6 @@
* @package Settings
*
*/
return array(
'groups' => array(
'accounts' => array(
@@ -28,7 +27,7 @@ return array(
'varname' => 'sessiontimeout',
'type' => 'int',
'default' => 600,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'session_allow_multiple_login' => array(
'label' => $lng['serversettings']['session_allow_multiple_login'],
@@ -36,7 +35,7 @@ return array(
'varname' => 'allow_multiple_login',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'login_domain_login' => array(
'label' => $lng['serversettings']['login_domain_login'],
@@ -44,7 +43,7 @@ return array(
'varname' => 'domain_login',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'login_maxloginattempts' => array(
'label' => $lng['serversettings']['maxloginattempts'],
@@ -52,7 +51,7 @@ return array(
'varname' => 'maxloginattempts',
'type' => 'int',
'default' => 3,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'login_deactivatetime' => array(
'label' => $lng['serversettings']['deactivatetime'],
@@ -60,7 +59,7 @@ return array(
'varname' => 'deactivatetime',
'type' => 'int',
'default' => 900,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'2fa_enabled' => array(
'label' => $lng['2fa']['2fa_enabled'],
@@ -68,7 +67,7 @@ return array(
'varname' => 'enabled',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_password_min_length' => array(
'label' => $lng['serversettings']['panel_password_min_length'],
@@ -76,7 +75,7 @@ return array(
'varname' => 'password_min_length',
'type' => 'int',
'default' => 0,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_password_alpha_lower' => array(
'label' => $lng['serversettings']['panel_password_alpha_lower'],
@@ -84,7 +83,7 @@ return array(
'varname' => 'password_alpha_lower',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_password_alpha_upper' => array(
'label' => $lng['serversettings']['panel_password_alpha_upper'],
@@ -92,7 +91,7 @@ return array(
'varname' => 'password_alpha_upper',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_password_numeric' => array(
'label' => $lng['serversettings']['panel_password_numeric'],
@@ -100,7 +99,7 @@ return array(
'varname' => 'password_numeric',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_password_special_char_required' => array(
'label' => $lng['serversettings']['panel_password_special_char_required'],
@@ -108,7 +107,7 @@ return array(
'varname' => 'password_special_char_required',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_password_special_char' => array(
'label' => $lng['serversettings']['panel_password_special_char'],
@@ -116,7 +115,7 @@ return array(
'varname' => 'password_special_char',
'type' => 'string',
'default' => '!?<>§$%+#=@',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_password_regex' => array(
'label' => $lng['serversettings']['panel_password_regex'],
@@ -124,7 +123,7 @@ return array(
'varname' => 'password_regex',
'type' => 'string',
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'customer_accountprefix' => array(
'label' => $lng['serversettings']['accountprefix'],
@@ -133,8 +132,10 @@ return array(
'type' => 'string',
'default' => '',
'plausibility_check_method' => array(
'\\Froxlor\\Validate\\Check', 'checkUsername'),
'save_method' => 'storeSettingField',
'\\Froxlor\\Validate\\Check',
'checkUsername'
),
'save_method' => 'storeSettingField'
),
'customer_mysqlprefix' => array(
'label' => $lng['serversettings']['mysqlprefix'],
@@ -143,8 +144,10 @@ return array(
'type' => 'string',
'default' => '',
'plausibility_check_method' => array(
'\\Froxlor\\Validate\\Check', 'checkUsername'),
'save_method' => 'storeSettingField',
'\\Froxlor\\Validate\\Check',
'checkUsername'
),
'save_method' => 'storeSettingField'
),
'customer_ftpprefix' => array(
'label' => $lng['serversettings']['ftpprefix'],
@@ -152,7 +155,7 @@ return array(
'varname' => 'ftpprefix',
'type' => 'string',
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'customer_ftpatdomain' => array(
'label' => $lng['serversettings']['ftpdomain'],
@@ -160,7 +163,7 @@ return array(
'varname' => 'ftpatdomain',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'panel_allow_preset' => array(
'label' => $lng['serversettings']['allow_password_reset'],
@@ -173,7 +176,7 @@ return array(
'fieldname' => 'panel_allow_preset_admin',
'fielddata' => array(
'settinggroup' => 'panel',
'varname' => 'allow_preset_admin',
'varname' => 'allow_preset_admin'
),
'onlyif' => 0
)
@@ -189,7 +192,7 @@ return array(
'fieldname' => 'panel_allow_preset',
'fielddata' => array(
'settinggroup' => 'panel',
'varname' => 'allow_preset',
'varname' => 'allow_preset'
),
'onlyif' => 1
)
@@ -202,9 +205,9 @@ return array(
'default' => false,
'cronmodule' => 'froxlor/backup',
'save_method' => 'storeSettingField'
),
),
),
)
)
)
)
);

View File

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

View File

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

View File

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

View File

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

View File

@@ -16,7 +16,6 @@
* @package Settings
*
*/
return array(
'groups' => array(
'ftpserver' => array(
@@ -29,11 +28,14 @@ return array(
'type' => 'option',
'default' => 'proftpd',
'option_mode' => 'one',
'option_options' => array('proftpd' => 'Proftpd', 'pureftpd' => 'Pureftpd'),
'save_method' => 'storeSettingField',
),
),
'option_options' => array(
'proftpd' => 'Proftpd',
'pureftpd' => 'Pureftpd'
),
'save_method' => 'storeSettingField'
)
)
)
)
);

View File

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

View File

@@ -16,7 +16,6 @@
* @package Settings
*
*/
return array(
'groups' => array(
'logging' => array(
@@ -38,8 +37,11 @@ return array(
'type' => 'option',
'default' => 1,
'option_mode' => 'one',
'option_options' => array(1 => $lng['admin']['logger']['normal'], 2 => $lng['admin']['logger']['paranoid']),
'save_method' => 'storeSettingField',
'option_options' => array(
1 => $lng['admin']['logger']['normal'],
2 => $lng['admin']['logger']['paranoid']
),
'save_method' => 'storeSettingField'
),
'logger_logtypes' => array(
'label' => $lng['serversettings']['logger']['types'],
@@ -48,8 +50,12 @@ return array(
'type' => 'option',
'default' => 'syslog,mysql',
'option_mode' => 'multiple',
'option_options' => array('syslog' => 'syslog', 'file' => 'file', 'mysql' => 'mysql'),
'save_method' => 'storeSettingField',
'option_options' => array(
'syslog' => 'syslog',
'file' => 'file',
'mysql' => 'mysql'
),
'save_method' => 'storeSettingField'
),
'logger_logfile' => array(
'label' => $lng['serversettings']['logger']['logfile'],
@@ -59,7 +65,7 @@ return array(
'string_type' => 'file',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
'save_method' => 'storeSettingField'
),
'logger_log_cron' => array(
'label' => $lng['serversettings']['logger']['logcron'],
@@ -73,10 +79,10 @@ return array(
1 => $lng['serversettings']['logger']['logcronoption']['once'],
2 => $lng['serversettings']['logger']['logcronoption']['always']
),
'save_method' => 'storeSettingField',
),
),
),
'save_method' => 'storeSettingField'
)
)
)
)
);

View File

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

View File

@@ -14,7 +14,6 @@
* @package Settings
*
*/
return array(
'groups' => array(
'spf' => array(

View File

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

View File

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

View File

@@ -1,55 +1,50 @@
<?php
/*
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2011 The PHP Group |
+----------------------------------------------------------------------+
| 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 |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| 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 |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Ralf Becker <beckerr@php.net> |
| Rasmus Lerdorf <rasmus@php.net> |
| Ilia Alshanetsky <ilia@prohost.org> |
+----------------------------------------------------------------------+
All other licensing and usage conditions are those of the PHP Group.
Based on https://github.com/krakjoe/apcu/blob/master/apc.php
Implemented into Froxlor: Janos Muzsi <muzsij@hypernics.hu>
* +----------------------------------------------------------------------+
* | APC |
* +----------------------------------------------------------------------+
* | Copyright (c) 2006-2011 The PHP Group |
* +----------------------------------------------------------------------+
* | 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 |
* | available through the world-wide-web at the following url: |
* | http://www.php.net/license/3_01.txt |
* | 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 |
* | license@php.net so we can mail you a copy immediately. |
* +----------------------------------------------------------------------+
* | Authors: Ralf Becker <beckerr@php.net> |
* | Rasmus Lerdorf <rasmus@php.net> |
* | Ilia Alshanetsky <ilia@prohost.org> |
* +----------------------------------------------------------------------+
*
* All other licensing and usage conditions are those of the PHP Group.
*
* Based on https://github.com/krakjoe/apcu/blob/master/apc.php
* Implemented into Froxlor: Janos Muzsi <muzsij@hypernics.hu>
*
*/
define('AREA', 'admin');
require './lib/init.php';
$horizontal_bar_size = 950; // 1280px window width
if ($action == 'delete' &&
function_exists('apcu_clear_cache') &&
$userinfo['change_serversettings'] == '1'
) {
if ($action == 'delete' && function_exists('apcu_clear_cache') && $userinfo['change_serversettings'] == '1') {
apcu_clear_cache();
$log->logAction(ADM_ACTION, LOG_INFO, "cleared APCu cache");
header('Location: ' . $linker->getLink(array('section' => 'apcuinfo', 'page' => 'showinfo')));
header('Location: ' . $linker->getLink(array(
'section' => 'apcuinfo',
'page' => 'showinfo'
)));
exit();
}
if (!function_exists('apcu_cache_info') ||
!function_exists('apcu_sma_info')
) {
if (! function_exists('apcu_cache_info') || ! function_exists('apcu_sma_info')) {
\Froxlor\UI\Response::standard_error($lng['error']['no_apcuinfo']);
}
if ($page == 'showinfo'
) {
if ($page == 'showinfo') {
$cache = apcu_cache_info();
$mem = apcu_sma_info();
$time = time();
@@ -123,18 +118,28 @@ if ($page == 'showinfo'
$img_src2 = '';
$img_src3 = '';
if (graphics_avail()) {
$img_src = $linker->getLink(array('section' => 'apcuinfo', 'page' => 'img1', 'action' => mt_rand(0, 1000000)));
$img_src = $linker->getLink(array(
'section' => 'apcuinfo',
'page' => 'img1',
'action' => mt_rand(0, 1000000)
));
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)));
$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)));
$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") . "\";");
} elseif ($page == 'img1'
) {
} elseif ($page == 'img1') {
$mem = apcu_sma_info();
@@ -169,7 +174,10 @@ if ($page == 'showinfo'
if (($angle_to * 360) - ($angle_from * 360) >= 1) {
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
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;
@@ -180,7 +188,10 @@ if ($page == 'showinfo'
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) {
array_push($string_placement, array($angle_from, $angle_to));
array_push($string_placement, array(
$angle_from,
$angle_to
));
}
}
$angle_from = $angle_to;
@@ -192,7 +203,10 @@ if ($page == 'showinfo'
$angle_to = 1;
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
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
));
}
}
}
@@ -202,9 +216,8 @@ if ($page == 'showinfo'
header("Content-type: image/png");
imagepng($image);
exit;
} elseif ($page == 'img2'
) {
exit();
} elseif ($page == 'img2') {
$cache = apcu_cache_info();
@@ -221,14 +234,15 @@ if ($page == 'showinfo'
$s = $cache['num_hits'] + $cache['num_misses'];
$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, 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, 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) */
);
header("Content-type: image/png");
imagepng($image);
exit;
} elseif ($page == 'img3'
) {
exit();
} elseif ($page == 'img3') {
$mem = apcu_sma_info();
@@ -278,17 +292,24 @@ if ($page == 'showinfo'
header("Content-type: image/png");
imagepng($image);
exit;
exit();
}
function graphics_avail() {
function graphics_avail()
{
return extension_loaded('gd');
}
// pretty printer for byte values
//
function bsize($s) {
foreach (array('', 'K', 'M', 'G') as $i => $k) {
function bsize($s)
{
foreach (array(
'',
'K',
'M',
'G'
) as $i => $k) {
if ($s < 1024)
break;
$s /= 1024;
@@ -296,7 +317,8 @@ function bsize($s) {
return sprintf("%5.1f %sBytes", $s, $k);
}
function duration($ts) {
function duration($ts)
{
global $time;
$years = (int) ((($time - $ts) / (7 * 86400)) / 52.177457);
$rem = (int) (($time - $ts) - ($years * 52.177457 * 7 * 86400));
@@ -328,7 +350,8 @@ function duration($ts) {
return $str;
}
function block_sort($array1, $array2) {
function block_sort($array1, $array2)
{
if ($array1['offset'] > $array2['offset']) {
return 1;
} else {
@@ -336,11 +359,11 @@ function block_sort($array1, $array2) {
}
}
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);
if (function_exists("imagefilledarc")) {
// exists only if GD 2.0.1 is available
imagefilledarc($im, $centerX + 1, $centerY + 1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE);
@@ -364,7 +387,8 @@ function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $co
}
}
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);
@@ -376,7 +400,8 @@ function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $te
}
}
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;
$y1 = $y + $h - 1;

View File

@@ -20,7 +20,7 @@
define('AREA', 'admin');
require './lib/init.php';
use \Froxlor\Http\HttpClient;
use Froxlor\Http\HttpClient;
// define update-uri
define('UPDATE_URI', "https://version.froxlor.org/Froxlor/api/" . $version);
@@ -202,8 +202,7 @@ elseif ($page == 'extract') {
$hiddenparams = '';
$yesfile = $filename . '?s=' . $s . '&amp;page=extract&amp;archive=' . $toExtract;
eval("echo \"" . \Froxlor\UI\Template::getTemplate("misc/question_yesno", true) . "\";");
}
// display error
} // display error
elseif ($page == 'error') {
// retrieve error-number via url-parameter

View File

@@ -22,8 +22,7 @@ use Froxlor\Settings;
if ($userinfo['change_serversettings'] == '1') {
if ($action == 'setconfigured')
{
if ($action == 'setconfigured') {
Settings::Set('panel.is_configured', '1', true);
\Froxlor\UI\Response::redirectTo('admin_configfiles.php', array(
's' => $s
@@ -31,12 +30,9 @@ if ($userinfo['change_serversettings'] == '1') {
}
$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');
}
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');
}
@@ -95,7 +91,7 @@ if ($userinfo['change_serversettings'] == '1') {
if (! file_exists($config_dir . '/' . $distribution . ".xml")) {
trigger_error("Unknown distribution, are you playing around with the URL?");
exit;
exit();
}
// create configparser object
@@ -111,7 +107,7 @@ if ($userinfo['change_serversettings'] == '1') {
if (! isset($services[$service])) {
trigger_error("Unknown service, are you playing around with the URL?");
exit;
exit();
}
$daemons = $services[$service]->getDaemons();
@@ -159,7 +155,7 @@ if ($userinfo['change_serversettings'] == '1') {
if (! isset($daemons[$daemon])) {
trigger_error("Unknown daemon, are you playing around with the URL?");
exit;
exit();
}
$confarr = $daemons[$daemon]->getConfig();

View File

@@ -16,15 +16,12 @@
* @package Panel
*
*/
define('AREA', 'admin');
require './lib/init.php';
use Froxlor\Database\Database;
if ($page == 'log'
&& $userinfo['change_serversettings'] == '1'
) {
if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
if ($action == '') {
$fields = array(
'date' => $lng['logger']['date'],
@@ -46,17 +43,13 @@ if ($page == 'log'
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']][$row['logid']] = $row;
}
if ($paging->sortfield == 'date'
&& $paging->sortorder == 'desc'
) {
if ($paging->sortfield == 'date' && $paging->sortorder == 'desc') {
krsort($clog);
} else {
ksort($clog);
@@ -114,21 +107,25 @@ if ($page == 'log'
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate('logger/logger') . "\";");
} elseif ($action == 'truncate') {
if (isset($_POST['send'])
&& $_POST['send'] == 'send'
) {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$truncatedate = time() - (60 * 10);
$trunc_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < :trunc"
);
Database::pexecute($trunc_stmt, array('trunc' => $truncatedate));
DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < :trunc");
Database::pexecute($trunc_stmt, array(
'trunc' => $truncatedate
));
$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 {
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
*
*/
define('AREA', 'admin');
require './lib/init.php';
@@ -32,12 +31,8 @@ if ($page == 'message') {
if ($action == '') {
$log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed panel_message');
if (isset($_POST['send'])
&& $_POST['send'] == 'send'
) {
if ($_POST['receipient'] == 0
&& $userinfo['customers_see_all'] == '1'
) {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
if ($_POST['receipient'] == 0 && $userinfo['customers_see_all'] == '1') {
$log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to admins');
$result = Database::query('SELECT `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`");
} elseif ($_POST['receipient'] == 1) {
@@ -48,9 +43,10 @@ if ($page == 'message') {
$log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to customers');
$result = Database::prepare('
SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`
WHERE `adminid` = :adminid"
);
Database::pexecute($result, array('adminid' => $userinfo['adminid']));
WHERE `adminid` = :adminid");
Database::pexecute($result, array(
'adminid' => $userinfo['adminid']
));
}
} else {
\Froxlor\UI\Response::standard_error('noreceipientsgiven');
@@ -68,7 +64,11 @@ if ($page == 'message') {
$row['firstname'] = isset($row['firstname']) ? $row['firstname'] : '';
$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->FromName = (isset($userinfo['firstname']) ? $userinfo['firstname'] . ' ' : '') . $userinfo['name'];
@@ -87,7 +87,12 @@ if ($page == 'message') {
$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 {
\Froxlor\UI\Response::standard_error('nomessagetosend');
}
@@ -104,7 +109,6 @@ if ($page == 'message') {
} else {
$successmessage = str_replace('%s', $sentitems, $lng['message']['success']);
}
} else {
$success = 0;
$sentitems = 0;

View File

@@ -17,28 +17,24 @@
* Based on https://github.com/amnuts/opcache-gui
*
*/
define('AREA', 'admin');
require './lib/init.php';
if ($action == 'reset' &&
function_exists('opcache_reset') &&
$userinfo['change_serversettings'] == '1'
) {
if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') {
opcache_reset();
$log->logAction(ADM_ACTION, LOG_INFO, "reseted OPcache");
header('Location: ' . $linker->getLink(array('section' => 'opcacheinfo', 'page' => 'showinfo')));
header('Location: ' . $linker->getLink(array(
'section' => 'opcacheinfo',
'page' => 'showinfo'
)));
exit();
}
if (!function_exists('opcache_get_configuration')
) {
if (! function_exists('opcache_get_configuration')) {
\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);
@@ -85,14 +81,11 @@ if ($page == 'showinfo'
'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'])))),
'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) : ''),
'blacklistmiss' => number_format($blacklistmiss, 0, '.', ' ') . ($cachetotal > 0 ? sprintf(" (%.1f %%)", $blacklistmiss / ($cachetotal) * 100) : '')
);
$usedmem = @$opcache_status['memory_usage']['used_memory'] ?: 0;
@@ -107,7 +100,7 @@ if ($page == 'showinfo'
'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) : ''),
'wasted' => $wastedmemstr . ($totalmem > 0 ? sprintf(" (%.1f %%)", $wastedmem / ($totalmem) * 100) : '')
);
}
@@ -121,7 +114,7 @@ if ($page == 'showinfo'
'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,'.',' '),
'strcount' => number_format(@$opcache_status['interned_strings_usage']['number_of_strings'] ?: 0, 0, '.', ' ')
);
}
@@ -133,7 +126,7 @@ if ($page == 'showinfo'
$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) : ''),
'wasted' => number_format($wastedkey, 0, '.', ' ') . ($totalkey > 0 ? sprintf(" (%.1f %%)", $wastedkey / ($totalkey) * 100) : '')
);
}
@@ -145,11 +138,16 @@ if ($page == 'showinfo'
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/opcacheinfo/showinfo") . "\";");
}
function bsize($s) {
foreach (array('', 'K', 'M', 'G') as $i => $k) {
function bsize($s)
{
foreach (array(
'',
'K',
'M',
'G'
) as $i => $k) {
if ($s < 1024)
break;
$s /= 1024;

View File

@@ -110,7 +110,9 @@ if ($page == 'overview') {
if ($action == 'delete') {
try {
$json_result = PhpSettings::getLocal($userinfo, array('id' => $id))->get();
$json_result = PhpSettings::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -121,7 +123,9 @@ if ($page == 'overview') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
try {
PhpSettings::getLocal($userinfo, array('id' => $id))->delete();
PhpSettings::getLocal($userinfo, array(
'id' => $id
))->delete();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -144,7 +148,9 @@ if ($page == 'overview') {
if ($action == 'edit') {
try {
$json_result = PhpSettings::getLocal($userinfo, array('id' => $id))->get();
$json_result = PhpSettings::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -248,7 +254,9 @@ if ($page == 'overview') {
if ($action == 'delete') {
try {
$json_result = FpmDaemons::getLocal($userinfo, array('id' => $id))->get();
$json_result = FpmDaemons::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -285,7 +293,9 @@ if ($page == 'overview') {
if ($action == 'edit') {
try {
$json_result = FpmDaemons::getLocal($userinfo, array('id' => $id))->get();
$json_result = FpmDaemons::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}

View File

@@ -16,7 +16,6 @@
* @package Panel
*
*/
define('AREA', 'admin');
require './lib/init.php';
@@ -26,7 +25,6 @@ use Froxlor\Settings as Settings;
if (isset($_POST['subjectid'])) {
$subjectid = intval($_POST['subjectid']);
$mailbodyid = intval($_POST['mailbodyid']);
} elseif (isset($_GET['subjectid'])) {
$subjectid = intval($_GET['subjectid']);
$mailbodyid = intval($_GET['mailbodyid']);
@@ -34,7 +32,6 @@ if (isset($_POST['subjectid'])) {
if (isset($_POST['id'])) {
$id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
$id = intval($_GET['id']);
}
@@ -49,10 +46,7 @@ $available_templates = array(
// only show templates of features that are enabled #1191
if ((int) Settings::Get('system.report_enable') == 1) {
array_push($available_templates,
'trafficmaxpercent',
'diskmaxpercent'
);
array_push($available_templates, 'trafficmaxpercent', 'diskmaxpercent');
}
$file_templates = array(
@@ -71,9 +65,10 @@ if ($action == '') {
$result_stmt = Database::prepare("
SELECT `id`, `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `templategroup`='mails'
ORDER BY `language`, `varname`"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid']));
ORDER BY `language`, `varname`");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid']
));
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$parts = array();
@@ -98,9 +93,11 @@ if ($action == '') {
$result_stmt = Database::prepare("
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `language`= :lang
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language_name));
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid'],
'lang' => $language_name
));
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$templates_done[] = str_replace('_subject', '', $row['varname']);
@@ -116,9 +113,10 @@ if ($action == '') {
$filetemplateadd = false;
$result_stmt = Database::prepare("
SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `templategroup`='files'"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid']));
WHERE `adminid` = :adminid AND `templategroup`='files'");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid']
));
if (Database::num_rows() != count($file_templates)) {
$filetemplateadd = true;
@@ -128,83 +126,86 @@ if ($action == '') {
eval("\$filetemplates.=\"" . \Froxlor\UI\Template::getTemplate("templates/templates_filetemplate") . "\";");
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates") . "\";");
} elseif($action == 'delete'
&& $subjectid != 0
&& $mailbodyid != 0
) {
} elseif ($action == 'delete' && $subjectid != 0 && $mailbodyid != 0) {
// email templates
$result_stmt = Database::prepare("
SELECT `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :id"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $subjectid));
WHERE `adminid` = :adminid AND `id` = :id");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid'],
'id' => $subjectid
));
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
if ($result['varname'] != '') {
if (isset($_POST['send'])
&& $_POST['send'] == 'send'
) {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$del_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid
AND (`id` = :ida OR `id` = :idb)"
);
AND (`id` = :ida OR `id` = :idb)");
Database::pexecute($del_stmt, array(
'adminid' => $userinfo['adminid'],
'ida' => $subjectid,
'idb' => $mailbodyid
));
$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 {
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' && $id != 0) {
// file templates
$result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :id"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id));
WHERE `adminid` = :adminid AND `id` = :id");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid'],
'id' => $id
));
if (Database::num_rows() > 0) {
$row = $result_stmt->fetch(PDO::FETCH_ASSOC);
if (isset($_POST['send'])
&& $_POST['send'] == 'send'
) {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$del_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :id"
);
Database::pexecute($del_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id));
WHERE `adminid` = :adminid AND `id` = :id");
Database::pexecute($del_stmt, array(
'adminid' => $userinfo['adminid'],
'id' => $id
));
$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 {
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 {
\Froxlor\UI\Response::standard_error('templatenotfound');
}
} elseif ($action == 'add') {
if (Settings::Get('panel.sendalternativemail') == 1) {
$available_templates[] = 'pop_success_alternative';
}
if (isset($_POST['prepare'])
&& $_POST['prepare'] == 'prepare'
) {
if (isset($_POST['prepare']) && $_POST['prepare'] == 'prepare') {
// email templates
$language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
$template = validate($_POST['template'], 'template');
@@ -231,10 +232,7 @@ if ($action == '') {
$image = $template_add_data['template_add']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates_add_2") . "\";");
} elseif(isset($_POST['send'])
&& $_POST['send'] == 'send'
) {
} elseif (isset($_POST['send']) && $_POST['send'] == 'send') {
// email templates
$language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
$template = validate($_POST['template'], 'template');
@@ -244,9 +242,11 @@ if ($action == '') {
$result_stmt = Database::prepare("
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `language` = :lang
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language));
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid'],
'lang' => $language
));
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$templates[] = str_replace('_subject', '', $row['varname']);
@@ -255,7 +255,6 @@ if ($action == '') {
$templates = array_diff($available_templates, $templates);
if (array_search($template, $templates) === false) {
\Froxlor\UI\Response::standard_error('templatenotfound');
} else {
$ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` SET
@@ -263,8 +262,7 @@ if ($action == '') {
`language` = :lang,
`templategroup` = 'mails',
`varname` = :var,
`value` = :value"
);
`value` = :value");
// mail-subject
$ins_data = array(
@@ -285,12 +283,12 @@ if ($action == '') {
Database::pexecute($ins_stmt, $ins_data);
$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']) && $_POST['filesend'] == 'filesend') {
// file templates
$template = validate($_POST['template'], 'template');
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
@@ -301,8 +299,7 @@ if ($action == '') {
`language` = '',
`templategroup` = 'files',
`varname` = :var,
`value` = :value"
);
`value` = :value");
$ins_data = array(
'adminid' => $userinfo['adminid'],
@@ -312,8 +309,10 @@ if ($action == '') {
Database::pexecute($ins_stmt, $ins_data);
$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'])) {
// email templates
@@ -326,9 +325,11 @@ if ($action == '') {
$result_stmt = Database::prepare("
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `language` = :lang
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language_name));
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid'],
'lang' => $language_name
));
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$templates[] = str_replace('_subject', '', $row['varname']);
@@ -351,18 +352,17 @@ if ($action == '') {
} else {
\Froxlor\UI\Response::standard_error('alltemplatesdefined');
}
} else {
// filetemplates
$result_stmt = Database::prepare("
SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `templategroup`='files'"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid']));
WHERE `adminid` = :adminid AND `templategroup`='files'");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid']
));
if (Database::num_rows() == count($file_templates)) {
\Froxlor\UI\Response::standard_error('alltemplatesdefined');
} else {
$templatesdefined = array();
@@ -385,32 +385,27 @@ if ($action == '') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/filetemplates_add") . "\";");
}
}
} elseif($action == 'edit'
&& $subjectid != 0
&& $mailbodyid != 0
) {
} elseif ($action == 'edit' && $subjectid != 0 && $mailbodyid != 0) {
// email templates
$result_stmt = Database::prepare("
SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :subjectid"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'subjectid' => $subjectid));
WHERE `adminid` = :adminid AND `id` = :subjectid");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid'],
'subjectid' => $subjectid
));
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
if ($result['varname'] != '') {
if (isset($_POST['send'])
&& $_POST['send'] == 'send'
) {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
$mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
$upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET
`value` = :value
WHERE `adminid` = :adminid AND `id` = :id"
);
WHERE `adminid` = :adminid AND `id` = :id");
// subject
Database::pexecute($upd_stmt, array(
'value' => $subject,
@@ -425,8 +420,10 @@ if ($action == '') {
));
$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 {
$result = htmlentities_array($result);
@@ -435,9 +432,10 @@ if ($action == '') {
$result_stmt = Database::prepare("
SELECT `language`, `varname`, `value`
FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `id` = :id"
);
Database::pexecute($result_stmt, array('id' => $mailbodyid));
WHERE `id` = :id");
Database::pexecute($result_stmt, array(
'id' => $mailbodyid
));
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
$template_name = str_replace('_mailbody', '', $result['varname']);
@@ -456,31 +454,27 @@ if ($action == '') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates_edit") . "\";");
}
}
} elseif($action == 'editf'
&& $id != 0
) {
} elseif ($action == 'editf' && $id != 0) {
// file templates
$result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid` = :adminid AND `id` = :id"
);
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id));
WHERE `adminid` = :adminid AND `id` = :id");
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid'],
'id' => $id
));
if (Database::num_rows() > 0) {
$row = $result_stmt->fetch(PDO::FETCH_ASSOC);
// filetemplates
if (isset($_POST['filesend'])
&& $_POST['filesend'] == 'filesend'
) {
if (isset($_POST['filesend']) && $_POST['filesend'] == 'filesend') {
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
$upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET
`value` = :value
WHERE `adminid` = :adminid AND `id` = :id"
);
WHERE `adminid` = :adminid AND `id` = :id");
Database::pexecute($upd_stmt, array(
'value' => $filecontent,
'adminid' => $userinfo['adminid'],
@@ -488,8 +482,10 @@ if ($action == '') {
));
$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 {
$row = htmlentities_array($row);
@@ -501,7 +497,6 @@ if ($action == '') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/filetemplates_edit") . "\";");
}
} else {
\Froxlor\UI\Response::standard_error('templatenotfound');
}

View File

@@ -15,7 +15,6 @@
* @package Panel
*
*/
define('AREA', 'admin');
require './lib/init.php';
@@ -41,7 +40,7 @@ $months = array(
'9' => 'sep',
'10' => 'oct',
'11' => 'nov',
'12' => 'dec',
'12' => 'dec'
);
if ($page == 'overview' || $page == 'customers') {
@@ -74,17 +73,17 @@ if ($page == 'overview' || $page == 'customers') {
'sep' => 0,
'oct' => 0,
'nov' => 0,
'dec' => 0,
'dec' => 0
);
$customer_name_list_stmt = Database::prepare("
SELECT `customerid`,`company`,`name`,`firstname`
FROM `" . TABLE_PANEL_CUSTOMERS . "`
WHERE `deactivated`='0'" .
($userinfo['customers_see_all'] ? '' : " AND `adminid` = :id") . "
ORDER BY name"
);
Database::pexecute($customer_name_list_stmt, array('id' => $userinfo['adminid']));
WHERE `deactivated`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :id") . "
ORDER BY name");
Database::pexecute($customer_name_list_stmt, array(
'id' => $userinfo['adminid']
));
while ($customer_name = $customer_name_list_stmt->fetch(PDO::FETCH_ASSOC)) {
@@ -102,16 +101,18 @@ if ($page == 'overview' || $page == 'customers') {
'sep' => '-',
'oct' => '-',
'nov' => '-',
'dec' => '-',
'dec' => '-'
);
$traffic_list_stmt = Database::prepare("
SELECT month, SUM(http+ftp_up+ftp_down+mail)*1024 AS traffic
FROM `" . TABLE_PANEL_TRAFFIC . "`
WHERE year = :year AND `customerid` = :id
GROUP BY month ORDER BY month"
);
Database::pexecute($traffic_list_stmt, array('year' => (date("Y")-$years), 'id' => $customer_name['customerid']));
GROUP BY month ORDER BY month");
Database::pexecute($traffic_list_stmt, array(
'year' => (date("Y") - $years),
'id' => $customer_name['customerid']
));
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');
@@ -121,7 +122,7 @@ if ($page == 'overview' || $page == 'customers') {
}
// sum up totals
$virtual_host = array(
'name' => $lng['traffic']['months']['total'],
'name' => $lng['traffic']['months']['total']
);
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'));

View File

@@ -14,7 +14,6 @@
* @package Panel
*
*/
define('AREA', 'admin');
require './lib/init.php';
@@ -30,14 +29,10 @@ if ($page == 'overview') {
* so we have to set them both to run a correct upgrade
*/
if (! isFroxlor()) {
if (Settings::Get('panel.version') == null
|| Settings::Get('panel.version') == ''
) {
if (Settings::Get('panel.version') == null || Settings::Get('panel.version') == '') {
Settings::Set('panel.version', '1.4.2.1');
}
if (Settings::Get('system.dbversion') == null
|| Settings::Get('system.dbversion') == ''
) {
if (Settings::Get('system.dbversion') == null || Settings::Get('system.dbversion') == '') {
/**
* for syscp-stable (1.4.2.1) this value has to be 0
* so the required table-fields are added correctly
@@ -45,8 +40,7 @@ if ($page == 'overview') {
* -> bug #54
*/
$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);
if (isset($result['value'])) {
@@ -61,14 +55,8 @@ if ($page == 'overview') {
$successful_update = false;
$message = '';
if (isset($_POST['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['send']) && $_POST['send'] == 'send') {
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') . "\";");
include_once './install/updatesql.php';

View File

@@ -70,8 +70,7 @@ if ($action == 'delete') {
// customer generates for himself, admins will see a customer-select-box later
if (AREA == 'admin') {
$cid = 0;
}
elseif (AREA == 'customer') {
} elseif (AREA == 'customer') {
$cid = $userinfo['customerid'];
}
$key = hash('sha256', openssl_random_pseudo_bytes(64 * 64));
@@ -110,8 +109,7 @@ if ($action == 'delete') {
");
if (AREA == 'admin') {
$cid = 0;
}
elseif (AREA == 'customer') {
} elseif (AREA == 'customer') {
$cid = $userinfo['customerid'];
}
Database::pexecute($upd_stmt, array(
@@ -122,7 +120,7 @@ if ($action == 'delete') {
'cid' => $cid
));
echo json_encode(true);
exit;
exit();
}
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed api::api_keys");

View File

@@ -19,7 +19,8 @@
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" />
<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)" />
<target name="static-analysis"
@@ -41,7 +42,8 @@
</parallel>
</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/coverage" />
<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.">
<exec executable="${pdepend}" taskname="pdepend">
<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
value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
<arg path="${basedir}/lib/Froxlor" />
@@ -204,7 +207,8 @@
<target name="phpunit-no-coverage" unless="phpunit.done"
depends="prepare"
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 path="${basedir}/phpunit.xml" />
<arg value="--testsuite" />
@@ -215,9 +219,11 @@
<property name="phpunit.done" value="true" />
</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">
<exec executable="${phpdox}" dir="${basedir}/build" taskname="phpdox">
<exec executable="${phpdox}" dir="${basedir}/build"
taskname="phpdox">
<arg value="--file" />
<arg path="${basedir}/phpdox.xml" />
</exec>

View File

@@ -8,11 +8,13 @@
],
"homepage": "https://www.froxlor.org",
"license": "GPL-2.0-or-later",
"authors" : [{
"authors": [
{
"name": "Michael Kaufmann",
"email": "team@froxlor.org",
"role": "Lead Developer"
}, {
},
{
"name": "Robert Förster",
"email": "team@froxlor.org",
"role": "Package Maintainer"

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
*
*/
define('AREA', 'customer');
require './lib/init.php';
@@ -51,9 +50,11 @@ if ($page == 'overview') {
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`
WHERE `d`.`customerid`= :customerid
AND `d`.`email_only`='0'
AND `d`.`id` <> :standardsubdomain " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
);
Database::pexecute($domains_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain']));
AND `d`.`id` <> :standardsubdomain " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
Database::pexecute($domains_stmt, array(
"customerid" => $userinfo['customerid'],
"standardsubdomain" => $userinfo['standardsubdomain']
));
$paging->setEntries(Database::num_rows());
$sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
@@ -79,7 +80,9 @@ if ($page == 'overview') {
// nothing (ssl_global)
$row['domain_hascert'] = 0;
$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);
if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') {
// own certificate (ssl_customer_green)
@@ -88,7 +91,9 @@ if ($page == 'overview') {
// check if it's parent has one set (shared)
if ($row['parentdomainid'] != 0) {
$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);
if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') {
// parent has a certificate (ssl_shared)
@@ -191,7 +196,9 @@ if ($page == 'overview') {
$result = json_decode($json_result, true)['data'];
$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($_POST['send']) && $_POST['send'] == 'send') {
@@ -200,9 +207,16 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
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 {
\Froxlor\UI\Response::standard_error('domains_cantdeletemaindomain');
@@ -215,16 +229,20 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
$stmt = Database::prepare("SELECT `id`, `domain`, `documentroot`, `ssl_redirect`,`isemaildomain`,`letsencrypt` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid` = :customerid
AND `parentdomainid` = '0'
AND `email_only` = '0'
AND `caneditdomain` = '1'
ORDER BY `domain` ASC"
);
Database::pexecute($stmt, array("customerid" => $userinfo['customerid']));
ORDER BY `domain` ASC");
Database::pexecute($stmt, array(
"customerid" => $userinfo['customerid']
));
$domains = '';
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
@@ -239,9 +257,10 @@ if ($page == 'overview') {
AND `d`.`customerid`=`c`.`customerid`
AND `d`.`email_only`='0'
AND `d`.`customerid`= :customerid
ORDER BY `d`.`domain` ASC"
);
Database::pexecute($domains_stmt, array("customerid" => $userinfo['customerid']));
ORDER BY `d`.`domain` ASC");
Database::pexecute($domains_stmt, array(
"customerid" => $userinfo['customerid']
));
while ($row_domain = $domains_stmt->fetch(PDO::FETCH_ASSOC)) {
$aliasdomains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id']);
@@ -274,8 +293,7 @@ if ($page == 'overview') {
$phpconfigs = '';
$has_phpconfigs = false;
if (isset($userinfo['allowed_phpconfigs']) && !empty($userinfo['allowed_phpconfigs']))
{
if (isset($userinfo['allowed_phpconfigs']) && ! empty($userinfo['allowed_phpconfigs'])) {
$has_phpconfigs = true;
$allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY);
$phpconfigs_result_stmt = Database::query("
@@ -320,7 +338,10 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
$result['domain'] = $idna_convert->decode($result['domain']);
@@ -338,9 +359,11 @@ if ($page == 'overview') {
IN (SELECT `id_ipandports` FROM `" . TABLE_DOMAINTOIP . "`
WHERE `id_domain` = :id)
GROUP BY `d`.`id`, `d`.`domain`
ORDER BY `d`.`domain` ASC"
);
Database::pexecute($domains_stmt, array("id" => $result['id'], "customerid" => $userinfo['customerid']));
ORDER BY `d`.`domain` ASC");
Database::pexecute($domains_stmt, array(
"id" => $result['id'],
"customerid" => $userinfo['customerid']
));
while ($row_domain = $domains_stmt->fetch(PDO::FETCH_ASSOC)) {
$domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id'], $result['aliasdomain']);
@@ -376,7 +399,9 @@ if ($page == 'overview') {
LEFT JOIN `" . TABLE_DOMAINTOIP . "` dti ON dti.id_ipandports = pip.id
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);
if (isset($resultX['countSSL']) && (int) $resultX['countSSL'] > 0) {
$ssl_ipsandports = 'notempty';
@@ -404,9 +429,10 @@ if ($page == 'overview') {
LEFT JOIN `" . TABLE_DOMAINTOIP . "` `dip`
ON ( `dip`.`id_ipandports` = `p`.`id` )
WHERE `dip`.`id_domain` = :id_domain
GROUP BY `p`.`ip`"
);
Database::pexecute($ips_stmt, array("id_domain" => $result['id']));
GROUP BY `p`.`ip`");
Database::pexecute($ips_stmt, array(
"id_domain" => $result['id']
));
$result_ipandport['ip'] = '';
while ($rowip = $ips_stmt->fetch(PDO::FETCH_ASSOC)) {
$result_ipandport['ip'] .= $rowip['ip'] . "<br />";
@@ -414,8 +440,7 @@ if ($page == 'overview') {
$phpconfigs = '';
$has_phpconfigs = false;
if (isset($userinfo['allowed_phpconfigs']) && !empty($userinfo['allowed_phpconfigs']))
{
if (isset($userinfo['allowed_phpconfigs']) && ! empty($userinfo['allowed_phpconfigs'])) {
$has_phpconfigs = true;
$allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY);
$phpconfigs_result_stmt = Database::query("
@@ -463,13 +488,17 @@ if ($page == 'overview') {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
// 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 . "`
WHERE `domainid`= :domainid"
);
$result = Database::pexecute_first($stmt, array("domainid" => $id));
WHERE `domainid`= :domainid");
$result = Database::pexecute_first($stmt, array(
"domainid" => $id
));
$do_insert = false;
// if no entry can be found, behave like we have empty values
@@ -496,11 +525,9 @@ if ($page == 'overview') {
} elseif ($page == 'domaindnseditor' && $userinfo['dnsenabled'] == '1' && Settings::Get('system.dnsenabled') == '1') {
require_once __DIR__ . '/dns_editor.php';
} elseif ($page == 'sslcertificates') {
require_once __DIR__ . '/ssl_certificates.php';
} elseif ($page == 'logfiles') {
require_once __DIR__ . '/logfiles_viewer.php';

View File

@@ -16,7 +16,6 @@
* @package Panel
*
*/
define('AREA', 'customer');
require './lib/init.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`
LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`)
LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`)
WHERE `m`.`customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
);
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
WHERE `m`.`customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
Database::pexecute($result_stmt, array(
"customerid" => $userinfo['customerid']
));
$emailscount = Database::num_rows();
$paging->setEntries($emailscount);
$sortcode = $paging->getHtmlSortCode($lng);
@@ -131,9 +131,10 @@ if ($page == 'overview') {
$emaildomains_count_stmt = Database::prepare("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid`= :customerid
AND `isemaildomain`='1' ORDER BY `domain` ASC"
);
Database::pexecute($emaildomains_count_stmt, array("customerid" => $userinfo['customerid']));
AND `isemaildomain`='1' ORDER BY `domain` ASC");
Database::pexecute($emaildomains_count_stmt, array(
"customerid" => $userinfo['customerid']
));
$emaildomains_count = $emaildomains_count_stmt->fetch(PDO::FETCH_ASSOC);
$emaildomains_count = $emaildomains_count['count'];
@@ -157,14 +158,21 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
if ($result['popaccountid'] != '0') {
$show_checkbox = true;
} else {
$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') {
@@ -176,14 +184,20 @@ if ($page == 'overview') {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
$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 {
$result_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid`= :cid
AND `isemaildomain`='1'
ORDER BY `domain` ASC"
);
Database::pexecute($result_stmt, array("cid" => $userinfo['customerid']));
ORDER BY `domain` ASC");
Database::pexecute($result_stmt, array(
"cid" => $userinfo['customerid']
));
$domains = '';
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
@@ -271,7 +285,12 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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') {
if ($action == 'add' && $id != 0) {
@@ -291,11 +310,18 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
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']);
@@ -311,11 +337,16 @@ if ($page == 'overview') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/account_add") . "\";");
}
} else {
\Froxlor\UI\Response::standard_error(array('allresourcesused', 'allocatetoomuchquota'), $quota);
\Froxlor\UI\Response::standard_error(array(
'allresourcesused',
'allocatetoomuchquota'
), $quota);
}
} elseif ($action == 'changepw' && $id != 0) {
try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get();
$json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -328,7 +359,12 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
$result['email_full'] = $idna_convert->decode($result['email_full']);
$result = htmlentities_array($result);
@@ -344,7 +380,9 @@ if ($page == 'overview') {
}
} elseif ($action == 'changequota' && Settings::Get('system.mail_quota_enabled') == '1' && $id != 0) {
try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get();
$json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -357,7 +395,12 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
$result['email_full'] = $idna_convert->decode($result['email_full']);
$result = htmlentities_array($result);
@@ -373,7 +416,9 @@ if ($page == 'overview') {
}
} elseif ($action == 'delete' && $id != 0) {
try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get();
$json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -386,9 +431,18 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
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 ($userinfo['email_forwarders_used'] < $userinfo['email_forwarders'] || $userinfo['email_forwarders'] == '-1') {
try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get();
$json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -409,7 +465,12 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
$result['email_full'] = $idna_convert->decode($result['email_full']);
$result = htmlentities_array($result);
@@ -428,7 +489,9 @@ if ($page == 'overview') {
}
} elseif ($action == 'delete' && $id != 0) {
try {
$json_result = Emails::getLocal($userinfo, array('id' => $id))->get();
$json_result = Emails::getLocal($userinfo, array(
'id' => $id
))->get();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -454,9 +517,19 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
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
*
*/
define('AREA', 'customer');
require './lib/init.php';
@@ -50,9 +49,10 @@ if ($page == 'overview') {
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_FTP_USERS, $fields);
$result_stmt = Database::prepare("SELECT `id`, `username`, `description`, `homedir`, `shell` FROM `" . TABLE_FTP_USERS . "`
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
);
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
Database::pexecute($result_stmt, array(
"customerid" => $userinfo['customerid']
));
$ftps_count = Database::num_rows();
$paging->setEntries($ftps_count);
$sortcode = $paging->getHtmlSortCode($lng);
@@ -99,9 +99,16 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
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 {
\Froxlor\UI\Response::standard_error('ftp_cantdeletemainaccount');
@@ -114,7 +121,10 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
$pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], '/');
@@ -123,9 +133,10 @@ if ($page == 'overview') {
$domains = '';
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid`= :customerid"
);
Database::pexecute($result_domains_stmt, array("customerid" => $userinfo['customerid']));
WHERE `customerid`= :customerid");
Database::pexecute($result_domains_stmt, array(
"customerid" => $userinfo['customerid']
));
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
$domainlist[] = $row_domain['domain'];
@@ -180,7 +191,10 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
if (strpos($result['homedir'], $userinfo['documentroot']) === 0) {
$homedir = str_replace($userinfo['documentroot'], "/", $result['homedir']);
@@ -195,9 +209,10 @@ if ($page == 'overview') {
$domains = '';
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid` = :customerid"
);
Database::pexecute($result_domains_stmt, array("customerid" => $userinfo['customerid']));
WHERE `customerid` = :customerid");
Database::pexecute($result_domains_stmt, array(
"customerid" => $userinfo['customerid']
));
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
$domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);

View File

@@ -16,7 +16,6 @@
* @package Panel
*
*/
define('AREA', 'customer');
require './lib/init.php';
@@ -27,19 +26,19 @@ use Froxlor\Api\Commands\Customers as Customers;
if ($action == 'logout') {
$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') {
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
WHERE `userid` = :customerid
AND `adminsession` = '0'
AND `hash` = :hash"
);
AND `hash` = :hash");
$params["hash"] = $s;
} else {
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
WHERE `userid` = :customerid
AND `adminsession` = '0'"
);
AND `adminsession` = '0'");
}
Database::pexecute($stmt, $params);
@@ -54,7 +53,10 @@ if ($page == 'overview') {
AND `parentdomainid` = '0'
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 = '';
$domainArray = array();
@@ -74,7 +76,10 @@ if ($page == 'overview') {
WHERE `customerid` = :customerid
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'];
}
@@ -84,7 +89,9 @@ if ($page == 'overview') {
// 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 = 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_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places'));
@@ -99,10 +106,14 @@ if ($page == 'overview') {
$services_enabled = "";
$se = array();
if ($userinfo['imap'] == '1') $se[] = "IMAP";
if ($userinfo['pop3'] == '1') $se[] = "POP3";
if ($userinfo['phpenabled'] == '1') $se[] = "PHP";
if ($userinfo['perlenabled'] == '1') $se[] = "Perl/CGI";
if ($userinfo['imap'] == '1')
$se[] = "IMAP";
if ($userinfo['pop3'] == '1')
$se[] = "POP3";
if ($userinfo['phpenabled'] == '1')
$se[] = "PHP";
if ($userinfo['perlenabled'] == '1')
$se[] = "Perl/CGI";
$services_enabled = implode(", ", $se);
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/index') . "\";");
@@ -117,17 +128,29 @@ if ($page == 'overview') {
$new_password_confirm = validatePassword($_POST['new_password_confirm'], 'new password confirm');
if ($old_password == '') {
\Froxlor\UI\Response::standard_error(array('stringisempty', 'oldpassword'));
\Froxlor\UI\Response::standard_error(array(
'stringisempty',
'oldpassword'
));
} elseif ($new_password == '') {
\Froxlor\UI\Response::standard_error(array('stringisempty', 'newpassword'));
\Froxlor\UI\Response::standard_error(array(
'stringisempty',
'newpassword'
));
} 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) {
\Froxlor\UI\Response::standard_error('newpasswordconfirmerror');
} else {
// Update user password
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) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -139,8 +162,7 @@ if ($page == 'overview') {
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
SET `password` = :password
WHERE `customerid` = :customerid
AND `username` = :username"
);
AND `username` = :username");
$params = array(
"password" => $cryptPassword,
"customerid" => $userinfo['customerid'],
@@ -162,8 +184,7 @@ if ($page == 'overview') {
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_HTPASSWDS . "`
SET `password` = :password
WHERE `customerid` = :customerid
AND `username` = :username"
);
AND `username` = :username");
$params = array(
"password" => $new_webalizer_password,
"customerid" => $userinfo['customerid'],
@@ -172,7 +193,9 @@ if ($page == 'overview') {
Database::pexecute($stmt, $params);
}
\Froxlor\UI\Response::redirectTo($filename, array('s' => $s));
\Froxlor\UI\Response::redirectTo($filename, array(
's' => $s
));
}
} else {
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/change_password') . "\";");
@@ -182,7 +205,10 @@ if ($page == 'overview') {
$def_language = validate($_POST['def_language'], 'default language');
if (isset($languages[$def_language])) {
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) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -190,12 +216,16 @@ if ($page == 'overview') {
// also update current session
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_SESSIONS . "`
SET `language` = :lang
WHERE `hash` = :hash"
);
Database::pexecute($stmt, array("lang" => $def_language, "hash" => $s));
WHERE `hash` = :hash");
Database::pexecute($stmt, array(
"lang" => $def_language,
"hash" => $s
));
}
$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 {
$default_lang = Settings::Get('panel.standardlanguage');
if ($userinfo['def_language'] != '') {
@@ -213,7 +243,10 @@ if ($page == 'overview') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$theme = validate($_POST['theme'], 'theme');
try {
Customers::getLocal($userinfo, array('id' => $userinfo['customerid'], 'theme' => $theme))->update();
Customers::getLocal($userinfo, array(
'id' => $userinfo['customerid'],
'theme' => $theme
))->update();
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}
@@ -221,12 +254,16 @@ if ($page == 'overview') {
// also update current session
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_SESSIONS . "`
SET `theme` = :theme
WHERE `hash` = :hash"
);
Database::pexecute($stmt, array("theme" => $theme, "hash" => $s));
WHERE `hash` = :hash");
Database::pexecute($stmt, array(
"theme" => $theme,
"hash" => $s
));
$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 {
$default_theme = Settings::Get('panel.default_theme');
if ($userinfo['theme'] != '') {
@@ -241,7 +278,6 @@ if ($page == 'overview') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/change_theme') . "\";");
}
} elseif ($page == 'send_error_report' && Settings::Get('system.allow_error_report_customer') == '1') {
// only show this if we really have an exception to report
@@ -279,9 +315,7 @@ if ($page == 'overview') {
$mail_html = str_replace("\n", "<br />", $mail_body);
// send actual report to dev-team
if (isset($_POST['send'])
&& $_POST['send'] == 'send'
) {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
// send mail and say thanks
$_mailerror = false;
try {
@@ -305,22 +339,25 @@ if ($page == 'overview') {
// finally remove error from fs
@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
// before actually sending anything
eval("echo \"" . \Froxlor\UI\Template::getTemplate("index/send_error_report") . "\";");
} else {
\Froxlor\UI\Response::redirectTo($filename, array('s' => $s));
\Froxlor\UI\Response::redirectTo($filename, array(
's' => $s
));
}
} 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';
}
elseif ($page == 'apihelp' && Settings::Get('api.enabled') == 1) {
} elseif ($page == 'apihelp' && Settings::Get('api.enabled') == 1) {
require_once __DIR__ . '/apihelp.php';
}

View File

@@ -16,7 +16,6 @@
* @package Panel
*
*/
define('AREA', 'customer');
require './lib/init.php';
@@ -56,9 +55,10 @@ if ($page == 'overview') {
);
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DATABASES, $fields);
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DATABASES . "`
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
);
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
Database::pexecute($result_stmt, array(
"customerid" => $userinfo['customerid']
));
$mysqls_count = Database::num_rows();
$paging->setEntries($mysqls_count);
@@ -81,9 +81,10 @@ if ($page == 'overview') {
$row = htmlentities_array($row);
$mbdata_stmt = Database::prepare("SELECT SUM(data_length + index_length) as MB FROM information_schema.TABLES
WHERE table_schema = :table_schema
GROUP BY table_schema"
);
Database::pexecute($mbdata_stmt, array("table_schema" => $row['databasename']));
GROUP BY table_schema");
Database::pexecute($mbdata_stmt, array(
"table_schema" => $row['databasename']
));
$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');
eval("\$mysqls.=\"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls_database') . "\";");
@@ -95,7 +96,6 @@ if ($page == 'overview') {
// End root-session
eval("echo \"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls') . "\";");
} elseif ($action == 'delete' && $id != 0) {
try {
@@ -124,13 +124,20 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
$dbnamedesc = $result['databasename'];
if (isset($result['description']) && $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') {
@@ -141,7 +148,10 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
$dbservers_stmt = Database::query("SELECT DISTINCT `dbserver` FROM `" . TABLE_PANEL_DATABASES . "`");
@@ -182,7 +192,10 @@ if ($page == 'overview') {
} catch (Exception $e) {
\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 {
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `" . TABLE_PANEL_DATABASES . "`");

View File

@@ -16,7 +16,6 @@
* @package Panel
*
*/
define('AREA', 'customer');
$intrafficpage = 1;
require './lib/init.php';
@@ -39,8 +38,7 @@ if (isset($_POST['month']) && isset($_POST['year'])) {
} elseif (isset($_GET['month']) && isset($_GET['year'])) {
$month = intval($_GET['month']);
$year = intval($_GET['year']);
}
//BAM! $_GET???
} // BAM! $_GET???
elseif (isset($_GET['page']) && $_GET['page'] == 'current') {
if (date('d') != '01') {
$month = date('m');
@@ -64,8 +62,7 @@ if (!is_null($month) && !is_null($year)) {
AND `month` = :month
AND `year` = :year
GROUP BY `day`
ORDER BY `day` DESC"
);
ORDER BY `day` DESC");
$params = array(
"customerid" => $userinfo['customerid'],
"month" => $month,
@@ -119,9 +116,10 @@ if (!is_null($month) && !is_null($year)) {
FROM `" . TABLE_PANEL_TRAFFIC . "`
WHERE `customerid` = :customerid
GROUP BY `year` DESC, `month` DESC
LIMIT 12"
);
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
LIMIT 12");
Database::pexecute($result_stmt, array(
"customerid" => $userinfo['customerid']
));
$traffic_complete['http'] = 0;
$traffic_complete['ftp'] = 0;
$traffic_complete['mail'] = 0;

View File

@@ -1,7 +1,7 @@
<?php
if (! defined('AREA')) {
header("Location: index.php");
exit;
exit();
}
/**

View File

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

View File

@@ -1132,8 +1132,7 @@ class FroxlorInstall
}
// require chosen language if not english
if ($this->_activelng != $standardlanguage)
{
if ($this->_activelng != $standardlanguage) {
$lngfile = $this->_basepath . '/install/lng/' . $this->_activelng . '.lng.php';
if (file_exists($lngfile)) {
// includes file /lng/$language.lng.php if it exists

View File

@@ -16,7 +16,6 @@
* @package Language
*
*/
$lng['requirements']['title'] = 'Checking system requirements...';
$lng['requirements']['installed'] = 'installed';
$lng['requirements']['not_true'] = 'no';

View File

@@ -16,7 +16,6 @@
* @package Language
*
*/
$lng['requirements']['title'] = 'Vérification des prérequis système...';
$lng['requirements']['installed'] = 'installé';
$lng['requirements']['not_true'] = 'non';

View File

@@ -16,7 +16,6 @@
* @package Language
*
*/
$lng['requirements']['title'] = 'Prüfe Systemvoraussetzungen...';
$lng['requirements']['installed'] = 'installiert';
$lng['requirements']['not_true'] = 'nein';

View File

@@ -1,16 +1,44 @@
@charset "UTF-8";
/* 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; }
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; }
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;
}
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 */
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;
color: #444;
-webkit-font-smoothing: subpixel-antialiased;
@@ -48,7 +76,6 @@ h3 {
font-size: 15px;
}
img {
border: 0;
vertical-align: middle;
@@ -186,7 +213,8 @@ p.submit {
* error message display
*/
.errorcontainer {
background:url(../img/icons/error_big.png) 10px center no-repeat #ffedef;
background: url(../img/icons/error_big.png) 10px center no-repeat
#ffedef;
border: 1px solid #ffc2ca;
padding: 10px 10px 10px 68px !important;
margin: 10px 0 10px 0 !important;
@@ -209,7 +237,8 @@ p.submit {
* warning message display
*/
.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
#fffecc;
border: 1px solid #f3c37e;
padding: 10px 10px 10px 68px !important;
margin: 10px 0 10px 0 !important;
@@ -217,6 +246,7 @@ p.submit {
overflow: hidden;
box-shadow: 0 0 0 black;
}
.ui-dialog {
padding: 10px !important;
}
@@ -326,6 +356,7 @@ table thead th, table th {
background-color: #e9edf0;
font-weight: bold;
}
table thead:first-child th, table:first-child th {
border-top: none !important;
}
@@ -333,16 +364,21 @@ table thead:first-child th, table:first-child th {
table th {
border-top: 0;
}
th a:hover {
text-decoration: none;
}
th a img {
}
th a:nth-child(odd) img {
position: relative;
top: -5px;
left: 4px;
}
th a:nth-child(even) img {
position: relative;
top: 3px;
@@ -360,6 +396,7 @@ table thead:first-child th {
table tbody td {
border-bottom: 1px dotted #ccc;
}
table tbody tr:last-child td {
border-bottom: 0;
}
@@ -443,43 +480,54 @@ input[type="button"],input[type="submit"],input[type="reset"] {
height: 26px;
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;
}
input[type="button"]:hover,input[type="submit"]:hover,input[type="reset"]:hover {
input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover
{
color: #333;
background-color: #dcdcdc;
}
input[type="button"]:active,input[type="submit"]:active,input[type="reset"]:active {
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);
-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;
background-color: #35aa47;
}
input[type="submit"]:hover, input[class="yesbutton"]:hover {
color: white;
background-color: #1d943b;
}
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"] {
background: #dae7ee;
padding: 0;
@@ -502,13 +550,15 @@ select {
margin-bottom: 5px;
min-width: 100px;
}
select.dropdown {
padding: 2px 4px 2px 24px;
height: 26px;
border: 1px solid #d9d9d9;
margin-bottom: 5px;
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;
-moz-appearance: none;
appearance: none;
@@ -541,22 +591,47 @@ select.dropdown {
margin-bottom: .5em;
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; }
.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; }
.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\Settings as Settings;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).

View File

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

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
namespace Froxlor\Cron\Http;
use Froxlor\Database\Database;
use \Froxlor\Settings;
use Froxlor\Settings;
use Froxlor\Cron\Http\Php\PhpInterface;
/**
@@ -21,20 +21,18 @@ use Froxlor\Cron\Http\Php\PhpInterface;
* @package Cron
*
*/
class ApacheFcgi extends Apache
{
protected function composePhpOptions($domain, $ssl_vhost = false)
{
$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);
$phpconfig = $php->getPhpConfig((int) $domain['phpsettingid']);
if((int)Settings::Get('phpfpm.enabled') == 1)
{
if ((int) Settings::Get('phpfpm.enabled') == 1) {
$srvName = 'fpm.external';
if ($domain['ssl'] == 1 && $ssl_vhost) {
$srvName = 'ssl-fpm.external';
@@ -46,9 +44,7 @@ class ApacheFcgi extends Apache
}
// mod_proxy stuff for apache-2.4
if (Settings::Get('system.apache24') == '1'
&& Settings::Get('phpfpm.use_mod_proxy') == '1'
) {
if (Settings::Get('system.apache24') == '1' && Settings::Get('phpfpm.use_mod_proxy') == '1') {
$filesmatch = $phpconfig['fpm_settings']['limit_extensions'];
$extensions = explode(" ", $filesmatch);
$filesmatch = "";
@@ -79,7 +75,6 @@ class ApacheFcgi extends Apache
$php_options_text .= ' CGIPassAuth On' . "\n";
$php_options_text .= ' </Directory>' . "\n";
}
} else {
$addheader = "";
if ($phpconfig['pass_authorizationheader'] == '1') {
@@ -116,24 +111,18 @@ class ApacheFcgi extends Apache
$php_options_text .= ' </Directory>' . "\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)
{
if ((int) Settings::Get('system.mod_fcgid_wrapper') == 0) {
$php_options_text .= ' SuexecUserGroup "' . $domain['loginname'] . '" "' . $domain['loginname'] . '"' . "\n";
$php_options_text .= ' ScriptAlias /php/ ' . $php->getInterface()->getConfigDir() . "\n";
}
else
{
} 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']);
$php_options_text .= ' <FilesMatch "\.(' . implode('|', $file_extensions) . ')$">' . "\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 .= ' Options +ExecCGI' . "\n";
@@ -161,9 +150,7 @@ class ApacheFcgi extends Apache
// create php.ini (fpm does nothing here, as it
// defines ini-settings in its pool config)
$php->getInterface()->createIniFile($phpconfig);
}
else
{
} else {
$php_options_text .= ' # PHP is disabled for this vHost' . "\n";
}
@@ -172,20 +159,13 @@ class ApacheFcgi extends Apache
public function createOwnVhostStarter()
{
if (Settings::Get('system.mod_fcgid_ownvhost') == '1'
|| (Settings::Get('phpfpm.enabled') == '1'
&& Settings::Get('phpfpm.enabled_ownvhost') == '1')
) {
if (Settings::Get('system.mod_fcgid_ownvhost') == '1' || (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.enabled_ownvhost') == '1')) {
$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');
$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');
$group = Settings::Get('phpfpm.vhost_httpgroup');

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.
@@ -14,11 +17,10 @@
* @package Cron
*
*/
use \Froxlor\Database;
use \Froxlor\Settings;
use Froxlor\Database;
use Froxlor\Settings;
if ((int)Settings::Get('system.report_webmax') > 0)
{
if ((int) Settings::Get('system.report_webmax') > 0) {
/**
* 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)) {
if (isset($row['diskspace'])
&& $row['diskspace_used'] != null
&& $row['diskspace_used'] > 0
&& (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int)Settings::Get('system.report_webmax')
) {
if (isset($row['diskspace']) && $row['diskspace_used'] != null && $row['diskspace_used'] > 0 && (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int) Settings::Get('system.report_webmax')) {
$rep_userinfo = array(
'name' => $row['name'],
@@ -58,12 +56,16 @@ if ((int)Settings::Get('system.report_webmax') > 0)
SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
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) {
$langfile = $lngfile['file'];
} 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'];
}
@@ -117,7 +119,9 @@ if ((int)Settings::Get('system.report_webmax') > 0)
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `reportsent` = '2'
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)) {
if (isset($row['diskspace'])
&& $row['diskspace_used'] != null
&& $row['diskspace_used'] > 0
&& (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int)Settings::Get('system.report_webmax')
) {
if (isset($row['diskspace']) && $row['diskspace_used'] != null && $row['diskspace_used'] > 0 && (($row['diskspace_used'] * 100) / $row['diskspace']) >= (int) Settings::Get('system.report_webmax')) {
$replace_arr = array(
'NAME' => $row['name'],
@@ -148,12 +148,16 @@ if ((int)Settings::Get('system.report_webmax') > 0)
SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
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) {
$langfile = $lngfile['file'];
} 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'];
}
@@ -207,7 +211,9 @@ if ((int)Settings::Get('system.report_webmax') > 0)
UPDATE `" . TABLE_PANEL_ADMINS . "` SET `reportsent` = '2'
WHERE `adminid` = :adminid
");
Database::pexecute($upd_stmt, array('adminid' => $row['adminid']));
Database::pexecute($upd_stmt, array(
'adminid' => $row['adminid']
));
}
}
} // webmax > 0

View File

@@ -70,7 +70,8 @@ class FroxlorLogger
/**
* return FroxlorLogger instance
*
* @param array $userinfo unused
* @param array $userinfo
* unused
*
* @return FroxlorLogger
*/

View File

@@ -5,16 +5,21 @@ use Froxlor\Settings;
class Statistics
{
/**
* Create or modify the AWStats configuration file for the given domain.
* Modified by Berend Dekens to allow custom configurations.
*
* @param logFile
* @param siteDomain
* @param hostAliases
* @param
* logFile
* @param
* siteDomain
* @param
* hostAliases
* @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
$header = "## GENERATED BY FROXLOR\n";
@@ -76,9 +81,7 @@ class Statistics
// Write the configuration file
while (($line = fgets($awstats_model_conf, 4096)) !== false) {
if (!preg_match('/^#/', $line)
&& trim($line) != ''
) {
if (! preg_match('/^#/', $line) && trim($line) != '') {
fwrite($awstats_domain_conf, preg_replace($regex, $replace, $line));
}
}
@@ -92,17 +95,16 @@ class Statistics
* either with webserver-user or - if fcgid
* is used - the customers name, #258
*
* @param array $row array if panel_customers
* @param array $row
* array if panel_customers
*
* @return void
*/
public static function makeChownWithNewStats($row) {
public static function makeChownWithNewStats($row)
{
// get correct user
if ((Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1')
&& isset($row['deactivated'])
&& $row['deactivated'] == '0'
) {
if ((Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') && isset($row['deactivated']) && $row['deactivated'] == '0') {
$user = $row['loginname'];
$group = $row['loginname'];
} else {
@@ -124,5 +126,4 @@ class Statistics
\Froxlor\FileDir::safe_exec('chown -R ' . escapeshellarg($user) . ':' . escapeshellarg($group) . ' ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
}
}
}

View File

@@ -1,10 +1,8 @@
<?php
namespace Froxlor;
use Froxlor\Database\Database;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
@@ -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 void Stash () forget all un-saved changes to settings
*/
class Settings {
class Settings
{
/**
* current settings object
@@ -75,7 +74,8 @@ class Settings {
/**
* private constructor, reads in all settings
*/
private function __construct() {
private function __construct()
{
$this->_readSettings();
self::$_updatedata = array();
// prepare statement
@@ -89,7 +89,8 @@ class Settings {
* Read in all settings from the database
* and set the internal $_data array
*/
private function _readSettings() {
private function _readSettings()
{
$result_stmt = Database::query("
SELECT `settingid`, `settinggroup`, `varname`, `value`
FROM `" . TABLE_PANEL_SETTINGS . "`
@@ -108,7 +109,8 @@ class Settings {
* @param string $varname
* @param string $value
*/
private function _storeSetting($group = null, $varname = null, $value = null) {
private function _storeSetting($group = null, $varname = null, $value = null)
{
$upd_data = array(
'group' => $group,
'varname' => $varname,
@@ -120,11 +122,13 @@ class Settings {
/**
* 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
*/
public function pGet($setting = null) {
public function pGet($setting = null)
{
$sstr = explode(".", $setting);
// no separator - do'h
if (! isset($sstr[1])) {
@@ -140,12 +144,15 @@ class Settings {
/**
* 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 $entry the entry that is expected to be in the list
* @param string $setting
* 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
*/
public function pIsInList($setting = null, $entry = null) {
public function pIsInList($setting = null, $entry = null)
{
$s = Settings::Get($setting);
if ($s == null) {
return false;
@@ -157,13 +164,15 @@ class Settings {
/**
* 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 boolean $instant_save
*
* @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
if (Settings::Get($setting) !== null) {
// set new value in array
@@ -195,12 +204,14 @@ class Settings {
/**
* 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
*
* @return boolean
*/
public function pAddNew($setting = null, $value = null) {
public function pAddNew($setting = null, $value = null)
{
// first check if it doesn't exist
if (Settings::Get($setting) === null) {
@@ -233,7 +244,8 @@ class Settings {
* Store all un-saved changes to the database and
* re-read in all settings
*/
public function pFlush() {
public function pFlush()
{
if (is_array(self::$_updatedata) && count(self::$_updatedata) > 0) {
// save all un-saved changes to the settings
foreach (self::$_updatedata as $group => $vargroup) {
@@ -252,7 +264,8 @@ class Settings {
/**
* forget all un-saved changes to settings
*/
public function pStash() {
public function pStash()
{
// empty update array
self::$_updatedata = array();
}
@@ -262,7 +275,8 @@ class Settings {
*
* @return object
*/
private static function getInstance() {
private static function getInstance()
{
// do we got an object already?
if (self::$_obj == null) {
self::$_obj = new self();
@@ -280,12 +294,16 @@ class Settings {
*
* @return mixed
*/
public static function __callStatic($name, $args) {
public static function __callStatic($name, $args)
{
// as our functions are not static and therefore cannot
// be called statically, we prefix a 'p' to all of
// our public functions so we can use Settings::functionname()
// 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);
return $result;
}

View File

@@ -145,72 +145,31 @@ class Crypt
* we check against the length, if not matched
* 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
*/
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) {
$password = validate(
$password,
Settings::Get('panel.password_min_length'),
'/^.{'.(int)Settings::Get('panel.password_min_length').',}$/D',
'notrequiredpasswordlength',
array(),
$json_response
);
$password = validate($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') != '') {
$password = validate(
$password,
Settings::Get('panel.password_regex'),
Settings::Get('panel.password_regex'),
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, Settings::Get('panel.password_regex'), Settings::Get('panel.password_regex'), 'notrequiredpasswordcomplexity', array(), $json_response);
} else {
if (Settings::Get('panel.password_alpha_lower')) {
$password = validate(
$password,
'/.*[a-z]+.*/',
'/.*[a-z]+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, '/.*[a-z]+.*/', '/.*[a-z]+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
}
if (Settings::Get('panel.password_alpha_upper')) {
$password = validate(
$password,
'/.*[A-Z]+.*/',
'/.*[A-Z]+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, '/.*[A-Z]+.*/', '/.*[A-Z]+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
}
if (Settings::Get('panel.password_numeric')) {
$password = validate(
$password,
'/.*[0-9]+.*/',
'/.*[0-9]+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, '/.*[0-9]+.*/', '/.*[0-9]+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
}
if (Settings::Get('panel.password_special_char_required')) {
$password = validate(
$password,
'/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/',
'/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/',
'notrequiredpasswordcomplexity',
array(),
$json_response
);
$password = validate($password, '/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/', '/.*[' . preg_quote(Settings::Get('panel.password_special_char')) . ']+.*/', 'notrequiredpasswordcomplexity', array(), $json_response);
}
}
@@ -225,15 +184,19 @@ class Crypt
* additionally it updates the hash if the system settings changed
* or if the very old md5() sum is used
*
* @param array $userinfo user-data from table
* @param string $password the password to validate
* @param string $table either panel_customers or panel_admins
* @param string $uid user-id-field in $table
* @param array $userinfo
* user-data from table
* @param string $password
* the password to validate
* @param string $table
* either panel_customers or panel_admins
* @param string $uid
* user-id-field in $table
*
* @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
if (Settings::Get('system.passwordcryptfunc') !== null) {
$systype = (int) Settings::Get('system.passwordcryptfunc');
@@ -256,8 +219,8 @@ class Crypt
if (($systype == 1 && $hash_type_chk != '$1$') || // MD5
($systype == 2 && $hash_type_chk != '$2$') || // BLOWFISH
($systype == 3 && $hash_type_chk != '$5$') || // SHA256
($systype == 4 && $hash_type_chk != '$6$') // SHA512
) {
($systype == 4 && $hash_type_chk != '$6$')) // SHA512
{
$update_hash = true;
}
}
@@ -280,8 +243,5 @@ class Crypt
return true;
}
return false;
}
}

View File

@@ -15,14 +15,16 @@ namespace Froxlor\UI;
* @package Classes
*
*/
class HtmlForm
{
/**
* internal tmp-variable to store form
*
* @var string
*/
private static $_form = '';
private static $_filename = '';
public static function genHTMLForm($data = array())
@@ -32,20 +34,17 @@ class HtmlForm
self::$_form = '';
foreach($data as $fdata)
{
foreach ($data as $fdata) {
$sections = $fdata['sections'];
foreach($sections as $section)
{
foreach ($sections as $section) {
/*
* here be section title & image
*/
$title = $section['title'];
$image = $section['image'];
if(isset($section['visible']) && $section['visible'] === false)
{
if (isset($section['visible']) && $section['visible'] === false) {
continue;
}
@@ -56,10 +55,8 @@ class HtmlForm
}
$nexto = false;
foreach($section['fields'] as $fieldname => $fielddata)
{
if(isset($fielddata['visible']) && $fielddata['visible'] === false)
{
foreach ($section['fields'] as $fieldname => $fielddata) {
if (isset($fielddata['visible']) && $fielddata['visible'] === false) {
continue;
}
@@ -70,7 +67,9 @@ class HtmlForm
$mandatory = self::_getMandatoryFlag($fielddata);
$data_field = self::_parseDataField($fieldname, $fielddata);
if (isset($fielddata['has_nextto'])) {
$nexto = array('field' => $fieldname);
$nexto = array(
'field' => $fieldname
);
$data_field .= '{NEXTTOFIELD_' . $fieldname . '}';
} else {
$nexto = false;
@@ -80,11 +79,7 @@ class HtmlForm
$data_field = self::_parseDataField($fieldname, $fielddata);
$data_field = str_replace("\t", "", $data_field);
$data_field = $fielddata['next_to_prefix'] . $data_field;
self::$_form = str_replace(
'{NEXTTOFIELD_'.$fielddata['next_to'].'}',
$data_field,
self::$_form
);
self::$_form = str_replace('{NEXTTOFIELD_' . $fielddata['next_to'] . '}', $data_field, self::$_form);
$nexto = false;
}
}
@@ -101,41 +96,48 @@ class HtmlForm
private static function _parseDataField($fieldname, $data = array())
{
switch($data['type'])
{
switch ($data['type']) {
case 'text':
return self::_textBox($fieldname, $data); break;
return self::_textBox($fieldname, $data);
break;
case 'textul':
return self::_textBox($fieldname, $data, 'text', true); break;
return self::_textBox($fieldname, $data, 'text', true);
break;
case 'password':
return self::_textBox($fieldname, $data, 'password'); break;
return self::_textBox($fieldname, $data, 'password');
break;
case 'hidden':
return self::_textBox($fieldname, $data, 'hidden'); break;
return self::_textBox($fieldname, $data, 'hidden');
break;
case 'yesno':
return self::_yesnoBox($data); break;
return self::_yesnoBox($data);
break;
case 'select':
return self::_selectBox($fieldname, $data); break;
return self::_selectBox($fieldname, $data);
break;
case 'label':
return self::_labelField($data); break;
return self::_labelField($data);
break;
case 'textarea':
return self::_textArea($fieldname, $data); break;
return self::_textArea($fieldname, $data);
break;
case 'checkbox':
return self::_checkbox($fieldname, $data); break;
return self::_checkbox($fieldname, $data);
break;
case 'file':
return self::_file($fieldname, $data); break;
return self::_file($fieldname, $data);
break;
case 'int':
return self::_int($fieldname, $data); break;
return self::_int($fieldname, $data);
break;
}
}
private static function _getMandatoryFlag($data = array())
{
if(isset($data['mandatory']))
{
if (isset($data['mandatory'])) {
return '&nbsp;<span class="red">*</span>';
}
elseif(isset($data['mandatory_ex']))
{
} elseif (isset($data['mandatory_ex'])) {
return '&nbsp;<span class="red">**</span>';
}
return '';
@@ -165,8 +167,7 @@ class HtmlForm
}
$ulfield = ($unlimited == true ? '&nbsp;' . $data['ul_field'] : '');
if(isset($data['display']) && $data['display'] != '')
{
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
@@ -224,9 +225,7 @@ class HtmlForm
id="' . $fieldname . '"
name="' . $fieldname . '"
' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . '
>'
.$select_var.
'</select>';
>' . $select_var . '</select>';
}
/**
@@ -246,12 +245,14 @@ class HtmlForm
* )
* </code>
*
* @param string $fieldname contains the fieldname
* @param array $data contains the data array
* @param string $fieldname
* 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
$checked = array();
if (isset($data['value'])) {
$checked = $data['value'];
@@ -259,7 +260,9 @@ class HtmlForm
if (isset($_SESSION['requestData'])) {
if (isset($_SESSION['requestData'][$fieldname])) {
$checked = array($_SESSION['requestData'][$fieldname]);
$checked = array(
$_SESSION['requestData'][$fieldname]
);
}
}
@@ -312,8 +315,7 @@ class HtmlForm
$value = '';
}
if(isset($data['display']) && $data['display'] != '')
{
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}

View File

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

View File

@@ -15,7 +15,6 @@
* @package AJAX
*
*/
require __DIR__ . '/vendor/autoload.php';
// Load the user settings

View File

@@ -14,14 +14,16 @@
* @package Classes
*
*/
class htmlform
{
/**
* internal tmp-variable to store form
*
* @var string
*/
private static $_form = '';
private static $_filename = '';
public static function genHTMLForm($data = array())
@@ -31,20 +33,17 @@ class htmlform
self::$_form = '';
foreach($data as $fdata)
{
foreach ($data as $fdata) {
$sections = $fdata['sections'];
foreach($sections as $section)
{
foreach ($sections as $section) {
/*
* here be section title & image
*/
$title = $section['title'];
$image = $section['image'];
if(isset($section['visible']) && $section['visible'] === false)
{
if (isset($section['visible']) && $section['visible'] === false) {
continue;
}
@@ -55,10 +54,8 @@ class htmlform
}
$nexto = false;
foreach($section['fields'] as $fieldname => $fielddata)
{
if(isset($fielddata['visible']) && $fielddata['visible'] === false)
{
foreach ($section['fields'] as $fieldname => $fielddata) {
if (isset($fielddata['visible']) && $fielddata['visible'] === false) {
continue;
}
@@ -69,7 +66,9 @@ class htmlform
$mandatory = self::_getMandatoryFlag($fielddata);
$data_field = self::_parseDataField($fieldname, $fielddata);
if (isset($fielddata['has_nextto'])) {
$nexto = array('field' => $fieldname);
$nexto = array(
'field' => $fieldname
);
$data_field .= '{NEXTTOFIELD_' . $fieldname . '}';
} else {
$nexto = false;
@@ -79,11 +78,7 @@ class htmlform
$data_field = self::_parseDataField($fieldname, $fielddata);
$data_field = str_replace("\t", "", $data_field);
$data_field = $fielddata['next_to_prefix'] . $data_field;
self::$_form = str_replace(
'{NEXTTOFIELD_'.$fielddata['next_to'].'}',
$data_field,
self::$_form
);
self::$_form = str_replace('{NEXTTOFIELD_' . $fielddata['next_to'] . '}', $data_field, self::$_form);
$nexto = false;
}
}
@@ -100,41 +95,48 @@ class htmlform
private static function _parseDataField($fieldname, $data = array())
{
switch($data['type'])
{
switch ($data['type']) {
case 'text':
return self::_textBox($fieldname, $data); break;
return self::_textBox($fieldname, $data);
break;
case 'textul':
return self::_textBox($fieldname, $data, 'text', true); break;
return self::_textBox($fieldname, $data, 'text', true);
break;
case 'password':
return self::_textBox($fieldname, $data, 'password'); break;
return self::_textBox($fieldname, $data, 'password');
break;
case 'hidden':
return self::_textBox($fieldname, $data, 'hidden'); break;
return self::_textBox($fieldname, $data, 'hidden');
break;
case 'yesno':
return self::_yesnoBox($data); break;
return self::_yesnoBox($data);
break;
case 'select':
return self::_selectBox($fieldname, $data); break;
return self::_selectBox($fieldname, $data);
break;
case 'label':
return self::_labelField($data); break;
return self::_labelField($data);
break;
case 'textarea':
return self::_textArea($fieldname, $data); break;
return self::_textArea($fieldname, $data);
break;
case 'checkbox':
return self::_checkbox($fieldname, $data); break;
return self::_checkbox($fieldname, $data);
break;
case 'file':
return self::_file($fieldname, $data); break;
return self::_file($fieldname, $data);
break;
case 'int':
return self::_int($fieldname, $data); break;
return self::_int($fieldname, $data);
break;
}
}
private static function _getMandatoryFlag($data = array())
{
if(isset($data['mandatory']))
{
if (isset($data['mandatory'])) {
return '&nbsp;<span class="red">*</span>';
}
elseif(isset($data['mandatory_ex']))
{
} elseif (isset($data['mandatory_ex'])) {
return '&nbsp;<span class="red">**</span>';
}
return '';
@@ -164,8 +166,7 @@ class htmlform
}
$ulfield = ($unlimited == true ? '&nbsp;' . $data['ul_field'] : '');
if(isset($data['display']) && $data['display'] != '')
{
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
@@ -223,9 +224,7 @@ class htmlform
id="' . $fieldname . '"
name="' . $fieldname . '"
' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . '
>'
.$select_var.
'</select>';
>' . $select_var . '</select>';
}
/**
@@ -245,12 +244,14 @@ class htmlform
* )
* </code>
*
* @param string $fieldname contains the fieldname
* @param array $data contains the data array
* @param string $fieldname
* 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
$checked = array();
if (isset($data['value'])) {
$checked = $data['value'];
@@ -258,7 +259,9 @@ class htmlform
if (isset($_SESSION['requestData'])) {
if (isset($_SESSION['requestData'][$fieldname])) {
$checked = array($_SESSION['requestData'][$fieldname]);
$checked = array(
$_SESSION['requestData'][$fieldname]
);
}
}
@@ -311,8 +314,7 @@ class htmlform
$value = '';
}
if(isset($data['display']) && $data['display'] != '')
{
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}

View File

@@ -15,19 +15,25 @@
* @package Panel
*
*/
class linker {
class linker
{
private $protocol = '';
private $username = '';
private $password = '';
private $hostname = '';
private $port = 80;
private $filename = 'index.php';
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
$this->protocol = $protocol;
$this->username = $username;
@@ -39,40 +45,59 @@ class linker {
$this->args['s'] = $sessionid;
}
public function __set($key, $value) {
public function __set($key, $value)
{
switch (strtolower($key)) {
case 'protocol': $this->protocol = $value; break;
case 'username': $this->username = $value; break;
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;
case 'protocol':
$this->protocol = $value;
break;
case 'username':
$this->username = $value;
break;
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;
}
public function add($key, $value) {
public function add($key, $value)
{
// Add a new value to our parameters (overwrite = enabled)
$this->args[$key] = $value;
}
public function del($key) {
public function del($key)
{
// If the key exists in our array -> delete it
if (isset($this->args[$key])) {
unset($this->args[$key]);
}
}
public function delAll() {
public function delAll()
{
// Just resetting the array
// Until the sessionid can be removed: save it
// @TODO: Remove this
$this->args = array('s' => $this->args['s']);
$this->args = array(
's' => $this->args['s']
);
}
public function getLink() {
public function getLink()
{
$link = '';
// Build the basic URL

View File

@@ -19,72 +19,85 @@
/**
* Class to manage paging system
*
* @package Functions
*/
class paging {
class paging
{
/**
* Userinfo
*
* @var array
*/
private $userinfo = array();
/**
* MySQL-Table
*
* @var string
*/
private $table = '';
/**
* Fields with description which should be selectable
*
* @var array
*/
private $fields = array();
/**
* Entries per page
*
* @var int
*/
private $entriesperpage = 0;
/**
* Number of entries of table
*
* @var int
*/
private $entries = 0;
/**
* Sortorder, asc or desc
*
* @var string
*/
public $sortorder = 'asc';
/**
* Sortfield
*
* @var string
*/
public $sortfield = '';
/**
* Searchfield
*
* @var string
*/
private $searchfield = '';
/**
* Searchtext
*
* @var string
*/
private $searchtext = '';
/**
* Pagenumber
*
* @var int
*/
private $pageno = 0;
/**
* Switch natsorting on/off
*
* @var bool
*/
private $natSorting = false;
@@ -92,18 +105,27 @@ class paging {
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
// passed as parameter anymore, because these are
@@ -124,21 +146,12 @@ class paging {
$checklastpaging = (isset($this->userinfo['lastpaging']['table']) && $this->userinfo['lastpaging']['table'] == $this->table);
$this->userinfo['lastpaging']['table'] = $this->table;
if (isset($_REQUEST['sortorder'])
&& (strtolower($_REQUEST['sortorder']) == 'desc'
|| strtolower($_REQUEST['sortorder']) == 'asc')
) {
if (isset($_REQUEST['sortorder']) && (strtolower($_REQUEST['sortorder']) == 'desc' || strtolower($_REQUEST['sortorder']) == 'asc')) {
$this->sortorder = strtolower($_REQUEST['sortorder']);
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['sortorder'])
&& (strtolower($this->userinfo['lastpaging']['sortorder']) == 'desc'
|| strtolower($this->userinfo['lastpaging']['sortorder']) == 'asc')
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['sortorder']) && (strtolower($this->userinfo['lastpaging']['sortorder']) == 'desc' || strtolower($this->userinfo['lastpaging']['sortorder']) == 'asc')) {
$this->sortorder = strtolower($this->userinfo['lastpaging']['sortorder']);
} else {
$this->sortorder = $default_order;
}
@@ -146,15 +159,10 @@ class paging {
$this->userinfo['lastpaging']['sortorder'] = $this->sortorder;
if (isset($_REQUEST['sortfield'])
&& isset($fields[$_REQUEST['sortfield']])
) {
if (isset($_REQUEST['sortfield']) && isset($fields[$_REQUEST['sortfield']])) {
$this->sortfield = $_REQUEST['sortfield'];
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['sortfield'])
&& isset($fields[$this->userinfo['lastpaging']['sortfield']])
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['sortfield']) && isset($fields[$this->userinfo['lastpaging']['sortfield']])) {
$this->sortfield = $this->userinfo['lastpaging']['sortfield'];
} else {
$fieldnames = array_keys($fields);
@@ -164,15 +172,10 @@ class paging {
$this->userinfo['lastpaging']['sortfield'] = $this->sortfield;
if (isset($_REQUEST['searchfield'])
&& isset($fields[$_REQUEST['searchfield']])
) {
if (isset($_REQUEST['searchfield']) && isset($fields[$_REQUEST['searchfield']])) {
$this->searchfield = $_REQUEST['searchfield'];
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['searchfield'])
&& isset($fields[$this->userinfo['lastpaging']['searchfield']])
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['searchfield']) && isset($fields[$this->userinfo['lastpaging']['searchfield']])) {
$this->searchfield = $this->userinfo['lastpaging']['searchfield'];
} else {
$fieldnames = array_keys($fields);
@@ -182,16 +185,10 @@ class paging {
$this->userinfo['lastpaging']['searchfield'] = $this->searchfield;
if (isset($_REQUEST['searchtext'])
&& (preg_match('/[-_@\p{L}\p{N}*.]+$/u', $_REQUEST['searchtext'])
|| $_REQUEST['searchtext'] === '')
) {
if (isset($_REQUEST['searchtext']) && (preg_match('/[-_@\p{L}\p{N}*.]+$/u', $_REQUEST['searchtext']) || $_REQUEST['searchtext'] === '')) {
$this->searchtext = trim($_REQUEST['searchtext']);
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['searchtext'])
&& preg_match('/[-_@\p{L}\p{N}*.]+$/u', $this->userinfo['lastpaging']['searchtext'])
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['searchtext']) && preg_match('/[-_@\p{L}\p{N}*.]+$/u', $this->userinfo['lastpaging']['searchtext'])) {
$this->searchtext = $this->userinfo['lastpaging']['searchtext'];
} else {
$this->searchtext = '';
@@ -200,15 +197,10 @@ class paging {
$this->userinfo['lastpaging']['searchtext'] = $this->searchtext;
if (isset($_REQUEST['pageno'])
&& intval($_REQUEST['pageno']) != 0
) {
if (isset($_REQUEST['pageno']) && intval($_REQUEST['pageno']) != 0) {
$this->pageno = intval($_REQUEST['pageno']);
} else {
if ($checklastpaging
&& isset($this->userinfo['lastpaging']['pageno'])
&& intval($this->userinfo['lastpaging']['pageno']) != 0
) {
if ($checklastpaging && isset($this->userinfo['lastpaging']['pageno']) && intval($this->userinfo['lastpaging']['pageno']) != 0) {
$this->pageno = intval($this->userinfo['lastpaging']['pageno']);
} else {
$this->pageno = 1;
@@ -239,10 +231,11 @@ class paging {
/**
* 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;
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
*
* @param int number of row
* @param
* int number of row
* @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);
$end = (intval($this->pageno) * intval($this->entriesperpage));
return (($count >= $begin && $count < $end) || $this->entriesperpage == 0);
@@ -267,10 +262,12 @@ class paging {
/**
* 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
*/
public function getSqlWhere($append = false) {
public function getSqlWhere($append = false)
{
if ($this->searchtext != '') {
if ($append == true) {
$condition = ' AND ';
@@ -293,7 +290,11 @@ class paging {
$searchfield = implode('.', $searchfield);
$ops = array('<', '>', '=');
$ops = array(
'<',
'>',
'='
);
// check if we use an operator or not
$useOper = 0;
@@ -324,10 +325,10 @@ class paging {
} else {
$searchtext = str_replace('*', '%', $this->searchtext);
// append wildcards if user did not enter any
if (strpos($searchtext,'%') === false) $searchtext='%'.$searchtext.'%';
if (strpos($searchtext, '%') === false)
$searchtext = '%' . $searchtext . '%';
$condition .= $searchfield . " LIKE " . \Froxlor\Database\Database::quote($searchtext);
}
} else {
$condition = '';
}
@@ -338,11 +339,12 @@ class paging {
/**
* 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
*/
public function getSqlOrderBy($natSorting = null) {
public function getSqlOrderBy($natSorting = null)
{
$sortfield = explode('.', $this->sortfield);
foreach ($sortfield as $id => $field) {
if (substr($field, - 1, 1) != '`') {
@@ -359,9 +361,7 @@ class paging {
$sortfield = implode('.', $sortfield);
$sortorder = strtoupper($this->sortorder);
if ($natSorting == true
|| ($natSorting === null && $this->natSorting == true)
) {
if ($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
$sortcode = "ORDER BY CONCAT( IF( ASCII( LEFT( " . $sortfield . ", 5 ) ) > 57,
LEFT( " . $sortfield . ", 1 ), 0 ),
@@ -381,8 +381,8 @@ class paging {
*
* @return string always empty
*/
public function getSqlLimit() {
public function getSqlLimit()
{
if ($this->_limit > 0) {
$_offset = ($this->pageno - 1) * $this->_limit;
return ' LIMIT ' . $_offset . ',' . $this->_limit;
@@ -396,11 +396,12 @@ class paging {
/**
* Returns html code for sorting field
*
* @param array Language array
* @param
* array Language array
* @return string the html sortcode
*/
public function getHtmlSortCode($lng, $break = false) {
public function getHtmlSortCode($lng, $break = false)
{
$sortcode = '';
$fieldoptions = '';
$orderoptions = '';
@@ -410,7 +411,10 @@ class paging {
}
$breakorws = ($break ? '<br />' : '&nbsp;');
foreach (array('asc' => $lng['panel']['ascending'], 'desc' => $lng['panel']['descending']) as $sortordertype => $sortorderdescription) {
foreach (array(
'asc' => $lng['panel']['ascending'],
'desc' => $lng['panel']['descending']
) as $sortordertype => $sortorderdescription) {
$orderoptions .= makeoption($sortorderdescription, $sortordertype, $this->sortorder, true, true);
}
@@ -421,17 +425,17 @@ class paging {
/**
* Returns html code for sorting arrows
*
* @param string URL to use as base for links
* @param string If set, only this field will be returned
* @param
* 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
*/
public function getHtmlArrowCode($baseurl, $field = '') {
public function getHtmlArrowCode($baseurl, $field = '')
{
global $theme;
if ($field != ''
&& isset($this->fields[$field])
) {
if ($field != '' && isset($this->fields[$field])) {
$baseurl = htmlspecialchars($baseurl);
$fieldname = htmlspecialchars($field);
eval("\$arrowcode =\"" . getTemplate("misc/htmlarrowcode", '1') . "\";");
@@ -450,11 +454,12 @@ class paging {
/**
* Returns html code for searching field
*
* @param array Language array
* @param
* array Language array
* @return string the html searchcode
*/
public function getHtmlSearchCode($lng) {
public function getHtmlSearchCode($lng)
{
$searchcode = '';
$fieldoptions = '';
$searchtext = htmlspecialchars($this->searchtext);
@@ -468,10 +473,12 @@ class 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
*/
public function getHtmlPagingCode($baseurl) {
public function getHtmlPagingCode($baseurl)
{
if ($this->entriesperpage == 0) {
return '';
} else {

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="Gentoo" version="2.2" defaulteditor="/usr/bin/nano">
<distribution name="Gentoo" version="2.2"
defaulteditor="/usr/bin/nano">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -915,8 +916,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -931,7 +932,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</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>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -1458,8 +1460,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
#local-ipv6=YOUR_IPv6_(if_any)
bind-config=<BIND_CONFIG_PATH>named.conf
@@ -1495,8 +1497,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1540,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1552,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1602,8 +1604,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Postfix programs paths settings
command_directory = /usr/sbin
@@ -1727,8 +1729,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# Add this lines to be able to use dovecot as delivery agent
# Dovecot LDA
@@ -1750,8 +1752,8 @@ dovecot unix - n n - - pipe
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Postfix programs paths settings
command_directory = /usr/sbin
@@ -1880,8 +1882,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# Add this lines to be able to use dovecot as delivery agent
# Dovecot LDA
@@ -1903,8 +1905,8 @@ dovecot unix - n n - - pipe
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Postfix programs paths settings
command_directory = /usr/sbin
@@ -2000,7 +2002,8 @@ debugger_command =
</content>
</file>
<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[
pwcheck_method: auxprop
auxprop_plugin: sql
@@ -2024,7 +2027,8 @@ sql_select: SELECT password_enc FROM mail_users WHERE username='%u@%r' OR email=
<!-- IMAP/POP3 services -->
<service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- 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>
<install><![CDATA[emerge net-mail/dovecot]]></install>
<file name="/etc/dovecot/dovecot.conf" chown="root:root"
@@ -2132,8 +2136,8 @@ protocol lda {
]]>
</content>
</file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root"
chmod="0600" backup="true">
<file name="/etc/dovecot/dovecot-sql.conf.ext"
chown="root:root" chmod="0600" backup="true">
<content><![CDATA[
driver = mysql
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>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:root"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:root" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -2226,8 +2230,8 @@ protocol sieve {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-sieve.conf" chown="root:root"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/90-sieve.conf"
chown="root:root" chmod="0644" backup="true">
<content><![CDATA[
##
## Settings for the Sieve interpreter
@@ -2496,8 +2500,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
]]>
</content>
</file>
<file name="/etc/courier-imap/pop3d" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier-imap/pop3d" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##VERSION: $Id: pop3d.dist.in,v 1.11 2004/10/30 15:39:38 mrsam Exp $
#
@@ -2629,8 +2633,8 @@ PRERUN=
]]>
</content>
</file>
<file name="/etc/courier-imap/imapd" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier-imap/imapd" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##VERSION: $Id: imapd.dist.in,v 1.32 2004/11/25 04:57:04 mrsam Exp $
#
@@ -3011,8 +3015,8 @@ PRERUN=
]]>
</content>
</file>
<file name="/etc/courier-imap/pop3d-ssl" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier-imap/pop3d-ssl" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##VERSION: $Id: pop3d-ssl.dist.in,v 1.12 2004/10/21 00:45:35 mrsam Exp $
#
@@ -3203,8 +3207,8 @@ MAILDIRPATH=.maildir
]]>
</content>
</file>
<file name="/etc/courier-imap/imapd-ssl" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier-imap/imapd-ssl" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##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">
<command><![CDATA[echo "net-ftp/proftpd mysql" >> /etc/portage/package.use]]></command>
<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
[ -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>"
@@ -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[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
# Server settings
ServerName "<SERVERNAME> FTP Server"
@@ -3582,8 +3587,8 @@ MISC_OTHER="-A -x -j -Z"
]]>
</content>
</file>
<file name="/etc/pureftpd-mysql.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/pureftpd-mysql.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
MYSQLServer <SQL_HOST>
#MYSQLPort 3306
@@ -3607,8 +3612,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cu
<daemon name="vsftpd" title="vsftpd">
<command><![CDATA[echo "net-ftp/vsftpd pam" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge net-ftp/vsftpd sys-auth/pam_mysql]]></install>
<file name="/etc/vsftpd/vsftpd.conf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/vsftpd/vsftpd.conf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
listen=YES
#listen_ipv6=YES
@@ -3680,7 +3685,8 @@ account required pam_mysql.so user=<SQL_UNPRIVILEGED_USER> passwd=<SQL_UN
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- 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">
<content><![CDATA[
#
@@ -3699,17 +3705,19 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<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|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon>
<!-- 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>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -3804,7 +3812,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<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[
#
# Froxlor logrotate snipet
@@ -3863,7 +3872,8 @@ aliases: files
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- 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>
<install><![CDATA[emerge dev-lang/php sys-auth/libnss-mysql]]></install>
<commands index="1">

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -43,7 +44,8 @@
</commands>
</general>
<!-- 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>
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
@@ -904,8 +906,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -920,7 +922,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</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>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -1447,8 +1450,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# Bind backend configuration
@@ -1494,8 +1497,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1539,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1551,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1599,8 +1602,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
@@ -2325,8 +2328,8 @@ virtual_mailbox_limit = 0
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
#
# Postfix master process configuration file. For details on the format
@@ -2577,8 +2580,8 @@ dict {
]]>
</content>
</file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root"
chmod="0600" backup="true">
<file name="/etc/dovecot/dovecot-sql.conf.ext"
chown="root:root" chmod="0600" backup="true">
<content><![CDATA[
# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext
@@ -3237,8 +3240,8 @@ mail_access_groups = vmail
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-master.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-master.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
#default_process_limit = 100
#default_client_limit = 1000
@@ -3492,8 +3495,8 @@ protocol imap {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -3795,8 +3798,8 @@ plugin {
</commands>
</general>
<!-- Dovecot with postfix -->
<daemon name="dovecot_postfix" version="2" title="Dovecot with postfix"
default="true">
<daemon name="dovecot_postfix" version="2"
title="Dovecot with postfix" default="true">
<include>//service[@type='mail']/general/installs[@index=1]
</include>
<include>//service[@type='mail']/general/files[@index=1]
@@ -3805,7 +3808,8 @@ plugin {
</include>
</daemon>
<!-- 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>
<include>//service[@type='mail']/general/files[@index=1]
@@ -3819,7 +3823,8 @@ plugin {
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<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
[ -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>"
@@ -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[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -4026,8 +4031,8 @@ Include /etc/proftpd/conf.d/
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# 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>
</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[
<IfModule mod_tls.c>
TLSEngine on
@@ -4226,14 +4232,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<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[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -4260,8 +4267,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -4407,7 +4414,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</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[
21
]]>
@@ -4451,7 +4459,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- 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">
<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>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<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>
@@ -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>
</daemon>
<!-- 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
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
rm libnss-mysql-bg_1.5-3+frx1_amd64.deb
]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -4584,7 +4595,8 @@ aliases: files
<visibility mode="notisdir">/etc/insserv/overrides</visibility>
<content><![CDATA[mkdir -p /etc/insserv/overrides]]></content>
</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>
<content><![CDATA[
#!/bin/sh
@@ -4599,7 +4611,8 @@ aliases: files
]]>
</content>
</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>
<content><![CDATA[
#!/bin/sh
@@ -4616,7 +4629,8 @@ aliases: files
]]>
</content>
</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>
<content><![CDATA[
#!/bin/sh
@@ -4631,7 +4645,8 @@ aliases: files
]]>
</content>
</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[
#!/bin/sh
### BEGIN INIT INFO
@@ -4647,7 +4662,8 @@ aliases: files
</file>
</daemon>
<!-- 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>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -4687,7 +4703,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<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[
#
# Froxlor logrotate snipet
@@ -4727,7 +4744,8 @@ aliases: files
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- 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">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -370,8 +371,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -386,7 +387,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</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>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -410,8 +412,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# 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>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -498,8 +500,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -510,8 +512,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -558,8 +560,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# FQDN from Froxlor
@@ -654,8 +656,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# Add these lines to be able to use dovecot as delivery agent
# Dovecot LDA
@@ -676,8 +678,8 @@ dovecot unix - n n - - pipe
<install><![CDATA[apt-get install libsasl2-2 libsasl2-modules libsasl2-modules-sql]]></install>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# 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 -->
<service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- 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>
<file name="/etc/dovecot/conf.d/01-mail-stack-delivery.conf"
chown="root:root" chmod="0644" backup="true">
@@ -882,8 +885,8 @@ service auth {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-auth.conf" chown="root:root"
chmod="0640" backup="true">
<file name="/etc/dovecot/conf.d/10-auth.conf"
chown="root:root" chmod="0640" backup="true">
<content><![CDATA[
##
## Authentication processes
@@ -1015,7 +1018,8 @@ auth_mechanisms = plain login
]]>
</content>
</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[
passdb {
driver = sql
@@ -1045,8 +1049,8 @@ iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
<!-- Courier -->
<daemon name="courier" title="Courier">
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier/authdaemonrc" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##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>
</file>
<file name="/etc/courier/authmysqlrc" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier/authmysqlrc" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
MYSQL_SERVER <SQL_HOST>
MYSQL_USERNAME <SQL_UNPRIVILEGED_USER>
@@ -1148,7 +1152,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<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
[ -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>"
@@ -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[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -1296,8 +1301,8 @@ Include /etc/proftpd/tls.conf
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# 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>
</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[
<IfModule mod_tls.c>
TLSEngine on
@@ -1435,14 +1441,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<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[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -1469,8 +1476,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -1500,7 +1507,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</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[
21
]]>
@@ -1523,7 +1531,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- 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">
<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>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<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>
@@ -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>
</daemon>
<!-- 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>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -1646,7 +1657,8 @@ aliases: files
<command><![CDATA[nscd --invalidate=group]]></command>
</daemon>
<!-- 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>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -1686,7 +1698,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<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[
#
# Froxlor logrotate snipet
@@ -1726,7 +1739,8 @@ aliases: files
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- 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">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="RHEL / CentOS" version="7" defaulteditor="/usr/bin/nano">
<distribution name="RHEL / CentOS" version="7"
defaulteditor="/usr/bin/nano">
<services>
<!-- 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>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -132,8 +133,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -144,8 +145,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -164,16 +165,16 @@ query = SELECT gid FROM mail_users WHERE email = '%s'
</commands>
</general>
<!-- postfix with dovecot -->
<daemon name="postfix_dovecot" version="2.10" title="Postfix with dovecot"
default="true">
<daemon name="postfix_dovecot" version="2.10"
title="Postfix with dovecot" default="true">
<include>//service[@type='smtp']/general/commands[@index=1]
</include>
<include>//service[@type='smtp']/general/installs[@index=1]
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# FQDN from Froxlor
@@ -262,8 +263,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# added for Froxlor
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 -->
<service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- 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>
<file name="/etc/dovecot/dovecot.conf" chown="root:root"
chmod="0644" backup="true">
@@ -504,8 +506,8 @@ auth_mechanisms = plain
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-logging.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-logging.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## Log destination.
@@ -1215,8 +1217,8 @@ protocol lda {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/15-mailboxes.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/15-mailboxes.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## Mailbox definitions
@@ -1364,8 +1366,8 @@ protocol lmtp {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -1821,10 +1823,11 @@ iterate_query = SELECT username AS user FROM mail_users
<!-- FTP services -->
<service type="ftp" title="{{lng.admin.configfiles.ftp}}">
<!-- 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>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
# This is the ProFTPD configuration file
#
@@ -2284,7 +2287,8 @@ ControlsLog /var/log/proftpd/controls.log
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- 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">
<content><![CDATA[
#
@@ -2303,17 +2307,19 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- 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|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
</daemon>
<!-- 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 install libnss-mysql nscd]]></install>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -2413,7 +2419,8 @@ aliases: files nisplus
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<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[
#
# Froxlor logrotate snipet

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="Debian" codename="Stretch" version="9.x" defaulteditor="/bin/nano">
<distribution name="Debian" codename="Stretch"
version="9.x" defaulteditor="/bin/nano">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -43,7 +44,8 @@
</commands>
</general>
<!-- 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>
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
@@ -893,8 +895,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -909,7 +911,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</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>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -1436,8 +1439,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# Bind backend configuration
@@ -1483,8 +1486,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1528,8 +1531,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1540,8 +1543,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1588,8 +1591,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
@@ -2334,8 +2337,8 @@ virtual_mailbox_limit = 0
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
#
# Postfix master process configuration file. For details on the format
@@ -2586,8 +2589,8 @@ dict {
]]>
</content>
</file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root"
chmod="0600" backup="true">
<file name="/etc/dovecot/dovecot-sql.conf.ext"
chown="root:root" chmod="0600" backup="true">
<content><![CDATA[
# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext
@@ -3246,8 +3249,8 @@ mail_access_groups = vmail
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-master.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-master.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
#default_process_limit = 100
#default_client_limit = 1000
@@ -3569,8 +3572,8 @@ protocol imap {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -3872,8 +3875,8 @@ plugin {
</commands>
</general>
<!-- Dovecot with postfix -->
<daemon name="dovecot_postfix" version="2" title="Dovecot with postfix"
default="true">
<daemon name="dovecot_postfix" version="2"
title="Dovecot with postfix" default="true">
<include>//service[@type='mail']/general/installs[@index=1]
</include>
<include>//service[@type='mail']/general/files[@index=1]
@@ -3887,7 +3890,8 @@ plugin {
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<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
[ -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>"
@@ -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[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -4094,8 +4098,8 @@ Include /etc/proftpd/conf.d/
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# 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>
</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[
<IfModule mod_tls.c>
TLSEngine on
@@ -4294,14 +4299,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<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[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -4328,8 +4334,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -4475,7 +4481,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</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[
21
]]>
@@ -4519,7 +4526,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- 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">
<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>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<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>
@@ -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>
</daemon>
<!-- 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>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -4587,7 +4597,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<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[
#
# Froxlor logrotate snipet
@@ -4627,7 +4638,8 @@ aliases: files
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- 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>
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -408,8 +409,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -424,7 +425,8 @@ gmysql-password=
</file>
<command><![CDATA[service pdns restart]]></command>
</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>
<file name="/etc/powerdns/pdns.conf" backup="true">
<content><![CDATA[
@@ -450,8 +452,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# 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>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -538,8 +540,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -550,8 +552,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -598,8 +600,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# FQDN from Froxlor
@@ -694,8 +696,8 @@ debugger_command =
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true" mode="append">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true" mode="append">
<content><![CDATA[
# Add these lines to be able to use dovecot as delivery agent
# Dovecot LDA
@@ -716,8 +718,8 @@ dovecot unix - n n - - pipe
<install><![CDATA[apt-get install libsasl2-2 libsasl2-modules libsasl2-modules-sql]]></install>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
## General Postfix configuration
# 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 -->
<service type="mail" title="{{lng.admin.configfiles.mail}}">
<!-- 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>
<file name="/etc/dovecot/conf.d/99-mail-stack-delivery.conf"
chown="root:root" chmod="0644" backup="true">
@@ -909,8 +912,8 @@ service auth {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-auth.conf" chown="root:root"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-auth.conf"
chown="root:root" chmod="0644" backup="true">
<content><![CDATA[
##
## Authentication processes
@@ -1059,8 +1062,8 @@ iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3
<!-- Courier -->
<daemon name="courier" title="Courier">
<install><![CDATA[apt-get install courier-pop courier-imap courier-authlib-mysql]]></install>
<file name="/etc/courier/authdaemonrc" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier/authdaemonrc" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
##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>
</file>
<file name="/etc/courier/authmysqlrc" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/courier/authmysqlrc" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
MYSQL_SERVER <SQL_HOST>
MYSQL_USERNAME <SQL_UNPRIVILEGED_USER>
@@ -1162,7 +1165,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<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
[ -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>"
@@ -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[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -1310,8 +1314,8 @@ Include /etc/proftpd/tls.conf
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# 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>
</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[
<IfModule mod_tls.c>
TLSEngine on
@@ -1449,14 +1454,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<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[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -1483,8 +1489,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -1514,7 +1520,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</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[
21
]]>
@@ -1537,7 +1544,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- 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">
<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>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<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>
@@ -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>
</daemon>
<!-- 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>
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
backup="true">
<file name="/etc/libnss-mysql.cfg" chown="root:root"
chmod="0600" backup="true">
<content><![CDATA[
getpwnam SELECT username,'x',uid,gid,'Froxlor Customer',homedir,shell \
FROM ftp_users \
@@ -1660,7 +1670,8 @@ aliases: files
<command><![CDATA[nscd --invalidate=group]]></command>
</daemon>
<!-- 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>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -1700,7 +1711,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<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[
#
# Froxlor logrotate snipet
@@ -1740,7 +1752,8 @@ aliases: files
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- 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">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -43,7 +44,8 @@
</commands>
</general>
<!-- 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>
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
@@ -904,8 +906,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -920,7 +922,8 @@ gmysql-password=
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
</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>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<content><![CDATA[
@@ -1447,8 +1450,8 @@ include-dir=/etc/powerdns/froxlor/
</content>
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
chmod="600">
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
<content><![CDATA[
# Bind backend configuration
@@ -1494,8 +1497,8 @@ bind-check-interval=180
<command><![CDATA[chmod 0750 {{settings.system.vmail_homedir}}]]></command>
</commands>
<files index="0">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_alias_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1539,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_uid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_uid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1551,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s'
]]>
</content>
</file>
<file name="/etc/postfix/mysql-virtual_gid_maps.cf" chown="root:postfix"
chmod="0640">
<file name="/etc/postfix/mysql-virtual_gid_maps.cf"
chown="root:postfix" chmod="0640">
<content><![CDATA[
user = <SQL_UNPRIVILEGED_USER>
password = <SQL_UNPRIVILEGED_PASSWORD>
@@ -1599,8 +1602,8 @@ root: root@<SERVERNAME>
</include>
<include>//service[@type='smtp']/general/commands[@index=2]
</include>
<file name="/etc/postfix/main.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/main.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
@@ -2345,8 +2348,8 @@ virtual_mailbox_limit = 0
</content>
</file>
<include>//service[@type='smtp']/general/files[@index=0]</include>
<file name="/etc/postfix/master.cf" chown="root:root" chmod="0644"
backup="true">
<file name="/etc/postfix/master.cf" chown="root:root"
chmod="0644" backup="true">
<content><![CDATA[
#
# Postfix master process configuration file. For details on the format
@@ -2597,8 +2600,8 @@ dict {
]]>
</content>
</file>
<file name="/etc/dovecot/dovecot-sql.conf.ext" chown="root:root"
chmod="0600" backup="true">
<file name="/etc/dovecot/dovecot-sql.conf.ext"
chown="root:root" chmod="0600" backup="true">
<content><![CDATA[
# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext
@@ -3257,8 +3260,8 @@ mail_access_groups = vmail
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/10-master.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/10-master.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
#default_process_limit = 100
#default_client_limit = 1000
@@ -3580,8 +3583,8 @@ protocol imap {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/20-managesieve.conf" chown="root:0"
chmod="0644" backup="true">
<file name="/etc/dovecot/conf.d/20-managesieve.conf"
chown="root:0" chmod="0644" backup="true">
<content><![CDATA[
##
## ManageSieve specific settings
@@ -3883,8 +3886,8 @@ plugin {
</commands>
</general>
<!-- Dovecot with postfix -->
<daemon name="dovecot_postfix" version="2" title="Dovecot with postfix"
default="true">
<daemon name="dovecot_postfix" version="2"
title="Dovecot with postfix" default="true">
<include>//service[@type='mail']/general/installs[@index=1]
</include>
<include>//service[@type='mail']/general/files[@index=1]
@@ -3898,7 +3901,8 @@ plugin {
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<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
[ -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>"
@@ -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[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
<file name="/etc/proftpd/proftpd.conf" chown="root:0"
chmod="0600" backup="true">
<content><![CDATA[
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
@@ -4105,8 +4109,8 @@ Include /etc/proftpd/conf.d/
]]>
</content>
</file>
<file name="/etc/proftpd/modules.conf" chown="root:0" chmod="0644"
backup="true">
<file name="/etc/proftpd/modules.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
#
# 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>
</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[
<IfModule mod_tls.c>
TLSEngine on
@@ -4305,14 +4310,15 @@ TLSVerifyClient off
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
<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[
1000
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/MySQLConfigFile" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/MySQLConfigFile"
chown="root:0" chmod="0644">
<content><![CDATA[
/etc/pure-ftpd/db/mysql.conf
]]>
@@ -4339,8 +4345,8 @@ yes
]]>
</content>
</file>
<file name="/etc/pure-ftpd/conf/PAMAuthentication" chown="root:0"
chmod="0644">
<file name="/etc/pure-ftpd/conf/PAMAuthentication"
chown="root:0" chmod="0644">
<content><![CDATA[
no
]]>
@@ -4486,7 +4492,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus
]]>
</content>
</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[
21
]]>
@@ -4530,7 +4537,8 @@ UPLOADGID=
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- 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">
<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>
</daemon>
<!-- AWstats -->
<daemon name="awstats" title="Awstats (webalizer alternative)">
<daemon name="awstats"
title="Awstats (webalizer alternative)">
<install><![CDATA[apt-get install awstats]]></install>
<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>
@@ -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>
</daemon>
<!-- 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>
<commands index="1">
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
@@ -4598,7 +4608,8 @@ aliases: files
<!-- Logrotate -->
<daemon name="logrotate" title="Logrotate">
<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[
#
# Froxlor logrotate snipet
@@ -4638,7 +4649,8 @@ aliases: files
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- 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>
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>

View File

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

View File

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

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'admin_edit' => array(
'title' => $lng['admin']['admin_edit'],
@@ -33,9 +32,14 @@ return array(
'label' => $lng['admin']['deactivated_user'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['deactivated']
),
'value' => array($result['deactivated']),
'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true)
),
'admin_password' => array(
@@ -88,9 +92,14 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox',
'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']
)
)
)
),
@@ -108,9 +117,14 @@ return array(
'label' => $lng['admin']['change_serversettings'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['change_serversettings'])
'value' => array(
$result['change_serversettings']
)
),
'customers' => array(
'label' => $lng['admin']['customers'],
@@ -124,9 +138,14 @@ return array(
'label' => $lng['admin']['customers_see_all'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['customers_see_all'])
'value' => array(
$result['customers_see_all']
)
),
'domains' => array(
'label' => $lng['admin']['domains'],
@@ -140,17 +159,27 @@ return array(
'label' => $lng['admin']['domains_see_all'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['domains_see_all'])
'value' => array(
$result['domains_see_all']
)
),
'caneditphpsettings' => array(
'label' => $lng['admin']['caneditphpsettings'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['caneditphpsettings'])
'value' => array(
$result['caneditphpsettings']
)
),
'diskspace' => array(
'label' => $lng['customer']['diskspace'],

View File

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

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'customer_edit' => array(
'title' => $lng['admin']['customer_edit'],
@@ -38,17 +37,27 @@ return array(
'label' => $lng['admin']['stdsubdomain_add'] . '?',
'type' => 'checkbox',
'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(
'label' => $lng['admin']['deactivated_user'],
'type' => 'checkbox',
'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(
'label' => $lng['login']['password'] . '&nbsp;(' . $lng['panel']['emptyfornochanges'] . ')',
@@ -59,7 +68,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'def_language' => array(
'label' => $lng['login']['language'],
@@ -144,9 +153,14 @@ return array(
'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox',
'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']
)
)
)
),
@@ -227,18 +241,28 @@ return array(
'label' => $lng['customer']['email_imap'],
'type' => 'checkbox',
'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
),
'email_pop3' => array(
'label' => $lng['customer']['email_pop3'],
'type' => 'checkbox',
'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
),
'ftps' => array(
@@ -260,9 +284,14 @@ return array(
'label' => $lng['admin']['phpenabled'] . '?',
'type' => 'checkbox',
'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(
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false),
@@ -276,17 +305,27 @@ return array(
'label' => $lng['admin']['perlenabled'] . '?',
'type' => 'checkbox',
'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(
'label' => $lng['admin']['dnsenabled'] . '?',
'type' => 'checkbox',
'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)
),
'logviewenabled' => array(
@@ -298,7 +337,9 @@ return array(
'value' => '1'
)
),
'value' => array($result['logviewenabled'])
'value' => array(
$result['logviewenabled']
)
)
)
),

View File

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

View File

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

View File

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

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'ipsandports_add' => array(
'title' => $lng['admin']['ipsandports']['add'],
@@ -44,26 +43,41 @@ return array(
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
'type' => 'checkbox',
'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(
'visible' => $is_apache && ! $is_apache24,
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'vhostcontainer' => array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'docroot' => array(
'label' => $lng['admin']['ipsandports']['docroot']['title'],
@@ -83,9 +97,14 @@ return array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
'type' => 'checkbox',
'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'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'ipsandports_edit' => array(
'title' => $lng['admin']['ipsandports']['edit'],
@@ -46,26 +45,41 @@ return array(
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
'type' => 'checkbox',
'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(
'visible' => $is_apache && ! $is_apache24,
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
'type' => 'checkbox',
'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(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer'],
'type' => 'checkbox',
'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(
'label' => $lng['admin']['ipsandports']['docroot']['title'],
@@ -87,9 +101,14 @@ return array(
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
'type' => 'checkbox',
'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'],
'type' => 'checkbox',
'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(
'label' => $lng['admin']['ipsandports']['ssl_cert_file'],

View File

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

View File

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

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'phpconfig_add' => array(
'title' => $lng['admin']['phpsettings']['addsettings'],
@@ -72,7 +71,10 @@ return array(
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -95,7 +97,10 @@ return array(
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -104,7 +109,10 @@ return array(
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'phpconfig_edit' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],
@@ -75,9 +74,14 @@ return array(
'label' => $lng['admin']['phpsettings']['enable_slowlog'],
'type' => 'checkbox',
'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(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
@@ -98,17 +102,27 @@ return array(
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
'type' => 'checkbox',
'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(
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
'type' => 'checkbox',
'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(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'domain_ssleditor' => array(
'title' => $lng['panel']['ssleditor'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'domain_add' => array(
'title' => $lng['domains']['subdomain_add'],
@@ -89,7 +88,10 @@ return array(
'desc' => $lng['domains']['ssl_redirect']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -99,7 +101,10 @@ return array(
'desc' => $lng['customer']['letsencrypt']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -116,7 +121,10 @@ return array(
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -125,12 +133,15 @@ return array(
'desc' => $lng['admin']['domain_hsts_preload']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
),
),
)
)
)
)
)
);

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'domain_edit' => array(
'title' => $lng['domains']['subdomain_edit'],
@@ -72,9 +71,14 @@ return array(
'label' => 'Emaildomain',
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['isemaildomain'])
'value' => array(
$result['isemaildomain']
)
),
'openbasedir_path' => array(
'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'] : ''),
'type' => 'checkbox',
'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(
'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false,
@@ -110,9 +119,14 @@ return array(
'desc' => $lng['customer']['letsencrypt']['description'],
'type' => 'checkbox',
'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(
'label' => $lng['admin']['domain_hsts_maxage']['title'],
@@ -127,21 +141,31 @@ return array(
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
'type' => 'checkbox',
'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(
'label' => $lng['admin']['domain_hsts_preload']['title'],
'desc' => $lng['admin']['domain_hsts_preload']['description'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['hsts_preload'])
),
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['hsts_preload']
)
)
)
)
)
)
);

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'emails_accountchangepasswd' => array(
'title' => $lng['menue']['main']['changepassword'],
@@ -38,7 +37,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'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
*
*/
return array(
'emails_accountchangequota' => array(
'title' => $lng['emails']['quota_edit'],

View File

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

View File

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

View File

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

View File

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

View File

@@ -44,7 +44,9 @@ return array(
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'backup_mail' => array(
'label' => $lng['extras']['backup_mail'],
@@ -55,7 +57,9 @@ return array(
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
),
'backup_dbs' => array(
'label' => $lng['extras']['backup_dbs'],
@@ -66,7 +70,9 @@ return array(
'value' => '1'
)
),
'value' => array('1')
'value' => array(
'1'
)
)
)
)

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'htaccess_add' => array(
'title' => $lng['extras']['pathoptions_add'],
@@ -35,7 +34,10 @@ return array(
'label' => $lng['extras']['directory_browsing'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
@@ -61,7 +63,10 @@ return array(
'label' => $lng['extras']['execute_perl'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
)

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'htaccess_edit' => array(
'title' => $lng['extras']['pathoptions_edit'],
@@ -33,9 +32,14 @@ return array(
'label' => $lng['extras']['directory_browsing'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['options_indexes'])
'value' => array(
$result['options_indexes']
)
),
'error404path' => array(
'label' => $lng['extras']['errordocument404path'],
@@ -62,9 +66,14 @@ return array(
'label' => $lng['extras']['execute_perl'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['options_cgi'])
'value' => array(
$result['options_cgi']
)
)
)
)

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'htpasswd_add' => array(
'title' => $lng['extras']['directoryprotection_add'],
@@ -44,7 +43,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'directory_authname' => array(
'label' => $lng['extras']['htpasswdauthname'],

View File

@@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'htpasswd_edit' => array(
'title' => $lng['extras']['directoryprotection_edit'],
@@ -43,7 +42,7 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword(),
'value' => \Froxlor\System\Crypt::generatePassword()
),
'directory_authname' => array(
'label' => $lng['extras']['htpasswdauthname'],

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