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
No known key found for this signature in database
GPG Key ID: 55284EC83A4823B8
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/

10
2fa.php
View File

@ -50,7 +50,7 @@ if ($action == 'delete') {
\Froxlor\UI\Response::standard_success($lng['2fa']['2fa_removed']);
} elseif ($action == 'add') {
$type = isset($_POST['type_2fa']) ? $_POST['type_2fa'] : '0';
if ($type == 0 || $type == 1) {
$data = "";
}
@ -69,7 +69,7 @@ if ($action == 'delete') {
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed 2fa::overview");
if ($userinfo['type_2fa'] == '0') {
// available types
$type_select_values = array(
0 => '-',
@ -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,40 +16,45 @@
* @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'],
'settinggroup' => 'panel',
'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'],
'settinggroup' => 'panel',
@ -57,23 +62,23 @@ return array(
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField'
),
),
'panel_natsorting' => array(
'label' => $lng['serversettings']['natsorting'],
'settinggroup' => 'panel',
'varname' => 'natsorting',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_no_robots' => array(
'label' => $lng['serversettings']['no_robots'],
'settinggroup' => 'panel',
'varname' => 'no_robots',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_paging' => array(
'label' => $lng['serversettings']['paging'],
'settinggroup' => 'panel',
@ -81,8 +86,8 @@ return array(
'type' => 'int',
'int_min' => 0,
'default' => 0,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_pathedit' => array(
'label' => $lng['serversettings']['pathedit'],
'settinggroup' => 'panel',
@ -90,9 +95,12 @@ 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'],
'settinggroup' => 'panel',
@ -101,16 +109,16 @@ return array(
'string_type' => 'mail',
'string_emptyallowed' => false,
'default' => '',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_adminmail_defname' => array(
'label' => $lng['serversettings']['adminmail_defname'],
'settinggroup' => 'panel',
'varname' => 'adminmail_defname',
'type' => 'string',
'default' => 'Froxlor Administrator',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_adminmail_return' => array(
'label' => $lng['serversettings']['adminmail_return'],
'settinggroup' => 'panel',
@ -119,8 +127,8 @@ return array(
'string_type' => 'mail',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_decimal_places' => array(
'label' => $lng['serversettings']['decimal_places'],
'settinggroup' => 'panel',
@ -129,8 +137,8 @@ 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'],
'settinggroup' => 'panel',
@ -139,8 +147,8 @@ return array(
'string_type' => 'url',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_webmail_url' => array(
'label' => $lng['serversettings']['webmail_url'],
'settinggroup' => 'panel',
@ -149,8 +157,8 @@ return array(
'string_type' => 'url',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_webftp_url' => array(
'label' => $lng['serversettings']['webftp_url'],
'settinggroup' => 'panel',
@ -159,40 +167,40 @@ 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'],
'settinggroup' => 'admin',
'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'],
'settinggroup' => 'admin',
'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'],
'settinggroup' => 'admin',
'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'],
'settinggroup' => 'customer',
'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'],
'settinggroup' => 'customer',
@ -201,32 +209,32 @@ 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'],
'settinggroup' => 'panel',
'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'],
'settinggroup' => 'panel',
'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'],
'settinggroup' => 'panel',
'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'],
'settinggroup' => 'panel',
@ -236,25 +244,25 @@ return array(
'option_mode' => 'multiple',
'option_emptyallowed' => true,
'option_options' => array(
'email' => $lng['menue']['email']['email'],
'mysql' => $lng['menue']['mysql']['mysql'],
'domains' => $lng['menue']['domains']['domains'],
'ftp' => $lng['menue']['ftp']['ftp'],
'extras' => $lng['menue']['extras']['extras'],
'extras.directoryprotection' => $lng['menue']['extras']['extras']." / ".$lng['menue']['extras']['directoryprotection'],
'extras.pathoptions' => $lng['menue']['extras']['extras']." / ".$lng['menue']['extras']['pathoptions'],
'extras.logger' => $lng['menue']['extras']['extras']." / ".$lng['menue']['logger']['logger'],
'extras.backup' => $lng['menue']['extras']['extras']." / ".$lng['menue']['extras']['backup'],
'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",
'email' => $lng['menue']['email']['email'],
'mysql' => $lng['menue']['mysql']['mysql'],
'domains' => $lng['menue']['domains']['domains'],
'ftp' => $lng['menue']['ftp']['ftp'],
'extras' => $lng['menue']['extras']['extras'],
'extras.directoryprotection' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['directoryprotection'],
'extras.pathoptions' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['pathoptions'],
'extras.logger' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['logger']['logger'],
'extras.backup' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['backup'],
'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',
),
),
),
),
);
'save_method' => 'storeSettingField'
)
)
)
)
);
?>

View File

@ -16,7 +16,6 @@
* @package Settings
*
*/
return array(
'groups' => array(
'accounts' => array(
@ -28,47 +27,47 @@ 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'],
'settinggroup' => 'session',
'varname' => 'allow_multiple_login',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'login_domain_login' => array(
'label' => $lng['serversettings']['login_domain_login'],
'settinggroup' => 'login',
'varname' => 'domain_login',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'login_maxloginattempts' => array(
'label' => $lng['serversettings']['maxloginattempts'],
'settinggroup' => 'login',
'varname' => 'maxloginattempts',
'type' => 'int',
'default' => 3,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'login_deactivatetime' => array(
'label' => $lng['serversettings']['deactivatetime'],
'settinggroup' => 'login',
'varname' => 'deactivatetime',
'type' => 'int',
'default' => 900,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'2fa_enabled' => array(
'label' => $lng['2fa']['2fa_enabled'],
'settinggroup' => '2fa',
'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,56 +75,56 @@ 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'],
'settinggroup' => 'panel',
'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'],
'settinggroup' => 'panel',
'varname' => 'password_alpha_upper',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_password_numeric' => array(
'label' => $lng['serversettings']['panel_password_numeric'],
'settinggroup' => 'panel',
'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'],
'settinggroup' => 'panel',
'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'],
'settinggroup' => 'panel',
'varname' => 'password_special_char',
'type' => 'string',
'default' => '!?<>§$%+#=@',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_password_regex' => array(
'label' => $lng['serversettings']['panel_password_regex'],
'settinggroup' => 'panel',
'varname' => 'password_regex',
'type' => 'string',
'default' => '',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'customer_accountprefix' => array(
'label' => $lng['serversettings']['accountprefix'],
'settinggroup' => 'customer',
@ -133,9 +132,11 @@ 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'],
'settinggroup' => 'customer',
@ -143,25 +144,27 @@ 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'],
'settinggroup' => 'customer',
'varname' => 'ftpprefix',
'type' => 'string',
'default' => '',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'customer_ftpatdomain' => array(
'label' => $lng['serversettings']['ftpdomain'],
'settinggroup' => 'customer',
'varname' => 'ftpatdomain',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_allow_preset' => array(
'label' => $lng['serversettings']['allow_password_reset'],
'settinggroup' => 'panel',
@ -170,14 +173,14 @@ return array(
'default' => false,
'save_method' => 'storeSettingField',
'dependency' => array(
'fieldname' => 'panel_allow_preset_admin',
'fielddata' => array(
'settinggroup' => 'panel',
'varname' => 'allow_preset_admin',
),
'onlyif' => 0
)
),
'fieldname' => 'panel_allow_preset_admin',
'fielddata' => array(
'settinggroup' => 'panel',
'varname' => 'allow_preset_admin'
),
'onlyif' => 0
)
),
'panel_allow_preset_admin' => array(
'label' => $lng['serversettings']['allow_password_reset_admin'],
'settinggroup' => 'panel',
@ -186,12 +189,12 @@ return array(
'default' => false,
'save_method' => 'storeSettingField',
'dependency' => array(
'fieldname' => 'panel_allow_preset',
'fielddata' => array(
'settinggroup' => 'panel',
'varname' => 'allow_preset',
),
'onlyif' => 1
'fieldname' => 'panel_allow_preset',
'fielddata' => array(
'settinggroup' => 'panel',
'varname' => 'allow_preset'
),
'onlyif' => 1
)
),
'system_backupenabled' => array(
@ -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,40 +26,40 @@ 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'],
'settinggroup' => 'system',
'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'],
'settinggroup' => 'system',
'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'],
'settinggroup' => 'system',
'varname' => 'cron_allowautoupdate',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_debug_cron' => array(
'label' => $lng['serversettings']['cron']['debug'],
'settinggroup' => 'system',
'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,8 +26,10 @@ 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'],
'settinggroup' => 'perl',
@ -36,8 +37,10 @@ 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'],
'settinggroup' => 'perl',
@ -46,8 +49,10 @@ 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'],
'settinggroup' => 'serversettings',
@ -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,17 +28,21 @@ 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'],
'settinggroup' => 'system',
'varname' => 'awstats_enabled',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_awstats_path' => array(
'label' => $lng['serversettings']['awstats_path'],
'settinggroup' => 'system',
@ -47,8 +50,8 @@ 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'],
'settinggroup' => 'system',
@ -56,8 +59,8 @@ 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'],
'settinggroup' => 'system',
@ -65,8 +68,8 @@ 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'],
'settinggroup' => 'system',
@ -74,11 +77,11 @@ 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,8 +29,8 @@ 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'],
'settinggroup' => 'system',
@ -40,8 +39,8 @@ 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'],
'settinggroup' => 'system',
@ -49,8 +48,8 @@ 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'],
'settinggroup' => 'system',
@ -59,48 +58,48 @@ return array(
'string_type' => 'dir',
'default' => 'Maildir',
'string_emptyallowed' => true,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'panel_sendalternativemail' => array(
'label' => $lng['serversettings']['sendalternativemail'],
'settinggroup' => 'panel',
'varname' => 'sendalternativemail',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_mail_quota_enabled' => array(
'label' => $lng['serversettings']['mail_quota_enabled'],
'settinggroup' => 'system',
'varname' => 'mail_quota_enabled',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_mail_quota' => array(
'label' => $lng['serversettings']['mail_quota'],
'settinggroup' => 'system',
'varname' => 'mail_quota',
'type' => 'int',
'default' => 100,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_catchall_enabled' => array(
'label' => $lng['serversettings']['catchall_enabled'],
'settinggroup' => 'catchall',
'varname' => 'catchall_enabled',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingResetCatchall',
),
'save_method' => 'storeSettingResetCatchall'
),
'system_mailtraffic_enabled' => array(
'label' => $lng['serversettings']['mailtraffic_enabled'],
'settinggroup' => 'system',
'varname' => 'mailtraffic_enabled',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_mdaserver' => array(
'label' => $lng['serversettings']['mdaserver'],
'settinggroup' => 'system',
@ -108,9 +107,12 @@ 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'],
'settinggroup' => 'system',
@ -119,8 +121,8 @@ 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'],
'settinggroup' => 'system',
@ -128,9 +130,12 @@ 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'],
'settinggroup' => 'system',
@ -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,10 +16,9 @@
* @package Settings
*
*/
return array(
'groups' => array(
'ftpserver' => array(
'ftpserver' => array(
'title' => $lng['admin']['ftpserversettings'],
'fields' => 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(
@ -30,7 +29,7 @@ return array(
'default' => true,
'save_method' => 'storeSettingField',
'overview_option' => true
),
),
'system_dnsenabled' => array(
'label' => $lng['serversettings']['dnseditorenable'],
'settinggroup' => 'system',
@ -38,7 +37,7 @@ return array(
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField'
),
),
'system_dns_server' => array(
'label' => $lng['serversettings']['dns_server'],
'settinggroup' => 'system',
@ -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,16 +58,16 @@ 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'],
'settinggroup' => 'system',
'varname' => 'bindreload_command',
'type' => 'string',
'default' => '/etc/init.d/bind9 reload',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_nameservers' => array(
'label' => $lng['serversettings']['nameservers'],
'settinggroup' => 'system',
@ -74,8 +76,8 @@ 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'],
'settinggroup' => 'system',
@ -84,8 +86,8 @@ 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'],
'settinggroup' => 'system',
@ -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'],
@ -104,7 +106,7 @@ return array(
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField'
),
),
'system_defaultttl' => array(
'label' => $lng['serversettings']['defaultttl'],
'settinggroup' => 'system',
@ -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(
@ -30,7 +29,7 @@ return array(
'default' => false,
'save_method' => 'storeSettingField',
'overview_option' => true
),
),
'logger_severity' => array(
'label' => $lng['serversettings']['logger']['severity'],
'settinggroup' => 'logger',
@ -38,9 +37,12 @@ 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'],
'settinggroup' => 'logger',
@ -48,9 +50,13 @@ 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'],
'settinggroup' => 'logger',
@ -59,8 +65,8 @@ return array(
'string_type' => 'file',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'logger_log_cron' => array(
'label' => $lng['serversettings']['logger']['logcron'],
'settinggroup' => 'logger',
@ -69,15 +75,15 @@ return array(
'default' => 0,
'option_mode' => 'one',
'option_options' => array(
0 => $lng['serversettings']['logger']['logcronoption']['never'],
1 => $lng['serversettings']['logger']['logcronoption']['once'],
2 => $lng['serversettings']['logger']['logcronoption']['always']
),
'save_method' => 'storeSettingField',
0 => $lng['serversettings']['logger']['logcronoption']['never'],
1 => $lng['serversettings']['logger']['logcronoption']['once'],
2 => $lng['serversettings']['logger']['logcronoption']['always']
),
),
),
'save_method' => 'storeSettingField'
)
)
)
);
)
);
?>

View File

@ -16,7 +16,6 @@
* @package \Froxlor\Settings
*
*/
return array(
'groups' => array(
'dkim' => array(
@ -30,7 +29,7 @@ return array(
'default' => false,
'save_method' => 'storeSettingFieldInsertBindTask',
'overview_option' => true
),
),
'dkim_prefix' => array(
'label' => $lng['dkim']['dkim_prefix'],
'settinggroup' => 'dkim',
@ -38,8 +37,8 @@ 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'],
'settinggroup' => 'dkim',
@ -47,8 +46,8 @@ 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'],
'settinggroup' => 'dkim',
@ -56,8 +55,8 @@ 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'],
'settinggroup' => 'dkim',
@ -65,9 +64,13 @@ 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'],
'settinggroup' => 'dkim',
@ -75,9 +78,12 @@ 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(
'title' => $lng['dkim']['dkim_keylength']['title'],
@ -88,9 +94,12 @@ 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'],
'settinggroup' => 'dkim',
@ -98,16 +107,16 @@ 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'],
'settinggroup' => 'dkim',
'varname' => 'dkim_add_adsp',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingFieldInsertBindTask',
),
'save_method' => 'storeSettingFieldInsertBindTask'
),
'dkim_add_adsppolicy' => array(
'label' => $lng['dkim']['dkim_add_adsppolicy'],
'settinggroup' => 'dkim',
@ -115,20 +124,24 @@ 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'],
'settinggroup' => 'dkim',
'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(
@ -28,7 +27,7 @@ return array(
'default' => false,
'save_method' => 'storeSettingField',
'overview_option' => true
),
),
'spf_entry' => array(
'label' => $lng['spf']['spf_entry'],
'settinggroup' => 'spf',
@ -36,10 +35,10 @@ return array(
'type' => 'string',
'default' => '"v=spf1 a mx -all"',
'save_method' => 'storeSettingField'
)
)
)
)
);
)
);
?>

