diff --git a/.gitignore b/.gitignore index f68799ba..8c981d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ logs/* !templates/Sparkle/ !templates/misc/ templates/Froxlor/assets/img/logo_custom.png +vendor/ diff --git a/2fa.php b/2fa.php index 9be0d70d..fe02e19d 100644 --- a/2fa.php +++ b/2fa.php @@ -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']); } diff --git a/actions/admin/settings/100.panel.php b/actions/admin/settings/100.panel.php index cae04cf9..d3a11445 100644 --- a/actions/admin/settings/100.panel.php +++ b/actions/admin/settings/100.panel.php @@ -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' + ) + ) + ) + ) +); ?> diff --git a/actions/admin/settings/110.accounts.php b/actions/admin/settings/110.accounts.php index 42e0b7be..71628dec 100644 --- a/actions/admin/settings/110.accounts.php +++ b/actions/admin/settings/110.accounts.php @@ -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' - ), - ), - ), + ) + ) + ) ) ); diff --git a/actions/admin/settings/125.cronjob.php b/actions/admin/settings/125.cronjob.php index 9a7eb49d..66a72754 100644 --- a/actions/admin/settings/125.cronjob.php +++ b/actions/admin/settings/125.cronjob.php @@ -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' + ) ) ) ) diff --git a/actions/admin/settings/137.perl.php b/actions/admin/settings/137.perl.php index 57681bad..9244fec2 100644 --- a/actions/admin/settings/137.perl.php +++ b/actions/admin/settings/137.perl.php @@ -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' + ) + ) + ) + ) + ) +); ?> diff --git a/actions/admin/settings/140.statistics.php b/actions/admin/settings/140.statistics.php index dbb48518..badf3f8c 100644 --- a/actions/admin/settings/140.statistics.php +++ b/actions/admin/settings/140.statistics.php @@ -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' ) ) ) - ); + ) +); ?> \ No newline at end of file diff --git a/actions/admin/settings/150.mail.php b/actions/admin/settings/150.mail.php index b5ce0522..260471d2 100644 --- a/actions/admin/settings/150.mail.php +++ b/actions/admin/settings/150.mail.php @@ -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' + ) + ) + ) + ) +); ?> diff --git a/actions/admin/settings/155.ftpserver.php b/actions/admin/settings/155.ftpserver.php index 8f7eab9b..e6797127 100644 --- a/actions/admin/settings/155.ftpserver.php +++ b/actions/admin/settings/155.ftpserver.php @@ -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' + ) + ) + ) ) ); diff --git a/actions/admin/settings/160.nameserver.php b/actions/admin/settings/160.nameserver.php index 40cc54b2..54ac6314 100644 --- a/actions/admin/settings/160.nameserver.php +++ b/actions/admin/settings/160.nameserver.php @@ -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' + ) + ) + ) + ) +); diff --git a/actions/admin/settings/170.logger.php b/actions/admin/settings/170.logger.php index 2b0e730d..023a5ce3 100644 --- a/actions/admin/settings/170.logger.php +++ b/actions/admin/settings/170.logger.php @@ -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' + ) + ) ) - ); + ) +); ?> diff --git a/actions/admin/settings/180.dkim.php b/actions/admin/settings/180.dkim.php index 33135365..0027af48 100644 --- a/actions/admin/settings/180.dkim.php +++ b/actions/admin/settings/180.dkim.php @@ -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' + ) + ) + ) + ) +); ?> diff --git a/actions/admin/settings/185.spf.php b/actions/admin/settings/185.spf.php index 55a44782..9d0fbcee 100644 --- a/actions/admin/settings/185.spf.php +++ b/actions/admin/settings/185.spf.php @@ -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' - ) ) ) ) - ); + ) +); ?> diff --git a/actions/admin/settings/210.security.php b/actions/admin/settings/210.security.php index 868a1525..62542c67 100644 --- a/actions/admin/settings/210.security.php +++ b/actions/admin/settings/210.security.php @@ -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' ) ) ) - ); + ) +); diff --git a/actions/admin/settings/220.quota.php b/actions/admin/settings/220.quota.php index 52e94379..cf79b4e1 100644 --- a/actions/admin/settings/220.quota.php +++ b/actions/admin/settings/220.quota.php @@ -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' + ) + ) + ) + ) +); ?> diff --git a/admin_apcuinfo.php b/admin_apcuinfo.php index a1b145cf..57f3cba7 100644 --- a/admin_apcuinfo.php +++ b/admin_apcuinfo.php @@ -1,415 +1,440 @@ | - | Rasmus Lerdorf | - | Ilia Alshanetsky | - +----------------------------------------------------------------------+ - - 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 - + * +----------------------------------------------------------------------+ + * | 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 | + * | Rasmus Lerdorf | + * | Ilia Alshanetsky | + * +----------------------------------------------------------------------+ + * + * 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 + * */ - 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); + } + } } diff --git a/admin_autoupdate.php b/admin_autoupdate.php index 37ff9edf..c71238f2 100644 --- a/admin_autoupdate.php +++ b/admin_autoupdate.php @@ -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 . '&page=extract&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 diff --git a/admin_configfiles.php b/admin_configfiles.php index 30f09fa1..ce96d2c5 100644 --- a/admin_configfiles.php +++ b/admin_configfiles.php @@ -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(); diff --git a/admin_ipsandports.php b/admin_ipsandports.php index dc4edc94..929dcf11 100644 --- a/admin_ipsandports.php +++ b/admin_ipsandports.php @@ -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") . "\";"); } } diff --git a/admin_logger.php b/admin_logger.php index fdd6bf48..a3b1e3cc 100644 --- a/admin_logger.php +++ b/admin_logger.php @@ -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); } } } diff --git a/admin_message.php b/admin_message.php index 8710d006..c2a730f4 100644 --- a/admin_message.php +++ b/admin_message.php @@ -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); diff --git a/admin_opcacheinfo.php b/admin_opcacheinfo.php index 7b71ce11..0224a357 100644 --- a/admin_opcacheinfo.php +++ b/admin_opcacheinfo.php @@ -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); } diff --git a/admin_phpsettings.php b/admin_phpsettings.php index ecc23757..7fed6060 100644 --- a/admin_phpsettings.php +++ b/admin_phpsettings.php @@ -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 . "
"; } - $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 . "
"; } - $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 { diff --git a/admin_templates.php b/admin_templates.php index ca090bcb..0f011077 100644 --- a/admin_templates.php +++ b/admin_templates.php @@ -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'); } diff --git a/admin_traffic.php b/admin_traffic.php index a48149ee..95dd97fe 100644 --- a/admin_traffic.php +++ b/admin_traffic.php @@ -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") . "\");"); diff --git a/admin_updates.php b/admin_updates.php index 8707b6b4..5b8e3966 100644 --- a/admin_updates.php +++ b/admin_updates.php @@ -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; diff --git a/api.php b/api.php index f27b1f0e..6561341d 100644 --- a/api.php +++ b/api.php @@ -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(); diff --git a/api_keys.php b/api_keys.php index 7cb534db..6022c50a 100644 --- a/api_keys.php +++ b/api_keys.php @@ -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); diff --git a/build.xml b/build.xml index 821b7eeb..2ecf5ddc 100644 --- a/build.xml +++ b/build.xml @@ -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" /> - - + @@ -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."> - + @@ -204,7 +207,8 @@ - + @@ -215,9 +219,11 @@ - - + diff --git a/composer.json b/composer.json index 9093a729..441f13f2 100644 --- a/composer.json +++ b/composer.json @@ -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" ] } diff --git a/css/jquery-ui.min.css b/css/jquery-ui.min.css index 8a59b9db..dc84872d 100644 --- a/css/jquery-ui.min.css +++ b/css/jquery-ui.min.css @@ -3,5 +3,1891 @@ * Includes: draggable.css, core.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css * To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=base&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cc0000&fcError=5f3f3f&borderColorError=f1a899&bgTextureError=flat&bgColorError=fddfdf&iconColorHighlight=777620&fcHighlight=777620&borderColorHighlight=dad55e&bgTextureHighlight=flat&bgColorHighlight=fffa90&iconColorActive=ffffff&fcActive=ffffff&borderColorActive=003eff&bgTextureActive=flat&bgColorActive=007fff&iconColorHover=555555&fcHover=2b2b2b&borderColorHover=cccccc&bgTextureHover=flat&bgColorHover=ededed&iconColorDefault=777777&fcDefault=454545&borderColorDefault=c5c5c5&bgTextureDefault=flat&bgColorDefault=f6f6f6&iconColorContent=444444&fcContent=333333&borderColorContent=dddddd&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=444444&fcHeader=333333&borderColorHeader=dddddd&bgTextureHeader=flat&bgColorHeader=e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif * Copyright jQuery Foundation and other contributors; Licensed MIT */ +.ui-draggable-handle { + -ms-touch-action: none; + touch-action: none +} -.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666} \ No newline at end of file +.ui-helper-hidden { + display: none +} + +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0, 0, 0, 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none +} + +.ui-helper-clearfix:before, .ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse +} + +.ui-helper-clearfix:after { + clear: both +} + +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter: Alpha(Opacity = 0) +} + +.ui-front { + z-index: 100 +} + +.ui-state-disabled { + cursor: default !important; + pointer-events: none +} + +.ui-icon { + display: inline-block; + vertical-align: middle; + margin-top: -.25em; + position: relative; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat +} + +.ui-widget-icon-block { + left: 50%; + margin-left: -8px; + display: block +} + +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.ui-resizable { + position: relative +} + +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; + -ms-touch-action: none; + touch-action: none +} + +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle + { + display: none +} + +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0 +} + +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0 +} + +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100% +} + +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100% +} + +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px +} + +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px +} + +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px +} + +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px +} + +.ui-selectable { + -ms-touch-action: none; + touch-action: none +} + +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black +} + +.ui-sortable-handle { + -ms-touch-action: none; + touch-action: none +} + +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin: 2px 0 0 0; + padding: .5em .5em .5em .7em; + font-size: 100% +} + +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto +} + +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default +} + +.ui-menu { + list-style: none; + padding: 0; + margin: 0; + display: block; + outline: 0 +} + +.ui-menu .ui-menu { + position: absolute +} + +.ui-menu .ui-menu-item { + margin: 0; + cursor: pointer; + list-style-image: + url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7") +} + +.ui-menu .ui-menu-item-wrapper { + position: relative; + padding: 3px 1em 3px .4em +} + +.ui-menu .ui-menu-divider { + margin: 5px 0; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0 +} + +.ui-menu .ui-state-focus, .ui-menu .ui-state-active { + margin: -1px +} + +.ui-menu-icons { + position: relative +} + +.ui-menu-icons .ui-menu-item-wrapper { + padding-left: 2em +} + +.ui-menu .ui-icon { + position: absolute; + top: 0; + bottom: 0; + left: .2em; + margin: auto 0 +} + +.ui-menu .ui-menu-icon { + left: auto; + right: 0 +} + +.ui-button { + padding: .4em 1em; + display: inline-block; + position: relative; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + overflow: visible +} + +.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, + .ui-button:active { + text-decoration: none +} + +.ui-button-icon-only { + width: 2em; + box-sizing: border-box; + text-indent: -9999px; + white-space: nowrap +} + +input.ui-button.ui-button-icon-only { + text-indent: 0 +} + +.ui-button-icon-only .ui-icon { + position: absolute; + top: 50%; + left: 50%; + margin-top: -8px; + margin-left: -8px +} + +.ui-button.ui-icon-notext .ui-icon { + padding: 0; + width: 2.1em; + height: 2.1em; + text-indent: -9999px; + white-space: nowrap +} + +input.ui-button.ui-icon-notext .ui-icon { + width: auto; + height: auto; + text-indent: 0; + white-space: normal; + padding: .4em 1em +} + +input.ui-button::-moz-focus-inner, button.ui-button::-moz-focus-inner { + border: 0; + padding: 0 +} + +.ui-controlgroup { + vertical-align: middle; + display: inline-block +} + +.ui-controlgroup>.ui-controlgroup-item { + float: left; + margin-left: 0; + margin-right: 0 +} + +.ui-controlgroup>.ui-controlgroup-item:focus, .ui-controlgroup>.ui-controlgroup-item.ui-visual-focus + { + z-index: 9999 +} + +.ui-controlgroup-vertical>.ui-controlgroup-item { + display: block; + float: none; + width: 100%; + margin-top: 0; + margin-bottom: 0; + text-align: left +} + +.ui-controlgroup-vertical .ui-controlgroup-item { + box-sizing: border-box +} + +.ui-controlgroup .ui-controlgroup-label { + padding: .4em 1em +} + +.ui-controlgroup .ui-controlgroup-label span { + font-size: 80% +} + +.ui-controlgroup-horizontal .ui-controlgroup-label+.ui-controlgroup-item + { + border-left: none +} + +.ui-controlgroup-vertical .ui-controlgroup-label+.ui-controlgroup-item { + border-top: none +} + +.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { + border-right: none +} + +.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { + border-bottom: none +} + +.ui-controlgroup-vertical .ui-spinner-input { + width: 75%; + width: calc(100% - 2.4em) +} + +.ui-controlgroup-vertical .ui-spinner .ui-spinner-up { + border-top-style: solid +} + +.ui-checkboxradio-label .ui-icon-background { + box-shadow: inset 1px 1px 1px #ccc; + border-radius: .12em; + border: none +} + +.ui-checkboxradio-radio-label .ui-icon-background { + width: 16px; + height: 16px; + border-radius: 1em; + overflow: visible; + border: none +} + +.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, + .ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { + background-image: none; + width: 8px; + height: 8px; + border-width: 4px; + border-style: solid +} + +.ui-checkboxradio-disabled { + pointer-events: none +} + +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none +} + +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0 +} + +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em +} + +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover + { + top: 1px +} + +.ui-datepicker .ui-datepicker-prev { + left: 2px +} + +.ui-datepicker .ui-datepicker-next { + right: 2px +} + +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px +} + +.ui-datepicker .ui-datepicker-next-hover { + right: 1px +} + +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span + { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px +} + +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center +} + +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0 +} + +.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year + { + width: 45% +} + +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em +} + +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0 +} + +.ui-datepicker td { + border: 0; + padding: 1px +} + +.ui-datepicker td span, .ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none +} + +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0 +} + +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible +} + +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left +} + +.ui-datepicker.ui-datepicker-multi { + width: auto +} + +.ui-datepicker-multi .ui-datepicker-group { + float: left +} + +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em +} + +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50% +} + +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3% +} + +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25% +} + +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, + .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header + { + border-left-width: 0 +} + +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left +} + +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0 +} + +.ui-datepicker-rtl { + direction: rtl +} + +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto +} + +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto +} + +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto +} + +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto +} + +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right +} + +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left +} + +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, + .ui-datepicker-rtl .ui-datepicker-group { + float: right +} + +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, + .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px +} + +.ui-datepicker .ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; + left: .5em; + top: .3em +} + +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0 +} + +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative +} + +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis +} + +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 20px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px +} + +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto +} + +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em +} + +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right +} + +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer +} + +.ui-dialog .ui-resizable-n { + height: 2px; + top: 0 +} + +.ui-dialog .ui-resizable-e { + width: 2px; + right: 0 +} + +.ui-dialog .ui-resizable-s { + height: 2px; + bottom: 0 +} + +.ui-dialog .ui-resizable-w { + width: 2px; + left: 0 +} + +.ui-dialog .ui-resizable-se, .ui-dialog .ui-resizable-sw, .ui-dialog .ui-resizable-ne, + .ui-dialog .ui-resizable-nw { + width: 7px; + height: 7px +} + +.ui-dialog .ui-resizable-se { + right: 0; + bottom: 0 +} + +.ui-dialog .ui-resizable-sw { + left: 0; + bottom: 0 +} + +.ui-dialog .ui-resizable-ne { + right: 0; + top: 0 +} + +.ui-dialog .ui-resizable-nw { + left: 0; + top: 0 +} + +.ui-draggable .ui-dialog-titlebar { + cursor: move +} + +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden +} + +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100% +} + +.ui-progressbar .ui-progressbar-overlay { + background: + url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); + height: 100%; + filter: alpha(opacity = 25); + opacity: 0.25 +} + +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none +} + +.ui-selectmenu-menu { + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + display: none +} + +.ui-selectmenu-menu .ui-menu { + overflow: auto; + overflow-x: hidden; + padding-bottom: 1px +} + +.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { + font-size: 1em; + font-weight: bold; + line-height: 1.5; + padding: 2px 0.4em; + margin: 0.5em 0 0 0; + height: auto; + border: 0 +} + +.ui-selectmenu-open { + display: block +} + +.ui-selectmenu-text { + display: block; + margin-right: 20px; + overflow: hidden; + text-overflow: ellipsis +} + +.ui-selectmenu-button.ui-button { + text-align: left; + white-space: nowrap; + width: 14em +} + +.ui-selectmenu-icon.ui-icon { + float: right; + margin-top: 0 +} + +.ui-slider { + position: relative; + text-align: left +} + +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; + -ms-touch-action: none; + touch-action: none +} + +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0 +} + +.ui-slider.ui-state-disabled .ui-slider-handle, .ui-slider.ui-state-disabled .ui-slider-range + { + filter: inherit +} + +.ui-slider-horizontal { + height: .8em +} + +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em +} + +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100% +} + +.ui-slider-horizontal .ui-slider-range-min { + left: 0 +} + +.ui-slider-horizontal .ui-slider-range-max { + right: 0 +} + +.ui-slider-vertical { + width: .8em; + height: 100px +} + +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em +} + +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100% +} + +.ui-slider-vertical .ui-slider-range-min { + bottom: 0 +} + +.ui-slider-vertical .ui-slider-range-max { + top: 0 +} + +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle +} + +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: .222em 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 2em +} + +.ui-spinner-button { + width: 1.6em; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0 +} + +.ui-spinner a.ui-spinner-button { + border-top-style: none; + border-bottom-style: none; + border-right-style: none +} + +.ui-spinner-up { + top: 0 +} + +.ui-spinner-down { + bottom: 0 +} + +.ui-tabs { + position: relative; + padding: .2em +} + +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0 +} + +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap +} + +.ui-tabs .ui-tabs-nav .ui-tabs-anchor { + float: left; + padding: .5em 1em; + text-decoration: none +} + +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px +} + +.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, + .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { + cursor: text +} + +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { + cursor: pointer +} + +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none +} + +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px +} + +body .ui-tooltip { + border-width: 2px +} + +.ui-widget { + font-family: Arial, Helvetica, sans-serif; + font-size: 1em +} + +.ui-widget .ui-widget { + font-size: 1em +} + +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button + { + font-family: Arial, Helvetica, sans-serif; + font-size: 1em +} + +.ui-widget.ui-widget-content { + border: 1px solid #c5c5c5 +} + +.ui-widget-content { + border: 1px solid #ddd; + background: #fff; + color: #333 +} + +.ui-widget-content a { + color: #333 +} + +.ui-widget-header { + border: 1px solid #ddd; + background: #e9e9e9; + color: #333; + font-weight: bold +} + +.ui-widget-header a { + color: #333 +} + +.ui-state-default, .ui-widget-content .ui-state-default, + .ui-widget-header .ui-state-default, .ui-button, html .ui-button.ui-state-disabled:hover, + html .ui-button.ui-state-disabled:active { + border: 1px solid #c5c5c5; + background: #f6f6f6; + font-weight: normal; + color: #454545 +} + +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited, + a.ui-button, a:link.ui-button, a:visited.ui-button, .ui-button { + color: #454545; + text-decoration: none +} + +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, + .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus, + .ui-button:hover, .ui-button:focus { + border: 1px solid #ccc; + background: #ededed; + font-weight: normal; + color: #2b2b2b +} + +.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, + .ui-state-hover a:visited, .ui-state-focus a, .ui-state-focus a:hover, + .ui-state-focus a:link, .ui-state-focus a:visited, a.ui-button:hover, a.ui-button:focus + { + color: #2b2b2b; + text-decoration: none +} + +.ui-visual-focus { + box-shadow: 0 0 3px 1px rgb(94, 158, 214) +} + +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active, + a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover + { + border: 1px solid #003eff; + background: #007fff; + font-weight: normal; + color: #fff +} + +.ui-icon-background, .ui-state-active .ui-icon-background { + border: #003eff; + background-color: #fff +} + +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited + { + color: #fff; + text-decoration: none +} + +.ui-state-highlight, .ui-widget-content .ui-state-highlight, + .ui-widget-header .ui-state-highlight { + border: 1px solid #dad55e; + background: #fffa90; + color: #777620 +} + +.ui-state-checked { + border: 1px solid #dad55e; + background: #fffa90 +} + +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a, + .ui-widget-header .ui-state-highlight a { + color: #777620 +} + +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error + { + border: 1px solid #f1a899; + background: #fddfdf; + color: #5f3f3f +} + +.ui-state-error a, .ui-widget-content .ui-state-error a, + .ui-widget-header .ui-state-error a { + color: #5f3f3f +} + +.ui-state-error-text, .ui-widget-content .ui-state-error-text, + .ui-widget-header .ui-state-error-text { + color: #5f3f3f +} + +.ui-priority-primary, .ui-widget-content .ui-priority-primary, + .ui-widget-header .ui-priority-primary { + font-weight: bold +} + +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, + .ui-widget-header .ui-priority-secondary { + opacity: .7; + filter: Alpha(Opacity = 70); + font-weight: normal +} + +.ui-state-disabled, .ui-widget-content .ui-state-disabled, + .ui-widget-header .ui-state-disabled { + opacity: .35; + filter: Alpha(Opacity = 35); + background-image: none +} + +.ui-state-disabled .ui-icon { + filter: Alpha(Opacity = 35) +} + +.ui-icon { + width: 16px; + height: 16px +} + +.ui-icon, .ui-widget-content .ui-icon { + background-image: url("images/ui-icons_444444_256x240.png") +} + +.ui-widget-header .ui-icon { + background-image: url("images/ui-icons_444444_256x240.png") +} + +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon, .ui-button:hover .ui-icon, + .ui-button:focus .ui-icon { + background-image: url("images/ui-icons_555555_256x240.png") +} + +.ui-state-active .ui-icon, .ui-button:active .ui-icon { + background-image: url("images/ui-icons_ffffff_256x240.png") +} + +.ui-state-highlight .ui-icon, .ui-button .ui-state-highlight.ui-icon { + background-image: url("images/ui-icons_777620_256x240.png") +} + +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon { + background-image: url("images/ui-icons_cc0000_256x240.png") +} + +.ui-button .ui-icon { + background-image: url("images/ui-icons_777777_256x240.png") +} + +.ui-icon-blank { + background-position: 16px 16px +} + +.ui-icon-caret-1-n { + background-position: 0 0 +} + +.ui-icon-caret-1-ne { + background-position: -16px 0 +} + +.ui-icon-caret-1-e { + background-position: -32px 0 +} + +.ui-icon-caret-1-se { + background-position: -48px 0 +} + +.ui-icon-caret-1-s { + background-position: -65px 0 +} + +.ui-icon-caret-1-sw { + background-position: -80px 0 +} + +.ui-icon-caret-1-w { + background-position: -96px 0 +} + +.ui-icon-caret-1-nw { + background-position: -112px 0 +} + +.ui-icon-caret-2-n-s { + background-position: -128px 0 +} + +.ui-icon-caret-2-e-w { + background-position: -144px 0 +} + +.ui-icon-triangle-1-n { + background-position: 0 -16px +} + +.ui-icon-triangle-1-ne { + background-position: -16px -16px +} + +.ui-icon-triangle-1-e { + background-position: -32px -16px +} + +.ui-icon-triangle-1-se { + background-position: -48px -16px +} + +.ui-icon-triangle-1-s { + background-position: -65px -16px +} + +.ui-icon-triangle-1-sw { + background-position: -80px -16px +} + +.ui-icon-triangle-1-w { + background-position: -96px -16px +} + +.ui-icon-triangle-1-nw { + background-position: -112px -16px +} + +.ui-icon-triangle-2-n-s { + background-position: -128px -16px +} + +.ui-icon-triangle-2-e-w { + background-position: -144px -16px +} + +.ui-icon-arrow-1-n { + background-position: 0 -32px +} + +.ui-icon-arrow-1-ne { + background-position: -16px -32px +} + +.ui-icon-arrow-1-e { + background-position: -32px -32px +} + +.ui-icon-arrow-1-se { + background-position: -48px -32px +} + +.ui-icon-arrow-1-s { + background-position: -65px -32px +} + +.ui-icon-arrow-1-sw { + background-position: -80px -32px +} + +.ui-icon-arrow-1-w { + background-position: -96px -32px +} + +.ui-icon-arrow-1-nw { + background-position: -112px -32px +} + +.ui-icon-arrow-2-n-s { + background-position: -128px -32px +} + +.ui-icon-arrow-2-ne-sw { + background-position: -144px -32px +} + +.ui-icon-arrow-2-e-w { + background-position: -160px -32px +} + +.ui-icon-arrow-2-se-nw { + background-position: -176px -32px +} + +.ui-icon-arrowstop-1-n { + background-position: -192px -32px +} + +.ui-icon-arrowstop-1-e { + background-position: -208px -32px +} + +.ui-icon-arrowstop-1-s { + background-position: -224px -32px +} + +.ui-icon-arrowstop-1-w { + background-position: -240px -32px +} + +.ui-icon-arrowthick-1-n { + background-position: 1px -48px +} + +.ui-icon-arrowthick-1-ne { + background-position: -16px -48px +} + +.ui-icon-arrowthick-1-e { + background-position: -32px -48px +} + +.ui-icon-arrowthick-1-se { + background-position: -48px -48px +} + +.ui-icon-arrowthick-1-s { + background-position: -64px -48px +} + +.ui-icon-arrowthick-1-sw { + background-position: -80px -48px +} + +.ui-icon-arrowthick-1-w { + background-position: -96px -48px +} + +.ui-icon-arrowthick-1-nw { + background-position: -112px -48px +} + +.ui-icon-arrowthick-2-n-s { + background-position: -128px -48px +} + +.ui-icon-arrowthick-2-ne-sw { + background-position: -144px -48px +} + +.ui-icon-arrowthick-2-e-w { + background-position: -160px -48px +} + +.ui-icon-arrowthick-2-se-nw { + background-position: -176px -48px +} + +.ui-icon-arrowthickstop-1-n { + background-position: -192px -48px +} + +.ui-icon-arrowthickstop-1-e { + background-position: -208px -48px +} + +.ui-icon-arrowthickstop-1-s { + background-position: -224px -48px +} + +.ui-icon-arrowthickstop-1-w { + background-position: -240px -48px +} + +.ui-icon-arrowreturnthick-1-w { + background-position: 0 -64px +} + +.ui-icon-arrowreturnthick-1-n { + background-position: -16px -64px +} + +.ui-icon-arrowreturnthick-1-e { + background-position: -32px -64px +} + +.ui-icon-arrowreturnthick-1-s { + background-position: -48px -64px +} + +.ui-icon-arrowreturn-1-w { + background-position: -64px -64px +} + +.ui-icon-arrowreturn-1-n { + background-position: -80px -64px +} + +.ui-icon-arrowreturn-1-e { + background-position: -96px -64px +} + +.ui-icon-arrowreturn-1-s { + background-position: -112px -64px +} + +.ui-icon-arrowrefresh-1-w { + background-position: -128px -64px +} + +.ui-icon-arrowrefresh-1-n { + background-position: -144px -64px +} + +.ui-icon-arrowrefresh-1-e { + background-position: -160px -64px +} + +.ui-icon-arrowrefresh-1-s { + background-position: -176px -64px +} + +.ui-icon-arrow-4 { + background-position: 0 -80px +} + +.ui-icon-arrow-4-diag { + background-position: -16px -80px +} + +.ui-icon-extlink { + background-position: -32px -80px +} + +.ui-icon-newwin { + background-position: -48px -80px +} + +.ui-icon-refresh { + background-position: -64px -80px +} + +.ui-icon-shuffle { + background-position: -80px -80px +} + +.ui-icon-transfer-e-w { + background-position: -96px -80px +} + +.ui-icon-transferthick-e-w { + background-position: -112px -80px +} + +.ui-icon-folder-collapsed { + background-position: 0 -96px +} + +.ui-icon-folder-open { + background-position: -16px -96px +} + +.ui-icon-document { + background-position: -32px -96px +} + +.ui-icon-document-b { + background-position: -48px -96px +} + +.ui-icon-note { + background-position: -64px -96px +} + +.ui-icon-mail-closed { + background-position: -80px -96px +} + +.ui-icon-mail-open { + background-position: -96px -96px +} + +.ui-icon-suitcase { + background-position: -112px -96px +} + +.ui-icon-comment { + background-position: -128px -96px +} + +.ui-icon-person { + background-position: -144px -96px +} + +.ui-icon-print { + background-position: -160px -96px +} + +.ui-icon-trash { + background-position: -176px -96px +} + +.ui-icon-locked { + background-position: -192px -96px +} + +.ui-icon-unlocked { + background-position: -208px -96px +} + +.ui-icon-bookmark { + background-position: -224px -96px +} + +.ui-icon-tag { + background-position: -240px -96px +} + +.ui-icon-home { + background-position: 0 -112px +} + +.ui-icon-flag { + background-position: -16px -112px +} + +.ui-icon-calendar { + background-position: -32px -112px +} + +.ui-icon-cart { + background-position: -48px -112px +} + +.ui-icon-pencil { + background-position: -64px -112px +} + +.ui-icon-clock { + background-position: -80px -112px +} + +.ui-icon-disk { + background-position: -96px -112px +} + +.ui-icon-calculator { + background-position: -112px -112px +} + +.ui-icon-zoomin { + background-position: -128px -112px +} + +.ui-icon-zoomout { + background-position: -144px -112px +} + +.ui-icon-search { + background-position: -160px -112px +} + +.ui-icon-wrench { + background-position: -176px -112px +} + +.ui-icon-gear { + background-position: -192px -112px +} + +.ui-icon-heart { + background-position: -208px -112px +} + +.ui-icon-star { + background-position: -224px -112px +} + +.ui-icon-link { + background-position: -240px -112px +} + +.ui-icon-cancel { + background-position: 0 -128px +} + +.ui-icon-plus { + background-position: -16px -128px +} + +.ui-icon-plusthick { + background-position: -32px -128px +} + +.ui-icon-minus { + background-position: -48px -128px +} + +.ui-icon-minusthick { + background-position: -64px -128px +} + +.ui-icon-close { + background-position: -80px -128px +} + +.ui-icon-closethick { + background-position: -96px -128px +} + +.ui-icon-key { + background-position: -112px -128px +} + +.ui-icon-lightbulb { + background-position: -128px -128px +} + +.ui-icon-scissors { + background-position: -144px -128px +} + +.ui-icon-clipboard { + background-position: -160px -128px +} + +.ui-icon-copy { + background-position: -176px -128px +} + +.ui-icon-contact { + background-position: -192px -128px +} + +.ui-icon-image { + background-position: -208px -128px +} + +.ui-icon-video { + background-position: -224px -128px +} + +.ui-icon-script { + background-position: -240px -128px +} + +.ui-icon-alert { + background-position: 0 -144px +} + +.ui-icon-info { + background-position: -16px -144px +} + +.ui-icon-notice { + background-position: -32px -144px +} + +.ui-icon-help { + background-position: -48px -144px +} + +.ui-icon-check { + background-position: -64px -144px +} + +.ui-icon-bullet { + background-position: -80px -144px +} + +.ui-icon-radio-on { + background-position: -96px -144px +} + +.ui-icon-radio-off { + background-position: -112px -144px +} + +.ui-icon-pin-w { + background-position: -128px -144px +} + +.ui-icon-pin-s { + background-position: -144px -144px +} + +.ui-icon-play { + background-position: 0 -160px +} + +.ui-icon-pause { + background-position: -16px -160px +} + +.ui-icon-seek-next { + background-position: -32px -160px +} + +.ui-icon-seek-prev { + background-position: -48px -160px +} + +.ui-icon-seek-end { + background-position: -64px -160px +} + +.ui-icon-seek-start { + background-position: -80px -160px +} + +.ui-icon-seek-first { + background-position: -80px -160px +} + +.ui-icon-stop { + background-position: -96px -160px +} + +.ui-icon-eject { + background-position: -112px -160px +} + +.ui-icon-volume-off { + background-position: -128px -160px +} + +.ui-icon-volume-on { + background-position: -144px -160px +} + +.ui-icon-power { + background-position: 0 -176px +} + +.ui-icon-signal-diag { + background-position: -16px -176px +} + +.ui-icon-signal { + background-position: -32px -176px +} + +.ui-icon-battery-0 { + background-position: -48px -176px +} + +.ui-icon-battery-1 { + background-position: -64px -176px +} + +.ui-icon-battery-2 { + background-position: -80px -176px +} + +.ui-icon-battery-3 { + background-position: -96px -176px +} + +.ui-icon-circle-plus { + background-position: 0 -192px +} + +.ui-icon-circle-minus { + background-position: -16px -192px +} + +.ui-icon-circle-close { + background-position: -32px -192px +} + +.ui-icon-circle-triangle-e { + background-position: -48px -192px +} + +.ui-icon-circle-triangle-s { + background-position: -64px -192px +} + +.ui-icon-circle-triangle-w { + background-position: -80px -192px +} + +.ui-icon-circle-triangle-n { + background-position: -96px -192px +} + +.ui-icon-circle-arrow-e { + background-position: -112px -192px +} + +.ui-icon-circle-arrow-s { + background-position: -128px -192px +} + +.ui-icon-circle-arrow-w { + background-position: -144px -192px +} + +.ui-icon-circle-arrow-n { + background-position: -160px -192px +} + +.ui-icon-circle-zoomin { + background-position: -176px -192px +} + +.ui-icon-circle-zoomout { + background-position: -192px -192px +} + +.ui-icon-circle-check { + background-position: -208px -192px +} + +.ui-icon-circlesmall-plus { + background-position: 0 -208px +} + +.ui-icon-circlesmall-minus { + background-position: -16px -208px +} + +.ui-icon-circlesmall-close { + background-position: -32px -208px +} + +.ui-icon-squaresmall-plus { + background-position: -48px -208px +} + +.ui-icon-squaresmall-minus { + background-position: -64px -208px +} + +.ui-icon-squaresmall-close { + background-position: -80px -208px +} + +.ui-icon-grip-dotted-vertical { + background-position: 0 -224px +} + +.ui-icon-grip-dotted-horizontal { + background-position: -16px -224px +} + +.ui-icon-grip-solid-vertical { + background-position: -32px -224px +} + +.ui-icon-grip-solid-horizontal { + background-position: -48px -224px +} + +.ui-icon-gripsmall-diagonal-se { + background-position: -64px -224px +} + +.ui-icon-grip-diagonal-se { + background-position: -80px -224px +} + +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { + border-top-left-radius: 3px +} + +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { + border-top-right-radius: 3px +} + +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { + border-bottom-left-radius: 3px +} + +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { + border-bottom-right-radius: 3px +} + +.ui-widget-overlay { + background: #aaa; + opacity: .3; + filter: Alpha(Opacity = 30) +} + +.ui-widget-shadow { + -webkit-box-shadow: 0 0 5px #666; + box-shadow: 0 0 5px #666 +} \ No newline at end of file diff --git a/customer_domains.php b/customer_domains.php index 0a010e1a..76bced31 100644 --- a/customer_domains.php +++ b/customer_domains.php @@ -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'] . "
"; } - + $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'; } diff --git a/customer_email.php b/customer_email.php index 7cb3f18d..b712edff 100644 --- a/customer_email.php +++ b/customer_email.php @@ -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)); } } } diff --git a/customer_ftp.php b/customer_ftp.php index b5f0651e..1688cfcb 100644 --- a/customer_ftp.php +++ b/customer_ftp.php @@ -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']; diff --git a/customer_index.php b/customer_index.php index 327a534d..6f7bff93 100644 --- a/customer_index.php +++ b/customer_index.php @@ -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", "
", $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'; } diff --git a/customer_logger.php b/customer_logger.php index 4d67b08b..7f394d81 100644 --- a/customer_logger.php +++ b/customer_logger.php @@ -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') . "\";"); } } diff --git a/customer_mysql.php b/customer_mysql.php index 77db4d38..61823d8d 100644 --- a/customer_mysql.php +++ b/customer_mysql.php @@ -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']; diff --git a/customer_traffic.php b/customer_traffic.php index 71bb0ff3..ae2c20c6 100644 --- a/customer_traffic.php +++ b/customer_traffic.php @@ -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') . "\";"); } diff --git a/dns_editor.php b/dns_editor.php index d869fb49..adfd9a8f 100644 --- a/dns_editor.php +++ b/dns_editor.php @@ -1,7 +1,7 @@ (2016-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Panel - * + * */ use Froxlor\Database\Database; diff --git a/doc/example/FroxlorAPI.php b/doc/example/FroxlorAPI.php index 0d9aa6cd..8bcb742d 100644 --- a/doc/example/FroxlorAPI.php +++ b/doc/example/FroxlorAPI.php @@ -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 * diff --git a/install/install.php b/install/install.php index 58e03083..8175ffa7 100644 --- a/install/install.php +++ b/install/install.php @@ -15,7 +15,6 @@ * @package Install * */ - require 'lib/class.FroxlorInstall.php'; $frxinstall = new FroxlorInstall(); diff --git a/install/lib/class.FroxlorInstall.php b/install/lib/class.FroxlorInstall.php index bf33bf59..504d8b8e 100644 --- a/install/lib/class.FroxlorInstall.php +++ b/install/lib/class.FroxlorInstall.php @@ -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 = ""; - + // 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 .= "
"; - + // 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 = ""; - + // 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 = ""; - + // 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'] . "
" . $this->_lng['requirements']['mysqldumpmissing']); } - + $content .= "
"; - + // 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("/(? (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package API - * @since 0.10.0 - * + * @copyright (c) the authors + * @author Froxlor team (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 { diff --git a/lib/Froxlor/Api/Commands/FpmDaemons.php b/lib/Froxlor/Api/Commands/FpmDaemons.php index c69c3f08..d2dce946 100644 --- a/lib/Froxlor/Api/Commands/FpmDaemons.php +++ b/lib/Froxlor/Api/Commands/FpmDaemons.php @@ -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). diff --git a/lib/Froxlor/Api/Commands/SubDomains.php b/lib/Froxlor/Api/Commands/SubDomains.php index 24591f0d..c3750e33 100644 --- a/lib/Froxlor/Api/Commands/SubDomains.php +++ b/lib/Froxlor/Api/Commands/SubDomains.php @@ -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 (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package API - * @since 0.10.0 - * + * @copyright (c) the authors + * @author Froxlor team (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 { diff --git a/lib/Froxlor/Cli/ConfigServicesCmd.php b/lib/Froxlor/Cli/ConfigServicesCmd.php index 220acdad..69abc0d1 100755 --- a/lib/Froxlor/Cli/ConfigServicesCmd.php +++ b/lib/Froxlor/Cli/ConfigServicesCmd.php @@ -1,5 +1,4 @@ (2003-2009) - * @author Froxlor team (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Cron - * + * @copyright (c) the authors + * @author Florian Lippert (2003-2009) + * @author Froxlor team (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.= ' '. "\n"; - $php_options_text.= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost'. "\n"; - $php_options_text.= ' ' . "\n"; + $filesmatch = '(' . str_replace(".", "\.", substr($filesmatch, 0, - 1)) . ')'; + $php_options_text .= ' ' . "\n"; + $php_options_text .= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost' . "\n"; + $php_options_text .= ' ' . "\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.= ' ' . "\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 .= ' ' . "\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.= ' ' . "\n"; - } elseif ($phpconfig['pass_authorizationheader'] == '1') { + $php_options_text .= ' Require all granted' . "\n"; + $php_options_text .= ' AllowOverride All' . "\n"; + $php_options_text .= ' ' . "\n"; + } elseif ($phpconfig['pass_authorizationheader'] == '1') { // allow Pass of Authorization header - $php_options_text.= ' ' . "\n"; - $php_options_text.= ' CGIPassAuth On' . "\n"; - $php_options_text.= ' ' . "\n"; - } - + $php_options_text .= ' ' . "\n"; + $php_options_text .= ' CGIPassAuth On' . "\n"; + $php_options_text .= ' ' . "\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.= ' ' . "\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 .= ' ' . "\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.= ' '. "\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.= ' ' . "\n"; + $filesmatch = '(' . str_replace(".", "\.", substr($filesmatch, 0, - 1)) . ')'; + $php_options_text .= ' ' . "\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 .= ' ' . "\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.= ' ' . "\n"; - $php_options_text.= ' Alias /fastcgiphp ' . $php->getInterface()->getAliasConfigDir() . $srvName . "\n"; + $php_options_text .= ' ' . "\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.= ' ' . "\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 .= ' ' . "\n"; $file_extensions = explode(' ', $phpconfig['file_extensions']); - $php_options_text.= ' ' . "\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 .= ' ' . "\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.= ' ' . "\n"; + $php_options_text .= ' Options +ExecCGI' . "\n"; + $php_options_text .= ' ' . "\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.= ' ' . "\n"; + $php_options_text .= ' ' . "\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'), diff --git a/lib/Froxlor/Cron/Traffic/cron_usage.inc.diskspace.php b/lib/Froxlor/Cron/Traffic/cron_usage.inc.diskspace.php index 88f364ae..ef2adadd 100644 --- a/lib/Froxlor/Cron/Traffic/cron_usage.inc.diskspace.php +++ b/lib/Froxlor/Cron/Traffic/cron_usage.inc.diskspace.php @@ -1,4 +1,7 @@ - (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Cron - * + * @copyright (c) the authors + * @author Froxlor team (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 diff --git a/lib/Froxlor/FroxlorLogger.php b/lib/Froxlor/FroxlorLogger.php index ed94af8b..b0e7ddfe 100644 --- a/lib/Froxlor/FroxlorLogger.php +++ b/lib/Froxlor/FroxlorLogger.php @@ -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) diff --git a/lib/Froxlor/Http/Statistics.php b/lib/Froxlor/Http/Statistics.php index cb9082f7..8e3b88e8 100644 --- a/lib/Froxlor/Http/Statistics.php +++ b/lib/Froxlor/Http/Statistics.php @@ -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))); + } } - } \ No newline at end of file diff --git a/lib/Froxlor/Settings.php b/lib/Froxlor/Settings.php index ed231121..f7633335 100644 --- a/lib/Froxlor/Settings.php +++ b/lib/Froxlor/Settings.php @@ -1,10 +1,8 @@ - * @author Froxlor team (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Classes - * - * @since 0.9.31 - * + * @copyright (c) the authors + * @author Michael Kaufmann + * @author Froxlor team (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 - * @author Froxlor team (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Classes - * + * @copyright (c) the authors + * @author Michael Kaufmann + * @author Froxlor team (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; } diff --git a/lib/Froxlor/System/Cronjob.php b/lib/Froxlor/System/Cronjob.php index 208851f8..d154530e 100644 --- a/lib/Froxlor/System/Cronjob.php +++ b/lib/Froxlor/System/Cronjob.php @@ -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() diff --git a/lib/Froxlor/System/Crypt.php b/lib/Froxlor/System/Crypt.php index 51d8a6c4..aabc6077 100644 --- a/lib/Froxlor/System/Crypt.php +++ b/lib/Froxlor/System/Crypt.php @@ -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; - } - - } \ No newline at end of file diff --git a/lib/Froxlor/UI/HtmlForm.php b/lib/Froxlor/UI/HtmlForm.php index 8c8f0c33..b62ea78a 100644 --- a/lib/Froxlor/UI/HtmlForm.php +++ b/lib/Froxlor/UI/HtmlForm.php @@ -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 (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Classes - * + * @copyright (c) the authors + * @author Froxlor team (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 ' *'; - } - elseif(isset($data['mandatory_ex'])) - { + } elseif (isset($data['mandatory_ex'])) { return ' **'; } 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 ? ' '.$data['ul_field'] : ''); - if(isset($data['display']) && $data['display'] != '') - { - $ulfield = ''.$data['display'].''; + $ulfield = ($unlimited == true ? ' ' . $data['ul_field'] : ''); + if (isset($data['display']) && $data['display'] != '') { + $ulfield = '' . $data['display'] . ''; } 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 ''; + id="' . $fieldname . '" + name="' . $fieldname . '" + ' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . ' + >' . $select_var . ''; } /** @@ -234,32 +233,36 @@ class HtmlForm * * * $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 + * ) * * - * @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 .= ''; + $output .= ''; + $output .= $key . ''; } 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 = ''.$data['display'].''; + if (isset($data['display']) && $data['display'] != '') { + $ulfield = '' . $data['display'] . ''; } 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 diff --git a/lib/Froxlor/Validate/Form/String.php b/lib/Froxlor/Validate/Form/Strings.php similarity index 99% rename from lib/Froxlor/Validate/Form/String.php rename to lib/Froxlor/Validate/Form/Strings.php index 51b6b2fc..ac93b0ed 100644 --- a/lib/Froxlor/Validate/Form/String.php +++ b/lib/Froxlor/Validate/Form/Strings.php @@ -1,7 +1,7 @@ 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)
"; - if (! empty($link)) { - echo ""; - } - echo $title; - if (! empty($link)) { - echo ""; - } - echo ""; - if (! empty($date)) { - echo " + if (! empty($link)) { + echo ""; + } + echo $title; + if (! empty($link)) { + echo ""; + } + echo ""; + if (! empty($date)) { + echo " {$date} "; - } - echo "
+ } + echo "

{$content}

diff --git a/lib/classes/output/class.htmlform.php b/lib/classes/output/class.htmlform.php index c7ded086..dc13fdc0 100644 --- a/lib/classes/output/class.htmlform.php +++ b/lib/classes/output/class.htmlform.php @@ -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 ' *'; - } - elseif(isset($data['mandatory_ex'])) - { + } elseif (isset($data['mandatory_ex'])) { return ' **'; } 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 ? ' '.$data['ul_field'] : ''); - if(isset($data['display']) && $data['display'] != '') - { - $ulfield = ''.$data['display'].''; + $ulfield = ($unlimited == true ? ' ' . $data['ul_field'] : ''); + if (isset($data['display']) && $data['display'] != '') { + $ulfield = '' . $data['display'] . ''; } 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 ''; + id="' . $fieldname . '" + name="' . $fieldname . '" + ' . (isset($data['class']) ? ' class="' . $data['class'] . '" ' : '') . ' + >' . $select_var . ''; } /** @@ -233,32 +232,36 @@ class htmlform * * * $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 + * ) * * - * @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 .= ''; + $output .= ''; + $output .= $key . ''; } 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 = ''.$data['display'].''; + if (isset($data['display']) && $data['display'] != '') { + $ulfield = '' . $data['display'] . ''; } 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 diff --git a/lib/classes/output/class.linker.php b/lib/classes/output/class.linker.php index 697ab5b5..ef8e7d6e 100644 --- a/lib/classes/output/class.linker.php +++ b/lib/classes/output/class.linker.php @@ -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 "&" - if (substr($link, -1) != "?") { + if (substr($link, - 1) != "?") { $link .= "&"; } diff --git a/lib/classes/output/class.paging.php b/lib/classes/output/class.paging.php index eed9e926..203ab3a5 100644 --- a/lib/classes/output/class.paging.php +++ b/lib/classes/output/class.paging.php @@ -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 ? '
' : ' '); - 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 = '« < '; - for ($i = $start;$i <= $stop;$i++) { + for ($i = $start; $i <= $stop; $i ++) { if ($i != $this->pageno) { - $pagingcode.= ' ' . $i . ' '; + $pagingcode .= ' ' . $i . ' '; } else { - $pagingcode.= ' ' . $i . ' '; + $pagingcode .= ' ' . $i . ' '; } } - $pagingcode.= ' > »'; + $pagingcode .= ' > »'; } else { $pagingcode = ''; } diff --git a/lib/configfiles/gentoo.xml b/lib/configfiles/gentoo.xml index 75bd0951..64ebe68a 100644 --- a/lib/configfiles/gentoo.xml +++ b/lib/configfiles/gentoo.xml @@ -1,6 +1,7 @@ - + @@ -915,8 +916,8 @@ include-dir=/etc/powerdns/froxlor/ - + - + - + named.conf @@ -1495,8 +1497,8 @@ bind-check-interval=180 - + password = @@ -1540,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi ]]> - + password = @@ -1552,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s' ]]> - + password = @@ -1602,8 +1604,8 @@ root: root@ //service[@type='smtp']/general/commands[@index=2] - + //service[@type='smtp']/general/files[@index=0] - + //service[@type='smtp']/general/commands[@index=2] - + //service[@type='smtp']/general/files[@index=0] - + //service[@type='smtp']/general/commands[@index=2] - + //service[@type='smtp']/general/files[@index=0] - + - + > /etc/portage/package.use]]> - + dbname= user= password= @@ -2144,8 +2148,8 @@ iterate_query = "SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3 ]]> - + - + - + - + - + - + > /etc/portage/package.use]]> - + " [ -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=" @@ -3434,8 +3439,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key - + FTP Server" @@ -3582,8 +3587,8 @@ MISC_OTHER="-A -x -j -Z" ]]> - + #MYSQLPort 3306 @@ -3607,8 +3612,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cu > /etc/portage/package.use]]> - + passwd= - + - + - + - + - + - - + > /etc/portage/package.use]]> @@ -3896,7 +3906,7 @@ aliases: files - diff --git a/lib/configfiles/jessie.xml b/lib/configfiles/jessie.xml index 24e9f27f..8a913c59 100644 --- a/lib/configfiles/jessie.xml +++ b/lib/configfiles/jessie.xml @@ -1,6 +1,7 @@ - + @@ -43,7 +44,8 @@ - + //service[@type='http']/general/commands @@ -904,8 +906,8 @@ include-dir=/etc/powerdns/froxlor/ - + - + - + - + password = @@ -1539,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi ]]> - + password = @@ -1551,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s' ]]> - + password = @@ -1599,8 +1602,8 @@ root: root@ //service[@type='smtp']/general/commands[@index=2] - + //service[@type='smtp']/general/files[@index=0] - + - + - + - + - + //service[@type='mail']/general/installs[@index=1] //service[@type='mail']/general/files[@index=1] @@ -3805,7 +3808,8 @@ plugin { - + //service[@type='mail']/general/installs[@index=1] //service[@type='mail']/general/files[@index=1] @@ -3819,7 +3823,8 @@ plugin { - + " [ -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=" @@ -3831,8 +3836,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key - + - + - + TLSEngine on @@ -4226,14 +4232,15 @@ TLSVerifyClient off - + - + @@ -4260,8 +4267,8 @@ yes ]]> - + @@ -4407,7 +4414,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus ]]> - + @@ -4451,7 +4459,8 @@ UPLOADGID= - + - + @@ -4479,14 +4489,15 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - + - + /etc/insserv/overrides - + {{settings.system.webserver}} - + {{settings.system.webserver}} - + {{settings.system.webserver}} - + - + @@ -4687,7 +4703,8 @@ aliases: files - + - - + {{settings.system.webserver}} @@ -4765,7 +4783,7 @@ aliases: files - diff --git a/lib/configfiles/precise.xml b/lib/configfiles/precise.xml index 0ccbc7be..dcdc9dc5 100644 --- a/lib/configfiles/precise.xml +++ b/lib/configfiles/precise.xml @@ -1,6 +1,7 @@ - + @@ -370,8 +371,8 @@ include-dir=/etc/powerdns/froxlor/ - + - + - + # add these entries to the list if any speficied: @@ -453,8 +455,8 @@ local-address=,127.0.0.1 - + password = @@ -498,8 +500,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi ]]> - + password = @@ -510,8 +512,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s' ]]> - + password = @@ -558,8 +560,8 @@ root: root@ //service[@type='smtp']/general/commands[@index=2] - + //service[@type='smtp']/general/files[@index=0] - + //service[@type='smtp']/general/commands[@index=2] - + - + @@ -882,8 +885,8 @@ service auth { ]]> - + - + - + - + MYSQL_USERNAME @@ -1148,7 +1152,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3) - + " [ -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=" @@ -1160,8 +1165,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key - + - + - + TLSEngine on @@ -1435,14 +1441,15 @@ TLSVerifyClient off - + - + @@ -1469,8 +1476,8 @@ yes ]]> - + @@ -1500,7 +1507,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus ]]> - + @@ -1523,7 +1531,8 @@ UPLOADGID= - + - + @@ -1551,10 +1561,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - + - + - + @@ -1686,7 +1698,8 @@ aliases: files - + - - + {{settings.system.webserver}} @@ -1764,7 +1778,7 @@ aliases: files - diff --git a/lib/configfiles/rhel_centos.xml b/lib/configfiles/rhel_centos.xml index 6affbbd0..da22a090 100644 --- a/lib/configfiles/rhel_centos.xml +++ b/lib/configfiles/rhel_centos.xml @@ -1,6 +1,7 @@ - + @@ -87,8 +88,8 @@ Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath} - + password = @@ -132,8 +133,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi ]]> - + password = @@ -144,8 +145,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s' ]]> - + password = @@ -164,16 +165,16 @@ query = SELECT gid FROM mail_users WHERE email = '%s' - + //service[@type='smtp']/general/commands[@index=1] //service[@type='smtp']/general/installs[@index=1] //service[@type='smtp']/general/commands[@index=2] - + //service[@type='smtp']/general/files[@index=0] - + - + @@ -504,8 +506,8 @@ auth_mechanisms = plain ]]> - + - + - + - + - + - + - + - + - + - + - + @@ -43,7 +44,8 @@ - + //service[@type='http']/general/commands @@ -893,8 +895,8 @@ include-dir=/etc/powerdns/froxlor/ - + - + - + - + password = @@ -1528,8 +1531,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi ]]> - + password = @@ -1540,8 +1543,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s' ]]> - + password = @@ -1588,8 +1591,8 @@ root: root@ //service[@type='smtp']/general/commands[@index=2] - + //service[@type='smtp']/general/files[@index=0] - + - + - + - + - + //service[@type='mail']/general/installs[@index=1] //service[@type='mail']/general/files[@index=1] @@ -3887,7 +3890,8 @@ plugin { - + " [ -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=" @@ -3899,8 +3903,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key - + - + - + TLSEngine on @@ -4294,14 +4299,15 @@ TLSVerifyClient off - + - + @@ -4328,8 +4334,8 @@ yes ]]> - + @@ -4475,7 +4481,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus ]]> - + @@ -4519,7 +4526,8 @@ UPLOADGID= - + - + @@ -4547,7 +4556,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - + @@ -4587,7 +4597,8 @@ aliases: files - + - - + {{settings.system.webserver}} @@ -4659,7 +4671,7 @@ aliases: files - diff --git a/lib/configfiles/trusty.xml b/lib/configfiles/trusty.xml index be3f31bf..07a55f33 100644 --- a/lib/configfiles/trusty.xml +++ b/lib/configfiles/trusty.xml @@ -1,6 +1,7 @@ - + @@ -408,8 +409,8 @@ include-dir=/etc/powerdns/froxlor/ - + - + - + # add these entries to the list if any speficied: @@ -493,8 +495,8 @@ local-address=,127.0.0.1 - + password = @@ -538,8 +540,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi ]]> - + password = @@ -550,8 +552,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s' ]]> - + password = @@ -598,8 +600,8 @@ root: root@ //service[@type='smtp']/general/commands[@index=2] - + //service[@type='smtp']/general/files[@index=0] - + //service[@type='smtp']/general/commands[@index=2] - + - + @@ -909,8 +912,8 @@ service auth { ]]> - + - + - + MYSQL_USERNAME @@ -1162,7 +1165,8 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3) - + " [ -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=" @@ -1174,8 +1178,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key - + - + - + TLSEngine on @@ -1449,14 +1454,15 @@ TLSVerifyClient off - + - + @@ -1483,8 +1489,8 @@ yes ]]> - + @@ -1514,7 +1520,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus ]]> - + @@ -1537,7 +1544,8 @@ UPLOADGID= - + - + @@ -1565,10 +1574,11 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - + - + - + @@ -1700,7 +1711,8 @@ aliases: files - + - - + {{settings.system.webserver}} @@ -1778,7 +1791,7 @@ aliases: files - diff --git a/lib/configfiles/xenial.xml b/lib/configfiles/xenial.xml index 0564fdef..e6d62055 100644 --- a/lib/configfiles/xenial.xml +++ b/lib/configfiles/xenial.xml @@ -1,6 +1,7 @@ - + @@ -43,7 +44,8 @@ - + //service[@type='http']/general/commands @@ -904,8 +906,8 @@ include-dir=/etc/powerdns/froxlor/ - + - + - + - + password = @@ -1539,8 +1542,8 @@ query = SELECT DISTINCT username FROM mail_users WHERE email in ((SELECT mail_vi ]]> - + password = @@ -1551,8 +1554,8 @@ query = SELECT uid FROM mail_users WHERE email = '%s' ]]> - + password = @@ -1599,8 +1602,8 @@ root: root@ //service[@type='smtp']/general/commands[@index=2] - + //service[@type='smtp']/general/files[@index=0] - + - + - + - + - + //service[@type='mail']/general/installs[@index=1] //service[@type='mail']/general/files[@index=1] @@ -3898,7 +3901,8 @@ plugin { - + " [ -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=" @@ -3910,8 +3914,8 @@ chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key - + - + - + TLSEngine on @@ -4305,14 +4310,15 @@ TLSVerifyClient off - + - + @@ -4339,8 +4345,8 @@ yes ]]> - + @@ -4486,7 +4492,8 @@ MySQLGetQTASZ SELECT panel_customers.diskspace/1024 AS QuotaSize FROM panel_cus ]]> - + @@ -4530,7 +4537,8 @@ UPLOADGID= - + - + @@ -4558,7 +4567,8 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - + @@ -4598,7 +4608,8 @@ aliases: files - + - - + {{settings.system.webserver}} @@ -4670,7 +4682,7 @@ aliases: files - diff --git a/lib/cron_init.php b/lib/cron_init.php index cb7dcbf2..54c5c436 100644 --- a/lib/cron_init.php +++ b/lib/cron_init.php @@ -1,5 +1,4 @@ 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( diff --git a/lib/formfields/admin/admin/formfield.admin_edit.php b/lib/formfields/admin/admin/formfield.admin_edit.php index f081d0a2..a207767c 100644 --- a/lib/formfields/admin/admin/formfield.admin_edit.php +++ b/lib/formfields/admin/admin/formfield.admin_edit.php @@ -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'].' ('.$lng['panel']['emptyfornochanges'].')', + 'label' => $lng['login']['password'] . ' (' . $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'], diff --git a/lib/formfields/admin/cronjobs/formfield.cronjobs_edit.php b/lib/formfields/admin/cronjobs/formfield.cronjobs_edit.php index 7c71dbc0..75607699 100644 --- a/lib/formfields/admin/cronjobs/formfield.cronjobs_edit.php +++ b/lib/formfields/admin/cronjobs/formfield.cronjobs_edit.php @@ -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'], diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index c67f32c8..2afb1b2b 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -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( diff --git a/lib/formfields/admin/customer/formfield.customer_edit.php b/lib/formfields/admin/customer/formfield.customer_edit.php index 2202a1de..9f5879da 100644 --- a/lib/formfields/admin/customer/formfield.customer_edit.php +++ b/lib/formfields/admin/customer/formfield.customer_edit.php @@ -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'].' ('.$lng['panel']['emptyfornochanges'].')', + 'label' => $lng['login']['password'] . ' (' . $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'] + ) ) ) ), diff --git a/lib/formfields/admin/domains/formfield.domains_add.php b/lib/formfields/admin/domains/formfield.domains_add.php index 0fe4bbe8..48b7b243 100644 --- a/lib/formfields/admin/domains/formfield.domains_add.php +++ b/lib/formfields/admin/domains/formfield.domains_add.php @@ -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( diff --git a/lib/formfields/admin/domains/formfield.domains_edit.php b/lib/formfields/admin/domains/formfield.domains_edit.php index c80cc7e1..4c756ec1 100644 --- a/lib/formfields/admin/domains/formfield.domains_edit.php +++ b/lib/formfields/admin/domains/formfield.domains_edit.php @@ -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( diff --git a/lib/formfields/admin/domains/formfield.domains_import.php b/lib/formfields/admin/domains/formfield.domains_import.php index 4fcf4fa4..060b8111 100644 --- a/lib/formfields/admin/domains/formfield.domains_import.php +++ b/lib/formfields/admin/domains/formfield.domains_import.php @@ -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'], diff --git a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php index 0f9074a6..9a1348f0 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php @@ -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() ), diff --git a/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php b/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php index 1fc75d0f..efa5161b 100644 --- a/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php +++ b/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php @@ -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'], diff --git a/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php b/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php index d5e86de2..b2074877 100644 --- a/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php +++ b/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'fpmconfig_add' => array( 'title' => $lng['admin']['phpsettings']['addsettings'], diff --git a/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php b/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php index 74593812..01209b21 100644 --- a/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php +++ b/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'fpmconfig_edit' => array( 'title' => $lng['admin']['phpsettings']['editsettings'], diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php index 9c977bac..4c032912 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php @@ -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' ), diff --git a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php index a96eaa35..ef6acff5 100644 --- a/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php +++ b/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php @@ -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'] ), diff --git a/lib/formfields/admin/plans/formfield.plans_add.php b/lib/formfields/admin/plans/formfield.plans_add.php index dcb0d1c7..7228ba32 100644 --- a/lib/formfields/admin/plans/formfield.plans_add.php +++ b/lib/formfields/admin/plans/formfield.plans_add.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'plans_add' => array( 'title' => $lng['admin']['plans']['add'], diff --git a/lib/formfields/admin/plans/formfield.plans_edit.php b/lib/formfields/admin/plans/formfield.plans_edit.php index 551977d4..5efb6b2c 100644 --- a/lib/formfields/admin/plans/formfield.plans_edit.php +++ b/lib/formfields/admin/plans/formfield.plans_edit.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'plans_edit' => array( 'title' => $lng['admin']['plans']['edit'], diff --git a/lib/formfields/admin/templates/formfield.filetemplate_add.php b/lib/formfields/admin/templates/formfield.filetemplate_add.php index 699009af..ace5c880 100644 --- a/lib/formfields/admin/templates/formfield.filetemplate_add.php +++ b/lib/formfields/admin/templates/formfield.filetemplate_add.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'filetemplate_add' => array( 'title' => $lng['admin']['templates']['template_add'], diff --git a/lib/formfields/admin/templates/formfield.filetemplate_edit.php b/lib/formfields/admin/templates/formfield.filetemplate_edit.php index 9fb7ad10..91d6885b 100644 --- a/lib/formfields/admin/templates/formfield.filetemplate_edit.php +++ b/lib/formfields/admin/templates/formfield.filetemplate_edit.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'filetemplate_edit' => array( 'title' => $lng['admin']['templates']['template_edit'], diff --git a/lib/formfields/admin/templates/formfield.template_add.php b/lib/formfields/admin/templates/formfield.template_add.php index 48b9c22c..ce9c277f 100644 --- a/lib/formfields/admin/templates/formfield.template_add.php +++ b/lib/formfields/admin/templates/formfield.template_add.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'template_add' => array( 'title' => $lng['admin']['templates']['template_add'], diff --git a/lib/formfields/admin/templates/formfield.template_edit.php b/lib/formfields/admin/templates/formfield.template_edit.php index aeb49dfb..d6b1c70a 100644 --- a/lib/formfields/admin/templates/formfield.template_edit.php +++ b/lib/formfields/admin/templates/formfield.template_edit.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'template_edit' => array( 'title' => $lng['admin']['templates']['template_edit'], diff --git a/lib/formfields/customer/domains/formfield.domain_ssleditor.php b/lib/formfields/customer/domains/formfield.domain_ssleditor.php index 1e4de102..e6a14faa 100644 --- a/lib/formfields/customer/domains/formfield.domain_ssleditor.php +++ b/lib/formfields/customer/domains/formfield.domain_ssleditor.php @@ -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, diff --git a/lib/formfields/customer/domains/formfield.domains_add.php b/lib/formfields/customer/domains/formfield.domains_add.php index f516baf1..00d9fca6 100644 --- a/lib/formfields/customer/domains/formfield.domains_add.php +++ b/lib/formfields/customer/domains/formfield.domains_add.php @@ -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'].'
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? $pathSelect['note'] . '
' . $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() - ), - ), - ), + ) + ) + ) ) ) ); diff --git a/lib/formfields/customer/domains/formfield.domains_edit.php b/lib/formfields/customer/domains/formfield.domains_edit.php index ef8e496a..56a28543 100644 --- a/lib/formfields/customer/domains/formfield.domains_edit.php +++ b/lib/formfields/customer/domains/formfield.domains_edit.php @@ -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']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null) . (isset($pathSelect['note']) ? '
' . $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'] + ) + ) ) - ), + ) ) ) ); diff --git a/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php b/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php index e92c8bf1..cc242aa6 100644 --- a/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php +++ b/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php @@ -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() ) ) ) diff --git a/lib/formfields/customer/email/formfield.emails_accountchangequota.php b/lib/formfields/customer/email/formfield.emails_accountchangequota.php index dab39c31..90821a66 100644 --- a/lib/formfields/customer/email/formfield.emails_accountchangequota.php +++ b/lib/formfields/customer/email/formfield.emails_accountchangequota.php @@ -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'] ) diff --git a/lib/formfields/customer/email/formfield.emails_add.php b/lib/formfields/customer/email/formfield.emails_add.php index 83510f6a..514306ef 100644 --- a/lib/formfields/customer/email/formfield.emails_add.php +++ b/lib/formfields/customer/email/formfield.emails_add.php @@ -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() ) ) diff --git a/lib/formfields/customer/email/formfield.emails_addaccount.php b/lib/formfields/customer/email/formfield.emails_addaccount.php index 61751850..111d0dd5 100644 --- a/lib/formfields/customer/email/formfield.emails_addaccount.php +++ b/lib/formfields/customer/email/formfield.emails_addaccount.php @@ -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), diff --git a/lib/formfields/customer/email/formfield.emails_addforwarder.php b/lib/formfields/customer/email/formfield.emails_addforwarder.php index 4d0e9293..79cd4f4d 100644 --- a/lib/formfields/customer/email/formfield.emails_addforwarder.php +++ b/lib/formfields/customer/email/formfield.emails_addforwarder.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'emails_addforwarder' => array( 'title' => $lng['emails']['forwarder_add'], diff --git a/lib/formfields/customer/email/formfield.emails_edit.php b/lib/formfields/customer/email/formfield.emails_edit.php index b0befd21..6e687681 100644 --- a/lib/formfields/customer/email/formfield.emails_edit.php +++ b/lib/formfields/customer/email/formfield.emails_edit.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'emails_edit' => array( 'title' => $lng['emails']['emails_edit'], @@ -34,29 +33,29 @@ return array( 'visible' => ($result['popaccountid'] != 0 ? true : false), 'label' => $lng['emails']['account'], 'type' => 'label', - 'value' => $lng['panel']['yes'].' ['.$lng['menue']['main']['changepassword'].'] ['.$lng['emails']['account_delete'].']' + 'value' => $lng['panel']['yes'] . ' [' . $lng['menue']['main']['changepassword'] . '] [' . $lng['emails']['account_delete'] . ']' ), 'account_no' => array( 'visible' => ($result['popaccountid'] == 0 ? true : false), 'label' => $lng['emails']['account'], 'type' => 'label', - 'value' => $lng['panel']['no'].' ['.$lng['emails']['account_add'].']' + 'value' => $lng['panel']['no'] . ' [' . $lng['emails']['account_add'] . ']' ), 'mail_quota' => array( 'visible' => ($result['popaccountid'] != 0 && \Froxlor\Settings::Get('system.mail_quota_enabled')), 'label' => $lng['customer']['email_quota'], 'type' => 'label', - 'value' => $result['quota'].' MiB ['.$lng['emails']['quota_edit'].']' + 'value' => $result['quota'] . ' MiB [' . $lng['emails']['quota_edit'] . ']' ), 'mail_catchall' => array( 'label' => $lng['emails']['catchall'], 'type' => 'label', - 'value' => ($result['iscatchall'] == 0 ? $lng['panel']['no'] : $lng['panel']['yes']).' ['.$lng['panel']['toggle'].']' + 'value' => ($result['iscatchall'] == 0 ? $lng['panel']['no'] : $lng['panel']['yes']) . ' [' . $lng['panel']['toggle'] . ']' ), 'mail_fwds' => array( - 'label' => $lng['emails']['forwarders'].' ('.$forwarders_count.')', + 'label' => $lng['emails']['forwarders'] . ' (' . $forwarders_count . ')', 'type' => 'label', - 'value' => $forwarders.' '.$lng['emails']['forwarder_add'].'' + 'value' => $forwarders . ' ' . $lng['emails']['forwarder_add'] . '' ) ) ) diff --git a/lib/formfields/customer/extras/formfield.backup.php b/lib/formfields/customer/extras/formfield.backup.php index 99bcdf0f..4a756613 100644 --- a/lib/formfields/customer/extras/formfield.backup.php +++ b/lib/formfields/customer/extras/formfield.backup.php @@ -25,7 +25,7 @@ return array( 'fields' => array( 'path' => array( 'label' => $lng['panel']['backuppath']['title'], - 'desc' => $lng['panel']['backuppath']['description'].'
'.(\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$pathSelect['value'] : ''), + 'desc' => $lng['panel']['backuppath']['description'] . '
' . (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '
' . $pathSelect['value'] : ''), 'type' => $pathSelect['type'], 'select_var' => $pathSelect['value'], 'value' => $pathSelect['value'] @@ -44,7 +44,9 @@ return array( 'value' => '1' ) ), - 'value' => array('1') + 'value' => array( + '1' + ) ), 'backup_mail' => array( 'label' => $lng['extras']['backup_mail'], @@ -55,7 +57,9 @@ return array( 'value' => '1' ) ), - 'value' => array('1') + 'value' => array( + '1' + ) ), 'backup_dbs' => array( 'label' => $lng['extras']['backup_dbs'], @@ -66,7 +70,9 @@ return array( 'value' => '1' ) ), - 'value' => array('1') + 'value' => array( + '1' + ) ) ) ) diff --git a/lib/formfields/customer/extras/formfield.htaccess_add.php b/lib/formfields/customer/extras/formfield.htaccess_add.php index 8c736353..87ee8b66 100644 --- a/lib/formfields/customer/extras/formfield.htaccess_add.php +++ b/lib/formfields/customer/extras/formfield.htaccess_add.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'htaccess_add' => array( 'title' => $lng['extras']['pathoptions_add'], @@ -26,7 +25,7 @@ return array( 'fields' => array( 'path' => array( 'label' => $lng['panel']['path'], - 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '
' . $pathSelect['value'] : ''), 'type' => $pathSelect['type'], 'select_var' => $pathSelect['value'], 'value' => $pathSelect['value'] @@ -35,8 +34,11 @@ return array( 'label' => $lng['extras']['directory_browsing'], 'type' => 'checkbox', 'values' => array( - array ('label' => $lng['panel']['yes'], 'value' => '1') - ), + array( + 'label' => $lng['panel']['yes'], + 'value' => '1' + ) + ), 'value' => array() ), 'error404path' => array( @@ -61,8 +63,11 @@ return array( 'label' => $lng['extras']['execute_perl'], 'type' => 'checkbox', 'values' => array( - array ('label' => $lng['panel']['yes'], 'value' => '1') - ), + array( + 'label' => $lng['panel']['yes'], + 'value' => '1' + ) + ), 'value' => array() ) ) diff --git a/lib/formfields/customer/extras/formfield.htaccess_edit.php b/lib/formfields/customer/extras/formfield.htaccess_edit.php index ffc84787..f73f7d93 100644 --- a/lib/formfields/customer/extras/formfield.htaccess_edit.php +++ b/lib/formfields/customer/extras/formfield.htaccess_edit.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'htaccess_edit' => array( 'title' => $lng['extras']['pathoptions_edit'], @@ -33,9 +32,14 @@ return array( 'label' => $lng['extras']['directory_browsing'], 'type' => 'checkbox', 'values' => array( - array ('label' => $lng['panel']['yes'], 'value' => '1') - ), - 'value' => array($result['options_indexes']) + array( + 'label' => $lng['panel']['yes'], + 'value' => '1' + ) + ), + 'value' => array( + $result['options_indexes'] + ) ), 'error404path' => array( 'label' => $lng['extras']['errordocument404path'], @@ -62,9 +66,14 @@ return array( 'label' => $lng['extras']['execute_perl'], 'type' => 'checkbox', 'values' => array( - array ('label' => $lng['panel']['yes'], 'value' => '1') - ), - 'value' => array($result['options_cgi']) + array( + 'label' => $lng['panel']['yes'], + 'value' => '1' + ) + ), + 'value' => array( + $result['options_cgi'] + ) ) ) ) diff --git a/lib/formfields/customer/extras/formfield.htpasswd_add.php b/lib/formfields/customer/extras/formfield.htpasswd_add.php index 82b6d325..87a6e5d8 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_add.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_add.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'htpasswd_add' => array( 'title' => $lng['extras']['directoryprotection_add'], @@ -26,7 +25,7 @@ return array( 'fields' => array( 'path' => array( 'label' => $lng['panel']['path'], - 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '
' . $pathSelect['value'] : ''), 'type' => $pathSelect['type'], 'select_var' => $pathSelect['value'], 'value' => $pathSelect['value'] @@ -44,7 +43,7 @@ return array( 'label' => $lng['customer']['generated_pwd'], 'type' => 'text', 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), - 'value' => \Froxlor\System\Crypt::generatePassword(), + 'value' => \Froxlor\System\Crypt::generatePassword() ), 'directory_authname' => array( 'label' => $lng['extras']['htpasswdauthname'], diff --git a/lib/formfields/customer/extras/formfield.htpasswd_edit.php b/lib/formfields/customer/extras/formfield.htpasswd_edit.php index 2458a00e..607ef682 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_edit.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_edit.php @@ -14,7 +14,6 @@ * @package Formfields * */ - return array( 'htpasswd_edit' => array( 'title' => $lng['extras']['directoryprotection_edit'], @@ -43,7 +42,7 @@ return array( 'label' => $lng['customer']['generated_pwd'], 'type' => 'text', 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), - 'value' => \Froxlor\System\Crypt::generatePassword(), + 'value' => \Froxlor\System\Crypt::generatePassword() ), 'directory_authname' => array( 'label' => $lng['extras']['htpasswdauthname'], diff --git a/lib/formfields/customer/ftp/formfield.ftp_add.php b/lib/formfields/customer/ftp/formfield.ftp_add.php index 56ccb97f..ded4d0c6 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_add.php +++ b/lib/formfields/customer/ftp/formfield.ftp_add.php @@ -13,7 +13,6 @@ * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Formfields */ - return array( 'ftp_add' => array( 'title' => $lng['ftp']['account_add'], @@ -32,7 +31,7 @@ return array( 'visible' => (\Froxlor\Settings::Get('customer.ftpatdomain') == '1' ? true : false), 'label' => $lng['domains']['domainname'], 'type' => 'select', - 'select_var' => (isset($domains) ? $domains : ""), + 'select_var' => (isset($domains) ? $domains : "") ), 'ftp_description' => array( 'label' => $lng['panel']['ftpdesc'] = 'FTP description', @@ -40,7 +39,7 @@ return array( ), 'path' => array( 'label' => $lng['panel']['path'], - 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '
' . $pathSelect['value'] : ''), 'type' => $pathSelect['type'], 'select_var' => $pathSelect['value'], 'value' => $pathSelect['value'] @@ -54,21 +53,24 @@ 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() ), 'sendinfomail' => array( 'label' => $lng['customer']['sendinfomail'], 'type' => 'checkbox', 'values' => array( - array ('label' => $lng['panel']['yes'], 'value' => '1') - ), + array( + 'label' => $lng['panel']['yes'], + 'value' => '1' + ) + ), 'value' => array() ), 'shell' => array( 'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false), 'label' => $lng['panel']['shell'], 'type' => 'select', - 'select_var' => (isset($shells) ? $shells : ""), + 'select_var' => (isset($shells) ? $shells : "") ) ) ) diff --git a/lib/formfields/customer/ftp/formfield.ftp_edit.php b/lib/formfields/customer/ftp/formfield.ftp_edit.php index c403bce6..727bd7a7 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_edit.php +++ b/lib/formfields/customer/ftp/formfield.ftp_edit.php @@ -13,7 +13,6 @@ * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Formfields */ - return array( 'ftp_edit' => array( 'title' => $lng['ftp']['account_edit'], @@ -26,7 +25,7 @@ return array( 'username' => array( 'label' => $lng['login']['username'], 'type' => 'label', - 'value' => $result['username'], + 'value' => $result['username'] ), 'ftp_description' => array( 'label' => $lng['panel']['ftpdesc'] = 'FTP description', @@ -35,7 +34,7 @@ return array( ), 'path' => array( 'label' => $lng['panel']['path'], - 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '
'.$pathSelect['value'] : ''), + 'desc' => (\Froxlor\Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null) . (isset($pathSelect['note']) ? '
' . $pathSelect['value'] : ''), 'type' => $pathSelect['type'], 'select_var' => $pathSelect['value'], 'value' => $pathSelect['value'] @@ -50,13 +49,13 @@ 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() ), 'shell' => array( 'visible' => (\Froxlor\Settings::Get('system.allow_customer_shell') == '1' ? true : false), 'label' => $lng['panel']['shell'], 'type' => 'select', - 'select_var' => (isset($shells) ? $shells : ""), + 'select_var' => (isset($shells) ? $shells : "") ) ) ) diff --git a/lib/formfields/customer/mysql/formfield.mysql_add.php b/lib/formfields/customer/mysql/formfield.mysql_add.php index e6fe207c..3782fcf8 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_add.php +++ b/lib/formfields/customer/mysql/formfield.mysql_add.php @@ -14,48 +14,48 @@ * @package Formfields */ return array( - 'mysql_add' => array( - 'title' => $lng['mysql']['database_create'], - 'image' => 'icons/mysql_add.png', - 'sections' => array( - 'section_a' => array( - 'title' => $lng['mysql']['database_create'], - 'image' => 'icons/mysql_add.png', - 'fields' => array( - 'description' => array( - 'label' => $lng['mysql']['databasedescription'], - 'type' => 'text' - ), - 'mysql_server' => array( - 'visible' => (1 < $count_mysqlservers ? true : false), - 'label' => $lng['mysql']['mysql_server'], - 'type' => 'select', - 'select_var' => $mysql_servers - ), - 'mysql_password' => array( - 'label' => $lng['login']['password'], - 'type' => 'password', - 'autocomplete' => 'off' - ), - 'mysql_password_suggestion' => array( - 'label' => $lng['customer']['generated_pwd'], - 'type' => 'text', - 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), - 'value' => \Froxlor\System\Crypt::generatePassword() - ), - 'sendinfomail' => array( - 'label' => $lng['customer']['sendinfomail'], - 'type' => 'checkbox', - 'values' => array( - array( - 'label' => $lng['panel']['yes'], - 'value' => '1' - ) - ), - 'value' => array() - ) - ) - ) - ) - ) + 'mysql_add' => array( + 'title' => $lng['mysql']['database_create'], + 'image' => 'icons/mysql_add.png', + 'sections' => array( + 'section_a' => array( + 'title' => $lng['mysql']['database_create'], + 'image' => 'icons/mysql_add.png', + 'fields' => array( + 'description' => array( + 'label' => $lng['mysql']['databasedescription'], + 'type' => 'text' + ), + 'mysql_server' => array( + 'visible' => (1 < $count_mysqlservers ? true : false), + 'label' => $lng['mysql']['mysql_server'], + 'type' => 'select', + 'select_var' => $mysql_servers + ), + 'mysql_password' => array( + 'label' => $lng['login']['password'], + 'type' => 'password', + 'autocomplete' => 'off' + ), + 'mysql_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), + 'value' => \Froxlor\System\Crypt::generatePassword() + ), + 'sendinfomail' => array( + 'label' => $lng['customer']['sendinfomail'], + 'type' => 'checkbox', + 'values' => array( + array( + 'label' => $lng['panel']['yes'], + 'value' => '1' + ) + ), + 'value' => array() + ) + ) + ) + ) + ) ); diff --git a/lib/formfields/customer/mysql/formfield.mysql_edit.php b/lib/formfields/customer/mysql/formfield.mysql_edit.php index 44443ea6..4748fa84 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_edit.php +++ b/lib/formfields/customer/mysql/formfield.mysql_edit.php @@ -14,43 +14,43 @@ * @package Formfields */ return array( - 'mysql_edit' => array( - 'title' => $lng['mysql']['database_edit'], - 'image' => 'icons/mysql_edit.png', - 'sections' => array( - 'section_a' => array( - 'title' => $lng['mysql']['database_edit'], - 'image' => 'icons/mysql_edit.png', - 'fields' => array( - 'databasename' => array( - 'label' => $lng['mysql']['databasename'], - 'type' => 'label', - 'value' => $result['databasename'] - ), - 'description' => array( - 'label' => $lng['mysql']['databasedescription'], - 'type' => 'text', - 'value' => $result['description'] - ), - 'mysql_server' => array( - 'visible' => (1 < $count_mysqlservers ? true : false), - 'label' => $lng['mysql']['mysql_server'], - 'type' => 'label', - 'value' => $sql_root['caption'] - ), - 'mysql_password' => array( - 'label' => $lng['changepassword']['new_password_ifnotempty'], - 'type' => 'password', - 'autocomplete' => 'off' - ), - 'mysql_password_suggestion' => array( - 'label' => $lng['customer']['generated_pwd'], - 'type' => 'text', - 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), - 'value' => \Froxlor\System\Crypt::generatePassword() - ) - ) - ) - ) - ) + 'mysql_edit' => array( + 'title' => $lng['mysql']['database_edit'], + 'image' => 'icons/mysql_edit.png', + 'sections' => array( + 'section_a' => array( + 'title' => $lng['mysql']['database_edit'], + 'image' => 'icons/mysql_edit.png', + 'fields' => array( + 'databasename' => array( + 'label' => $lng['mysql']['databasename'], + 'type' => 'label', + 'value' => $result['databasename'] + ), + 'description' => array( + 'label' => $lng['mysql']['databasedescription'], + 'type' => 'text', + 'value' => $result['description'] + ), + 'mysql_server' => array( + 'visible' => (1 < $count_mysqlservers ? true : false), + 'label' => $lng['mysql']['mysql_server'], + 'type' => 'label', + 'value' => $sql_root['caption'] + ), + 'mysql_password' => array( + 'label' => $lng['changepassword']['new_password_ifnotempty'], + 'type' => 'password', + 'autocomplete' => 'off' + ), + 'mysql_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), + 'value' => \Froxlor\System\Crypt::generatePassword() + ) + ) + ) + ) + ) ); diff --git a/lib/functions.php b/lib/functions.php index 5b23b94f..b1948c98 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -16,7 +16,6 @@ * @package Functions * */ - $libdirname = dirname(__FILE__); includeFunctions($libdirname . '/functions/'); @@ -24,17 +23,13 @@ includeFunctions($libdirname . '/functions/'); function includeFunctions($dirname) { $dirhandle = opendir($dirname); - while(false !== ($filename = readdir($dirhandle))) - { - if($filename != '.' && $filename != '..' && $filename != '') - { - if((substr($filename, 0, 9) == 'function.' || substr($filename, 0, 9) == 'constant.') && substr($filename, -4 ) == '.php') - { - include($dirname . $filename); + while (false !== ($filename = readdir($dirhandle))) { + if ($filename != '.' && $filename != '..' && $filename != '') { + if ((substr($filename, 0, 9) == 'function.' || substr($filename, 0, 9) == 'constant.') && substr($filename, - 4) == '.php') { + include ($dirname . $filename); } - if(is_dir($dirname . $filename)) - { + if (is_dir($dirname . $filename)) { includeFunctions($dirname . $filename . '/'); } } @@ -50,19 +45,22 @@ Autoloader::init(); * iterates through given directory and includes * the file which matches $classname * - * @copyright (c) the authors - * @author Froxlor team (2013-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Autoloader - * @since 0.9.29.1 + * @copyright (c) the authors + * @author Froxlor team (2013-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Autoloader + * @since 0.9.29.1 */ -class Autoloader { +class Autoloader +{ /** * returns a new AutoLoader-object + * * @return Autoloader */ - public static function init() { + public static function init() + { return new self(); } @@ -71,9 +69,13 @@ class Autoloader { * * @return null */ - public function __construct() { + public function __construct() + { // register autoload.function - spl_autoload_register(array($this, 'doAutoload')); + spl_autoload_register(array( + $this, + 'doAutoload' + )); } /** @@ -85,11 +87,12 @@ class Autoloader { * @throws Exception * @return boolean */ - public function doAutoload($class) { + public function doAutoload($class) + { // define the paths where to look for classes $paths = array( - dirname(dirname(__FILE__)) . '/install/' + dirname(dirname(__FILE__)) . '/install/' ); // don't load anything from a namespace, it's not our responsibility @@ -102,12 +105,10 @@ class Autoloader { // valid directory? if (is_dir($path)) { // create RecursiveIteratorIterator - $its = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($path) - ); + $its = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); // check every file - foreach ($its as $fullFileName => $it ) { + foreach ($its as $fullFileName => $it) { // does it match the Filename pattern? if (preg_match("/^(class|module|interface|abstract|)\.?$class\.php$/i", $it->getFilename())) { // include the file and return from the loop @@ -117,10 +118,10 @@ class Autoloader { } } else { // yikes - no valid directory to check - throw new Exception("Cannot autoload from directory '".$path."'. No such directory."); + throw new Exception("Cannot autoload from directory '" . $path . "'. No such directory."); } } // yikes - class not found - throw new Exception("Could not find class '".$class."'"); + throw new Exception("Could not find class '" . $class . "'"); } } diff --git a/lib/functions/formfields/bool/function.getFormFieldDataBool.php b/lib/functions/formfields/bool/function.getFormFieldDataBool.php index fdc8b194..2044e826 100644 --- a/lib/functions/formfields/bool/function.getFormFieldDataBool.php +++ b/lib/functions/formfields/bool/function.getFormFieldDataBool.php @@ -16,15 +16,11 @@ * @package Functions * */ - function getFormFieldDataBool($fieldname, $fielddata, &$input) { - if(isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja')) - { + if (isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja')) { $newfieldvalue = '1'; - } - else - { + } else { $newfieldvalue = '0'; } diff --git a/lib/functions/formfields/bool/function.getFormFieldOutputBool.php b/lib/functions/formfields/bool/function.getFormFieldOutputBool.php index e767e139..d66e2efb 100644 --- a/lib/functions/formfields/bool/function.getFormFieldOutputBool.php +++ b/lib/functions/formfields/bool/function.getFormFieldOutputBool.php @@ -16,7 +16,6 @@ * @package Functions * */ - function getFormFieldOutputBool($fieldname, $fielddata, $do_show = true) { $label = $fielddata['label']; diff --git a/lib/functions/formfields/bool/function.validateFormFieldBool.php b/lib/functions/formfields/bool/function.validateFormFieldBool.php index 425a6638..a2ac1fa4 100644 --- a/lib/functions/formfields/bool/function.validateFormFieldBool.php +++ b/lib/functions/formfields/bool/function.validateFormFieldBool.php @@ -16,15 +16,11 @@ * @package Functions * */ - function validateFormFieldBool($fieldname, $fielddata, $newfieldvalue) { - if($newfieldvalue === '1' || $newfieldvalue === 1 || $newfieldvalue === true || strtolower($newfieldvalue) === 'yes' || strtolower($newfieldvalue) === 'ja' || $newfieldvalue === '0' || $newfieldvalue === 0 || $newfieldvalue === false || strtolower($newfieldvalue) === 'no' || strtolower($newfieldvalue) === 'nein' || strtolower($newfieldvalue) === '') - { + if ($newfieldvalue === '1' || $newfieldvalue === 1 || $newfieldvalue === true || strtolower($newfieldvalue) === 'yes' || strtolower($newfieldvalue) === 'ja' || $newfieldvalue === '0' || $newfieldvalue === 0 || $newfieldvalue === false || strtolower($newfieldvalue) === 'no' || strtolower($newfieldvalue) === 'nein' || strtolower($newfieldvalue) === '') { return true; - } - else - { + } else { return 'noboolean'; } } diff --git a/lib/functions/formfields/constant.formfields.php b/lib/functions/formfields/constant.formfields.php index 7f4a75c7..55ddb4fb 100644 --- a/lib/functions/formfields/constant.formfields.php +++ b/lib/functions/formfields/constant.formfields.php @@ -16,10 +16,9 @@ * @package Functions * */ - -if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_OK')) +if (! defined('FORMFIELDS_PLAUSIBILITY_CHECK_OK')) define('FORMFIELDS_PLAUSIBILITY_CHECK_OK', 0); -if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR')) +if (! defined('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR')) define('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR', 1); -if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION')) +if (! defined('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION')) define('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION', 2); diff --git a/lib/functions/formfields/date/function.getFormFieldOutputDate.php b/lib/functions/formfields/date/function.getFormFieldOutputDate.php index 2c39a4b4..4f52d6b9 100644 --- a/lib/functions/formfields/date/function.getFormFieldOutputDate.php +++ b/lib/functions/formfields/date/function.getFormFieldOutputDate.php @@ -16,11 +16,9 @@ * @package Functions * */ - function getFormFieldOutputDate($fieldname, $fielddata, $do_show = true) { - if(isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true) - { + if (isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true) { $fielddata['value'] = date('Y-m-d', $fielddata['value']); } diff --git a/lib/functions/formfields/date/function.manipulateFormFieldDataDate.php b/lib/functions/formfields/date/function.manipulateFormFieldDataDate.php index 82693ac3..70222360 100644 --- a/lib/functions/formfields/date/function.manipulateFormFieldDataDate.php +++ b/lib/functions/formfields/date/function.manipulateFormFieldDataDate.php @@ -16,11 +16,9 @@ * @package Functions * */ - function manipulateFormFieldDataDate($fieldname, $fielddata, $newfieldvalue) { - if(isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true) - { + if (isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true) { $newfieldvalue = strtotime($newfieldvalue); } diff --git a/lib/functions/formfields/date/function.validateFormFieldDate.php b/lib/functions/formfields/date/function.validateFormFieldDate.php index 8490ebb4..b1f20b7d 100644 --- a/lib/functions/formfields/date/function.validateFormFieldDate.php +++ b/lib/functions/formfields/date/function.validateFormFieldDate.php @@ -16,17 +16,13 @@ * @package Functions * */ - function validateFormFieldDate($fieldname, $fielddata, $newfieldvalue) { - if($newfieldvalue == '0000-00-00' || preg_match('/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', $newfieldvalue)) - { + if ($newfieldvalue == '0000-00-00' || preg_match('/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', $newfieldvalue)) { $returnvalue = true; - } - else - { + } else { $returnvalue = false; } - + return $returnvalue; } diff --git a/lib/functions/formfields/file/function.getFormFieldOutputFile.php b/lib/functions/formfields/file/function.getFormFieldOutputFile.php index d19a9bd4..16c08bf3 100644 --- a/lib/functions/formfields/file/function.getFormFieldOutputFile.php +++ b/lib/functions/formfields/file/function.getFormFieldOutputFile.php @@ -14,7 +14,6 @@ * @package Functions * */ - function getFormFieldOutputFile($fieldname, $fielddata, $do_show = true) { $label = $fielddata['label']; diff --git a/lib/functions/formfields/file/function.validateFormFieldFile.php b/lib/functions/formfields/file/function.validateFormFieldFile.php index 3680ae9d..c3847874 100644 --- a/lib/functions/formfields/file/function.validateFormFieldFile.php +++ b/lib/functions/formfields/file/function.validateFormFieldFile.php @@ -14,7 +14,6 @@ * @package Functions * */ - function validateFormFieldFile($fieldname, $fielddata, $newfieldvalue) { return true; diff --git a/lib/functions/formfields/function.buildForm.php b/lib/functions/formfields/function.buildForm.php index f325f8e2..ace8a342 100644 --- a/lib/functions/formfields/function.buildForm.php +++ b/lib/functions/formfields/function.buildForm.php @@ -16,32 +16,25 @@ * @package Functions * */ - function buildForm($form) { $fields = ''; - if(validateFormDefinition($form)) - { - foreach($form['groups'] as $groupname => $groupdetails) - { - if(isset($groupdetails['title']) && $groupdetails['title'] != '') - { + if (validateFormDefinition($form)) { + foreach ($form['groups'] as $groupname => $groupdetails) { + if (isset($groupdetails['title']) && $groupdetails['title'] != '') { $fields .= getFormGroupOutput($groupname, $groupdetails); } - - if(validateFieldDefinition($groupdetails)) - { + + if (validateFieldDefinition($groupdetails)) { // Prefetch form fields - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { $groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails)); $form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname]; } // Collect form field output - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { $fields .= getFormFieldOutput($fieldname, $fielddetails); } } diff --git a/lib/functions/formfields/function.buildFormEx.php b/lib/functions/formfields/function.buildFormEx.php index 96048840..77202010 100644 --- a/lib/functions/formfields/function.buildFormEx.php +++ b/lib/functions/formfields/function.buildFormEx.php @@ -14,9 +14,8 @@ * @package Settings * */ - -function buildFormEx($form, $part = '') { - +function buildFormEx($form, $part = '') +{ $fields = ''; if (validateFormDefinition($form)) { @@ -26,18 +25,18 @@ function buildFormEx($form, $part = '') { if (isset($groupdetails['title']) && $groupdetails['title'] != '') { $fields .= getFormOverviewGroupOutput($groupname, $groupdetails); } - } - // only show one section + } // only show one section elseif ($part != '' && ($groupname == $part || $part == 'all')) { /** * this part checks for the 'websrv_avail' entry in the settings-array - * if found, we check if the current webserver is in the array. If this + * if found, we check if the current webserver is in the array. + * If this * is not the case, we change the setting type to "hidden", #502 */ $do_show = true; if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) { $websrv = Settings::Get('system.webserver'); - if (!in_array($websrv, $groupdetails['websrv_avail'])) { + if (! in_array($websrv, $groupdetails['websrv_avail'])) { $do_show = false; } } @@ -49,24 +48,24 @@ function buildFormEx($form, $part = '') { $do_show = $groupdetails['visible']; } - //if ($do_show) { - if (isset($groupdetails['title']) && $groupdetails['title'] != '') { - $fields .= getFormGroupOutput($groupname, $groupdetails); + // if ($do_show) { + if (isset($groupdetails['title']) && $groupdetails['title'] != '') { + $fields .= getFormGroupOutput($groupname, $groupdetails); + } + + if (validateFieldDefinition($groupdetails)) { + // Prefetch form fields + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + $groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails)); + $form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname]; } - if (validateFieldDefinition($groupdetails)) { - // Prefetch form fields - foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { - $groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails)); - $form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname]; - } - - // Collect form field output - foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { - $fields .= getFormFieldOutput($fieldname, $fielddetails); - } + // Collect form field output + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + $fields .= getFormFieldOutput($fieldname, $fielddetails); } - //} + } + // } } } } diff --git a/lib/functions/formfields/function.checkPlausibilityFormField.php b/lib/functions/formfields/function.checkPlausibilityFormField.php index 6f77c7ac..d134ce3a 100644 --- a/lib/functions/formfields/function.checkPlausibilityFormField.php +++ b/lib/functions/formfields/function.checkPlausibilityFormField.php @@ -16,16 +16,12 @@ * @package Functions * */ - function checkPlausibilityFormField($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues) { $returnvalue = ''; - if(is_array($fielddata) && isset($fielddata['plausibility_check_method']) && $fielddata['plausibility_check_method'] != '' && function_exists($fielddata['plausibility_check_method'])) - { + if (is_array($fielddata) && isset($fielddata['plausibility_check_method']) && $fielddata['plausibility_check_method'] != '' && function_exists($fielddata['plausibility_check_method'])) { $returnvalue = call_user_func($fielddata['plausibility_check_method'], $fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues); - } - else - { + } else { $returnvalue = false; } return $returnvalue; diff --git a/lib/functions/formfields/function.getFormFieldData.php b/lib/functions/formfields/function.getFormFieldData.php index d44212ed..fa029ad4 100644 --- a/lib/functions/formfields/function.getFormFieldData.php +++ b/lib/functions/formfields/function.getFormFieldData.php @@ -16,26 +16,17 @@ * @package Functions * */ - function getFormFieldData($fieldname, $fielddata, &$input) { - if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type']))) - { + if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type']))) { $gfdFunc = 'getFormFieldData' . ucfirst($fielddata['type']); $newfieldvalue = $gfdFunc($fieldname, $fielddata, $input); - } - else - { - if(isset($input[$fieldname])) - { + } else { + if (isset($input[$fieldname])) { $newfieldvalue = $input[$fieldname]; - } - elseif(isset($fielddata['default'])) - { + } elseif (isset($fielddata['default'])) { $newfieldvalue = $fielddata['default']; - } - else - { + } else { $newfieldvalue = false; } } diff --git a/lib/functions/formfields/function.getFormFieldOutput.php b/lib/functions/formfields/function.getFormFieldOutput.php index c7e5b840..6b4abac2 100644 --- a/lib/functions/formfields/function.getFormFieldOutput.php +++ b/lib/functions/formfields/function.getFormFieldOutput.php @@ -16,17 +16,12 @@ * @package Functions * */ - -function getFormFieldOutput($fieldname, $fielddata) { - +function getFormFieldOutput($fieldname, $fielddata) +{ global $lng; $returnvalue = ''; - if (is_array($fielddata) - && isset($fielddata['type']) - && $fielddata['type'] != '' - && function_exists('getFormFieldOutput' . ucfirst($fielddata['type'])) - ) { + if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldOutput' . ucfirst($fielddata['type']))) { if (isset($fielddata['label']) && is_array($fielddata['label'])) { if (isset($fielddata['label']['title']) && isset($fielddata['label']['description'])) { $fielddata['label'] = '' . $fielddata['label']['title'] . '
' . $fielddata['label']['description']; @@ -35,7 +30,7 @@ function getFormFieldOutput($fieldname, $fielddata) { } } - if (!isset($fielddata['value'])) { + if (! isset($fielddata['value'])) { if (isset($fielddata['default'])) { $fielddata['value'] = $fielddata['default']; } else { @@ -45,15 +40,16 @@ function getFormFieldOutput($fieldname, $fielddata) { /** * this part checks for the 'websrv_avail' entry in the settings-array - * if found, we check if the current webserver is in the array. If this + * if found, we check if the current webserver is in the array. + * If this * is not the case, we change the setting type to "hidden", #502 */ $do_show = true; if (isset($fielddata['websrv_avail']) && is_array($fielddata['websrv_avail'])) { $websrv = Settings::Get('system.webserver'); - if (!in_array($websrv, $fielddata['websrv_avail'])) { + if (! in_array($websrv, $fielddata['websrv_avail'])) { $do_show = false; - $fielddata['label'].= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $fielddata['websrv_avail'])); + $fielddata['label'] .= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $fielddata['websrv_avail'])); } } @@ -62,14 +58,14 @@ function getFormFieldOutput($fieldname, $fielddata) { // be false due to websrv_avail if (isset($fielddata['visible']) && $do_show) { $do_show = $fielddata['visible']; - if (!$do_show) { - $fielddata['label'].= $lng['serversettings']['option_unavailable']; + if (! $do_show) { + $fielddata['label'] .= $lng['serversettings']['option_unavailable']; } } - //if ($do_show) { - $returnvalue = call_user_func('getFormFieldOutput' . ucfirst($fielddata['type']), $fieldname, $fielddata, $do_show); - //} + // if ($do_show) { + $returnvalue = call_user_func('getFormFieldOutput' . ucfirst($fielddata['type']), $fieldname, $fielddata, $do_show); + // } } return $returnvalue; } diff --git a/lib/functions/formfields/function.getFormGroupOutput.php b/lib/functions/formfields/function.getFormGroupOutput.php index 8f31a057..fe4058d7 100644 --- a/lib/functions/formfields/function.getFormGroupOutput.php +++ b/lib/functions/formfields/function.getFormGroupOutput.php @@ -16,16 +16,15 @@ * @package Functions * */ - -function getFormGroupOutput($groupname, $groupdetails) { - +function getFormGroupOutput($groupname, $groupdetails) +{ global $lng, $theme; eval("\$group = \"" . \Froxlor\UI\Template::getTemplate("settings/settings_group") . "\";"); return $group; } -function getFormOverviewGroupOutput($groupname, $groupdetails) { - +function getFormOverviewGroupOutput($groupname, $groupdetails) +{ global $lng, $filename, $s, $theme; $group = ''; @@ -34,38 +33,28 @@ function getFormOverviewGroupOutput($groupname, $groupdetails) { $activated = true; $option = ''; - if(isset($groupdetails['fields'])) - { - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { - if(isset($fielddetails['overview_option']) - && $fielddetails['overview_option'] == true - ) { - if($fielddetails['type'] != 'option' - && $fielddetails['type'] != 'bool') - { + if (isset($groupdetails['fields'])) { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + if (isset($fielddetails['overview_option']) && $fielddetails['overview_option'] == true) { + if ($fielddetails['type'] != 'option' && $fielddetails['type'] != 'bool') { \Froxlor\UI\Response::standard_error('overviewsettingoptionisnotavalidfield'); } - if($fielddetails['type'] == 'option') - { + if ($fielddetails['type'] == 'option') { $options_array = $fielddetails['option_options']; $options = ''; - foreach($options_array as $value => $vtitle) - { - $options .= makeoption($vtitle, $value, Settings::Get($fielddetails['settinggroup'].'.'.$fielddetails['varname'])); + foreach ($options_array as $value => $vtitle) { + $options .= makeoption($vtitle, $value, Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname'])); } - $option.= $fielddetails['label'].': '; - $option.= ''; + $option .= $fielddetails['label'] . ': '; + $option .= ''; $activated = true; - } - else - { - $option.= $lng['admin']['activated'].': '; - $option.= makeyesno($fieldname, '1', '0', Settings::Get($fielddetails['settinggroup'].'.'.$fielddetails['varname'])); - $activated = (int)Settings::Get($fielddetails['settinggroup'].'.'.$fielddetails['varname']); + } else { + $option .= $lng['admin']['activated'] . ': '; + $option .= makeyesno($fieldname, '1', '0', Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname'])); + $activated = (int) Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']); } } } @@ -73,13 +62,14 @@ function getFormOverviewGroupOutput($groupname, $groupdetails) { /** * this part checks for the 'websrv_avail' entry in the settings - * if found, we check if the current webserver is in the array. If this + * if found, we check if the current webserver is in the array. + * If this * is not the case, we change the setting type to "hidden", #502 */ $do_show = true; if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) { $websrv = Settings::Get('system.webserver'); - if (!in_array($websrv, $groupdetails['websrv_avail'])) { + if (! in_array($websrv, $groupdetails['websrv_avail'])) { $do_show = false; $title .= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $groupdetails['websrv_avail'])); // hack disabled flag into select-box diff --git a/lib/functions/formfields/function.manipulateFormFieldData.php b/lib/functions/formfields/function.manipulateFormFieldData.php index 112b1d6b..7d2b9db0 100644 --- a/lib/functions/formfields/function.manipulateFormFieldData.php +++ b/lib/functions/formfields/function.manipulateFormFieldData.php @@ -16,11 +16,9 @@ * @package Functions * */ - function manipulateFormFieldData($fieldname, $fielddata, $newfieldvalue) { - if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('manipulateFormFieldData' . ucfirst($fielddata['type']))) - { + if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('manipulateFormFieldData' . ucfirst($fielddata['type']))) { $newfieldvalue = call_user_func('manipulateFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, $newfieldvalue); } diff --git a/lib/functions/formfields/function.prefetchFormFieldData.php b/lib/functions/formfields/function.prefetchFormFieldData.php index 1e572289..280313bd 100644 --- a/lib/functions/formfields/function.prefetchFormFieldData.php +++ b/lib/functions/formfields/function.prefetchFormFieldData.php @@ -16,12 +16,10 @@ * @package Functions * */ - function prefetchFormFieldData($fieldname, $fielddata) { $returnvalue = array(); - if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('prefetchFormFieldData' . ucfirst($fielddata['type']))) - { + if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('prefetchFormFieldData' . ucfirst($fielddata['type']))) { $returnvalue = call_user_func('prefetchFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata); } return $returnvalue; diff --git a/lib/functions/formfields/function.processForm.php b/lib/functions/formfields/function.processForm.php index 198b0366..f036e5f7 100644 --- a/lib/functions/formfields/function.processForm.php +++ b/lib/functions/formfields/function.processForm.php @@ -16,45 +16,33 @@ * @package Functions * */ - function processForm(&$form, &$input, $url_params = array()) { - if(validateFormDefinition($form)) - { + if (validateFormDefinition($form)) { $submitted_fields = array(); $changed_fields = array(); $saved_fields = array(); - foreach($form['groups'] as $groupname => $groupdetails) - { - if(validateFieldDefinition($groupdetails)) - { + foreach ($form['groups'] as $groupname => $groupdetails) { + if (validateFieldDefinition($groupdetails)) { // Prefetch form fields - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { $groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails)); $form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname]; } } } - foreach($form['groups'] as $groupname => $groupdetails) - { - if(validateFieldDefinition($groupdetails)) - { + foreach ($form['groups'] as $groupname => $groupdetails) { + if (validateFieldDefinition($groupdetails)) { // Validate fields - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { $newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input); - if($newfieldvalue != $fielddetails['value']) - { - if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true) - { + if ($newfieldvalue != $fielddetails['value']) { + if (($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true) { \Froxlor\UI\Response::standard_error($error, $fieldname); - } - else - { + } else { $changed_fields[$fieldname] = $newfieldvalue; } } @@ -64,51 +52,37 @@ function processForm(&$form, &$input, $url_params = array()) } } - foreach($form['groups'] as $groupname => $groupdetails) - { - if(validateFieldDefinition($groupdetails)) - { + foreach ($form['groups'] as $groupname => $groupdetails) { + if (validateFieldDefinition($groupdetails)) { // Check fields for plausibility - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { - if(($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) - { - if(is_array($plausibility_check) && isset($plausibility_check[0])) - { - if($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK) - { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + if (($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) { + if (is_array($plausibility_check) && isset($plausibility_check[0])) { + if ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK) { // Nothing to do here, everything's okay - } - elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) - { + } elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) { unset($plausibility_check[0]); $error = $plausibility_check[1]; unset($plausibility_check[1]); $targetname = implode(' ', $plausibility_check); \Froxlor\UI\Response::standard_error($error, $targetname); - } - elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) - { + } elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) { unset($plausibility_check[0]); $question = $plausibility_check[1]; unset($plausibility_check[1]); $targetname = implode(' ', $plausibility_check); - if(!isset($input[$question])) - { - if(is_array($url_params) && isset($url_params['filename'])) - { + if (! isset($input[$question])) { + if (is_array($url_params) && isset($url_params['filename'])) { $filename = $url_params['filename']; unset($url_params['filename']); - } - else - { + } else { $filename = ''; } - ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array($question => $question)), $targetname); + ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array( + $question => $question + )), $targetname); } - } - else - { + } else { \Froxlor\UI\Response::standard_error('plausibilitychecknotunderstood'); } } @@ -117,21 +91,14 @@ function processForm(&$form, &$input, $url_params = array()) } } - foreach($form['groups'] as $groupname => $groupdetails) - { - if(validateFieldDefinition($groupdetails)) - { + foreach ($form['groups'] as $groupname => $groupdetails) { + if (validateFieldDefinition($groupdetails)) { // Save fields - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { - if(isset($changed_fields[$fieldname])) - { - if(($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false) - { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + if (isset($changed_fields[$fieldname])) { + if (($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false) { $saved_fields = array_merge($saved_fields, $saved_field); - } - else - { + } else { \Froxlor\UI\Response::standard_error('errorwhensaving', $fieldname); } } @@ -146,26 +113,17 @@ function processForm(&$form, &$input, $url_params = array()) function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_all, $settings_part, $only_enabledisable) { - if(validateFormDefinition($form)) - { + if (validateFormDefinition($form)) { $submitted_fields = array(); $changed_fields = array(); $saved_fields = array(); - foreach($form['groups'] as $groupname => $groupdetails) - { - if(($settings_part && $part == $groupname) - || $settings_all - || $only_enabledisable - ){ - if(validateFieldDefinition($groupdetails)) - { + foreach ($form['groups'] as $groupname => $groupdetails) { + if (($settings_part && $part == $groupname) || $settings_all || $only_enabledisable) { + if (validateFieldDefinition($groupdetails)) { // Prefetch form fields - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { - if(!$only_enabledisable - || ($only_enabledisable && isset($fielddetails['overview_option'])) - ) { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) { $groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails)); $form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname]; } @@ -174,29 +132,17 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_ } } - foreach($form['groups'] as $groupname => $groupdetails) - { - if(($settings_part && $part == $groupname) - || $settings_all - || $only_enabledisable - ){ - if(validateFieldDefinition($groupdetails)) - { + foreach ($form['groups'] as $groupname => $groupdetails) { + if (($settings_part && $part == $groupname) || $settings_all || $only_enabledisable) { + if (validateFieldDefinition($groupdetails)) { // Validate fields - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { - if(!$only_enabledisable - || ($only_enabledisable && isset($fielddetails['overview_option'])) - ) { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) { $newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input); - if($newfieldvalue != $fielddetails['value']) - { - if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true) - { + if ($newfieldvalue != $fielddetails['value']) { + if (($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true) { \Froxlor\UI\Response::standard_error($error, $fieldname); - } - else - { + } else { $changed_fields[$fieldname] = $newfieldvalue; } } @@ -208,58 +154,39 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_ } } - foreach($form['groups'] as $groupname => $groupdetails) - { - if(($settings_part && $part == $groupname) - || $settings_all - || $only_enabledisable - ){ - if(validateFieldDefinition($groupdetails)) - { + foreach ($form['groups'] as $groupname => $groupdetails) { + if (($settings_part && $part == $groupname) || $settings_all || $only_enabledisable) { + if (validateFieldDefinition($groupdetails)) { // Check fields for plausibility - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { - if(!$only_enabledisable - || ($only_enabledisable && isset($fielddetails['overview_option'])) - ) { - if(($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) - { - if(is_array($plausibility_check) && isset($plausibility_check[0])) - { - if($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK) - { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) { + if (($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false) { + if (is_array($plausibility_check) && isset($plausibility_check[0])) { + if ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK) { // Nothing to do here, everything's okay - } - elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) - { + } elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR) { unset($plausibility_check[0]); $error = $plausibility_check[1]; unset($plausibility_check[1]); $targetname = implode(' ', $plausibility_check); \Froxlor\UI\Response::standard_error($error, $targetname); - } - elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) - { + } elseif ($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION) { unset($plausibility_check[0]); $question = $plausibility_check[1]; unset($plausibility_check[1]); $targetname = implode(' ', $plausibility_check); - if(!isset($input[$question])) - { - if(is_array($url_params) && isset($url_params['filename'])) - { + if (! isset($input[$question])) { + if (is_array($url_params) && isset($url_params['filename'])) { $filename = $url_params['filename']; unset($url_params['filename']); - } - else - { + } else { $filename = ''; } - ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array($question => $question)), $targetname); + ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array( + $question => $question + )), $targetname); } - } - else - { + } else { \Froxlor\UI\Response::standard_error('plausibilitychecknotunderstood'); } } @@ -270,28 +197,16 @@ function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_ } } - foreach($form['groups'] as $groupname => $groupdetails) - { - if(($settings_part && $part == $groupname) - || $settings_all - || $only_enabledisable - ){ - if(validateFieldDefinition($groupdetails)) - { + foreach ($form['groups'] as $groupname => $groupdetails) { + if (($settings_part && $part == $groupname) || $settings_all || $only_enabledisable) { + if (validateFieldDefinition($groupdetails)) { // Save fields - foreach($groupdetails['fields'] as $fieldname => $fielddetails) - { - if(!$only_enabledisable - || ($only_enabledisable && isset($fielddetails['overview_option'])) - ) { - if(isset($changed_fields[$fieldname])) - { - if(($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false) - { + foreach ($groupdetails['fields'] as $fieldname => $fielddetails) { + if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) { + if (isset($changed_fields[$fieldname])) { + if (($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false) { $saved_fields = array_merge($saved_fields, $saved_field); - } - else - { + } else { \Froxlor\UI\Response::standard_error('errorwhensaving', $fieldname); } } diff --git a/lib/functions/formfields/function.returnField.php b/lib/functions/formfields/function.returnField.php index 56b6c9bd..12b44a89 100644 --- a/lib/functions/formfields/function.returnField.php +++ b/lib/functions/formfields/function.returnField.php @@ -16,8 +16,9 @@ * @package Functions * */ - function returnField($fieldname, $fielddata, $newfieldvalue) { - return array($fieldname => $newfieldvalue); + return array( + $fieldname => $newfieldvalue + ); } diff --git a/lib/functions/formfields/function.saveForm.php b/lib/functions/formfields/function.saveForm.php index 196d4e6a..1ea3b5f8 100644 --- a/lib/functions/formfields/function.saveForm.php +++ b/lib/functions/formfields/function.saveForm.php @@ -16,20 +16,17 @@ * @package Functions * */ - function saveForm($fielddata, $newfieldvalue) { $returnvalue = ''; - if(is_array($fielddata) && isset($fielddata['save_method']) && $fielddata['save_method'] != '') - { - $returnvalue = call_user_func(array('\\Froxlor\\Settings\\Store', $fielddata['save_method']), $fielddata, $newfieldvalue); - } - elseif(is_array($fielddata) && !isset($fielddata['save_method'])) - { + if (is_array($fielddata) && isset($fielddata['save_method']) && $fielddata['save_method'] != '') { + $returnvalue = call_user_func(array( + '\\Froxlor\\Settings\\Store', + $fielddata['save_method'] + ), $fielddata, $newfieldvalue); + } elseif (is_array($fielddata) && ! isset($fielddata['save_method'])) { $returnvalue = true; - } - else - { + } else { $returnvalue = false; } return $returnvalue; diff --git a/lib/functions/formfields/function.validateFormDefinition.php b/lib/functions/formfields/function.validateFormDefinition.php index 0d247b2a..dddbfc57 100644 --- a/lib/functions/formfields/function.validateFormDefinition.php +++ b/lib/functions/formfields/function.validateFormDefinition.php @@ -16,15 +16,13 @@ * @package Functions * */ - function validateFormDefinition($form) { $returnvalue = false; - - if(is_array($form) && !empty($form) && isset($form['groups']) && is_array($form['groups']) && !empty($form['groups'])) - { + + if (is_array($form) && ! empty($form) && isset($form['groups']) && is_array($form['groups']) && ! empty($form['groups'])) { $returnvalue = true; } - + return $returnvalue; } diff --git a/lib/functions/formfields/function.validateFormField.php b/lib/functions/formfields/function.validateFormField.php index fab5a165..1f074cb9 100644 --- a/lib/functions/formfields/function.validateFormField.php +++ b/lib/functions/formfields/function.validateFormField.php @@ -16,16 +16,12 @@ * @package Functions * */ - function validateFormField($fieldname, $fielddata, $newfieldvalue) { $returnvalue = ''; - if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('validateFormField' . ucfirst($fielddata['type']))) - { + if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('validateFormField' . ucfirst($fielddata['type']))) { $returnvalue = call_user_func('validateFormField' . ucfirst($fielddata['type']), $fieldname, $fielddata, $newfieldvalue); - } - else - { + } else { $returnvalue = 'validation method not found'; } return $returnvalue; diff --git a/lib/functions/formfields/hidden/function.getFormFieldOutputHidden.php b/lib/functions/formfields/hidden/function.getFormFieldOutputHidden.php index d6cb78d9..bf22a3d9 100644 --- a/lib/functions/formfields/hidden/function.getFormFieldOutputHidden.php +++ b/lib/functions/formfields/hidden/function.getFormFieldOutputHidden.php @@ -16,13 +16,11 @@ * @package Functions * */ - function getFormFieldOutputHidden($fieldname, $fielddata) { $returnvalue = ''; - if(isset($fielddata['label']) && $fielddata['label'] != '') - { + if (isset($fielddata['label']) && $fielddata['label'] != '') { $label = $fielddata['label']; $value = htmlentities($fielddata['value']); eval("\$returnvalue .= \"" . \Froxlor\UI\Template::getTemplate("formfields/hidden", true) . "\";"); diff --git a/lib/functions/formfields/hidden/function.validateFormFieldHidden.php b/lib/functions/formfields/hidden/function.validateFormFieldHidden.php index 2ebeb105..0d498813 100644 --- a/lib/functions/formfields/hidden/function.validateFormFieldHidden.php +++ b/lib/functions/formfields/hidden/function.validateFormFieldHidden.php @@ -16,7 +16,6 @@ * @package Functions * */ - function validateFormFieldHidden($fieldname, $fielddata, $newfieldvalue) { /** @@ -24,15 +23,9 @@ function validateFormFieldHidden($fieldname, $fielddata, $newfieldvalue) * because it might be possible that the cronjob ran * while settings have been edited (bug #52) */ - if($newfieldvalue === $fielddata['value'] - || $fieldname == 'system_last_tasks_run' - || $fieldname == 'system_last_traffic_run' - || $fieldname == 'system_lastcronrun' - ) { + if ($newfieldvalue === $fielddata['value'] || $fieldname == 'system_last_tasks_run' || $fieldname == 'system_last_traffic_run' || $fieldname == 'system_lastcronrun') { return true; - } - else - { + } else { return 'hiddenfieldvaluechanged'; } } diff --git a/lib/functions/formfields/hiddenstring/function.getFormFieldOutputString.php b/lib/functions/formfields/hiddenstring/function.getFormFieldOutputString.php index c8c3aaef..63e6ebf7 100644 --- a/lib/functions/formfields/hiddenstring/function.getFormFieldOutputString.php +++ b/lib/functions/formfields/hiddenstring/function.getFormFieldOutputString.php @@ -16,7 +16,6 @@ * @package Functions * */ - function getFormFieldOutputHiddenString($fieldname, $fielddata, $do_show = true) { $label = $fielddata['label']; diff --git a/lib/functions/formfields/hiddenstring/function.validateFormFieldString.php b/lib/functions/formfields/hiddenstring/function.validateFormFieldString.php index bb5bfa2a..99c093e8 100644 --- a/lib/functions/formfields/hiddenstring/function.validateFormFieldString.php +++ b/lib/functions/formfields/hiddenstring/function.validateFormFieldString.php @@ -16,100 +16,71 @@ * @package Functions * */ - function validateFormFieldHiddenString($fieldname, $fielddata, $newfieldvalue) { - if(isset($fielddata['string_delimiter']) && $fielddata['string_delimiter'] != '') - { + if (isset($fielddata['string_delimiter']) && $fielddata['string_delimiter'] != '') { $newfieldvalues = explode($fielddata['string_delimiter'], $newfieldvalue); unset($fielddata['string_delimiter']); $returnvalue = true; - foreach($newfieldvalues as $single_newfieldvalue) - { + foreach ($newfieldvalues as $single_newfieldvalue) { /** - * don't use tabs in value-fields, #81 - */ + * don't use tabs in value-fields, #81 + */ $single_newfieldvalue = str_replace("\t", " ", $single_newfieldvalue); $single_returnvalue = validateFormFieldString($fieldname, $fielddata, $single_newfieldvalue); - if($single_returnvalue !== true) - { + if ($single_returnvalue !== true) { $returnvalue = $single_returnvalue; break; } } - } - else - { + } else { $returnvalue = false; /** - * don't use tabs in value-fields, #81 - */ + * don't use tabs in value-fields, #81 + */ $newfieldvalue = str_replace("\t", " ", $newfieldvalue); - if(isset($fielddata['string_type']) && $fielddata['string_type'] == 'mail') - { + if (isset($fielddata['string_type']) && $fielddata['string_type'] == 'mail') { $returnvalue = (filter_var($newfieldvalue, FILTER_VALIDATE_EMAIL) == $newfieldvalue); - } - elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'url') - { + } elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'url') { $returnvalue = validateUrl($newfieldvalue); - } - elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir') - { + } elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir') { // add trailing slash to validate path if needed // refs #331 - if(substr($newfieldvalue, -1) != '/') { - $newfieldvalue.= '/'; + if (substr($newfieldvalue, - 1) != '/') { + $newfieldvalue .= '/'; } $returnvalue = ($newfieldvalue == \Froxlor\FileDir::makeCorrectDir($newfieldvalue)); - } - elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'file') - { + } elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'file') { $returnvalue = ($newfieldvalue == \Froxlor\FileDir::makeCorrectFile($newfieldvalue)); - } - elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'filedir') - { + } elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'filedir') { $returnvalue = (($newfieldvalue == \Froxlor\FileDir::makeCorrectDir($newfieldvalue)) || ($newfieldvalue == \Froxlor\FileDir::makeCorrectFile($newfieldvalue))); - } - elseif(preg_match('/^[^\r\n\t\f\0]*$/D', $newfieldvalue)) - { + } elseif (preg_match('/^[^\r\n\t\f\0]*$/D', $newfieldvalue)) { $returnvalue = true; } - if(isset($fielddata['string_regexp']) && $fielddata['string_regexp'] != '') - { - if(preg_match($fielddata['string_regexp'], $newfieldvalue)) - { + if (isset($fielddata['string_regexp']) && $fielddata['string_regexp'] != '') { + if (preg_match($fielddata['string_regexp'], $newfieldvalue)) { $returnvalue = true; - } - else - { + } else { $returnvalue = false; } } - if(isset($fielddata['string_emptyallowed']) && $fielddata['string_emptyallowed'] === true && $newfieldvalue === '') - { + if (isset($fielddata['string_emptyallowed']) && $fielddata['string_emptyallowed'] === true && $newfieldvalue === '') { $returnvalue = true; - } - elseif(isset($fielddata['string_emptyallowed']) && $fielddata['string_emptyallowed'] === false && $newfieldvalue === '') - { + } elseif (isset($fielddata['string_emptyallowed']) && $fielddata['string_emptyallowed'] === false && $newfieldvalue === '') { $returnvalue = 'stringmustntbeempty'; } } - - if($returnvalue === true) - { + + if ($returnvalue === true) { return true; - } - elseif($returnvalue === false) - { + } elseif ($returnvalue === false) { return 'stringformaterror'; - } - else - { + } else { return $returnvalue; } } \ No newline at end of file diff --git a/lib/functions/formfields/int/function.getFormFieldDataInt.php b/lib/functions/formfields/int/function.getFormFieldDataInt.php index 556ba831..cb53b6e9 100644 --- a/lib/functions/formfields/int/function.getFormFieldDataInt.php +++ b/lib/functions/formfields/int/function.getFormFieldDataInt.php @@ -16,16 +16,12 @@ * @package Functions * */ - function getFormFieldDataInt($fieldname, $fielddata, &$input) { - if(isset($input[$fieldname])) - { - $newfieldvalue = (int)$input[$fieldname]; - } - else - { - $newfieldvalue = (int)$fielddata['default']; + if (isset($input[$fieldname])) { + $newfieldvalue = (int) $input[$fieldname]; + } else { + $newfieldvalue = (int) $fielddata['default']; } return $newfieldvalue; diff --git a/lib/functions/formfields/int/function.getFormFieldOutputInt.php b/lib/functions/formfields/int/function.getFormFieldOutputInt.php index 4cbad457..500ec043 100644 --- a/lib/functions/formfields/int/function.getFormFieldOutputInt.php +++ b/lib/functions/formfields/int/function.getFormFieldOutputInt.php @@ -16,7 +16,6 @@ * @package Functions * */ - function getFormFieldOutputInt($fieldname, $fielddata, $do_show = true) { return getFormFieldOutputString($fieldname, $fielddata, $do_show); diff --git a/lib/functions/formfields/int/function.validateFormFieldInt.php b/lib/functions/formfields/int/function.validateFormFieldInt.php index 733d7615..3fa31656 100644 --- a/lib/functions/formfields/int/function.validateFormFieldInt.php +++ b/lib/functions/formfields/int/function.validateFormFieldInt.php @@ -16,17 +16,14 @@ * @package Functions * */ - function validateFormFieldInt($fieldname, $fielddata, $newfieldvalue) { - if(isset($fielddata['int_min']) && (int)$newfieldvalue < (int)$fielddata['int_min']) - { - return('intvaluetoolow'); + if (isset($fielddata['int_min']) && (int) $newfieldvalue < (int) $fielddata['int_min']) { + return ('intvaluetoolow'); } - if(isset($fielddata['int_max']) && (int)$newfieldvalue > (int)$fielddata['int_max']) - { - return('intvaluetoohigh'); + if (isset($fielddata['int_max']) && (int) $newfieldvalue > (int) $fielddata['int_max']) { + return ('intvaluetoohigh'); } return true; diff --git a/lib/functions/formfields/label/function.getFormFieldOutputLabel.php b/lib/functions/formfields/label/function.getFormFieldOutputLabel.php index 38b0ec67..e76c4fef 100644 --- a/lib/functions/formfields/label/function.getFormFieldOutputLabel.php +++ b/lib/functions/formfields/label/function.getFormFieldOutputLabel.php @@ -16,7 +16,6 @@ * @package Functions * */ - function getFormFieldOutputLabel($fieldname, $fielddata) { $label = $fielddata['label']; diff --git a/lib/functions/formfields/label/function.validateFormFieldLabel.php b/lib/functions/formfields/label/function.validateFormFieldLabel.php index 17191248..ccc74f45 100644 --- a/lib/functions/formfields/label/function.validateFormFieldLabel.php +++ b/lib/functions/formfields/label/function.validateFormFieldLabel.php @@ -16,11 +16,9 @@ * @package Functions * */ - function validateFormFieldLabel($fieldname, $fielddata, $newfieldvalue) { // Return false, in case we happen to have that field in our $input array, so someone doesn't get the chance to save crap to our database // TODO: Throw some error that actually makes sense - false would just throw unknown error - return false; } diff --git a/lib/functions/formfields/option/function.getFormFieldDataOption.php b/lib/functions/formfields/option/function.getFormFieldDataOption.php index 09b3b436..bd92aec6 100644 --- a/lib/functions/formfields/option/function.getFormFieldDataOption.php +++ b/lib/functions/formfields/option/function.getFormFieldDataOption.php @@ -16,20 +16,15 @@ * @package Functions * */ - function getFormFieldDataOption($fieldname, $fielddata, &$input) { - if(isset($input[$fieldname])) - { + if (isset($input[$fieldname])) { $newfieldvalue = $input[$fieldname]; - } - else - { + } else { $newfieldvalue = $fielddata['default']; } - - if(is_array($newfieldvalue)) - { + + if (is_array($newfieldvalue)) { $newfieldvalue = implode(',', $newfieldvalue); } diff --git a/lib/functions/formfields/option/function.getFormFieldOutputOption.php b/lib/functions/formfields/option/function.getFormFieldOutputOption.php index 786141b6..e7a491d5 100644 --- a/lib/functions/formfields/option/function.getFormFieldOutputOption.php +++ b/lib/functions/formfields/option/function.getFormFieldOutputOption.php @@ -16,28 +16,22 @@ * @package Functions * */ - function getFormFieldOutputOption($fieldname, $fielddata, $do_show = true) { $returnvalue = ''; - if(isset($fielddata['option_options']) && is_array($fielddata['option_options']) && !empty($fielddata['option_options'])) - { - if(isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple') - { + if (isset($fielddata['option_options']) && is_array($fielddata['option_options']) && ! empty($fielddata['option_options'])) { + if (isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple') { $multiple = true; $fielddata['value'] = explode(',', $fielddata['value']); - } - else - { + } else { $multiple = false; } $label = $fielddata['label']; $options_array = $fielddata['option_options']; $options = ''; - foreach($options_array as $value => $title) - { + foreach ($options_array as $value => $title) { $options .= makeoption($title, $value, $fielddata['value']); } eval("\$returnvalue = \"" . \Froxlor\UI\Template::getTemplate("formfields/option", true) . "\";"); diff --git a/lib/functions/formfields/option/function.prefetchFormFieldDataOption.php b/lib/functions/formfields/option/function.prefetchFormFieldDataOption.php index adb860e7..b3254018 100644 --- a/lib/functions/formfields/option/function.prefetchFormFieldDataOption.php +++ b/lib/functions/formfields/option/function.prefetchFormFieldDataOption.php @@ -16,15 +16,13 @@ * @package Functions * */ - function prefetchFormFieldDataOption($fieldname, $fielddata) { $returnvalue = array(); - - if((!isset($fielddata['option_options']) || !is_array($fielddata['option_options']) || empty($fielddata['option_options'])) && (isset($fielddata['option_options_method']) && function_exists($fielddata['option_options_method']))) - { + + if ((! isset($fielddata['option_options']) || ! is_array($fielddata['option_options']) || empty($fielddata['option_options'])) && (isset($fielddata['option_options_method']) && function_exists($fielddata['option_options_method']))) { $returnvalue['options'] = call_user_func($fielddata['option_options_method']); } - + return $returnvalue; } diff --git a/lib/functions/formfields/option/function.validateFormFieldOption.php b/lib/functions/formfields/option/function.validateFormFieldOption.php index 01b4be5f..3b6f57be 100644 --- a/lib/functions/formfields/option/function.validateFormFieldOption.php +++ b/lib/functions/formfields/option/function.validateFormFieldOption.php @@ -16,30 +16,22 @@ * @package Functions * */ - function validateFormFieldOption($fieldname, $fielddata, $newfieldvalue) { $returnvalue = true; - if(isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple') - { + if (isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple') { $options = explode(',', $newfieldvalue); - foreach($options as $option) - { + foreach ($options as $option) { $returnvalue = ($returnvalue && isset($fielddata['option_options'][$option])); } - } - else - { + } else { $returnvalue = isset($fielddata['option_options'][$newfieldvalue]); } - if($returnvalue === true || $fielddata['visible'] == false) - { + if ($returnvalue === true || $fielddata['visible'] == false) { return true; - } - else - { + } else { if (isset($fielddata['option_emptyallowed']) && $fielddata['option_emptyallowed']) { return true; } diff --git a/lib/functions/formfields/string/function.getFormFieldOutputString.php b/lib/functions/formfields/string/function.getFormFieldOutputString.php index 50ea8d55..78c5520e 100644 --- a/lib/functions/formfields/string/function.getFormFieldOutputString.php +++ b/lib/functions/formfields/string/function.getFormFieldOutputString.php @@ -16,7 +16,6 @@ * @package Functions * */ - function getFormFieldOutputString($fieldname, $fielddata, $do_show = true) { $label = $fielddata['label']; diff --git a/lib/functions/formfields/text/function.getFormFieldDataText.php b/lib/functions/formfields/text/function.getFormFieldDataText.php index a1f7f3ca..0f0aad70 100644 --- a/lib/functions/formfields/text/function.getFormFieldDataText.php +++ b/lib/functions/formfields/text/function.getFormFieldDataText.php @@ -14,9 +14,9 @@ * @package Functions * */ - -function getFormFieldDataText($fieldname, $fielddata, &$input) { - if(isset($input[$fieldname])) { +function getFormFieldDataText($fieldname, $fielddata, &$input) +{ + if (isset($input[$fieldname])) { $newfieldvalue = str_replace("\r\n", "\n", $input[$fieldname]); } else { $newfieldvalue = $fielddata['default']; diff --git a/lib/functions/formfields/text/function.getFormFieldOutputText.php b/lib/functions/formfields/text/function.getFormFieldOutputText.php index f5e6ea86..d4f75a9e 100644 --- a/lib/functions/formfields/text/function.getFormFieldOutputText.php +++ b/lib/functions/formfields/text/function.getFormFieldOutputText.php @@ -16,7 +16,6 @@ * @package Functions * */ - function getFormFieldOutputText($fieldname, $fielddata, $do_show = true) { $label = $fielddata['label']; diff --git a/lib/functions/formfields/text/function.validateFormFieldText.php b/lib/functions/formfields/text/function.validateFormFieldText.php index 77833f92..a58b7988 100644 --- a/lib/functions/formfields/text/function.validateFormFieldText.php +++ b/lib/functions/formfields/text/function.validateFormFieldText.php @@ -16,15 +16,13 @@ * @package Functions * */ - function validateFormFieldText($fieldname, $fielddata, $newfieldvalue) { $returnvalue = 'stringformaterror'; - - if(preg_match('/^[^\0]*$/', $newfieldvalue)) - { + + if (preg_match('/^[^\0]*$/', $newfieldvalue)) { $returnvalue = true; } - + return $returnvalue; } diff --git a/lib/functions/froxlor/function.CorrectErrorDocument.php b/lib/functions/froxlor/function.CorrectErrorDocument.php index 7d036a5a..d20a4e26 100644 --- a/lib/functions/froxlor/function.CorrectErrorDocument.php +++ b/lib/functions/froxlor/function.CorrectErrorDocument.php @@ -19,36 +19,33 @@ * this functions validates a given value as ErrorDocument * refs #267 * - * @param string error-document-string + * @param + * string error-document-string * @param bool $throw_exception * * @return string error-document-string - * + * */ -function correctErrorDocument($errdoc = null, $throw_exception = false) { - +function correctErrorDocument($errdoc = null, $throw_exception = false) +{ $idna_convert = new idna_convert_wrapper(); if ($errdoc !== null && $errdoc != '') { // not a URL - if ((strtoupper(substr($errdoc, 0, 5)) != 'HTTP:' - && strtoupper(substr($errdoc, 0, 6)) != 'HTTPS:') - || !validateUrl($errdoc) - ) { + if ((strtoupper(substr($errdoc, 0, 5)) != 'HTTP:' && strtoupper(substr($errdoc, 0, 6)) != 'HTTPS:') || ! validateUrl($errdoc)) { // a file if (substr($errdoc, 0, 1) != '"') { $errdoc = \Froxlor\FileDir::makeCorrectFile($errdoc); // apache needs a starting-slash (starting at the domains-docroot) - if (!substr($errdoc, 0, 1) == '/') { - $errdoc = '/'.$errdoc; + if (! substr($errdoc, 0, 1) == '/') { + $errdoc = '/' . $errdoc; } - } - // a string (check for ending ") + } // a string (check for ending ") else { // string won't work for lighty if (Settings::Get('system.webserver') == 'lighttpd') { \Froxlor\UI\Response::standard_error('stringerrordocumentnotvalidforlighty', '', $throw_exception); - } elseif(substr($errdoc, -1) != '"') { + } elseif (substr($errdoc, - 1) != '"') { $errdoc .= '"'; } } diff --git a/lib/functions/froxlor/function.getFilesystemQuota.php b/lib/functions/froxlor/function.getFilesystemQuota.php index f8805533..c1aab238 100644 --- a/lib/functions/froxlor/function.getFilesystemQuota.php +++ b/lib/functions/froxlor/function.getFilesystemQuota.php @@ -14,15 +14,15 @@ * @package Functions * */ - -function getFilesystemQuota() { +function getFilesystemQuota() +{ // enabled at all? if (Settings::Get('system.diskquota_enabled')) { // set linux defaults $repquota_params = "-np"; - //$quota_line_regex = "/^#([0-9]+)\s*[+-]{2}\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)/i"; + // $quota_line_regex = "/^#([0-9]+)\s*[+-]{2}\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)/i"; $quota_line_regex = "/^#([0-9]+)\s+[+-]{2}\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/i"; // check for freebsd - which needs other values @@ -42,18 +42,18 @@ function getFilesystemQuota() { // It matches - put it into an array with userid as key (for easy lookup later) $usedquota[$matches[1]] = array( - 'block' => array( - 'used' => $matches[2], - 'soft' => $matches[3], - 'hard' => $matches[4], - 'grace' => (isFreeBSD() ? '0' : $matches[5]) - ), - 'file' => array( - 'used' => $matches[6], - 'soft' => $matches[7], - 'hard' => $matches[8], - 'grace' => (isFreeBSD() ? '0' : $matches[9]) - ), + 'block' => array( + 'used' => $matches[2], + 'soft' => $matches[3], + 'hard' => $matches[4], + 'grace' => (isFreeBSD() ? '0' : $matches[5]) + ), + 'file' => array( + 'used' => $matches[6], + 'soft' => $matches[7], + 'hard' => $matches[8], + 'grace' => (isFreeBSD() ? '0' : $matches[9]) + ) ); } } diff --git a/lib/functions/froxlor/function.getLanguages.php b/lib/functions/froxlor/function.getLanguages.php index c27d735e..d7b8c68a 100644 --- a/lib/functions/froxlor/function.getLanguages.php +++ b/lib/functions/froxlor/function.getLanguages.php @@ -16,16 +16,13 @@ * @package Functions * */ - -function getLanguages() { - +function getLanguages() +{ $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_LANGUAGE . "` "); $languages_array = array(); while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { - if (!isset($languages_array[$row['language']]) - && !in_array($row['language'], $languages_array) - ) { + if (! isset($languages_array[$row['language']]) && ! in_array($row['language'], $languages_array)) { $languages_array[$row['language']] = html_entity_decode($row['language']); } } diff --git a/lib/functions/froxlor/function.getPhpConfigs.php b/lib/functions/froxlor/function.getPhpConfigs.php index 522c64bd..10034fa8 100644 --- a/lib/functions/froxlor/function.getPhpConfigs.php +++ b/lib/functions/froxlor/function.getPhpConfigs.php @@ -21,22 +21,20 @@ * * @return array */ -function getPhpConfigs() { - +function getPhpConfigs() +{ $configs_array = array(); // check if table exists because this is used in a preconfig // where the tables possibly does not exist yet - $results = Database::query("SHOW TABLES LIKE '".TABLE_PANEL_PHPCONFIGS."'"); - if (!$results) { + $results = Database::query("SHOW TABLES LIKE '" . TABLE_PANEL_PHPCONFIGS . "'"); + if (! $results) { $configs_array[1] = 'Default php.ini'; } else { // get all configs $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`"); while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { - if (!isset($configs_array[$row['id']]) - && !in_array($row['id'], $configs_array) - ) { + if (! isset($configs_array[$row['id']]) && ! in_array($row['id'], $configs_array)) { $configs_array[$row['id']] = html_entity_decode($row['description']); } } diff --git a/lib/functions/froxlor/function.getThemes.php b/lib/functions/froxlor/function.getThemes.php index 6ec6963f..bb945005 100644 --- a/lib/functions/froxlor/function.getThemes.php +++ b/lib/functions/froxlor/function.getThemes.php @@ -20,20 +20,16 @@ * * @return array */ -function getThemes() { - - $themespath = \Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir().'/templates/'); +function getThemes() +{ + $themespath = \Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/templates/'); $themes_available = array(); if (is_dir($themespath)) { $its = new DirectoryIterator($themespath); foreach ($its as $it) { - if ($it->isDir() - && $it->getFilename() != '.' - && $it->getFilename() != '..' - && $it->getFilename() != 'misc' - ) { + if ($it->isDir() && $it->getFilename() != '.' && $it->getFilename() != '..' && $it->getFilename() != 'misc') { $theme = $themespath . $it->getFilename(); if (file_exists($theme . '/config.json')) { $themeconfig = json_decode(file_get_contents($theme . '/config.json'), true); diff --git a/lib/functions/froxlor/function.loadConfigArrayDir.php b/lib/functions/froxlor/function.loadConfigArrayDir.php index 2295ff33..8088b8dc 100644 --- a/lib/functions/froxlor/function.loadConfigArrayDir.php +++ b/lib/functions/froxlor/function.loadConfigArrayDir.php @@ -16,8 +16,8 @@ * @package Functions * */ - -function loadConfigArrayDir() { +function loadConfigArrayDir() +{ // Workaround until we use gettext global $lng, $theme; @@ -26,7 +26,7 @@ function loadConfigArrayDir() { // so we can read from more than one directory // and still be valid for old calls $numargs = func_num_args(); - if($numargs <= 0) { + if ($numargs <= 0) { return null; } @@ -37,9 +37,9 @@ function loadConfigArrayDir() { // we assume that this is a list of // setting-groups to be selected $selection = null; - for($x=0;$x<$numargs;$x++) { + for ($x = 0; $x < $numargs; $x ++) { $arg = func_get_arg($x); - if(is_array($arg) && isset($arg[0])) { + if (is_array($arg) && isset($arg[0])) { $selection = $arg; } else { $configdirs[] = $arg; @@ -54,11 +54,7 @@ function loadConfigArrayDir() { if (is_dir($data_dirname)) { $data_dirhandle = opendir($data_dirname); while (false !== ($data_filename = readdir($data_dirhandle))) { - if ($data_filename != '.' - && $data_filename != '..' - && $data_filename != '' - && substr($data_filename, -4 ) == '.php' - ) { + if ($data_filename != '.' && $data_filename != '..' && $data_filename != '' && substr($data_filename, - 4) == '.php') { $data_files[] = $data_dirname . $data_filename; } } @@ -69,7 +65,7 @@ function loadConfigArrayDir() { if ($has_data) { sort($data_files); foreach ($data_files as $data_filename) { - $data = array_merge_recursive($data, include($data_filename)); + $data = array_merge_recursive($data, include ($data_filename)); } } @@ -77,10 +73,7 @@ function loadConfigArrayDir() { // to select, we'll handle this here // (this is for multiserver-client settings) $_data = array(); - if ($selection != null - && is_array($selection) - && isset($selection[0]) - ) { + if ($selection != null && is_array($selection) && isset($selection[0])) { $_data['groups'] = array(); foreach ($data['groups'] as $group => $data) { if (in_array($group, $selection)) { diff --git a/lib/functions/froxlor/function.phpErrHandler.php b/lib/functions/froxlor/function.phpErrHandler.php index d48dff81..3aa9c7c0 100644 --- a/lib/functions/froxlor/function.phpErrHandler.php +++ b/lib/functions/froxlor/function.phpErrHandler.php @@ -11,14 +11,14 @@ * * @return void|boolean */ -function phpErrHandler($errno, $errstr, $errfile, $errline, $errcontext) { - - if (!(error_reporting() & $errno)) { +function phpErrHandler($errno, $errstr, $errfile, $errline, $errcontext) +{ + if (! (error_reporting() & $errno)) { // This error code is not included in error_reporting return; } - if (!isset($_SERVER['SHELL']) || (isset($_SERVER['SHELL']) && $_SERVER['SHELL'] == '')) { + if (! isset($_SERVER['SHELL']) || (isset($_SERVER['SHELL']) && $_SERVER['SHELL'] == '')) { global $theme; // fallback @@ -28,10 +28,10 @@ function phpErrHandler($errno, $errstr, $errfile, $errline, $errcontext) { // prevent possible file-path-disclosure $errfile = str_replace(\Froxlor\Froxlor::getInstallDir(), "", $errfile); // if we're not on the shell, output a nicer error-message - $err_hint = file_get_contents(\Froxlor\Froxlor::getInstallDir().'/templates/'.$theme.'/misc/phperrornice.tpl'); + $err_hint = file_get_contents(\Froxlor\Froxlor::getInstallDir() . '/templates/' . $theme . '/misc/phperrornice.tpl'); // replace values - $err_hint = str_replace("", '#'.$errno.' '.$errstr, $err_hint); - $err_hint = str_replace("", $errfile.':'.$errline, $err_hint); + $err_hint = str_replace("", '#' . $errno . ' ' . $errstr, $err_hint); + $err_hint = str_replace("", $errfile . ':' . $errline, $err_hint); // show echo $err_hint; diff --git a/lib/functions/froxlor/function.updateCounters.php b/lib/functions/froxlor/function.updateCounters.php index b8470375..580f3ba8 100644 --- a/lib/functions/froxlor/function.updateCounters.php +++ b/lib/functions/froxlor/function.updateCounters.php @@ -16,22 +16,23 @@ * @package Functions * */ - -use \Froxlor\Database\Database; +use Froxlor\Database\Database; /** * Function which updates all counters of used ressources in panel_admins and panel_customers - * @param bool Set to true to get an array with debug information - * @return array Contains debug information if parameter 'returndebuginfo' is set to true * + * @param + * bool Set to true to get an array with debug information + * @return array Contains debug information if parameter 'returndebuginfo' is set to true + * * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) */ -function updateCounters($returndebuginfo = false) { - +function updateCounters($returndebuginfo = false) +{ $returnval = array(); - if($returndebuginfo === true) { + if ($returndebuginfo === true) { $returnval = array( 'admins' => array(), 'customers' => array() @@ -48,62 +49,79 @@ function updateCounters($returndebuginfo = false) { $cur_adm = $customer['adminid']; // initialize admin-resources array for admin $customer['adminid'] - if (!isset($admin_resources[$cur_adm])) { + if (! isset($admin_resources[$cur_adm])) { $admin_resources[$cur_adm] = array(); } _addResourceCountEx($admin_resources[$cur_adm], $customer, 'diskspace_used', 'diskspace'); _addResourceCountEx($admin_resources[$cur_adm], $customer, 'traffic_used', 'traffic_used'); // !!! yes, USED and USED - foreach (array('mysqls', 'ftps', 'emails', 'email_accounts', 'email_forwarders', 'email_quota', 'subdomains') as $field) { - _addResourceCount($admin_resources[$cur_adm], $customer, $field.'_used', $field); + foreach (array( + 'mysqls', + 'ftps', + 'emails', + 'email_accounts', + 'email_forwarders', + 'email_quota', + 'subdomains' + ) as $field) { + _addResourceCount($admin_resources[$cur_adm], $customer, $field . '_used', $field); } $customer_mysqls_stmt = Database::prepare('SELECT COUNT(*) AS `number_mysqls` FROM `' . TABLE_PANEL_DATABASES . '` - WHERE `customerid` = :cid' - ); - $customer_mysqls = Database::pexecute_first($customer_mysqls_stmt, array("cid" => $customer['customerid'])); - $customer['mysqls_used_new'] = (int)$customer_mysqls['number_mysqls']; - + WHERE `customerid` = :cid'); + $customer_mysqls = Database::pexecute_first($customer_mysqls_stmt, array( + "cid" => $customer['customerid'] + )); + $customer['mysqls_used_new'] = (int) $customer_mysqls['number_mysqls']; + $customer_emails_stmt = Database::prepare('SELECT COUNT(*) AS `number_emails` FROM `' . TABLE_MAIL_VIRTUAL . '` - WHERE `customerid` = :cid' - ); - $customer_emails = Database::pexecute_first($customer_emails_stmt, array("cid" => $customer['customerid'])); - $customer['emails_used_new'] = (int)$customer_emails['number_emails']; - + WHERE `customerid` = :cid'); + $customer_emails = Database::pexecute_first($customer_emails_stmt, array( + "cid" => $customer['customerid'] + )); + $customer['emails_used_new'] = (int) $customer_emails['number_emails']; + $customer_emails_result_stmt = Database::prepare('SELECT `email`, `email_full`, `destination`, `popaccountid` AS `number_email_forwarders` FROM `' . TABLE_MAIL_VIRTUAL . '` - WHERE `customerid` = :cid' - ); - Database::pexecute($customer_emails_result_stmt, array("cid" => $customer['customerid'])); + WHERE `customerid` = :cid'); + Database::pexecute($customer_emails_result_stmt, array( + "cid" => $customer['customerid'] + )); $customer_email_forwarders = 0; $customer_email_accounts = 0; - while($customer_emails_row = $customer_emails_result_stmt->fetch(PDO::FETCH_ASSOC)) { - if($customer_emails_row['destination'] != '') { + while ($customer_emails_row = $customer_emails_result_stmt->fetch(PDO::FETCH_ASSOC)) { + if ($customer_emails_row['destination'] != '') { $customer_emails_row['destination'] = explode(' ', \Froxlor\FileDir::makeCorrectDestination($customer_emails_row['destination'])); - $customer_email_forwarders+= count($customer_emails_row['destination']); + $customer_email_forwarders += count($customer_emails_row['destination']); - if(in_array($customer_emails_row['email_full'], $customer_emails_row['destination'])) { - $customer_email_forwarders-= 1; - $customer_email_accounts++; + if (in_array($customer_emails_row['email_full'], $customer_emails_row['destination'])) { + $customer_email_forwarders -= 1; + $customer_email_accounts ++; } } } $customer['email_accounts_used_new'] = $customer_email_accounts; $customer['email_forwarders_used_new'] = $customer_email_forwarders; - + $customer_ftps_stmt = Database::prepare('SELECT COUNT(*) AS `number_ftps` FROM `' . TABLE_FTP_USERS . '` WHERE `customerid` = :cid'); - $customer_ftps = Database::pexecute_first($customer_ftps_stmt, array("cid" => $customer['customerid'])); - $customer['ftps_used_new'] = ((int)$customer_ftps['number_ftps'] - 1); - + $customer_ftps = Database::pexecute_first($customer_ftps_stmt, array( + "cid" => $customer['customerid'] + )); + $customer['ftps_used_new'] = ((int) $customer_ftps['number_ftps'] - 1); + $customer_subdomains_stmt = Database::prepare('SELECT COUNT(*) AS `number_subdomains` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `customerid` = :cid AND `parentdomainid` <> "0"'); - $customer_subdomains = Database::pexecute_first($customer_subdomains_stmt, array("cid" => $customer['customerid'])); - $customer['subdomains_used_new'] = (int)$customer_subdomains['number_subdomains']; - + $customer_subdomains = Database::pexecute_first($customer_subdomains_stmt, array( + "cid" => $customer['customerid'] + )); + $customer['subdomains_used_new'] = (int) $customer_subdomains['number_subdomains']; + $customer_email_quota_stmt = Database::prepare('SELECT SUM(`quota`) AS `email_quota` FROM `' . TABLE_MAIL_USERS . '` WHERE `customerid` = :cid'); - $customer_email_quota = Database::pexecute_first($customer_email_quota_stmt, array("cid" => $customer['customerid'])); - $customer['email_quota_used_new'] = (int)$customer_email_quota['email_quota']; + $customer_email_quota = Database::pexecute_first($customer_email_quota_stmt, array( + "cid" => $customer['customerid'] + )); + $customer['email_quota_used_new'] = (int) $customer_email_quota['email_quota']; $stmt = Database::prepare('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used` = :mysqls_used, @@ -113,8 +131,7 @@ function updateCounters($returndebuginfo = false) { `email_quota_used` = :email_quota_used, `ftps_used` = :ftps_used, `subdomains_used` = :subdomains_used - WHERE `customerid` = :cid' - ); + WHERE `customerid` = :cid'); $params = array( "mysqls_used" => $customer['mysqls_used_new'], "emails_used" => $customer['emails_used_new'], @@ -127,7 +144,7 @@ function updateCounters($returndebuginfo = false) { ); Database::pexecute($stmt, $params); - if($returndebuginfo === true) { + if ($returndebuginfo === true) { $returnval['customers'][$customer['customerid']] = $customer; } } @@ -136,24 +153,38 @@ function updateCounters($returndebuginfo = false) { $admins_stmt = Database::prepare('SELECT * FROM `' . TABLE_PANEL_ADMINS . '` ORDER BY `adminid`'); Database::pexecute($admins_stmt, array()); - while($admin = $admins_stmt->fetch(PDO::FETCH_ASSOC)) { + while ($admin = $admins_stmt->fetch(PDO::FETCH_ASSOC)) { $admin_customers_stmt = Database::prepare('SELECT COUNT(*) AS `number_customers` FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `adminid` = :aid'); - $admin_customers = Database::pexecute_first($admin_customers_stmt, array("aid" => $admin['adminid'])); + $admin_customers = Database::pexecute_first($admin_customers_stmt, array( + "aid" => $admin['adminid'] + )); $admin['customers_used_new'] = $admin_customers['number_customers']; - + $admin_domains_stmt = Database::prepare('SELECT COUNT(*) AS `number_domains` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `adminid` = :aid AND `isemaildomain` = "1"'); - $admin_domains = Database::pexecute_first($admin_domains_stmt, array("aid" => $admin['adminid'])); + $admin_domains = Database::pexecute_first($admin_domains_stmt, array( + "aid" => $admin['adminid'] + )); $admin['domains_used_new'] = $admin_domains['number_domains']; $cur_adm = $admin['adminid']; - if (!isset($admin_resources[$cur_adm])) { + if (! isset($admin_resources[$cur_adm])) { $admin_resources[$cur_adm] = array(); } - foreach (array('diskspace_used', 'traffic_used', 'mysqls_used', 'ftps_used', 'emails_used', 'email_accounts_used', 'email_forwarders_used', 'email_quota_used', 'subdomains_used') as $field) { + foreach (array( + 'diskspace_used', + 'traffic_used', + 'mysqls_used', + 'ftps_used', + 'emails_used', + 'email_accounts_used', + 'email_forwarders_used', + 'email_quota_used', + 'subdomains_used' + ) as $field) { _initArrField($field, $admin_resources[$cur_adm], 0); - $admin[$field.'_new'] = $admin_resources[$cur_adm][$field]; + $admin[$field . '_new'] = $admin_resources[$cur_adm][$field]; } $stmt = Database::prepare('UPDATE `' . TABLE_PANEL_ADMINS . '` @@ -168,8 +199,7 @@ function updateCounters($returndebuginfo = false) { `ftps_used` = :ftps_used, `subdomains_used` = :subdomains_used, `traffic_used` = :traffic_used - WHERE `adminid` = :aid' - ); + WHERE `adminid` = :aid'); $params = array( "customers_used" => $admin['customers_used_new'], @@ -187,7 +217,7 @@ function updateCounters($returndebuginfo = false) { ); Database::pexecute($stmt, $params); - if($returndebuginfo === true) { + if ($returndebuginfo === true) { $returnval['admins'][$admin['adminid']] = $admin; } } @@ -199,13 +229,15 @@ function updateCounters($returndebuginfo = false) { * initialize a field-value of an array if not yet initialized * * @param string $field - * @param array $arr reference + * @param array $arr + * reference * @param int $init_value * * @return void */ -function _initArrField($field = null, &$arr, $init_value = 0) { - if (!isset($arr[$field])) { +function _initArrField($field = null, &$arr, $init_value = 0) +{ + if (! isset($arr[$field])) { $arr[$field] = $init_value; } } @@ -214,14 +246,16 @@ function _initArrField($field = null, &$arr, $init_value = 0) { * if the customer does not have unlimited resources, add the used resources * to the admin-resource-counter * - * @param array $arr reference + * @param array $arr + * reference * @param array $customer_arr * @param string $used_field * @param string $field * * @return void */ -function _addResourceCount(&$arr, $customer_arr, $used_field = null, $field = null) { +function _addResourceCount(&$arr, $customer_arr, $used_field = null, $field = null) +{ _initArrField($used_field, $arr, 0); if ($customer_arr[$field] != '-1') { $arr[$used_field] += intval($customer_arr[$used_field]); @@ -234,19 +268,20 @@ function _addResourceCount(&$arr, $customer_arr, $used_field = null, $field = nu * Special function wrapper for diskspace and traffic as they need to * be calculated otherwise to get the -1 for unlimited * - * @param array $arr reference + * @param array $arr + * reference * @param array $customer_arr * @param string $used_field * @param string $field * * @return void */ -function _addResourceCountEx(&$arr, $customer_arr, $used_field = null, $field = null) { +function _addResourceCountEx(&$arr, $customer_arr, $used_field = null, $field = null) +{ _initArrField($used_field, $arr, 0); if ($field == 'diskspace' && ($customer_arr[$field] / 1024) != '-1') { $arr[$used_field] += intval($customer_arr[$used_field]); - } - elseif ($field == 'traffic_used') { + } elseif ($field == 'traffic_used') { $arr[$used_field] += intval($customer_arr[$used_field]); } } diff --git a/lib/functions/froxlor/function.updateFunctions.php b/lib/functions/froxlor/function.updateFunctions.php index 381f4c21..c0351052 100644 --- a/lib/functions/froxlor/function.updateFunctions.php +++ b/lib/functions/froxlor/function.updateFunctions.php @@ -15,28 +15,30 @@ * */ - /** * Function showUpdateStep * * outputs and logs the current * update progress * - * @param string task/status - * @param bool needs_status (if false, a linebreak will be added) - * - * @return string formatted output and log-entry + * @param + * string task/status + * @param + * bool needs_status (if false, a linebreak will be added) + * + * @return string formatted output and log-entry */ -function showUpdateStep($task = null, $needs_status = true) { - +function showUpdateStep($task = null, $needs_status = true) +{ global $updatelog, $filelog; - if (!$needs_status) echo ""; + if (! $needs_status) + echo ""; // output echo $task; - if (!$needs_status) { + if (! $needs_status) { echo "
"; } @@ -50,26 +52,27 @@ function showUpdateStep($task = null, $needs_status = true) { * outputs [OK] (success), [??] (warning) or [!!] (failure) * of the last update-step * - * @param int status (0 = success, 1 = warning, 2 = failure) - * - * @return string formatted output and log-entry + * @param + * int status (0 = success, 1 = warning, 2 = failure) + * + * @return string formatted output and log-entry */ -function lastStepStatus($status = -1, $message = '') { - +function lastStepStatus($status = -1, $message = '') +{ global $updatelog, $filelog; - switch($status) { + switch ($status) { case 0: - $status_sign = ($message != '') ? '['.$message.']' : '[OK]'; + $status_sign = ($message != '') ? '[' . $message . ']' : '[OK]'; $status_color = 'ok'; break; case 1: - $status_sign = ($message != '') ? '['.$message.']' : '[??]'; + $status_sign = ($message != '') ? '[' . $message . ']' : '[??]'; $status_color = 'warn'; break; case 2: - $status_sign = ($message != '') ? '['.$message.']' : '[!!]'; + $status_sign = ($message != '') ? '[' . $message . ']' : '[!!]'; $status_color = 'err'; break; default: @@ -79,13 +82,12 @@ function lastStepStatus($status = -1, $message = '') { } // output - echo "".$status_sign."
"; + echo "" . $status_sign . "
"; - if ($status == -1 || $status == 2) { + if ($status == - 1 || $status == 2) { $updatelog->logAction(ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!'); $filelog->logAction(ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!'); - - } elseif($status == 0 || $status == 1) { + } elseif ($status == 0 || $status == 1) { $filelog->logAction(ADM_ACTION, LOG_WARNING, 'Success'); } } diff --git a/lib/functions/froxlor/function.version_compare2.php b/lib/functions/froxlor/function.version_compare2.php index 5434d578..6ef915f9 100644 --- a/lib/functions/froxlor/function.version_compare2.php +++ b/lib/functions/froxlor/function.version_compare2.php @@ -23,7 +23,8 @@ * * @return integer 0 if equal, 1 if a>b and -1 if b>a */ -function version_compare2($a, $b) { +function version_compare2($a, $b) +{ // split version into pieces and remove trailing .0 $a = explode(".", $a); @@ -35,8 +36,7 @@ function version_compare2($a, $b) { while (count($a) != count($b)) { if (count($a) < count($b)) { $a[] = '0'; - } - elseif (count($b) < count($a)) { + } elseif (count($b) < count($a)) { $b[] = '0'; } } @@ -47,9 +47,8 @@ function version_compare2($a, $b) { // if B matches A to this depth, compare the values if ($aVal > $b[$depth]) { return 1; // A > B - } - else if ($aVal < $b[$depth]) { - return -1; // B > A + } else if ($aVal < $b[$depth]) { + return - 1; // B > A } // an equal result is inconclusive at this point } else { @@ -59,31 +58,30 @@ function version_compare2($a, $b) { } // at this point, we know that to the depth that A and B extend to, they are equivalent. // either the loop ended because A is shorter than B, or both are equal. - return (count($a) < count($b)) ? -1 : 0; + return (count($a) < count($b)) ? - 1 : 0; } -function _parseVersionArray(&$arr = null) { +function _parseVersionArray(&$arr = null) +{ // -svn or -dev or -rc ? - if (stripos($arr[count($arr)-1], '-') !== false) { - $x = explode("-", $arr[count($arr)-1]); - $arr[count($arr)-1] = $x[0]; + if (stripos($arr[count($arr) - 1], '-') !== false) { + $x = explode("-", $arr[count($arr) - 1]); + $arr[count($arr) - 1] = $x[0]; if (stripos($x[1], 'rc') !== false) { $arr[] = '-1'; $arr[] = '2'; // rc > dev > svn - // number of rc + // number of rc $arr[] = substr($x[1], 2); - } - else if (stripos($x[1], 'dev') !== false) { + } else if (stripos($x[1], 'dev') !== false) { $arr[] = '-1'; $arr[] = '1'; // svn < dev < rc - // number of dev + // number of dev $arr[] = substr($x[1], 3); - } - // -svn version are deprecated + } // -svn version are deprecated else if (stripos($x[1], 'svn') !== false) { $arr[] = '-1'; $arr[] = '0'; // svn < dev < rc - // number of svn + // number of svn $arr[] = substr($x[1], 3); } } diff --git a/lib/functions/logger/constant.logger.php b/lib/functions/logger/constant.logger.php index db7c2aa2..1679b943 100644 --- a/lib/functions/logger/constant.logger.php +++ b/lib/functions/logger/constant.logger.php @@ -16,16 +16,15 @@ * @package Functions * */ - -if(!defined('USR_ACTION')) +if (! defined('USR_ACTION')) define('USR_ACTION', '10'); -if(!defined('RES_ACTION')) +if (! defined('RES_ACTION')) define('RES_ACTION', '20'); -if(!defined('ADM_ACTION')) +if (! defined('ADM_ACTION')) define('ADM_ACTION', '30'); -if(!defined('CRON_ACTION')) +if (! defined('CRON_ACTION')) define('CRON_ACTION', '40'); -if(!defined('LOGIN_ACTION')) +if (! defined('LOGIN_ACTION')) define('LOGIN_ACTION', '50'); -if(!defined('LOG_ERROR')) +if (! defined('LOG_ERROR')) define('LOG_ERROR', '99'); diff --git a/lib/functions/output/function.RedirectCode.php b/lib/functions/output/function.RedirectCode.php index 79c7528c..5f91d5ae 100644 --- a/lib/functions/output/function.RedirectCode.php +++ b/lib/functions/output/function.RedirectCode.php @@ -19,9 +19,9 @@ * * @return array array of enabled redirect-codes */ -function getRedirectCodesArray() { - - $sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC"; +function getRedirectCodesArray() +{ + $sql = "SELECT * FROM `" . TABLE_PANEL_REDIRECTCODES . "` WHERE `enabled` = '1' ORDER BY `id` ASC"; $result_stmt = Database::query($sql); $codes = array(); @@ -36,22 +36,23 @@ function getRedirectCodesArray() { * return an array of all enabled redirect-codes * for the settings form * - * @param bool $add_desc optional, default true, add the code-description - * + * @param bool $add_desc + * optional, default true, add the code-description + * * @return array array of enabled redirect-codes */ -function getRedirectCodes($add_desc = true) { - +function getRedirectCodes($add_desc = true) +{ global $lng; - $sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC"; + $sql = "SELECT * FROM `" . TABLE_PANEL_REDIRECTCODES . "` WHERE `enabled` = '1' ORDER BY `id` ASC"; $result_stmt = Database::query($sql); $codes = array(); while ($rc = $result_stmt->fetch(PDO::FETCH_ASSOC)) { $codes[$rc['id']] = $rc['code']; if ($add_desc) { - $codes[$rc['id']] .= ' ('.$lng['redirect_desc'][$rc['desc']].')'; + $codes[$rc['id']] .= ' (' . $lng['redirect_desc'][$rc['desc']] . ')'; } } @@ -62,11 +63,13 @@ function getRedirectCodes($add_desc = true) { * returns the redirect-code for a given * domain-id * - * @param integer $domainid id of the domain - * + * @param integer $domainid + * id of the domain + * * @return string redirect-code */ -function getDomainRedirectCode($domainid = 0) { +function getDomainRedirectCode($domainid = 0) +{ // get system default $default = '301'; @@ -80,14 +83,14 @@ function getDomainRedirectCode($domainid = 0) { $result_stmt = Database::prepare(" SELECT `r`.`code` as `redirect` - FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc` + FROM `" . TABLE_PANEL_REDIRECTCODES . "` `r`, `" . TABLE_PANEL_DOMAINREDIRECTS . "` `rc` WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = :domainid "); - $result = Database::pexecute_first($result_stmt, array('domainid' => $domainid)); + $result = Database::pexecute_first($result_stmt, array( + 'domainid' => $domainid + )); - if (is_array($result) - && isset($result['redirect']) - ) { + if (is_array($result) && isset($result['redirect'])) { $code = ($result['redirect'] == '---') ? $default : $result['redirect']; } } @@ -98,25 +101,26 @@ function getDomainRedirectCode($domainid = 0) { * returns the redirect-id for a given * domain-id * - * @param integer $domainid id of the domain - * + * @param integer $domainid + * id of the domain + * * @return integer redirect-code-id */ -function getDomainRedirectId($domainid = 0) { - +function getDomainRedirectId($domainid = 0) +{ $code = 1; if ($domainid > 0) { $result_stmt = Database::prepare(" SELECT `r`.`id` as `redirect` - FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc` + FROM `" . TABLE_PANEL_REDIRECTCODES . "` `r`, `" . TABLE_PANEL_DOMAINREDIRECTS . "` `rc` WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = :domainid "); - $result = Database::pexecute_first($result_stmt, array('domainid' => $domainid)); + $result = Database::pexecute_first($result_stmt, array( + 'domainid' => $domainid + )); - if (is_array($result) - && isset($result['redirect']) - ) { - $code = (int)$result['redirect']; + if (is_array($result) && isset($result['redirect'])) { + $code = (int) $result['redirect']; } } return $code; @@ -125,17 +129,23 @@ function getDomainRedirectId($domainid = 0) { /** * adds a redirectcode for a domain * - * @param integer $domainid id of the domain to add the code for - * @param integer $redirect selected redirect-id - * + * @param integer $domainid + * id of the domain to add the code for + * @param integer $redirect + * selected redirect-id + * * @return null */ -function addRedirectToDomain($domainid = 0, $redirect = 1) { +function addRedirectToDomain($domainid = 0, $redirect = 1) +{ if ($domainid > 0) { $ins_stmt = Database::prepare(" - INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."` SET `rid` = :rid, `did` = :did + INSERT INTO `" . TABLE_PANEL_DOMAINREDIRECTS . "` SET `rid` = :rid, `did` = :did "); - Database::pexecute($ins_stmt, array('rid' => $redirect, 'did' => $domainid)); + Database::pexecute($ins_stmt, array( + 'rid' => $redirect, + 'did' => $domainid + )); } } @@ -143,26 +153,33 @@ function addRedirectToDomain($domainid = 0, $redirect = 1) { * updates the redirectcode of a domain * if redirect-code is false, nothing happens * - * @param integer $domainid id of the domain to update - * @param integer $redirect selected redirect-id or false - * + * @param integer $domainid + * id of the domain to update + * @param integer $redirect + * selected redirect-id or false + * * @return null */ -function updateRedirectOfDomain($domainid = 0, $redirect = false) { - +function updateRedirectOfDomain($domainid = 0, $redirect = false) +{ if ($redirect == false) { return; } if ($domainid > 0) { $del_stmt = Database::prepare(" - DELETE FROM `".TABLE_PANEL_DOMAINREDIRECTS."` WHERE `did` = :domainid + DELETE FROM `" . TABLE_PANEL_DOMAINREDIRECTS . "` WHERE `did` = :domainid "); - Database::pexecute($del_stmt, array('domainid' => $domainid)); + Database::pexecute($del_stmt, array( + 'domainid' => $domainid + )); $ins_stmt = Database::prepare(" - INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."` SET `rid` = :rid, `did` = :did + INSERT INTO `" . TABLE_PANEL_DOMAINREDIRECTS . "` SET `rid` = :rid, `did` = :did "); - Database::pexecute($ins_stmt, array('rid' => $redirect, 'did' => $domainid)); + Database::pexecute($ins_stmt, array( + 'rid' => $redirect, + 'did' => $domainid + )); } } diff --git a/lib/functions/output/function.ask_yesno.php b/lib/functions/output/function.ask_yesno.php index 16abf515..4d6fff18 100644 --- a/lib/functions/output/function.ask_yesno.php +++ b/lib/functions/output/function.ask_yesno.php @@ -20,26 +20,31 @@ /** * Prints Question on screen * - * @param string $text The question - * @param string $yesfile File which will be called with POST if user clicks yes - * @param array $params Values which will be given to $yesfile. Format: array(variable1=>value1, variable2=>value2, variable3=>value3) - * @param string $targetname Name of the target eg Domain or eMail address etc. - * @param int $back_nr Number of steps to go back when "No" is pressed - * + * @param string $text + * The question + * @param string $yesfile + * File which will be called with POST if user clicks yes + * @param array $params + * Values which will be given to $yesfile. Format: array(variable1=>value1, variable2=>value2, variable3=>value3) + * @param string $targetname + * Name of the target eg Domain or eMail address etc. + * @param int $back_nr + * Number of steps to go back when "No" is pressed + * * @author Florian Lippert * @author Froxlor team (2010-) - * + * * @return string outputs parsed question_yesno template */ -function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1) { - +function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1) +{ global $userinfo, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; if (is_array($params)) { foreach ($params as $field => $value) { - $hiddenparams.= '' . "\n"; + $hiddenparams .= '' . "\n"; } } @@ -47,20 +52,22 @@ function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_n $text = $lng['question'][$text]; } - $text = strtr($text, array('%s' => $targetname)); + $text = strtr($text, array( + '%s' => $targetname + )); eval("echo \"" . getTemplate('misc/question_yesno', '1') . "\";"); - exit; + exit(); } -function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) { - +function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) +{ global $userinfo, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; if (is_array($params)) { foreach ($params as $field => $value) { - $hiddenparams.= '' . "\n"; + $hiddenparams .= '' . "\n"; } } @@ -75,10 +82,13 @@ function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $ if ($show_checkbox) { $checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true); } else { - $checkbox = '' . "\n";; + $checkbox = '' . "\n"; + ; } - $text = strtr($text, array('%s' => $targetname)); + $text = strtr($text, array( + '%s' => $targetname + )); eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";"); - exit; + exit(); } diff --git a/lib/functions/output/function.buildNavigation.php b/lib/functions/output/function.buildNavigation.php index 3babb1f2..aa03b2d2 100644 --- a/lib/functions/output/function.buildNavigation.php +++ b/lib/functions/output/function.buildNavigation.php @@ -19,48 +19,47 @@ /** * Build Navigation Sidebar - * @param array navigation data - * @param array userinfo the userinfo of the user - * @return string the content of the navigation bar * + * @param + * array navigation data + * @param + * array userinfo the userinfo of the user + * @return string the content of the navigation bar + * * @author Florian Lippert */ - -function buildNavigation($navigation, $userinfo) { +function buildNavigation($navigation, $userinfo) +{ global $theme; $returnvalue = ''; // sanitize user-given input (url-manipulation) if (isset($_GET['page']) && is_array($_GET['page'])) { - $_GET['page'] = (string)$_GET['page'][0]; + $_GET['page'] = (string) $_GET['page'][0]; } if (isset($_GET['action']) && is_array($_GET['action'])) { - $_GET['action'] = (string)$_GET['action'][0]; + $_GET['action'] = (string) $_GET['action'][0]; } - foreach($navigation as $box) { - if ((!isset($box['show_element']) || $box['show_element'] === true) && - (!isset($box['required_resources']) || $box['required_resources'] == '' || (isset($userinfo[$box['required_resources']]) && ((int)$userinfo[$box['required_resources']] > 0 || $userinfo[$box['required_resources']] == '-1')))) { + foreach ($navigation as $box) { + if ((! isset($box['show_element']) || $box['show_element'] === true) && (! isset($box['required_resources']) || $box['required_resources'] == '' || (isset($userinfo[$box['required_resources']]) && ((int) $userinfo[$box['required_resources']] > 0 || $userinfo[$box['required_resources']] == '-1')))) { $navigation_links = ''; foreach ($box['elements'] as $element_id => $element) { - if ((!isset($element['show_element']) || $element['show_element'] === true) && - (!isset($element['required_resources']) || $element['required_resources'] == '' || (isset($userinfo[$element['required_resources']]) && ((int)$userinfo[$element['required_resources']] > 0 || $userinfo[$element['required_resources']] == '-1'))) - ) { + if ((! isset($element['show_element']) || $element['show_element'] === true) && (! isset($element['required_resources']) || $element['required_resources'] == '' || (isset($userinfo[$element['required_resources']]) && ((int) $userinfo[$element['required_resources']] > 0 || $userinfo[$element['required_resources']] == '-1')))) { $target = ''; $active = ''; $navurl = '#'; if (isset($element['url']) && trim($element['url']) != '') { // append sid only to local - if (!preg_match('/^https?\:\/\//', $element['url']) - && (isset($userinfo['hash']) && $userinfo['hash'] != '')) { + if (! preg_match('/^https?\:\/\//', $element['url']) && (isset($userinfo['hash']) && $userinfo['hash'] != '')) { // generate sid with ? oder & if (strpos($element['url'], '?') !== false) { - $element['url'].= '&s=' . $userinfo['hash']; + $element['url'] .= '&s=' . $userinfo['hash']; } else { - $element['url'].= '?s=' . $userinfo['hash']; + $element['url'] .= '?s=' . $userinfo['hash']; } } @@ -70,7 +69,7 @@ function buildNavigation($navigation, $userinfo) { if (isset($_GET['page']) && substr_count($element['url'], "page=" . $_GET['page']) > 0 && substr_count($element['url'], basename($_SERVER["SCRIPT_FILENAME"])) > 0 && isset($_GET['action']) && substr_count($element['url'], "action=" . $_GET['action']) > 0) { $active = ' active'; - } elseif (isset($_GET['page']) && substr_count($element['url'], "page=" . $_GET['page']) > 0 && substr_count($element['url'], basename($_SERVER["SCRIPT_FILENAME"])) > 0 && substr_count($element['url'], "action=") == 0 && !isset($_GET['action'])) { + } elseif (isset($_GET['page']) && substr_count($element['url'], "page=" . $_GET['page']) > 0 && substr_count($element['url'], basename($_SERVER["SCRIPT_FILENAME"])) > 0 && substr_count($element['url'], "action=") == 0 && ! isset($_GET['action'])) { $active = ' active'; } @@ -89,20 +88,20 @@ function buildNavigation($navigation, $userinfo) { if (isset($box['url']) && trim($box['url']) != '') { // append sid only to local - if (!preg_match('/^https?\:\/\//', $box['url']) && (isset($userinfo['hash']) && $userinfo['hash'] != '')) { + if (! preg_match('/^https?\:\/\//', $box['url']) && (isset($userinfo['hash']) && $userinfo['hash'] != '')) { // generate sid with ? oder & if (strpos($box['url'], '?') !== false) { - $box['url'].= '&s=' . $userinfo['hash']; + $box['url'] .= '&s=' . $userinfo['hash']; } else { - $box['url'].= '?s=' . $userinfo['hash']; + $box['url'] .= '?s=' . $userinfo['hash']; } } if (isset($box['new_window']) && $box['new_window'] == true) { $target = ' target="_blank"'; } - + $navurl = htmlspecialchars($box['url']); $navlabel = $box['label']; } else { diff --git a/lib/functions/output/function.getCorrectFullUserDetails.php b/lib/functions/output/function.getCorrectFullUserDetails.php index de391f31..f4728582 100644 --- a/lib/functions/output/function.getCorrectFullUserDetails.php +++ b/lib/functions/output/function.getCorrectFullUserDetails.php @@ -20,25 +20,23 @@ /** * Returns full style user details "Name, Firstname | Company" * - * @param array An array with keys firstname, name and company + * @param + * array An array with keys firstname, name and company * @return string The full details - * + * * @author Florian Lippert */ - -function getCorrectFullUserDetails($userinfo) { +function getCorrectFullUserDetails($userinfo) +{ $returnval = ''; if (isset($userinfo['firstname']) && isset($userinfo['name']) && isset($userinfo['company'])) { if ($userinfo['company'] == '') { $returnval = $userinfo['name'] . ', ' . $userinfo['firstname']; - } - else { - if ($userinfo['name'] != '' - && $userinfo['firstname'] != '') { + } else { + if ($userinfo['name'] != '' && $userinfo['firstname'] != '') { $returnval = $userinfo['name'] . ', ' . $userinfo['firstname'] . ' | ' . $userinfo['company']; - } - else { + } else { $returnval = $userinfo['company']; } } diff --git a/lib/functions/output/function.getCorrectUserSalutation.php b/lib/functions/output/function.getCorrectUserSalutation.php index 91e077b3..cd407349 100644 --- a/lib/functions/output/function.getCorrectUserSalutation.php +++ b/lib/functions/output/function.getCorrectUserSalutation.php @@ -20,26 +20,22 @@ /** * Returns correct user salutation, either "Firstname Name" or "Company" * - * @param array An array with keys firstname, name and company + * @param + * array An array with keys firstname, name and company * @return string The correct salutation - * + * * @author Florian Lippert */ - function getCorrectUserSalutation($userinfo) { $returnval = ''; - - if(isset($userinfo['firstname']) && isset($userinfo['name']) && isset($userinfo['company'])) - { + + if (isset($userinfo['firstname']) && isset($userinfo['name']) && isset($userinfo['company'])) { // Always prefer firstname name - if($userinfo['company'] != '' && $userinfo['name'] == '' && $userinfo['firstname'] == '') - { + if ($userinfo['company'] != '' && $userinfo['name'] == '' && $userinfo['firstname'] == '') { $returnval = $userinfo['company']; - } - else - { + } else { $returnval = $userinfo['firstname'] . ' ' . $userinfo['name']; } } diff --git a/lib/functions/output/function.getTemplate.php b/lib/functions/output/function.getTemplate.php index 7fa6d655..a0404ca3 100644 --- a/lib/functions/output/function.getTemplate.php +++ b/lib/functions/output/function.getTemplate.php @@ -20,19 +20,20 @@ /** * Get template from filesystem * - * @param string Templatename - * @param string noarea If area should be used to get template + * @param + * string Templatename + * @param + * string noarea If area should be used to get template * @return string The Template * @author Florian Lippert */ - -function getTemplate($template, $noarea = 0) { - +function getTemplate($template, $noarea = 0) +{ global $templatecache, $theme; $fallback_theme = 'Sparkle'; - if (!isset($theme) || $theme == '') { + if (! isset($theme) || $theme == '') { $theme = $fallback_theme; } @@ -40,7 +41,7 @@ function getTemplate($template, $noarea = 0) { $template = AREA . '/' . $template; } - if (!isset($templatecache[$theme][$template])) { + if (! isset($templatecache[$theme][$template])) { $filename = './templates/' . $theme . '/' . $template . '.tpl'; @@ -78,13 +79,11 @@ function getTemplate($template, $noarea = 0) { * * @return string|bool content on success, else false */ -function _checkAndParseTpl($filename) { - +function _checkAndParseTpl($filename) +{ $templatefile = ""; - if (file_exists($filename) - && is_readable($filename) - ) { + if (file_exists($filename) && is_readable($filename)) { $templatefile = addcslashes(file_get_contents($filename), '"\\'); diff --git a/lib/functions/output/function.makecheckbox.php b/lib/functions/output/function.makecheckbox.php index 3a0feb37..2e92a106 100644 --- a/lib/functions/output/function.makecheckbox.php +++ b/lib/functions/output/function.makecheckbox.php @@ -20,48 +20,45 @@ /** * Return HTML Code for a checkbox * - * @param string The fieldname - * @param string The captions - * @param string The Value which will be returned - * @param bool Add a
at the end of the checkbox - * @param string Values which will be selected by default - * @param bool Whether the title may contain html or not - * @param bool Whether the value may contain html or not + * @param + * string The fieldname + * @param + * string The captions + * @param + * string The Value which will be returned + * @param + * bool Add a
at the end of the checkbox + * @param + * string Values which will be selected by default + * @param + * bool Whether the title may contain html or not + * @param + * bool Whether the value may contain html or not * @return string HTML Code * @author Michael Kaufmann */ - function makecheckbox($name, $title, $value, $break = false, $selvalue = NULL, $title_trusted = false, $value_trusted = false) { - if($selvalue !== NULL - && $value == $selvalue) - { + if ($selvalue !== NULL && $value == $selvalue) { $checked = 'checked="checked"'; - } - else if(isset($_SESSION['requestData'][$name])) - { + } else if (isset($_SESSION['requestData'][$name])) { $checked = 'checked="checked"'; - } - else - { + } else { $checked = ''; } - if(!$title_trusted) - { + if (! $title_trusted) { $title = htmlspecialchars($title); } - if(!$value_trusted) - { + if (! $value_trusted) { $value = htmlspecialchars($value); } $checkbox = ''; - if($break) - { - $checkbox.= '
'; + if ($break) { + $checkbox .= '
'; } return $checkbox; diff --git a/lib/functions/output/function.makeoption.php b/lib/functions/output/function.makeoption.php index a0072137..3e334446 100644 --- a/lib/functions/output/function.makeoption.php +++ b/lib/functions/output/function.makeoption.php @@ -20,43 +20,41 @@ /** * Return HTML Code for an option within a - '; + + return ''; } diff --git a/lib/functions/output/function.redirectTo.php b/lib/functions/output/function.redirectTo.php index 415b5a03..abaf2566 100644 --- a/lib/functions/output/function.redirectTo.php +++ b/lib/functions/output/function.redirectTo.php @@ -20,24 +20,26 @@ /** * Sends an header ( 'Location ...' ) to the browser. * - * @param string Destination - * @param array Get-Variables - * @param boolean if the target we are creating for a redirect - * should be a relative or an absolute url - * - * @return boolean false if params is not an array - * - * @author Florian Lippert - * @author Martin Burchert - * + * @param + * string Destination + * @param + * array Get-Variables + * @param + * boolean if the target we are creating for a redirect + * should be a relative or an absolute url + * + * @return boolean false if params is not an array + * + * @author Florian Lippert + * @author Martin Burchert + * * @changes martin@2005-01-29 * - added isRelative parameter * - speed up the url generation * - fixed bug #91 */ - -function redirectTo($destination, $get_variables = null, $isRelative = true) { - +function redirectTo($destination, $get_variables = null, $isRelative = true) +{ global $s; if (is_array($get_variables)) { @@ -56,9 +58,7 @@ function redirectTo($destination, $get_variables = null, $isRelative = true) { $linker->hostname = ''; $path = './'; } else { - if (isset($_SERVER['HTTPS']) - && strtolower($_SERVER['HTTPS']) == 'on' - ) { + if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { $linker->protocol = 'https'; } else { $linker->protocol = 'http'; @@ -74,8 +74,7 @@ function redirectTo($destination, $get_variables = null, $isRelative = true) { $linker->filename = $path . $destination; } header('Location: ' . $linker->getLink()); - exit; - + exit(); } elseif ($get_variables == null) { if ($isRelative) { $linker = new linker($destination, $s); @@ -83,7 +82,7 @@ function redirectTo($destination, $get_variables = null, $isRelative = true) { $linker = new linker($destination); } header('Location: ' . $linker->getLink()); - exit; + exit(); } return false; diff --git a/lib/functions/output/function.standard_error.php b/lib/functions/output/function.standard_error.php index 089d2343..e2613709 100644 --- a/lib/functions/output/function.standard_error.php +++ b/lib/functions/output/function.standard_error.php @@ -20,19 +20,21 @@ /** * Prints one ore more errormessages on screen * - * @param array Errormessages - * @param string A %s in the errormessage will be replaced by this string. + * @param + * array Errormessages + * @param + * string A %s in the errormessage will be replaced by this string. * @author Florian Lippert * @author Ron Brand */ -function standard_error($errors = '', $replacer = '', $throw_exception = false) { - +function standard_error($errors = '', $replacer = '', $throw_exception = false) +{ global $userinfo, $s, $header, $footer, $lng, $theme; $_SESSION['requestData'] = $_POST; $replacer = htmlentities($replacer); - if (!is_array($errors)) { + if (! is_array($errors)) { $errors = array( $errors ); @@ -40,14 +42,16 @@ function standard_error($errors = '', $replacer = '', $throw_exception = false) $link = ''; if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !== false) { - $link = ''.$lng['panel']['back'].''; + $link = '' . $lng['panel']['back'] . ''; } $error = ''; foreach ($errors as $single_error) { if (isset($lng['error'][$single_error])) { $single_error = $lng['error'][$single_error]; - $single_error = strtr($single_error, array('%s' => $replacer)); + $single_error = strtr($single_error, array( + '%s' => $replacer + )); } else { $error = 'Unknown Error (' . $single_error . '): ' . $replacer; break; @@ -56,7 +60,7 @@ function standard_error($errors = '', $replacer = '', $throw_exception = false) if (empty($error)) { $error = $single_error; } else { - $error.= ' ' . $single_error; + $error .= ' ' . $single_error; } } @@ -64,17 +68,18 @@ function standard_error($errors = '', $replacer = '', $throw_exception = false) throw new Exception(strip_tags($error), 400); } eval("echo \"" . getTemplate('misc/error', '1') . "\";"); - exit; + exit(); } -function dynamic_error($message) { +function dynamic_error($message) +{ global $userinfo, $s, $header, $footer, $lng, $theme; $_SESSION['requestData'] = $_POST; $link = ''; if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !== false) { - $link = ''.$lng['panel']['back'].''; + $link = '' . $lng['panel']['back'] . ''; } $error = $message; eval("echo \"" . getTemplate('misc/error', '1') . "\";"); - exit; + exit(); } diff --git a/lib/functions/output/function.standard_success.php b/lib/functions/output/function.standard_success.php index 1f319fb8..475f034c 100644 --- a/lib/functions/output/function.standard_success.php +++ b/lib/functions/output/function.standard_success.php @@ -29,21 +29,21 @@ function standard_success($success_message = '', $replacer = '', $params = array(), $throw_exception = false) { global $s, $header, $footer, $lng, $theme; - + if (isset($lng['success'][$success_message])) { $success_message = strtr($lng['success'][$success_message], array( '%s' => htmlentities($replacer) )); } - + if ($throw_exception) { throw new Exception(strip_tags($success_message), 200); } - + if (is_array($params) && isset($params['filename'])) { $redirect_url = $params['filename'] . '?s=' . $s; unset($params['filename']); - + foreach ($params as $varname => $value) { if ($value != '') { $redirect_url .= '&' . $varname . '=' . $value; @@ -52,7 +52,7 @@ function standard_success($success_message = '', $replacer = '', $params = array } else { $redirect_url = ''; } - + eval("echo \"" . getTemplate('misc/success', '1') . "\";"); exit(); } diff --git a/lib/functions/phphelpers/function.array_merge_prefix.php b/lib/functions/phphelpers/function.array_merge_prefix.php index 84aa8ed4..eefcbe46 100644 --- a/lib/functions/phphelpers/function.array_merge_prefix.php +++ b/lib/functions/phphelpers/function.array_merge_prefix.php @@ -16,28 +16,20 @@ * @package Functions * */ - function array_merge_prefix($array1, $key_prefix, $array2) { - if(is_array($array1) && is_array($array2)) - { - if($key_prefix != '') - { - foreach($array2 as $key => $value) - { + if (is_array($array1) && is_array($array2)) { + if ($key_prefix != '') { + foreach ($array2 as $key => $value) { $array1[$key_prefix . '_' . $key] = $value; unset($array2[$key]); } unset($array2); return $array1; - } - else - { + } else { return array_merge($array1, $array2); } - } - else - { + } else { return $array1; } } diff --git a/lib/functions/phphelpers/function.doubleval_ressource.php b/lib/functions/phphelpers/function.doubleval_ressource.php index 21170b82..e7ffb9db 100644 --- a/lib/functions/phphelpers/function.doubleval_ressource.php +++ b/lib/functions/phphelpers/function.doubleval_ressource.php @@ -21,19 +21,17 @@ * Returns a double of the given value which isn't negative. * Returns -1 if the given value was -1. * - * @param any The value + * @param + * any The value * @return double The positive value * @author Florian Lippert */ - function doubleval_ressource($the_value) { $the_value = doubleval($the_value); - if($the_value < 0 - && $the_value != '-1') - { - $the_value*= - 1; + if ($the_value < 0 && $the_value != '-1') { + $the_value *= - 1; } return $the_value; diff --git a/lib/functions/phphelpers/function.html_entity_decode_array.php b/lib/functions/phphelpers/function.html_entity_decode_array.php index ca176210..0dab2248 100644 --- a/lib/functions/phphelpers/function.html_entity_decode_array.php +++ b/lib/functions/phphelpers/function.html_entity_decode_array.php @@ -22,29 +22,28 @@ * can select which fields should be handled by htmlentities and with advantage, * that you can eliminate all html entities by setting complete=true * - * @param array The subject array - * @param string The fields which should be checked for, separated by spaces - * @param bool Select true to use html_entity_decode_complete instead of html_entity_decode - * @param int See php documentation about this - * @param string See php documentation about this + * @param + * array The subject array + * @param + * string The fields which should be checked for, separated by spaces + * @param + * bool Select true to use html_entity_decode_complete instead of html_entity_decode + * @param + * int See php documentation about this + * @param + * string See php documentation about this * @return array The array with html_entity_decode'd strings * @author Florian Lippert */ - function html_entity_decode_array($subject, $fields = '', $complete = false, $quote_style = ENT_COMPAT, $charset = 'UTF-8') { - if(is_array($subject)) - { - if(!is_array($fields)) - { + if (is_array($subject)) { + if (! is_array($fields)) { $fields = array_trim(explode(' ', $fields)); } - foreach($subject as $field => $value) - { - if((!is_array($fields) || empty($fields)) - || (is_array($fields) && !empty($fields) && in_array($field, $fields))) - { + foreach ($subject as $field => $value) { + if ((! is_array($fields) || empty($fields)) || (is_array($fields) && ! empty($fields) && in_array($field, $fields))) { /** * Just call ourselve to manage multi-dimensional arrays */ @@ -52,15 +51,10 @@ function html_entity_decode_array($subject, $fields = '', $complete = false, $qu $subject[$field] = html_entity_decode_array($subject[$field], $fields, $complete, $quote_style, $charset); } } - } - else - { - if($complete == true) - { + } else { + if ($complete == true) { $subject = html_entity_decode_complete($subject, $quote_style, $charset); - } - else - { + } else { $subject = html_entity_decode($subject, $quote_style, $charset); } } diff --git a/lib/functions/phphelpers/function.html_entity_decode_complete.php b/lib/functions/phphelpers/function.html_entity_decode_complete.php index 5060207f..f50456f2 100644 --- a/lib/functions/phphelpers/function.html_entity_decode_complete.php +++ b/lib/functions/phphelpers/function.html_entity_decode_complete.php @@ -20,26 +20,21 @@ /** * Calls html_entity_decode in a loop until the result doesn't differ from original anymore * - * @param string The string in which the html entities should be eliminated. + * @param + * string The string in which the html entities should be eliminated. * @return string The cleaned string * @author Florian Lippert */ - function html_entity_decode_complete($string) { global $theme; - if($theme == 'Classic') - { - while($string != html_entity_decode($string)) - { + if ($theme == 'Classic') { + while ($string != html_entity_decode($string)) { $string = html_entity_decode($string); } - } - else - { - while($string != html_entity_decode($string, ENT_COMPAT | ENT_HTML5, 'UTF-8')) - { + } else { + while ($string != html_entity_decode($string, ENT_COMPAT | ENT_HTML5, 'UTF-8')) { $string = html_entity_decode($string, ENT_COMPAT | ENT_HTML5, 'UTF-8'); } } diff --git a/lib/functions/phphelpers/function.htmlentities_array.php b/lib/functions/phphelpers/function.htmlentities_array.php index 26d0a6d1..671b120a 100644 --- a/lib/functions/phphelpers/function.htmlentities_array.php +++ b/lib/functions/phphelpers/function.htmlentities_array.php @@ -21,28 +21,26 @@ * Wrapper around htmlentities to handle arrays, with the advantage that you * can select which fields should be handled by htmlentities * - * @param array The subject array - * @param string The fields which should be checked for, separated by spaces - * @param int See php documentation about this - * @param string See php documentation about this + * @param + * array The subject array + * @param + * string The fields which should be checked for, separated by spaces + * @param + * int See php documentation about this + * @param + * string See php documentation about this * @return array The array with htmlentitie'd strings * @author Florian Lippert */ - function htmlentities_array($subject, $fields = '', $quote_style = ENT_QUOTES, $charset = 'UTF-8') { - if(is_array($subject)) - { - if(!is_array($fields)) - { + if (is_array($subject)) { + if (! is_array($fields)) { $fields = array_trim(explode(' ', $fields)); } - foreach($subject as $field => $value) - { - if((!is_array($fields) || empty($fields)) - || (is_array($fields) && !empty($fields) && in_array($field, $fields))) - { + foreach ($subject as $field => $value) { + if ((! is_array($fields) || empty($fields)) || (is_array($fields) && ! empty($fields) && in_array($field, $fields))) { /** * Just call ourselve to manage multi-dimensional arrays */ @@ -50,9 +48,7 @@ function htmlentities_array($subject, $fields = '', $quote_style = ENT_QUOTES, $ $subject[$field] = htmlentities_array($subject[$field], $fields, $quote_style, $charset); } } - } - else - { + } else { $subject = htmlentities($subject, $quote_style, $charset); } diff --git a/lib/functions/phphelpers/function.intval_ressource.php b/lib/functions/phphelpers/function.intval_ressource.php index a16396f6..73a3e2b4 100644 --- a/lib/functions/phphelpers/function.intval_ressource.php +++ b/lib/functions/phphelpers/function.intval_ressource.php @@ -21,19 +21,17 @@ * Returns an integer of the given value which isn't negative. * Returns -1 if the given value was -1. * - * @param any The value + * @param + * any The value * @return int The positive value * @author Florian Lippert */ - function intval_ressource($the_value) { $the_value = intval($the_value); - if($the_value < 0 - && $the_value != '-1') - { - $the_value*= - 1; + if ($the_value < 0 && $the_value != '-1') { + $the_value *= - 1; } return $the_value; diff --git a/lib/functions/phphelpers/function.str_replace_array.php b/lib/functions/phphelpers/function.str_replace_array.php index 8d018f61..efdaa9c0 100644 --- a/lib/functions/phphelpers/function.str_replace_array.php +++ b/lib/functions/phphelpers/function.str_replace_array.php @@ -21,30 +21,27 @@ * Replaces Strings in an array, with the advantage that you * can select which fields should be str_replace'd * - * @param mixed String or array of strings to search for - * @param mixed String or array to replace with - * @param array The subject array - * @param string The fields which should be checked for, separated by spaces + * @param + * mixed String or array of strings to search for + * @param + * mixed String or array to replace with + * @param + * array The subject array + * @param + * string The fields which should be checked for, separated by spaces * @return array The str_replace'd array * @author Florian Lippert */ - function str_replace_array($search, $replace, $subject, $fields = '') { - if(is_array($subject)) - { + if (is_array($subject)) { $fields = array_trim(explode(' ', $fields)); - foreach($subject as $field => $value) - { - if((!is_array($fields) || empty($fields)) - || (is_array($fields) && !empty($fields) && in_array($field, $fields))) - { + foreach ($subject as $field => $value) { + if ((! is_array($fields) || empty($fields)) || (is_array($fields) && ! empty($fields) && in_array($field, $fields))) { $subject[$field] = str_replace($search, $replace, $subject[$field]); } } - } - else - { + } else { $subject = str_replace($search, $replace, $subject); } diff --git a/lib/functions/phphelpers/function.stripslashes_array.php b/lib/functions/phphelpers/function.stripslashes_array.php index ac81f9e1..2dfae6d7 100644 --- a/lib/functions/phphelpers/function.stripslashes_array.php +++ b/lib/functions/phphelpers/function.stripslashes_array.php @@ -22,29 +22,28 @@ * can select which fields should be handled by htmlentities and with advantage, * that you can eliminate all slashes by setting complete=true * - * @param array The subject array - * @param int See php documentation about this - * @param string See php documentation about this - * @param string The fields which should be checked for, separated by spaces - * @param bool Select true to use stripslashes_complete instead of stripslashes + * @param + * array The subject array + * @param + * int See php documentation about this + * @param + * string See php documentation about this + * @param + * string The fields which should be checked for, separated by spaces + * @param + * bool Select true to use stripslashes_complete instead of stripslashes * @return array The array with stripslashe'd strings * @author Florian Lippert */ - function stripslashes_array($subject, $fields = '', $complete = false) { - if(is_array($subject)) - { - if(!is_array($fields)) - { + if (is_array($subject)) { + if (! is_array($fields)) { $fields = array_trim(explode(' ', $fields)); } - foreach($subject as $field => $value) - { - if((!is_array($fields) || empty($fields)) - || (is_array($fields) && !empty($fields) && in_array($field, $fields))) - { + foreach ($subject as $field => $value) { + if ((! is_array($fields) || empty($fields)) || (is_array($fields) && ! empty($fields) && in_array($field, $fields))) { /** * Just call ourselve to manage multi-dimensional arrays */ @@ -52,15 +51,10 @@ function stripslashes_array($subject, $fields = '', $complete = false) $subject[$field] = stripslashes_array($subject[$field], $fields, $complete); } } - } - else - { - if($complete == true) - { + } else { + if ($complete == true) { $subject = stripslashes_complete($subject); - } - else - { + } else { $subject = stripslashes($subject); } } diff --git a/lib/functions/phphelpers/function.stripslashes_complete.php b/lib/functions/phphelpers/function.stripslashes_complete.php index 04dd07b1..f9a4b7da 100644 --- a/lib/functions/phphelpers/function.stripslashes_complete.php +++ b/lib/functions/phphelpers/function.stripslashes_complete.php @@ -20,15 +20,14 @@ /** * Calls stripslashes in a loop until the result doesn't differ from original anymore * - * @param string The string in which the slashes should be eliminated. + * @param + * string The string in which the slashes should be eliminated. * @return string The cleaned string * @author Florian Lippert */ - function stripslashes_complete($string) { - while($string != stripslashes($string)) - { + while ($string != stripslashes($string)) { $string = stripslashes($string); } diff --git a/lib/functions/validate/function.buildValidMailFrom.php b/lib/functions/validate/function.buildValidMailFrom.php index 02057359..4d0b21b6 100644 --- a/lib/functions/validate/function.buildValidMailFrom.php +++ b/lib/functions/validate/function.buildValidMailFrom.php @@ -20,14 +20,21 @@ /** * Create a valid from/to - mailheader (remove carriage-returns) * - * @param string The name of the recipient - * @param string The mailaddress + * @param + * string The name of the recipient + * @param + * string The mailaddress * @return string A valid header-entry * @author Florian Aders */ - function buildValidMailFrom($name, $mailaddress) { - $mailfrom = str_replace(array("\r", "\n"), '', $name) . ' <' . str_replace(array("\r", "\n"), '', $mailaddress) . '>'; + $mailfrom = str_replace(array( + "\r", + "\n" + ), '', $name) . ' <' . str_replace(array( + "\r", + "\n" + ), '', $mailaddress) . '>'; return $mailfrom; } diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 4bdd1916..3dd0e658 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -16,7 +16,6 @@ * @package System * */ - define('TABLE_FTP_GROUPS', 'ftp_groups'); define('TABLE_FTP_USERS', 'ftp_users'); define('TABLE_FTP_QUOTALIMITS', 'ftp_quotalimits'); @@ -53,4 +52,4 @@ define('TABLE_PANEL_FPMDAEMONS', 'panel_fpmdaemons'); define('TABLE_PANEL_PLANS', 'panel_plans'); define('TABLE_API_KEYS', 'api_keys'); -require dirname(__FILE__).'/version.inc.php'; +require dirname(__FILE__) . '/version.inc.php'; diff --git a/lng/dutch.lng.php b/lng/dutch.lng.php index 5c845390..7ed849dd 100644 --- a/lng/dutch.lng.php +++ b/lng/dutch.lng.php @@ -20,7 +20,6 @@ /** * Global */ - $lng['translator'] = 'Sander Klein/Frits Letteboer'; $lng['panel']['edit'] = 'bewerken'; $lng['panel']['delete'] = 'verwijderen'; @@ -627,7 +626,6 @@ $lng['dkim']['dkim_dkimkeys']['description'] = 'Bestandsnaam van het DK $lng['dkim']['dkimrestart_command']['title'] = 'Herstart-commando voor Milter'; $lng['dkim']['dkimrestart_command']['description'] = 'Geef het commando om de milter-plugin te herstarten'; - // ADDED IN 1.2.19-svn12 $lng['admin']['allips'] = 'Alle IP\'s'; @@ -746,7 +744,7 @@ $lng['admin']['show_version_footer']['description'] = 'Toont de versie van Froxl $lng['admin']['froxlor_graphic']['title'] = 'Kopgrafiek voor Froxlor'; $lng['admin']['froxlor_graphic']['description'] = 'Afbeelding die getoond wordt in de kop'; -//improved froxlor +// improved froxlor $lng['menue']['phpsettings']['maintitle'] = 'PHP Configuratie\'s'; $lng['admin']['phpsettings']['title'] = 'PHP Configuratie'; @@ -786,7 +784,7 @@ $lng['serversettings']['mod_fcgid']['tmpdir']['description'] = 'Waar dienen de t $lng['serversettings']['mod_fcgid']['peardir']['title'] = 'Globale PEAR-mappen'; $lng['serversettings']['mod_fcgid']['peardir']['description'] = 'Welke PEAR-mappen dienen te worden ingesloten in elke php.ini? Bij meerdere mappen dienen deze te worden gescheiden door dubbele punten.'; -//improved Froxlor 2 +// improved Froxlor 2 $lng['admin']['templates']['index_html'] = 'Standaardpagina voor nieuwe mappen/domeinen'; $lng['admin']['templates']['SERVERNAME'] = 'Wordt vervangen door de naam van de server.'; @@ -830,7 +828,6 @@ $lng['serversettings']['mod_fcgid']['maxrequests']['description'] = 'Toegestane // fix bug #1124 $lng['error']['admin_domain_emailsystemhostname'] = 'De naam van de server kan niet gebruikt worden als domein voor e-mail.'; - // ADDED IN 1.4.2.1-2 $lng['admin']['ipsandports']['webserverdefaultconfig'] = 'Standaarconfiguratie webserver'; diff --git a/lng/english.lng.php b/lng/english.lng.php index a31e8721..afc5e731 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -20,7 +20,6 @@ /** * Global */ - $lng['translator'] = ''; $lng['panel']['edit'] = 'Edit'; $lng['panel']['delete'] = 'Delete'; @@ -499,7 +498,7 @@ $lng['admin']['updatecounters'] = 'Recalculate resource usage'; $lng['question']['admin_counters_reallyupdate'] = 'Do you really want to recalculate resource usage?'; $lng['panel']['pathDescription'] = 'If the directory doesn\'t exist, it will be created automatically.'; $lng['panel']['pathDescriptionEx'] = '

If you want a redirect to another domain than this entry has to start with http:// or https://.'; -$lng['panel']['pathDescriptionSubdomain'] = $lng['panel']['pathDescription'].$lng['panel']['pathDescriptionEx']."

If the URL ends with / it is considered a folder, if not, it is treated as file."; +$lng['panel']['pathDescriptionSubdomain'] = $lng['panel']['pathDescription'] . $lng['panel']['pathDescriptionEx'] . "

If the URL ends with / it is considered a folder, if not, it is treated as file."; // ADDED IN 1.2.16-svn6 @@ -681,10 +680,10 @@ $lng['admin']['sslsettings'] = 'SSL settings'; $lng['cronjobs']['notyetrun'] = 'Not yet run'; $lng['serversettings']['default_vhostconf']['title'] = 'Default vHost-settings'; $lng['admin']['specialsettings_replacements'] = "You can use the following variables:
{DOMAIN}, {DOCROOT}, {CUSTOMER}, {IP}, {PORT}, {SCHEME}
"; -$lng['serversettings']['default_vhostconf']['description'] = 'The content of this field will be included into this ip/port vHost container directly. '.$lng['admin']['specialsettings_replacements'].' Attention: The code won\'t be checked for any errors. If it contains errors, webserver might not start again!'; +$lng['serversettings']['default_vhostconf']['description'] = 'The content of this field will be included into this ip/port vHost container directly. ' . $lng['admin']['specialsettings_replacements'] . ' Attention: The code won\'t be checked for any errors. If it contains errors, webserver might not start again!'; $lng['serversettings']['apache_globaldiropt']['title'] = 'Directory options for customer-prefix'; $lng['serversettings']['apache_globaldiropt']['description'] = 'The content of this field will be included into the 05_froxlor_dirfix_nofcgid.conf apache config. If empty, the default value is used:

apache >=2.4
Require all granted
AllowOverride All


apache <=2.2
Order allow,deny
allow from all
'; -$lng['serversettings']['default_vhostconf_domain']['description'] = 'The content of this field will be included into the domain vHost container directly. '.$lng['admin']['specialsettings_replacements'].' Attention: The code won\'t be checked for any errors. If it contains errors, webserver might not start again!'; +$lng['serversettings']['default_vhostconf_domain']['description'] = 'The content of this field will be included into the domain vHost container directly. ' . $lng['admin']['specialsettings_replacements'] . ' Attention: The code won\'t be checked for any errors. If it contains errors, webserver might not start again!'; $lng['error']['invalidip'] = 'Invalid IP address: %s'; $lng['serversettings']['decimal_places'] = 'Number of decimal places in traffic/webspace output'; @@ -823,7 +822,7 @@ $lng['admin']['show_version_footer']['description'] = 'Show the Froxlor version $lng['admin']['froxlor_graphic']['title'] = 'Header graphic for Froxlor'; $lng['admin']['froxlor_graphic']['description'] = 'What graphic should be shown in the header'; -//improved froxlor +// improved froxlor $lng['menue']['phpsettings']['maintitle'] = 'PHP Configurations'; $lng['admin']['phpsettings']['title'] = 'PHP Configuration'; @@ -866,7 +865,7 @@ $lng['serversettings']['mod_fcgid']['tmpdir']['description'] = 'Where should the $lng['serversettings']['mod_fcgid']['peardir']['title'] = 'Global PEAR directories'; $lng['serversettings']['mod_fcgid']['peardir']['description'] = 'Which global PEAR directories should be replaced in every php.ini config? Different directories must be separated by a colon.'; -//improved Froxlor 2 +// improved Froxlor 2 $lng['admin']['templates']['index_html'] = 'index file for newly created customer directories'; $lng['admin']['templates']['SERVERNAME'] = 'Replaced with the servername.'; @@ -1564,8 +1563,8 @@ $lng['tasks']['remove_emailacc_files'] = 'Delete customer e-mail data.'; // ADDED IN 0.9.28-svn5 $lng['error']['operationnotpermitted'] = 'Operation not permitted!'; $lng['error']['featureisdisabled'] = 'Feature %s is disabled. Please contact your service provider.'; -$lng['serversettings']['catchall_enabled']['title'] = 'Use Catchall'; -$lng['serversettings']['catchall_enabled']['description'] = 'Do you want to provide your customers the catchall-feature?'; +$lng['serversettings']['catchall_enabled']['title'] = 'Use Catchall'; +$lng['serversettings']['catchall_enabled']['description'] = 'Do you want to provide your customers the catchall-feature?'; // ADDED IN 0.9.28.svn6 $lng['serversettings']['apache_24']['title'] = 'Use modifications for Apache 2.4'; @@ -2045,8 +2044,8 @@ $lng['2fa']['2fa_verify'] = 'Verify code'; $lng['mails']['2fa']['mailbody'] = 'Hello,\n\nyour 2FA login-code is: {CODE}.\n\nThis is an automatically created\ne-mail, please do not answer!\n\nYours sincerely, your administrator'; $lng['mails']['2fa']['subject'] = 'Froxlor - 2FA Code'; $lng['2fa']['2fa_overview_desc'] = 'Here you can activate a two-factor authentication for your account.

You can either use an authenticator-app (time-based one-time password / TOTP) or let froxlor send you an email to your account-address after each successful login with a one-time password.'; -$lng['2fa']['2fa_email_desc'] = 'Your account is set up to use one-time passwords via e-mail. To deactivate, click on "'.$lng['2fa']['2fa_delete'].'"'; -$lng['2fa']['2fa_ga_desc'] = 'Your account is set up to use time-based one-time passwords via authenticator-app. Please scan the QR code below with your desired authenticator app to generate the codes. To deactivate, click on "'.$lng['2fa']['2fa_delete'].'"'; +$lng['2fa']['2fa_email_desc'] = 'Your account is set up to use one-time passwords via e-mail. To deactivate, click on "' . $lng['2fa']['2fa_delete'] . '"'; +$lng['2fa']['2fa_ga_desc'] = 'Your account is set up to use time-based one-time passwords via authenticator-app. Please scan the QR code below with your desired authenticator app to generate the codes. To deactivate, click on "' . $lng['2fa']['2fa_delete'] . '"'; $lng['admin']['logviewenabled'] = 'Enable access to access/error-logs'; $lng['panel']['viewlogs'] = 'View logfiles'; $lng['panel']['not_configured'] = 'System not configured yet. Click here to go to configurations.'; diff --git a/lng/french.lng.php b/lng/french.lng.php index 540f1b08..1e18a049 100644 --- a/lng/french.lng.php +++ b/lng/french.lng.php @@ -22,8 +22,8 @@ /** * Some importants rules of typograhie in french : * These signs << ! ? : " & >> must be be preceded by white space - * -> We can make the white space like that : <<   >> - * -> so the white space is still committed to the previous letter and punctuation mark as follows. + * -> We can make the white space like that : <<   >> + * -> so the white space is still committed to the previous letter and punctuation mark as follows. * These signs << . ; , ' >> should be glued to the previous letter * These signs << / | = >> would be preceded and followed with a white as mush as possible, it is much clear from reading. */ @@ -31,7 +31,6 @@ /** * Global */ - $lng['translator'] = 'Tim Zielosko, Aldo Reset, Romain MARIADASSOU'; $lng['panel']['edit'] = 'Modifier'; $lng['panel']['delete'] = 'Supprimer'; @@ -231,7 +230,7 @@ $lng['error']['destinationnonexist'] = 'Veuillez écrire votre adresse de renvoi $lng['error']['destinationalreadyexistasmail'] = 'Le renvoi vers l\'adresse "%s" existe déjà comme adresse active.'; $lng['error']['destinationalreadyexist'] = 'Il existe déjà une réexpédition vers l\'adresse "%s".'; $lng['error']['destinationiswrong'] = 'L\'adresse "%s" contient des signes invalides ou est incomplète.'; -// $lng['error']['loginnameissystemaccount'] = 'Vous ne pouvez pas créer un compte identique au compte système, veuillez réessayer avec un autre nom.'; +// $lng['error']['loginnameissystemaccount'] = 'Vous ne pouvez pas créer un compte identique au compte système, veuillez réessayer avec un autre nom.'; $lng['error']['loginnameissystemaccount'] = 'Vous ne pouvez pas créer de compte ressemblant aux comptes système (ex : "%s"). Veuillez entrer un autre nom de compte.'; /** diff --git a/lng/german.lng.php b/lng/german.lng.php index 8207ad85..a1c29035 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -20,7 +20,6 @@ /** * Global */ - $lng['translator'] = ''; $lng['panel']['edit'] = 'bearbeiten'; $lng['panel']['delete'] = 'löschen'; @@ -494,7 +493,7 @@ $lng['admin']['updatecounters'] = 'Ressourcenverbrauch'; $lng['question']['admin_counters_reallyupdate'] = 'Wollen Sie den Ressourcenverbrauch neu berechnen?'; $lng['panel']['pathDescription'] = 'Sollte das Verzeichnis nicht existieren, wird es automatisch erstellt.'; $lng['panel']['pathDescriptionEx'] = '
Sollte eine Weiterleitung auf eine andere Domain gewünscht sein, muss der Eintrag mit http:// oder https:// beginnen.'; -$lng['panel']['pathDescriptionSubdomain'] = $lng['panel']['pathDescription'].$lng['panel']['pathDescriptionEx']."
Endet die URL mit einem / (Slash) geht Froxlor von einem Ordner aus, wenn nicht, wird es wie eine Datei behandelt."; +$lng['panel']['pathDescriptionSubdomain'] = $lng['panel']['pathDescription'] . $lng['panel']['pathDescriptionEx'] . "
Endet die URL mit einem / (Slash) geht Froxlor von einem Ordner aus, wenn nicht, wird es wie eine Datei behandelt."; // ADDED IN 1.2.16-svn6 @@ -675,8 +674,8 @@ $lng['admin']['sslsettings'] = 'SSL-Einstellungen'; $lng['cronjobs']['notyetrun'] = 'Bisher nicht gestartet'; $lng['serversettings']['default_vhostconf']['title'] = 'Standard vHost-Einstellungen'; $lng['admin']['specialsettings_replacements'] = "Die folgenden Variablen können verwendet werden:
{DOMAIN}, {DOCROOT}, {CUSTOMER}, {IP}, {PORT}, {SCHEME}
"; -$lng['serversettings']['default_vhostconf']['description'] = 'Der Inhalt dieses Feldes wird direkt in den IP/Port-vHost-Container übernommen. '.$lng['admin']['specialsettings_replacements'].'
ACHTUNG: Der Code wird nicht auf Fehler geprüft. Etwaige Fehler werden also auch übernommen. Der Webserver könnte nicht mehr starten!'; -$lng['serversettings']['default_vhostconf_domain']['description'] = 'Der Inhalt dieses Feldes wird direkt in jeden Domain-vHost-Container übernommen. '. $lng['admin']['specialsettings_replacements'].'ACHTUNG: Der Code wird nicht auf Fehler geprüft. Etwaige Fehler werden also auch übernommen. Der Webserver könnte nicht mehr starten!'; +$lng['serversettings']['default_vhostconf']['description'] = 'Der Inhalt dieses Feldes wird direkt in den IP/Port-vHost-Container übernommen. ' . $lng['admin']['specialsettings_replacements'] . '
ACHTUNG: Der Code wird nicht auf Fehler geprüft. Etwaige Fehler werden also auch übernommen. Der Webserver könnte nicht mehr starten!'; +$lng['serversettings']['default_vhostconf_domain']['description'] = 'Der Inhalt dieses Feldes wird direkt in jeden Domain-vHost-Container übernommen. ' . $lng['admin']['specialsettings_replacements'] . 'ACHTUNG: Der Code wird nicht auf Fehler geprüft. Etwaige Fehler werden also auch übernommen. Der Webserver könnte nicht mehr starten!'; $lng['serversettings']['apache_globaldiropt']['title'] = 'Kunden-Prefix Ordner-Optionen'; $lng['serversettings']['apache_globaldiropt']['description'] = 'Der Inhalt dieses Feldes wird in die 05_froxlor_dirfix_nofcgid.conf Apache Konfigurationsdatei eingefügt. Wenn leer werden folgende Standardwerte verwendet:

apache >=2.4
Require all granted
AllowOverride All


apache <=2.2
Order allow,deny
allow from all
'; $lng['error']['invalidip'] = 'Ungültige IP-Adresse: "%s"'; @@ -816,7 +815,7 @@ $lng['admin']['show_version_footer']['description'] = 'Zeige Froxlor Version in $lng['admin']['froxlor_graphic']['title'] = 'Grafik im Kopfbereich des Panels'; $lng['admin']['froxlor_graphic']['description'] = 'Welche Grafik soll im Kopfbereich des Panels anstatt des Froxlor Logos angezeigt werden?'; -//improved froxlor +// improved froxlor $lng['menue']['phpsettings']['maintitle'] = 'PHP-Konfigurationen'; $lng['admin']['phpsettings']['title'] = 'PHP-Konfiguration'; @@ -860,7 +859,7 @@ $lng['admin']['know_what_youre_doing'] = 'Ändern Sie diese Einstellungen nur, w $lng['serversettings']['mod_fcgid']['peardir']['title'] = 'Globale PEAR Verzeichnisse'; $lng['serversettings']['mod_fcgid']['peardir']['description'] = 'Welche globalen PEAR Verzeichnisse sollen in den php.ini-Einstellungen ersetzt werden? Einzelne Verzeichnisse sind mit einem Doppelpunkt zu trennen.'; -//improved Froxlor 2 +// improved Froxlor 2 $lng['admin']['templates']['index_html'] = 'index.html Datei für neu erzeugte Kundenverzeichnisse'; $lng['admin']['templates']['SERVERNAME'] = 'Wird mit dem Servernamen ersetzt.'; @@ -1692,8 +1691,8 @@ $lng['2fa']['2fa_verify'] = 'Code verifizieren'; $lng['mails']['2fa']['mailbody'] = 'Hallo,\n\nihr 2FA-Login Code lautet: {CODE}\n\nDies ist eine automatisch generierte\neMail, bitte antworten Sie nicht auf\ndiese Mitteilung.\n\nIhr Administrator'; $lng['mails']['2fa']['subject'] = 'Froxlor - 2FA Code'; $lng['2fa']['2fa_overview_desc'] = 'Hier kann für das Konto eine Zwei-Faktor-Authentisierung aktiviert werden.

Es kann entweder eine Authenticator-App (time-based one-time password / TOTP) genutzt werden oder ein Einmalpasswort, welches nach erfolgreichem Login an die hinterlegte E-Mail Adresse gesendet wird.'; -$lng['2fa']['2fa_email_desc'] = 'Das Konto ist eingerichtet, um Einmalpasswörter per E-Mail zu erhalten. Zum Deaktivieren, klicke auf "'.$lng['2fa']['2fa_delete'].'"'; -$lng['2fa']['2fa_ga_desc'] = 'Das Konto ist eingerichtet, um zeitbasierte Einmalpasswörter via Authenticator-App zu erhalten. Um die gewünschte Authenticator-App einzurichten, scanne bitte den untenstehenden QR-Code. Zum Deaktivieren, klicke auf "'.$lng['2fa']['2fa_delete'].'"'; +$lng['2fa']['2fa_email_desc'] = 'Das Konto ist eingerichtet, um Einmalpasswörter per E-Mail zu erhalten. Zum Deaktivieren, klicke auf "' . $lng['2fa']['2fa_delete'] . '"'; +$lng['2fa']['2fa_ga_desc'] = 'Das Konto ist eingerichtet, um zeitbasierte Einmalpasswörter via Authenticator-App zu erhalten. Um die gewünschte Authenticator-App einzurichten, scanne bitte den untenstehenden QR-Code. Zum Deaktivieren, klicke auf "' . $lng['2fa']['2fa_delete'] . '"'; $lng['admin']['logviewenabled'] = 'Zugriff auf access/error-Logdateien'; $lng['panel']['viewlogs'] = 'Logdateien einsehen'; $lng['panel']['not_configured'] = 'Das System wurde noch nicht konfiguriert. Hier klicken für Konfiguration.'; diff --git a/lng/lng_references.php b/lng/lng_references.php index 492f1b63..fade3003 100644 --- a/lng/lng_references.php +++ b/lng/lng_references.php @@ -19,7 +19,6 @@ /** * Error References Mapping (do not need to be translated) */ - $lng['error']['myloginname'] = '\'' . $lng['login']['username'] . '\''; $lng['error']['mypassword'] = '\'' . $lng['login']['password'] . '\''; $lng['error']['oldpassword'] = '\'' . $lng['changepassword']['old_password'] . '\''; diff --git a/lng/portugues.lng.php b/lng/portugues.lng.php index 9e7d46d8..f3aa3749 100644 --- a/lng/portugues.lng.php +++ b/lng/portugues.lng.php @@ -22,7 +22,6 @@ /** * Global */ - $lng['translator'] = 'Ricardo Luiz Costa, Rafael Andrade, Thiago Goncalves de Castro'; $lng['panel']['edit'] = 'Editar'; $lng['panel']['delete'] = 'Deletar'; diff --git a/lng/swedish.lng.php b/lng/swedish.lng.php index 7a3100d7..9cdc438a 100644 --- a/lng/swedish.lng.php +++ b/lng/swedish.lng.php @@ -20,7 +20,6 @@ /** * Global */ - $lng['translator'] = 'Staffan Starberg'; $lng['panel']['edit'] = 'Ändra'; $lng['panel']['delete'] = 'Radera'; diff --git a/phpcs.xml b/phpcs.xml index 032051b6..dd119e2f 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -10,7 +10,8 @@ - + diff --git a/phpdox.xml b/phpdox.xml index 8161ff28..2dceb6dc 100644 --- a/phpdox.xml +++ b/phpdox.xml @@ -22,10 +22,7 @@ - + diff --git a/phpmd.xml b/phpmd.xml index 2f9d2bf5..2a8aceb1 100644 --- a/phpmd.xml +++ b/phpmd.xml @@ -1,5 +1,6 @@ - diff --git a/scripts/froxlor_master_cronjob.php b/scripts/froxlor_master_cronjob.php index ea9f14e5..76abbf6c 100644 --- a/scripts/froxlor_master_cronjob.php +++ b/scripts/froxlor_master_cronjob.php @@ -14,7 +14,6 @@ * @package Cron * */ - require dirname(__DIR__) . '/vendor/autoload.php'; \Froxlor\Cron\MasterCron::run(); diff --git a/ssl_certificates.php b/ssl_certificates.php index dabc63ec..d44f1825 100644 --- a/ssl_certificates.php +++ b/ssl_certificates.php @@ -1,7 +1,7 @@ (2016-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Panel - * + * */ use Froxlor\Database\Database; diff --git a/templates/Sparkle/2fa/overview.tpl b/templates/Sparkle/2fa/overview.tpl index 165e9874..fcb2fa25 100644 --- a/templates/Sparkle/2fa/overview.tpl +++ b/templates/Sparkle/2fa/overview.tpl @@ -2,38 +2,41 @@ $header

-   {$lng['login']['2fa']} +   + {$lng['login']['2fa']}

- +
-

{$lng['2fa']['2fa_overview_desc']}


-   +

{$lng['2fa']['2fa_overview_desc']}

+
 
- +
-

{$lng['2fa']['2fa_email_desc']}


- +

{$lng['2fa']['2fa_email_desc']}

+
- +
-

{$lng['2fa']['2fa_ga_desc']}


- QRCode

- +

{$lng['2fa']['2fa_ga_desc']}

+
QRCode
+
- +
diff --git a/templates/Sparkle/admin/phpconfig/overview.tpl b/templates/Sparkle/admin/phpconfig/overview.tpl index 403753b3..b23cc62f 100644 --- a/templates/Sparkle/admin/phpconfig/overview.tpl +++ b/templates/Sparkle/admin/phpconfig/overview.tpl @@ -1,38 +1,37 @@ $header -
-
-

-   - {$lng['menue']['phpsettings']['maintitle']} -

-
+
+
+

+   {$lng['menue']['phpsettings']['maintitle']} +

+
-
+
- + - - - - - - - - - - - - - - - $tablecontent - -
{$lng['admin']['phpsettings']['description']}{$lng['admin']['phpsettings']['activedomains']}{$lng['admin']['phpsettings']['fpmdesc']}{$lng['admin']['phpsettings']['binary']}{$lng['admin']['phpsettings']['file_extensions']}{$lng['panel']['options']}
- - + + + + + + + + + + + + + $tablecontent + +
{$lng['admin']['phpsettings']['description']}{$lng['admin']['phpsettings']['activedomains']}{$lng['admin']['phpsettings']['fpmdesc']}{$lng['admin']['phpsettings']['binary']}{$lng['admin']['phpsettings']['file_extensions']}{$lng['panel']['options']}
+ +
  {$lng['admin']['phpsettings']['addnew']} @@ -41,5 +40,5 @@ $header
-
+
$footer diff --git a/templates/Sparkle/assets/css/dark.css b/templates/Sparkle/assets/css/dark.css index c972bb91..f9dc59dd 100644 --- a/templates/Sparkle/assets/css/dark.css +++ b/templates/Sparkle/assets/css/dark.css @@ -1,34 +1,41 @@ .content, nav { background-color: #11171c; } + nav div:first-child { - display:inherit; + display: inherit; } + nav a { color: #424a51; } + nav a:hover { color: #fff; } + nav .active { color: #fff; } + .menuelement { border: none; color: #424a51; margin: 15px 0 25px 10px; padding: 0; } + .menuelement h4 { background: none; color: #088ecc; font-weight: 900; text-transform: uppercase; } + .menuelement h4 a { color: #088ecc; } .topheader { - background:#f0f2f4; -} + background: #f0f2f4; +} \ No newline at end of file diff --git a/templates/Sparkle/assets/css/froxlor.css b/templates/Sparkle/assets/css/froxlor.css index c779a029..65ffd926 100644 --- a/templates/Sparkle/assets/css/froxlor.css +++ b/templates/Sparkle/assets/css/froxlor.css @@ -1,92 +1,96 @@ @charset "UTF-8"; /* TYPE */ -html,body { - font-family:Numans, Verdana, Geneva, sans-serif; - background-color:#eeeeee; - font-size:12px; +html, body { + font-family: Numans, Verdana, Geneva, sans-serif; + background-color: #eeeeee; + font-size: 12px; } .content { - background-color:#eeeeee; - min-width:100%; - margin-top:100px; - border-bottom:0; + background-color: #eeeeee; + min-width: 100%; + margin-top: 100px; + border-bottom: 0; } /* * main container */ .main { - margin-left:240px; - margin-right:10px; - border:1px solid #666!important; - background:-webkit-gradient(linear, left top, right top, color-stop(0.16, rgb(220,220,220)), color-stop(1, rgb(255,255,255))); - background:-moz-linear-gradient(left center, rgb(220,220,220) 16%, rgb(255,255,255) 100%); - filter:progid:DXImageTransform.Microsoft.gradient(startColorStr=#dcdcdc, endColorStr=#ffffff, GradientType=1); - -ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#dcdcdc, endColorstr=#ffffff, GradientType=1)"; - webkit-border-top-right-radius:20px; - -webkit-border-bottom-left-radius:20px; - -moz-border-radius-topright:20px; - -moz-border-radius-bottomleft:20px; - border-top-right-radius:20px; - border-bottom-left-radius:20px; + margin-left: 240px; + margin-right: 10px; + border: 1px solid #666 !important; + background: -webkit-gradient(linear, left top, right top, color-stop(0.16, rgb(220, + 220, 220)), color-stop(1, rgb(255, 255, 255))); + background: -moz-linear-gradient(left center, rgb(220, 220, 220) 16%, + rgb(255, 255, 255) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#dcdcdc, + endColorStr=#ffffff, GradientType=1); + -ms-filter: + "progid:DXImageTransform.Microsoft.gradient(startColorstr=#dcdcdc, endColorstr=#ffffff, GradientType=1)"; + webkit-border-top-right-radius: 20px; + -webkit-border-bottom-left-radius: 20px; + -moz-border-radius-topright: 20px; + -moz-border-radius-bottomleft: 20px; + border-top-right-radius: 20px; + border-bottom-left-radius: 20px; } header img { - height:70px !important; + height: 70px !important; } h2 img { - width:32px!important; - height:32px!important; + width: 32px !important; + height: 32px !important; } .topheader { - background:#cccccc url('../img/header_g_froxlor.png') 0 bottom repeat-x; - margin-bottom:12px; - border-bottom:0; + background: #cccccc url('../img/header_g_froxlor.png') 0 bottom repeat-x; + margin-bottom: 12px; + border-bottom: 0; } .topheader_navigation { - display:none; + display: none; } .topheadernav img { - height:24px!important; - width:24px; + height: 24px !important; + width: 24px; } /* navigation */ nav { - background-color:#eeeeee; - margin:0; + background-color: #eeeeee; + margin: 0; } nav div:first-child { - display:block; - margin-top:0; + display: block; + margin-top: 0; } nav div:nth-child(2) { - border-top:1px solid #666!important; + border-top: 1px solid #666 !important; } nav div:last-child { - border-bottom:1px solid #666!important; + border-bottom: 1px solid #666 !important; } .menuelement { - -webkit-border-top-right-radius:20px; - -webkit-border-bottom-left-radius:20px; - -moz-border-radius-topright:20px; - -moz-border-radius-bottomleft:20px; - border-top-right-radius:20px; - border-bottom-left-radius:20px; + -webkit-border-top-right-radius: 20px; + -webkit-border-bottom-left-radius: 20px; + -moz-border-radius-topright: 20px; + -moz-border-radius-bottomleft: 20px; + border-top-right-radius: 20px; + border-bottom-left-radius: 20px; margin: 4px 0 8px 12px; - padding:4px 0 0 8px; - border:1px solid #666; - background-color:#fff; + padding: 4px 0 0 8px; + border: 1px solid #666; + background-color: #fff; } .menuelement ul li { @@ -94,22 +98,22 @@ nav div:last-child { } .menuelement h4 { - color:#000; + color: #000; } .menuelement h4 a { - color:#000; + color: #000; } /* TABLES */ table { border: 1px solid #666; - -webkit-border-top-right-radius:20px; - -webkit-border-bottom-left-radius:20px; - -moz-border-radius-topright:20px; - -moz-border-radius-bottomleft:20px; - border-top-right-radius:20px; - border-bottom-left-radius:20px; + -webkit-border-top-right-radius: 20px; + -webkit-border-bottom-left-radius: 20px; + -moz-border-radius-topright: 20px; + -moz-border-radius-bottomleft: 20px; + border-top-right-radius: 20px; + border-bottom-left-radius: 20px; background-color: #fff; } @@ -121,9 +125,9 @@ table thead th, table th { } table thead th:last-child { - -webkit-border-top-right-radius:20px; - -moz-border-radius-topright:20px; - border-top-right-radius:20px; + -webkit-border-top-right-radius: 20px; + -moz-border-radius-topright: 20px; + border-top-right-radius: 20px; } table tfoot tr td { @@ -145,78 +149,87 @@ table.hl tbody tr:hover:last-child td:first-child { } input { - color:#000; - background-color:#dae7ee!important; - border:1px solid #666666; + color: #000; + background-color: #dae7ee !important; + border: 1px solid #666666; } /* * BUTTONS */ -input[type="button"],input[type="submit"],input[type="reset"],input[type="file"] { - padding:4px 10px; - margin:0 30px 0 0; - height:30px; - border:1px solid #999999; - -moz-border-radius:5px; - -khtml-border-radius:5px; - -webkit-border-radius:5px; - border-radius:5px; +input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] + { + padding: 4px 10px; + margin: 0 30px 0 0; + height: 30px; + border: 1px solid #999999; + -moz-border-radius: 5px; + -khtml-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; background-color: #ccc; } -.loginsec input[type="button"],.loginsec input[type="submit"],.loginsec input[type="reset"] { - margin:0 1px; +.loginsec input[type="button"], .loginsec input[type="submit"], + .loginsec input[type="reset"] { + margin: 0 1px; } -input[type="submit"],input[class="yesbutton"],input[type="submit"]:hover,input[class="yesbutton"]:hover,input[type="submit"]:active,input[class="yesbutton"]:active { - color:green!important; - background:#ccc url('../img/icons/button_ok.png') no-repeat 4px 8px!important; - padding-left:25px; +input[type="submit"], input[class="yesbutton"], input[type="submit"]:hover, + input[class="yesbutton"]:hover, input[type="submit"]:active, input[class="yesbutton"]:active + { + color: green !important; + background: #ccc url('../img/icons/button_ok.png') no-repeat 4px 8px + !important; + padding-left: 25px; } -input[class="nobutton"],input[type="reset"],input[class="nobutton"]:hover,input[type="reset"]:hover,input[class="nobutton"]:active,input[type="reset"]:active { - color:red!important; - background:#ccc url('../img/icons/cancel.png') no-repeat 4px 8px!important; - padding-left:25px; +input[class="nobutton"], input[type="reset"], input[class="nobutton"]:hover, + input[type="reset"]:hover, input[class="nobutton"]:active, input[type="reset"]:active + { + color: red !important; + background: #ccc url('../img/icons/cancel.png') no-repeat 4px 8px + !important; + padding-left: 25px; } input[type="file"] { - color:blue!important; - background:#ccc url('../img/icons/button_ok.png') no-repeat 4px 8px!important; - padding-left:25px; + color: blue !important; + background: #ccc url('../img/icons/button_ok.png') no-repeat 4px 8px + !important; + padding-left: 25px; } select { - color:#000; - background-color:#dae7ee; - border:1px solid #666; + color: #000; + background-color: #dae7ee; + border: 1px solid #666; } .dboarditem { margin: 4px 0 18px 12px; border: 1px solid #666; - -webkit-border-top-right-radius:20px; - -webkit-border-bottom-left-radius:20px; - -moz-border-radius-topright:20px; - -moz-border-radius-bottomleft:20px; - border-top-right-radius:20px; - border-bottom-left-radius:20px; - padding:0; + -webkit-border-top-right-radius: 20px; + -webkit-border-bottom-left-radius: 20px; + -moz-border-radius-topright: 20px; + -moz-border-radius-bottomleft: 20px; + border-top-right-radius: 20px; + border-bottom-left-radius: 20px; + padding: 0; } -.dboarditem td,.dboarditemfull td { - padding-left:20px; +.dboarditem td, .dboarditemfull td { + padding-left: 20px; } .dboarditem table tbody tr:first-child th { - -webkit-border-top-right-radius:20px; - -moz-border-radius-topright:20px; - border-top-right-radius:20px; + -webkit-border-top-right-radius: 20px; + -moz-border-radius-topright: 20px; + border-top-right-radius: 20px; } .dboarditem table tbody tr:last-child td:first-child { - -webkit-border-bottom-left-radius:20px; - -moz-border-radius-bottomleft:20px; - border-bottom-left-radius:20px; + -webkit-border-bottom-left-radius: 20px; + -moz-border-radius-bottomleft: 20px; + border-bottom-left-radius: 20px; } \ No newline at end of file diff --git a/templates/Sparkle/assets/css/main.css b/templates/Sparkle/assets/css/main.css index 27926daa..eb696992 100644 --- a/templates/Sparkle/assets/css/main.css +++ b/templates/Sparkle/assets/css/main.css @@ -662,14 +662,14 @@ input[type="button"], input[type="submit"], input[type="reset"], input[type="fil margin: 0 1px; } -input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, .btnlink:hover - { +input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, + .btnlink:hover { color: #333; background-color: #dcdcdc; } -input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, .btnlink:active - { +input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, + .btnlink: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); @@ -681,12 +681,14 @@ input[type="submit"], input[class="yesbutton"], .btnlink { background-color: #35aa47; } -input[type="submit"]:hover, input[class="yesbutton"]:hover, .btnlink:hover { +input[type="submit"]:hover, input[class="yesbutton"]:hover, .btnlink:hover + { color: #fff; background-color: #1d943b; } -input[class="submit"]:active, input[class="yesbutton"]:active, .btnlink:active { +input[class="submit"]:active, input[class="yesbutton"]:active, .btnlink:active + { background-color: #35aa47; } @@ -1735,4 +1737,4 @@ td.size-50 { font-weight: 700; padding: 5px 10px; color: #ffe !important; -} +} \ No newline at end of file diff --git a/templates/Sparkle/assets/css/main_ie.css b/templates/Sparkle/assets/css/main_ie.css index 6865e288..aaedf4e3 100644 --- a/templates/Sparkle/assets/css/main_ie.css +++ b/templates/Sparkle/assets/css/main_ie.css @@ -5,10 +5,10 @@ input { padding: 4px 4px 0 24px; } -input[type="submit"],input[class="nobutton"],input[type="reset"] { +input[type="submit"], input[class="nobutton"], input[type="reset"] { padding-left: 24px; } table thead th { border-right: 1px solid #333; -} +} \ No newline at end of file diff --git a/templates/Sparkle/config.json b/templates/Sparkle/config.json index b6d2f779..1effdcb9 100644 --- a/templates/Sparkle/config.json +++ b/templates/Sparkle/config.json @@ -1 +1,26 @@ -{"variants":{"default":{"css":["main.css"],"js":["main.js", "apikey.js"],"description":"Default"},"froxlor":{"css":["main.css","froxlor.css"],"js":["main.js", "apikey.js"],"description":"Froxlor"}},"author":"Roman Schmerold"} +{ + "variants": { + "default": { + "css": [ + "main.css" + ], + "js": [ + "main.js", + "apikey.js" + ], + "description": "Default" + }, + "froxlor": { + "css": [ + "main.css", + "froxlor.css" + ], + "js": [ + "main.js", + "apikey.js" + ], + "description": "Froxlor" + } + }, + "author": "Roman Schmerold" +} diff --git a/templates/misc/awstats/index.html b/templates/misc/awstats/index.html index 409f2152..5cc33752 100644 --- a/templates/misc/awstats/index.html +++ b/templates/misc/awstats/index.html @@ -1,18 +1,20 @@ - + - AWStats for {SITE_DOMAIN} +AWStats for {SITE_DOMAIN} - - + + - - <body> - </body> - + + <body> + </body> + diff --git a/templates/misc/awstats/nav.html b/templates/misc/awstats/nav.html index 165a5568..d35ac3b8 100644 --- a/templates/misc/awstats/nav.html +++ b/templates/misc/awstats/nav.html @@ -1,38 +1,42 @@ - + - Navigation - -