mirror of
https://github.com/Froxlor/Froxlor.git
synced 2024-09-21 02:17:34 +00:00
get rid of most of the checkstyle warnings
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
parent
30f5902b88
commit
7416a41a42
@ -92,8 +92,8 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
|
||||
$traffic_percent = 100;
|
||||
}
|
||||
|
||||
$row = \Froxlor\PhpHelper::str_replace_array('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::strReplaceArray('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
|
||||
$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';
|
||||
|
||||
@ -174,7 +174,7 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_admin_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_admin_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -327,7 +327,7 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
|
||||
$ipaddress .= \Froxlor\UI\HTML::makeoption($row['ip'], $row['id'], $result['ip']);
|
||||
}
|
||||
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$admin_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/admin/formfield.admin_edit.php';
|
||||
$admin_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($admin_edit_data);
|
||||
|
@ -67,7 +67,7 @@ if ($page == 'overview') {
|
||||
'page' => 'error',
|
||||
'errno' => 3
|
||||
));
|
||||
} elseif (\Froxlor\Froxlor::version_compare2($version, $_version) == - 1) {
|
||||
} elseif (\Froxlor\Froxlor::versionCompare2($version, $_version) == - 1) {
|
||||
// there is a newer version - yay
|
||||
$isnewerversion = 1;
|
||||
} else {
|
||||
|
@ -58,7 +58,7 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
$cmod = $row['module'];
|
||||
}
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
|
||||
$row['lastrun'] = date('d.m.Y H:i', $row['lastrun']);
|
||||
$row['isactive'] = ((int) $row['isactive'] == 1) ? $lng['panel']['yes'] : $lng['panel']['no'];
|
||||
|
@ -126,8 +126,8 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
||||
$islocked = 1;
|
||||
}
|
||||
|
||||
$row = \Froxlor\PhpHelper::str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps subdomains');
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::strReplaceArray('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps subdomains');
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
|
||||
// fix progress-bars if value is >100%
|
||||
if ($disk_percent > 100) {
|
||||
@ -230,7 +230,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('customer_reallyunlock', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('customer_reallyunlock', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -260,7 +260,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno_withcheckbox('admin_customer_reallydelete', 'admin_customer_alsoremovefiles', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNoWithCheckbox('admin_customer_reallydelete', 'admin_customer_alsoremovefiles', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -438,7 +438,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
||||
$result['mysqls'] = '';
|
||||
}
|
||||
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$gender_options = \Froxlor\UI\HTML::makeoption($lng['gender']['undef'], 0, ($result['gender'] == '0' ? true : false), true, true);
|
||||
$gender_options .= \Froxlor\UI\HTML::makeoption($lng['gender']['male'], 1, ($result['gender'] == '1' ? true : false), true, true);
|
||||
|
@ -106,7 +106,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
|
||||
if (isset($row['domain']) && $row['domain'] != '' && $paging->checkDisplay($i)) {
|
||||
$row['customername'] = \Froxlor\User::getCorrectFullUserDetails($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
// display a nice list of IP's
|
||||
$row['ipandport'] = str_replace("\n", "<br />", $row['ipandport']);
|
||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
|
||||
@ -159,7 +159,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
if (\Froxlor\Domain\Domain::domainHasMainSubDomains($id)) {
|
||||
$showcheck = true;
|
||||
}
|
||||
\Froxlor\UI\HTML::ask_yesno_withcheckbox('admin_domain_reallydelete', 'remove_subbutmain_domains', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNoWithCheckbox('admin_domain_reallydelete', 'remove_subbutmain_domains', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -624,7 +624,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
}
|
||||
}
|
||||
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$domain_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_edit.php';
|
||||
$domain_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($domain_edit_data);
|
||||
|
@ -115,7 +115,7 @@ if ($page == 'overview') {
|
||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $dec_places);
|
||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $dec_places);
|
||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $dec_places);
|
||||
$userinfo = \Froxlor\PhpHelper::str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
|
||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||
|
||||
|
@ -58,7 +58,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$row['ip'] = '[' . $row['ip'] . ']';
|
||||
}
|
||||
@ -94,7 +94,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_ip_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_ip_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -146,7 +146,7 @@ if ($page == 'ipsandports' || $page == 'overview') {
|
||||
));
|
||||
} else {
|
||||
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($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);
|
||||
|
@ -63,7 +63,7 @@ if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
|
||||
$_action = 0;
|
||||
foreach ($logrows as $row) {
|
||||
// if ($paging->checkDisplay($i)) {
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
||||
|
||||
if ($_action != $action) {
|
||||
@ -122,7 +122,7 @@ if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('logger_reallytruncate', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('logger_reallytruncate', $filename, array(
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
), TABLE_PANEL_LOG);
|
||||
|
@ -134,7 +134,7 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('phpsetting_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('phpsetting_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -279,7 +279,7 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('fpmsetting_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('fpmsetting_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
|
@ -58,7 +58,7 @@ if ($page == '' || $page == 'overview') {
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
$row['ts_format'] = date("d.m.Y H:i", $row['ts']);
|
||||
eval("\$plans.=\"" . \Froxlor\UI\Template::getTemplate("plans/plans_plan") . "\";");
|
||||
$count ++;
|
||||
@ -90,7 +90,7 @@ if ($page == '' || $page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('plan_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('plan_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -271,7 +271,7 @@ if ($page == '' || $page == 'overview') {
|
||||
if ($result['name'] != '') {
|
||||
|
||||
$result['value'] = json_decode($result['value'], true);
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
foreach ($result['value'] as $index => $value) {
|
||||
$result[$index] = $value;
|
||||
|
@ -157,7 +157,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
'filename' => 'admin_index.php'
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_configs_reallyrebuild', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_configs_reallyrebuild', $filename, array(
|
||||
'page' => $page
|
||||
));
|
||||
}
|
||||
@ -179,7 +179,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/updatecounters") . "\";");
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_counters_reallyupdate', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_counters_reallyupdate', $filename, array(
|
||||
'page' => $page
|
||||
));
|
||||
}
|
||||
@ -194,7 +194,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_cleartextmailpws_reallywipe', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_cleartextmailpws_reallywipe', $filename, array(
|
||||
'page' => $page
|
||||
));
|
||||
}
|
||||
@ -211,7 +211,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_quotas_reallywipe', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_quotas_reallywipe', $filename, array(
|
||||
'page' => $page
|
||||
));
|
||||
}
|
||||
@ -252,7 +252,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_quotas_reallyenforce', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_quotas_reallyenforce', $filename, array(
|
||||
'page' => $page
|
||||
));
|
||||
}
|
||||
@ -261,7 +261,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$integrity->fixAll();
|
||||
} elseif (isset($_GET['action']) && $_GET['action'] == "fix") {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_integritycheck_reallyfix', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_integritycheck_reallyfix', $filename, array(
|
||||
'page' => $page
|
||||
));
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ if ($action == '') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_template_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_template_reallydelete', $filename, array(
|
||||
'subjectid' => $subjectid,
|
||||
'mailbodyid' => $mailbodyid,
|
||||
'page' => $page,
|
||||
@ -190,7 +190,7 @@ if ($action == '') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('admin_template_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('admin_template_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -426,7 +426,7 @@ if ($action == '') {
|
||||
));
|
||||
} else {
|
||||
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
$template = $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])];
|
||||
$subject = $result['value'];
|
||||
$result_stmt = Database::prepare("
|
||||
@ -442,7 +442,7 @@ if ($action == '') {
|
||||
|
||||
// don't escape the already escaped language-string so save up before htmlentities()
|
||||
$language = $result['language'];
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
$mailbody = $result['value'];
|
||||
|
||||
$template_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.template_edit.php';
|
||||
@ -487,7 +487,7 @@ if ($action == '') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
|
||||
$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);
|
||||
|
@ -115,7 +115,7 @@ if ($page == 'overview' || $page == 'customers') {
|
||||
));
|
||||
|
||||
while ($traffic_month = $traffic_list_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$virtual_host[$months[(int) $traffic_month['month']]] = \Froxlor\PhpHelper::size_readable($traffic_month['traffic'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
$virtual_host[$months[(int) $traffic_month['month']]] = \Froxlor\PhpHelper::sizeReadable($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") . "\");");
|
||||
@ -125,7 +125,7 @@ if ($page == 'overview' || $page == 'customers') {
|
||||
'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::sizeReadable($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") . "\");");
|
||||
|
@ -206,7 +206,7 @@ if (count($all_keys) == 0) {
|
||||
}
|
||||
|
||||
// escape stuff
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($key);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($key);
|
||||
|
||||
// shorten keys
|
||||
$row['_apikey'] = substr($row['apikey'], 0, 20) . '...';
|
||||
|
@ -151,7 +151,7 @@ if ($page == 'overview') {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
|
||||
if (isset($domain_array[$sortkey])) {
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($domain_array[$sortkey]);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($domain_array[$sortkey]);
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$statsapp = 'awstats';
|
||||
} else {
|
||||
@ -176,7 +176,7 @@ if ($page == 'overview') {
|
||||
if (Settings::Get('system.use_ssl') == '1' && \Froxlor\Domain\Domain::domainHasSslIpPort($row['id']) && $row['caneditdomain'] == '1' && $row['letsencrypt'] == 0) {
|
||||
$show_ssledit = true;
|
||||
}
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
|
||||
}
|
||||
}
|
||||
@ -212,7 +212,7 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('domains_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('domains_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -459,7 +459,7 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$domainip = $result_ipandport['ip'];
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$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);
|
||||
@ -512,7 +512,7 @@ if ($page == 'overview') {
|
||||
$do_insert = true;
|
||||
}
|
||||
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$ssleditor_data = include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.domain_ssleditor.php';
|
||||
$ssleditor_form = \Froxlor\UI\HtmlForm::genHTMLForm($ssleditor_data);
|
||||
|
@ -118,9 +118,9 @@ 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::sizeReadable($row['mboxsize'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_email") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
@ -168,7 +168,7 @@ if ($page == 'overview') {
|
||||
} else {
|
||||
$show_checkbox = false;
|
||||
}
|
||||
\Froxlor\UI\HTML::ask_yesno_withcheckbox('email_reallydelete', 'admin_customer_alsoremovemail', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNoWithCheckbox('email_reallydelete', 'admin_customer_alsoremovemail', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -252,7 +252,7 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$destinations_count = count($result['destination']);
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$email_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_edit.php';
|
||||
|
||||
@ -325,7 +325,7 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
$quota = Settings::Get('system.mail_quota');
|
||||
|
||||
$account_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_addaccount.php';
|
||||
@ -367,7 +367,7 @@ if ($page == 'overview') {
|
||||
));
|
||||
} else {
|
||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$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);
|
||||
@ -403,7 +403,7 @@ if ($page == 'overview') {
|
||||
));
|
||||
} else {
|
||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$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);
|
||||
@ -438,7 +438,7 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno_withcheckbox('email_reallydelete_account', 'admin_customer_alsoremovemail', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNoWithCheckbox('email_reallydelete_account', 'admin_customer_alsoremovemail', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -473,7 +473,7 @@ if ($page == 'overview') {
|
||||
));
|
||||
} else {
|
||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$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);
|
||||
@ -524,7 +524,7 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('email_reallydelete_forwarder', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('email_reallydelete_forwarder', $filename, array(
|
||||
'id' => $id,
|
||||
'forwarderid' => $forwarderid,
|
||||
'page' => $page,
|
||||
|
@ -73,7 +73,7 @@ if ($page == 'overview') {
|
||||
$row['path'] = str_replace($userinfo['documentroot'], "/", $row['path']);
|
||||
}
|
||||
$row['path'] = \Froxlor\FileDir::makeCorrectDir($row['path']);
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$htpasswds.=\"" . \Froxlor\UI\Template::getTemplate("extras/htpasswds_htpasswd") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
@ -108,7 +108,7 @@ if ($page == 'overview') {
|
||||
$result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']);
|
||||
}
|
||||
|
||||
\Froxlor\UI\HTML::ask_yesno('extras_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('extras_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -163,7 +163,7 @@ if ($page == 'overview') {
|
||||
$result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']);
|
||||
}
|
||||
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$htpasswd_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htpasswd_edit.php';
|
||||
$htpasswd_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($htpasswd_edit_data);
|
||||
@ -219,7 +219,7 @@ if ($page == 'overview') {
|
||||
$row['options_indexes'] = str_replace('0', $lng['panel']['no'], $row['options_indexes']);
|
||||
$row['options_cgi'] = str_replace('1', $lng['panel']['yes'], $row['options_cgi']);
|
||||
$row['options_cgi'] = str_replace('0', $lng['panel']['no'], $row['options_cgi']);
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$htaccess.=\"" . \Froxlor\UI\Template::getTemplate("extras/htaccess_htaccess") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
@ -250,7 +250,7 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno('extras_reallydelete_pathoptions', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('extras_reallydelete_pathoptions', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
@ -314,7 +314,7 @@ if ($page == 'overview') {
|
||||
* $options_indexes = \Froxlor\UI\HTML::makeyesno('options_indexes', '1', '0', $result['options_indexes']);
|
||||
* $options_cgi = \Froxlor\UI\HTML::makeyesno('options_cgi', '1', '0', $result['options_cgi']);
|
||||
*/
|
||||
$result = \Froxlor\PhpHelper::htmlentities_array($result);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$htaccess_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htaccess_edit.php';
|
||||
$htaccess_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($htaccess_edit_data);
|
||||
|
@ -73,7 +73,7 @@ if ($page == 'overview') {
|
||||
|
||||
$row['documentroot'] = \Froxlor\FileDir::makeCorrectDir($row['documentroot']);
|
||||
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate('ftp/accounts_account') . "\";");
|
||||
$count ++;
|
||||
}
|
||||
@ -104,7 +104,7 @@ if ($page == 'overview') {
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
\Froxlor\UI\HTML::ask_yesno_withcheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNoWithCheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
|
@ -100,7 +100,7 @@ if ($page == 'overview') {
|
||||
|
||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
||||
$userinfo = \Froxlor\PhpHelper::str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
|
||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||
|
||||
|
@ -76,7 +76,7 @@ if ($page == 'log') {
|
||||
$_action = 0;
|
||||
foreach ($logrows as $row) {
|
||||
// if ($paging->checkDisplay($i)) {
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
||||
|
||||
if ($_action != $action) {
|
||||
|
@ -78,7 +78,7 @@ if ($page == 'overview') {
|
||||
Database::needRoot(true);
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($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");
|
||||
@ -86,7 +86,7 @@ if ($page == 'overview') {
|
||||
"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::sizeReadable($mbdata['MB'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
eval("\$mysqls.=\"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls_database') . "\";");
|
||||
$count ++;
|
||||
}
|
||||
@ -133,7 +133,7 @@ if ($page == 'overview') {
|
||||
if (isset($result['description']) && $result['description'] != '') {
|
||||
$dbnamedesc .= ' (' . $result['description'] . ')';
|
||||
}
|
||||
\Froxlor\UI\HTML::ask_yesno('mysql_reallydelete', $filename, array(
|
||||
\Froxlor\UI\HTML::askYesNo('mysql_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
|
@ -106,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::sizeReadable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
$traffic_complete['ftp'] = \Froxlor\PhpHelper::sizeReadable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
$traffic_complete['mail'] = \Froxlor\PhpHelper::sizeReadable($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 {
|
||||
@ -158,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::sizeReadable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
$traffic_complete['ftp'] = \Froxlor\PhpHelper::sizeReadable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
$traffic_complete['mail'] = \Froxlor\PhpHelper::sizeReadable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic') . "\";");
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ if ($action == '2fa_entercode') {
|
||||
$replace_arr = array(
|
||||
'CODE' => $code
|
||||
);
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replace_variables($lng['mails']['2fa']['mailbody'], $replace_arr));
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables($lng['mails']['2fa']['mailbody'], $replace_arr));
|
||||
|
||||
try {
|
||||
$mail->Subject = $lng['mails']['2fa']['subject'];
|
||||
@ -496,7 +496,7 @@ if ($action == 'forgotpwd') {
|
||||
"lang" => $def_language
|
||||
));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['password_reset']['subject']), $replace_arr));
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result['value'] != '') ? $result['value'] : $lng['mails']['password_reset']['subject']), $replace_arr));
|
||||
|
||||
$result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
|
||||
WHERE `adminid`= :adminid
|
||||
@ -508,7 +508,7 @@ if ($action == 'forgotpwd') {
|
||||
"lang" => $def_language
|
||||
));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['password_reset']['mailbody']), $replace_arr));
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result['value'] != '') ? $result['value'] : $lng['mails']['password_reset']['mailbody']), $replace_arr));
|
||||
|
||||
$_mailerror = false;
|
||||
$mailerr_msg = "";
|
||||
|
@ -51,5 +51,5 @@ function versionInUpdate($current_version, $version_to_check)
|
||||
return true;
|
||||
}
|
||||
|
||||
return (\Froxlor\Froxlor::version_compare2($current_version, $version_to_check) == - 1 ? true : false);
|
||||
return (\Froxlor\Froxlor::versionCompare2($current_version, $version_to_check) == - 1 ? true : false);
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ abstract class ApiCommand extends ApiParameter
|
||||
"var" => $varname
|
||||
), true, true);
|
||||
// @fixme html_entity_decode
|
||||
$content = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result['value'] != '') ? $result['value'] : $default), $replace_arr));
|
||||
$content = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result['value'] != '') ? $result['value'] : $default), $replace_arr));
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
||||
// check for customized version to not output
|
||||
// "There is a newer version of froxlor" besides the error-message
|
||||
$isnewerversion = - 1;
|
||||
} elseif (\Froxlor\Froxlor::version_compare2($this->version, $_version) == - 1) {
|
||||
} elseif (\Froxlor\Froxlor::versionCompare2($this->version, $_version) == - 1) {
|
||||
// there is a newer version - yay
|
||||
$isnewerversion = 1;
|
||||
} else {
|
||||
|
@ -762,14 +762,14 @@ class Apache extends HttpConfigBase
|
||||
|
||||
if (Settings::Get('system.logfiles_piped') == '1' && Settings::Get('system.logfiles_script') != '') {
|
||||
// replace for error_log
|
||||
$command = \Froxlor\PhpHelper::replace_variables(Settings::Get('system.logfiles_script'), array(
|
||||
$command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array(
|
||||
'LOGFILE' => $error_log,
|
||||
'DOMAIN' => $domain['domain'],
|
||||
'CUSTOMER' => $domain['loginname']
|
||||
));
|
||||
$logfiles_text .= ' ErrorLog "| ' . $command . "\"\n";
|
||||
// replace for access_log
|
||||
$command = \Froxlor\PhpHelper::replace_variables(Settings::Get('system.logfiles_script'), array(
|
||||
$command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array(
|
||||
'LOGFILE' => $access_log,
|
||||
'DOMAIN' => $domain['domain'],
|
||||
'CUSTOMER' => $domain['loginname']
|
||||
|
@ -54,7 +54,7 @@ class HttpConfigBase
|
||||
'SCHEME' => ($is_ssl_vhost) ? 'https' : 'http',
|
||||
'DOCROOT' => $domain['documentroot']
|
||||
);
|
||||
return \Froxlor\PhpHelper::replace_variables($template, $templateVars);
|
||||
return \Froxlor\PhpHelper::replaceVariables($template, $templateVars);
|
||||
}
|
||||
|
||||
protected function getMyPath($ip_port = null)
|
||||
|
@ -167,7 +167,7 @@ class Fcgid
|
||||
$phpini_file .= "; php.ini created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $this->domain['domain'] . "' with id #" . $this->domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
|
||||
$phpini_file .= "; Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
|
||||
$phpini_file .= ";\n\n";
|
||||
$phpini_file .= \Froxlor\PhpHelper::replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini_file .= \Froxlor\PhpHelper::replaceVariables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini_file = str_replace('"none"', 'none', $phpini_file);
|
||||
// $phpini_file = preg_replace('/\"+/', '"', $phpini_file);
|
||||
$phpini_file_handler = fopen($this->getIniFile(), 'w');
|
||||
|
@ -237,7 +237,7 @@ class Fpm
|
||||
'CUSTOMER_HOMEDIR' => \Froxlor\FileDir::makeCorrectDir($this->domain['customerroot'])
|
||||
);
|
||||
|
||||
$phpini = \Froxlor\PhpHelper::replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini = \Froxlor\PhpHelper::replaceVariables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini_array = explode("\n", $phpini);
|
||||
|
||||
$fpm_config .= "\n\n";
|
||||
|
@ -106,11 +106,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
'varname' => 'trafficmaxpercent_subject'
|
||||
);
|
||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
||||
|
||||
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
||||
|
||||
$_mailerror = false;
|
||||
$mailerr_msg = "";
|
||||
@ -208,11 +208,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
'varname' => 'trafficmaxpercent_subject'
|
||||
);
|
||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
||||
|
||||
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
||||
|
||||
$_mailerror = false;
|
||||
$mailerr_msg = "";
|
||||
@ -407,11 +407,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
'varname' => 'diskmaxpercent_subject'
|
||||
);
|
||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
||||
|
||||
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
||||
|
||||
$_mailerror = false;
|
||||
$mailerr_msg = "";
|
||||
@ -500,11 +500,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
'varname' => 'diskmaxpercent_subject'
|
||||
);
|
||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
||||
|
||||
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replace_variables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
||||
|
||||
$_mailerror = false;
|
||||
$mailerr_msg = "";
|
||||
|
@ -229,7 +229,7 @@ class IntegrityCheck
|
||||
* @param bool $fix
|
||||
* Fix everything found directly
|
||||
*/
|
||||
public function SubdomainSslRedirect($fix = false)
|
||||
public function subdomainSslRedirect($fix = false)
|
||||
{
|
||||
$ips = array();
|
||||
$parentdomains = array();
|
||||
@ -301,7 +301,7 @@ class IntegrityCheck
|
||||
}
|
||||
|
||||
if ($fix) {
|
||||
return $this->SubdomainSslRedirect();
|
||||
return $this->subdomainSslRedirect();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
@ -217,8 +217,8 @@ class FileDir
|
||||
'ADMIN_EMAIL' => $template['admin_email']
|
||||
);
|
||||
|
||||
// @fixme replace_variables
|
||||
$htmlcontent = PhpHelper::replace_variables($template['value'], $replace_arr);
|
||||
// @fixme replaceVariables
|
||||
$htmlcontent = PhpHelper::replaceVariables($template['value'], $replace_arr);
|
||||
$indexhtmlpath = self::makeCorrectFile($destination . '/index.' . Settings::Get('system.index_file_extension'));
|
||||
$index_html_handler = fopen($indexhtmlpath, 'w');
|
||||
fwrite($index_html_handler, $htmlcontent);
|
||||
|
@ -210,7 +210,7 @@ final class Froxlor
|
||||
*
|
||||
* @return integer 0 if equal, 1 if a>b and -1 if b>a
|
||||
*/
|
||||
public static function version_compare2($a, $b)
|
||||
public static function versionCompare2($a, $b)
|
||||
{
|
||||
|
||||
// split version into pieces and remove trailing .0
|
||||
|
@ -55,16 +55,10 @@ class IdnaWrapper
|
||||
*/
|
||||
public function encode($to_encode)
|
||||
{
|
||||
$to_encode = $this->is_utf8($to_encode) ? $to_encode : utf8_encode($to_encode);
|
||||
$to_encode = $this->isUtf8($to_encode) ? $to_encode : utf8_encode($to_encode);
|
||||
return $this->idna_converter->encode($to_encode);
|
||||
}
|
||||
|
||||
public function encode_uri($to_encode)
|
||||
{
|
||||
$to_encode = $this->is_utf8($to_encode) ? $to_encode : utf8_encode($to_encode);
|
||||
return $this->idna_converter->encodeUri($to_encode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a domain name, a email address or a list of one of both.
|
||||
*
|
||||
@ -87,7 +81,7 @@ class IdnaWrapper
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function is_utf8($string = null)
|
||||
private function isUtf8($string = null)
|
||||
{
|
||||
if (function_exists("mb_detect_encoding")) {
|
||||
if (mb_detect_encoding($string, 'UTF-8, ISO-8859-1') === 'UTF-8') {
|
||||
|
@ -20,7 +20,7 @@ class PhpHelper
|
||||
* @return array The array with htmlentitie'd strings
|
||||
* @author Florian Lippert <flo@syscp.org>
|
||||
*/
|
||||
public static function htmlentities_array($subject, $fields = '', $quote_style = ENT_QUOTES, $charset = 'UTF-8')
|
||||
public static function htmlentitiesArray($subject, $fields = '', $quote_style = ENT_QUOTES, $charset = 'UTF-8')
|
||||
{
|
||||
if (is_array($subject)) {
|
||||
if (! is_array($fields)) {
|
||||
@ -30,7 +30,7 @@ class PhpHelper
|
||||
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
|
||||
$subject[$field] = self::htmlentities_array($subject[$field], $fields, $quote_style, $charset);
|
||||
$subject[$field] = self::htmlentitiesArray($subject[$field], $fields, $quote_style, $charset);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -55,7 +55,7 @@ class PhpHelper
|
||||
* @return array The str_replace'd array
|
||||
* @author Florian Lippert <flo@syscp.org>
|
||||
*/
|
||||
public static function str_replace_array($search, $replace, $subject, $fields = '')
|
||||
public static function strReplaceArray($search, $replace, $subject, $fields = '')
|
||||
{
|
||||
if (is_array($subject)) {
|
||||
$fields = self::array_trim(explode(' ', $fields));
|
||||
@ -162,7 +162,7 @@ class PhpHelper
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ class PhpHelper
|
||||
* @param
|
||||
* string
|
||||
*/
|
||||
public static function size_readable($size, $max = null, $system = 'si', $retstring = '%01.2f %s')
|
||||
public static function sizeReadable($size, $max = null, $system = 'si', $retstring = '%01.2f %s')
|
||||
{
|
||||
// Pick units
|
||||
$systems = array(
|
||||
@ -312,7 +312,7 @@ class PhpHelper
|
||||
*
|
||||
* @return string The submitted string with the variables replaced.
|
||||
*/
|
||||
public static function replace_variables($text, $vars)
|
||||
public static function replaceVariables($text, $vars)
|
||||
{
|
||||
$pattern = "/\{([a-zA-Z0-9\-_]+)\}/";
|
||||
$matches = array();
|
||||
|
@ -224,7 +224,7 @@ class Crypt
|
||||
if ($pwd_hash == $pwd_check) {
|
||||
|
||||
// check for update of hash (only if our database is ready to handle the bigger string)
|
||||
$is_ready = (\Froxlor\Froxlor::version_compare2("0.9.33", \Froxlor\Froxlor::getVersion()) <= 0 ? true : false);
|
||||
$is_ready = (\Froxlor\Froxlor::versionCompare2("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
|
||||
|
@ -155,7 +155,7 @@ class Form
|
||||
} else {
|
||||
$filename = '';
|
||||
}
|
||||
\Froxlor\UI\HTML::ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array(
|
||||
\Froxlor\UI\HTML::askYesNo($question, $filename, array_merge($url_params, $submitted_fields, array(
|
||||
$question => $question
|
||||
)), $targetname);
|
||||
}
|
||||
@ -259,7 +259,7 @@ class Form
|
||||
} else {
|
||||
$filename = '';
|
||||
}
|
||||
\Froxlor\UI\HTML::ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array(
|
||||
\Froxlor\UI\HTML::askYesNo($question, $filename, array_merge($url_params, $submitted_fields, array(
|
||||
$question => $question
|
||||
)), $targetname);
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ class HTML
|
||||
*
|
||||
* @return string outputs parsed question_yesno template
|
||||
*/
|
||||
public static function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1)
|
||||
public static function askYesNo($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1)
|
||||
{
|
||||
global $userinfo, $s, $header, $footer, $lng, $theme;
|
||||
|
||||
@ -275,7 +275,7 @@ class HTML
|
||||
exit();
|
||||
}
|
||||
|
||||
public static function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true)
|
||||
public static function askYesNoWithCheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true)
|
||||
{
|
||||
global $userinfo, $s, $header, $footer, $lng, $theme;
|
||||
|
||||
|
20
phpcs.xml
20
phpcs.xml
@ -9,10 +9,26 @@
|
||||
<rule ref="PSR2">
|
||||
<exclude name="Generic.WhiteSpace.DisallowTabIndent" />
|
||||
<exclude name="Generic.Files.LineLength" />
|
||||
<exclude name="Generic.ControlStructures.InlineControlStructure.Discouraged" />
|
||||
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
|
||||
<exclude
|
||||
name="Generic.ControlStructures.InlineControlStructure" />
|
||||
<exclude
|
||||
name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen" />
|
||||
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine" />
|
||||
</rule>
|
||||
|
||||
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
|
||||
<exclude-pattern>tests/</exclude-pattern>
|
||||
</rule>
|
||||
|
||||
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
|
||||
<exclude-pattern>lib/Froxlor/Settings.php</exclude-pattern>
|
||||
<exclude-pattern>lib/Froxlor/FileDir.php</exclude-pattern>
|
||||
<exclude-pattern>lib/Froxlor/Validate/Validate.php</exclude-pattern>
|
||||
<exclude-pattern>lib/Froxlor/Database/Database.php</exclude-pattern>
|
||||
<exclude-pattern>lib/Froxlor/UI/Response.php</exclude-pattern>
|
||||
</rule>
|
||||
|
||||
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
|
||||
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
|
||||
</rule>
|
||||
</ruleset>
|
||||
|
@ -149,7 +149,7 @@ if (count($all_certs) == 0) {
|
||||
}
|
||||
}
|
||||
|
||||
$row = \Froxlor\PhpHelper::htmlentities_array($cert);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($cert);
|
||||
eval("\$certificates.=\"" . \Froxlor\UI\Template::getTemplate("ssl_certificates/certs_cert", true) . "\";");
|
||||
} else {
|
||||
$message = sprintf($lng['domains']['ssl_certificate_error'], $cert['domain']);
|
||||
|
Loading…
Reference in New Issue
Block a user