View File

@ -16,7 +16,6 @@
* @package Settings
*
*/
return array(
'groups' => array(
'security' => array(
@ -28,16 +27,16 @@ return array(
'varname' => 'unix_names',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_mailpwcleartext' => array(
'label' => $lng['serversettings']['mailpwcleartext'],
'settinggroup' => 'system',
'varname' => 'mailpwcleartext',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_passwordcryptfunc' => array(
'label' => $lng['serversettings']['passwordcryptfunc'],
'settinggroup' => 'system',
@ -45,33 +44,36 @@ 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'],
'settinggroup' => 'system',
'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'],
'settinggroup' => 'system',
'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'],
'settinggroup' => 'system',
'varname' => 'allow_customer_shell',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'save_method' => 'storeSettingField'
),
'system_available_shells' => array(
'label' => $lng['serversettings']['available_shells'],
'settinggroup' => 'system',
@ -79,9 +81,9 @@ 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,415 +1,440 @@
<?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'
) {
apcu_clear_cache();
$log->logAction(ADM_ACTION, LOG_INFO, "cleared APCu cache");
header('Location: ' . $linker->getLink(array('section' => 'apcuinfo', 'page' => 'showinfo')));
exit();
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'
)));
exit();
}
if (!function_exists('apcu_cache_info') ||
!function_exists('apcu_sma_info')
) {
\Froxlor\UI\Response::standard_error($lng['error']['no_apcuinfo']);
if (! function_exists('apcu_cache_info') || ! function_exists('apcu_sma_info')) {
\Froxlor\UI\Response::standard_error($lng['error']['no_apcuinfo']);
}
if ($page == 'showinfo'
) {
$cache = apcu_cache_info();
$mem = apcu_sma_info();
$time = time();
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_apcuinfo");
if ($page == 'showinfo') {
$cache = apcu_cache_info();
$mem = apcu_sma_info();
$time = time();
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_apcuinfo");
$passtime = $time - $cache['start_time'] > 0 ? $time - $cache['start_time'] : 1; // zero division
$mem_size = $mem['num_seg'] * $mem['seg_size'];
$mem_avail = $mem['avail_mem'];
$mem_used = $mem_size - $mem_avail;
$seg_size = bsize($mem['seg_size']);
$sharedmem = sprintf($lng['apcuinfo']['sharedmemval'], $mem['num_seg'], $seg_size, $cache['memory_type']);
$req_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits'] + $cache['num_misses']) / $passtime) : 0);
$hit_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits']) / $passtime) : 0);
$miss_rate_user = sprintf("%.2f", $cache['num_misses'] ? (($cache['num_misses']) / $passtime) : 0);
$insert_rate_user = sprintf("%.2f", $cache['num_inserts'] ? (($cache['num_inserts']) / $passtime) : 0);
$apcversion = phpversion('apcu');
$phpversion = phpversion();
$number_vars = $cache['num_entries'];
$starttime = date('Y-m-d H:i:s', $cache['start_time']);
$uptime_duration = duration($cache['start_time']);
$size_vars = bsize($cache['mem_size']);
$passtime = $time - $cache['start_time'] > 0 ? $time - $cache['start_time'] : 1; // zero division
$mem_size = $mem['num_seg'] * $mem['seg_size'];
$mem_avail = $mem['avail_mem'];
$mem_used = $mem_size - $mem_avail;
$seg_size = bsize($mem['seg_size']);
$sharedmem = sprintf($lng['apcuinfo']['sharedmemval'], $mem['num_seg'], $seg_size, $cache['memory_type']);
$req_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits'] + $cache['num_misses']) / $passtime) : 0);
$hit_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits']) / $passtime) : 0);
$miss_rate_user = sprintf("%.2f", $cache['num_misses'] ? (($cache['num_misses']) / $passtime) : 0);
$insert_rate_user = sprintf("%.2f", $cache['num_inserts'] ? (($cache['num_inserts']) / $passtime) : 0);
$apcversion = phpversion('apcu');
$phpversion = phpversion();
$number_vars = $cache['num_entries'];
$starttime = date('Y-m-d H:i:s', $cache['start_time']);
$uptime_duration = duration($cache['start_time']);
$size_vars = bsize($cache['mem_size']);
// check for possible empty values that are used in the templates
if (!isset($cache['file_upload_progress'])) {
$cache['file_upload_progress'] = $lng['logger']['unknown'];
}
// check for possible empty values that are used in the templates
if (! isset($cache['file_upload_progress'])) {
$cache['file_upload_progress'] = $lng['logger']['unknown'];
}
if (!isset($cache['num_expunges'])) {
$cache['num_expunges'] = $lng['logger']['unknown'];
}
if (! isset($cache['num_expunges'])) {
$cache['num_expunges'] = $lng['logger']['unknown'];
}
$runtimelines = '';
foreach (ini_get_all('apcu') as $name => $v) {
$value = $v['local_value'];
eval("\$runtimelines.=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/runtime_line") . "\";");
}
$runtimelines = '';
foreach (ini_get_all('apcu') as $name => $v) {
$value = $v['local_value'];
eval("\$runtimelines.=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/runtime_line") . "\";");
}
$freemem = bsize($mem_avail) . sprintf(" (%.1f%%)", $mem_avail * 100 / $mem_size);
$usedmem = bsize($mem_used) . sprintf(" (%.1f%%)", $mem_used * 100 / $mem_size);
$hits = $cache['num_hits'] . @sprintf(" (%.1f%%)", $cache['num_hits'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
$misses = $cache['num_misses'] . @sprintf(" (%.1f%%)", $cache['num_misses'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
$freemem = bsize($mem_avail) . sprintf(" (%.1f%%)", $mem_avail * 100 / $mem_size);
$usedmem = bsize($mem_used) . sprintf(" (%.1f%%)", $mem_used * 100 / $mem_size);
$hits = $cache['num_hits'] . @sprintf(" (%.1f%%)", $cache['num_hits'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
$misses = $cache['num_misses'] . @sprintf(" (%.1f%%)", $cache['num_misses'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
// Fragementation: (freeseg - 1) / total_seg
$nseg = $freeseg = $fragsize = $freetotal = 0;
for ($i = 0; $i < $mem['num_seg']; $i++) {
$ptr = 0;
foreach ($mem['block_lists'][$i] as $block) {
if ($block['offset'] != $ptr) {
++$nseg;
}
$ptr = $block['offset'] + $block['size'];
/* Only consider blocks <5M for the fragmentation % */
if ($block['size'] < (5 * 1024 * 1024))
$fragsize+=$block['size'];
$freetotal+=$block['size'];
}
$freeseg += count($mem['block_lists'][$i]);
}
// Fragementation: (freeseg - 1) / total_seg
$nseg = $freeseg = $fragsize = $freetotal = 0;
for ($i = 0; $i < $mem['num_seg']; $i ++) {
$ptr = 0;
foreach ($mem['block_lists'][$i] as $block) {
if ($block['offset'] != $ptr) {
++ $nseg;
}
$ptr = $block['offset'] + $block['size'];
/* Only consider blocks <5M for the fragmentation % */
if ($block['size'] < (5 * 1024 * 1024))
$fragsize += $block['size'];
$freetotal += $block['size'];
}
$freeseg += count($mem['block_lists'][$i]);
}
if ($freeseg > 1) {
$frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize / $freetotal) * 100, bsize($fragsize), bsize($freetotal), $freeseg);
} else {
$frag = "0%";
}
if ($freeseg > 1) {
$frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize / $freetotal) * 100, bsize($fragsize), bsize($freetotal), $freeseg);
} else {
$frag = "0%";
}
foreach (ini_get_all('apcu') as $name => $v) {
$value = $v['local_value'];
}
foreach (ini_get_all('apcu') as $name => $v) {
$value = $v['local_value'];
}
$img_src1 = '';
$img_src2 = '';
$img_src3 = '';
if (graphics_avail()) {
$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)));
eval("\$img_src2=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";");
$img_src = $linker->getLink(array('section' => 'apcuinfo', 'page' => 'img3', 'action' => mt_rand(0, 1000000)));
eval("\$img_src3=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";");
}
$img_src1 = '';
$img_src2 = '';
$img_src3 = '';
if (graphics_avail()) {
$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)
));
eval("\$img_src2=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";");
$img_src = $linker->getLink(array(
'section' => 'apcuinfo',
'page' => 'img3',
'action' => mt_rand(0, 1000000)
));
eval("\$img_src3=\"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/img_line") . "\";");
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/showinfo") . "\";");
} elseif ($page == 'img1'
) {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/apcuinfo/showinfo") . "\";");
} elseif ($page == 'img1') {
$mem = apcu_sma_info();
$mem = apcu_sma_info();
$size = 460;
$image = imagecreate($size + 5, $size + 5);
$size = 460;
$image = imagecreate($size + 5, $size + 5);
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
$col_black = imagecolorallocate($image, 0, 0, 0);
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
$col_black = imagecolorallocate($image, 0, 0, 0);
imagecolortransparent($image, $col_white);
imagecolortransparent($image, $col_white);
$s = $mem['num_seg'] * $mem['seg_size'];
$a = $mem['avail_mem'];
$x = $y = $size / 2;
$fuzz = 0.000001;
$s = $mem['num_seg'] * $mem['seg_size'];
$a = $mem['avail_mem'];
$x = $y = $size / 2;
$fuzz = 0.000001;
// This block of code creates the pie chart. It is a lot more complex than you
// would expect because we try to visualize any memory fragmentation as well.
$angle_from = 0;
$string_placement = array();
for ($i = 0; $i < $mem['num_seg']; $i++) {
$ptr = 0;
$free = $mem['block_lists'][$i];
uasort($free, 'block_sort');
foreach ($free as $block) {
if ($block['offset'] != $ptr) { // Used block
$angle_to = $angle_from + ($block['offset'] - $ptr) / $s;
if (($angle_to + $fuzz) > 1)
$angle_to = 1;
if (($angle_to * 360) - ($angle_from * 360) >= 1) {
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
if (($angle_to - $angle_from) > 0.05) {
array_push($string_placement, array($angle_from, $angle_to));
}
}
$angle_from = $angle_to;
}
$angle_to = $angle_from + ($block['size']) / $s;
if (($angle_to + $fuzz) > 1)
$angle_to = 1;
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));
}
}
$angle_from = $angle_to;
$ptr = $block['offset'] + $block['size'];
}
if ($ptr < $mem['seg_size']) { // memory at the end
$angle_to = $angle_from + ($mem['seg_size'] - $ptr) / $s;
if (($angle_to + $fuzz) > 1)
$angle_to = 1;
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));
}
}
}
foreach ($string_placement as $angle) {
text_arc($image, $x, $y, $size, $angle[0] * 360, $angle[1] * 360, $col_black, bsize($s * ($angle[1] - $angle[0])));
}
// This block of code creates the pie chart. It is a lot more complex than you
// would expect because we try to visualize any memory fragmentation as well.
$angle_from = 0;
$string_placement = array();
for ($i = 0; $i < $mem['num_seg']; $i ++) {
$ptr = 0;
$free = $mem['block_lists'][$i];
uasort($free, 'block_sort');
foreach ($free as $block) {
if ($block['offset'] != $ptr) { // Used block
$angle_to = $angle_from + ($block['offset'] - $ptr) / $s;
if (($angle_to + $fuzz) > 1)
$angle_to = 1;
if (($angle_to * 360) - ($angle_from * 360) >= 1) {
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
if (($angle_to - $angle_from) > 0.05) {
array_push($string_placement, array(
$angle_from,
$angle_to
));
}
}
$angle_from = $angle_to;
}
$angle_to = $angle_from + ($block['size']) / $s;
if (($angle_to + $fuzz) > 1)
$angle_to = 1;
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
));
}
}
$angle_from = $angle_to;
$ptr = $block['offset'] + $block['size'];
}
if ($ptr < $mem['seg_size']) { // memory at the end
$angle_to = $angle_from + ($mem['seg_size'] - $ptr) / $s;
if (($angle_to + $fuzz) > 1)
$angle_to = 1;
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
));
}
}
}
foreach ($string_placement as $angle) {
text_arc($image, $x, $y, $size, $angle[0] * 360, $angle[1] * 360, $col_black, bsize($s * ($angle[1] - $angle[0])));
}
header("Content-type: image/png");
imagepng($image);
exit;
} elseif ($page == 'img2'
) {
header("Content-type: image/png");
imagepng($image);
exit();
} elseif ($page == 'img2') {
$cache = apcu_cache_info();
$cache = apcu_cache_info();
$size = $horizontal_bar_size;
$image = imagecreate($size + 5, 140);
$size = $horizontal_bar_size;
$image = imagecreate($size + 5, 140);
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
$col_black = imagecolorallocate($image, 0, 0, 0);
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
$col_black = imagecolorallocate($image, 0, 0, 0);
imagecolortransparent($image, $col_white);
imagecolortransparent($image, $col_white);
$s = $cache['num_hits'] + $cache['num_misses'];
$a = $cache['num_hits'];
$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'
) {
header("Content-type: image/png");
imagepng($image);
exit();
} elseif ($page == 'img3') {
$mem = apcu_sma_info();
$mem = apcu_sma_info();
$size = $horizontal_bar_size;
$image = imagecreate($size, 70);
$size = $horizontal_bar_size;
$image = imagecreate($size, 70);
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
$col_black = imagecolorallocate($image, 0, 0, 0);
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
$col_black = imagecolorallocate($image, 0, 0, 0);
imagecolortransparent($image, $col_white);
imagecolortransparent($image, $col_white);
$s = $mem['num_seg'] * $mem['seg_size'];
$a = $mem['avail_mem'];
$x = 10;
$y = 0;
$s = $mem['num_seg'] * $mem['seg_size'];
$a = $mem['avail_mem'];
$x = 10;
$y = 0;
// This block of code creates the bar chart. It is a lot more complex than you
// would expect because we try to visualize any memory fragmentation as well.
for ($i = 0; $i < $mem['num_seg']; $i++) {
$ptr = 0;
$free = $mem['block_lists'][$i];
uasort($free, 'block_sort');
foreach ($free as $block) {
if ($block['offset'] != $ptr) { // Used block
$h = ($size - 5) * ($block['offset'] - $ptr) / $s;
if ($h > 0) {
fill_box($image, $y, $x, $h, 50, $col_black, $col_red);
}
$y+=$h;
}
$h = ($size - 5) * ($block['size']) / $s;
if ($h > 0) {
fill_box($image, $y, $x, $h, 50, $col_black, $col_green);
}
$y+=$h;
$ptr = $block['offset'] + $block['size'];
}
if ($ptr < $mem['seg_size']) { // memory at the end
$h = ($size - 5) * ($mem['seg_size'] - $ptr) / $s;
if ($h > 0) {
fill_box($image, $y, $x, $h, 50, $col_black, $col_red, bsize($mem['seg_size'] - $ptr), $j++);
}
}
}
// This block of code creates the bar chart. It is a lot more complex than you
// would expect because we try to visualize any memory fragmentation as well.
for ($i = 0; $i < $mem['num_seg']; $i ++) {
$ptr = 0;
$free = $mem['block_lists'][$i];
uasort($free, 'block_sort');
foreach ($free as $block) {
if ($block['offset'] != $ptr) { // Used block
$h = ($size - 5) * ($block['offset'] - $ptr) / $s;
if ($h > 0) {
fill_box($image, $y, $x, $h, 50, $col_black, $col_red);
}
$y += $h;
}
$h = ($size - 5) * ($block['size']) / $s;
if ($h > 0) {
fill_box($image, $y, $x, $h, 50, $col_black, $col_green);
}
$y += $h;
$ptr = $block['offset'] + $block['size'];
}
if ($ptr < $mem['seg_size']) { // memory at the end
$h = ($size - 5) * ($mem['seg_size'] - $ptr) / $s;
if ($h > 0) {
fill_box($image, $y, $x, $h, 50, $col_black, $col_red, bsize($mem['seg_size'] - $ptr), $j ++);
}
}
}
header("Content-type: image/png");
imagepng($image);
exit;
header("Content-type: image/png");
imagepng($image);
exit();
}
function graphics_avail() {
return extension_loaded('gd');
function graphics_avail()
{
return extension_loaded('gd');
}
// pretty printer for byte values
//
function bsize($s) {
foreach (array('', 'K', 'M', 'G') as $i => $k) {
if ($s < 1024)
break;
$s/=1024;
}
return sprintf("%5.1f %sBytes", $s, $k);
function bsize($s)
{
foreach (array(
'',
'K',
'M',
'G'
) as $i => $k) {
if ($s < 1024)
break;
$s /= 1024;
}
return sprintf("%5.1f %sBytes", $s, $k);
}
function duration($ts) {
global $time;
$years = (int) ((($time - $ts) / (7 * 86400)) / 52.177457);
$rem = (int) (($time - $ts) - ($years * 52.177457 * 7 * 86400));
$weeks = (int) (($rem) / (7 * 86400));
$days = (int) (($rem) / 86400) - $weeks * 7;
$hours = (int) (($rem) / 3600) - $days * 24 - $weeks * 7 * 24;
$mins = (int) (($rem) / 60) - $hours * 60 - $days * 24 * 60 - $weeks * 7 * 24 * 60;
$str = '';
if ($years == 1)
$str .= "$years year, ";
if ($years > 1)
$str .= "$years years, ";
if ($weeks == 1)
$str .= "$weeks week, ";
if ($weeks > 1)
$str .= "$weeks weeks, ";
if ($days == 1)
$str .= "$days day,";
if ($days > 1)
$str .= "$days days,";
if ($hours == 1)
$str .= " $hours hour and";
if ($hours > 1)
$str .= " $hours hours and";
if ($mins == 1)
$str .= " 1 minute";
else
$str .= " $mins minutes";
return $str;
function duration($ts)
{
global $time;
$years = (int) ((($time - $ts) / (7 * 86400)) / 52.177457);
$rem = (int) (($time - $ts) - ($years * 52.177457 * 7 * 86400));
$weeks = (int) (($rem) / (7 * 86400));
$days = (int) (($rem) / 86400) - $weeks * 7;
$hours = (int) (($rem) / 3600) - $days * 24 - $weeks * 7 * 24;
$mins = (int) (($rem) / 60) - $hours * 60 - $days * 24 * 60 - $weeks * 7 * 24 * 60;
$str = '';
if ($years == 1)
$str .= "$years year, ";
if ($years > 1)
$str .= "$years years, ";
if ($weeks == 1)
$str .= "$weeks week, ";
if ($weeks > 1)
$str .= "$weeks weeks, ";
if ($days == 1)
$str .= "$days day,";
if ($days > 1)
$str .= "$days days,";
if ($hours == 1)
$str .= " $hours hour and";
if ($hours > 1)
$str .= " $hours hours and";
if ($mins == 1)
$str .= " 1 minute";
else
$str .= " $mins minutes";
return $str;
}
function block_sort($array1, $array2) {
if ($array1['offset'] > $array2['offset']) {
return 1;
} else {
return -1;
}
function block_sort($array1, $array2)
{
if ($array1['offset'] > $array2['offset']) {
return 1;
} else {
return - 1;
}
}
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);
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);
imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE);
imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL | IMG_ARC_EDGED);
} else {
imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start + 1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end - 1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
imagefill($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $color2);
}
if ($text) {
if ($placeindex > 0) {
imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1);
imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1);
} else {
imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1);
}
}
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);
imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE);
imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL | IMG_ARC_EDGED);
} else {
imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start + 1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end - 1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
imagefill($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $color2);
}
if ($text) {
if ($placeindex > 0) {
imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1);
imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1);
} else {
imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1);
}
}
}
function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $text, $placeindex = 0) {
$r = $diameter / 2;
$w = deg2rad((360 + $start + ($end - $start) / 2) % 360);
function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $text, $placeindex = 0)
{
$r = $diameter / 2;
$w = deg2rad((360 + $start + ($end - $start) / 2) % 360);
if ($placeindex > 0) {
imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1);
imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1);
} else {
imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1);
}
if ($placeindex > 0) {
imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1);
imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1);
} else {
imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1);
}
}
function fill_box($im, $x, $y, $w, $h, $color1, $color2, $text = '', $placeindex = '') {
global $col_black;
$x1 = $x + $w - 1;
$y1 = $y + $h - 1;
function fill_box($im, $x, $y, $w, $h, $color1, $color2, $text = '', $placeindex = '')
{
global $col_black;
$x1 = $x + $w - 1;
$y1 = $y + $h - 1;
imagerectangle($im, $x, $y1, $x1 + 1, $y + 1, $col_black);
if ($y1 > $y)
imagefilledrectangle($im, $x, $y, $x1, $y1, $color2);
else
imagefilledrectangle($im, $x, $y1, $x1, $y, $color2);
imagerectangle($im, $x, $y1, $x1, $y, $color1);
if ($text) {
if ($placeindex > 0) {
imagerectangle($im, $x, $y1, $x1 + 1, $y + 1, $col_black);
if ($y1 > $y)
imagefilledrectangle($im, $x, $y, $x1, $y1, $color2);
else
imagefilledrectangle($im, $x, $y1, $x1, $y, $color2);
imagerectangle($im, $x, $y1, $x1, $y, $color1);
if ($text) {
if ($placeindex > 0) {
if ($placeindex < 16) {
$px = 5;
$py = $placeindex * 12 + 6;
imagefilledrectangle($im, $px + 90, $py + 3, $px + 90 - 4, $py - 3, $color2);
imageline($im, $x, $y + $h / 2, $px + 90, $py, $color2);
imagestring($im, 2, $px, $py - 6, $text, $color1);
} else {
if ($placeindex < 31) {
$px = $x + 40 * 2;
$py = ($placeindex - 15) * 12 + 6;
} else {
$px = $x + 40 * 2 + 100 * intval(($placeindex - 15) / 15);
$py = ($placeindex % 15) * 12 + 6;
}
imagefilledrectangle($im, $px, $py + 3, $px - 4, $py - 3, $color2);
imageline($im, $x + $w, $y + $h / 2, $px, $py, $color2);
imagestring($im, 2, $px + 2, $py - 6, $text, $color1);
}
} else {
imagestring($im, 4, $x + 5, $y1 - 16, $text, $color1);
}
}
if ($placeindex < 16) {
$px = 5;
$py = $placeindex * 12 + 6;
imagefilledrectangle($im, $px + 90, $py + 3, $px + 90 - 4, $py - 3, $color2);
imageline($im, $x, $y + $h / 2, $px + 90, $py, $color2);
imagestring($im, 2, $px, $py - 6, $text, $color1);
} else {
if ($placeindex < 31) {
$px = $x + 40 * 2;
$py = ($placeindex - 15) * 12 + 6;
} else {
$px = $x + 40 * 2 + 100 * intval(($placeindex - 15) / 15);
$py = ($placeindex % 15) * 12 + 6;
}
imagefilledrectangle($im, $px, $py + 3, $px - 4, $py - 3, $color2);
imageline($im, $x + $w, $y + $h / 2, $px, $py, $color2);
imagestring($im, 2, $px + 2, $py - 6, $text, $color1);
}
} else {
imagestring($im, 4, $x + 5, $y1 - 16, $text, $color1);
}
}
}

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

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');
}
@ -93,9 +89,9 @@ if ($userinfo['change_serversettings'] == '1') {
if ($distribution != "") {
if (!file_exists($config_dir . '/' . $distribution . ".xml")) {
if (! file_exists($config_dir . '/' . $distribution . ".xml")) {
trigger_error("Unknown distribution, are you playing around with the URL?");
exit;
exit();
}
// create configparser object
@ -109,9 +105,9 @@ if ($userinfo['change_serversettings'] == '1') {
if ($service != "") {
if (!isset($services[$service])) {
if (! isset($services[$service])) {
trigger_error("Unknown service, are you playing around with the URL?");
exit;
exit();
}
$daemons = $services[$service]->getDaemons();
@ -157,9 +153,9 @@ if ($userinfo['change_serversettings'] == '1') {
if ($distribution != "" && $service != "" && $daemon != "") {
if (!isset($daemons[$daemon])) {
if (! isset($daemons[$daemon])) {
trigger_error("Unknown daemon, are you playing around with the URL?");
exit;
exit();
}
$confarr = $daemons[$daemon]->getConfig();

View File

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

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);
@ -70,65 +63,69 @@ if ($page == 'log'
$_action = 0;
foreach ($logrows as $row) {
// if ($paging->checkDisplay($i)) {
$row = htmlentities_array($row);
$row['date'] = date("d.m.y H:i:s", $row['date']);
$row = htmlentities_array($row);
$row['date'] = date("d.m.y H:i:s", $row['date']);
if ($_action != $action) {
switch ($action) {
case USR_ACTION:
$_action = $lng['admin']['customer'];
break;
case RES_ACTION:
$_action = $lng['logger']['reseller'];
break;
case ADM_ACTION:
$_action = $lng['logger']['admin'];
break;
case CRON_ACTION:
$_action = $lng['logger']['cron'];
break;
case LOGIN_ACTION:
$_action = $lng['logger']['login'];
break;
case LOG_ERROR:
$_action = $lng['logger']['intern'];
break;
default:
$_action = $lng['logger']['unknown'];
break;
}
$row['action'] = $_action;
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_action') . "\";");
if ($_action != $action) {
switch ($action) {
case USR_ACTION:
$_action = $lng['admin']['customer'];
break;
case RES_ACTION:
$_action = $lng['logger']['reseller'];
break;
case ADM_ACTION:
$_action = $lng['logger']['admin'];
break;
case CRON_ACTION:
$_action = $lng['logger']['cron'];
break;
case LOGIN_ACTION:
$_action = $lng['logger']['login'];
break;
case LOG_ERROR:
$_action = $lng['logger']['intern'];
break;
default:
$_action = $lng['logger']['unknown'];
break;
}
$log_count++;
$row['type'] = getLogLevelDesc($row['type']);
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_log') . "\";");
$count++;
$_action = $action;
$row['action'] = $_action;
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_action') . "\";");
}
$log_count ++;
$row['type'] = getLogLevelDesc($row['type']);
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_log') . "\";");
$count ++;
$_action = $action;
// }
$i++;
$i ++;
}
$i++;
$i ++;
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate('logger/logger') . "\";");
} 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');
@ -59,7 +55,7 @@ if ($page == 'message') {
$subject = $_POST['subject'];
$message = wordwrap($_POST['message'], 70);
if (!empty($message)) {
if (! empty($message)) {
$mailcounter = 0;
$mail->Body = $message;
$mail->Subject = $subject;
@ -68,11 +64,15 @@ 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'];
if (!$mail->Send()) {
if (! $mail->Send()) {
if ($mail->ErrorInfo != '') {
$mailerr_msg = $mail->ErrorInfo;
} else {
@ -83,11 +83,16 @@ if ($page == 'message') {
\Froxlor\UI\Response::standard_error('errorsendingmail', $row['email']);
}
$mailcounter++;
$mailcounter ++;
$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');
}
@ -97,14 +102,13 @@ if ($page == 'message') {
if ($action == 'showsuccess') {
$success = 1;
$sentitems = isset($_GET['sentitems']) ? (int)$_GET['sentitems'] : 0;
$sentitems = isset($_GET['sentitems']) ? (int) $_GET['sentitems'] : 0;
if ($sentitems == 0) {
$successmessage = $lng['message']['noreceipients'];
} else {
$successmessage = str_replace('%s', $sentitems, $lng['message']['success']);
}
} else {
$success = 0;
$sentitems = 0;
@ -115,7 +119,7 @@ if ($page == 'message') {
$receipients = '';
if ($userinfo['customers_see_all'] == '1') {
$receipients.= makeoption($lng['panel']['reseller'], 0);
$receipients .= makeoption($lng['panel']['reseller'], 0);
}
$receipients .= makeoption($lng['panel']['customer'], 1);

View File

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

View File

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

View File

@ -16,7 +16,6 @@
* @package Panel
*
*/
define('AREA', 'admin');
require './lib/init.php';
@ -26,16 +25,14 @@ use Froxlor\Settings as Settings;
if (isset($_POST['subjectid'])) {
$subjectid = intval($_POST['subjectid']);
$mailbodyid = intval($_POST['mailbodyid']);
} elseif(isset($_GET['subjectid'])) {
} elseif (isset($_GET['subjectid'])) {
$subjectid = intval($_GET['subjectid']);
$mailbodyid = intval($_GET['mailbodyid']);
}
if (isset($_POST['id'])) {
$id = intval($_POST['id']);
} elseif(isset($_GET['id'])) {
} elseif (isset($_GET['id'])) {
$id = intval($_GET['id']);
}
@ -48,11 +45,8 @@ $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'
);
if ((int) Settings::Get('system.report_enable') == 1) {
array_push($available_templates, 'trafficmaxpercent', 'diskmaxpercent');
}
$file_templates = array(
@ -60,7 +54,7 @@ $file_templates = array(
);
if ($action == '') {
//email templates
// email templates
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_templates");
if (Settings::Get('panel.sendalternativemail') == 1) {
@ -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']);
@ -111,14 +108,15 @@ if ($action == '') {
}
}
//filetemplates
// filetemplates
$filetemplates = '';
$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,84 +126,87 @@ 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
) {
//email templates
} 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
) {
//file templates
} 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') {
} elseif ($action == 'add') {
if (Settings::Get('panel.sendalternativemail') == 1) {
$available_templates[] = 'pop_success_alternative';
}
if (isset($_POST['prepare'])
&& $_POST['prepare'] == 'prepare'
) {
//email templates
if (isset($_POST['prepare']) && $_POST['prepare'] == 'prepare') {
// email templates
$language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
$template = validate($_POST['template'], 'template');
@ -224,18 +225,15 @@ if ($action == '') {
$lng = $lng_bak;
$template_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.template_add.php';
$template_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.template_add.php';
$template_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($template_add_data);
$title = $template_add_data['template_add']['title'];
$image = $template_add_data['template_add']['image'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates_add_2") . "\";");
} elseif(isset($_POST['send'])
&& $_POST['send'] == 'send'
) {
//email templates
} elseif (isset($_POST['send']) && $_POST['send'] == 'send') {
// email templates
$language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
$template = validate($_POST['template'], 'template');
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
@ -244,18 +242,19 @@ 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)) {
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$templates[] = str_replace('_subject', '', $row['varname']);
}
$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,14 +262,13 @@ if ($action == '') {
`language` = :lang,
`templategroup` = 'mails',
`varname` = :var,
`value` = :value"
);
`value` = :value");
// mail-subject
$ins_data = array(
'adminid' => $userinfo['adminid'],
'lang' => $language,
'var' => $template.'_subject',
'var' => $template . '_subject',
'value' => $subject
);
Database::pexecute($ins_stmt, $ins_data);
@ -279,19 +277,19 @@ if ($action == '') {
$ins_data = array(
'adminid' => $userinfo['adminid'],
'lang' => $language,
'var' => $template.'_mailbody',
'var' => $template . '_mailbody',
'value' => $mailbody
);
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'
) {
//file templates
} 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,11 +309,13 @@ 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'])) {
} elseif(!isset($_GET['files'])) {
//email templates
// email templates
$add = false;
$language_options = '';
$template_options = '';
@ -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']);
@ -336,12 +337,12 @@ if ($action == '') {
if (count(array_diff($available_templates, $templates)) > 0) {
$add = true;
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true, true);
$language_options .= makeoption($language_name, $language_file, $userinfo['language'], true, true);
$templates = array_diff($available_templates, $templates);
foreach ($templates as $template) {
$template_options.= makeoption($lng['admin']['templates'][$template], $template, NULL, true, true, $language_file) . "\n";
$template_options .= makeoption($lng['admin']['templates'][$template], $template, NULL, true, true, $language_file) . "\n";
}
}
}
@ -351,18 +352,17 @@ if ($action == '') {
} else {
\Froxlor\UI\Response::standard_error('alltemplatesdefined');
}
} else {
//filetemplates
// 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();
@ -373,10 +373,10 @@ if ($action == '') {
}
foreach (array_diff($file_templates, $templatesdefined) as $template) {
$free_templates.= makeoption($lng['admin']['templates'][$template], $template, '', true);
$free_templates .= makeoption($lng['admin']['templates'][$template], $template, '', true);
}
$filetemplate_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.filetemplate_add.php';
$filetemplate_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.filetemplate_add.php';
$filetemplate_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($filetemplate_add_data);
$title = $filetemplate_add_data['filetemplate_add']['title'];
@ -385,32 +385,27 @@ if ($action == '') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/filetemplates_add") . "\";");
}
}
} elseif($action == 'edit'
&& $subjectid != 0
&& $mailbodyid != 0
) {
//email templates
} 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,11 +432,12 @@ 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']);
// don't escape the already escaped language-string so save up before htmlentities()
@ -447,7 +445,7 @@ if ($action == '') {
$result = htmlentities_array($result);
$mailbody = $result['value'];
$template_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.template_edit.php';
$template_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.template_edit.php';
$template_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($template_edit_data);
$title = $template_edit_data['template_edit']['title'];
@ -456,31 +454,27 @@ if ($action == '') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("templates/templates_edit") . "\";");
}
}
} elseif($action == 'editf'
&& $id != 0
) {
//file templates
} 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) {
if (Database::num_rows() > 0) {
$row = $result_stmt->fetch(PDO::FETCH_ASSOC);
//filetemplates
if (isset($_POST['filesend'])
&& $_POST['filesend'] == 'filesend'
) {
// filetemplates
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,12 +482,14 @@ 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);
$filetemplate_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.filetemplate_edit.php';
$filetemplate_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.filetemplate_edit.php';
$filetemplate_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($filetemplate_edit_data);
$title = $filetemplate_edit_data['filetemplate_edit']['title'];
@ -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';
@ -24,7 +23,7 @@ use Froxlor\Settings as Settings;
if (isset($_POST['id'])) {
$id = intval($_POST['id']);
} elseif(isset($_GET['id'])) {
} elseif (isset($_GET['id'])) {
$id = intval($_GET['id']);
}
@ -41,52 +40,52 @@ $months = array(
'9' => 'sep',
'10' => 'oct',
'11' => 'nov',
'12' => 'dec',
'12' => 'dec'
);
if ($page == 'overview' || $page == 'customers') {
$customerview = 1;
$stats_tables = '';
$minyear_stmt = Database::query("SELECT `year` FROM `". TABLE_PANEL_TRAFFIC . "` ORDER BY `year` ASC LIMIT 1");
$minyear_stmt = Database::query("SELECT `year` FROM `" . TABLE_PANEL_TRAFFIC . "` ORDER BY `year` ASC LIMIT 1");
$minyear = $minyear_stmt->fetch(PDO::FETCH_ASSOC);
if (!isset($minyear['year']) || $minyear['year'] == 0) {
if (! isset($minyear['year']) || $minyear['year'] == 0) {
$maxyears = 0;
} else {
$maxyears = date("Y") - $minyear['year'];
}
for ($years = 0; $years<=$maxyears; $years++) {
for ($years = 0; $years <= $maxyears; $years ++) {
$overview['year'] = date("Y")-$years;
$overview['year'] = date("Y") - $years;
$overview['type'] = $lng['traffic']['customer'];
$domain_list = '';
$totals = array(
'jan' => 0,
'feb' => 0,
'mar' => 0,
'apr' => 0,
'may' => 0,
'jun' => 0,
'jul' => 0,
'aug' => 0,
'sep' => 0,
'oct' => 0,
'nov' => 0,
'dec' => 0,
'jan' => 0,
'feb' => 0,
'mar' => 0,
'apr' => 0,
'may' => 0,
'jun' => 0,
'jul' => 0,
'aug' => 0,
'sep' => 0,
'oct' => 0,
'nov' => 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)) {
while ($customer_name = $customer_name_list_stmt->fetch(PDO::FETCH_ASSOC)) {
$virtual_host = array(
'name' => ($customer_name['company'] == '' ? $customer_name['name'] . ", " . $customer_name['firstname'] : $customer_name['company']),
@ -102,29 +101,31 @@ 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');
$totals[$months[(int)$traffic_month['month']]] += $traffic_month['traffic'];
$virtual_host[$months[(int) $traffic_month['month']]] = \Froxlor\PhpHelper::size_readable($traffic_month['traffic'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$totals[$months[(int) $traffic_month['month']]] += $traffic_month['traffic'];
}
eval("\$domain_list .= sprintf(\"%s\", \"" . \Froxlor\UI\Template::getTemplate("traffic/index_table_row") . "\");");
}
// 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'));
$virtual_host[$month] = ($bytes == 0 ? '-' : \Froxlor\PhpHelper::size_readable($bytes, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s'));
}
$customerview = 0;
eval("\$total_list = sprintf(\"%s\", \"" . \Froxlor\UI\Template::getTemplate("traffic/index_table_row") . "\");");

View File

@ -14,7 +14,6 @@
* @package Panel
*
*/
define('AREA', 'admin');
require './lib/init.php';
@ -29,15 +28,11 @@ if ($page == 'overview') {
* have any version/dbversion in the database (don't know why)
* 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 (! isFroxlor()) {
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,12 +40,11 @@ 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'])) {
Settings::Set('system.dbversion', (int)$result['value'], false);
Settings::Set('system.dbversion', (int) $result['value'], false);
} else {
Settings::Set('system.dbversion', 0, false);
}
@ -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';
@ -86,23 +74,23 @@ if ($page == 'overview') {
}
}
if (!$successful_update) {
if (! $successful_update) {
$current_version = Settings::Get('panel.version');
$current_db_version = Settings::Get('panel.db_version');
if (empty($current_db_version)) {
$current_db_version = "0";
$current_db_version = "0";
}
$new_version = $version;
$new_db_version = $dbversion;
$ui_text = $lng['update']['update_information']['part_a'];
if ($version != $current_version) {
$ui_text = str_replace('%curversion', $current_version, $ui_text);
$ui_text = str_replace('%newversion', $new_version, $ui_text);
$ui_text = str_replace('%curversion', $current_version, $ui_text);
$ui_text = str_replace('%newversion', $new_version, $ui_text);
} else {
// show db version
$ui_text = str_replace('%curversion', $current_db_version, $ui_text);
$ui_text = str_replace('%newversion', $new_db_version, $ui_text);
// show db version
$ui_text = str_replace('%curversion', $current_db_version, $ui_text);
$ui_text = str_replace('%newversion', $new_db_version, $ui_text);
}
$update_information = $ui_text;

View File

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

View File

@ -17,7 +17,7 @@ if (! defined('AREA')) {
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Panel
* @since 0.10.0
*
*
*/
use Froxlor\Database as Database;
@ -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));
@ -84,23 +83,23 @@ if ($action == 'delete') {
));
$success_message = $lng['apikeys']['apikey_added'];
} elseif ($action == 'jqEditApiKey') {
$keyid = isset($_POST['id']) ? (int)$_POST['id'] : 0;
$keyid = isset($_POST['id']) ? (int) $_POST['id'] : 0;
$allowed_from = isset($_POST['allowed_from']) ? $_POST['allowed_from'] : "";
$valid_until = isset($_POST['valid_until']) ? (int)$_POST['valid_until'] : -1;
$valid_until = isset($_POST['valid_until']) ? (int) $_POST['valid_until'] : - 1;
// validate allowed_from
$ip_list = array_map('trim', explode(",", $allowed_from));
$_check_list = $ip_list;
foreach ($_check_list as $idx => $ip) {
if (validate_ip2($ip, true, 'invalidip', true, true) == false) {
unset ($ip_list[$idx]);
unset($ip_list[$idx]);
}
}
$ip_list = array_map('inet_ntop', array_map('inet_pton', $ip_list));
$allowed_from = implode(",", array_unique($ip_list));
if ($valid_until <= 0 || !is_numeric($valid_until)) {
$valid_until = -1;
if ($valid_until <= 0 || ! is_numeric($valid_until)) {
$valid_until = - 1;
}
$upd_stmt = Database::prepare("
@ -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");
@ -179,7 +177,7 @@ if (count($all_keys) == 0) {
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
$searchcode = $paging->getHtmlSearchCode($lng);
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
foreach ($all_keys as $idx => $key) {
if ($paging->checkDisplay($idx)) {
@ -206,7 +204,7 @@ if (count($all_keys) == 0) {
// customer do not need links
$adminCustomerLink = $key['loginname'];
}
// escape stuff
$row = htmlentities_array($key);

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

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

1888
css/jquery-ui.min.css vendored

File diff suppressed because one or more lines are too long

View File

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

View File

@ -16,7 +16,6 @@
* @package Panel
*
*/
define('AREA', 'customer');
require './lib/init.php';
@ -27,7 +26,7 @@ use Froxlor\Api\Commands\EmailAccounts as EmailAccounts;
use Froxlor\Api\Commands\EmailForwarders as EmailForwarders;
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','email')) {
if (Settings::IsInList('panel.customer_hide_options', 'email')) {
\Froxlor\UI\Response::redirectTo('customer_index.php');
}
@ -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);
@ -64,7 +64,7 @@ if ($page == 'overview') {
$emails = array();
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if (!isset($emails[$row['domain']]) || !is_array($emails[$row['domain']])) {
if (! isset($emails[$row['domain']]) || ! is_array($emails[$row['domain']])) {
$emails[$row['domain']] = array();
}
@ -96,7 +96,7 @@ if ($page == 'overview') {
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_domain") . "\";");
}
$emails_count++;
$emails_count ++;
$row['email'] = $idna_convert->decode($row['email']);
$row['email_full'] = $idna_convert->decode($row['email_full']);
$row['destination'] = explode(' ', $row['destination']);
@ -118,22 +118,23 @@ if ($page == 'overview') {
$row['destination'] = substr($row['destination'], 0, 32) . '... (' . $destinations_count . ')';
}
$row['mboxsize'] = \Froxlor\PhpHelper::size_readable($row['mboxsize'], 'GiB', 'bi', '%01.' . (int)Settings::Get('panel.decimal_places') . 'f %s');
$row['mboxsize'] = \Froxlor\PhpHelper::size_readable($row['mboxsize'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$row = htmlentities_array($row);
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_email") . "\";");
$count++;
$count ++;
}
$i++;
$i ++;
}
}
$emaildomains_count_stmt = Database::prepare("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "`
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,23 +184,29 @@ 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)) {
$domains.= makeoption($idna_convert->decode($row['domain']), $row['domain']);
$domains .= makeoption($idna_convert->decode($row['domain']), $row['domain']);
}
//$iscatchall = makeyesno('iscatchall', '1', '0', '0');
// $iscatchall = makeyesno('iscatchall', '1', '0', '0');
$email_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_add.php';
$email_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_add.php';
if (Settings::Get('catchall.catchall_enabled') != '1') {
unset($email_add_data['emails_add']['sections']['section_a']['fields']['iscatchall']);
@ -231,7 +245,7 @@ if ($page == 'overview') {
if ($destination != $result['email_full'] && $destination != '') {
eval("\$forwarders.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_edit_forwarder") . "\";");
$forwarders_count++;
$forwarders_count ++;
}
$result['destination'][$dest_id] = $destination;
@ -240,7 +254,7 @@ if ($page == 'overview') {
$destinations_count = count($result['destination']);
$result = htmlentities_array($result);
$email_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_edit.php';
$email_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_edit.php';
if (Settings::Get('catchall.catchall_enabled') != '1') {
unset($email_edit_data['emails_edit']['sections']['section_a']['fields']['mail_catchall']);
@ -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,12 +359,17 @@ 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);
$account_changepw_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php';
$account_changepw_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php';
$account_changepw_form = \Froxlor\UI\HtmlForm::genHTMLForm($account_changepw_data);
$title = $account_changepw_data['emails_accountchangepasswd']['title'];
@ -344,7 +380,9 @@ if ($page == 'overview') {
}
} elseif ($action == 'changequota' && Settings::Get('system.mail_quota_enabled') == '1' && $id != 0) {
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,12 +395,17 @@ 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);
$quota_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_accountchangequota.php';
$quota_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_accountchangequota.php';
$quota_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($quota_edit_data);
$title = $quota_edit_data['emails_accountchangequota']['title'];
@ -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,12 +465,17 @@ 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);
$forwarder_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_addforwarder.php';
$forwarder_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_addforwarder.php';
$forwarder_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($forwarder_add_data);
$title = $forwarder_add_data['emails_addforwarder']['title'];
@ -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';
@ -25,7 +24,7 @@ use Froxlor\Settings;
use Froxlor\Api\Commands\Ftps as Ftps;
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','ftp')) {
if (Settings::IsInList('panel.customer_hide_options', 'ftp')) {
\Froxlor\UI\Response::redirectTo('customer_index.php');
}
@ -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);
@ -75,10 +75,10 @@ if ($page == 'overview') {
$row = htmlentities_array($row);
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate('ftp/accounts_account') . "\";");
$count++;
$count ++;
}
$i++;
$i ++;
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate('ftp/accounts') . "\";");
@ -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,12 +133,13 @@ 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'];
$domainlist[] = $row_domain['domain'];
}
sort($domainlist);
@ -143,7 +154,7 @@ if ($page == 'overview') {
if (Settings::Get('system.allow_customer_shell') == '1') {
$shells = makeoption("/bin/false", "/bin/false", "/bin/false");
$shells_avail = Settings::Get('system.available_shells');
if (!empty($shells_avail)) {
if (! empty($shells_avail)) {
$shells_avail = explode(",", $shells_avail);
$shells_avail = array_map("trim", $shells_avail);
foreach ($shells_avail as $_shell) {
@ -152,9 +163,9 @@ if ($page == 'overview') {
}
}
//$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
// $sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
$ftp_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_add.php';
$ftp_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/ftp/formfield.ftp_add.php';
$ftp_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($ftp_add_data);
$title = $ftp_add_data['ftp_add']['title'];
@ -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']);
@ -207,7 +222,7 @@ if ($page == 'overview') {
if (Settings::Get('system.allow_customer_shell') == '1') {
$shells = makeoption("/bin/false", "/bin/false", $result['shell']);
$shells_avail = Settings::Get('system.available_shells');
if (!empty($shells_avail)) {
if (! empty($shells_avail)) {
$shells_avail = explode(",", $shells_avail);
$shells_avail = array_map("trim", $shells_avail);
foreach ($shells_avail as $_shell) {
@ -216,7 +231,7 @@ if ($page == 'overview') {
}
}
$ftp_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_edit.php';
$ftp_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/ftp/formfield.ftp_edit.php';
$ftp_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($ftp_edit_data);
$title = $ftp_edit_data['ftp_edit']['title'];

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'];
}
@ -83,8 +88,10 @@ if ($page == 'overview') {
$month = date('M Y', $yesterday);
// 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_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']
));
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places'));
$userinfo['diskspace_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places'));
@ -99,17 +106,21 @@ if ($page == 'overview') {
$services_enabled = "";
$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') . "\";");
} elseif ($page == 'change_password') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$old_password = validate($_POST['old_password'], 'old password');
if (!validatePasswordLogin($userinfo,$old_password,TABLE_PANEL_CUSTOMERS,'customerid')) {
if (! validatePasswordLogin($userinfo, $old_password, TABLE_PANEL_CUSTOMERS, 'customerid')) {
\Froxlor\UI\Response::standard_error('oldpasswordnotcorrect');
}
@ -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'] != '') {
@ -236,12 +273,11 @@ if ($page == 'overview') {
$theme_options = '';
$themes_avail = getThemes();
foreach ($themes_avail as $t => $d) {
$theme_options.= makeoption($d, $t, $default_theme, true);
$theme_options .= makeoption($d, $t, $default_theme, true);
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/change_theme') . "\";");
}
} elseif ($page == 'send_error_report' && Settings::Get('system.allow_error_report_customer') == '1') {
// only show this if we really have an exception to report
@ -249,8 +285,8 @@ if ($page == 'overview') {
$errid = $_GET['errorid'];
// read error file
$err_dir = \Froxlor\FileDir::makeCorrectDir(FROXLOR_INSTALL_DIR."/logs/");
$err_file = \Froxlor\FileDir::makeCorrectFile($err_dir."/".$errid."_sql-error.log");
$err_dir = \Froxlor\FileDir::makeCorrectDir(FROXLOR_INSTALL_DIR . "/logs/");
$err_file = \Froxlor\FileDir::makeCorrectFile($err_dir . "/" . $errid . "_sql-error.log");
if (file_exists($err_file)) {
@ -269,19 +305,17 @@ if ($page == 'overview') {
$mail_body = "Dear froxlor-team,\n\n";
$mail_body .= "the following error has been reported by a user:\n\n";
$mail_body .= "-------------------------------------------------------------\n";
$mail_body .= $_error['code'].' '.$_error['message']."\n\n";
$mail_body .= "File: ".$_error['file'].':'.$_error['line']."\n\n";
$mail_body .= "Trace:\n".trim($_error['trace'])."\n\n";
$mail_body .= $_error['code'] . ' ' . $_error['message'] . "\n\n";
$mail_body .= "File: " . $_error['file'] . ':' . $_error['line'] . "\n\n";
$mail_body .= "Trace:\n" . trim($_error['trace']) . "\n\n";
$mail_body .= "-------------------------------------------------------------\n\n";
$mail_body .= "Froxlor-version: ".$version."\n";
$mail_body .= "DB-version: ".$dbversion."\n\n";
$mail_body .= "Froxlor-version: " . $version . "\n";
$mail_body .= "DB-version: " . $dbversion . "\n\n";
$mail_body .= "End of report";
$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 {
@ -290,7 +324,7 @@ if ($page == 'overview') {
$mail->MsgHTML($mail_html);
$mail->AddAddress('error-reports@froxlor.org', 'Froxlor Developer Team');
$mail->Send();
} catch(\PHPMailer\PHPMailer\Exception $e) {
} catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
@ -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

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

View File

@ -16,7 +16,6 @@
* @package Panel
*
*/
define('AREA', 'customer');
require './lib/init.php';
@ -25,7 +24,7 @@ use Froxlor\Settings;
use Froxlor\Api\Commands\Mysqls as Mysqls;
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','mysql')) {
if (Settings::IsInList('panel.customer_hide_options', 'mysql')) {
\Froxlor\UI\Response::redirectTo('customer_index.php');
}
@ -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);
@ -70,7 +70,7 @@ if ($page == 'overview') {
$count = 0;
$mysqls = '';
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `".TABLE_PANEL_DATABASES."`");
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `" . TABLE_PANEL_DATABASES . "`");
$dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC);
$count_mysqlservers = $dbserver['numservers'];
@ -81,21 +81,21 @@ 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');
$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') . "\";");
$count++;
$count ++;
}
$i++;
$i ++;
}
Database::needRoot(false);
// End root-session
eval("echo \"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls') . "\";");
} elseif ($action == 'delete' && $id != 0) {
try {
@ -114,7 +114,7 @@ if ($page == 'overview') {
$sql_root = Database::getSqlData();
Database::needRoot(false);
if (!isset($sql_root[$result['dbserver']]) || !is_array($sql_root[$result['dbserver']])) {
if (! isset($sql_root[$result['dbserver']]) || ! is_array($sql_root[$result['dbserver']])) {
$result['dbserver'] = 0;
}
@ -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'].')';
$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,10 +148,13 @@ 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."`");
$dbservers_stmt = Database::query("SELECT DISTINCT `dbserver` FROM `" . TABLE_PANEL_DATABASES . "`");
$mysql_servers = '';
$count_mysqlservers = 0;
while ($dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC)) {
@ -152,11 +162,11 @@ if ($page == 'overview') {
Database::needSqlData();
$sql_root = Database::getSqlData();
$mysql_servers .= makeoption($sql_root['caption'], $dbserver['dbserver']);
$count_mysqlservers++;
$count_mysqlservers ++;
}
Database::needRoot(false);
$mysql_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_add.php';
$mysql_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/mysql/formfield.mysql_add.php';
$mysql_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($mysql_add_data);
$title = $mysql_add_data['mysql_add']['title'];
@ -182,10 +192,13 @@ 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."`");
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `" . TABLE_PANEL_DATABASES . "`");
$dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC);
$count_mysqlservers = $dbserver['numservers'];
@ -194,7 +207,7 @@ if ($page == 'overview') {
$sql_root = Database::getSqlData();
Database::needRoot(false);
$mysql_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_edit.php';
$mysql_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/mysql/formfield.mysql_edit.php';
$mysql_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($mysql_edit_data);
$title = $mysql_edit_data['mysql_edit']['title'];

View File

@ -16,7 +16,6 @@
* @package Panel
*
*/
define('AREA', 'customer');
$intrafficpage = 1;
require './lib/init.php';
@ -25,7 +24,7 @@ use Froxlor\Database\Database;
use Froxlor\Settings;
// redirect if this customer page is hidden via settings
if (Settings::IsInList('panel.customer_hide_options','traffic')) {
if (Settings::IsInList('panel.customer_hide_options', 'traffic')) {
\Froxlor\UI\Response::redirectTo('customer_index.php');
}
@ -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');
@ -56,7 +54,7 @@ elseif (isset($_GET['page']) && $_GET['page'] == 'current') {
}
}
if (!is_null($month) && !is_null($year)) {
if (! is_null($month) && ! is_null($year)) {
$traf['byte'] = 0;
$result_stmt = Database::prepare("SELECT SUM(`http`) as 'http', SUM(`ftp_up`) AS 'ftp_up', SUM(`ftp_down`) as 'ftp_down', SUM(`mail`) as 'mail', `day`, `month`, `year`
FROM `" . TABLE_PANEL_TRAFFIC . "`
@ -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,
@ -109,9 +106,9 @@ if (!is_null($month) && !is_null($year)) {
$show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year'];
}
$traffic_complete['http'] = \Froxlor\PhpHelper::size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
$traffic_complete['ftp'] = \Froxlor\PhpHelper::size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
$traffic_complete['mail'] = \Froxlor\PhpHelper::size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
$traffic_complete['http'] = \Froxlor\PhpHelper::size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$traffic_complete['ftp'] = \Froxlor\PhpHelper::size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$traffic_complete['mail'] = \Froxlor\PhpHelper::size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_details') . "\";");
} else {
@ -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;
@ -160,9 +158,9 @@ if (!is_null($month) && !is_null($year)) {
eval("\$traffic.=\"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_traffic') . "\";");
}
$traffic_complete['http'] = \Froxlor\PhpHelper::size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
$traffic_complete['ftp'] = \Froxlor\PhpHelper::size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
$traffic_complete['mail'] = \Froxlor\PhpHelper::size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
$traffic_complete['http'] = \Froxlor\PhpHelper::size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$traffic_complete['ftp'] = \Froxlor\PhpHelper::size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
$traffic_complete['mail'] = \Froxlor\PhpHelper::size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic') . "\";");
}

View File

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

View File

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

View File

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

View File

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

View File

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

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';
@ -77,8 +76,8 @@ $lng['install']['changing_data'] = 'Ajustement des paramètres...';
$lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...';
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans '.dirname(dirname(__DIR__)).'/lib/.';
$lng['install']['creating_configfile_failed'] = 'Impossible de créer '.dirname(dirname(__DIR__)).'/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans ' . dirname(dirname(__DIR__)) . '/lib/.';
$lng['install']['creating_configfile_failed'] = 'Impossible de créer ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';
$lng['click_here_to_refresh'] = 'Cliquez ici pour vérifier à nouveau';

View File

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

View File

@ -1,37 +1,65 @@
@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;
html, body {
font: 12px/18px 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial,
Verdana, sans-serif;
background-color: #f5f5f5;
color:#444;
color: #444;
-webkit-font-smoothing: subpixel-antialiased;
}
body {
margin:0;
padding:0;
margin: 0;
padding: 0;
}
.dark {
background-color: #e9edf0;
border-bottom:1px solid #d1d5d8;
border-bottom: 1px solid #d1d5d8;
}
header img {
padding:10px 0 10px 10px;
padding: 10px 0 10px 10px;
}
h1 {
display:none;
display: none;
}
h2, h3 {
@ -41,21 +69,20 @@ h2, h3 {
}
h2 {
font-size:17px;
font-size: 17px;
}
h3 {
font-size: 15px;
}
img {
border:0;
vertical-align:middle;
border: 0;
vertical-align: middle;
}
td a {
text-decoration:none;
text-decoration: none;
}
.bradius {
@ -65,19 +92,19 @@ td a {
/* FOOTER */
footer {
clear:both;
text-align:center;
clear: both;
text-align: center;
color: #888;
font-size:10px !important;
font-size: 10px !important;
margin: 10px 0;
}
footer a,footer a:active,footer a:visited {
footer a, footer a:active, footer a:visited {
color: #888;
}
.install {
background-color:#fff;
background-color: #fff;
margin: 20px auto 12px;
width: 800px;
}
@ -87,14 +114,14 @@ p {
}
.installsec {
margin-top:10px;
padding:0;
text-align:left;
margin-top: 10px;
padding: 0;
text-align: left;
}
.installsec table {
width:100%;
padding:0 10px;
width: 100%;
padding: 0 10px;
margin: 15px 0 15px 0;
}
@ -106,46 +133,46 @@ p {
}
.installsec form {
width:800px;
margin:0 auto;
padding:10px 0 0;
text-align:left;
width: 800px;
margin: 0 auto;
padding: 10px 0 0;
text-align: left;
}
.installsec fieldset {
border:0;
float:left;
clear:left;
width:600px;
margin:0 100px 10px;
padding:0;
border: 0;
float: left;
clear: left;
width: 600px;
margin: 0 100px 10px;
padding: 0;
}
.installsec fieldset p, .installsec fieldset h3{
.installsec fieldset p, .installsec fieldset h3 {
clear: both;
}
.installsec legend {
display:none;
display: none;
}
.installsec label {
float:left;
margin-right:0;
margin-top:8px;
text-align:left;
float: left;
margin-right: 0;
margin-top: 8px;
text-align: left;
}
p.submit {
text-align:right;
padding-right:46px;
text-align: right;
padding-right: 46px;
}
.installsec aside {
border-top:1px solid #d1d5d8;
clear:both;
float:none;
width:auto;
border-top: 1px solid #d1d5d8;
clear: both;
float: none;
width: auto;
text-align: right;
padding: 10px;
}
@ -153,140 +180,143 @@ p.submit {
.line {
border: 0;
width: 800px;
border-bottom:1px solid #d1d5d8;
border-bottom: 1px solid #d1d5d8;
}
.messagewrapper {
width:650px;
margin:0 auto;
padding:120px 0 0;
overflow:hidden;
width: 650px;
margin: 0 auto;
padding: 120px 0 0;
overflow: hidden;
}
.messagewrapperfull {
width:100%;
margin:0 auto;
padding:0;
overflow:hidden;
width: 100%;
margin: 0 auto;
padding: 0;
overflow: hidden;
}
.overviewsearch {
position:absolute;
top:155px;
right:36px;
font-size:80%;
position: absolute;
top: 155px;
right: 36px;
font-size: 80%;
}
.overviewadd {
padding:10px;
font-weight:700;
padding: 10px;
font-weight: 700;
}
/*
* error message display
*/
.errorcontainer {
background:url(../img/icons/error_big.png) 10px center no-repeat #ffedef;
border:1px solid #ffc2ca;
padding:10px 10px 10px 68px!important;
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;
text-align:left!important;
overflow:hidden;
text-align: left !important;
overflow: hidden;
box-shadow: 0 0 0 black;
}
.errortitle {
font-weight:700;
color:#c00!important;
font-weight: 700;
color: #c00 !important;
}
.error {
font-weight:400!important;
color:#c00!important;
font-weight: 400 !important;
color: #c00 !important;
}
/*
* warning message display
*/
.warningcontainer,.ui-dialog {
background:url(../img/icons/warning_big.png) 10px center no-repeat #fffecc;
border:1px solid #f3c37e;
padding:10px 10px 10px 68px !important;
.warningcontainer, .ui-dialog {
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;
text-align:left!important;
overflow:hidden;
text-align: left !important;
overflow: hidden;
box-shadow: 0 0 0 black;
}
.ui-dialog {
padding: 10px !important;
}
.warningtitle,.ui-dialog-titlebar {
font-weight:700;
color:#D57D00;
.warningtitle, .ui-dialog-titlebar {
font-weight: 700;
color: #D57D00;
}
.warning,.ui-dialog-content {
color:#D57D00!important;
.warning, .ui-dialog-content {
color: #D57D00 !important;
}
/*
* success message display
*/
.successcontainer {
background:url(../img/icons/ok_big.png) 10px center no-repeat #E2F9E3;
border:1px solid #9C9;
padding:10px 10px 10px 68px!important;
background: url(../img/icons/ok_big.png) 10px center no-repeat #E2F9E3;
border: 1px solid #9C9;
padding: 10px 10px 10px 68px !important;
margin: 10px 0 10px 0 !important;
text-align:left!important;
overflow:hidden;
text-align: left !important;
overflow: hidden;
box-shadow: 0 0 0 black;
}
.successtitle {
font-weight:700;
color:#060!important;
font-weight: 700;
color: #060 !important;
}
.success {
font-weight:400!important;
font-weight: 400 !important;
}
/*
* neutral/info message display
*/
.neutralcontainer {
background:url(../img/icons/info_big.png) 10px center no-repeat #d2eaf6;
border:1px solid #b7d8ed;
padding:10px 10px 10px 68px!important;
background: url(../img/icons/info_big.png) 10px center no-repeat #d2eaf6;
border: 1px solid #b7d8ed;
padding: 10px 10px 10px 68px !important;
margin: 10px 0 10px 0 !important;
text-align:left!important;
overflow:hidden;
text-align: left !important;
overflow: hidden;
box-shadow: 0 0 0 black;
}
.neutraltitle {
font-weight:700;
color:#3188c1!important;
font-weight: 700;
color: #3188c1 !important;
}
.neutral {
font-weight:400!important;
color:#3188c1!important;
font-weight: 400 !important;
color: #3188c1 !important;
}
/* std hyperlink */
a,a:active,a:visited {
color:#176fa1;
text-decoration:none;
a, a:active, a:visited {
color: #176fa1;
text-decoration: none;
}
a:hover {
text-decoration:underline;
text-decoration: underline;
}
.infotext {
font-size:11px;
font-size: 11px;
}
/*
@ -294,28 +324,28 @@ a:hover {
*/
.main {
margin: 105px 10px 0 240px;
background-color:#fff;
background-color: #fff;
padding: 30px 30px 30px 30px;
min-height:400px;
min-height: 400px;
}
.noborder {
width:100%;
border-spacing:0;
border-collapse:separate;
width: 100%;
border-spacing: 0;
border-collapse: separate;
border: 0;
}
.noborder td {
border:0;
border: 0;
}
table {
width:100%;
border-spacing:0;
border:1px solid #d1d5d8;
border-collapse:separate;
box-shadow:0 0 0 black !important;
width: 100%;
border-spacing: 0;
border: 1px solid #d1d5d8;
border-collapse: separate;
box-shadow: 0 0 0 black !important;
}
table thead th, table th {
@ -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;
@ -358,33 +394,34 @@ table thead:first-child th {
}
table tbody td {
border-bottom:1px dotted #ccc;
border-bottom: 1px dotted #ccc;
}
table tbody tr:last-child td {
border-bottom: 0;
}
.formtable {
width: 100%;
border-spacing:0;
border:0;
border-collapse:separate;
margin:0 0 0;
border-spacing: 0;
border: 0;
border-collapse: separate;
margin: 0 0 0;
}
.formtable tbody td {
border:0;
border-bottom:1px dotted #ccc;
border: 0;
border-bottom: 1px dotted #ccc;
min-height: 20px;
}
.formtable label {
float:none;
display:block;
padding:0;
margin:0;
width:100%;
text-align:left;
float: none;
display: block;
padding: 0;
margin: 0;
width: 100%;
text-align: left;
}
td {
@ -393,47 +430,47 @@ td {
}
table tfoot td {
height:25px;
height: 25px;
border-top: 1px solid #d1d5d8;
background-color: #f2f8fa;
}
.tfootleft {
text-align:left;
text-align: left;
}
.maintitle {
padding-top:20px;
padding-top: 20px;
}
/* input elements */
input {
background: #fff url(../img/text_align_left.png) no-repeat 5px 4px;
color: #333;
padding:2px 4px 2px 24px;
height:22px;
padding: 2px 4px 2px 24px;
height: 22px;
border: 1px solid #d9d9d9;
margin-bottom: 5px;
border-radius: 3px;
}
textarea {
background:#fff url(../img/text_align_left.png) no-repeat 5px 4px;
background: #fff url(../img/text_align_left.png) no-repeat 5px 4px;
color: #333;
padding:4px 4px 2px 24px;
border:1px solid #d9d9d9;
padding: 4px 4px 2px 24px;
border: 1px solid #d9d9d9;
margin-bottom: 5px;
border-radius: 3px;
}
input[type="password"] {
background:#fff url(../img/password.png) no-repeat 5px 4px;
background: #fff url(../img/password.png) no-repeat 5px 4px;
}
/*
* BUTTONS
*/
input[type="button"],input[type="submit"],input[type="reset"] {
input[type="button"], input[type="submit"], input[type="reset"] {
margin: 0 5px;
padding: 5px 14px;
outline: 0;
@ -443,45 +480,56 @@ 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 {
color: #333;
background-color: #dcdcdc;
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 {
-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="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 {
input[type="submit"], input[class="yesbutton"] {
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 {
input[type="submit"]:hover, input[class="yesbutton"]:hover {
color: white;
background-color: #c53727;
}
input[class="nobutton"]:active,input[type="reset"]:active {
background-color: #dd4b39;
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;
background: #dae7ee;
padding: 0;
margin: 0 5px 0 0;
vertical-align: middle;
@ -491,72 +539,99 @@ input[type="checkbox"] {
input[type="radio"] {
vertical-align: middle;
margin: 0 10px 0 10px;
height:22px;
height: 22px;
}
select {
background:#fff;
padding:4px;
background: #fff;
padding: 4px;
color: #333;
border:1px solid #d9d9d9;
border: 1px solid #d9d9d9;
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;
-moz-appearance: none;
appearance: none;
}
.maintable {
width:90%;
width: 90%;
}
.update_progess {
padding:2em;
text-align:left;
padding: 2em;
text-align: left;
}
.preconfig {
text-align:left;
margin-top:20px;
margin-bottom:5px;
margin-right:15px;
margin-left:15px;
text-align: left;
margin-top: 20px;
margin-bottom: 5px;
margin-right: 15px;
margin-left: 15px;
}
.preconfigitem {
padding:.15em;
border-bottom:1px solid #ccc;
padding: .15em;
border-bottom: 1px solid #ccc;
}
.preconfdesc {
display:block;
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;
display: block;
margin-bottom: .5em;
font-size: 120%;
}
.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; }
.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;
}

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).
@ -11,12 +12,12 @@ use Froxlor\Settings as Settings;
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package API
* @since 0.10.0
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package API
* @since 0.10.0
*
*/
class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntity
{

View File

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

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

View File

@ -1,4 +1,7 @@
<?php if (!defined('MASTER_CRONJOB')) die('You cannot access this file directly!');
<?php
if (! defined('MASTER_CRONJOB'))
die('You cannot access this file directly!');
/**
* This file is part of the Froxlor project.
@ -8,17 +11,16 @@
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @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'];
}
@ -99,7 +101,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
$mail->MsgHTML(nl2br($mail_body));
$mail->AddAddress($row['email'], $row['name']);
$mail->Send();
} catch(\PHPMailer\PHPMailer\Exception $e) {
} catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
@ -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'];
}
@ -189,7 +193,7 @@ if ((int)Settings::Get('system.report_webmax') > 0)
$mail->MsgHTML(nl2br($mail_body));
$mail->AddAddress($row['email'], $row['name']);
$mail->Send();
} catch(\PHPMailer\PHPMailer\Exception $e) {
} catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
@ -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,8 +70,9 @@ class FroxlorLogger
/**
* return FroxlorLogger instance
*
* @param array $userinfo unused
*
* @param array $userinfo
* unused
*
* @return FroxlorLogger
*/
public static function getInstanceOf($userinfo = null)

View File

@ -5,33 +5,38 @@ 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";
$header2 = "## Do not remove the line above! This tells Froxlor to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure Froxlor won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n";
$awstats_dir = \Froxlor\FileDir::makeCorrectDir($customerDocroot.'/awstats/'.$siteDomain.'/');
if (!is_dir($awstats_dir)) {
\Froxlor\FileDir::safe_exec('mkdir -p '.escapeshellarg($awstats_dir));
$awstats_dir = \Froxlor\FileDir::makeCorrectDir($customerDocroot . '/awstats/' . $siteDomain . '/');
if (! is_dir($awstats_dir)) {
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($awstats_dir));
}
// chown created folder, #258
self::makeChownWithNewStats($awstats_params);
// weird but could happen...
if (!is_dir(Settings::Get('system.awstats_conf'))) {
\Froxlor\FileDir::safe_exec('mkdir -p '.escapeshellarg(Settings::Get('system.awstats_conf')));
if (! is_dir(Settings::Get('system.awstats_conf'))) {
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(Settings::Get('system.awstats_conf')));
}
// These are the variables we will replace
$regex = array(
'/\{LOG_FILE\}/',
@ -47,82 +52,78 @@ class Statistics
$awstats_dir,
\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_conf'))
);
// File names
$domain_file = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.awstats_conf').'/awstats.' . $siteDomain . '.conf');
$model_file = \Froxlor\Froxlor::getInstallDir().'/templates/misc/awstats/awstats.froxlor.model.conf';
$domain_file = \Froxlor\FileDir::makeCorrectFile(Settings::Get('system.awstats_conf') . '/awstats.' . $siteDomain . '.conf');
$model_file = \Froxlor\Froxlor::getInstallDir() . '/templates/misc/awstats/awstats.froxlor.model.conf';
$model_file = \Froxlor\FileDir::makeCorrectFile($model_file);
// Test if the file exists
if (file_exists($domain_file)) {
// Check for the generated header - if this is a manual modification we won't update
$awstats_domain_conf = fopen($domain_file, 'r');
if (fgets($awstats_domain_conf, strlen($header)) != $header) {
fclose($awstats_domain_conf);
return;
}
// Close the file
fclose($awstats_domain_conf);
}
$awstats_domain_conf = fopen($domain_file, 'w');
$awstats_model_conf = fopen($model_file, 'r');
// Write the header
fwrite($awstats_domain_conf, $header);
fwrite($awstats_domain_conf, preg_replace($regex, $replace, $header2));
// Write the configuration file
while (($line = fgets($awstats_model_conf, 4096)) !== false) {
if (!preg_match('/^#/', $line)
&& trim($line) != ''
) {
fwrite($awstats_domain_conf, preg_replace($regex, $replace, $line));
}
if (! preg_match('/^#/', $line) && trim($line) != '') {
fwrite($awstats_domain_conf, preg_replace($regex, $replace, $line));
}
}
fclose($awstats_domain_conf);
fclose($awstats_model_conf);
}
/**
* chowns either awstats or webalizer folder,
* 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'
) {
$user = $row['loginname'];
$group = $row['loginname'];
} else {
$user = $row['guid'];
$group = $row['guid'];
}
// get correct directory
$dir = $row['documentroot'];
if (Settings::Get('system.awstats_enabled') == '1') {
$dir .= '/awstats/';
} else {
$dir .= '/webalizer/';
}
// only run chown if directory exists
if (file_exists($dir)) {
// run chown
\Froxlor\FileDir::safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
}
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 {
$user = $row['guid'];
$group = $row['guid'];
}
// get correct directory
$dir = $row['documentroot'];
if (Settings::Get('system.awstats_enabled') == '1') {
$dir .= '/awstats/';
} else {
$dir .= '/webalizer/';
}
// only run chown if directory exists
if (file_exists($dir)) {
// run chown
\Froxlor\FileDir::safe_exec('chown -R ' . escapeshellarg($user) . ':' . escapeshellarg($group) . ' ' . escapeshellarg(\Froxlor\FileDir::makeCorrectDir($dir)));
}
}
}

View File

@ -1,10 +1,8 @@
<?php
namespace Froxlor;
use Froxlor\Database\Database;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
@ -13,14 +11,14 @@ use Froxlor\Database\Database;
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @since 0.9.31
*
* @copyright (c) the authors
* @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @since 0.9.31
*
*/
/**
@ -28,12 +26,12 @@ use Froxlor\Database\Database;
*
* Interaction with settings from the db
*
* @copyright (c) the authors
* @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @copyright (c) the authors
* @author Michael Kaufmann <mkaufmann@nutime.de>
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @method static mixed Get ($setting = null) return a setting-value by its group and varname separated by a dot (group.varname)
* @method static boolean Set ($setting = null, $value = null, $instant_save = true) update a setting / set a new value
* @method static boolean IsInList ($setting = null, $entry = null) tests if a setting-value that i s a comma separated list contains an entry
@ -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,12 +74,13 @@ class Settings {
/**
* private constructor, reads in all settings
*/
private function __construct() {
private function __construct()
{
$this->_readSettings();
self::$_updatedata = array();
// prepare statement
self::$_updstmt = Database::prepare("
UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = :value
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = :value
WHERE `settinggroup` = :group AND `varname` = :varname
");
}
@ -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,11 +109,12 @@ 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,
'value' => $value
'group' => $group,
'varname' => $varname,
'value' => $value
);
Database::pexecute(self::$_updstmt, $upd_data);
}
@ -120,14 +122,16 @@ 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])) {
if (! isset($sstr[1])) {
return null;
}
$result = null;
@ -140,35 +144,40 @@ 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) {
$s=Settings::Get($setting);
if ($s==null) {
public function pIsInList($setting = null, $entry = null)
{
$s = Settings::Get($setting);
if ($s == null) {
return false;
}
$slist = explode(",",$s);
$slist = explode(",", $s);
return in_array($entry, $slist);
}
/**
* 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
$sstr = explode(".", $setting);
if (!isset($sstr[1])) {
if (! isset($sstr[1])) {
return false;
}
self::$_data[$sstr[0]][$sstr[1]] = $value;
@ -177,12 +186,12 @@ class Settings {
$this->_storeSetting($sstr[0], $sstr[1], $value);
} else {
// set temporary data for usage
if (!isset(self::$_data[$sstr[0]]) || !is_array(self::$_data[$sstr[0]])) {
if (! isset(self::$_data[$sstr[0]]) || ! is_array(self::$_data[$sstr[0]])) {
self::$_data[$sstr[0]] = array();
}
self::$_data[$sstr[0]][$sstr[1]] = $value;
// set update-data when invoking Flush()
if (!isset(self::$_updatedata[$sstr[0]]) || !is_array(self::$_updatedata[$sstr[0]])) {
if (! isset(self::$_updatedata[$sstr[0]]) || ! is_array(self::$_updatedata[$sstr[0]])) {
self::$_updatedata[$sstr[0]] = array();
}
self::$_updatedata[$sstr[0]][$sstr[1]] = $value;
@ -195,31 +204,33 @@ 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) {
// validate parameter
$sstr = explode(".", $setting);
if (!isset($sstr[1])) {
if (! isset($sstr[1])) {
return false;
}
// prepare statement
$ins_stmt = Database::prepare("
INSERT INTO `".TABLE_PANEL_SETTINGS."` SET
INSERT INTO `" . TABLE_PANEL_SETTINGS . "` SET
`settinggroup` = :group,
`varname` = :varname,
`value` = :value
");
$ins_data = array(
'group' => $sstr[0],
'varname' => $sstr[1],
'value' => $value
'group' => $sstr[0],
'varname' => $sstr[1],
'value' => $value
);
Database::pexecute($ins_stmt, $ins_data);
// also set new value to internal array and make it available
@ -233,7 +244,8 @@ class Settings {
* Store all un-saved changes to the database and
* 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

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

View File

@ -137,7 +137,7 @@ class Crypt
return $available_pwdhashes;
}
/**
* Function validatePassword
*
@ -145,78 +145,37 @@ 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);
}
}
return $password;
}
/**
* Function validatePasswordLogin
*
@ -225,22 +184,26 @@ 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');
$systype = (int) Settings::Get('system.passwordcryptfunc');
}
$pwd_hash = $userinfo['password'];
$update_hash = false;
// check for good'ole md5
if (strlen($pwd_hash) == 32 && ctype_xdigit($pwd_hash)) {
@ -254,34 +217,31 @@ class Crypt
// check whether the hash needs to be updated
$hash_type_chk = substr($pwd_hash, 0, 3);
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
) {
$update_hash = true;
}
($systype == 2 && $hash_type_chk != '$2$') || // BLOWFISH
($systype == 3 && $hash_type_chk != '$5$') || // SHA256
($systype == 4 && $hash_type_chk != '$6$')) // SHA512
{
$update_hash = true;
}
}
if ($pwd_hash == $pwd_check) {
// check for update of hash (only if our database is ready to handle the bigger string)
$is_ready = (version_compare2("0.9.33", \Froxlor\Froxlor::getVersion()) <= 0 ? true : false);
if ($update_hash && $is_ready) {
$upd_stmt = \Froxlor\Database\Database::prepare("
UPDATE " . $table . " SET `password` = :newpasswd WHERE `" . $uid . "` = :uid
");
$params = array (
$params = array(
'newpasswd' => self::makeCryptPassword($password),
'uid' => $userinfo[$uid]
);
\Froxlor\Database\Database::pexecute($upd_stmt, $params);
}
return true;
}
return false;
}
}

View File

@ -9,20 +9,22 @@ namespace Froxlor\UI;
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @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,46 +34,43 @@ 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;
}
if (!isset($section['nobuttons']) || $section['nobuttons'] == false) {
if (! isset($section['nobuttons']) || $section['nobuttons'] == false) {
eval("self::\$_form .= \"" . Template::getTemplate("misc/form/table_section", "1") . "\";");
} else {
$nob = true;
}
$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;
}
if ($nexto === false || (isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to'])) {
$label = $fielddata['label'];
$desc = (isset($fielddata['desc']) ? $fielddata['desc'] : '');
$style = (isset($fielddata['style']) ? ' class="'.$fielddata['style'].'"' : '');
$style = (isset($fielddata['style']) ? ' class="' . $fielddata['style'] . '"' : '');
$mandatory = self::_getMandatoryFlag($fielddata);
$data_field = self::_parseDataField($fieldname, $fielddata);
if (isset($fielddata['has_nextto'])) {
$nexto = array('field' => $fieldname);
$data_field.='{NEXTTOFIELD_'.$fieldname.'}';
$nexto = array(
'field' => $fieldname
);
$data_field .= '{NEXTTOFIELD_' . $fieldname . '}';
} else {
$nexto = false;
}
@ -79,12 +78,8 @@ class HtmlForm
} else {
$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
);
$data_field = $fielddata['next_to_prefix'] . $data_field;
self::$_form = str_replace('{NEXTTOFIELD_' . $fielddata['next_to'] . '}', $data_field, self::$_form);
$nexto = false;
}
}
@ -92,7 +87,7 @@ class HtmlForm
}
// add save/reset buttons at the end of the form
if (!$nob) {
if (! $nob) {
eval("self::\$_form .= \"" . Template::getTemplate("misc/form/table_end", "1") . "\";");
}
@ -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 '';
@ -145,14 +147,14 @@ class HtmlForm
{
$return = '';
$extras = '';
if(isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"';
if (isset($data['maxlength'])) {
$extras .= ' maxlength="' . $data['maxlength'] . '"';
}
if(isset($data['size'])) {
$extras .= ' size="'.$data['size'].'"';
if (isset($data['size'])) {
$extras .= ' size="' . $data['size'] . '"';
}
if(isset($data['autocomplete'])) {
$extras .= ' autocomplete="'.$data['autocomplete'].'"';
if (isset($data['autocomplete'])) {
$extras .= ' autocomplete="' . $data['autocomplete'] . '"';
}
// add support to save reloaded forms
@ -164,10 +166,9 @@ class HtmlForm
$value = '';
}
$ulfield = ($unlimited == true ? '&nbsp;'.$data['ul_field'] : '');
if(isset($data['display']) && $data['display'] != '')
{
$ulfield = '<strong>'.$data['display'].'</strong>';
$ulfield = ($unlimited == true ? '&nbsp;' . $data['ul_field'] : '');
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
eval("\$return = \"" . Template::getTemplate("misc/form/input_text", "1") . "\";");
@ -178,11 +179,11 @@ class HtmlForm
{
$return = '';
$extras = '';
if(isset($data['cols'])) {
$extras .= ' cols="'.$data['cols'].'"';
if (isset($data['cols'])) {
$extras .= ' cols="' . $data['cols'] . '"';
}
if(isset($data['rows'])) {
$extras .= ' rows="'.$data['rows'].'"';
if (isset($data['rows'])) {
$extras .= ' rows="' . $data['rows'] . '"';
}
// add support to save reloaded forms
@ -221,12 +222,10 @@ class HtmlForm
}
return '<select
id="'.$fieldname.'"
name="'.$fieldname.'"
'.(isset($data['class']) ? ' class="'.$data['class'] .'" ' : '').'
>'
.$select_var.
'</select>';
id="' . $fieldname . '"
name="' . $fieldname . '"
' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . '
>' . $select_var . '</select>';
}
/**
@ -234,32 +233,36 @@ class HtmlForm
*
* <code>
* $data = array(
* 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox',
* 'values' => array(
* array( 'label' => 'active',
* 'value' => '1'
* )
* ),
* 'value' => array('1'),
* 'mandatory' => true
* )
* 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox',
* 'values' => array(
* array( 'label' => 'active',
* 'value' => '1'
* )
* ),
* 'value' => array('1'),
* 'mandatory' => true
* )
* </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'];
}
if (isset($_SESSION['requestData'])) {
if(isset($_SESSION['requestData'][$fieldname])) {
$checked = array($_SESSION['requestData'][$fieldname]);
if (isset($_SESSION['requestData'][$fieldname])) {
$checked = array(
$_SESSION['requestData'][$fieldname]
);
}
}
@ -272,12 +275,12 @@ class HtmlForm
// will contain the output
$output = "";
foreach($data['values'] as $val) {
foreach ($data['values'] as $val) {
$key = $val['label'];
// is this box checked?
$isChecked = '';
if (is_array($checked) && count($checked) > 0) {
foreach($checked as $tmp) {
foreach ($checked as $tmp) {
if ($tmp == $val['value']) {
$isChecked = ' checked="checked" ';
break;
@ -286,10 +289,10 @@ class HtmlForm
}
$output .= '<label>';
if (empty($isArray)) {
$output .= '<input type="hidden" name="'.$fieldname.'" value="0" />';
$output .= '<input type="hidden" name="' . $fieldname . '" value="0" />';
}
$output .= '<input type="checkbox" name="'.$fieldname.$isArray.'" value="'.$val['value'].'" '.$isChecked.'/>';
$output .= $key.'</label>';
$output .= '<input type="checkbox" name="' . $fieldname . $isArray . '" value="' . $val['value'] . '" ' . $isChecked . '/>';
$output .= $key . '</label>';
}
return $output;
@ -299,8 +302,8 @@ class HtmlForm
{
$return = '';
$extras = '';
if(isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"';
if (isset($data['maxlength'])) {
$extras .= ' maxlength="' . $data['maxlength'] . '"';
}
// add support to save reloaded forms
@ -312,9 +315,8 @@ class HtmlForm
$value = '';
}
if(isset($data['display']) && $data['display'] != '')
{
$ulfield = '<strong>'.$data['display'].'</strong>';
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
eval("\$return = \"" . Template::getTemplate("misc/form/input_file", "1") . "\";");
@ -325,11 +327,11 @@ class HtmlForm
{
$return = '';
$extras = '';
if(isset($data['int_min'])) {
$extras .= ' min="'.$data['int_min'].'"';
if (isset($data['int_min'])) {
$extras .= ' min="' . $data['int_min'] . '"';
}
if(isset($data['int_max'])) {
$extras .= ' max="'.$data['int_max'].'"';
if (isset($data['int_max'])) {
$extras .= ' max="' . $data['int_max'] . '"';
}
// add support to save reloaded forms

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

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,46 +33,43 @@ 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;
}
if (!isset($section['nobuttons']) || $section['nobuttons'] == false) {
if (! isset($section['nobuttons']) || $section['nobuttons'] == false) {
eval("self::\$_form .= \"" . getTemplate("misc/form/table_section", "1") . "\";");
} else {
$nob = true;
}
$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;
}
if ($nexto === false || (isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to'])) {
$label = $fielddata['label'];
$desc = (isset($fielddata['desc']) ? $fielddata['desc'] : '');
$style = (isset($fielddata['style']) ? ' class="'.$fielddata['style'].'"' : '');
$style = (isset($fielddata['style']) ? ' class="' . $fielddata['style'] . '"' : '');
$mandatory = self::_getMandatoryFlag($fielddata);
$data_field = self::_parseDataField($fieldname, $fielddata);
if (isset($fielddata['has_nextto'])) {
$nexto = array('field' => $fieldname);
$data_field.='{NEXTTOFIELD_'.$fieldname.'}';
$nexto = array(
'field' => $fieldname
);
$data_field .= '{NEXTTOFIELD_' . $fieldname . '}';
} else {
$nexto = false;
}
@ -78,12 +77,8 @@ class htmlform
} else {
$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
);
$data_field = $fielddata['next_to_prefix'] . $data_field;
self::$_form = str_replace('{NEXTTOFIELD_' . $fielddata['next_to'] . '}', $data_field, self::$_form);
$nexto = false;
}
}
@ -91,7 +86,7 @@ class htmlform
}
// add save/reset buttons at the end of the form
if (!$nob) {
if (! $nob) {
eval("self::\$_form .= \"" . getTemplate("misc/form/table_end", "1") . "\";");
}
@ -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 '';
@ -144,14 +146,14 @@ class htmlform
{
$return = '';
$extras = '';
if(isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"';
if (isset($data['maxlength'])) {
$extras .= ' maxlength="' . $data['maxlength'] . '"';
}
if(isset($data['size'])) {
$extras .= ' size="'.$data['size'].'"';
if (isset($data['size'])) {
$extras .= ' size="' . $data['size'] . '"';
}
if(isset($data['autocomplete'])) {
$extras .= ' autocomplete="'.$data['autocomplete'].'"';
if (isset($data['autocomplete'])) {
$extras .= ' autocomplete="' . $data['autocomplete'] . '"';
}
// add support to save reloaded forms
@ -163,10 +165,9 @@ class htmlform
$value = '';
}
$ulfield = ($unlimited == true ? '&nbsp;'.$data['ul_field'] : '');
if(isset($data['display']) && $data['display'] != '')
{
$ulfield = '<strong>'.$data['display'].'</strong>';
$ulfield = ($unlimited == true ? '&nbsp;' . $data['ul_field'] : '');
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
eval("\$return = \"" . getTemplate("misc/form/input_text", "1") . "\";");
@ -177,11 +178,11 @@ class htmlform
{
$return = '';
$extras = '';
if(isset($data['cols'])) {
$extras .= ' cols="'.$data['cols'].'"';
if (isset($data['cols'])) {
$extras .= ' cols="' . $data['cols'] . '"';
}
if(isset($data['rows'])) {
$extras .= ' rows="'.$data['rows'].'"';
if (isset($data['rows'])) {
$extras .= ' rows="' . $data['rows'] . '"';
}
// add support to save reloaded forms
@ -220,12 +221,10 @@ class htmlform
}
return '<select
id="'.$fieldname.'"
name="'.$fieldname.'"
'.(isset($data['class']) ? ' class="'.$data['class'] .'" ' : '').'
>'
.$select_var.
'</select>';
id="' . $fieldname . '"
name="' . $fieldname . '"
' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . '
>' . $select_var . '</select>';
}
/**
@ -233,32 +232,36 @@ class htmlform
*
* <code>
* $data = array(
* 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox',
* 'values' => array(
* array( 'label' => 'active',
* 'value' => '1'
* )
* ),
* 'value' => array('1'),
* 'mandatory' => true
* )
* 'label' => $lng['customer']['email_imap'],
* 'type' => 'checkbox',
* 'values' => array(
* array( 'label' => 'active',
* 'value' => '1'
* )
* ),
* 'value' => array('1'),
* 'mandatory' => true
* )
* </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'];
}
if (isset($_SESSION['requestData'])) {
if(isset($_SESSION['requestData'][$fieldname])) {
$checked = array($_SESSION['requestData'][$fieldname]);
if (isset($_SESSION['requestData'][$fieldname])) {
$checked = array(
$_SESSION['requestData'][$fieldname]
);
}
}
@ -271,12 +274,12 @@ class htmlform
// will contain the output
$output = "";
foreach($data['values'] as $val) {
foreach ($data['values'] as $val) {
$key = $val['label'];
// is this box checked?
$isChecked = '';
if (is_array($checked) && count($checked) > 0) {
foreach($checked as $tmp) {
foreach ($checked as $tmp) {
if ($tmp == $val['value']) {
$isChecked = ' checked="checked" ';
break;
@ -285,10 +288,10 @@ class htmlform
}
$output .= '<label>';
if (empty($isArray)) {
$output .= '<input type="hidden" name="'.$fieldname.'" value="0" />';
$output .= '<input type="hidden" name="' . $fieldname . '" value="0" />';
}
$output .= '<input type="checkbox" name="'.$fieldname.$isArray.'" value="'.$val['value'].'" '.$isChecked.'/>';
$output .= $key.'</label>';
$output .= '<input type="checkbox" name="' . $fieldname . $isArray . '" value="' . $val['value'] . '" ' . $isChecked . '/>';
$output .= $key . '</label>';
}
return $output;
@ -298,8 +301,8 @@ class htmlform
{
$return = '';
$extras = '';
if(isset($data['maxlength'])) {
$extras .= ' maxlength="'.$data['maxlength'].'"';
if (isset($data['maxlength'])) {
$extras .= ' maxlength="' . $data['maxlength'] . '"';
}
// add support to save reloaded forms
@ -311,9 +314,8 @@ class htmlform
$value = '';
}
if(isset($data['display']) && $data['display'] != '')
{
$ulfield = '<strong>'.$data['display'].'</strong>';
if (isset($data['display']) && $data['display'] != '') {
$ulfield = '<strong>' . $data['display'] . '</strong>';
}
eval("\$return = \"" . getTemplate("misc/form/input_file", "1") . "\";");
@ -324,11 +326,11 @@ class htmlform
{
$return = '';
$extras = '';
if(isset($data['int_min'])) {
$extras .= ' min="'.$data['int_min'].'"';
if (isset($data['int_min'])) {
$extras .= ' min="' . $data['int_min'] . '"';
}
if(isset($data['int_max'])) {
$extras .= ' max="'.$data['int_max'].'"';
if (isset($data['int_max'])) {
$extras .= ' max="' . $data['int_max'] . '"';
}
// add support to save reloaded forms

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
@ -132,7 +157,7 @@ class linker {
// Loop through arguments and add them to the link
foreach ($this->args as $key => $value) {
// For all but the first argument, prepend "&amp;"
if (substr($link, -1) != "?") {
if (substr($link, - 1) != "?") {
$link .= "&";
}

View File

@ -19,91 +19,113 @@
/**
* 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;
private $_limit = 0;
/**
* 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'
* 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'
*
*/
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
@ -113,7 +135,7 @@ class paging {
$this->userinfo = $userinfo;
if (!is_array($this->userinfo['lastpaging'])) {
if (! is_array($this->userinfo['lastpaging'])) {
$this->userinfo['lastpaging'] = json_decode($this->userinfo['lastpaging'], true);
}
@ -124,21 +146,12 @@ class paging {
$checklastpaging = (isset($this->userinfo['lastpaging']['table']) && $this->userinfo['lastpaging']['table'] == $this->table);
$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;
@ -232,17 +224,18 @@ class paging {
'adminsession' => $userinfo['adminsession']
);
\Froxlor\Database\Database::pexecute($upd_stmt, $upd_data);
$this->_limit = $limit;
}
/**
* 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 ';
@ -280,8 +277,8 @@ class paging {
$searchfield = explode('.', $this->searchfield);
foreach ($searchfield as $id => $field) {
if (substr($field, -1, 1) != '`') {
$field.= '`';
if (substr($field, - 1, 1) != '`') {
$field .= '`';
}
if ($field{0} != '`') {
@ -292,9 +289,13 @@ class paging {
}
$searchfield = implode('.', $searchfield);
$ops = array('<', '>', '=');
$ops = array(
'<',
'>',
'='
);
// check if we use an operator or not
$useOper = 0;
$oper = "=";
@ -302,32 +303,32 @@ class paging {
$useOper = 1;
$oper = substr($this->searchtext, 0, 1);
}
// check for diskspace and whether searchtext is a number
// in any other case the logical-operators would make no sense
if (strpos($searchfield, 'diskspace') > 0 && is_numeric(substr($this->searchtext, $useOper))) {
// anything with diskspace is *1024
$searchtext = ((int)substr($this->searchtext, $useOper))*1024;
$searchtext = ((int) substr($this->searchtext, $useOper)) * 1024;
$useOper = 1;
} elseif (strpos($searchfield, 'traffic') > 0 && is_numeric(substr($this->searchtext, $useOper))) {
// anything with traffic is *1024*1024
$searchtext = ((int)substr($this->searchtext, $useOper))*1024*1024;
$searchtext = ((int) substr($this->searchtext, $useOper)) * 1024 * 1024;
$useOper = 1;
} else {
// any other field
$searchtext = substr($this->searchtext, $useOper);
}
if ($useOper == 1 && is_numeric(substr($this->searchtext, $useOper))) {
// now as we use >, < or = we use the given operator and not LIKE
$condition.= $searchfield . " ".$oper." " . \Froxlor\Database\Database::quote($searchtext);
$condition .= $searchfield . " " . $oper . " " . \Froxlor\Database\Database::quote($searchtext);
} else {
$searchtext = str_replace('*', '%', $this->searchtext);
// append wildcards if user did not enter any
if (strpos($searchtext,'%') === false) $searchtext='%'.$searchtext.'%';
$condition.= $searchfield . " LIKE " . \Froxlor\Database\Database::quote($searchtext);
if (strpos($searchtext, '%') === false)
$searchtext = '%' . $searchtext . '%';
$condition .= $searchfield . " LIKE " . \Froxlor\Database\Database::quote($searchtext);
}
} else {
$condition = '';
}
@ -338,15 +339,16 @@ 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) != '`') {
$field.= '`';
if (substr($field, - 1, 1) != '`') {
$field .= '`';
}
if ($field{0} != '`') {
@ -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,11 +381,11 @@ 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;
return ' LIMIT ' . $_offset . ',' . $this->_limit;
}
/**
* currently not in use
@ -396,22 +396,26 @@ 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 = '';
foreach ($this->fields as $fieldname => $fieldcaption) {
$fieldoptions.= makeoption($fieldcaption, $fieldname, $this->sortfield, true, true);
$fieldoptions .= makeoption($fieldcaption, $fieldname, $this->sortfield, true, true);
}
$breakorws = ($break ? '<br />' : '&nbsp;');
foreach (array('asc' => $lng['panel']['ascending'], 'desc' => $lng['panel']['descending']) as $sortordertype => $sortorderdescription) {
$orderoptions.= makeoption($sortorderdescription, $sortordertype, $this->sortorder, true, true);
foreach (array(
'asc' => $lng['panel']['ascending'],
'desc' => $lng['panel']['descending']
) as $sortordertype => $sortorderdescription) {
$orderoptions .= makeoption($sortorderdescription, $sortordertype, $this->sortorder, true, true);
}
eval("\$sortcode =\"" . getTemplate("misc/htmlsortcode", '1') . "\";");
@ -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,16 +454,17 @@ 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);
foreach ($this->fields as $fieldname => $fieldcaption) {
$fieldoptions.= makeoption($fieldcaption, $fieldname, $this->searchfield, true, true);
$fieldoptions .= makeoption($fieldcaption, $fieldname, $this->searchfield, true, true);
}
eval("\$searchcode =\"" . getTemplate("misc/htmlsearchcode", '1') . "\";");
return $searchcode;
@ -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 {
@ -479,7 +486,7 @@ class paging {
}
if ($this->entries % $this->entriesperpage != 0) {
$pages++;
$pages ++;
}
if ($pages > 1) {
@ -495,14 +502,14 @@ class paging {
}
$pagingcode = '<a href="' . htmlspecialchars($baseurl) . '&amp;pageno=1">&laquo;</a> <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) - 1) == 0 ? '1' : intval($this->pageno) - 1) . '">&lt;</a>&nbsp;';
for ($i = $start;$i <= $stop;$i++) {
for ($i = $start; $i <= $stop; $i ++) {
if ($i != $this->pageno) {
$pagingcode.= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . $i . '">' . $i . '</a>&nbsp;';
$pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . $i . '">' . $i . '</a>&nbsp;';
} else {
$pagingcode.= ' <strong>' . $i . '</strong>&nbsp;';
$pagingcode .= ' <strong>' . $i . '</strong>&nbsp;';
}
}
$pagingcode.= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) + 1) > $pages ? $pages : intval($this->pageno) + 1) . '">&gt;</a> <a href="' . $baseurl . '&amp;pageno=' . $pages . '">&raquo;</a>';
$pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) + 1) > $pages ? $pages : intval($this->pageno) + 1) . '">&gt;</a> <a href="' . $baseurl . '&amp;pageno=' . $pages . '">&raquo;</a>';
} else {
$pagingcode = '';
}

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
@ -3858,12 +3867,13 @@ aliases: files
<content><![CDATA[# remove "-D PHP5" from /etc/conf.d/apache2]]></content>
</command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<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">
@ -3896,7 +3906,7 @@ aliases: files
</visibility>
<command><![CDATA[# remove "-D PHP5" from /etc/conf.d/apache2]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

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
@ -4722,12 +4739,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php5]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<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>
@ -4765,7 +4783,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

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
@ -1721,12 +1734,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php5]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<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>
@ -1764,7 +1778,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

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
@ -4622,12 +4633,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.0]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<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>
@ -4659,7 +4671,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

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
@ -1735,12 +1747,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php5]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<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>
@ -1778,7 +1791,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

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
@ -4633,12 +4644,13 @@ aliases: files
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.0]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<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>
@ -4670,7 +4682,7 @@ aliases: files
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.\Froxlor\Froxlor::getInstallDir()}}/scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>

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,8 +95,11 @@ 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()
),
'customers' => array(
@ -109,8 +114,11 @@ 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()
),
'domains' => array(
@ -125,16 +133,22 @@ 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()
),
'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()
),
'diskspace' => array(

View File

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

View File

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

View File

@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'customer_edit' => array(
'title' => $lng['admin']['customer_edit'],
@ -35,23 +34,33 @@ return array(
'value' => $result['documentroot']
),
'createstdsubdomain' => array(
'label' => $lng['admin']['stdsubdomain_add'].'?',
'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'].')',
'label' => $lng['login']['password'] . '&nbsp;(' . $lng['panel']['emptyfornochanges'] . ')',
'type' => 'password',
'autocomplete' => 'off'
),
@ -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,14 +153,19 @@ 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']
)
)
)
),
'section_cpre' => array(
'visible' => !empty($hosting_plans),
'visible' => ! empty($hosting_plans),
'title' => $lng['admin']['plans']['use_plan'],
'image' => 'icons/user_add.png',
'fields' => array(
@ -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(
@ -257,36 +281,51 @@ return array(
'ul_field' => $mysqls_ul
),
'phpenabled' => array(
'label' => $lng['admin']['phpenabled'].'?',
'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),
'label' => $lng['admin']['phpsettings']['title'],
'type' => 'checkbox',
'values' => $phpconfigs,
'value' => isset($result['allowed_phpconfigs']) && !empty($result['allowed_phpconfigs']) ? json_decode($result['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY) : array(),
'value' => isset($result['allowed_phpconfigs']) && ! empty($result['allowed_phpconfigs']) ? json_decode($result['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY) : array(),
'is_array' => 1
),
'perlenabled' => array(
'label' => $lng['admin']['perlenabled'].'?',
'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'].'?',
'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'
)
)
)
),
@ -216,7 +220,7 @@ return array(
'desc' => $lng['admin']['domain_http2']['description'],
'type' => 'checkbox',
'values' => array(
array (
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
@ -265,22 +269,18 @@ 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 (
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'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']
)
)
)
),
@ -252,7 +256,7 @@ return array(
'desc' => $lng['admin']['domain_http2']['description'],
'type' => 'checkbox',
'values' => array(
array (
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
@ -307,16 +311,12 @@ 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 (
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
@ -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'],
@ -40,30 +39,45 @@ return array(
'image' => 'icons/ipsports_add.png',
'fields' => array(
'listen_statement' => array(
'visible' => !$is_nginx,
'visible' => ! $is_nginx,
'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,
'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'],
@ -42,30 +41,45 @@ return array(
'image' => 'icons/ipsports_edit.png',
'fields' => array(
'listen_statement' => array(
'visible' => !$is_nginx,
'visible' => ! $is_nginx,
'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,
'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'],
@ -60,19 +59,22 @@ return array(
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'type' => 'text'
),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => '022'
),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => '022'
),
'phpfpm_enable_slowlog' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'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()
),
@ -118,49 +126,49 @@ return array(
'max_children' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 1
),
'start_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 20
),
'min_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 5
),
'max_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 35
),
'max_requests' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 0
),
'idle_timeout' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 30
),
'limit_extensions' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'text',
'value' => '.php'
),

View File

@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'phpconfig_edit' => array(
'title' => $lng['admin']['phpsettings']['editsettings'],
@ -55,29 +54,34 @@ return array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_starter']['title'],
'type' => 'text',
'value' => ((int)$result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
'value' => ((int) $result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
),
'mod_fcgid_maxrequests' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
'type' => 'text',
'value' => ((int)$result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
'value' => ((int) $result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => $result['mod_fcgid_umask']
),
'mod_fcgid_umask' => array(
'visible' => (\Froxlor\Settings::Get('system.mod_fcgid') == 1 ? true : false),
'label' => $lng['admin']['mod_fcgid_umask']['title'],
'type' => 'text',
'maxlength' => 3,
'value' => $result['mod_fcgid_umask']
),
'phpfpm_enable_slowlog' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'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),
@ -120,49 +134,49 @@ return array(
'max_children' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['max_children']
),
'start_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['start_servers']
),
'min_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['min_spare_servers']
),
'max_spare_servers' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['max_spare_servers']
),
'max_requests' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['max_requests']
),
'idle_timeout' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['idle_timeout']
),
'limit_extensions' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'text',
'value' => $result['limit_extensions']
),

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'],
@ -45,7 +44,7 @@ return array(
'ssl_cert_chainfile' => array(
'style' => 'align-top',
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile_content'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'].$lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'] . $lng['admin']['ipsandports']['ssl_cert_chainfile_content_desc'],
'type' => 'textarea',
'cols' => 100,
'rows' => 15,
@ -54,7 +53,7 @@ return array(
'ssl_ca_file' => array(
'style' => 'align-top',
'label' => $lng['admin']['ipsandports']['ssl_ca_file_content'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'].$lng['admin']['ipsandports']['ssl_ca_file_content_desc'],
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'] . $lng['admin']['ipsandports']['ssl_ca_file_content_desc'],
'type' => 'textarea',
'cols' => 100,
'rows' => 15,

View File

@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'domain_add' => array(
'title' => $lng['domains']['subdomain_add'],
@ -43,7 +42,7 @@ return array(
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null).(isset($pathSelect['note']) ? $pathSelect['note'].'<br />'.$pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? $pathSelect['note'] . '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
@ -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'],
@ -42,7 +41,7 @@ return array(
),
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? '<br />' . $pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']
@ -68,13 +67,18 @@ return array(
'select_var' => $serveraliasoptions
),
'isemaildomain' => array(
'visible' => ((( $result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2' ) && $result['parentdomainid'] != '0') ? true : false),
'visible' => ((($result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2') && $result['parentdomainid'] != '0') ? true : false),
'label' => 'Emaildomain',
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['isemaildomain'])
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'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')
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array($result['hsts_preload'])
),
'value' => array(
$result['hsts_preload']
)
)
)
),
)
)
)
);

View File

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

View File

@ -14,7 +14,6 @@
* @package Formfields
*
*/
return array(
'emails_add' => array(
'title' => $lng['emails']['emails_add'],
@ -40,8 +39,11 @@ 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'],

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