Compare commits
160 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24e02e99fb | ||
|
|
97bb7b6227 | ||
|
|
5ceddc8c65 | ||
|
|
3a17d03796 | ||
|
|
57ae195930 | ||
|
|
9b86d576fa | ||
|
|
02a12eda13 | ||
|
|
a31da97d66 | ||
|
|
9f13aa9a12 | ||
|
|
2841051649 | ||
|
|
acfbf55d15 | ||
|
|
5848df28fd | ||
|
|
21925f48c3 | ||
|
|
17a64c58c2 | ||
|
|
0ca38cff31 | ||
|
|
5efc1849b4 | ||
|
|
f213d666e2 | ||
|
|
78495b6487 | ||
|
|
ab1c76e104 | ||
|
|
a671223823 | ||
|
|
3a99e10296 | ||
|
|
38031aaff9 | ||
|
|
65773bce57 | ||
|
|
ee5de56a94 | ||
|
|
aba97df9b2 | ||
|
|
79e670f797 | ||
|
|
8670cb6742 | ||
|
|
bde87950a5 | ||
|
|
aa1d2ab01d | ||
|
|
2a770a93b1 | ||
|
|
5b85a1c183 | ||
|
|
caf8893558 | ||
|
|
a280461cf6 | ||
|
|
455c655580 | ||
|
|
ecd707424f | ||
|
|
60fe330de1 | ||
|
|
cdb871b82b | ||
|
|
35c4e3d1b9 | ||
|
|
b3f82f0981 | ||
|
|
b1b68364be | ||
|
|
ea76ce8fcc | ||
|
|
16eca628dd | ||
|
|
6bf5eccc24 | ||
|
|
63d00cd453 | ||
|
|
c79cba26f3 | ||
|
|
36eb3cc1aa | ||
|
|
15a13a7783 | ||
|
|
816874872d | ||
|
|
0e8449f28d | ||
|
|
3dcbbb9e7b | ||
|
|
5ab9e6865d | ||
|
|
3a47b2050e | ||
|
|
907c475361 | ||
|
|
0dfb4bdcdb | ||
|
|
a5dc7b93a2 | ||
|
|
244d2823a6 | ||
|
|
2f0251bb19 | ||
|
|
a37d795ff3 | ||
|
|
d9331cca61 | ||
|
|
f169129e27 | ||
|
|
746548492b | ||
|
|
4ad8b62576 | ||
|
|
1eed3d1166 | ||
|
|
6a32720c9a | ||
|
|
e389ae4bf8 | ||
|
|
970ecb469e | ||
|
|
92b6914610 | ||
|
|
7e57352bc0 | ||
|
|
e3d42a3f62 | ||
|
|
456a287621 | ||
|
|
eff630da8d | ||
|
|
aa45a0302e | ||
|
|
aa14487995 | ||
|
|
10b52486b5 | ||
|
|
0af655f106 | ||
|
|
665c87cca7 | ||
|
|
1c50838d37 | ||
|
|
ac5bc78e12 | ||
|
|
a5e6ef674f | ||
|
|
03bc94e69c | ||
|
|
37176c94a1 | ||
|
|
a141c83ad4 | ||
|
|
7c3ff95d22 | ||
|
|
d653f6842f | ||
|
|
35a69fbfe0 | ||
|
|
e733701459 | ||
|
|
70677fced2 | ||
|
|
daa223ed42 | ||
|
|
0398f4cdba | ||
|
|
1a0953e77e | ||
|
|
490704f8e1 | ||
|
|
2748f1b633 | ||
|
|
8e60c6b201 | ||
|
|
d4716b2376 | ||
|
|
2c98fc4c2d | ||
|
|
65e1f633ef | ||
|
|
ed4dbba278 | ||
|
|
1a6082ca91 | ||
|
|
da1d94149a | ||
|
|
e7cfceb65d | ||
|
|
1f48ca4711 | ||
|
|
fe0fb8dd5f | ||
|
|
4a5ab7d95d | ||
|
|
0d44adf265 | ||
|
|
0b63b4e110 | ||
|
|
ba7e9688c5 | ||
|
|
443ae1df68 | ||
|
|
b59aa6f140 | ||
|
|
4e9df61fef | ||
|
|
b350815aa0 | ||
|
|
b672c722b9 | ||
|
|
db60606cfa | ||
|
|
2524491883 | ||
|
|
de061e7e36 | ||
|
|
9ecd182a91 | ||
|
|
a7934bcb7b | ||
|
|
9dc2c09da7 | ||
|
|
b23e4a4d85 | ||
|
|
394ec4cd4a | ||
|
|
6ccfb7efbb | ||
|
|
1454d8d40f | ||
|
|
0fde1ce7e9 | ||
|
|
86155f7a9c | ||
|
|
60578a5d31 | ||
|
|
7fcacb4637 | ||
|
|
fb35fb9a3a | ||
|
|
6128954231 | ||
|
|
f4d4490d08 | ||
|
|
27f0c4eb53 | ||
|
|
cb1df3a7e0 | ||
|
|
a572ac3914 | ||
|
|
498ff15e98 | ||
|
|
022ed1a9a8 | ||
|
|
814339cc73 | ||
|
|
0bb48a3cdf | ||
|
|
67d74406bd | ||
|
|
d73d8da2fd | ||
|
|
3c7bdcb5e0 | ||
|
|
c6ac73f74f | ||
|
|
fdcb294244 | ||
|
|
8898c7c165 | ||
|
|
d4c0acb353 | ||
|
|
9ea32b69cb | ||
|
|
0524c70d2b | ||
|
|
6ca7920147 | ||
|
|
65b2e4efa7 | ||
|
|
7000fd2c30 | ||
|
|
3b1ff03b33 | ||
|
|
ffa9205f95 | ||
|
|
bc73ed0c75 | ||
|
|
17fd350d33 | ||
|
|
c2e57dfd60 | ||
|
|
50f2047da3 | ||
|
|
ecb9470b65 | ||
|
|
6d90b5ba80 | ||
|
|
eb3590dc34 | ||
|
|
bddf9b496c | ||
|
|
edc702dafa | ||
|
|
85dfc1030a | ||
|
|
c0dd432916 |
@@ -1,4 +0,0 @@
|
|||||||
codecov:
|
|
||||||
notify:
|
|
||||||
require_ci_to_pass: no
|
|
||||||
|
|
||||||
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@@ -48,7 +48,7 @@ strings in
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
### New settings and database-layout changnes
|
### New settings and database-layout changes
|
||||||
If you add new settings or layout changes, please make sure you add these to
|
If you add new settings or layout changes, please make sure you add these to
|
||||||
|
|
||||||
* `install/froxlor.sql`
|
* `install/froxlor.sql`
|
||||||
|
|||||||
@@ -52,10 +52,7 @@ install:
|
|||||||
- mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < install/froxlor.sql
|
- mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < install/froxlor.sql
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ant phpunit
|
- ant phpunit-no-coverage
|
||||||
|
|
||||||
after_success:
|
|
||||||
- bash <(curl -s https://codecov.io/bash) -f "build/logs/clover.xml"
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
irc: "chat.freenode.net#froxlor"
|
irc: "chat.freenode.net#froxlor"
|
||||||
|
|||||||
@@ -270,6 +270,14 @@ return array(
|
|||||||
'default' => true,
|
'default' => true,
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField'
|
||||||
),
|
),
|
||||||
|
'hide_incompatible_settings' => array(
|
||||||
|
'label' => $lng['serversettings']['hide_incompatible_settings'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'hide_incompatible_settings',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'save_method' => 'storeSettingField'
|
||||||
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ return array(
|
|||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'ssl_protocols',
|
'varname' => 'ssl_protocols',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => 'TLSv1,TLSv1.2',
|
'default' => 'TLSv1.2',
|
||||||
'option_mode' => 'multiple',
|
'option_mode' => 'multiple',
|
||||||
'option_options' => array(
|
'option_options' => array(
|
||||||
'TLSv1' => 'TLSv1',
|
'TLSv1' => 'TLSv1',
|
||||||
|
|||||||
@@ -39,6 +39,15 @@ return array(
|
|||||||
'default' => '/etc/postfix/dkim/',
|
'default' => '/etc/postfix/dkim/',
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField'
|
||||||
),
|
),
|
||||||
|
'dkim_privkeysuffix' => array(
|
||||||
|
'label' => $lng['dkim']['privkeysuffix'],
|
||||||
|
'settinggroup' => 'dkim',
|
||||||
|
'varname' => 'privkeysuffix',
|
||||||
|
'type' => 'string',
|
||||||
|
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
||||||
|
'default' => '.priv',
|
||||||
|
'save_method' => 'storeSettingField'
|
||||||
|
),
|
||||||
'dkim_domains' => array(
|
'dkim_domains' => array(
|
||||||
'label' => $lng['dkim']['dkim_domains'],
|
'label' => $lng['dkim']['dkim_domains'],
|
||||||
'settinggroup' => 'dkim',
|
'settinggroup' => 'dkim',
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
|
|||||||
$count ++;
|
$count ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$admincount = $paging->getEntries();
|
$admincount = $result['count'] . " / " . $paging->getEntries();
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("admins/admins") . "\";");
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("admins/admins") . "\";");
|
||||||
} elseif ($action == 'su') {
|
} elseif ($action == 'su') {
|
||||||
|
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
|||||||
$count ++;
|
$count ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$customercount = $paging->getEntries();
|
$customercount = $result['count'] . " / " . $paging->getEntries();
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("customers/customers") . "\";");
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("customers/customers") . "\";");
|
||||||
} elseif ($action == 'su' && $id != 0) {
|
} elseif ($action == 'su' && $id != 0) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$domainscount = $paging->getEntries();
|
$domainscount = $result['count'] . " / " . $paging->getEntries();
|
||||||
|
|
||||||
// Display the list
|
// Display the list
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domains") . "\";");
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domains") . "\";");
|
||||||
@@ -616,7 +616,6 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
|
|
||||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
|
|
||||||
$customerid = intval($_POST['customerid']);
|
|
||||||
$separator = \Froxlor\Validate\Validate::validate($_POST['separator'], 'separator');
|
$separator = \Froxlor\Validate\Validate::validate($_POST['separator'], 'separator');
|
||||||
$offset = (int) \Froxlor\Validate\Validate::validate($_POST['offset'], 'offset', "/[0-9]/i");
|
$offset = (int) \Froxlor\Validate\Validate::validate($_POST['offset'], 'offset', "/[0-9]/i");
|
||||||
|
|
||||||
@@ -625,7 +624,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$bulk = new \Froxlor\Bulk\DomainBulkAction($file_name, $customerid);
|
$bulk = new \Froxlor\Bulk\DomainBulkAction($file_name, $userinfo);
|
||||||
$result = $bulk->doImport($separator, $offset);
|
$result = $bulk->doImport($separator, $offset);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
\Froxlor\UI\Response::standard_error('domain_import_error', $e->getMessage());
|
\Froxlor\UI\Response::standard_error('domain_import_error', $e->getMessage());
|
||||||
@@ -647,19 +646,6 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
'page' => 'domains'
|
'page' => 'domains'
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
$customers = \Froxlor\UI\HTML::makeoption($lng['panel']['please_choose'], 0, 0, true);
|
|
||||||
$result_customers_stmt = Database::prepare("
|
|
||||||
SELECT `customerid`, `loginname`, `name`, `firstname`, `company`
|
|
||||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY `name` ASC");
|
|
||||||
$params = array();
|
|
||||||
if ($userinfo['customers_see_all'] == '0') {
|
|
||||||
$params['adminid'] = $userinfo['adminid'];
|
|
||||||
}
|
|
||||||
Database::pexecute($result_customers_stmt, $params);
|
|
||||||
|
|
||||||
while ($row_customer = $result_customers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
|
||||||
$customers .= \Froxlor\UI\HTML::makeoption(\Froxlor\User::getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$domain_import_data = include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_import.php';
|
$domain_import_data = include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_import.php';
|
||||||
$domain_import_form = \Froxlor\UI\HtmlForm::genHTMLForm($domain_import_data);
|
$domain_import_form = \Froxlor\UI\HtmlForm::genHTMLForm($domain_import_data);
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ if (isset($_POST['id'])) {
|
|||||||
if ($page == 'overview') {
|
if ($page == 'overview') {
|
||||||
|
|
||||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_index");
|
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_index");
|
||||||
|
$params = [];
|
||||||
|
if ($userinfo['customers_see_all'] == '0') {
|
||||||
|
$params = [
|
||||||
|
'adminid' => $userinfo['adminid']
|
||||||
|
];
|
||||||
|
}
|
||||||
$overview_stmt = Database::prepare("SELECT COUNT(*) AS `number_customers`,
|
$overview_stmt = Database::prepare("SELECT COUNT(*) AS `number_customers`,
|
||||||
SUM(`diskspace_used`) AS `diskspace_used`,
|
SUM(`diskspace_used`) AS `diskspace_used`,
|
||||||
SUM(`mysqls_used`) AS `mysqls_used`,
|
SUM(`mysqls_used`) AS `mysqls_used`,
|
||||||
@@ -68,20 +74,18 @@ if ($page == 'overview') {
|
|||||||
SUM(`subdomains_used`) AS `subdomains_used`,
|
SUM(`subdomains_used`) AS `subdomains_used`,
|
||||||
SUM(`traffic_used`) AS `traffic_used`
|
SUM(`traffic_used`) AS `traffic_used`
|
||||||
FROM `" . TABLE_PANEL_CUSTOMERS . "`" . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid "));
|
FROM `" . TABLE_PANEL_CUSTOMERS . "`" . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid "));
|
||||||
$overview = Database::pexecute_first($overview_stmt, array(
|
$overview = Database::pexecute_first($overview_stmt, $params);
|
||||||
'adminid' => $userinfo['adminid']
|
|
||||||
));
|
|
||||||
|
|
||||||
$dec_places = Settings::Get('panel.decimal_places');
|
$dec_places = Settings::Get('panel.decimal_places');
|
||||||
$overview['traffic_used'] = round($overview['traffic_used'] / (1024 * 1024), $dec_places);
|
$overview['traffic_bytes_used'] = $overview['traffic_used'] * 1024;
|
||||||
$overview['diskspace_used'] = round($overview['diskspace_used'] / 1024, $dec_places);
|
$overview['traffic_used'] = \Froxlor\PhpHelper::sizeReadable($overview['traffic_used'] * 1024, null, 'bi');
|
||||||
|
$overview['diskspace_bytes_used'] = $overview['diskspace_used'] * 1024;
|
||||||
|
$overview['diskspace_used'] = \Froxlor\PhpHelper::sizeReadable($overview['diskspace_used'] * 1024, null, 'bi');
|
||||||
|
|
||||||
$number_domains_stmt = Database::prepare("
|
$number_domains_stmt = Database::prepare("
|
||||||
SELECT COUNT(*) AS `number_domains` FROM `" . TABLE_PANEL_DOMAINS . "`
|
SELECT COUNT(*) AS `number_domains` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||||
WHERE `parentdomainid`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :adminid"));
|
WHERE `parentdomainid`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :adminid"));
|
||||||
$number_domains = Database::pexecute_first($number_domains_stmt, array(
|
$number_domains = Database::pexecute_first($number_domains_stmt, $params);
|
||||||
'adminid' => $userinfo['adminid']
|
|
||||||
));
|
|
||||||
|
|
||||||
$overview['number_domains'] = $number_domains['number_domains'];
|
$overview['number_domains'] = $number_domains['number_domains'];
|
||||||
|
|
||||||
@@ -111,11 +115,17 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$dec_places = Settings::Get('panel.decimal_places');
|
$dec_places = Settings::Get('panel.decimal_places');
|
||||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $dec_places);
|
// get everything in bytes for the percentage calculation on the dashboard
|
||||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $dec_places);
|
$userinfo['diskspace_bytes'] = ($userinfo['diskspace'] > -1) ? $userinfo['diskspace'] * 1024 : -1;
|
||||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $dec_places);
|
$userinfo['diskspace_bytes_used'] = $userinfo['diskspace_used'] * 1024;
|
||||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $dec_places);
|
$userinfo['traffic_bytes'] = ($userinfo['traffic'] > -1) ? $userinfo['traffic'] * 1024 : - 1;
|
||||||
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
$userinfo['traffic_bytes_used'] = $userinfo['traffic_used'] * 1024;
|
||||||
|
|
||||||
|
$userinfo['diskspace'] = ($userinfo['diskspace'] > -1) ? \Froxlor\PhpHelper::sizeReadable($userinfo['diskspace'] * 1024, null, 'bi') : - 1;
|
||||||
|
$userinfo['diskspace_used'] = \Froxlor\PhpHelper::sizeReadable($userinfo['diskspace_used'] * 1024, null, 'bi');
|
||||||
|
$userinfo['traffic'] = ($userinfo['traffic'] > -1) ? \Froxlor\PhpHelper::sizeReadable($userinfo['traffic'] * 1024, null, 'bi') : - 1;
|
||||||
|
$userinfo['traffic_used'] = \Froxlor\PhpHelper::sizeReadable($userinfo['traffic_used'] * 1024, null, 'bi');
|
||||||
|
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace diskspace_bytes traffic traffic_bytes mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||||
|
|
||||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||||
|
|
||||||
|
|||||||
8
api.php
8
api.php
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use voku\helper\AntiXSS;
|
||||||
|
|
||||||
require __DIR__ . '/vendor/autoload.php';
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
|
|
||||||
require \Froxlor\Froxlor::getInstallDir() . '/lib/tables.inc.php';
|
require \Froxlor\Froxlor::getInstallDir() . '/lib/tables.inc.php';
|
||||||
@@ -30,6 +32,12 @@ if (is_null($decoded_request)) {
|
|||||||
json_response(400, "Invalid JSON");
|
json_response(400, "Invalid JSON");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check for xss attempts and clean request
|
||||||
|
*/
|
||||||
|
$antiXss = new AntiXSS();
|
||||||
|
$request = $antiXss->xss_clean($request);
|
||||||
|
|
||||||
// validate content
|
// validate content
|
||||||
try {
|
try {
|
||||||
$decoded_request = stripcslashes_deep($decoded_request);
|
$decoded_request = stripcslashes_deep($decoded_request);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
"docs": "https://github.com/Froxlor/Froxlor/wiki"
|
"docs": "https://github.com/Froxlor/Froxlor/wiki"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0",
|
"php": ">=7.1",
|
||||||
"ext-session": "*",
|
"ext-session": "*",
|
||||||
"ext-ctype": "*",
|
"ext-ctype": "*",
|
||||||
"ext-pdo": "*",
|
"ext-pdo": "*",
|
||||||
@@ -46,7 +46,8 @@
|
|||||||
"phpmailer/phpmailer": "~6.0",
|
"phpmailer/phpmailer": "~6.0",
|
||||||
"monolog/monolog": "^1.24",
|
"monolog/monolog": "^1.24",
|
||||||
"robthree/twofactorauth": "^1.6",
|
"robthree/twofactorauth": "^1.6",
|
||||||
"froxlor/idna-convert-legacy": "^2.1"
|
"froxlor/idna-convert-legacy": "^2.1",
|
||||||
|
"voku/anti-xss": "^4.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "8.4.1",
|
"phpunit/phpunit": "8.4.1",
|
||||||
|
|||||||
2016
composer.lock
generated
2016
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -133,10 +133,10 @@ if ($page == 'overview') {
|
|||||||
FROM `" . TABLE_PANEL_DOMAINS . "`
|
FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||||
WHERE `customerid`= :cid AND `isemaildomain` = '1'
|
WHERE `customerid`= :cid AND `isemaildomain` = '1'
|
||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, array(
|
$result2 = Database::pexecute_first($result_stmt, array(
|
||||||
"cid" => $userinfo['customerid']
|
"cid" => $userinfo['customerid']
|
||||||
));
|
));
|
||||||
$emaildomains_count = $result['emaildomains'];
|
$emaildomains_count = $result2['emaildomains'];
|
||||||
|
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/emails") . "\";");
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/emails") . "\";");
|
||||||
} elseif ($action == 'delete' && $id != 0) {
|
} elseif ($action == 'delete' && $id != 0) {
|
||||||
@@ -153,7 +153,8 @@ if ($page == 'overview') {
|
|||||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
try {
|
try {
|
||||||
Emails::getLocal($userinfo, array(
|
Emails::getLocal($userinfo, array(
|
||||||
'id' => $id
|
'id' => $id,
|
||||||
|
'delete_userfiles' => ($_POST['delete_userfiles'] ?? 0)
|
||||||
))->delete();
|
))->delete();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||||
|
|||||||
@@ -93,22 +93,30 @@ if ($page == 'overview') {
|
|||||||
'cid' => $userinfo['customerid']
|
'cid' => $userinfo['customerid']
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($usages)
|
// get everything in bytes for the percentage calculation on the dashboard
|
||||||
{
|
$userinfo['diskspace_bytes'] = ($userinfo['diskspace'] > -1) ? $userinfo['diskspace'] * 1024 : -1;
|
||||||
$userinfo['diskspace_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places'));
|
$userinfo['traffic_bytes'] = ($userinfo['traffic'] > -1) ? $userinfo['traffic'] * 1024 : - 1;
|
||||||
$userinfo['mailspace_used'] = round($usages['mail'] / 1024, Settings::Get('panel.decimal_places'));
|
$userinfo['traffic_bytes_used'] = $userinfo['traffic_used'] * 1024;
|
||||||
$userinfo['dbspace_used'] = round($usages['mysql'] / 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
$userinfo['total_used'] = round(($usages['webspace'] + $usages['mail'] + $usages['mysql']) / 1024, Settings::Get('panel.decimal_places'));
|
if ($usages) {
|
||||||
|
$userinfo['diskspace_used'] = \Froxlor\PhpHelper::sizeReadable($usages['webspace'] * 1024, null, 'bi');
|
||||||
|
$userinfo['mailspace_used'] = \Froxlor\PhpHelper::sizeReadable($usages['mail'] * 1024, null, 'bi');
|
||||||
|
$userinfo['dbspace_used'] = \Froxlor\PhpHelper::sizeReadable($usages['mysql'] * 1024, null, 'bi');
|
||||||
|
$userinfo['total_used'] = \Froxlor\PhpHelper::sizeReadable(($usages['webspace'] + $usages['mail'] + $usages['mysql']) * 1024, null, 'bi');
|
||||||
|
$userinfo['diskspace_bytes_used'] = $usages['webspace'] * 1024;
|
||||||
|
$userinfo['total_bytes_used'] = ($usages['webspace'] + $usages['mail'] + $usages['mysql']) * 1024;
|
||||||
} else {
|
} else {
|
||||||
$userinfo['diskspace_used'] = 0;
|
$userinfo['diskspace_used'] = 0;
|
||||||
$userinfo['mailspace_used'] = 0;
|
$userinfo['mailspace_used'] = 0;
|
||||||
$userinfo['dbspace_used'] = 0;
|
$userinfo['dbspace_used'] = 0;
|
||||||
$userinfo['total_used'] = 0;
|
$userinfo['total_used'] = 0;
|
||||||
|
$userinfo['diskspace_bytes_used'] = 0;
|
||||||
|
$userinfo['total_bytes_used'] = 0;
|
||||||
}
|
}
|
||||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places'));
|
$userinfo['diskspace'] = ($userinfo['diskspace'] > -1) ? \Froxlor\PhpHelper::sizeReadable($userinfo['diskspace'] * 1024, null, 'bi') : - 1;
|
||||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
$userinfo['traffic'] = ($userinfo['traffic'] > -1) ? \Froxlor\PhpHelper::sizeReadable($userinfo['traffic'] * 1024, null, 'bi') : - 1;
|
||||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
$userinfo['traffic_used'] = \Froxlor\PhpHelper::sizeReadable($userinfo['traffic_used'] * 1024, null, 'bi');
|
||||||
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-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 diskspace_bytes traffic traffic_bytes mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||||
|
|
||||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||||
|
|
||||||
@@ -123,7 +131,7 @@ if ($page == 'overview') {
|
|||||||
if ($userinfo['perlenabled'] == '1')
|
if ($userinfo['perlenabled'] == '1')
|
||||||
$se[] = "Perl/CGI";
|
$se[] = "Perl/CGI";
|
||||||
if ($userinfo['api_allowed'] == '1')
|
if ($userinfo['api_allowed'] == '1')
|
||||||
$se[] = '<a href="customer_index.php?s='.$s.'&page=apikeys">API</a>';
|
$se[] = '<a href="customer_index.php?s=' . $s . '&page=apikeys">API</a>';
|
||||||
$services_enabled = implode(", ", $se);
|
$services_enabled = implode(", ", $se);
|
||||||
|
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/index') . "\";");
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/index') . "\";");
|
||||||
|
|||||||
@@ -85,10 +85,12 @@ if ($page == 'overview') {
|
|||||||
$mbdata_stmt = Database::prepare("SELECT SUM(data_length + index_length) as MB FROM information_schema.TABLES
|
$mbdata_stmt = Database::prepare("SELECT SUM(data_length + index_length) as MB FROM information_schema.TABLES
|
||||||
WHERE table_schema = :table_schema
|
WHERE table_schema = :table_schema
|
||||||
GROUP BY table_schema");
|
GROUP BY table_schema");
|
||||||
Database::pexecute($mbdata_stmt, array(
|
$mbdata = Database::pexecute_first($mbdata_stmt, array(
|
||||||
"table_schema" => $row['databasename']
|
"table_schema" => $row['databasename']
|
||||||
));
|
));
|
||||||
$mbdata = $mbdata_stmt->fetch(PDO::FETCH_ASSOC);
|
if (!$mbdata) {
|
||||||
|
$mbdata = array('MB' => 0);
|
||||||
|
}
|
||||||
$row['size'] = \Froxlor\PhpHelper::sizeReadable($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') . "\";");
|
eval("\$mysqls.=\"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls_database') . "\";");
|
||||||
$count ++;
|
$count ++;
|
||||||
|
|||||||
@@ -86,22 +86,18 @@ if (! is_null($month) && ! is_null($year)) {
|
|||||||
|
|
||||||
if (extension_loaded('bcmath')) {
|
if (extension_loaded('bcmath')) {
|
||||||
$traf['ftptext'] = bcdiv($row['ftp_up'], 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . bcdiv($row['ftp_down'], 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
$traf['ftptext'] = bcdiv($row['ftp_up'], 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . bcdiv($row['ftp_down'], 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||||
$traf['httptext'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
|
||||||
$traf['mailtext'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
|
||||||
$traf['ftp'] = bcdiv($ftp, 1024, Settings::Get('panel.decimal_places'));
|
$traf['ftp'] = bcdiv($ftp, 1024, Settings::Get('panel.decimal_places'));
|
||||||
$traf['http'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
$traf['mail'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
$traf['byte'] = bcdiv($traf['byte'], 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
} else {
|
} else {
|
||||||
$traf['ftptext'] = round($row['ftp_up'] / 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . round($row['ftp_down'] / 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
$traf['ftptext'] = round($row['ftp_up'] / 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . round($row['ftp_down'] / 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||||
$traf['httptext'] = round($http / 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
$traf['ftp'] = round($ftp / 1024, Settings::Get('panel.decimal_places'));
|
||||||
$traf['mailtext'] = round($mail / 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
|
||||||
$traf['http'] = round($http, Settings::Get('panel.decimal_places'));
|
|
||||||
$traf['ftp'] = round($ftp, Settings::Get('panel.decimal_places'));
|
|
||||||
$traf['mail'] = round($mail, Settings::Get('panel.decimal_places'));
|
|
||||||
$traf['byte'] = round($traf['byte'] / 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getReadableTraffic($traf,'httptext', $http, 1024, "MiB (HTTP)");
|
||||||
|
getReadableTraffic($traf,'http', $http, 1024);
|
||||||
|
getReadableTraffic($traf,'mailtext', $mail, 1024, "MiB (Mail)");
|
||||||
|
getReadableTraffic($traf,'mail', $mail, 1024);
|
||||||
|
getReadableTraffic($traf,'byte', $traf['byte'], (1024 * 1024));
|
||||||
|
|
||||||
eval("\$traffic.=\"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_month') . "\";");
|
eval("\$traffic.=\"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_month') . "\";");
|
||||||
$show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year'];
|
$show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year'];
|
||||||
}
|
}
|
||||||
@@ -142,22 +138,18 @@ if (! is_null($month) && ! is_null($year)) {
|
|||||||
|
|
||||||
if (extension_loaded('bcmath')) {
|
if (extension_loaded('bcmath')) {
|
||||||
$traf['ftptext'] = bcdiv($ftp_up, 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . bcdiv($ftp_down, 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
$traf['ftptext'] = bcdiv($ftp_up, 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . bcdiv($ftp_down, 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||||
$traf['httptext'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
|
||||||
$traf['mailtext'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
|
||||||
$traf['ftp'] = bcdiv(($ftp_up + $ftp_down), 1024, Settings::Get('panel.decimal_places'));
|
$traf['ftp'] = bcdiv(($ftp_up + $ftp_down), 1024, Settings::Get('panel.decimal_places'));
|
||||||
$traf['http'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
$traf['mail'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
$traf['byte'] = bcdiv($traf['byte'], 1024 * 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
} else {
|
} else {
|
||||||
$traf['ftptext'] = round($ftp_up / 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . round($ftp_down / 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
$traf['ftptext'] = round($ftp_up / 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . round($ftp_down / 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||||
$traf['httptext'] = round($http / 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
|
||||||
$traf['mailtext'] = round($mail / 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
|
||||||
$traf['ftp'] = round(($ftp_up + $ftp_down) / 1024, Settings::Get('panel.decimal_places'));
|
$traf['ftp'] = round(($ftp_up + $ftp_down) / 1024, Settings::Get('panel.decimal_places'));
|
||||||
$traf['http'] = round($http / 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
$traf['mail'] = round($mail / 1024, Settings::Get('panel.decimal_places'));
|
|
||||||
$traf['byte'] = round($traf['byte'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getReadableTraffic($traf,'httptext', $http, 1024, "MiB (HTTP)");
|
||||||
|
getReadableTraffic($traf,'http', $http, 1024);
|
||||||
|
getReadableTraffic($traf,'mailtext', $mail, 1024, "MiB (Mail)");
|
||||||
|
getReadableTraffic($traf,'mail', $mail, 1024);
|
||||||
|
getReadableTraffic($traf,'byte', $traf['byte'], (1024 * 1024));
|
||||||
|
|
||||||
eval("\$traffic.=\"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_traffic') . "\";");
|
eval("\$traffic.=\"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_traffic') . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,3 +159,12 @@ if (! is_null($month) && ! is_null($year)) {
|
|||||||
|
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic') . "\";");
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic') . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getReadableTraffic(&$traf, $index, $value, $divisor, $desc = "")
|
||||||
|
{
|
||||||
|
if (extension_loaded('bcmath')) {
|
||||||
|
$traf[$index] = bcdiv($value, $divisor,Settings::Get('panel.decimal_places')).(!empty($desc) ? " ".$desc : "");
|
||||||
|
} else {
|
||||||
|
$traf[$index] = round($value / $divisor, Settings::Get('panel.decimal_places')).(!empty($desc) ? " ".$desc : "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ if (! defined('AREA')) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Froxlor\Database\Database;
|
|
||||||
use Froxlor\Api\Commands\DomainZones as DomainZones;
|
use Froxlor\Api\Commands\DomainZones as DomainZones;
|
||||||
|
|
||||||
// This file is being included in admin_domains and customer_domains
|
// This file is being included in admin_domains and customer_domains
|
||||||
@@ -36,18 +35,6 @@ $ttl = isset($_POST['record']['ttl']) ? (int) $_POST['record']['ttl'] : 18000;
|
|||||||
// get domain-name
|
// get domain-name
|
||||||
$domain = \Froxlor\Dns\Dns::getAllowedDomainEntry($domain_id, AREA, $userinfo);
|
$domain = \Froxlor\Dns\Dns::getAllowedDomainEntry($domain_id, AREA, $userinfo);
|
||||||
|
|
||||||
// select all entries
|
|
||||||
try {
|
|
||||||
// get list
|
|
||||||
$json_result = DomainZones::getLocal($userinfo, [
|
|
||||||
'id' => $domain_id
|
|
||||||
])->listing();
|
|
||||||
} catch (Exception $e) {
|
|
||||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
|
||||||
}
|
|
||||||
$result = json_decode($json_result, true)['data'];
|
|
||||||
$dom_entries = $result['list'];
|
|
||||||
|
|
||||||
$errors = "";
|
$errors = "";
|
||||||
$success_message = "";
|
$success_message = "";
|
||||||
|
|
||||||
@@ -63,8 +50,9 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
|||||||
'ttl' => $ttl
|
'ttl' => $ttl
|
||||||
))->add();
|
))->add();
|
||||||
$success_message = $lng['success']['dns_record_added'];
|
$success_message = $lng['success']['dns_record_added'];
|
||||||
|
$record = $prio = $content = "";
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
$errors = str_replace("\n", "<br>", $e->getMessage());
|
||||||
}
|
}
|
||||||
} elseif ($action == 'delete') {
|
} elseif ($action == 'delete') {
|
||||||
// remove entry
|
// remove entry
|
||||||
@@ -75,26 +63,26 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
|||||||
'entry_id' => $entry_id,
|
'entry_id' => $entry_id,
|
||||||
'id' => $domain_id
|
'id' => $domain_id
|
||||||
))->delete();
|
))->delete();
|
||||||
|
// success message (inline)
|
||||||
|
$success_message = $lng['success']['dns_record_deleted'];
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$errors = str_replace("\n", "<br>", $e->getMessage());
|
$errors = str_replace("\n", "<br>", $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($errors)) {
|
|
||||||
// remove deleted entry from internal data array (no reread of DB necessary)
|
|
||||||
$_t = $dom_entries;
|
|
||||||
foreach ($_t as $idx => $entry) {
|
|
||||||
if ($entry['id'] == $entry_id) {
|
|
||||||
unset($dom_entries[$idx]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unset($_t);
|
|
||||||
// success message (inline)
|
|
||||||
$success_message = $lng['success']['dns_record_deleted'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// select all entries
|
||||||
|
try {
|
||||||
|
// get list
|
||||||
|
$json_result = DomainZones::getLocal($userinfo, [
|
||||||
|
'id' => $domain_id
|
||||||
|
])->listing();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||||
|
}
|
||||||
|
$result = json_decode($json_result, true)['data'];
|
||||||
|
$dom_entries = $result['list'];
|
||||||
|
|
||||||
// show editor
|
// show editor
|
||||||
$record_list = "";
|
$record_list = "";
|
||||||
$existing_entries = "";
|
$existing_entries = "";
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ CREATE TABLE `ftp_groups` (
|
|||||||
DROP TABLE IF EXISTS `ftp_users`;
|
DROP TABLE IF EXISTS `ftp_users`;
|
||||||
CREATE TABLE `ftp_users` (
|
CREATE TABLE `ftp_users` (
|
||||||
`id` int(20) NOT NULL auto_increment,
|
`id` int(20) NOT NULL auto_increment,
|
||||||
`username` varchar(255) NOT NULL default '',
|
`username` varchar(255) NOT NULL,
|
||||||
`uid` int(5) NOT NULL default '0',
|
`uid` int(5) NOT NULL default '0',
|
||||||
`gid` int(5) NOT NULL default '0',
|
`gid` int(5) NOT NULL default '0',
|
||||||
`password` varchar(128) NOT NULL default '',
|
`password` varchar(128) NOT NULL,
|
||||||
`homedir` varchar(255) NOT NULL default '',
|
`homedir` varchar(255) NOT NULL default '',
|
||||||
`shell` varchar(255) NOT NULL default '/bin/false',
|
`shell` varchar(255) NOT NULL default '/bin/false',
|
||||||
`login_enabled` enum('N','Y') NOT NULL default 'N',
|
`login_enabled` enum('N','Y') NOT NULL default 'N',
|
||||||
@@ -90,8 +90,8 @@ CREATE TABLE `panel_activation` (
|
|||||||
DROP TABLE IF EXISTS `panel_admins`;
|
DROP TABLE IF EXISTS `panel_admins`;
|
||||||
CREATE TABLE `panel_admins` (
|
CREATE TABLE `panel_admins` (
|
||||||
`adminid` int(11) unsigned NOT NULL auto_increment,
|
`adminid` int(11) unsigned NOT NULL auto_increment,
|
||||||
`loginname` varchar(50) NOT NULL default '',
|
`loginname` varchar(50) NOT NULL,
|
||||||
`password` varchar(255) NOT NULL default '',
|
`password` varchar(255) NOT NULL,
|
||||||
`name` varchar(255) NOT NULL default '',
|
`name` varchar(255) NOT NULL default '',
|
||||||
`email` varchar(255) NOT NULL default '',
|
`email` varchar(255) NOT NULL default '',
|
||||||
`def_language` varchar(100) NOT NULL default '',
|
`def_language` varchar(100) NOT NULL default '',
|
||||||
@@ -142,7 +142,7 @@ CREATE TABLE `panel_admins` (
|
|||||||
DROP TABLE IF EXISTS `panel_customers`;
|
DROP TABLE IF EXISTS `panel_customers`;
|
||||||
CREATE TABLE `panel_customers` (
|
CREATE TABLE `panel_customers` (
|
||||||
`customerid` int(11) unsigned NOT NULL auto_increment,
|
`customerid` int(11) unsigned NOT NULL auto_increment,
|
||||||
`loginname` varchar(50) NOT NULL default '',
|
`loginname` varchar(50) NOT NULL,
|
||||||
`password` varchar(255) NOT NULL default '',
|
`password` varchar(255) NOT NULL default '',
|
||||||
`adminid` int(11) unsigned NOT NULL default '0',
|
`adminid` int(11) unsigned NOT NULL default '0',
|
||||||
`name` varchar(255) NOT NULL default '',
|
`name` varchar(255) NOT NULL default '',
|
||||||
@@ -223,7 +223,7 @@ CREATE TABLE `panel_databases` (
|
|||||||
DROP TABLE IF EXISTS `panel_domains`;
|
DROP TABLE IF EXISTS `panel_domains`;
|
||||||
CREATE TABLE `panel_domains` (
|
CREATE TABLE `panel_domains` (
|
||||||
`id` int(11) unsigned NOT NULL auto_increment,
|
`id` int(11) unsigned NOT NULL auto_increment,
|
||||||
`domain` varchar(255) NOT NULL default '',
|
`domain` varchar(255) NOT NULL,
|
||||||
`domain_ace` varchar(255) NOT NULL default '',
|
`domain_ace` varchar(255) NOT NULL default '',
|
||||||
`adminid` int(11) unsigned NOT NULL default '0',
|
`adminid` int(11) unsigned NOT NULL default '0',
|
||||||
`customerid` int(11) unsigned NOT NULL default '0',
|
`customerid` int(11) unsigned NOT NULL default '0',
|
||||||
@@ -286,7 +286,7 @@ CREATE TABLE `panel_domains` (
|
|||||||
DROP TABLE IF EXISTS `panel_ipsandports`;
|
DROP TABLE IF EXISTS `panel_ipsandports`;
|
||||||
CREATE TABLE `panel_ipsandports` (
|
CREATE TABLE `panel_ipsandports` (
|
||||||
`id` int(11) unsigned NOT NULL auto_increment,
|
`id` int(11) unsigned NOT NULL auto_increment,
|
||||||
`ip` varchar(39) NOT NULL default '',
|
`ip` varchar(39) NOT NULL,
|
||||||
`port` int(5) NOT NULL default '80',
|
`port` int(5) NOT NULL default '80',
|
||||||
`listen_statement` tinyint(1) NOT NULL default '0',
|
`listen_statement` tinyint(1) NOT NULL default '0',
|
||||||
`namevirtualhost_statement` tinyint(1) NOT NULL default '0',
|
`namevirtualhost_statement` tinyint(1) NOT NULL default '0',
|
||||||
@@ -387,6 +387,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('dkim', 'dkim_domains', 'domains'),
|
('dkim', 'dkim_domains', 'domains'),
|
||||||
('dkim', 'dkim_dkimkeys', 'dkim-keys.conf'),
|
('dkim', 'dkim_dkimkeys', 'dkim-keys.conf'),
|
||||||
('dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart'),
|
('dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart'),
|
||||||
|
('dkim', 'privkeysuffix', '.priv'),
|
||||||
('admin', 'show_news_feed', '0'),
|
('admin', 'show_news_feed', '0'),
|
||||||
('admin', 'show_version_login', '0'),
|
('admin', 'show_version_login', '0'),
|
||||||
('admin', 'show_version_footer', '0'),
|
('admin', 'show_version_footer', '0'),
|
||||||
@@ -554,6 +555,7 @@ opcache.interned_strings_buffer'),
|
|||||||
('system', 'ssl_cert_file', '/etc/apache2/apache2.pem'),
|
('system', 'ssl_cert_file', '/etc/apache2/apache2.pem'),
|
||||||
('system', 'use_ssl', '0'),
|
('system', 'use_ssl', '0'),
|
||||||
('system', 'default_vhostconf', ''),
|
('system', 'default_vhostconf', ''),
|
||||||
|
('system', 'default_sslvhostconf', ''),
|
||||||
('system', 'mail_quota_enabled', '0'),
|
('system', 'mail_quota_enabled', '0'),
|
||||||
('system', 'mail_quota', '100'),
|
('system', 'mail_quota', '100'),
|
||||||
('system', 'webalizer_enabled', '1'),
|
('system', 'webalizer_enabled', '1'),
|
||||||
@@ -655,7 +657,7 @@ opcache.interned_strings_buffer'),
|
|||||||
('system', 'leaccount', ''),
|
('system', 'leaccount', ''),
|
||||||
('system', 'nssextrausers', '0'),
|
('system', 'nssextrausers', '0'),
|
||||||
('system', 'le_domain_dnscheck', '1'),
|
('system', 'le_domain_dnscheck', '1'),
|
||||||
('system', 'ssl_protocols', 'TLSv1,TLSv1.2'),
|
('system', 'ssl_protocols', 'TLSv1.2'),
|
||||||
('system', 'tlsv13_cipher_list', ''),
|
('system', 'tlsv13_cipher_list', ''),
|
||||||
('system', 'honorcipherorder', '0'),
|
('system', 'honorcipherorder', '0'),
|
||||||
('system', 'sessiontickets', '1'),
|
('system', 'sessiontickets', '1'),
|
||||||
@@ -670,6 +672,8 @@ opcache.interned_strings_buffer'),
|
|||||||
('system', 'froxloraliases', ''),
|
('system', 'froxloraliases', ''),
|
||||||
('system', 'apply_specialsettings_default', '1'),
|
('system', 'apply_specialsettings_default', '1'),
|
||||||
('system', 'apply_phpconfigs_default', '1'),
|
('system', 'apply_phpconfigs_default', '1'),
|
||||||
|
('system', 'hide_incompatible_settings', '0'),
|
||||||
|
('system', 'include_default_vhostconf', '0'),
|
||||||
('api', 'enabled', '0'),
|
('api', 'enabled', '0'),
|
||||||
('2fa', 'enabled', '1'),
|
('2fa', 'enabled', '1'),
|
||||||
('panel', 'decimal_places', '4'),
|
('panel', 'decimal_places', '4'),
|
||||||
@@ -704,8 +708,8 @@ opcache.interned_strings_buffer'),
|
|||||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||||
('panel', 'customer_hide_options', ''),
|
('panel', 'customer_hide_options', ''),
|
||||||
('panel', 'is_configured', '0'),
|
('panel', 'is_configured', '0'),
|
||||||
('panel', 'version', '0.10.16'),
|
('panel', 'version', '0.10.24'),
|
||||||
('panel', 'db_version', '202004140');
|
('panel', 'db_version', '202101200');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_tasks`;
|
DROP TABLE IF EXISTS `panel_tasks`;
|
||||||
@@ -786,23 +790,6 @@ CREATE TABLE `panel_diskspace` (
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_diskspace_admins`;
|
|
||||||
CREATE TABLE `panel_diskspace_admins` (
|
|
||||||
`id` int(11) unsigned NOT NULL auto_increment,
|
|
||||||
`adminid` int(11) unsigned NOT NULL default '0',
|
|
||||||
`year` int(4) unsigned zerofill NOT NULL default '0000',
|
|
||||||
`month` int(2) unsigned zerofill NOT NULL default '00',
|
|
||||||
`day` int(2) unsigned zerofill NOT NULL default '00',
|
|
||||||
`stamp` int(11) unsigned NOT NULL default '0',
|
|
||||||
`webspace` bigint(30) unsigned NOT NULL default '0',
|
|
||||||
`mail` bigint(30) unsigned NOT NULL default '0',
|
|
||||||
`mysql` bigint(30) unsigned NOT NULL default '0',
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
KEY `adminid` (`adminid`)
|
|
||||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_languages`;
|
DROP TABLE IF EXISTS `panel_languages`;
|
||||||
CREATE TABLE `panel_languages` (
|
CREATE TABLE `panel_languages` (
|
||||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
@@ -997,7 +984,8 @@ CREATE TABLE IF NOT EXISTS `domain_ssl_settings` (
|
|||||||
`ssl_csr_file` mediumtext,
|
`ssl_csr_file` mediumtext,
|
||||||
`ssl_fullchain_file` mediumtext,
|
`ssl_fullchain_file` mediumtext,
|
||||||
`expirationdate` datetime DEFAULT NULL,
|
`expirationdate` datetime DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY (`domainid`)
|
||||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ class FroxlorInstall
|
|||||||
$this->_guessServerName();
|
$this->_guessServerName();
|
||||||
$this->_guessServerIP();
|
$this->_guessServerIP();
|
||||||
$this->_guessWebserver();
|
$this->_guessWebserver();
|
||||||
|
$this->_guessDistribution();
|
||||||
|
|
||||||
$this->_getPostField('mysql_host', '127.0.0.1');
|
$this->_getPostField('mysql_host', '127.0.0.1');
|
||||||
$this->_getPostField('mysql_database', 'froxlor');
|
$this->_getPostField('mysql_database', 'froxlor');
|
||||||
@@ -504,12 +505,30 @@ class FroxlorInstall
|
|||||||
$this->_updateSetting($upd_stmt, 'error', 'system', 'errorlog_level');
|
$this->_updateSetting($upd_stmt, 'error', 'system', 'errorlog_level');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$distros = glob(\Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml');
|
||||||
|
foreach ($distros as $_distribution) {
|
||||||
|
if ($this->_data['distribution'] == str_replace(".xml", "", strtolower(basename($_distribution)))) {
|
||||||
|
$dist = new \Froxlor\Config\ConfigParser($_distribution);
|
||||||
|
$defaults = $dist->getDefaults();
|
||||||
|
foreach ($defaults->property as $property) {
|
||||||
|
$this->_updateSetting($upd_stmt, $property->value, $property->settinggroup, $property->varname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed');
|
$this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed');
|
||||||
$this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath');
|
$this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath');
|
||||||
|
|
||||||
// insert the lastcronrun to be the installation date
|
// insert the lastcronrun to be the installation date
|
||||||
$this->_updateSetting($upd_stmt, time(), 'system', 'lastcronrun');
|
$this->_updateSetting($upd_stmt, time(), 'system', 'lastcronrun');
|
||||||
|
|
||||||
|
// check currently used php version and set values of fpm/fcgid accordingly
|
||||||
|
if (defined('PHP_MAJOR_VERSION') && defined('PHP_MINOR_VERSION')) {
|
||||||
|
$reload = "service php" . PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION . "-fpm restart";
|
||||||
|
$config_dir = "/etc/php/" . PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION . "/fpm/pool.d/";
|
||||||
|
$db->query("UPDATE `" . TABLE_PANEL_FPMDAEMONS . "` SET `reload_cmd` = '" . $reload . "', `config_dir` = '" . $config_dir . "' WHERE `id` ='1';");
|
||||||
|
}
|
||||||
|
|
||||||
// set specific times for some crons (traffic only at night, etc.)
|
// set specific times for some crons (traffic only at night, etc.)
|
||||||
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $ts . "' WHERE `cronfile` ='cron_traffic';");
|
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $ts . "' WHERE `cronfile` ='cron_traffic';");
|
||||||
@@ -840,6 +859,32 @@ class FroxlorInstall
|
|||||||
*/
|
*/
|
||||||
$section = $this->_lng['install']['serversettings'];
|
$section = $this->_lng['install']['serversettings'];
|
||||||
eval("\$formdata .= \"" . $this->_getTemplate("datasection") . "\";");
|
eval("\$formdata .= \"" . $this->_getTemplate("datasection") . "\";");
|
||||||
|
// distribution
|
||||||
|
if (! empty($_POST['installstep']) && $this->_data['distribution'] == '') {
|
||||||
|
$diststyle = 'color:red;';
|
||||||
|
} else {
|
||||||
|
$diststyle = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// show list of available distro's
|
||||||
|
$distros = glob(\Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml');
|
||||||
|
foreach ($distros as $_distribution) {
|
||||||
|
$dist = new \Froxlor\Config\ConfigParser($_distribution);
|
||||||
|
$dist_display = $dist->distributionName . " " . $dist->distributionCodename . " (" . $dist->distributionVersion . ")";
|
||||||
|
$distributions_select_data[$dist_display] .= str_replace(".xml", "", strtolower(basename($_distribution)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// sort by distribution name
|
||||||
|
ksort($distributions_select_data);
|
||||||
|
|
||||||
|
foreach ($distributions_select_data as $dist_display => $dist_index) {
|
||||||
|
// create select-box-option
|
||||||
|
$distributions_select .= \Froxlor\UI\HTML::makeoption($dist_display, $dist_index, $this->_data['distribution']);
|
||||||
|
// $this->_data['distribution']
|
||||||
|
}
|
||||||
|
|
||||||
|
$formdata .= $this->_getSectionItemSelectbox('distribution', $distributions_select, $diststyle);
|
||||||
|
|
||||||
// servername
|
// servername
|
||||||
if (! empty($_POST['installstep']) && $this->_data['servername'] == '') {
|
if (! empty($_POST['installstep']) && $this->_data['servername'] == '') {
|
||||||
$style = 'color:red;';
|
$style = 'color:red;';
|
||||||
@@ -861,12 +906,12 @@ class FroxlorInstall
|
|||||||
$websrvstyle = '';
|
$websrvstyle = '';
|
||||||
}
|
}
|
||||||
// apache
|
// apache
|
||||||
$formdata .= $this->_getSectionItemCheckbox('apache2', ($this->_data['webserver'] == 'apache2'), $websrvstyle);
|
$formdata .= $this->_getSectionItemCheckbox('webserver', 'apache2', ($this->_data['webserver'] == 'apache2'), $websrvstyle);
|
||||||
$formdata .= $this->_getSectionItemCheckbox('apache24', ($this->_data['webserver'] == 'apache24'), $websrvstyle);
|
$formdata .= $this->_getSectionItemCheckbox('webserver', 'apache24', ($this->_data['webserver'] == 'apache24'), $websrvstyle);
|
||||||
// lighttpd
|
// lighttpd
|
||||||
$formdata .= $this->_getSectionItemCheckbox('lighttpd', ($this->_data['webserver'] == 'lighttpd'), $websrvstyle);
|
$formdata .= $this->_getSectionItemCheckbox('webserver', 'lighttpd', ($this->_data['webserver'] == 'lighttpd'), $websrvstyle);
|
||||||
// nginx
|
// nginx
|
||||||
$formdata .= $this->_getSectionItemCheckbox('nginx', ($this->_data['webserver'] == 'nginx'), $websrvstyle);
|
$formdata .= $this->_getSectionItemCheckbox('webserver', 'nginx', ($this->_data['webserver'] == 'nginx'), $websrvstyle);
|
||||||
// webserver-user
|
// webserver-user
|
||||||
if (! empty($_POST['installstep']) && $this->_data['httpuser'] == '') {
|
if (! empty($_POST['installstep']) && $this->_data['httpuser'] == '') {
|
||||||
$style = 'color:red;';
|
$style = 'color:red;';
|
||||||
@@ -918,7 +963,7 @@ class FroxlorInstall
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate form radio field for webserver-selection
|
* generate form radio field
|
||||||
*
|
*
|
||||||
* @param string $fieldname
|
* @param string $fieldname
|
||||||
* @param boolean $checked
|
* @param boolean $checked
|
||||||
@@ -926,8 +971,9 @@ class FroxlorInstall
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function _getSectionItemCheckbox($fieldname = null, $checked = false, $style = "")
|
private function _getSectionItemCheckbox($groupname = null, $fieldname = null, $checked = false, $style = "")
|
||||||
{
|
{
|
||||||
|
$groupname = $this->_lng['install'][$groupname];
|
||||||
$fieldlabel = $this->_lng['install'][$fieldname];
|
$fieldlabel = $this->_lng['install'][$fieldname];
|
||||||
if ($checked) {
|
if ($checked) {
|
||||||
$checked = 'checked="checked"';
|
$checked = 'checked="checked"';
|
||||||
@@ -937,6 +983,25 @@ class FroxlorInstall
|
|||||||
return $sectionitem;
|
return $sectionitem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* generate form selectbox
|
||||||
|
*
|
||||||
|
* @param string $fieldname
|
||||||
|
* @param boolean $options
|
||||||
|
* @param string $style
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function _getSectionItemSelectbox($fieldname = null, $options = null, $style = "")
|
||||||
|
{
|
||||||
|
$groupname = $this->_lng['install'][$groupname];
|
||||||
|
$fieldlabel = $this->_lng['install'][$fieldname];
|
||||||
|
|
||||||
|
$sectionitem = "";
|
||||||
|
eval("\$sectionitem .= \"" . $this->_getTemplate("dataitemselect") . "\";");
|
||||||
|
return $sectionitem;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate form checkbox field
|
* generate form checkbox field
|
||||||
*
|
*
|
||||||
@@ -971,11 +1036,11 @@ class FroxlorInstall
|
|||||||
// check for correct php version
|
// check for correct php version
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']);
|
||||||
|
|
||||||
if (version_compare("7.0.0", PHP_VERSION, ">=")) {
|
if (version_compare("7.1.0", PHP_VERSION, ">=")) {
|
||||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notfound'] . ' (' . PHP_VERSION . ')');
|
$content .= $this->_status_message('red', $this->_lng['requirements']['notfound'] . ' (' . PHP_VERSION . ')');
|
||||||
$_die = true;
|
$_die = true;
|
||||||
} else {
|
} else {
|
||||||
if (version_compare("7.1.0", PHP_VERSION, ">=")) {
|
if (version_compare("7.4.0", PHP_VERSION, ">=")) {
|
||||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['newerphpprefered'] . ' (' . PHP_VERSION . ')');
|
$content .= $this->_status_message('orange', $this->_lng['requirements']['newerphpprefered'] . ' (' . PHP_VERSION . ')');
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', PHP_VERSION);
|
$content .= $this->_status_message('green', PHP_VERSION);
|
||||||
@@ -1273,6 +1338,42 @@ class FroxlorInstall
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get/guess linux distribution
|
||||||
|
*/
|
||||||
|
private function _guessDistribution()
|
||||||
|
{
|
||||||
|
// post
|
||||||
|
if (! empty($_POST['distribution'])) {
|
||||||
|
$this->_data['distribution'] = $_POST['distribution'];
|
||||||
|
} else {
|
||||||
|
// set default os.
|
||||||
|
$os_dist = array(
|
||||||
|
'ID' => 'buster'
|
||||||
|
);
|
||||||
|
$os_version = array(
|
||||||
|
'0' => '10'
|
||||||
|
);
|
||||||
|
|
||||||
|
// read os-release
|
||||||
|
if (file_exists('/etc/os-release')) {
|
||||||
|
$os_dist = parse_ini_file('/etc/os-release', false);
|
||||||
|
if (is_array($os_dist) && array_key_exists('ID', $os_dist) && array_key_exists('VERSION_ID', $os_dist)) {
|
||||||
|
$os_version = explode('.', $os_dist['VERSION_ID'])[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$distros = glob(\Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml');
|
||||||
|
foreach ($distros as $_distribution) {
|
||||||
|
$dist = new \Froxlor\Config\ConfigParser($_distribution);
|
||||||
|
$ver = explode('.', $dist->distributionVersion)[0];
|
||||||
|
if (strtolower($os_dist['ID']) == strtolower($dist->distributionName) && $os_version == $ver) {
|
||||||
|
$this->_data['distribution'] = str_replace(".xml", "", strtolower(basename($_distribution)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if POST field is set and get value for the
|
* check if POST field is set and get value for the
|
||||||
* internal data array, if not set use either '' or $default if != null
|
* internal data array, if not set use either '' or $default if != null
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
function showUpdateStep($task = null, $needs_status = true)
|
function showUpdateStep($task = null, $needs_status = true)
|
||||||
{
|
{
|
||||||
|
set_time_limit(30);
|
||||||
if (! $needs_status)
|
if (! $needs_status)
|
||||||
echo "<b>";
|
echo "<b>";
|
||||||
|
|
||||||
@@ -41,7 +42,6 @@ function showUpdateStep($task = null, $needs_status = true)
|
|||||||
}
|
}
|
||||||
|
|
||||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, $task);
|
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, $task);
|
||||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, $task);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,7 +82,6 @@ function lastStepStatus($status = -1, $message = '')
|
|||||||
|
|
||||||
if ($status == - 1 || $status == 2) {
|
if ($status == - 1 || $status == 2) {
|
||||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
|
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
|
||||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
|
|
||||||
} elseif ($status == 0 || $status == 1) {
|
} elseif ($status == 0 || $status == 1) {
|
||||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, 'Success');
|
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, 'Success');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ $lng['install']['admin_pass1'] = 'Administrator Password';
|
|||||||
$lng['install']['admin_pass2'] = 'Administrator-Password (confirm)';
|
$lng['install']['admin_pass2'] = 'Administrator-Password (confirm)';
|
||||||
$lng['install']['activate_newsfeed'] = 'Enable the official newsfeed<br><small>(https://inside.froxlor.org/news/)</small>';
|
$lng['install']['activate_newsfeed'] = 'Enable the official newsfeed<br><small>(https://inside.froxlor.org/news/)</small>';
|
||||||
$lng['install']['serversettings'] = 'Server settings';
|
$lng['install']['serversettings'] = 'Server settings';
|
||||||
|
$lng['install']['distribution'] = 'Distribution';
|
||||||
$lng['install']['servername'] = 'Server name (FQDN, no ip-address)';
|
$lng['install']['servername'] = 'Server name (FQDN, no ip-address)';
|
||||||
$lng['install']['serverip'] = 'Server IP';
|
$lng['install']['serverip'] = 'Server IP';
|
||||||
$lng['install']['webserver'] = 'Webserver';
|
$lng['install']['webserver'] = 'Webserver';
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ $lng['install']['admin_user'] = 'Nom d\'utilisateur administrateur';
|
|||||||
$lng['install']['admin_pass1'] = 'Mot de passe administrateur';
|
$lng['install']['admin_pass1'] = 'Mot de passe administrateur';
|
||||||
$lng['install']['admin_pass2'] = 'Mot de passe administrateur (confirmez)';
|
$lng['install']['admin_pass2'] = 'Mot de passe administrateur (confirmez)';
|
||||||
$lng['install']['serversettings'] = 'Réglages serveur';
|
$lng['install']['serversettings'] = 'Réglages serveur';
|
||||||
|
$lng['install']['distribution'] = 'Distribution';
|
||||||
$lng['install']['servername'] = 'Nom du serveur (FQDN, pas d\'adresse IP)';
|
$lng['install']['servername'] = 'Nom du serveur (FQDN, pas d\'adresse IP)';
|
||||||
$lng['install']['serverip'] = 'Adresse IP du serveur';
|
$lng['install']['serverip'] = 'Adresse IP du serveur';
|
||||||
$lng['install']['webserver'] = 'Serveur Web';
|
$lng['install']['webserver'] = 'Serveur Web';
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ $lng['install']['admin_pass1'] = 'Administrator-Passwort';
|
|||||||
$lng['install']['admin_pass2'] = 'Administrator-Passwort (Bestätigung)';
|
$lng['install']['admin_pass2'] = 'Administrator-Passwort (Bestätigung)';
|
||||||
$lng['install']['activate_newsfeed'] = 'Aktiviere das offizielle Newsfeed<br><small>(https://inside.froxlor.org/news/)</small>';
|
$lng['install']['activate_newsfeed'] = 'Aktiviere das offizielle Newsfeed<br><small>(https://inside.froxlor.org/news/)</small>';
|
||||||
$lng['install']['serversettings'] = 'Servereinstellungen';
|
$lng['install']['serversettings'] = 'Servereinstellungen';
|
||||||
|
$lng['install']['distribution'] = 'Distribution';
|
||||||
$lng['install']['servername'] = 'Servername (FQDN, keine IP-Adresse)';
|
$lng['install']['servername'] = 'Servername (FQDN, keine IP-Adresse)';
|
||||||
$lng['install']['serverip'] = 'Server-IP';
|
$lng['install']['serverip'] = 'Server-IP';
|
||||||
$lng['install']['webserver'] = 'Webserver';
|
$lng['install']['webserver'] = 'Webserver';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<p>
|
<p>
|
||||||
<label for="{$fieldname}" class="install-block {$style}">{$this->_lng['install']['webserver']} {$fieldlabel}:</label>
|
<label for="{$fieldname}" class="install-block {$style}">{$groupname} {$fieldlabel}:</label>
|
||||||
<input type="radio" name="webserver" id="{$fieldname}" value="{$fieldname}" {$checked} /><span>{$fieldlabel}</span>
|
<input type="radio" name="{$groupname}" id="{$fieldname}" value="{$fieldname}" {$checked} /><span>{$fieldlabel}</span>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
6
install/templates/dataitemselect.tpl
Normal file
6
install/templates/dataitemselect.tpl
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<p>
|
||||||
|
<label for="{$fieldname}" class="install-block {$style}">{$fieldlabel}:</label>
|
||||||
|
<select name="{$fieldname}" id="{$fieldname}" class="dropdown">
|
||||||
|
{$options}
|
||||||
|
</select>
|
||||||
|
</p>
|
||||||
@@ -617,3 +617,111 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.15')) {
|
|||||||
showUpdateStep("Updating from 0.10.15 to 0.10.16", false);
|
showUpdateStep("Updating from 0.10.15 to 0.10.16", false);
|
||||||
\Froxlor\Froxlor::updateToVersion('0.10.16');
|
\Froxlor\Froxlor::updateToVersion('0.10.16');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isDatabaseVersion('202004140')) {
|
||||||
|
|
||||||
|
showUpdateStep("Adding unique key on domainid field in domain ssl table");
|
||||||
|
// check for duplicate entries prior to set a unique key to avoid errors on update
|
||||||
|
Database::query("
|
||||||
|
DELETE a.* FROM domain_ssl_settings AS a
|
||||||
|
LEFT JOIN domain_ssl_settings AS b ON
|
||||||
|
((b.`domainid`=a.`domainid` AND UNIX_TIMESTAMP(b.`expirationdate`) > UNIX_TIMESTAMP(a.`expirationdate`))
|
||||||
|
OR (UNIX_TIMESTAMP(b.`expirationdate`) = UNIX_TIMESTAMP(a.`expirationdate`) AND b.`id`>a.`id`))
|
||||||
|
WHERE b.`id` IS NOT NULL
|
||||||
|
");
|
||||||
|
Database::query("ALTER TABLE `domain_ssl_settings` ADD UNIQUE(`domainid`)");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
\Froxlor\Froxlor::updateToDbVersion('202005150');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.16')) {
|
||||||
|
showUpdateStep("Updating from 0.10.16 to 0.10.17", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.17');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.17')) {
|
||||||
|
showUpdateStep("Updating from 0.10.17 to 0.10.18", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.18');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.18')) {
|
||||||
|
showUpdateStep("Updating from 0.10.18 to 0.10.19", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.19');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isDatabaseVersion('202005150')) {
|
||||||
|
|
||||||
|
showUpdateStep("Add new performance indexes", true);
|
||||||
|
Database::query("ALTER TABLE panel_customers ADD INDEX guid (guid);");
|
||||||
|
Database::query("ALTER TABLE panel_tasks ADD INDEX type (type);");
|
||||||
|
Database::query("ALTER TABLE mail_users ADD INDEX username (username);");
|
||||||
|
Database::query("ALTER TABLE mail_users ADD INDEX imap (imap);");
|
||||||
|
Database::query("ALTER TABLE mail_users ADD INDEX pop3 (pop3);");
|
||||||
|
Database::query("ALTER TABLE ftp_groups ADD INDEX gid (gid);");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
\Froxlor\Froxlor::updateToDbVersion('202007240');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.19')) {
|
||||||
|
showUpdateStep("Updating from 0.10.19 to 0.10.20", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.20');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isDatabaseVersion('202007240')) {
|
||||||
|
|
||||||
|
showUpdateStep("Removing old unused table", true);
|
||||||
|
Database::query("DROP TABLE IF EXISTS `panel_diskspace_admins`;");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
\Froxlor\Froxlor::updateToDbVersion('202009070');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.20')) {
|
||||||
|
showUpdateStep("Updating from 0.10.20 to 0.10.21", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.21');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.21')) {
|
||||||
|
|
||||||
|
showUpdateStep("Adding settings for ssl-vhost default content if not updated from db-version 201910110", true);
|
||||||
|
Settings::AddNew("system.default_sslvhostconf", '');
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Updating from 0.10.21 to 0.10.22", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.22');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.22')) {
|
||||||
|
showUpdateStep("Updating from 0.10.22 to 0.10.23", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.23');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.23')) {
|
||||||
|
showUpdateStep("Updating from 0.10.23 to 0.10.23.1", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.23.1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isDatabaseVersion('202009070')) {
|
||||||
|
|
||||||
|
showUpdateStep("Adding setting to hide incompatible settings", true);
|
||||||
|
Settings::AddNew("system.hide_incompatible_settings", '0');
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
\Froxlor\Froxlor::updateToDbVersion('202012300');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isDatabaseVersion('202012300')) {
|
||||||
|
|
||||||
|
showUpdateStep("Adding setting for DKIM private key extension/suffix", true);
|
||||||
|
Settings::AddNew("dkim.privkeysuffix", '.priv');
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
\Froxlor\Froxlor::updateToDbVersion('202101200');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.23.1')) {
|
||||||
|
showUpdateStep("Updating from 0.10.23.1 to 0.10.24", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.24');
|
||||||
|
}
|
||||||
|
|||||||
@@ -600,8 +600,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
|
|||||||
if (versionInUpdate($current_version, '0.9.32-rc2')) {
|
if (versionInUpdate($current_version, '0.9.32-rc2')) {
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.<br /><br />';
|
$description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.<br /><br />';
|
||||||
$question = '<strong>Please specify the command to execute cronscripts</strong> (default: "/usr/bin/nice -n 5 /usr/bin/php5 -q")<br />';
|
$question = '<strong>Please specify the command to execute cronscripts</strong> (default: "/usr/bin/nice -n 5 /usr/bin/php -q")<br />';
|
||||||
$question .= '<input type="text" class="text" name="croncmdline" value="/usr/bin/nice -n 5 /usr/bin/php5 -q" /><br />';
|
$question .= '<input type="text" class="text" name="croncmdline" value="/usr/bin/nice -n 5 /usr/bin/php -q" /><br />';
|
||||||
eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
|
eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
js/html5shiv.min.js
vendored
4
js/html5shiv.min.js
vendored
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||||
*/
|
*/
|
||||||
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document);
|
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);
|
||||||
4
js/jquery.min.js
vendored
4
js/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -54,6 +54,13 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
*/
|
*/
|
||||||
private $mail = null;
|
private $mail = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether the call is an internal one or not
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
private $internal_call = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* language strings array
|
* language strings array
|
||||||
*
|
*
|
||||||
@@ -90,10 +97,12 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
* optional, array of parameters (var=>value) for the command
|
* optional, array of parameters (var=>value) for the command
|
||||||
* @param array $userinfo
|
* @param array $userinfo
|
||||||
* optional, passed via WebInterface (instead of $header)
|
* optional, passed via WebInterface (instead of $header)
|
||||||
|
* @param boolean $internal
|
||||||
|
* optional whether called internally, default false
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function __construct($header = null, $params = null, $userinfo = null)
|
public function __construct($header = null, $params = null, $userinfo = null, $internal = false)
|
||||||
{
|
{
|
||||||
parent::__construct($params);
|
parent::__construct($params);
|
||||||
|
|
||||||
@@ -127,6 +136,9 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
if ($this->debug) {
|
if ($this->debug) {
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::LOG_ERROR, LOG_DEBUG, "[API] " . get_called_class() . ": " . json_encode($params, JSON_UNESCAPED_SLASHES));
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::LOG_ERROR, LOG_DEBUG, "[API] " . get_called_class() . ": " . json_encode($params, JSON_UNESCAPED_SLASHES));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set internal call flag
|
||||||
|
$this->internal_call = $internal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -191,13 +203,15 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
* array of user-data
|
* array of user-data
|
||||||
* @param array $params
|
* @param array $params
|
||||||
* array of parameters for the command
|
* array of parameters for the command
|
||||||
|
* @param boolean $internal
|
||||||
|
* optional whether called internally, default false
|
||||||
*
|
*
|
||||||
* @return ApiCommand
|
* @return ApiCommand
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function getLocal($userinfo = null, $params = null)
|
public static function getLocal($userinfo = null, $params = null, $internal = false)
|
||||||
{
|
{
|
||||||
return new static(null, $params, $userinfo);
|
return new static(null, $params, $userinfo, $internal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -210,6 +224,16 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
return $this->is_admin;
|
return $this->is_admin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* internal call flag
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
protected function isInternal()
|
||||||
|
{
|
||||||
|
return $this->internal_call;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return field from user-table
|
* return field from user-table
|
||||||
*
|
*
|
||||||
@@ -241,7 +265,7 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
* optional array of placeholders mapped to the actual value which is used in the API commands when executing the statement [internal]
|
* optional array of placeholders mapped to the actual value which is used in the API commands when executing the statement [internal]
|
||||||
* @param boolean $append
|
* @param boolean $append
|
||||||
* optional append to WHERE clause rather then create new one, default false [internal]
|
* optional append to WHERE clause rather then create new one, default false [internal]
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getSearchWhere(&$query_fields = array(), $append = false)
|
protected function getSearchWhere(&$query_fields = array(), $append = false)
|
||||||
@@ -304,7 +328,7 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
* optional, limit resultset, default 0
|
* optional, limit resultset, default 0
|
||||||
* @param int $sql_offset
|
* @param int $sql_offset
|
||||||
* optional, offset for limitation, default 0
|
* optional, offset for limitation, default 0
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getLimit()
|
protected function getLimit()
|
||||||
@@ -333,7 +357,7 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
* optional array with index = fieldname and value = ASC|DESC
|
* optional array with index = fieldname and value = ASC|DESC
|
||||||
* @param boolean $append
|
* @param boolean $append
|
||||||
* optional append to ORDER BY clause rather then create new one, default false [internal]
|
* optional append to ORDER BY clause rather then create new one, default false [internal]
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getOrderBy($append = false)
|
protected function getOrderBy($append = false)
|
||||||
@@ -417,15 +441,18 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
*
|
*
|
||||||
* @param string $command
|
* @param string $command
|
||||||
* @param array|null $params
|
* @param array|null $params
|
||||||
*
|
* @param boolean $internal
|
||||||
|
* optional whether called internally, default false
|
||||||
|
*
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function apiCall($command = null, $params = null)
|
protected function apiCall($command = null, $params = null, $internal = false)
|
||||||
{
|
{
|
||||||
$_command = explode(".", $command);
|
$_command = explode(".", $command);
|
||||||
$module = __NAMESPACE__ . "\Commands\\" . $_command[0];
|
$module = __NAMESPACE__ . "\Commands\\" . $_command[0];
|
||||||
$function = $_command[1];
|
$function = $_command[1];
|
||||||
$json_result = $module::getLocal($this->getUserData(), $params)->{$function}();
|
$json_result = $module::getLocal($this->getUserData(), $params, $internal)->{$function}();
|
||||||
return json_decode($json_result, true)['data'];
|
return json_decode($json_result, true)['data'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -491,7 +518,7 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
$customer_ids[] = $customer['customerid'];
|
$customer_ids[] = $customer['customerid'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (! empty($customer_hide_option) && \Froxlor\Settings::IsInList('panel.customer_hide_options', $customer_hide_option)) {
|
if (!$this->isInternal() && ! empty($customer_hide_option) && \Froxlor\Settings::IsInList('panel.customer_hide_options', $customer_hide_option)) {
|
||||||
throw new \Exception("You cannot access this resource", 405);
|
throw new \Exception("You cannot access this resource", 405);
|
||||||
}
|
}
|
||||||
$customer_ids = array(
|
$customer_ids = array(
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -75,7 +75,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_admins']);
|
return $this->response(200, "successful", $result['num_admins']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
@@ -109,7 +109,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get admin '" . $result['loginname'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get admin '" . $result['loginname'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = ($id > 0 ? "id #" . $id : "loginname '" . $loginname . "'");
|
$key = ($id > 0 ? "id #" . $id : "loginname '" . $loginname . "'");
|
||||||
throw new \Exception("Admin with " . $key . " could not be found", 404);
|
throw new \Exception("Admin with " . $key . " could not be found", 404);
|
||||||
@@ -231,7 +231,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||||
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
||||||
$def_language = \Froxlor\Validate\Validate::validate($def_language, 'default language', '', '', array(), true);
|
$def_language = \Froxlor\Validate\Validate::validate($def_language, 'default language', '', '', array(), true);
|
||||||
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', '/^[^\0]*$/', '', array(), true);
|
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
|
|
||||||
if (Settings::Get('system.mail_quota_enabled') != '1') {
|
if (Settings::Get('system.mail_quota_enabled') != '1') {
|
||||||
$email_quota = - 1;
|
$email_quota = - 1;
|
||||||
@@ -364,7 +364,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result = $this->apiCall('Admins.get', array(
|
$result = $this->apiCall('Admins.get', array(
|
||||||
'id' => $adminid
|
'id' => $adminid
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
@@ -531,7 +531,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||||
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
||||||
$def_language = \Froxlor\Validate\Validate::validate($def_language, 'default language', '', '', array(), true);
|
$def_language = \Froxlor\Validate\Validate::validate($def_language, 'default language', '', '', array(), true);
|
||||||
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', '/^[^\0]*$/', '', array(), true);
|
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$theme = \Froxlor\Validate\Validate::validate($theme, 'theme', '', '', array(), true);
|
$theme = \Froxlor\Validate\Validate::validate($theme, 'theme', '', '', array(), true);
|
||||||
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
|
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
|
||||||
|
|
||||||
@@ -677,7 +677,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result = $this->apiCall('Admins.get', array(
|
$result = $this->apiCall('Admins.get', array(
|
||||||
'id' => $result['adminid']
|
'id' => $result['adminid']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -713,6 +713,10 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
if ($id == $this->getUserDetail('adminid')) {
|
if ($id == $this->getUserDetail('adminid')) {
|
||||||
\Froxlor\UI\Response::standard_error('youcantdeleteyourself', '', true);
|
\Froxlor\UI\Response::standard_error('youcantdeleteyourself', '', true);
|
||||||
}
|
}
|
||||||
|
// can't delete the first superadmin
|
||||||
|
if ($id == 1) {
|
||||||
|
\Froxlor\UI\Response::standard_error('cannotdeletesuperadmin', '', true);
|
||||||
|
}
|
||||||
|
|
||||||
// delete admin
|
// delete admin
|
||||||
$del_stmt = Database::prepare("
|
$del_stmt = Database::prepare("
|
||||||
@@ -730,14 +734,6 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
'adminid' => $id
|
'adminid' => $id
|
||||||
), true, true);
|
), true, true);
|
||||||
|
|
||||||
// delete the diskspace usage
|
|
||||||
$del_stmt = Database::prepare("
|
|
||||||
DELETE FROM `" . TABLE_PANEL_DISKSPACE_ADMINS . "` WHERE `adminid` = :adminid
|
|
||||||
");
|
|
||||||
Database::pexecute($del_stmt, array(
|
|
||||||
'adminid' => $id
|
|
||||||
), true, true);
|
|
||||||
|
|
||||||
// set admin-id of the old admin's customer to current admins
|
// set admin-id of the old admin's customer to current admins
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET
|
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET
|
||||||
@@ -779,7 +775,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
|
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted admin '" . $result['loginname'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted admin '" . $result['loginname'] . "'");
|
||||||
\Froxlor\User::updateCounters();
|
\Froxlor\User::updateCounters();
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -821,7 +817,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result['loginfail_count'] = 0;
|
$result['loginfail_count'] = 0;
|
||||||
|
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] unlocked admin '" . $result['loginname'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] unlocked admin '" . $result['loginname'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
|
|||||||
30
lib/Froxlor/Api/Commands/ApiKeys.php
Normal file
30
lib/Froxlor/Api/Commands/ApiKeys.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
namespace Froxlor\Api\Commands;
|
||||||
|
|
||||||
|
use Froxlor\Database\Database;
|
||||||
|
use Froxlor\Settings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the Froxlor project.
|
||||||
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the COPYING
|
||||||
|
* file that was distributed with this source code. You can also view the
|
||||||
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
*
|
||||||
|
* @copyright (c) the authors
|
||||||
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
* @package API
|
||||||
|
* @since 0.10.0
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class ApiKeys extends \Froxlor\Api\ApiCommand
|
||||||
|
{
|
||||||
|
|
||||||
|
public function listing()
|
||||||
|
{}
|
||||||
|
|
||||||
|
public function listingCount()
|
||||||
|
{}
|
||||||
|
}
|
||||||
@@ -81,7 +81,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
$result = $this->apiCall('Certificates.get', array(
|
$result = $this->apiCall('Certificates.get', array(
|
||||||
'id' => $domain['id']
|
'id' => $domain['id']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Domain '" . $domain['domain'] . "' already has a certificate. Did you mean to call update?", 406);
|
throw new \Exception("Domain '" . $domain['domain'] . "' already has a certificate. Did you mean to call update?", 406);
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
if (! $result) {
|
if (! $result) {
|
||||||
throw new \Exception("Domain '" . $domain['domain'] . "' does not have a certificate.", 412);
|
throw new \Exception("Domain '" . $domain['domain'] . "' does not have a certificate.", 412);
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -168,7 +168,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
$result = $this->apiCall('Certificates.get', array(
|
$result = $this->apiCall('Certificates.get', array(
|
||||||
'id' => $domain['id']
|
'id' => $domain['id']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -222,7 +222,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
}
|
}
|
||||||
$result[] = $cert;
|
$result[] = $cert;
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -258,7 +258,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
$certs_stmt = Database::prepare($certs_stmt_query);
|
$certs_stmt = Database::prepare($certs_stmt_query);
|
||||||
$result = Database::pexecute_first($certs_stmt, $qry_params, true, true);
|
$result = Database::pexecute_first($certs_stmt, $qry_params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_certs']);
|
return $this->response(200, "successful", $result['num_certs']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
\Froxlor\System\Cronjob::inserttask('12', $chk['domain']);
|
\Froxlor\System\Cronjob::inserttask('12', $chk['domain']);
|
||||||
}
|
}
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] removed ssl-certificate for '" . $chk['domain'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] removed ssl-certificate for '" . $chk['domain'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Unable to determine SSL certificate. Maybe no access?", 406);
|
throw new \Exception("Unable to determine SSL certificate. Maybe no access?", 406);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE
|
|||||||
'id' => $id
|
'id' => $id
|
||||||
), true, true);
|
), true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("cronjob with id #" . $id . " could not be found", 404);
|
throw new \Exception("cronjob with id #" . $id . " could not be found", 404);
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE
|
|||||||
$result = $this->apiCall('Cronjobs.get', array(
|
$result = $this->apiCall('Cronjobs.get', array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE
|
|||||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -175,7 +175,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_crons']);
|
return $this->response(200, "successful", $result['num_crons']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
|
|||||||
@@ -52,7 +52,9 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
* @param bool $backup_web
|
* @param bool $backup_web
|
||||||
* optional whether to backup web-data, default is 0 (false)
|
* optional whether to backup web-data, default is 0 (false)
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* required when called as admin, not needed when called as customer
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
|
* @param string $loginname
|
||||||
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
*
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -109,7 +111,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
\Froxlor\System\Cronjob::inserttask('20', $task_data);
|
\Froxlor\System\Cronjob::inserttask('20', $task_data);
|
||||||
|
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] added customer-backup job for '" . $customer['loginname'] . "'. Target directory: " . $userpath);
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] added customer-backup job for '" . $customer['loginname'] . "'. Target directory: " . $userpath);
|
||||||
return $this->response(200, "successfull", $task_data);
|
return $this->response(200, "successful", $task_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -168,7 +170,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list customer-backups");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list customer-backups");
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -202,7 +204,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
$result_count ++;
|
$result_count ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", $result_count);
|
return $this->response(200, "successful", $result_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -237,7 +239,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
'tid' => $entry
|
'tid' => $entry
|
||||||
), true, true);
|
), true, true);
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] deleted planned customer-backup #" . $entry);
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] deleted planned customer-backup #" . $entry);
|
||||||
return $this->response(200, "successfull", true);
|
return $this->response(200, "successful", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -90,7 +90,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
}
|
}
|
||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_customers']);
|
return $this->response(200, "successful", $result['num_customers']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
@@ -143,7 +143,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
$result['custom_notes'] = "";
|
$result['custom_notes'] = "";
|
||||||
}
|
}
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get customer '" . $result['loginname'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get customer '" . $result['loginname'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = ($id > 0 ? "id #" . $id : "loginname '" . $loginname . "'");
|
$key = ($id > 0 ? "id #" . $id : "loginname '" . $loginname . "'");
|
||||||
throw new \Exception("Customer with " . $key . " could not be found", 404);
|
throw new \Exception("Customer with " . $key . " could not be found", 404);
|
||||||
@@ -183,7 +183,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
* optional, whether to show the content of custom_notes to the customer, default 0 (false)
|
* optional, whether to show the content of custom_notes to the customer, default 0 (false)
|
||||||
* @param string $new_loginname
|
* @param string $new_loginname
|
||||||
* optional, if empty generated automatically using customer-prefix and increasing number
|
* optional, if empty generated automatically using customer-prefix and increasing number
|
||||||
* @param string $password
|
* @param string $new_customer_password
|
||||||
* optional, if empty generated automatically and send to the customer's email if $sendpassword is 1
|
* optional, if empty generated automatically and send to the customer's email if $sendpassword is 1
|
||||||
* @param bool $sendpassword
|
* @param bool $sendpassword
|
||||||
* optional, whether to send the password to the customer after creation, default 0 (false)
|
* optional, whether to send the password to the customer after creation, default 0 (false)
|
||||||
@@ -336,7 +336,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
||||||
$customernumber = \Froxlor\Validate\Validate::validate($customernumber, 'customer number', '/^[A-Za-z0-9 \-]*$/Di', '', array(), true);
|
$customernumber = \Froxlor\Validate\Validate::validate($customernumber, 'customer number', '/^[A-Za-z0-9 \-]*$/Di', '', array(), true);
|
||||||
$def_language = \Froxlor\Validate\Validate::validate($def_language, 'default language', '', '', array(), true);
|
$def_language = \Froxlor\Validate\Validate::validate($def_language, 'default language', '', '', array(), true);
|
||||||
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', '/^[^\0]*$/', '', array(), true);
|
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
|
|
||||||
if (Settings::Get('system.mail_quota_enabled') != '1') {
|
if (Settings::Get('system.mail_quota_enabled') != '1') {
|
||||||
$email_quota = - 1;
|
$email_quota = - 1;
|
||||||
@@ -743,7 +743,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
$result = $this->apiCall('Customers.get', array(
|
$result = $this->apiCall('Customers.get', array(
|
||||||
'loginname' => $loginname
|
'loginname' => $loginname
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("No more resources available", 406);
|
throw new \Exception("No more resources available", 406);
|
||||||
}
|
}
|
||||||
@@ -928,7 +928,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
$fax = \Froxlor\Validate\Validate::validate($fax, 'fax', '/^[0-9\- \+\(\)\/]*$/', '', array(), true);
|
$fax = \Froxlor\Validate\Validate::validate($fax, 'fax', '/^[0-9\- \+\(\)\/]*$/', '', array(), true);
|
||||||
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
||||||
$customernumber = \Froxlor\Validate\Validate::validate($customernumber, 'customer number', '/^[A-Za-z0-9 \-]*$/Di', '', array(), true);
|
$customernumber = \Froxlor\Validate\Validate::validate($customernumber, 'customer number', '/^[A-Za-z0-9 \-]*$/Di', '', array(), true);
|
||||||
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', '/^[^\0]*$/', '', array(), true);
|
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
if (! empty($allowed_phpconfigs)) {
|
if (! empty($allowed_phpconfigs)) {
|
||||||
$allowed_phpconfigs = array_map('intval', $allowed_phpconfigs);
|
$allowed_phpconfigs = array_map('intval', $allowed_phpconfigs);
|
||||||
}
|
}
|
||||||
@@ -1025,7 +1025,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
\Froxlor\System\Cronjob::inserttask('1');
|
\Froxlor\System\Cronjob::inserttask('1');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($phpenabled != $result['phpenabled'] || $perlenabled != $result['perlenabled']) {
|
if ($phpenabled != $result['phpenabled'] || $perlenabled != $result['perlenabled'] || $email != $result['email']) {
|
||||||
\Froxlor\System\Cronjob::inserttask('1');
|
\Froxlor\System\Cronjob::inserttask('1');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1340,7 +1340,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
$result = $this->apiCall('Customers.get', array(
|
$result = $this->apiCall('Customers.get', array(
|
||||||
'id' => $result['customerid']
|
'id' => $result['customerid']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1573,7 +1573,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
\Froxlor\System\Cronjob::inserttask('10');
|
\Froxlor\System\Cronjob::inserttask('10');
|
||||||
|
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted customer '" . $result['loginname'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted customer '" . $result['loginname'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -1615,7 +1615,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
$result['loginfail_count'] = 0;
|
$result['loginfail_count'] = 0;
|
||||||
|
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] unlocked customer '" . $result['loginname'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] unlocked customer '" . $result['loginname'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -1685,7 +1685,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
$result = $this->apiCall('Customers.get', array(
|
$result = $this->apiCall('Customers.get', array(
|
||||||
'id' => $c_result['customerid']
|
'id' => $c_result['customerid']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* add options for a given directory
|
* add options for a given directory
|
||||||
*
|
*
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* path relative to the customer's home-Directory
|
* path relative to the customer's home-Directory
|
||||||
* @param bool $options_indexes
|
* @param bool $options_indexes
|
||||||
@@ -69,7 +69,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$error500path = $this->getParam('error500path', true, '');
|
$error500path = $this->getParam('error500path', true, '');
|
||||||
|
|
||||||
// validation
|
// validation
|
||||||
$path = \Froxlor\FileDir::makeCorrectDir(\Froxlor\Validate\Validate::validate($path, 'path', '', '', array(), true));
|
$path = \Froxlor\FileDir::makeCorrectDir(\Froxlor\Validate\Validate::validate($path, 'path', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true));
|
||||||
$userpath = $path;
|
$userpath = $path;
|
||||||
$path = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . '/' . $path);
|
$path = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . '/' . $path);
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$result = $this->apiCall('DirOptions.get', array(
|
$result = $this->apiCall('DirOptions.get', array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,7 +186,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get directory options for '" . $result['path'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get directory options for '" . $result['path'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = "id #" . $id;
|
$key = "id #" . $id;
|
||||||
throw new \Exception("Directory option with " . $key . " could not be found", 404);
|
throw new \Exception("Directory option with " . $key . " could not be found", 404);
|
||||||
@@ -198,9 +198,9 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* @param int $id
|
* @param int $id
|
||||||
* id of dir-protection entry
|
* id of dir-protection entry
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param bool $options_indexes
|
* @param bool $options_indexes
|
||||||
* optional, activate directory-listing for this path, default 0 (false)
|
* optional, activate directory-listing for this path, default 0 (false)
|
||||||
* @param bool $options_cgi
|
* @param bool $options_cgi
|
||||||
@@ -275,7 +275,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$result = $this->apiCall('DirOptions.get', array(
|
$result = $this->apiCall('DirOptions.get', array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -315,7 +315,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list directory-options");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list directory-options");
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -347,7 +347,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_htaccess']);
|
return $this->response(200, "successful", $result['num_htaccess']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,7 +414,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
), true, true);
|
), true, true);
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted directory-option for '" . str_replace($customer_data['documentroot'], '/', $result['path']) . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted directory-option for '" . str_replace($customer_data['documentroot'], '/', $result['path']) . "'");
|
||||||
\Froxlor\System\Cronjob::inserttask('1');
|
\Froxlor\System\Cronjob::inserttask('1');
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
|
|||||||
* add htaccess protection to a given directory
|
* add htaccess protection to a given directory
|
||||||
*
|
*
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param string $username
|
* @param string $username
|
||||||
* @param string $directory_password
|
* @param string $directory_password
|
||||||
@@ -60,7 +60,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
|
|||||||
$authname = $this->getParam('directory_authname', true, '');
|
$authname = $this->getParam('directory_authname', true, '');
|
||||||
|
|
||||||
// validation
|
// validation
|
||||||
$path = \Froxlor\FileDir::makeCorrectDir(\Froxlor\Validate\Validate::validate($path, 'path', '', '', array(), true));
|
$path = \Froxlor\FileDir::makeCorrectDir(\Froxlor\Validate\Validate::validate($path, 'path', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true));
|
||||||
$path = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . '/' . $path);
|
$path = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . '/' . $path);
|
||||||
$username = \Froxlor\Validate\Validate::validate($username, 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/', '', array(), true);
|
$username = \Froxlor\Validate\Validate::validate($username, 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/', '', array(), true);
|
||||||
$authname = \Froxlor\Validate\Validate::validate($authname, 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/', '', array(), true);
|
$authname = \Froxlor\Validate\Validate::validate($authname, 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/', '', array(), true);
|
||||||
@@ -111,7 +111,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
|
|||||||
$result = $this->apiCall('DirProtections.get', array(
|
$result = $this->apiCall('DirProtections.get', array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -173,7 +173,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
|
|||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get directory protection for '" . $result['path'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get directory protection for '" . $result['path'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = ($id > 0 ? "id #" . $id : "username '" . $username . "'");
|
$key = ($id > 0 ? "id #" . $id : "username '" . $username . "'");
|
||||||
throw new \Exception("Directory protection with " . $key . " could not be found", 404);
|
throw new \Exception("Directory protection with " . $key . " could not be found", 404);
|
||||||
@@ -187,9 +187,9 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
|
|||||||
* @param string $username
|
* @param string $username
|
||||||
* optional, the username
|
* optional, the username
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param string $directory_password
|
* @param string $directory_password
|
||||||
* optional, leave empty for no change
|
* optional, leave empty for no change
|
||||||
* @param string $directory_authname
|
* @param string $directory_authname
|
||||||
@@ -258,7 +258,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
|
|||||||
$result = $this->apiCall('DirProtections.get', array(
|
$result = $this->apiCall('DirProtections.get', array(
|
||||||
'id' => $result['id']
|
'id' => $result['id']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -298,7 +298,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
|
|||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list directory-protections");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list directory-protections");
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -330,7 +330,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_htpasswd']);
|
return $this->response(200, "successful", $result['num_htpasswd']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,6 +386,6 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
|
|||||||
|
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
|
||||||
\Froxlor\System\Cronjob::inserttask('1');
|
\Froxlor\System\Cronjob::inserttask('1');
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,6 +170,10 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// check www-alias setting
|
||||||
|
if ($result['wwwserveralias'] == '1' && $result['iswildcarddomain'] == '0' && $record == 'www') {
|
||||||
|
$errors[] = $this->lng['error']['no_wwwcnamae_ifwwwalias'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// append trailing dot (again)
|
// append trailing dot (again)
|
||||||
$content .= '.';
|
$content .= '.';
|
||||||
@@ -309,10 +313,10 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$result = $this->apiCall('DomainZones.get', array(
|
$result = $this->apiCall('DomainZones.get', array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
// return $errors
|
// return $errors
|
||||||
throw new \Exception(implode("\n", $errors));
|
throw new \Exception(implode("\n", $errors), 406);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -360,7 +364,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$zonefile = (string) $zone;
|
$zonefile = (string) $zone;
|
||||||
|
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get dns-zone for '" . $result['domain'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get dns-zone for '" . $result['domain'] . "'");
|
||||||
return $this->response(200, "successfull", explode("\n", $zonefile));
|
return $this->response(200, "successful", explode("\n", $zonefile));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -420,7 +424,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
while ($row = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -464,7 +468,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
'did' => $id
|
'did' => $id
|
||||||
), true, true);
|
), true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_dns']);
|
return $this->response(200, "successful", $result['num_dns']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,8 +515,8 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
if ($del_stmt->rowCount() > 0) {
|
if ($del_stmt->rowCount() > 0) {
|
||||||
// re-generate bind configs
|
// re-generate bind configs
|
||||||
\Froxlor\System\Cronjob::inserttask('4');
|
\Froxlor\System\Cronjob::inserttask('4');
|
||||||
return $this->response(200, "successfull", true);
|
return $this->response(200, "successful", true);
|
||||||
}
|
}
|
||||||
return $this->response(304, "successfull", true);
|
return $this->response(304, "successful", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
}
|
}
|
||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -100,7 +100,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
}
|
}
|
||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_domains']);
|
return $this->response(200, "successful", $result['num_domains']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
@@ -156,7 +156,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
$result['ipsandports'] = $this->getIpsForDomain($result['id']);
|
$result['ipsandports'] = $this->getIpsForDomain($result['id']);
|
||||||
}
|
}
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get domain '" . $result['domain'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get domain '" . $result['domain'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = ($id > 0 ? "id #" . $id : "domainname '" . $domainname . "'");
|
$key = ($id > 0 ? "id #" . $id : "domainname '" . $domainname . "'");
|
||||||
throw new \Exception("Domain with " . $key . " could not be found", 404);
|
throw new \Exception("Domain with " . $key . " could not be found", 404);
|
||||||
@@ -199,6 +199,9 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
* @param string $domain
|
* @param string $domain
|
||||||
* domain-name
|
* domain-name
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
|
* @param string $loginname
|
||||||
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param int $adminid
|
* @param int $adminid
|
||||||
* optional, default is the calling admin's ID
|
* optional, default is the calling admin's ID
|
||||||
* @param array $ipandport
|
* @param array $ipandport
|
||||||
@@ -297,7 +300,6 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
|
|
||||||
// parameters
|
// parameters
|
||||||
$p_domain = $this->getParam('domain');
|
$p_domain = $this->getParam('domain');
|
||||||
$customerid = intval($this->getParam('customerid'));
|
|
||||||
|
|
||||||
// optional parameters
|
// optional parameters
|
||||||
$p_ipandports = $this->getParam('ipandport', true, explode(',', Settings::Get('system.defaultip')));
|
$p_ipandports = $this->getParam('ipandport', true, explode(',', Settings::Get('system.defaultip')));
|
||||||
@@ -377,9 +379,8 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
), '', true);
|
), '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$customer = $this->apiCall('Customers.get', array(
|
$customer = $this->getCustomerData();
|
||||||
'id' => $customerid
|
$customerid = $customer['customerid'];
|
||||||
));
|
|
||||||
|
|
||||||
if ($this->getUserDetail('customers_see_all') == '1' && $adminid != $this->getUserDetail('adminid')) {
|
if ($this->getUserDetail('customers_see_all') == '1' && $adminid != $this->getUserDetail('adminid')) {
|
||||||
$admin_stmt = Database::prepare("
|
$admin_stmt = Database::prepare("
|
||||||
@@ -428,8 +429,8 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
$zonefile = '';
|
$zonefile = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $specialsettings), 'specialsettings', '/^[^\0]*$/', '', array(), true);
|
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $specialsettings), 'specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
\Froxlor\Validate\Validate::validate($documentroot, 'documentroot', '', '', array(), true);
|
\Froxlor\Validate\Validate::validate($documentroot, 'documentroot', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
|
||||||
|
|
||||||
// If path is empty and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
// If path is empty and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||||
// set default path to subdomain or domain name
|
// set default path to subdomain or domain name
|
||||||
@@ -828,7 +829,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
$result = $this->apiCall('Domains.get', array(
|
$result = $this->apiCall('Domains.get', array(
|
||||||
'domainname' => $domain
|
'domainname' => $domain
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("No more resources available", 406);
|
throw new \Exception("No more resources available", 406);
|
||||||
@@ -844,7 +845,9 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
* @param string $domainname
|
* @param string $domainname
|
||||||
* optional, the domainname
|
* optional, the domainname
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional customer-id
|
* required (if $loginname is not specified)
|
||||||
|
* @param string $loginname
|
||||||
|
* required (if $customerid is not specified)
|
||||||
* @param int $adminid
|
* @param int $adminid
|
||||||
* optional, default is the calling admin's ID
|
* optional, default is the calling admin's ID
|
||||||
* @param array $ipandport
|
* @param array $ipandport
|
||||||
@@ -952,9 +955,18 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
|
|
||||||
// optional parameters
|
// optional parameters
|
||||||
$p_ipandports = $this->getParam('ipandport', true, array());
|
$p_ipandports = $this->getParam('ipandport', true, array());
|
||||||
$customerid = intval($this->getParam('customerid', true, $result['customerid']));
|
|
||||||
$adminid = intval($this->getParam('adminid', true, $result['adminid']));
|
$adminid = intval($this->getParam('adminid', true, $result['adminid']));
|
||||||
|
|
||||||
|
if ($this->getParam('customerid', true, 0) == 0 && $this->getParam('loginname', true, '') == '') {
|
||||||
|
$customerid = $result['customerid'];
|
||||||
|
$customer = $this->apiCall('Customers.get', array(
|
||||||
|
'id' => $customerid
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
$customer = $this->getCustomerData();
|
||||||
|
$customerid = $customer['customerid'];
|
||||||
|
}
|
||||||
|
|
||||||
$subcanemaildomain = $this->getParam('subcanemaildomain', true, $result['subcanemaildomain']);
|
$subcanemaildomain = $this->getParam('subcanemaildomain', true, $result['subcanemaildomain']);
|
||||||
$isemaildomain = $this->getBoolParam('isemaildomain', true, $result['isemaildomain']);
|
$isemaildomain = $this->getBoolParam('isemaildomain', true, $result['isemaildomain']);
|
||||||
$email_only = $this->getBoolParam('email_only', true, $result['email_only']);
|
$email_only = $this->getBoolParam('email_only', true, $result['email_only']);
|
||||||
@@ -1085,13 +1097,6 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
if (empty($customer) || $customer['customerid'] != $customerid) {
|
if (empty($customer) || $customer['customerid'] != $customerid) {
|
||||||
\Froxlor\UI\Response::standard_error('customerdoesntexist', '', true);
|
\Froxlor\UI\Response::standard_error('customerdoesntexist', '', true);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$customerid = $result['customerid'];
|
|
||||||
|
|
||||||
// get customer
|
|
||||||
$customer = $this->apiCall('Customers.get', array(
|
|
||||||
'id' => $customerid
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle change of admin (move domain from admin to admin)
|
// handle change of admin (move domain from admin to admin)
|
||||||
@@ -1157,8 +1162,8 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
$dkim = $result['dkim'];
|
$dkim = $result['dkim'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $specialsettings), 'specialsettings', '/^[^\0]*$/', '', array(), true);
|
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $specialsettings), 'specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$documentroot = \Froxlor\Validate\Validate::validate($documentroot, 'documentroot', '', '', array(), true);
|
$documentroot = \Froxlor\Validate\Validate::validate($documentroot, 'documentroot', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
|
||||||
|
|
||||||
// when moving customer and no path is specified, update would normally reuse the current document-root
|
// when moving customer and no path is specified, update would normally reuse the current document-root
|
||||||
// which would point to the wrong customer, therefore we will re-create that directory
|
// which would point to the wrong customer, therefore we will re-create that directory
|
||||||
@@ -1324,7 +1329,12 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! preg_match('/^https?\:\/\//', $documentroot)) {
|
if (! preg_match('/^https?\:\/\//', $documentroot)) {
|
||||||
$documentroot = \Froxlor\FileDir::makeCorrectDir($documentroot);
|
if ($documentroot != $result['documentroot']) {
|
||||||
|
if (substr($documentroot, 0, 1) != "/") {
|
||||||
|
$documentroot = $customer['documentroot'] . '/' . $documentroot;
|
||||||
|
}
|
||||||
|
$documentroot = \Froxlor\FileDir::makeCorrectDir($documentroot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($email_only == '1') {
|
if ($email_only == '1') {
|
||||||
@@ -1442,6 +1452,8 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
Database::pexecute($del_stmt, array(
|
Database::pexecute($del_stmt, array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
), true, true);
|
), true, true);
|
||||||
|
// remove domain from acme.sh / lets encrypt if used
|
||||||
|
\Froxlor\System\Cronjob::inserttask('12', $result['domain']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$updatechildren = '';
|
$updatechildren = '';
|
||||||
@@ -1766,7 +1778,10 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
|
|
||||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] updated domain '" . $idna_convert->decode($result['domain']) . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] updated domain '" . $idna_convert->decode($result['domain']) . "'");
|
||||||
return $this->response(200, "successfull", $update_data);
|
$result = $this->apiCall('Domains.get', array(
|
||||||
|
'domainname' => $result['domain']
|
||||||
|
));
|
||||||
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -1927,7 +1942,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
\Froxlor\System\Cronjob::inserttask('1');
|
\Froxlor\System\Cronjob::inserttask('1');
|
||||||
// Using nameserver, insert a task which rebuilds the server config
|
// Using nameserver, insert a task which rebuilds the server config
|
||||||
\Froxlor\System\Cronjob::inserttask('4');
|
\Froxlor\System\Cronjob::inserttask('4');
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
|||||||
* @param string $emailaddr
|
* @param string $emailaddr
|
||||||
* optional email-address to add the account for
|
* optional email-address to add the account for
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param string $email_password
|
* @param string $email_password
|
||||||
* password for the account
|
* password for the account
|
||||||
* @param string $alternative_email
|
* @param string $alternative_email
|
||||||
@@ -273,7 +273,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
|||||||
$result = $this->apiCall('Emails.get', array(
|
$result = $this->apiCall('Emails.get', array(
|
||||||
'emailaddr' => $result['email_full']
|
'emailaddr' => $result['email_full']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("No more resources available", 406);
|
throw new \Exception("No more resources available", 406);
|
||||||
}
|
}
|
||||||
@@ -295,9 +295,9 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
|||||||
* @param string $emailaddr
|
* @param string $emailaddr
|
||||||
* optional, the email-address to update
|
* optional, the email-address to update
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param int $email_quota
|
* @param int $email_quota
|
||||||
* optional, update quota
|
* optional, update quota
|
||||||
* @param string $email_password
|
* @param string $email_password
|
||||||
@@ -389,7 +389,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
|||||||
$result = $this->apiCall('Emails.get', array(
|
$result = $this->apiCall('Emails.get', array(
|
||||||
'emailaddr' => $result['email_full']
|
'emailaddr' => $result['email_full']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -418,9 +418,9 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
|||||||
* @param string $emailaddr
|
* @param string $emailaddr
|
||||||
* optional, the email-address to delete the account for
|
* optional, the email-address to delete the account for
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param bool $delete_userfiles
|
* @param bool $delete_userfiles
|
||||||
* optional, default false
|
* optional, default false
|
||||||
*
|
*
|
||||||
@@ -492,6 +492,6 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
|||||||
Customers::decreaseUsage($customer['customerid'], 'email_quota_used', '', $quota);
|
Customers::decreaseUsage($customer['customerid'], 'email_quota_used', '', $quota);
|
||||||
|
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted email account for '" . $result['email_full'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted email account for '" . $result['email_full'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
* @param string $emailaddr
|
* @param string $emailaddr
|
||||||
* optional, the email-address to add the forwarder for
|
* optional, the email-address to add the forwarder for
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param string $destination
|
* @param string $destination
|
||||||
* email-address to add as forwarder
|
* email-address to add as forwarder
|
||||||
*
|
*
|
||||||
@@ -102,7 +102,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
$result = $this->apiCall('Emails.get', array(
|
$result = $this->apiCall('Emails.get', array(
|
||||||
'emailaddr' => $result['email_full']
|
'emailaddr' => $result['email_full']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("No more resources available", 406);
|
throw new \Exception("No more resources available", 406);
|
||||||
}
|
}
|
||||||
@@ -168,7 +168,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->response(200, "successfull", [
|
return $this->response(200, "successful", [
|
||||||
'count' => count($destination),
|
'count' => count($destination),
|
||||||
'list' => $destination
|
'list' => $destination
|
||||||
]);
|
]);
|
||||||
@@ -210,7 +210,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
|
|
||||||
$result['destination'] = explode(' ', $result['destination']);
|
$result['destination'] = explode(' ', $result['destination']);
|
||||||
|
|
||||||
return $this->response(200, "successfull", count($result['destination']));
|
return $this->response(200, "successful", count($result['destination']));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -221,9 +221,9 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
* @param string $emailaddr
|
* @param string $emailaddr
|
||||||
* optional, the email-address to delete the forwarder from
|
* optional, the email-address to delete the forwarder from
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param int $forwarderid
|
* @param int $forwarderid
|
||||||
* id of the forwarder to delete
|
* id of the forwarder to delete
|
||||||
*
|
*
|
||||||
@@ -280,7 +280,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
|||||||
$result = $this->apiCall('Emails.get', array(
|
$result = $this->apiCall('Emails.get', array(
|
||||||
'emailaddr' => $result['email_full']
|
'emailaddr' => $result['email_full']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Unknown forwarder id", 404);
|
throw new \Exception("Unknown forwarder id", 404);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
* @param boolean $iscatchall
|
* @param boolean $iscatchall
|
||||||
* optional, make this address a catchall address, default: no
|
* optional, make this address a catchall address, default: no
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
*
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -62,9 +62,10 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check domain and whether it's an email-enabled domain
|
// check domain and whether it's an email-enabled domain
|
||||||
|
// use internal call because the customer might have 'domains' in customer_hide_options
|
||||||
$domain_check = $this->apiCall('SubDomains.get', array(
|
$domain_check = $this->apiCall('SubDomains.get', array(
|
||||||
'domainname' => $domain
|
'domainname' => $domain
|
||||||
));
|
), true);
|
||||||
if ($domain_check['isemaildomain'] == 0) {
|
if ($domain_check['isemaildomain'] == 0) {
|
||||||
\Froxlor\UI\Response::standard_error('maindomainnonexist', $domain, true);
|
\Froxlor\UI\Response::standard_error('maindomainnonexist', $domain, true);
|
||||||
}
|
}
|
||||||
@@ -139,7 +140,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result = $this->apiCall('Emails.get', array(
|
$result = $this->apiCall('Emails.get', array(
|
||||||
'emailaddr' => $email_full
|
'emailaddr' => $email_full
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("No more resources available", 406);
|
throw new \Exception("No more resources available", 406);
|
||||||
}
|
}
|
||||||
@@ -175,7 +176,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get email address '" . $result['email_full'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get email address '" . $result['email_full'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = ($id > 0 ? "id #" . $id : "emailaddr '" . $emailaddr . "'");
|
$key = ($id > 0 ? "id #" . $id : "emailaddr '" . $emailaddr . "'");
|
||||||
throw new \Exception("Email address with " . $key . " could not be found", 404);
|
throw new \Exception("Email address with " . $key . " could not be found", 404);
|
||||||
@@ -189,9 +190,9 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
* @param string $emailaddr
|
* @param string $emailaddr
|
||||||
* optional, the email-address
|
* optional, the email-address
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param boolean $iscatchall
|
* @param boolean $iscatchall
|
||||||
* optional
|
* optional
|
||||||
*
|
*
|
||||||
@@ -270,7 +271,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result = $this->apiCall('Emails.get', array(
|
$result = $this->apiCall('Emails.get', array(
|
||||||
'emailaddr' => $result['email_full']
|
'emailaddr' => $result['email_full']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -309,7 +310,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list email-addresses");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list email-addresses");
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -339,7 +340,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_emails']);
|
return $this->response(200, "successful", $result['num_emails']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,9 +352,9 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
* @param string $emailaddr
|
* @param string $emailaddr
|
||||||
* optional, the email-address
|
* optional, the email-address
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param boolean $delete_userfiles
|
* @param boolean $delete_userfiles
|
||||||
* optional, delete email data from filesystem, default: 0 (false)
|
* optional, delete email data from filesystem, default: 0 (false)
|
||||||
*
|
*
|
||||||
@@ -404,10 +405,6 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
Customers::decreaseUsage($customer['customerid'], 'email_forwarders_used', '', $number_forwarders);
|
Customers::decreaseUsage($customer['customerid'], 'email_forwarders_used', '', $number_forwarders);
|
||||||
Admins::decreaseUsage($customer['customerid'], 'email_forwarders_used', '', $number_forwarders);
|
Admins::decreaseUsage($customer['customerid'], 'email_forwarders_used', '', $number_forwarders);
|
||||||
|
|
||||||
if ($delete_userfiles) {
|
|
||||||
\Froxlor\System\Cronjob::inserttask('7', $customer['loginname'], $result['email_full']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete address
|
// delete address
|
||||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`= :customerid AND `id`= :id");
|
$stmt = Database::prepare("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`= :customerid AND `id`= :id");
|
||||||
Database::pexecute($stmt, array(
|
Database::pexecute($stmt, array(
|
||||||
@@ -417,6 +414,6 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
Customers::decreaseUsage($customer['customerid'], 'emails_used');
|
Customers::decreaseUsage($customer['customerid'], 'emails_used');
|
||||||
|
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted email address '" . $result['email_full'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted email address '" . $result['email_full'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$fpmdaemons[] = $row;
|
$fpmdaemons[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($fpmdaemons),
|
'count' => count($fpmdaemons),
|
||||||
'list' => $fpmdaemons
|
'list' => $fpmdaemons
|
||||||
));
|
));
|
||||||
@@ -93,7 +93,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_fpms']);
|
return $this->response(200, "successful", $result['num_fpms']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
@@ -121,7 +121,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
'id' => $id
|
'id' => $id
|
||||||
), true, true);
|
), true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("fpm-daemon with id #" . $id . " could not be found", 404);
|
throw new \Exception("fpm-daemon with id #" . $id . " could not be found", 404);
|
||||||
}
|
}
|
||||||
@@ -234,7 +234,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$result = $this->apiCall('FpmDaemons.get', array(
|
$result = $this->apiCall('FpmDaemons.get', array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -356,7 +356,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$result = $this->apiCall('FpmDaemons.get', array(
|
$result = $this->apiCall('FpmDaemons.get', array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -402,7 +402,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
|
|
||||||
\Froxlor\System\Cronjob::inserttask('1');
|
\Froxlor\System\Cronjob::inserttask('1');
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] fpm-daemon setting '" . $result['description'] . "' has been deleted by '" . $this->getUserDetail('loginname') . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] fpm-daemon setting '" . $result['description'] . "' has been deleted by '" . $this->getUserDetail('loginname') . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
// zum update schritt #1 -> download
|
// zum update schritt #1 -> download
|
||||||
if ($isnewerversion == 1) {
|
if ($isnewerversion == 1) {
|
||||||
$text = 'There is a newer version available: "' . $_version . '" (Your current version is: ' . $this->version . ')';
|
$text = 'There is a newer version available: "' . $_version . '" (Your current version is: ' . $this->version . ')';
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'isnewerversion' => $isnewerversion,
|
'isnewerversion' => $isnewerversion,
|
||||||
'version' => $_version,
|
'version' => $_version,
|
||||||
'message' => $text,
|
'message' => $text,
|
||||||
@@ -83,7 +83,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
));
|
));
|
||||||
} elseif ($isnewerversion == 0) {
|
} elseif ($isnewerversion == 0) {
|
||||||
// all good
|
// all good
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'isnewerversion' => $isnewerversion,
|
'isnewerversion' => $isnewerversion,
|
||||||
'version' => $version_label,
|
'version' => $version_label,
|
||||||
'message' => "",
|
'message' => "",
|
||||||
@@ -95,7 +95,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->response(300, "successfull", array(
|
return $this->response(300, "successful", array(
|
||||||
'isnewerversion' => 0,
|
'isnewerversion' => 0,
|
||||||
'version' => $this->version . $this->branding,
|
'version' => $this->version . $this->branding,
|
||||||
'message' => 'Version-check not available due to missing php-curl extension',
|
'message' => 'Version-check not available due to missing php-curl extension',
|
||||||
@@ -129,7 +129,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
\Froxlor\System\Cronjob::inserttask('4');
|
\Froxlor\System\Cronjob::inserttask('4');
|
||||||
// cron.d file
|
// cron.d file
|
||||||
\Froxlor\System\Cronjob::inserttask('99');
|
\Froxlor\System\Cronjob::inserttask('99');
|
||||||
return $this->response(200, "successfull", true);
|
return $this->response(200, "successful", true);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new \Exception($e->getMessage(), 406);
|
throw new \Exception($e->getMessage(), 406);
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
|
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "User " . $this->getUserDetail('loginname') . " exported settings");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "User " . $this->getUserDetail('loginname') . " exported settings");
|
||||||
$json_export = \Froxlor\SImExporter::export();
|
$json_export = \Froxlor\SImExporter::export();
|
||||||
return $this->response(200, "successfull", $json_export);
|
return $this->response(200, "successful", $json_export);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
'value' => $row['value']
|
'value' => $row['value']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -197,7 +197,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
{
|
{
|
||||||
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
|
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
|
||||||
$setting = $this->getParam('key');
|
$setting = $this->getParam('key');
|
||||||
return $this->response(200, "successfull", Settings::Get($setting));
|
return $this->response(200, "successful", Settings::Get($setting));
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -227,7 +227,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
throw new \Exception("Setting '" . $setting . "' could not be found");
|
throw new \Exception("Setting '" . $setting . "' could not be found");
|
||||||
}
|
}
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] Changing setting '" . $setting . "' from '" . $oldvalue . "' to '" . $value . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] Changing setting '" . $setting . "' from '" . $oldvalue . "' to '" . $value . "'");
|
||||||
return $this->response(200, "successfull", Settings::Set($setting, $value, true));
|
return $this->response(200, "successful", Settings::Set($setting, $value, true));
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -240,7 +240,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
*/
|
*/
|
||||||
public function generatePassword()
|
public function generatePassword()
|
||||||
{
|
{
|
||||||
return $this->response(200, "successfull", \Froxlor\System\Crypt::generatePassword());
|
return $this->response(200, "successful", \Froxlor\System\Crypt::generatePassword());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -256,7 +256,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
$integrity = new \Froxlor\Database\IntegrityCheck();
|
$integrity = new \Froxlor\Database\IntegrityCheck();
|
||||||
$result = $integrity->checkAll();
|
$result = $integrity->checkAll();
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", "OK");
|
return $this->response(200, "successful", "OK");
|
||||||
}
|
}
|
||||||
throw new \Exception("Some checks failed.", 406);
|
throw new \Exception("Some checks failed.", 406);
|
||||||
}
|
}
|
||||||
@@ -333,7 +333,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return the list
|
// return the list
|
||||||
return $this->response(200, "successfull", $functions);
|
return $this->response(200, "successful", $functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
* @param string $ftp_domain
|
* @param string $ftp_domain
|
||||||
* optional if customer.ftpatdomain is allowed, specify a domain (customer must be owner)
|
* optional if customer.ftpatdomain is allowed, specify a domain (customer must be owner)
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* required when called as admin, not needed when called as customer
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
|
* @param string $loginname
|
||||||
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
* @param array $additional_members
|
* @param array $additional_members
|
||||||
* optional whether to add additional usernames to the group
|
* optional whether to add additional usernames to the group
|
||||||
* @param bool $is_defaultuser
|
* @param bool $is_defaultuser
|
||||||
@@ -180,6 +182,17 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
), true, true);
|
), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create quotatallies entry if it not exists, refs #885
|
||||||
|
if ($result_stmt->rowCount() == 0) {
|
||||||
|
$stmt = Database::prepare("INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "`
|
||||||
|
(`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`)
|
||||||
|
VALUES (:name, 'user', '0', '0', '0', '0', '0', '0')
|
||||||
|
");
|
||||||
|
Database::pexecute($stmt, array(
|
||||||
|
"name" => $username
|
||||||
|
), true, true);
|
||||||
|
}
|
||||||
|
|
||||||
$group_upd_stmt = Database::prepare("
|
$group_upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_FTP_GROUPS . "`
|
UPDATE `" . TABLE_FTP_GROUPS . "`
|
||||||
SET `members` = CONCAT_WS(',',`members`, :username)
|
SET `members` = CONCAT_WS(',',`members`, :username)
|
||||||
@@ -268,7 +281,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
$result = $this->apiCall('Ftps.get', array(
|
$result = $this->apiCall('Ftps.get', array(
|
||||||
'username' => $username
|
'username' => $username
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("No more resources available", 406);
|
throw new \Exception("No more resources available", 406);
|
||||||
@@ -329,7 +342,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get ftp-user '" . $result['username'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get ftp-user '" . $result['username'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = ($id > 0 ? "id #" . $id : "username '" . $username . "'");
|
$key = ($id > 0 ? "id #" . $id : "username '" . $username . "'");
|
||||||
throw new \Exception("FTP user with " . $key . " could not be found", 404);
|
throw new \Exception("FTP user with " . $key . " could not be found", 404);
|
||||||
@@ -339,11 +352,11 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
* update a given ftp-user by id or username
|
* update a given ftp-user by id or username
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* optional, the customer-id
|
* optional, the ftp-user-id
|
||||||
* @param string $username
|
* @param string $username
|
||||||
* optional, the username
|
* optional, the username
|
||||||
* @param string $ftp_password
|
* @param string $ftp_password
|
||||||
* password for the created database and database-user
|
* optional, update password if specified
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* destination path relative to the customers-homedir
|
* destination path relative to the customers-homedir
|
||||||
* @param string $ftp_description
|
* @param string $ftp_description
|
||||||
@@ -351,7 +364,9 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
* @param string $shell
|
* @param string $shell
|
||||||
* optional, default /bin/false (not changeable when deactivated)
|
* optional, default /bin/false (not changeable when deactivated)
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* required when called as admin, not needed when called as customer
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
|
* @param string $loginname
|
||||||
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
*
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -454,7 +469,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
'username' => $result['username']
|
'username' => $result['username']
|
||||||
));
|
));
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] updated ftp-user '" . $result['username'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] updated ftp-user '" . $result['username'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -490,7 +505,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list ftp-users");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list ftp-users");
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -518,7 +533,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_ftps']);
|
return $this->response(200, "successful", $result['num_ftps']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -626,6 +641,6 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
Customers::decreaseUsage($customer_data['customerid'], 'ftps_used', $resetaccnumber);
|
Customers::decreaseUsage($customer_data['customerid'], 'ftps_used', $resetaccnumber);
|
||||||
|
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] deleted ftp-user '" . $result['username'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] deleted ftp-user '" . $result['username'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -85,7 +85,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
}
|
}
|
||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_plans']);
|
return $this->response(200, "successful", $result['num_plans']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
@@ -120,7 +120,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get hosting-plan '" . $result['name'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get hosting-plan '" . $result['name'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = ($id > 0 ? "id #" . $id : "planname '" . $planname . "'");
|
$key = ($id > 0 ? "id #" . $id : "planname '" . $planname . "'");
|
||||||
throw new \Exception("Hosting-plan with " . $key . " could not be found", 404);
|
throw new \Exception("Hosting-plan with " . $key . " could not be found", 404);
|
||||||
@@ -246,7 +246,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
$result = $this->apiCall('HostingPlans.get', array(
|
$result = $this->apiCall('HostingPlans.get', array(
|
||||||
'planname' => $name
|
'planname' => $name
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -393,7 +393,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
);
|
);
|
||||||
Database::pexecute($upd_stmt, $update_data, true, true);
|
Database::pexecute($upd_stmt, $update_data, true, true);
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] updated hosting-plan '" . $result['name'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] updated hosting-plan '" . $result['name'] . "'");
|
||||||
return $this->response(200, "successfull", $update_data);
|
return $this->response(200, "successful", $update_data);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -431,7 +431,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
|
|||||||
'id' => $id
|
'id' => $id
|
||||||
), true, true);
|
), true, true);
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted hosting-plan '" . $result['name'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted hosting-plan '" . $result['name'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,12 +51,12 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$query_fields = array();
|
$query_fields = array();
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $ip_where . $this->getSearchWhere($query_fields, $append_where) . $this->getOrderBy() . $this->getLimit());
|
SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $ip_where . $this->getSearchWhere($query_fields, $append_where) . $this->getOrderBy() . $this->getLimit());
|
||||||
Database::pexecute($result_stmt, null, true, true);
|
Database::pexecute($result_stmt, $query_fields, true, true);
|
||||||
$result = array();
|
$result = array();
|
||||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -82,7 +82,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
SELECT COUNT(*) as num_ips FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $ip_where);
|
SELECT COUNT(*) as num_ips FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $ip_where);
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_ips']);
|
return $this->response(200, "successful", $result['num_ips']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
@@ -116,7 +116,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
), true, true);
|
), true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get ip " . $result['ip'] . " " . $result['port']);
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get ip " . $result['ip'] . " " . $result['port']);
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("IP/port with id #" . $id . " could not be found", 404);
|
throw new \Exception("IP/port with id #" . $id . " could not be found", 404);
|
||||||
}
|
}
|
||||||
@@ -171,17 +171,17 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
|
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
|
||||||
|
|
||||||
$ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip'), false, 'invalidip', false, true, false, false, true);
|
$ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip'), false, 'invalidip', false, true, false, false, true);
|
||||||
$port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, 80), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array(
|
$port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, 80), 'port', \Froxlor\Validate\Validate::REGEX_PORT, array(
|
||||||
'stringisempty',
|
'stringisempty',
|
||||||
'myport'
|
'myport'
|
||||||
), array(), true);
|
), array(), true);
|
||||||
$listen_statement = ! empty($this->getBoolParam('listen_statement', true, 0)) ? 1 : 0;
|
$listen_statement = ! empty($this->getBoolParam('listen_statement', true, 0)) ? 1 : 0;
|
||||||
$namevirtualhost_statement = ! empty($this->getBoolParam('namevirtualhost_statement', true, 0)) ? 1 : 0;
|
$namevirtualhost_statement = ! empty($this->getBoolParam('namevirtualhost_statement', true, 0)) ? 1 : 0;
|
||||||
$vhostcontainer = ! empty($this->getBoolParam('vhostcontainer', true, 0)) ? 1 : 0;
|
$vhostcontainer = ! empty($this->getBoolParam('vhostcontainer', true, 0)) ? 1 : 0;
|
||||||
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('specialsettings', true, '')), 'specialsettings', '/^[^\0]*$/', '', array(), true);
|
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('specialsettings', true, '')), 'specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$vhostcontainer_servername_statement = ! empty($this->getBoolParam('vhostcontainer_servername_statement', true, 1)) ? 1 : 0;
|
$vhostcontainer_servername_statement = ! empty($this->getBoolParam('vhostcontainer_servername_statement', true, 1)) ? 1 : 0;
|
||||||
$default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('default_vhostconf_domain', true, '')), 'default_vhostconf_domain', '/^[^\0]*$/', '', array(), true);
|
$default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('default_vhostconf_domain', true, '')), 'default_vhostconf_domain', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$docroot = \Froxlor\Validate\Validate::validate($this->getParam('docroot', true, ''), 'docroot', '', '', array(), true);
|
$docroot = \Froxlor\Validate\Validate::validate($this->getParam('docroot', true, ''), 'docroot', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
|
||||||
|
|
||||||
if ((int) Settings::Get('system.use_ssl') == 1) {
|
if ((int) Settings::Get('system.use_ssl') == 1) {
|
||||||
$ssl = ! empty($this->getBoolParam('ssl', true, 0)) ? intval($this->getBoolParam('ssl', true, 0)) : 0;
|
$ssl = ! empty($this->getBoolParam('ssl', true, 0)) ? intval($this->getBoolParam('ssl', true, 0)) : 0;
|
||||||
@@ -189,9 +189,9 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$ssl_key_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_key_file', $ssl, ''), 'ssl_key_file', '', '', array(), true);
|
$ssl_key_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_key_file', $ssl, ''), 'ssl_key_file', '', '', array(), true);
|
||||||
$ssl_ca_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_ca_file', true, ''), 'ssl_ca_file', '', '', array(), true);
|
$ssl_ca_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_ca_file', true, ''), 'ssl_ca_file', '', '', array(), true);
|
||||||
$ssl_cert_chainfile = \Froxlor\Validate\Validate::validate($this->getParam('ssl_cert_chainfile', true, ''), 'ssl_cert_chainfile', '', '', array(), true);
|
$ssl_cert_chainfile = \Froxlor\Validate\Validate::validate($this->getParam('ssl_cert_chainfile', true, ''), 'ssl_cert_chainfile', '', '', array(), true);
|
||||||
$ssl_specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_specialsettings', true, '')), 'ssl_specialsettings', '/^[^\0]*$/', '', array(), true);
|
$ssl_specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_specialsettings', true, '')), 'ssl_specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$include_specialsettings = ! empty($this->getBoolParam('include_specialsettings', true, 0)) ? 1 : 0;
|
$include_specialsettings = ! empty($this->getBoolParam('include_specialsettings', true, 0)) ? 1 : 0;
|
||||||
$ssl_default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_default_vhostconf_domain', true, '')), 'ssl_default_vhostconf_domain', '/^[^\0]*$/', '', array(), true);
|
$ssl_default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_default_vhostconf_domain', true, '')), 'ssl_default_vhostconf_domain', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$include_default_vhostconf_domain = ! empty($this->getBoolParam('include_default_vhostconf_domain', true, 0)) ? 1 : 0;
|
$include_default_vhostconf_domain = ! empty($this->getBoolParam('include_default_vhostconf_domain', true, 0)) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
$ssl = 0;
|
$ssl = 0;
|
||||||
@@ -307,7 +307,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$result = $this->apiCall('IpsAndPorts.get', array(
|
$result = $this->apiCall('IpsAndPorts.get', array(
|
||||||
'id' => $ins_data['id']
|
'id' => $ins_data['id']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -368,17 +368,17 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
));
|
));
|
||||||
|
|
||||||
$ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip', true, $result['ip']), false, 'invalidip', false, true, false, false, true);
|
$ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip', true, $result['ip']), false, 'invalidip', false, true, false, false, true);
|
||||||
$port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, $result['port']), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array(
|
$port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, $result['port']), 'port', \Froxlor\Validate\Validate::REGEX_PORT, array(
|
||||||
'stringisempty',
|
'stringisempty',
|
||||||
'myport'
|
'myport'
|
||||||
), array(), true);
|
), array(), true);
|
||||||
$listen_statement = $this->getBoolParam('listen_statement', true, $result['listen_statement']);
|
$listen_statement = $this->getBoolParam('listen_statement', true, $result['listen_statement']);
|
||||||
$namevirtualhost_statement = $this->getBoolParam('namevirtualhost_statement', true, $result['namevirtualhost_statement']);
|
$namevirtualhost_statement = $this->getBoolParam('namevirtualhost_statement', true, $result['namevirtualhost_statement']);
|
||||||
$vhostcontainer = $this->getBoolParam('vhostcontainer', true, $result['vhostcontainer']);
|
$vhostcontainer = $this->getBoolParam('vhostcontainer', true, $result['vhostcontainer']);
|
||||||
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('specialsettings', true, $result['specialsettings'])), 'specialsettings', '/^[^\0]*$/', '', array(), true);
|
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('specialsettings', true, $result['specialsettings'])), 'specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$vhostcontainer_servername_statement = $this->getParam('vhostcontainer_servername_statement', true, $result['vhostcontainer_servername_statement']);
|
$vhostcontainer_servername_statement = $this->getParam('vhostcontainer_servername_statement', true, $result['vhostcontainer_servername_statement']);
|
||||||
$default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('default_vhostconf_domain', true, $result['default_vhostconf_domain'])), 'default_vhostconf_domain', '/^[^\0]*$/', '', array(), true);
|
$default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('default_vhostconf_domain', true, $result['default_vhostconf_domain'])), 'default_vhostconf_domain', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$docroot = \Froxlor\Validate\Validate::validate($this->getParam('docroot', true, $result['docroot']), 'docroot', '', '', array(), true);
|
$docroot = \Froxlor\Validate\Validate::validate($this->getParam('docroot', true, $result['docroot']), 'docroot', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
|
||||||
|
|
||||||
if ((int) Settings::Get('system.use_ssl') == 1) {
|
if ((int) Settings::Get('system.use_ssl') == 1) {
|
||||||
$ssl = $this->getBoolParam('ssl', true, $result['ssl']);
|
$ssl = $this->getBoolParam('ssl', true, $result['ssl']);
|
||||||
@@ -386,9 +386,9 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$ssl_key_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_key_file', $ssl, $result['ssl_key_file']), 'ssl_key_file', '', '', array(), true);
|
$ssl_key_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_key_file', $ssl, $result['ssl_key_file']), 'ssl_key_file', '', '', array(), true);
|
||||||
$ssl_ca_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_ca_file', true, $result['ssl_ca_file']), 'ssl_ca_file', '', '', array(), true);
|
$ssl_ca_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_ca_file', true, $result['ssl_ca_file']), 'ssl_ca_file', '', '', array(), true);
|
||||||
$ssl_cert_chainfile = \Froxlor\Validate\Validate::validate($this->getParam('ssl_cert_chainfile', true, $result['ssl_cert_chainfile']), 'ssl_cert_chainfile', '', '', array(), true);
|
$ssl_cert_chainfile = \Froxlor\Validate\Validate::validate($this->getParam('ssl_cert_chainfile', true, $result['ssl_cert_chainfile']), 'ssl_cert_chainfile', '', '', array(), true);
|
||||||
$ssl_specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_specialsettings', true, $result['ssl_specialsettings'])), 'ssl_specialsettings', '/^[^\0]*$/', '', array(), true);
|
$ssl_specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_specialsettings', true, $result['ssl_specialsettings'])), 'ssl_specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$include_specialsettings = $this->getBoolParam('include_specialsettings', true, $result['include_specialsettings']);
|
$include_specialsettings = $this->getBoolParam('include_specialsettings', true, $result['include_specialsettings']);
|
||||||
$ssl_default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_default_vhostconf_domain', true, $result['ssl_default_vhostconf_domain'])), 'ssl_default_vhostconf_domain', '/^[^\0]*$/', '', array(), true);
|
$ssl_default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_default_vhostconf_domain', true, $result['ssl_default_vhostconf_domain'])), 'ssl_default_vhostconf_domain', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||||
$include_default_vhostconf_domain = $this->getBoolParam('include_default_vhostconf_domain', true, $result['include_default_vhostconf_domain']);
|
$include_default_vhostconf_domain = $this->getBoolParam('include_default_vhostconf_domain', true, $result['include_default_vhostconf_domain']);
|
||||||
} else {
|
} else {
|
||||||
$ssl = 0;
|
$ssl = 0;
|
||||||
@@ -514,7 +514,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$result = $this->apiCall('IpsAndPorts.get', array(
|
$result = $this->apiCall('IpsAndPorts.get', array(
|
||||||
'id' => $result['id']
|
'id' => $result['id']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
@@ -583,7 +583,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
\Froxlor\System\Cronjob::inserttask('4');
|
\Froxlor\System\Cronjob::inserttask('4');
|
||||||
|
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted IP/port '" . $result['ip'] . ":" . $result['port'] . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted IP/port '" . $result['ip'] . ":" . $result['port'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
} else {
|
} else {
|
||||||
\Froxlor\UI\Response::standard_error('cantdeletesystemip', '', true);
|
\Froxlor\UI\Response::standard_error('cantdeletesystemip', '', true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
* @param bool $sendinfomail
|
* @param bool $sendinfomail
|
||||||
* optional, send created resource-information to customer, default: false
|
* optional, send created resource-information to customer, default: false
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
*
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -169,7 +169,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result = $this->apiCall('Mysqls.get', array(
|
$result = $this->apiCall('Mysqls.get', array(
|
||||||
'dbname' => $username
|
'dbname' => $username
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -258,7 +258,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
Database::needRoot(false);
|
Database::needRoot(false);
|
||||||
$result['size'] = $mbdata['MB'] ?? 0;
|
$result['size'] = $mbdata['MB'] ?? 0;
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get database '" . $result['databasename'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get database '" . $result['databasename'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = ($id > 0 ? "id #" . $id : "dbname '" . $dbname . "'");
|
$key = ($id > 0 ? "id #" . $id : "dbname '" . $dbname . "'");
|
||||||
throw new \Exception("MySQL database with " . $key . " could not be found", 404);
|
throw new \Exception("MySQL database with " . $key . " could not be found", 404);
|
||||||
@@ -278,9 +278,9 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
* @param string $description
|
* @param string $description
|
||||||
* optional, description for database
|
* optional, description for database
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
*
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -307,7 +307,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
|
|
||||||
// paramters
|
// paramters
|
||||||
$password = $this->getParam('mysql_password', true, '');
|
$password = $this->getParam('mysql_password', true, '');
|
||||||
$databasedescription = $this->getParam('description', true, '');
|
$databasedescription = $this->getParam('description', true, $result['description']);
|
||||||
|
|
||||||
// validation
|
// validation
|
||||||
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
|
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
|
||||||
@@ -350,7 +350,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result = $this->apiCall('Mysqls.get', array(
|
$result = $this->apiCall('Mysqls.get', array(
|
||||||
'dbname' => $result['databasename']
|
'dbname' => $result['databasename']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -421,7 +421,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
Database::needRoot(false);
|
Database::needRoot(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -448,7 +448,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_dbs']);
|
return $this->response(200, "successful", $result['num_dbs']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,9 +462,9 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
* @param int $mysql_server
|
* @param int $mysql_server
|
||||||
* optional, specify database-server, default is none
|
* optional, specify database-server, default is none
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* optional, admin-only, the customer-id
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
* @param string $loginname
|
* @param string $loginname
|
||||||
* optional, admin-only, the loginname
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
*
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -510,6 +510,6 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
Customers::decreaseUsage($customer['customerid'], 'mysqls_used', $resetaccnumber);
|
Customers::decreaseUsage($customer['customerid'], 'mysqls_used', $resetaccnumber);
|
||||||
|
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] deleted database '" . $result['databasename'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] deleted database '" . $result['databasename'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$phpconfigs[] = $row;
|
$phpconfigs[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($phpconfigs),
|
'count' => count($phpconfigs),
|
||||||
'list' => $phpconfigs
|
'list' => $phpconfigs
|
||||||
));
|
));
|
||||||
@@ -137,7 +137,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_phps']);
|
return $this->response(200, "successful", $result['num_phps']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
@@ -165,7 +165,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
'id' => $id
|
'id' => $id
|
||||||
), true, true);
|
), true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("php-config with id #" . $id . " could not be found", 404);
|
throw new \Exception("php-config with id #" . $id . " could not be found", 404);
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$result = $this->apiCall('PhpSettings.get', array(
|
$result = $this->apiCall('PhpSettings.get', array(
|
||||||
'id' => $ins_data['id']
|
'id' => $ins_data['id']
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -563,7 +563,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
$result = $this->apiCall('PhpSettings.get', array(
|
$result = $this->apiCall('PhpSettings.get', array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
@@ -614,7 +614,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
|
|
||||||
\Froxlor\System\Cronjob::inserttask('1');
|
\Froxlor\System\Cronjob::inserttask('1');
|
||||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] php setting '" . $result['description'] . "' has been deleted by '" . $this->getUserDetail('loginname') . "'");
|
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] php setting '" . $result['description'] . "' has been deleted by '" . $this->getUserDetail('loginname') . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* @param string $url
|
* @param string $url
|
||||||
* optional, overwrites path value with an URL to generate a redirect, alternatively use the path parameter also for URLs
|
* optional, overwrites path value with an URL to generate a redirect, alternatively use the path parameter also for URLs
|
||||||
* @param int $openbasedir_path
|
* @param int $openbasedir_path
|
||||||
* optional, either 0 for customers-homedir or 1 for domains-docroot
|
* optional, either 0 for domains-docroot or 1 for customers-homedir
|
||||||
* @param int $phpsettingid
|
* @param int $phpsettingid
|
||||||
* optional, php-settings-id, if empty the $domain value is used
|
* optional, php-settings-id, if empty the $domain value is used
|
||||||
* @param int $redirectcode
|
* @param int $redirectcode
|
||||||
@@ -56,7 +56,9 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* @param bool $hsts_preload
|
* @param bool $hsts_preload
|
||||||
* optional whether or not to preload HSTS header value, default 0
|
* optional whether or not to preload HSTS header value, default 0
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* required when called as admin, not needed when called as customer
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
|
* @param string $loginname
|
||||||
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
*
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -345,7 +347,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$result = $this->apiCall('SubDomains.get', array(
|
$result = $this->apiCall('SubDomains.get', array(
|
||||||
'id' => $subdomain_id
|
'id' => $subdomain_id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
throw new \Exception("No more resources available", 406);
|
throw new \Exception("No more resources available", 406);
|
||||||
}
|
}
|
||||||
@@ -409,7 +411,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Settings::IsInList('panel.customer_hide_options', 'domains')) {
|
if (! $this->isInternal() && Settings::IsInList('panel.customer_hide_options', 'domains')) {
|
||||||
throw new \Exception("You cannot access this resource", 405);
|
throw new \Exception("You cannot access this resource", 405);
|
||||||
}
|
}
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
@@ -426,7 +428,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get subdomain '" . $result['domain'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get subdomain '" . $result['domain'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
$key = ($id > 0 ? "id #" . $id : "domainname '" . $domainname . "'");
|
$key = ($id > 0 ? "id #" . $id : "domainname '" . $domainname . "'");
|
||||||
throw new \Exception("Subdomain with " . $key . " could not be found", 404);
|
throw new \Exception("Subdomain with " . $key . " could not be found", 404);
|
||||||
@@ -450,7 +452,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* @param bool $isemaildomain
|
* @param bool $isemaildomain
|
||||||
* optional
|
* optional
|
||||||
* @param int $openbasedir_path
|
* @param int $openbasedir_path
|
||||||
* optional, either 0 for customers-homedir or 1 for domains-docroot
|
* optional, either 0 for domains-docroot or 1 for customers-homedir
|
||||||
* @param int $phpsettingid
|
* @param int $phpsettingid
|
||||||
* optional, php-settings-id, if empty the $domain value is used
|
* optional, php-settings-id, if empty the $domain value is used
|
||||||
* @param int $redirectcode
|
* @param int $redirectcode
|
||||||
@@ -470,7 +472,9 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* @param bool $hsts_preload
|
* @param bool $hsts_preload
|
||||||
* optional whether or not to preload HSTS header value
|
* optional whether or not to preload HSTS header value
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
* required when called as admin, not needed when called as customer
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
|
* @param string $loginname
|
||||||
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
*
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@@ -683,6 +687,8 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
Database::pexecute($del_stmt, array(
|
Database::pexecute($del_stmt, array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
), true, true);
|
), true, true);
|
||||||
|
// remove domain from acme.sh / lets encrypt if used
|
||||||
|
\Froxlor\System\Cronjob::inserttask('12', $result['domain']);
|
||||||
}
|
}
|
||||||
|
|
||||||
\Froxlor\System\Cronjob::inserttask('1');
|
\Froxlor\System\Cronjob::inserttask('1');
|
||||||
@@ -693,7 +699,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
$result = $this->apiCall('SubDomains.get', array(
|
$result = $this->apiCall('SubDomains.get', array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -797,7 +803,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
while ($row = $domains_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $domains_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -862,7 +868,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
");
|
");
|
||||||
$result = Database::pexecute_first($domains_stmt, null, true, true);
|
$result = Database::pexecute_first($domains_stmt, null, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_subdom']);
|
return $this->response(200, "successful", $result['num_subdom']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -873,7 +879,11 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
* optional, the domain-id
|
* optional, the domain-id
|
||||||
* @param string $domainname
|
* @param string $domainname
|
||||||
* optional, the domainname
|
* optional, the domainname
|
||||||
*
|
* @param int $customerid
|
||||||
|
* optional, required when called as admin (if $loginname is not specified)
|
||||||
|
* @param string $loginname
|
||||||
|
* optional, required when called as admin (if $customerid is not specified)
|
||||||
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
* @return string json-encoded array
|
* @return string json-encoded array
|
||||||
@@ -976,7 +986,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
Customers::decreaseUsage($customer['customerid'], 'subdomains_used');
|
Customers::decreaseUsage($customer['customerid'], 'subdomains_used');
|
||||||
|
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] deleted subdomain '" . $result['domain'] . "'");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] deleted subdomain '" . $result['domain'] . "'");
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successful", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list log-entries");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list log-entries");
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
@@ -129,7 +129,7 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
|
|
||||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->response(200, "successfull", $result['num_logs']);
|
return $this->response(200, "successful", $result['num_logs']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$params['trunc'] = $truncatedate;
|
$params['trunc'] = $truncatedate;
|
||||||
Database::pexecute($result_stmt, $params, true, true);
|
Database::pexecute($result_stmt, $params, true, true);
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] truncated the froxlor syslog");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] truncated the froxlor syslog");
|
||||||
return $this->response(200, "successfull", true);
|
return $this->response(200, "successful", true);
|
||||||
}
|
}
|
||||||
throw new \Exception("Not allowed to execute given command.", 403);
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ class Traffic extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
* optional, default empty
|
* optional, default empty
|
||||||
* @param int $day
|
* @param int $day
|
||||||
* optional, default empty
|
* optional, default empty
|
||||||
|
* @param int $date_from
|
||||||
|
* optional timestamp, default empty, if specified, $year, $month and $day will be ignored
|
||||||
|
* @param int $date_until
|
||||||
|
* optional timestamp, default empty, if specified, $year, $month and $day will be ignored
|
||||||
* @param bool $customer_traffic
|
* @param bool $customer_traffic
|
||||||
* optional, admin-only, whether to output ones own traffic or all of ones customers, default is 0 (false)
|
* optional, admin-only, whether to output ones own traffic or all of ones customers, default is 0 (false)
|
||||||
* @param int $customerid
|
* @param int $customerid
|
||||||
@@ -76,10 +80,29 @@ class Traffic extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
$year = $this->getParam('year', true, "");
|
$year = $this->getParam('year', true, "");
|
||||||
$month = $this->getParam('month', true, "");
|
$month = $this->getParam('month', true, "");
|
||||||
$day = $this->getParam('day', true, "");
|
$day = $this->getParam('day', true, "");
|
||||||
|
$date_from = $this->getParam('date_from', true, - 1);
|
||||||
|
$date_until = $this->getParam('date_until', true, - 1);
|
||||||
$customer_traffic = $this->getBoolParam('customer_traffic', true, 0);
|
$customer_traffic = $this->getBoolParam('customer_traffic', true, 0);
|
||||||
$customer_ids = $this->getAllowedCustomerIds();
|
$customer_ids = $this->getAllowedCustomerIds();
|
||||||
$result = array();
|
$result = array();
|
||||||
$params = array();
|
$params = array();
|
||||||
|
|
||||||
|
// validate parameters
|
||||||
|
if ($date_from >= 0 || $date_until >= 0) {
|
||||||
|
$year = "";
|
||||||
|
$month = "";
|
||||||
|
$day = "";
|
||||||
|
if ($date_from == $date_until) {
|
||||||
|
$date_until = -1;
|
||||||
|
}
|
||||||
|
if ($date_from >= 0 && $date_until >= 0 && $date_until < $date_from) {
|
||||||
|
// switch
|
||||||
|
$temp_ts = $date_from;
|
||||||
|
$date_from = $date_until;
|
||||||
|
$date_until = $temp_ts;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check for year/month/day
|
// check for year/month/day
|
||||||
$where_str = "";
|
$where_str = "";
|
||||||
if (! empty($year) && is_numeric($year)) {
|
if (! empty($year) && is_numeric($year)) {
|
||||||
@@ -94,6 +117,17 @@ class Traffic extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
$where_str .= " AND `day` = :day";
|
$where_str .= " AND `day` = :day";
|
||||||
$params['day'] = $day;
|
$params['day'] = $day;
|
||||||
}
|
}
|
||||||
|
if ($date_from >= 0 && $date_until >= 0) {
|
||||||
|
$where_str .= " AND `stamp` BETWEEN :df AND :du";
|
||||||
|
$params['df'] = $date_from;
|
||||||
|
$params['du'] = $date_until;
|
||||||
|
} elseif ($date_from >= 0 && $date_until < 0) {
|
||||||
|
$where_str .= " AND `stamp` > :df";
|
||||||
|
$params['df'] = $date_from;
|
||||||
|
} elseif ($date_from < 0 && $date_until >= 0) {
|
||||||
|
$where_str .= " AND `stamp` < :du";
|
||||||
|
$params['du'] = $date_until;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $this->isAdmin() || ($this->isAdmin() && $customer_traffic)) {
|
if (! $this->isAdmin() || ($this->isAdmin() && $customer_traffic)) {
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
@@ -110,7 +144,7 @@ class Traffic extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
$result[] = $row;
|
$result[] = $row;
|
||||||
}
|
}
|
||||||
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list traffic");
|
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] list traffic");
|
||||||
return $this->response(200, "successfull", array(
|
return $this->response(200, "successful", array(
|
||||||
'count' => count($result),
|
'count' => count($result),
|
||||||
'list' => $result
|
'list' => $result
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -35,20 +35,6 @@ abstract class BulkAction
|
|||||||
*/
|
*/
|
||||||
private $impFile = null;
|
private $impFile = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* customer id of the user the entity is being added to
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
private $custId = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* array of customer data read from the database
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
private $custData = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* api-function to call for addingg entity
|
* api-function to call for addingg entity
|
||||||
*
|
*
|
||||||
@@ -70,20 +56,27 @@ abstract class BulkAction
|
|||||||
*/
|
*/
|
||||||
private $errors = array();
|
private $errors = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* logged in user
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $userinfo = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class constructor, optionally sets file and customer-id
|
* class constructor, optionally sets file and customer-id
|
||||||
*
|
*
|
||||||
* @param string $import_file
|
* @param string $import_file
|
||||||
* @param int $customer_id
|
* @param array $userinfo
|
||||||
*
|
*
|
||||||
* @return object BulkAction instance
|
* @return object BulkAction instance
|
||||||
*/
|
*/
|
||||||
protected function __construct($import_file = null, $customer_id = 0)
|
protected function __construct($import_file = null, $userinfo = array())
|
||||||
{
|
{
|
||||||
if (! empty($import_file)) {
|
if (! empty($import_file)) {
|
||||||
$this->impFile = \Froxlor\FileDir::makeCorrectFile($import_file);
|
$this->impFile = \Froxlor\FileDir::makeCorrectFile($import_file);
|
||||||
}
|
}
|
||||||
$this->custId = $customer_id;
|
$this->userinfo = $userinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -109,18 +102,6 @@ abstract class BulkAction
|
|||||||
$this->impFile = \Froxlor\FileDir::makeCorrectFile($import_file);
|
$this->impFile = \Froxlor\FileDir::makeCorrectFile($import_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* setter for customer-id
|
|
||||||
*
|
|
||||||
* @param int $customer_id
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setCustomer($customer_id = 0)
|
|
||||||
{
|
|
||||||
$this->custId = $customer_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return the list of errors
|
* return the list of errors
|
||||||
*
|
*
|
||||||
@@ -145,7 +126,7 @@ abstract class BulkAction
|
|||||||
|
|
||||||
protected function importEntity($data_array = null)
|
protected function importEntity($data_array = null)
|
||||||
{
|
{
|
||||||
global $userinfo;
|
if (empty($data_array)) return null;
|
||||||
|
|
||||||
$module = '\\Froxlor\\Api\\Commands\\' . substr($this->api_call, 0, strpos($this->api_call, "."));
|
$module = '\\Froxlor\\Api\\Commands\\' . substr($this->api_call, 0, strpos($this->api_call, "."));
|
||||||
$function = substr($this->api_call, strpos($this->api_call, ".") + 1);
|
$function = substr($this->api_call, strpos($this->api_call, ".") + 1);
|
||||||
@@ -159,7 +140,7 @@ abstract class BulkAction
|
|||||||
|
|
||||||
$result = null;
|
$result = null;
|
||||||
try {
|
try {
|
||||||
$json_result = $module::getLocal($userinfo, $new_data)->$function();
|
$json_result = $module::getLocal($this->userinfo, $new_data)->$function();
|
||||||
$result = json_decode($json_result, true)['data'];
|
$result = json_decode($json_result, true)['data'];
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->errors[] = $e->getMessage();
|
$this->errors[] = $e->getMessage();
|
||||||
@@ -189,6 +170,10 @@ abstract class BulkAction
|
|||||||
throw new \Exception("Unable to read file '" . $this->impFile . "'");
|
throw new \Exception("Unable to read file '" . $this->impFile . "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($separator) || strlen($separator) != 1) {
|
||||||
|
throw new \Exception("Invalid separator specified: '" . $separator . "'");
|
||||||
|
}
|
||||||
|
|
||||||
$file_data = array();
|
$file_data = array();
|
||||||
$is_params_line = true;
|
$is_params_line = true;
|
||||||
$fh = @fopen($this->impFile, "r");
|
$fh = @fopen($this->impFile, "r");
|
||||||
@@ -218,37 +203,4 @@ abstract class BulkAction
|
|||||||
return $file_data;
|
return $file_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* to be called first in doImport() to read in customer and entity data
|
|
||||||
*/
|
|
||||||
protected function preImport()
|
|
||||||
{
|
|
||||||
$this->readCustomerData();
|
|
||||||
|
|
||||||
if ($this->custId <= 0) {
|
|
||||||
throw new \Exception("Invalid customer selected");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_null($this->custData)) {
|
|
||||||
throw new \Exception("Failed to read customer data");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* reads customer data from panel_customer by $_custId
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
protected function readCustomerData()
|
|
||||||
{
|
|
||||||
$cust_stmt = \Froxlor\Database\Database::prepare("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid` = :cid");
|
|
||||||
$this->custData = \Froxlor\Database\Database::pexecute_first($cust_stmt, array(
|
|
||||||
'cid' => $this->custId
|
|
||||||
));
|
|
||||||
if (is_array($this->custData) && isset($this->custData['customerid']) && $this->custData['customerid'] == $this->custId) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
$this->custData = null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ class DomainBulkAction extends BulkAction
|
|||||||
*
|
*
|
||||||
* @return object DomainBulkAction instance
|
* @return object DomainBulkAction instance
|
||||||
*/
|
*/
|
||||||
public function __construct($import_file = null, $customer_id = 0)
|
public function __construct($import_file = null, $userinfo)
|
||||||
{
|
{
|
||||||
parent::__construct($import_file, $customer_id);
|
parent::__construct($import_file, $userinfo);
|
||||||
$this->setApiCall('Domains.add');
|
$this->setApiCall('Domains.add');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,23 +49,14 @@ class DomainBulkAction extends BulkAction
|
|||||||
*/
|
*/
|
||||||
public function doImport($separator = ";", $offset = 0)
|
public function doImport($separator = ";", $offset = 0)
|
||||||
{
|
{
|
||||||
$this->preImport();
|
if ($this->userinfo['domains'] == "-1") {
|
||||||
|
|
||||||
// get the admins userinfo to check for domains_used, etc.
|
|
||||||
global $userinfo;
|
|
||||||
|
|
||||||
if ($userinfo['domains'] == "-1") {
|
|
||||||
$dom_unlimited = true;
|
$dom_unlimited = true;
|
||||||
} else {
|
} else {
|
||||||
$dom_unlimited = false;
|
$dom_unlimited = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$domains_used = (int) $userinfo['domains_used'];
|
$domains_used = (int) $this->userinfo['domains_used'];
|
||||||
$domains_avail = (int) $userinfo['domains'];
|
$domains_avail = (int) $this->userinfo['domains'];
|
||||||
|
|
||||||
if (empty($separator) || strlen($separator) != 1) {
|
|
||||||
throw new \Exception("Invalid separator specified: '" . $separator . "'");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! is_int($offset) || $offset < 0) {
|
if (! is_int($offset) || $offset < 0) {
|
||||||
throw new \Exception("Invalid offset specified");
|
throw new \Exception("Invalid offset specified");
|
||||||
|
|||||||
@@ -26,11 +26,16 @@ class ConfigServicesAction extends \Froxlor\Cli\Action
|
|||||||
*/
|
*/
|
||||||
private function validate()
|
private function validate()
|
||||||
{
|
{
|
||||||
|
global $lng;
|
||||||
|
|
||||||
$this->checkConfigParam(true);
|
$this->checkConfigParam(true);
|
||||||
$this->parseConfig();
|
$this->parseConfig();
|
||||||
|
|
||||||
require FROXLOR_INSTALL_DIR . '/lib/tables.inc.php';
|
require FROXLOR_INSTALL_DIR . '/lib/tables.inc.php';
|
||||||
|
|
||||||
|
include_once FROXLOR_INSTALL_DIR . '/lng/english.lng.php';
|
||||||
|
include_once FROXLOR_INSTALL_DIR . '/lng/lng_references.php';
|
||||||
|
|
||||||
if (array_key_exists("import-settings", $this->_args)) {
|
if (array_key_exists("import-settings", $this->_args)) {
|
||||||
$this->importSettings();
|
$this->importSettings();
|
||||||
}
|
}
|
||||||
@@ -78,6 +83,20 @@ class ConfigServicesAction extends \Froxlor\Cli\Action
|
|||||||
$distros = glob($config_dir . '*.xml');
|
$distros = glob($config_dir . '*.xml');
|
||||||
// tmp array
|
// tmp array
|
||||||
$distributions_select_data = array();
|
$distributions_select_data = array();
|
||||||
|
|
||||||
|
//set default os.
|
||||||
|
$os_dist = array('ID' => 'buster');
|
||||||
|
$os_version = array('0' => '10');
|
||||||
|
$os_default = $os_dist['ID'];
|
||||||
|
|
||||||
|
//read os-release
|
||||||
|
if(file_exists('/etc/os-release')) {
|
||||||
|
$os_dist = parse_ini_file('/etc/os-release', false);
|
||||||
|
if(is_array($os_dist) && array_key_exists('ID', $os_dist) && array_key_exists('VERSION_ID', $os_dist)) {
|
||||||
|
$os_version = explode('.',$os_dist['VERSION_ID'])[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// read in all the distros
|
// read in all the distros
|
||||||
foreach ($distros as $_distribution) {
|
foreach ($distros as $_distribution) {
|
||||||
// get configparser object
|
// get configparser object
|
||||||
@@ -86,6 +105,12 @@ class ConfigServicesAction extends \Froxlor\Cli\Action
|
|||||||
$dist_display = $this->getCompleteDistroName($dist);
|
$dist_display = $this->getCompleteDistroName($dist);
|
||||||
// store in tmp array
|
// store in tmp array
|
||||||
$distributions_select_data[$dist_display] = str_replace(".xml", "", strtolower(basename($_distribution)));
|
$distributions_select_data[$dist_display] = str_replace(".xml", "", strtolower(basename($_distribution)));
|
||||||
|
|
||||||
|
//guess if this is the current distro.
|
||||||
|
$ver = explode('.', $dist->distributionVersion)[0];
|
||||||
|
if (strtolower($os_dist['ID']) == strtolower($dist->distributionName) && $os_version == $ver) {
|
||||||
|
$os_default = str_replace(".xml", "", strtolower(basename($_distribution)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// sort by distribution name
|
// sort by distribution name
|
||||||
@@ -103,7 +128,7 @@ class ConfigServicesAction extends \Froxlor\Cli\Action
|
|||||||
echo PHP_EOL;
|
echo PHP_EOL;
|
||||||
|
|
||||||
while (! in_array($_daemons_config['distro'], $distributions_select_data)) {
|
while (! in_array($_daemons_config['distro'], $distributions_select_data)) {
|
||||||
$_daemons_config['distro'] = ConfigServicesCmd::getInput("choose distribution", "buster");
|
$_daemons_config['distro'] = ConfigServicesCmd::getInput("choose distribution", $os_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
// go through all services and let user check whether to include it or not
|
// go through all services and let user check whether to include it or not
|
||||||
|
|||||||
@@ -39,6 +39,13 @@ class ConfigParser
|
|||||||
*/
|
*/
|
||||||
private $services = array();
|
private $services = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holding the available defaults in the XML
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $defaults = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store the parsed SimpleXMLElement for usage
|
* Store the parsed SimpleXMLElement for usage
|
||||||
*
|
*
|
||||||
@@ -147,7 +154,7 @@ class ConfigParser
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function parse()
|
private function parseServices()
|
||||||
{
|
{
|
||||||
// We only want to parse the stuff one time
|
// We only want to parse the stuff one time
|
||||||
if ($this->isparsed == true) {
|
if ($this->isparsed == true) {
|
||||||
@@ -174,6 +181,29 @@ class ConfigParser
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse the XML and populate $this->services
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function parseDefaults()
|
||||||
|
{
|
||||||
|
// We only want to parse the stuff one time
|
||||||
|
if ($this->isparsed == true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get all defaults
|
||||||
|
$defaults = $this->xml->xpath('//defaults');
|
||||||
|
foreach ($defaults as $default) {
|
||||||
|
$this->defaults = $default;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Switch flag to indicate we parsed our data
|
||||||
|
$this->isparsed = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return all services defined by the XML
|
* Return all services defined by the XML
|
||||||
*
|
*
|
||||||
@@ -184,9 +214,25 @@ class ConfigParser
|
|||||||
public function getServices()
|
public function getServices()
|
||||||
{
|
{
|
||||||
// Let's parse this shit(!)
|
// Let's parse this shit(!)
|
||||||
$this->parse();
|
$this->parseServices();
|
||||||
|
|
||||||
// Return our carefully searched for services
|
// Return our carefully searched for services
|
||||||
return $this->services;
|
return $this->services;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all defaults defined by the XML
|
||||||
|
*
|
||||||
|
* The array will hold ConfigDefaults - Objects for further handling
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getDefaults()
|
||||||
|
{
|
||||||
|
// Let's parse this shit(!)
|
||||||
|
$this->parseDefaults();
|
||||||
|
|
||||||
|
// Return our carefully searched for defaults
|
||||||
|
return $this->defaults;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ abstract class DnsBase
|
|||||||
{
|
{
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
|
|
||||||
|
$known_ns_ips = [];
|
||||||
if (Settings::Get('system.nameservers') != '') {
|
if (Settings::Get('system.nameservers') != '') {
|
||||||
$nameservers = explode(',', Settings::Get('system.nameservers'));
|
$nameservers = explode(',', Settings::Get('system.nameservers'));
|
||||||
foreach ($nameservers as $nameserver) {
|
foreach ($nameservers as $nameserver) {
|
||||||
@@ -58,6 +59,8 @@ abstract class DnsBase
|
|||||||
$nameserver_ips = array(
|
$nameserver_ips = array(
|
||||||
$nameserver
|
$nameserver
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$known_ns_ips = array_merge($known_ns_ips, $nameserver_ips);
|
||||||
}
|
}
|
||||||
$this->ns[] = array(
|
$this->ns[] = array(
|
||||||
'hostname' => $nameserver,
|
'hostname' => $nameserver,
|
||||||
@@ -80,7 +83,9 @@ abstract class DnsBase
|
|||||||
if (Settings::Get('system.axfrservers') != '') {
|
if (Settings::Get('system.axfrservers') != '') {
|
||||||
$axfrservers = explode(',', Settings::Get('system.axfrservers'));
|
$axfrservers = explode(',', Settings::Get('system.axfrservers'));
|
||||||
foreach ($axfrservers as $axfrserver) {
|
foreach ($axfrservers as $axfrserver) {
|
||||||
$this->axfr[] = trim($axfrserver);
|
if (!in_array(trim($axfrserver), $known_ns_ips)) {
|
||||||
|
$this->axfr[] = trim($axfrserver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,18 +200,18 @@ abstract class DnsBase
|
|||||||
|
|
||||||
while ($domain = $result_domains_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($domain = $result_domains_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
$privkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id']);
|
$privkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim' . $domain['dkim_id'] . Settings::Get('dkim.privkeysuffix'));
|
||||||
$pubkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id'] . '.public');
|
$pubkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim' . $domain['dkim_id'] . '.public');
|
||||||
|
|
||||||
if ($domain['dkim_privkey'] == '' || $domain['dkim_pubkey'] == '') {
|
if ($domain['dkim_privkey'] == '' || $domain['dkim_pubkey'] == '') {
|
||||||
$max_dkim_id_stmt = Database::query("SELECT MAX(`dkim_id`) as `max_dkim_id` FROM `" . TABLE_PANEL_DOMAINS . "`");
|
$max_dkim_id_stmt = Database::query("SELECT MAX(`dkim_id`) as `max_dkim_id` FROM `" . TABLE_PANEL_DOMAINS . "`");
|
||||||
$max_dkim_id = $max_dkim_id_stmt->fetch(\PDO::FETCH_ASSOC);
|
$max_dkim_id = $max_dkim_id_stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
$domain['dkim_id'] = (int) $max_dkim_id['max_dkim_id'] + 1;
|
$domain['dkim_id'] = (int) $max_dkim_id['max_dkim_id'] + 1;
|
||||||
$privkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id']);
|
$privkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim' . $domain['dkim_id'] . Settings::Get('dkim.privkeysuffix'));
|
||||||
\Froxlor\FileDir::safe_exec('openssl genrsa -out ' . escapeshellarg($privkey_filename) . ' ' . Settings::Get('dkim.dkim_keylength'));
|
\Froxlor\FileDir::safe_exec('openssl genrsa -out ' . escapeshellarg($privkey_filename) . ' ' . Settings::Get('dkim.dkim_keylength'));
|
||||||
$domain['dkim_privkey'] = file_get_contents($privkey_filename);
|
$domain['dkim_privkey'] = file_get_contents($privkey_filename);
|
||||||
\Froxlor\FileDir::safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
|
\Froxlor\FileDir::safe_exec("chmod 0640 " . escapeshellarg($privkey_filename));
|
||||||
$pubkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim_' . $domain['dkim_id'] . '.public');
|
$pubkey_filename = \Froxlor\FileDir::makeCorrectFile(Settings::Get('dkim.dkim_prefix') . '/dkim' . $domain['dkim_id'] . '.public');
|
||||||
\Froxlor\FileDir::safe_exec('openssl rsa -in ' . escapeshellarg($privkey_filename) . ' -pubout -outform pem -out ' . escapeshellarg($pubkey_filename));
|
\Froxlor\FileDir::safe_exec('openssl rsa -in ' . escapeshellarg($privkey_filename) . ' -pubout -outform pem -out ' . escapeshellarg($pubkey_filename));
|
||||||
$domain['dkim_pubkey'] = file_get_contents($pubkey_filename);
|
$domain['dkim_pubkey'] = file_get_contents($pubkey_filename);
|
||||||
\Froxlor\FileDir::safe_exec("chmod 0664 " . escapeshellarg($pubkey_filename));
|
\Froxlor\FileDir::safe_exec("chmod 0664 " . escapeshellarg($pubkey_filename));
|
||||||
|
|||||||
@@ -413,7 +413,8 @@ class Apache extends HttpConfigBase
|
|||||||
$this->virtualhosts_data[$vhosts_filename] .= $this->processSpecialConfigTemplate($row_ipsandports['ssl_specialsettings'], $domain, $row_ipsandports['ip'], $row_ipsandports['port'], $row_ipsandports['ssl'] == '1') . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= $this->processSpecialConfigTemplate($row_ipsandports['ssl_specialsettings'], $domain, $row_ipsandports['ip'], $row_ipsandports['port'], $row_ipsandports['ssl'] == '1') . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row_ipsandports['ssl_cert_file'] == '') {
|
// check for required fallback
|
||||||
|
if (($row_ipsandports['ssl_cert_file'] == '' || ! file_exists($row_ipsandports['ssl_cert_file'])) && (Settings::Get('system.le_froxlor_enabled') == '0' || $this->froxlorVhostHasLetsEncryptCert() == false)) {
|
||||||
$row_ipsandports['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
$row_ipsandports['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
||||||
if (! file_exists($row_ipsandports['ssl_cert_file'])) {
|
if (! file_exists($row_ipsandports['ssl_cert_file'])) {
|
||||||
// explicitly disable ssl for this vhost
|
// explicitly disable ssl for this vhost
|
||||||
@@ -424,6 +425,11 @@ class Apache extends HttpConfigBase
|
|||||||
|
|
||||||
if ($row_ipsandports['ssl_key_file'] == '') {
|
if ($row_ipsandports['ssl_key_file'] == '') {
|
||||||
$row_ipsandports['ssl_key_file'] = Settings::Get('system.ssl_key_file');
|
$row_ipsandports['ssl_key_file'] = Settings::Get('system.ssl_key_file');
|
||||||
|
if (! file_exists($row_ipsandports['ssl_key_file'])) {
|
||||||
|
// explicitly disable ssl for this vhost
|
||||||
|
$row_ipsandports['ssl_cert_file'] = "";
|
||||||
|
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_DEBUG, 'System certificate key-file "' . Settings::Get('system.ssl_key_file') . '" does not seem to exist. Disabling SSL-vhost for "' . Settings::Get('system.hostname') . '"');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row_ipsandports['ssl_ca_file'] == '') {
|
if ($row_ipsandports['ssl_ca_file'] == '') {
|
||||||
@@ -950,7 +956,7 @@ class Apache extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($ssl_vhost === true && $domain['ssl'] == '1' && Settings::Get('system.use_ssl') == '1') {
|
if ($ssl_vhost === true && $domain['ssl'] == '1' && Settings::Get('system.use_ssl') == '1') {
|
||||||
if ($domain['ssl_cert_file'] == '') {
|
if ($domain['ssl_cert_file'] == '' || ! file_exists($domain['ssl_cert_file'])) {
|
||||||
$domain['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
$domain['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
||||||
if (! file_exists($domain['ssl_cert_file'])) {
|
if (! file_exists($domain['ssl_cert_file'])) {
|
||||||
// explicitly disable ssl for this vhost
|
// explicitly disable ssl for this vhost
|
||||||
@@ -959,8 +965,13 @@ class Apache extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($domain['ssl_key_file'] == '') {
|
if ($domain['ssl_key_file'] == '' || ! file_exists($domain['ssl_key_file'])) {
|
||||||
$domain['ssl_key_file'] = Settings::Get('system.ssl_key_file');
|
$domain['ssl_key_file'] = Settings::Get('system.ssl_key_file');
|
||||||
|
if (! file_exists($domain['ssl_key_file'])) {
|
||||||
|
// explicitly disable ssl for this vhost
|
||||||
|
$domain['ssl_cert_file'] = "";
|
||||||
|
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_DEBUG, 'System certificate key-file "' . Settings::Get('system.ssl_key_file') . '" does not seem to exist. Disabling SSL-vhost for "' . $domain['domain'] . '"');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($domain['ssl_ca_file'] == '') {
|
if ($domain['ssl_ca_file'] == '') {
|
||||||
|
|||||||
@@ -105,7 +105,11 @@ class DomainSSL
|
|||||||
$_fh = fopen($filename, 'w');
|
$_fh = fopen($filename, 'w');
|
||||||
fwrite($_fh, $dom_certs[$type]);
|
fwrite($_fh, $dom_certs[$type]);
|
||||||
fclose($_fh);
|
fclose($_fh);
|
||||||
chmod($filename, 0600);
|
if ($type == 'ssl_key_file') {
|
||||||
|
chmod($filename, 0600);
|
||||||
|
} else {
|
||||||
|
chmod($filename, 0644);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// override corresponding array values
|
// override corresponding array values
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use Froxlor\Settings;
|
|||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
use Froxlor\PhpHelper;
|
use Froxlor\PhpHelper;
|
||||||
use Froxlor\Domain\Domain;
|
use Froxlor\Domain\Domain;
|
||||||
|
use Froxlor\FileDir;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
@@ -20,9 +21,9 @@ use Froxlor\Domain\Domain;
|
|||||||
* @author Froxlor team <team@froxlor.org> (2016-)
|
* @author Froxlor team <team@froxlor.org> (2016-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Cron
|
* @package Cron
|
||||||
*
|
*
|
||||||
* @since 0.9.35
|
* @since 0.9.35
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
||||||
{
|
{
|
||||||
@@ -43,8 +44,6 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
*/
|
*/
|
||||||
private static $upddom_stmt = null;
|
private static $upddom_stmt = null;
|
||||||
|
|
||||||
private static $do_update = true;
|
|
||||||
|
|
||||||
public static $no_inserttask = false;
|
public static $no_inserttask = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,8 +59,11 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
// Let's Encrypt cronjob is combined with regeneration of webserver configuration files.
|
// Let's Encrypt cronjob is combined with regeneration of webserver configuration files.
|
||||||
// For debugging purposes you can use the --debug switch and the --force switch to run the cron manually.
|
// For debugging purposes you can use the --debug switch and the --force switch to run the cron manually.
|
||||||
// check whether we MIGHT need to run although there is no task to regenerate config-files
|
// check whether we MIGHT need to run although there is no task to regenerate config-files
|
||||||
$needRenew = self::issueDomains();
|
$issue_froxlor = self::issueFroxlorVhost();
|
||||||
if ($needRenew || self::issueFroxlorVhost()) {
|
$issue_domains = self::issueDomains();
|
||||||
|
$renew_froxlor = self::renewFroxlorVhost();
|
||||||
|
$renew_domains = self::renewDomains(true);
|
||||||
|
if ($issue_froxlor || !empty($issue_domains) || !empty($renew_froxlor) || $renew_domains) {
|
||||||
// insert task to generate certificates and vhost-configs
|
// insert task to generate certificates and vhost-configs
|
||||||
\Froxlor\System\Cronjob::inserttask(1);
|
\Froxlor\System\Cronjob::inserttask(1);
|
||||||
}
|
}
|
||||||
@@ -76,6 +78,8 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
return - 1;
|
return - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self::checkUpgrade();
|
||||||
|
|
||||||
// flag for re-generation of vhost files
|
// flag for re-generation of vhost files
|
||||||
$changedetected = 0;
|
$changedetected = 0;
|
||||||
|
|
||||||
@@ -267,7 +271,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
* @param int $domain_id
|
* @param int $domain_id
|
||||||
* @param FroxlorLogger $cronlog
|
* @param FroxlorLogger $cronlog
|
||||||
*/
|
*/
|
||||||
private static function validateDns(&$domains = array(), $domain_id, &$cronlog)
|
private static function validateDns(array &$domains, $domain_id, &$cronlog)
|
||||||
{
|
{
|
||||||
if (Settings::Get('system.le_domain_dnscheck') == '1' && ! empty($domains)) {
|
if (Settings::Get('system.le_domain_dnscheck') == '1' && ! empty($domains)) {
|
||||||
$loop_domains = $domains;
|
$loop_domains = $domains;
|
||||||
@@ -277,7 +281,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Validating DNS of " . $domain);
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Validating DNS of " . $domain);
|
||||||
// ips accordint to NS
|
// ips accordint to NS
|
||||||
$domain_ips = PhpHelper::gethostbynamel6($domain);
|
$domain_ips = PhpHelper::gethostbynamel6($domain);
|
||||||
if (count(array_intersect($our_ips, $domain_ips)) <= 0) {
|
if ($domain_ips == false || count(array_intersect($our_ips, $domain_ips)) <= 0) {
|
||||||
// no common ips...
|
// no common ips...
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_WARNING, "Skipping Let's Encrypt generation for " . $domain . " due to no system known IP address via DNS check");
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_WARNING, "Skipping Let's Encrypt generation for " . $domain . " due to no system known IP address via DNS check");
|
||||||
unset($domains[$idx]);
|
unset($domains[$idx]);
|
||||||
@@ -286,16 +290,11 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function runAcmeSh($certrow = array(), $domains = array(), &$cronlog = null, $force = false)
|
private static function runAcmeSh(array $certrow, array $domains, &$cronlog = null, $force = false)
|
||||||
{
|
{
|
||||||
if (! empty($domains)) {
|
if (! empty($domains)) {
|
||||||
|
|
||||||
if (self::$do_update) {
|
$acmesh_cmd = self::$acmesh . " --server " . self::$apiserver . " --issue -d " . implode(" -d ", $domains);
|
||||||
self::checkUpgrade();
|
|
||||||
self::$do_update = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$acmesh_cmd = self::$acmesh . " --auto-upgrade 0 --server " . self::$apiserver . " --issue -d " . implode(" -d ", $domains);
|
|
||||||
// challenge path
|
// challenge path
|
||||||
$acmesh_cmd .= " -w " . Settings::Get('system.letsencryptchallengepath');
|
$acmesh_cmd .= " -w " . Settings::Get('system.letsencryptchallengepath');
|
||||||
if (Settings::Get('system.leecc') > 0) {
|
if (Settings::Get('system.leecc') > 0) {
|
||||||
@@ -328,7 +327,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
private static function certToDb($certrow, &$cronlog, $acme_result)
|
private static function certToDb($certrow, &$cronlog, $acme_result)
|
||||||
{
|
{
|
||||||
$return = array();
|
$return = array();
|
||||||
self::readCertificateToVar($certrow['domain'], $return, $cronlog);
|
self::readCertificateToVar(strtolower($certrow['domain']), $return, $cronlog);
|
||||||
|
|
||||||
if (! empty($return['crt'])) {
|
if (! empty($return['crt'])) {
|
||||||
|
|
||||||
@@ -400,8 +399,8 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
");
|
");
|
||||||
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
||||||
// also check for possible existing certificate
|
// also check for possible existing certificate
|
||||||
if ($froxlor_ssl || (! $froxlor_ssl && ! self::checkFsFilesAreNewer(Settings::Get('system.hostname'), date('Y-m-d H:i:s', 0)))) {
|
if ($froxlor_ssl && self::checkFsFilesAreNewer(Settings::Get('system.hostname'), $froxlor_ssl['expirationdate'])) {
|
||||||
return ($froxlor_ssl ? $froxlor_ssl : true);
|
return $froxlor_ssl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -410,7 +409,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
/**
|
/**
|
||||||
* get a list of domains that have a lets encrypt certificate (possible renew)
|
* get a list of domains that have a lets encrypt certificate (possible renew)
|
||||||
*/
|
*/
|
||||||
private static function renewDomains()
|
private static function renewDomains($check = false)
|
||||||
{
|
{
|
||||||
$certificates_stmt = Database::query("
|
$certificates_stmt = Database::query("
|
||||||
SELECT
|
SELECT
|
||||||
@@ -437,10 +436,15 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
AND dom.`iswildcarddomain` = 0
|
AND dom.`iswildcarddomain` = 0
|
||||||
");
|
");
|
||||||
$renew_certs = $certificates_stmt->fetchAll(\PDO::FETCH_ASSOC);
|
$renew_certs = $certificates_stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
if (self::renewFroxlorVhost()) {
|
|
||||||
// add froxlor to the list of renews
|
|
||||||
}
|
|
||||||
if ($renew_certs) {
|
if ($renew_certs) {
|
||||||
|
if ($check) {
|
||||||
|
foreach ($renew_certs as $cert) {
|
||||||
|
if (self::checkFsFilesAreNewer($cert['domain'], $cert['expirationdate'])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return $renew_certs;
|
return $renew_certs;
|
||||||
}
|
}
|
||||||
return array();
|
return array();
|
||||||
@@ -493,22 +497,42 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
private static function checkFsFilesAreNewer($domain, $cert_date = 0)
|
private static function checkFsFilesAreNewer($domain, $cert_date = 0)
|
||||||
{
|
{
|
||||||
$certificate_folder = dirname(self::$acmesh) . "/" . $domain;
|
$certificate_folder = self::getWorkingDirFromEnv($domain);
|
||||||
if (Settings::Get('system.leecc') > 0) {
|
|
||||||
$certificate_folder .= "_ecc";
|
|
||||||
}
|
|
||||||
$certificate_folder = \Froxlor\FileDir::makeCorrectDir($certificate_folder);
|
|
||||||
$ssl_file = \Froxlor\FileDir::makeCorrectFile($certificate_folder . '/' . $domain . '.cer');
|
$ssl_file = \Froxlor\FileDir::makeCorrectFile($certificate_folder . '/' . $domain . '.cer');
|
||||||
|
|
||||||
if (is_dir($certificate_folder) && file_exists($ssl_file) && is_readable($ssl_file)) {
|
if (is_dir($certificate_folder) && file_exists($ssl_file) && is_readable($ssl_file)) {
|
||||||
$cert_data = openssl_x509_parse(file_get_contents($ssl_file));
|
$cert_data = openssl_x509_parse(file_get_contents($ssl_file));
|
||||||
if (strtotime($cert_data['validTo_time_t']) > strtotime($cert_date)) {
|
if ($cert_data && $cert_data['validTo_time_t'] > strtotime($cert_date)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getWorkingDirFromEnv($domain = "", $forced_noecc = false)
|
||||||
|
{
|
||||||
|
if (Settings::Get('system.leecc') > 0 && ! $forced_noecc) {
|
||||||
|
$domain .= "_ecc";
|
||||||
|
}
|
||||||
|
$env_file = FileDir::makeCorrectFile(dirname(self::$acmesh) . '/acme.sh.env');
|
||||||
|
if (file_exists($env_file)) {
|
||||||
|
$output = [];
|
||||||
|
$cut = <<<EOC
|
||||||
|
cut -d'"' -f2
|
||||||
|
EOC;
|
||||||
|
exec('grep "LE_WORKING_DIR" ' . escapeshellarg($env_file) . ' | ' . $cut, $output);
|
||||||
|
if (is_array($output) && ! empty($output) && isset($output[0]) && ! empty($output[0])) {
|
||||||
|
return FileDir::makeCorrectDir($output[0] . "/" . $domain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FileDir::makeCorrectDir(dirname(self::$acmesh) . "/" . $domain);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getAcmeSh()
|
||||||
|
{
|
||||||
|
return self::$acmesh;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get certificate files from filesystem and store in $return array
|
* get certificate files from filesystem and store in $return array
|
||||||
*
|
*
|
||||||
@@ -518,11 +542,10 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
*/
|
*/
|
||||||
private static function readCertificateToVar($domain, &$return, &$cronlog)
|
private static function readCertificateToVar($domain, &$return, &$cronlog)
|
||||||
{
|
{
|
||||||
$certificate_folder = dirname(self::$acmesh) . "/" . $domain;
|
$certificate_folder = self::getWorkingDirFromEnv($domain);
|
||||||
$certificate_folder_noecc = null;
|
$certificate_folder_noecc = null;
|
||||||
if (Settings::Get('system.leecc') > 0) {
|
if (Settings::Get('system.leecc') > 0) {
|
||||||
$certificate_folder_noecc = \Froxlor\FileDir::makeCorrectDir($certificate_folder);
|
$certificate_folder_noecc = self::getWorkingDirFromEnv($domain, true);
|
||||||
$certificate_folder .= "_ecc";
|
|
||||||
}
|
}
|
||||||
$certificate_folder = \Froxlor\FileDir::makeCorrectDir($certificate_folder);
|
$certificate_folder = \Froxlor\FileDir::makeCorrectDir($certificate_folder);
|
||||||
|
|
||||||
@@ -581,7 +604,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
*/
|
*/
|
||||||
private static function checkUpgrade()
|
private static function checkUpgrade()
|
||||||
{
|
{
|
||||||
$acmesh_result = \Froxlor\FileDir::safe_exec(self::$acmesh . " --upgrade");
|
$acmesh_result = \Froxlor\FileDir::safe_exec(self::$acmesh . " --upgrade --auto-upgrade 0");
|
||||||
// check for activated cron
|
// check for activated cron
|
||||||
$acmesh_result2 = \Froxlor\FileDir::safe_exec(self::$acmesh . " --install-cronjob");
|
$acmesh_result2 = \Froxlor\FileDir::safe_exec(self::$acmesh . " --install-cronjob");
|
||||||
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Checking for LetsEncrypt client upgrades before renewing certificates:\n" . implode("\n", $acmesh_result) . "\n" . implode("\n", $acmesh_result2));
|
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Checking for LetsEncrypt client upgrades before renewing certificates:\n" . implode("\n", $acmesh_result) . "\n" . implode("\n", $acmesh_result2));
|
||||||
|
|||||||
@@ -188,7 +188,8 @@ class Lighttpd extends HttpConfigBase
|
|||||||
$this->lighttpd_data[$vhost_filename] .= $this->processSpecialConfigTemplate($row_ipsandports['ssl_specialsettings'], $domain, $row_ipsandports['ip'], $row_ipsandports['port'], $row_ipsandports['ssl'] == '1') . "\n";
|
$this->lighttpd_data[$vhost_filename] .= $this->processSpecialConfigTemplate($row_ipsandports['ssl_specialsettings'], $domain, $row_ipsandports['ip'], $row_ipsandports['port'], $row_ipsandports['ssl'] == '1') . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row_ipsandports['ssl_cert_file'] == '') {
|
// check for required fallback
|
||||||
|
if (($row_ipsandports['ssl_cert_file'] == '' || ! file_exists($row_ipsandports['ssl_cert_file'])) && (Settings::Get('system.le_froxlor_enabled') == '0' || $this->froxlorVhostHasLetsEncryptCert() == false)) {
|
||||||
$row_ipsandports['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
$row_ipsandports['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
||||||
if (! file_exists($row_ipsandports['ssl_cert_file'])) {
|
if (! file_exists($row_ipsandports['ssl_cert_file'])) {
|
||||||
// explicitly disable ssl for this vhost
|
// explicitly disable ssl for this vhost
|
||||||
@@ -555,7 +556,7 @@ class Lighttpd extends HttpConfigBase
|
|||||||
$ssl_settings = '';
|
$ssl_settings = '';
|
||||||
|
|
||||||
if ($ssl_vhost === true && $domain['ssl'] == '1' && (int) Settings::Get('system.use_ssl') == 1) {
|
if ($ssl_vhost === true && $domain['ssl'] == '1' && (int) Settings::Get('system.use_ssl') == 1) {
|
||||||
if ($domain['ssl_cert_file'] == '') {
|
if ($domain['ssl_cert_file'] == '' || ! file_exists($domain['ssl_cert_file'])) {
|
||||||
$domain['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
$domain['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
||||||
if (! file_exists($domain['ssl_cert_file'])) {
|
if (! file_exists($domain['ssl_cert_file'])) {
|
||||||
// explicitly disable ssl for this vhost
|
// explicitly disable ssl for this vhost
|
||||||
|
|||||||
@@ -155,7 +155,8 @@ class Nginx extends HttpConfigBase
|
|||||||
// we know whether it's an ssl vhost or not
|
// we know whether it's an ssl vhost or not
|
||||||
$ssl_vhost = false;
|
$ssl_vhost = false;
|
||||||
if ($row_ipsandports['ssl'] == '1') {
|
if ($row_ipsandports['ssl'] == '1') {
|
||||||
if ($row_ipsandports['ssl_cert_file'] == '') {
|
// check for required fallback
|
||||||
|
if (($row_ipsandports['ssl_cert_file'] == '' || ! file_exists($row_ipsandports['ssl_cert_file'])) && (Settings::Get('system.le_froxlor_enabled') == '0' || $this->froxlorVhostHasLetsEncryptCert() == false)) {
|
||||||
$row_ipsandports['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
$row_ipsandports['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
||||||
if (! file_exists($row_ipsandports['ssl_cert_file'])) {
|
if (! file_exists($row_ipsandports['ssl_cert_file'])) {
|
||||||
// explicitly disable ssl for this vhost
|
// explicitly disable ssl for this vhost
|
||||||
@@ -165,6 +166,11 @@ class Nginx extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
if ($row_ipsandports['ssl_key_file'] == '') {
|
if ($row_ipsandports['ssl_key_file'] == '') {
|
||||||
$row_ipsandports['ssl_key_file'] = Settings::Get('system.ssl_key_file');
|
$row_ipsandports['ssl_key_file'] = Settings::Get('system.ssl_key_file');
|
||||||
|
if (! file_exists($row_ipsandports['ssl_key_file'])) {
|
||||||
|
// explicitly disable ssl for this vhost
|
||||||
|
$row_ipsandports['ssl_cert_file'] = "";
|
||||||
|
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_DEBUG, 'System certificate key-file "' . Settings::Get('system.ssl_key_file') . '" does not seem to exist. Disabling SSL-vhost for "' . Settings::Get('system.hostname') . '"');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($row_ipsandports['ssl_ca_file'] == '') {
|
if ($row_ipsandports['ssl_ca_file'] == '') {
|
||||||
$row_ipsandports['ssl_ca_file'] = Settings::Get('system.ssl_ca_file');
|
$row_ipsandports['ssl_ca_file'] = Settings::Get('system.ssl_ca_file');
|
||||||
@@ -659,7 +665,7 @@ class Nginx extends HttpConfigBase
|
|||||||
{
|
{
|
||||||
$sslsettings = '';
|
$sslsettings = '';
|
||||||
|
|
||||||
if ($domain_or_ip['ssl_cert_file'] == '') {
|
if ($domain_or_ip['ssl_cert_file'] == '' || ! file_exists($domain_or_ip['ssl_cert_file'])) {
|
||||||
$domain_or_ip['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
$domain_or_ip['ssl_cert_file'] = Settings::Get('system.ssl_cert_file');
|
||||||
if (! file_exists($domain_or_ip['ssl_cert_file'])) {
|
if (! file_exists($domain_or_ip['ssl_cert_file'])) {
|
||||||
// explicitly disable ssl for this vhost
|
// explicitly disable ssl for this vhost
|
||||||
@@ -668,8 +674,15 @@ class Nginx extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($domain_or_ip['ssl_key_file'] == '') {
|
if ($domain_or_ip['ssl_key_file'] == '' || ! file_exists($domain_or_ip['ssl_key_file'])) {
|
||||||
|
// use fallback
|
||||||
$domain_or_ip['ssl_key_file'] = Settings::Get('system.ssl_key_file');
|
$domain_or_ip['ssl_key_file'] = Settings::Get('system.ssl_key_file');
|
||||||
|
// check whether it exists
|
||||||
|
if (! file_exists($domain_or_ip['ssl_key_file'])) {
|
||||||
|
// explicitly disable ssl for this vhost
|
||||||
|
$domain_or_ip['ssl_cert_file'] = "";
|
||||||
|
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_DEBUG, 'System certificate key-file "' . Settings::Get('system.ssl_key_file') . '" does not seem to exist. Disabling SSL-vhost for "' . $domain_or_ip['domain'] . '"');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($domain_or_ip['ssl_ca_file'] == '') {
|
if ($domain_or_ip['ssl_ca_file'] == '') {
|
||||||
@@ -901,7 +914,6 @@ class Nginx extends HttpConfigBase
|
|||||||
FROM `" . TABLE_PANEL_HTPASSWDS . "` AS a
|
FROM `" . TABLE_PANEL_HTPASSWDS . "` AS a
|
||||||
JOIN `" . TABLE_PANEL_DOMAINS . "` AS b USING (`customerid`)
|
JOIN `" . TABLE_PANEL_DOMAINS . "` AS b USING (`customerid`)
|
||||||
WHERE b.customerid = :customerid AND b.domain = :domain
|
WHERE b.customerid = :customerid AND b.domain = :domain
|
||||||
AND path LIKE CONCAT(b.documentroot, '%')
|
|
||||||
");
|
");
|
||||||
Database::pexecute($result_stmt, array(
|
Database::pexecute($result_stmt, array(
|
||||||
'customerid' => $domain['customerid'],
|
'customerid' => $domain['customerid'],
|
||||||
@@ -1041,10 +1053,10 @@ class Nginx extends HttpConfigBase
|
|||||||
|
|
||||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||||
// awstats
|
// awstats
|
||||||
$stats_text .= "\t" . 'location /awstats {' . "\n";
|
$stats_text .= "\t" . 'location ^~ /awstats/ {' . "\n";
|
||||||
} else {
|
} else {
|
||||||
// webalizer
|
// webalizer
|
||||||
$stats_text .= "\t" . 'location /webalizer {' . "\n";
|
$stats_text .= "\t" . 'location ^~ /webalizer {' . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$stats_text .= "\t\t" . 'alias ' . $alias_dir . ';' . "\n";
|
$stats_text .= "\t\t" . 'alias ' . $alias_dir . ';' . "\n";
|
||||||
|
|||||||
@@ -108,6 +108,11 @@ class PhpInterface
|
|||||||
$this->_php_configs_cache[$php_config_id]['fpm_settings'] = Database::pexecute_first($stmt, array(
|
$this->_php_configs_cache[$php_config_id]['fpm_settings'] = Database::pexecute_first($stmt, array(
|
||||||
'id' => $this->_php_configs_cache[$php_config_id]['fpmsettingid']
|
'id' => $this->_php_configs_cache[$php_config_id]['fpmsettingid']
|
||||||
));
|
));
|
||||||
|
// override fpm daemon settings if set in php-config
|
||||||
|
if ($this->_php_configs_cache[$php_config_id]['override_fpmconfig'] == 1) {
|
||||||
|
$this->_php_configs_cache[$php_config_id]['fpm_settings']['limit_extensions'] = $this->_php_configs_cache[$php_config_id]['limit_extensions'];
|
||||||
|
$this->_php_configs_cache[$php_config_id]['fpm_settings']['idle_timeout'] = $this->_php_configs_cache[$php_config_id]['idle_timeout'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Froxlor\Cron\Traffic;
|
|||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Cron
|
* @package Cron
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
use Froxlor\Settings;
|
use Froxlor\Settings;
|
||||||
@@ -55,7 +55,6 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
Database::pexecute($result_stmt, $result_data);
|
Database::pexecute($result_stmt, $result_data);
|
||||||
|
|
||||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
if (isset($row['traffic']) && $row['traffic'] > 0 && $row['traffic_used'] != null && (($row['traffic_used'] * 100) / $row['traffic']) >= (int) Settings::Get('system.report_trafficmax')) {
|
if (isset($row['traffic']) && $row['traffic'] > 0 && $row['traffic_used'] != null && (($row['traffic_used'] * 100) / $row['traffic']) >= (int) Settings::Get('system.report_trafficmax')) {
|
||||||
$rep_userinfo = array(
|
$rep_userinfo = array(
|
||||||
'name' => $row['name'],
|
'name' => $row['name'],
|
||||||
@@ -93,9 +92,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
// include english language file (fallback)
|
// include english language file (fallback)
|
||||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
include \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||||
// include admin/customer language file
|
// include admin/customer language file
|
||||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
if ($lngfile != 'lng/english.lng.php') {
|
||||||
|
include \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||||
|
}
|
||||||
|
|
||||||
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
||||||
$result2_stmt = Database::prepare("
|
$result2_stmt = Database::prepare("
|
||||||
@@ -110,11 +111,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
'varname' => 'trafficmaxpercent_subject'
|
'varname' => 'trafficmaxpercent_subject'
|
||||||
);
|
);
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
||||||
|
|
||||||
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
$mailerr_msg = "";
|
$mailerr_msg = "";
|
||||||
@@ -146,6 +147,8 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
Database::pexecute($upd_stmt, array(
|
Database::pexecute($upd_stmt, array(
|
||||||
'customerid' => $row['customerid']
|
'customerid' => $row['customerid']
|
||||||
));
|
));
|
||||||
|
|
||||||
|
unset($lng);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,9 +198,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
// include english language file (fallback)
|
// include english language file (fallback)
|
||||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
include \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||||
// include admin/customer language file
|
// include admin/customer language file
|
||||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
if ($lngfile != 'lng/english.lng.php') {
|
||||||
|
include \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||||
|
}
|
||||||
|
|
||||||
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
||||||
$result2_stmt = Database::prepare("
|
$result2_stmt = Database::prepare("
|
||||||
@@ -212,11 +217,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
'varname' => 'trafficmaxpercent_subject'
|
'varname' => 'trafficmaxpercent_subject'
|
||||||
);
|
);
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
||||||
|
|
||||||
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
$mailerr_msg = "";
|
$mailerr_msg = "";
|
||||||
@@ -326,6 +331,8 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
$mail->ClearAddresses();
|
$mail->ClearAddresses();
|
||||||
|
|
||||||
|
unset($lng);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // trafficmax > 0
|
} // trafficmax > 0
|
||||||
@@ -398,10 +405,10 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
// include english language file (fallback)
|
// include english language file (fallback)
|
||||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
include \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||||
// include admin/customer language file
|
// include admin/customer language file
|
||||||
if ($lngfile != 'lng/english.lng.php') {
|
if ($lngfile != 'lng/english.lng.php') {
|
||||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
include \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
||||||
@@ -417,11 +424,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
'varname' => 'diskmaxpercent_subject'
|
'varname' => 'diskmaxpercent_subject'
|
||||||
);
|
);
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
||||||
|
|
||||||
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
$mailerr_msg = "";
|
$mailerr_msg = "";
|
||||||
@@ -453,6 +460,8 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
Database::pexecute($upd_stmt, array(
|
Database::pexecute($upd_stmt, array(
|
||||||
'customerid' => $row['customerid']
|
'customerid' => $row['customerid']
|
||||||
));
|
));
|
||||||
|
|
||||||
|
unset($lng);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,9 +502,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
// include english language file (fallback)
|
// include english language file (fallback)
|
||||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
include \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/lng/english.lng.php');
|
||||||
// include admin/customer language file
|
// include admin/customer language file
|
||||||
include_once \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
if ($lngfile != 'lng/english.lng.php') {
|
||||||
|
include \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . '/' . $langfile);
|
||||||
|
}
|
||||||
|
|
||||||
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
||||||
$result2_stmt = Database::prepare("
|
$result2_stmt = Database::prepare("
|
||||||
@@ -510,11 +521,11 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
'varname' => 'diskmaxpercent_subject'
|
'varname' => 'diskmaxpercent_subject'
|
||||||
);
|
);
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
||||||
|
|
||||||
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
$mailerr_msg = "";
|
$mailerr_msg = "";
|
||||||
@@ -546,6 +557,8 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
Database::pexecute($upd_stmt, array(
|
Database::pexecute($upd_stmt, array(
|
||||||
'adminid' => $row['adminid']
|
'adminid' => $row['adminid']
|
||||||
));
|
));
|
||||||
|
|
||||||
|
unset($lng);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // webmax > 0
|
} // webmax > 0
|
||||||
|
|||||||
@@ -163,6 +163,13 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` ORDER BY `customerid` ASC");
|
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` ORDER BY `customerid` ASC");
|
||||||
|
|
||||||
|
$currentDate = date("Y-m-d");
|
||||||
|
|
||||||
|
$current_stamp = time();
|
||||||
|
$current_year = date('Y', $current_stamp);
|
||||||
|
$current_month = date('m', $current_stamp);
|
||||||
|
$current_day = date('d', $current_stamp);
|
||||||
|
|
||||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
/**
|
/**
|
||||||
* HTTP-Traffic
|
* HTTP-Traffic
|
||||||
@@ -208,7 +215,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
// will iterate through all customer-domains and the awstats-configs
|
// will iterate through all customer-domains and the awstats-configs
|
||||||
// know the logfile-name, #246
|
// know the logfile-name, #246
|
||||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||||
$httptraffic += floatval(self::callAwstatsGetTraffic($row['customerid'], $row['documentroot'] . '/awstats/', $domainlist[$row['customerid']]));
|
$httptraffic += floatval(self::callAwstatsGetTraffic($row['customerid'], $row['documentroot'] . '/awstats/', $domainlist[$row['customerid']], $current_stamp));
|
||||||
} else {
|
} else {
|
||||||
$httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'], $row['documentroot'] . '/webalizer/', $caption, $domainlist[$row['customerid']]));
|
$httptraffic += floatval(self::callWebalizerGetTraffic($row['loginname'], $row['documentroot'] . '/webalizer/', $caption, $domainlist[$row['customerid']]));
|
||||||
}
|
}
|
||||||
@@ -250,8 +257,6 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
if (Settings::Get("system.mailtraffic_enabled")) {
|
if (Settings::Get("system.mailtraffic_enabled")) {
|
||||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_INFO, 'mail traffic usage for ' . $row['loginname'] . " started...");
|
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_INFO, 'mail traffic usage for ' . $row['loginname'] . " started...");
|
||||||
|
|
||||||
$currentDate = date("Y-m-d");
|
|
||||||
|
|
||||||
$domains_stmt = Database::prepare("SELECT domain FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :cid");
|
$domains_stmt = Database::prepare("SELECT domain FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :cid");
|
||||||
Database::pexecute($domains_stmt, array(
|
Database::pexecute($domains_stmt, array(
|
||||||
"cid" => $row['customerid']
|
"cid" => $row['customerid']
|
||||||
@@ -312,10 +317,10 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
$ins_data = array(
|
$ins_data = array(
|
||||||
'customerid' => $row['customerid'],
|
'customerid' => $row['customerid'],
|
||||||
'year' => date('Y', time()),
|
'year' => $current_year,
|
||||||
'month' => date('m', time()),
|
'month' => $current_month,
|
||||||
'day' => date('d', time()),
|
'day' => $current_day,
|
||||||
'stamp' => time(),
|
'stamp' => $current_stamp,
|
||||||
'http' => $current_traffic['http'],
|
'http' => $current_traffic['http'],
|
||||||
'ftp_up' => $current_traffic['ftp_up'],
|
'ftp_up' => $current_traffic['ftp_up'],
|
||||||
'ftp_down' => $current_traffic['ftp_down'],
|
'ftp_down' => $current_traffic['ftp_down'],
|
||||||
@@ -340,8 +345,8 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `year` = :year AND `month` = :month AND `customerid` = :customerid
|
FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `year` = :year AND `month` = :month AND `customerid` = :customerid
|
||||||
");
|
");
|
||||||
$sum_month_traffic = Database::pexecute_first($sum_month_traffic_stmt, array(
|
$sum_month_traffic = Database::pexecute_first($sum_month_traffic_stmt, array(
|
||||||
'year' => date('Y', time()),
|
'year' => $current_year,
|
||||||
'month' => date('m', time()),
|
'month' => $current_month,
|
||||||
'customerid' => $row['customerid']
|
'customerid' => $row['customerid']
|
||||||
));
|
));
|
||||||
$sum_month_traffic['all'] = $sum_month_traffic['http'] + $sum_month_traffic['ftp_up'] + $sum_month_traffic['ftp_down'] + $sum_month_traffic['mail'];
|
$sum_month_traffic['all'] = $sum_month_traffic['http'] + $sum_month_traffic['ftp_up'] + $sum_month_traffic['ftp_down'] + $sum_month_traffic['mail'];
|
||||||
@@ -425,10 +430,10 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
$ins_data = array(
|
$ins_data = array(
|
||||||
'customerid' => $row['customerid'],
|
'customerid' => $row['customerid'],
|
||||||
'year' => date('Y', time()),
|
'year' => $current_year,
|
||||||
'month' => date('m', time()),
|
'month' => $current_month,
|
||||||
'day' => date('d', time()),
|
'day' => $current_day,
|
||||||
'stamp' => time(),
|
'stamp' => $current_stamp,
|
||||||
'webspace' => $current_diskspace['webspace'],
|
'webspace' => $current_diskspace['webspace'],
|
||||||
'mail' => $current_diskspace['mail'],
|
'mail' => $current_diskspace['mail'],
|
||||||
'mysql' => $current_diskspace['mysql']
|
'mysql' => $current_diskspace['mysql']
|
||||||
@@ -534,10 +539,10 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
$ins_data = array(
|
$ins_data = array(
|
||||||
'adminid' => $row['adminid'],
|
'adminid' => $row['adminid'],
|
||||||
'year' => date('Y', time()),
|
'year' => $current_year,
|
||||||
'month' => date('m', time()),
|
'month' => $current_month,
|
||||||
'day' => date('d', time()),
|
'day' => $current_day,
|
||||||
'stamp' => time(),
|
'stamp' => $current_stamp,
|
||||||
'http' => $admin_traffic[$row['adminid']]['http'],
|
'http' => $admin_traffic[$row['adminid']]['http'],
|
||||||
'ftp_up' => $admin_traffic[$row['adminid']]['ftp_up'],
|
'ftp_up' => $admin_traffic[$row['adminid']]['ftp_up'],
|
||||||
'ftp_down' => $admin_traffic[$row['adminid']]['ftp_down'],
|
'ftp_down' => $admin_traffic[$row['adminid']]['ftp_down'],
|
||||||
@@ -570,29 +575,6 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($admin_diskspace[$row['adminid']])) {
|
if (isset($admin_diskspace[$row['adminid']])) {
|
||||||
|
|
||||||
$ins_data = array(
|
|
||||||
'adminid' => $row['adminid'],
|
|
||||||
'year' => date('Y', time()),
|
|
||||||
'month' => date('m', time()),
|
|
||||||
'day' => date('d', time()),
|
|
||||||
'stamp' => time(),
|
|
||||||
'webspace' => $admin_diskspace[$row['adminid']]['webspace'],
|
|
||||||
'mail' => $admin_diskspace[$row['adminid']]['mail'],
|
|
||||||
'mysql' => $admin_diskspace[$row['adminid']]['mysql']
|
|
||||||
);
|
|
||||||
$ins_stmt = Database::prepare("
|
|
||||||
INSERT INTO `" . TABLE_PANEL_DISKSPACE_ADMINS . "` SET
|
|
||||||
`adminid` = :adminid,
|
|
||||||
`year` = :year,
|
|
||||||
`month` = :month,
|
|
||||||
`day` = :day,
|
|
||||||
`stamp` = :stamp,
|
|
||||||
`webspace` = :webspace,
|
|
||||||
`mail` = :mail,
|
|
||||||
`mysql` = :mysql
|
|
||||||
");
|
|
||||||
|
|
||||||
$upd_data = array(
|
$upd_data = array(
|
||||||
'diskspace' => $admin_diskspace[$row['adminid']]['all'],
|
'diskspace' => $admin_diskspace[$row['adminid']]['all'],
|
||||||
'adminid' => $row['adminid']
|
'adminid' => $row['adminid']
|
||||||
@@ -757,7 +739,7 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function callAwstatsGetTraffic($customerid, $outputdir, $usersdomainlist)
|
private static function callAwstatsGetTraffic($customerid, $outputdir, $usersdomainlist, $current_stamp)
|
||||||
{
|
{
|
||||||
$returnval = 0;
|
$returnval = 0;
|
||||||
|
|
||||||
@@ -789,8 +771,8 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
");
|
");
|
||||||
$result_data = array(
|
$result_data = array(
|
||||||
'customerid' => $customerid,
|
'customerid' => $customerid,
|
||||||
'year' => date('Y', time()),
|
'year' => date('Y', $current_stamp),
|
||||||
'month' => date('m', time())
|
'month' => date('m', $current_stamp)
|
||||||
);
|
);
|
||||||
$result = Database::pexecute_first($result_stmt, $result_data);
|
$result = Database::pexecute_first($result_stmt, $result_data);
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Customer
|
|||||||
*
|
*
|
||||||
* @return string customers loginname
|
* @return string customers loginname
|
||||||
*/
|
*/
|
||||||
public function getLoginNameByUid($uid = null)
|
public static function getLoginNameByUid($uid = null)
|
||||||
{
|
{
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `guid` = :guid
|
SELECT `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `guid` = :guid
|
||||||
|
|||||||
@@ -131,9 +131,26 @@ class Dns
|
|||||||
}
|
}
|
||||||
|
|
||||||
// additional required records for CAA if activated
|
// additional required records for CAA if activated
|
||||||
if (Settings::Get('system.dns_createcaaentry') && Settings::Get('system.use_ssl') == "1" && !empty($domain['p_ssl_ipandports'])) {
|
if (Settings::Get('system.dns_createcaaentry') && Settings::Get('system.use_ssl') == "1") {
|
||||||
// check for CAA content later
|
$result_stmt = Database::prepare("
|
||||||
self::addRequiredEntry('@CAA@', 'CAA', $required_entries);
|
SELECT i.`ip`, i.`port`, i.`ssl`
|
||||||
|
FROM " . TABLE_PANEL_IPSANDPORTS . " i
|
||||||
|
LEFT JOIN " . TABLE_DOMAINTOIP . " dip ON dip.id_ipandports = i.id
|
||||||
|
WHERE i.ssl = 1 AND dip.id_domain = :domainid
|
||||||
|
");
|
||||||
|
Database::pexecute($result_stmt, array(
|
||||||
|
'domainid' => $domain['id']
|
||||||
|
));
|
||||||
|
|
||||||
|
$ssl_ipandports = array();
|
||||||
|
while ($ssl_ipandport = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
|
$ssl_ipandports[] = $ssl_ipandport;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($ssl_ipandports)) {
|
||||||
|
// check for CAA content later
|
||||||
|
self::addRequiredEntry('@CAA@', 'CAA', $required_entries);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// additional required records for SPF and DKIM if activated
|
// additional required records for SPF and DKIM if activated
|
||||||
@@ -144,7 +161,7 @@ class Dns
|
|||||||
}
|
}
|
||||||
if (Settings::Get('dkim.use_dkim') == '1') {
|
if (Settings::Get('dkim.use_dkim') == '1') {
|
||||||
// check for DKIM content later
|
// check for DKIM content later
|
||||||
self::addRequiredEntry('dkim_' . $domain['dkim_id'] . '._domainkey', 'TXT', $required_entries);
|
self::addRequiredEntry('dkim' . $domain['dkim_id'] . '._domainkey', 'TXT', $required_entries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +177,7 @@ class Dns
|
|||||||
// unset special CAA required-entry
|
// unset special CAA required-entry
|
||||||
unset($required_entries[$entry['type']][md5("@CAA@")]);
|
unset($required_entries[$entry['type']][md5("@CAA@")]);
|
||||||
}
|
}
|
||||||
if (Settings::Get('spf.use_spf') == '1' && $entry['type'] == 'TXT' && $entry['record'] == '@' && (strtolower(substr($entry['content'], 0, 7)) == '"v=spf1' || strtolower(substr($entry['content'], 0, 6)) == 'v=spf1') ) {
|
if (Settings::Get('spf.use_spf') == '1' && $entry['type'] == 'TXT' && $entry['record'] == '@' && (strtolower(substr($entry['content'], 0, 7)) == '"v=spf1' || strtolower(substr($entry['content'], 0, 6)) == 'v=spf1')) {
|
||||||
// unset special spf required-entry
|
// unset special spf required-entry
|
||||||
unset($required_entries[$entry['type']][md5("@SPF@")]);
|
unset($required_entries[$entry['type']][md5("@SPF@")]);
|
||||||
}
|
}
|
||||||
@@ -168,6 +185,17 @@ class Dns
|
|||||||
// use the first NS entry as primary ns
|
// use the first NS entry as primary ns
|
||||||
$primary_ns = $entry['content'];
|
$primary_ns = $entry['content'];
|
||||||
}
|
}
|
||||||
|
// check for CNAME on @, www- or wildcard-Alias and remove A/AAAA record accordingly
|
||||||
|
foreach ([
|
||||||
|
'@',
|
||||||
|
'www',
|
||||||
|
'*'
|
||||||
|
] as $crceord) {
|
||||||
|
if ($entry['type'] == 'CNAME' && $entry['record'] == '@' && (array_key_exists(md5($crceord), $required_entries['A']) || array_key_exists(md5($crceord), $required_entries['AAAA']))) {
|
||||||
|
unset($required_entries['A'][md5($crceord)]);
|
||||||
|
unset($required_entries['AAAA'][md5($crceord)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
$zonerecords[] = new DnsEntry($entry['record'], $entry['type'], $entry['content'], $entry['prio'], $entry['ttl']);
|
$zonerecords[] = new DnsEntry($entry['record'], $entry['type'], $entry['content'], $entry['prio'], $entry['ttl']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,16 +207,16 @@ class Dns
|
|||||||
if ($froxlorhostname) {
|
if ($froxlorhostname) {
|
||||||
// use all available IP's for the froxlor-hostname
|
// use all available IP's for the froxlor-hostname
|
||||||
$result_ip_stmt = Database::prepare("
|
$result_ip_stmt = Database::prepare("
|
||||||
SELECT `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "` GROUP BY `ip`
|
SELECT `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "` GROUP BY `ip`
|
||||||
");
|
");
|
||||||
Database::pexecute($result_ip_stmt);
|
Database::pexecute($result_ip_stmt);
|
||||||
} else {
|
} else {
|
||||||
$result_ip_stmt = Database::prepare("
|
$result_ip_stmt = Database::prepare("
|
||||||
SELECT `p`.`ip` AS `ip`
|
SELECT `p`.`ip` AS `ip`
|
||||||
FROM `" . TABLE_PANEL_IPSANDPORTS . "` `p`, `" . TABLE_DOMAINTOIP . "` `di`
|
FROM `" . TABLE_PANEL_IPSANDPORTS . "` `p`, `" . TABLE_DOMAINTOIP . "` `di`
|
||||||
WHERE `di`.`id_domain` = :domainid AND `p`.`id` = `di`.`id_ipandports`
|
WHERE `di`.`id_domain` = :domainid AND `p`.`id` = `di`.`id_ipandports`
|
||||||
GROUP BY `p`.`ip`;
|
GROUP BY `p`.`ip`;
|
||||||
");
|
");
|
||||||
Database::pexecute($result_ip_stmt, array(
|
Database::pexecute($result_ip_stmt, array(
|
||||||
'domainid' => $domain_id
|
'domainid' => $domain_id
|
||||||
));
|
));
|
||||||
@@ -276,7 +304,7 @@ class Dns
|
|||||||
if ($record == '@SPF@') {
|
if ($record == '@SPF@') {
|
||||||
$txt_content = Settings::Get('spf.spf_entry');
|
$txt_content = Settings::Get('spf.spf_entry');
|
||||||
$zonerecords[] = new DnsEntry('@', 'TXT', self::encloseTXTContent($txt_content));
|
$zonerecords[] = new DnsEntry('@', 'TXT', self::encloseTXTContent($txt_content));
|
||||||
} elseif ($record == 'dkim_' . $domain['dkim_id'] . '._domainkey' && ! empty($dkim_entries)) {
|
} elseif ($record == 'dkim' . $domain['dkim_id'] . '._domainkey' && ! empty($dkim_entries)) {
|
||||||
// check for multiline entry
|
// check for multiline entry
|
||||||
$multiline = false;
|
$multiline = false;
|
||||||
if (substr($dkim_entries[0], 0, 1) == '(') {
|
if (substr($dkim_entries[0], 0, 1) == '(') {
|
||||||
@@ -302,6 +330,7 @@ class Dns
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($caa_entries as $entry) {
|
foreach ($caa_entries as $entry) {
|
||||||
|
if (empty($entry)) continue;
|
||||||
$zonerecords[] = new DnsEntry('@', 'CAA', $entry);
|
$zonerecords[] = new DnsEntry('@', 'CAA', $entry);
|
||||||
// additional required records by subdomain setting
|
// additional required records by subdomain setting
|
||||||
if ($domain['wwwserveralias'] == '1') {
|
if ($domain['wwwserveralias'] == '1') {
|
||||||
|
|||||||
@@ -329,13 +329,9 @@ class Domain
|
|||||||
public static function doLetsEncryptCleanUp($domainname = null)
|
public static function doLetsEncryptCleanUp($domainname = null)
|
||||||
{
|
{
|
||||||
// @ see \Froxlor\Cron\Http\LetsEncrypt\AcmeSh.php
|
// @ see \Froxlor\Cron\Http\LetsEncrypt\AcmeSh.php
|
||||||
$acmesh = "/root/.acme.sh/acme.sh";
|
$acmesh = \Froxlor\Cron\Http\LetsEncrypt\AcmeSh::getAcmeSh();
|
||||||
if (file_exists($acmesh)) {
|
if (file_exists($acmesh)) {
|
||||||
$certificate_folder = dirname($acmesh) . "/" . $domainname;
|
$certificate_folder = \Froxlor\Cron\Http\LetsEncrypt\AcmeSh::getWorkingDirFromEnv($domainname);
|
||||||
if (\Froxlor\Settings::Get('system.leecc') > 0) {
|
|
||||||
$certificate_folder .= "_ecc";
|
|
||||||
}
|
|
||||||
$certificate_folder = \Froxlor\FileDir::makeCorrectDir($certificate_folder);
|
|
||||||
if (file_exists($certificate_folder)) {
|
if (file_exists($certificate_folder)) {
|
||||||
$params = " --remove -d " . $domainname;
|
$params = " --remove -d " . $domainname;
|
||||||
if (\Froxlor\Settings::Get('system.leecc') > 0) {
|
if (\Froxlor\Settings::Get('system.leecc') > 0) {
|
||||||
|
|||||||
@@ -7,17 +7,17 @@ final class Froxlor
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Main version variable
|
// Main version variable
|
||||||
const VERSION = '0.10.16';
|
const VERSION = '0.10.24';
|
||||||
|
|
||||||
// Database version (YYYYMMDDC where C is a daily counter)
|
// Database version (YYYYMMDDC where C is a daily counter)
|
||||||
const DBVERSION = '202004140';
|
const DBVERSION = '202101200';
|
||||||
|
|
||||||
// Distribution branding-tag (used for Debian etc.)
|
// Distribution branding-tag (used for Debian etc.)
|
||||||
const BRANDING = '';
|
const BRANDING = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return path to where froxlor is installed, e.g.
|
* return path to where froxlor is installed, e.g.
|
||||||
* /var/www/froxlor
|
* /var/www/froxlor/
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ class PhpHelper
|
|||||||
*
|
*
|
||||||
* @return void|boolean
|
* @return void|boolean
|
||||||
*/
|
*/
|
||||||
public static function phpErrHandler($errno, $errstr, $errfile, $errline, $errcontext)
|
public static function phpErrHandler($errno, $errstr, $errfile, $errline, $errcontext = array())
|
||||||
{
|
{
|
||||||
if (! (error_reporting() & $errno)) {
|
if (! (error_reporting() & $errno)) {
|
||||||
// This error code is not included in error_reporting
|
// This error code is not included in error_reporting
|
||||||
@@ -223,9 +223,17 @@ class PhpHelper
|
|||||||
*/
|
*/
|
||||||
public static function gethostbynamel6($host, $try_a = true)
|
public static function gethostbynamel6($host, $try_a = true)
|
||||||
{
|
{
|
||||||
$dns6 = dns_get_record($host, DNS_AAAA);
|
$dns6 = @dns_get_record($host, DNS_AAAA);
|
||||||
|
if (!is_array($dns6)) {
|
||||||
|
// no record or failed to check
|
||||||
|
$dns6 = [];
|
||||||
|
}
|
||||||
if ($try_a == true) {
|
if ($try_a == true) {
|
||||||
$dns4 = dns_get_record($host, DNS_A);
|
$dns4 = @dns_get_record($host, DNS_A);
|
||||||
|
if (!is_array($dns4)) {
|
||||||
|
// no record or failed to check
|
||||||
|
$dns4 = [];
|
||||||
|
}
|
||||||
$dns = array_merge($dns4, $dns6);
|
$dns = array_merge($dns4, $dns6);
|
||||||
} else {
|
} else {
|
||||||
$dns = $dns6;
|
$dns = $dns6;
|
||||||
@@ -382,4 +390,33 @@ class PhpHelper
|
|||||||
}
|
}
|
||||||
return $returnval;
|
return $returnval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function to check a super-global passed by reference
|
||||||
|
* so it gets automatically updated
|
||||||
|
*
|
||||||
|
* @param array $global
|
||||||
|
* @param \voku\helper\AntiXSS $antiXss
|
||||||
|
*/
|
||||||
|
public static function cleanGlobal(&$global, &$antiXss)
|
||||||
|
{
|
||||||
|
$ignored_fields = [
|
||||||
|
'system_default_vhostconf',
|
||||||
|
'system_default_sslvhostconf',
|
||||||
|
'system_apache_globaldiropt',
|
||||||
|
'specialsettings',
|
||||||
|
'ssl_specialsettings',
|
||||||
|
'default_vhostconf_domain',
|
||||||
|
'ssl_default_vhostconf_domain',
|
||||||
|
'filecontent'
|
||||||
|
];
|
||||||
|
if (isset($global) && ! empty($global)) {
|
||||||
|
$tmp = $global;
|
||||||
|
foreach ($tmp as $index => $value) {
|
||||||
|
if (!in_array($index, $ignored_fields)) {
|
||||||
|
$global[$index] = $antiXss->xss_clean($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ class Store
|
|||||||
if ($returnvalue !== false) {
|
if ($returnvalue !== false) {
|
||||||
\Froxlor\System\Cronjob::inserttask('4');
|
\Froxlor\System\Cronjob::inserttask('4');
|
||||||
}
|
}
|
||||||
return false;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function storeSettingHostname($fieldname, $fielddata, $newfieldvalue)
|
public static function storeSettingHostname($fieldname, $fielddata, $newfieldvalue)
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ class Mailer extends \PHPMailer\PHPMailer\PHPMailer
|
|||||||
$this->Port = Settings::Get('system.mail_smtp_port');
|
$this->Port = Settings::Get('system.mail_smtp_port');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* use froxlor's email-validation
|
||||||
|
*/
|
||||||
|
self::$validator = [
|
||||||
|
'\Froxlor\\Validate\\Validate',
|
||||||
|
'validateEmail'
|
||||||
|
];
|
||||||
|
|
||||||
if (self::ValidateAddress(Settings::Get('panel.adminmail')) !== false) {
|
if (self::ValidateAddress(Settings::Get('panel.adminmail')) !== false) {
|
||||||
// set return-to address and custom sender-name, see #76
|
// set return-to address and custom sender-name, see #76
|
||||||
$this->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
|
$this->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ class Form
|
|||||||
if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
|
if (! $only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option']))) {
|
||||||
$newfieldvalue = self::getFormFieldData($fieldname, $fielddetails, $input);
|
$newfieldvalue = self::getFormFieldData($fieldname, $fielddetails, $input);
|
||||||
if ($newfieldvalue != $fielddetails['value']) {
|
if ($newfieldvalue != $fielddetails['value']) {
|
||||||
if (($error = \Froxlor\Validate\Form::validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true) {
|
if (($error = \Froxlor\Validate\Form::validateFormField($fieldname, $fielddetails, $newfieldvalue)) != true) {
|
||||||
\Froxlor\UI\Response::standard_error($error, $fieldname);
|
\Froxlor\UI\Response::standard_error($error, $fieldname);
|
||||||
} else {
|
} else {
|
||||||
$changed_fields[$fieldname] = $newfieldvalue;
|
$changed_fields[$fieldname] = $newfieldvalue;
|
||||||
@@ -443,12 +443,12 @@ class Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if ($do_show) {
|
if ($do_show || (!$do_show && Settings::Get('system.hide_incompatible_settings') == '0')) {
|
||||||
$returnvalue = call_user_func(array(
|
$returnvalue = call_user_func(array(
|
||||||
'\\Froxlor\\UI\\Fields',
|
'\\Froxlor\\UI\\Fields',
|
||||||
'getFormFieldOutput' . ucfirst($fielddata['type'])
|
'getFormFieldOutput' . ucfirst($fielddata['type'])
|
||||||
), $fieldname, $fielddata, $do_show);
|
), $fieldname, $fielddata, $do_show);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -299,7 +299,6 @@ class HTML
|
|||||||
$checkbox = self::makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
|
$checkbox = self::makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
|
||||||
} else {
|
} else {
|
||||||
$checkbox = '<input type="hidden" name="delete_userfiles" value="0" />' . "\n";
|
$checkbox = '<input type="hidden" name="delete_userfiles" value="0" />' . "\n";
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = strtr($text, array(
|
$text = strtr($text, array(
|
||||||
|
|||||||
@@ -164,6 +164,9 @@ class Pagination
|
|||||||
// if a search is performed, the result-entries-count is irrelevant
|
// if a search is performed, the result-entries-count is irrelevant
|
||||||
// we do not want pagination
|
// we do not want pagination
|
||||||
$this->is_search = true;
|
$this->is_search = true;
|
||||||
|
// unset any limit as we do not have pagination when showing search-results
|
||||||
|
unset($this->data['sql_limit']);
|
||||||
|
unset($this->data['sql_offset']);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Data
|
|||||||
$newfieldvalue = str_replace("\t", " ", $newfieldvalue);
|
$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);
|
$returnvalue = \Froxlor\Validate\Validate::validateEmail($newfieldvalue);
|
||||||
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'url') {
|
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'url') {
|
||||||
$returnvalue = \Froxlor\Validate\Validate::validateUrl($newfieldvalue);
|
$returnvalue = \Froxlor\Validate\Validate::validateUrl($newfieldvalue);
|
||||||
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir') {
|
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir') {
|
||||||
@@ -194,7 +194,7 @@ class Data
|
|||||||
$newfieldvalue = str_replace("\t", " ", $newfieldvalue);
|
$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);
|
$returnvalue = \Froxlor\Validate\Validate::validateEmail($newfieldvalue);
|
||||||
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'url') {
|
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'url') {
|
||||||
$returnvalue = \Froxlor\Validate\Validate::validateUrl($newfieldvalue);
|
$returnvalue = \Froxlor\Validate\Validate::validateUrl($newfieldvalue);
|
||||||
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir') {
|
} elseif (isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir') {
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ namespace Froxlor\Validate;
|
|||||||
class Validate
|
class Validate
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const REGEX_DIR = '/^|(\/[\w-]+)+$/';
|
||||||
|
|
||||||
|
const REGEX_PORT = '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di';
|
||||||
|
|
||||||
|
const REGEX_CONF_TEXT = '/^[^\0]*$/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the given string by matching against the pattern, prints an error on failure and exits
|
* Validates the given string by matching against the pattern, prints an error on failure and exits
|
||||||
*
|
*
|
||||||
@@ -211,9 +217,9 @@ class Validate
|
|||||||
public static function validateDomain($domainname, $allow_underscore = false)
|
public static function validateDomain($domainname, $allow_underscore = false)
|
||||||
{
|
{
|
||||||
if (is_string($domainname)) {
|
if (is_string($domainname)) {
|
||||||
$char_validation = '([a-z\d](-*[a-z\d])*)(\.?([a-z\d](-*[a-z\d])*))*\.([a-z\d])+';
|
$char_validation = '([a-z\d](-*[a-z\d])*)(\.?([a-z\d](-*[a-z\d])*))*\.(xn\-\-)?([a-z\d])+';
|
||||||
if ($allow_underscore) {
|
if ($allow_underscore) {
|
||||||
$char_validation = '([a-z\d\_](-*[a-z\d\_])*)(\.([a-z\d\_](-*[a-z\d])*))*(\.?([a-z\d](-*[a-z\d])*))+\.([a-z\d])+';
|
$char_validation = '([a-z\d\_](-*[a-z\d\_])*)(\.([a-z\d\_](-*[a-z\d])*))*(\.?([a-z\d](-*[a-z\d])*))+\.(xn\-\-)?([a-z\d])+';
|
||||||
}
|
}
|
||||||
|
|
||||||
// valid chars check && overall length check && length of each label
|
// valid chars check && overall length check && length of each label
|
||||||
@@ -250,6 +256,10 @@ class Validate
|
|||||||
public static function validateEmail($email)
|
public static function validateEmail($email)
|
||||||
{
|
{
|
||||||
$email = strtolower($email);
|
$email = strtolower($email);
|
||||||
|
// as of php-7.1
|
||||||
|
if (defined('FILTER_FLAG_EMAIL_UNICODE')) {
|
||||||
|
return filter_var($email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE);
|
||||||
|
}
|
||||||
return filter_var($email, FILTER_VALIDATE_EMAIL);
|
return filter_var($email, FILTER_VALIDATE_EMAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4860,7 +4860,7 @@ aliases: files
|
|||||||
</visibility>
|
</visibility>
|
||||||
<visibility mode="true">{{settings.phpfpm.enabled_ownvhost}}
|
<visibility mode="true">{{settings.phpfpm.enabled_ownvhost}}
|
||||||
</visibility>
|
</visibility>
|
||||||
<command><![CDATA[a2dismod php7.0]]></command>
|
<command><![CDATA[a2dismod php7.3]]></command>
|
||||||
</commands>
|
</commands>
|
||||||
<commands index="5">
|
<commands index="5">
|
||||||
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
|
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
|
||||||
|
|||||||
@@ -1,7 +1,39 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<froxlor>
|
<froxlor>
|
||||||
<distribution name="RHEL / CentOS" version="7"
|
<distribution name="CentOS" version="7"
|
||||||
defaulteditor="/usr/bin/nano">
|
defaulteditor="/usr/bin/nano">
|
||||||
|
<defaults>
|
||||||
|
<property>
|
||||||
|
<varname>apacheconf_vhost</varname>
|
||||||
|
<settinggroup>system</settinggroup>
|
||||||
|
<value>/etc/httpd/conf.d/</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<varname>apacheconf_diroptions</varname>
|
||||||
|
<settinggroup>system</settinggroup>
|
||||||
|
<value>/etc/httpd/conf.d/</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<varname>apacheconf_htpasswddir</varname>
|
||||||
|
<settinggroup>system</settinggroup>
|
||||||
|
<value>/etc/httpd/froxlor-htpasswd/</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<varname>apachereload_command</varname>
|
||||||
|
<settinggroup>system</settinggroup>
|
||||||
|
<value>systemctl reload-or-restart httpd.service</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<varname>bindreload_command</varname>
|
||||||
|
<settinggroup>system</settinggroup>
|
||||||
|
<value>systemctl reload-or-restart named.service</value>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<varname>crondreload</varname>
|
||||||
|
<settinggroup>system</settinggroup>
|
||||||
|
<value>systemctl reload-or-restart crond.service</value>
|
||||||
|
</property>
|
||||||
|
</defaults>
|
||||||
<services>
|
<services>
|
||||||
<!-- HTTP -->
|
<!-- HTTP -->
|
||||||
<service type="http" title="{{lng.admin.configfiles.http}}">
|
<service type="http" title="{{lng.admin.configfiles.http}}">
|
||||||
@@ -61,6 +93,20 @@ Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath}
|
|||||||
<command><![CDATA[systemctl reload-or-restart httpd.service]]></command>
|
<command><![CDATA[systemctl reload-or-restart httpd.service]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
</service>
|
</service>
|
||||||
|
<!--DNS -->
|
||||||
|
<service type="dns" title="{{lng.admin.configfiles.dns}}">
|
||||||
|
<!--Bind9 -->
|
||||||
|
<daemon name="bind" title="Bind9 nameserver" default="true">
|
||||||
|
<install><![CDATA[yum install bind]]></install>
|
||||||
|
<command><![CDATA[ln -sv /etc/named /etc/bind]]></command>
|
||||||
|
<command><![CDATA[echo "include \"/etc/named.conf.local\";" >> /etc/named.conf]]></command>
|
||||||
|
<command><![CDATA[echo "include \"{{settings.system.bindconf_directory}}froxlor_bind.conf\";" >> /etc/named.conf.local]]></command>
|
||||||
|
<command><![CDATA[touch {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
|
||||||
|
<command><![CDATA[chown named:0 {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
|
||||||
|
<command><![CDATA[chmod 0644 {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
|
||||||
|
<command><![CDATA[systemctl restart named]]></command>
|
||||||
|
</daemon>
|
||||||
|
</service>
|
||||||
<!-- SMTP services -->
|
<!-- SMTP services -->
|
||||||
<service type="smtp" title="{{lng.admin.configfiles.smtp}}">
|
<service type="smtp" title="{{lng.admin.configfiles.smtp}}">
|
||||||
<!-- general SMTP commands -->
|
<!-- general SMTP commands -->
|
||||||
@@ -1825,6 +1871,7 @@ iterate_query = SELECT username AS user FROM mail_users
|
|||||||
<!-- Proftpd -->
|
<!-- Proftpd -->
|
||||||
<daemon name="proftpd" version="1.3" title="ProFTPd"
|
<daemon name="proftpd" version="1.3" title="ProFTPd"
|
||||||
default="true">
|
default="true">
|
||||||
|
<install><![CDATA[yum --enablerepo=extras install epel-release]]></install>
|
||||||
<install><![CDATA[yum install proftpd proftpd-mysql]]></install>
|
<install><![CDATA[yum install proftpd proftpd-mysql]]></install>
|
||||||
<file name="/etc/proftpd.conf" chown="root:0"
|
<file name="/etc/proftpd.conf" chown="root:0"
|
||||||
chmod="0600" backup="true">
|
chmod="0600" backup="true">
|
||||||
@@ -2295,9 +2342,10 @@ ControlsLog /var/log/proftpd/controls.log
|
|||||||
<!-- AWstats -->
|
<!-- AWstats -->
|
||||||
<daemon name="awstats"
|
<daemon name="awstats"
|
||||||
title="Awstats (webalizer alternative)">
|
title="Awstats (webalizer alternative)">
|
||||||
|
<install><![CDATA[yum install awstats]]></install>
|
||||||
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's/^DirData/# DirData/' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
<command><![CDATA[sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' {{settings.system.awstats_conf}}/awstats.model.conf]]></command>
|
||||||
<command><![CDATA[rm /etc/cron.d/awstats]]></command>
|
<command><![CDATA[rm /etc/cron.hourly/awstats]]></command>
|
||||||
</daemon>
|
</daemon>
|
||||||
<!-- libnss-mysql -->
|
<!-- libnss-mysql -->
|
||||||
<daemon name="libnss"
|
<daemon name="libnss"
|
||||||
2484
lib/configfiles/centos8.xml
Normal file
2484
lib/configfiles/centos8.xml
Normal file
File diff suppressed because it is too large
Load Diff
4100
lib/configfiles/focal.xml
Normal file
4100
lib/configfiles/focal.xml
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<froxlor>
|
<froxlor>
|
||||||
<distribution name="Ubuntu" codename="Xenial"
|
<distribution name="Ubuntu" codename="Xenial"
|
||||||
version="16.04" defaulteditor="/bin/nano">
|
version="16.04" defaulteditor="/bin/nano" deprecated="true">
|
||||||
<services>
|
<services>
|
||||||
<!-- HTTP -->
|
<!-- HTTP -->
|
||||||
<service type="http" title="{{lng.admin.configfiles.http}}">
|
<service type="http" title="{{lng.admin.configfiles.http}}">
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ return array(
|
|||||||
'value' => array()
|
'value' => array()
|
||||||
),
|
),
|
||||||
'diskspace' => array(
|
'diskspace' => array(
|
||||||
'label' => $lng['customer']['diskspace'],
|
'label' => $lng['customer']['diskspace'] . ' (' . $lng['customer']['mib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 6,
|
'maxlength' => 6,
|
||||||
@@ -175,7 +175,7 @@ return array(
|
|||||||
'ul_field' => $diskspace_ul
|
'ul_field' => $diskspace_ul
|
||||||
),
|
),
|
||||||
'traffic' => array(
|
'traffic' => array(
|
||||||
'label' => $lng['customer']['traffic'],
|
'label' => $lng['customer']['traffic'] . ' (' . $lng['customer']['gib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 4,
|
'maxlength' => 4,
|
||||||
@@ -215,7 +215,7 @@ return array(
|
|||||||
'ul_field' => $email_forwarders_ul
|
'ul_field' => $email_forwarders_ul
|
||||||
),
|
),
|
||||||
'email_quota' => array(
|
'email_quota' => array(
|
||||||
'label' => $lng['customer']['email_quota'],
|
'label' => $lng['customer']['email_quota'] . ' (' . $lng['customer']['mib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ return array(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
'diskspace' => array(
|
'diskspace' => array(
|
||||||
'label' => $lng['customer']['diskspace'],
|
'label' => $lng['customer']['diskspace'] . ' (' . $lng['customer']['mib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['diskspace'],
|
'value' => $result['diskspace'],
|
||||||
'maxlength' => 6,
|
'maxlength' => 6,
|
||||||
@@ -204,7 +204,7 @@ return array(
|
|||||||
'ul_field' => $diskspace_ul
|
'ul_field' => $diskspace_ul
|
||||||
),
|
),
|
||||||
'traffic' => array(
|
'traffic' => array(
|
||||||
'label' => $lng['customer']['traffic'],
|
'label' => $lng['customer']['traffic'] . ' (' . $lng['customer']['gib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['traffic'],
|
'value' => $result['traffic'],
|
||||||
'maxlength' => 4,
|
'maxlength' => 4,
|
||||||
@@ -244,7 +244,7 @@ return array(
|
|||||||
'ul_field' => $email_forwarders_ul
|
'ul_field' => $email_forwarders_ul
|
||||||
),
|
),
|
||||||
'email_quota' => array(
|
'email_quota' => array(
|
||||||
'label' => $lng['customer']['email_quota'],
|
'label' => $lng['customer']['email_quota'] . ' (' . $lng['customer']['mib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['email_quota'],
|
'value' => $result['email_quota'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ return array(
|
|||||||
'image' => 'icons/user_add.png',
|
'image' => 'icons/user_add.png',
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'diskspace' => array(
|
'diskspace' => array(
|
||||||
'label' => $lng['customer']['diskspace'],
|
'label' => $lng['customer']['diskspace'] . ' (' . $lng['customer']['mib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 16,
|
'maxlength' => 16,
|
||||||
@@ -198,7 +198,7 @@ return array(
|
|||||||
'ul_field' => $diskspace_ul
|
'ul_field' => $diskspace_ul
|
||||||
),
|
),
|
||||||
'traffic' => array(
|
'traffic' => array(
|
||||||
'label' => $lng['customer']['traffic'],
|
'label' => $lng['customer']['traffic'] . ' (' . $lng['customer']['gib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 14,
|
'maxlength' => 14,
|
||||||
@@ -238,7 +238,7 @@ return array(
|
|||||||
'ul_field' => $email_forwarders_ul
|
'ul_field' => $email_forwarders_ul
|
||||||
),
|
),
|
||||||
'email_quota' => array(
|
'email_quota' => array(
|
||||||
'label' => $lng['customer']['email_quota'],
|
'label' => $lng['customer']['email_quota']. ' (' . $lng['customer']['mib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ return array(
|
|||||||
'image' => 'icons/user_edit.png',
|
'image' => 'icons/user_edit.png',
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'diskspace' => array(
|
'diskspace' => array(
|
||||||
'label' => $lng['customer']['diskspace'],
|
'label' => $lng['customer']['diskspace'] . ' (' . $lng['customer']['mib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['diskspace'],
|
'value' => $result['diskspace'],
|
||||||
'maxlength' => 16,
|
'maxlength' => 16,
|
||||||
@@ -204,7 +204,7 @@ return array(
|
|||||||
'ul_field' => $diskspace_ul
|
'ul_field' => $diskspace_ul
|
||||||
),
|
),
|
||||||
'traffic' => array(
|
'traffic' => array(
|
||||||
'label' => $lng['customer']['traffic'],
|
'label' => $lng['customer']['traffic'] . ' (' . $lng['customer']['gib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['traffic'],
|
'value' => $result['traffic'],
|
||||||
'maxlength' => 14,
|
'maxlength' => 14,
|
||||||
@@ -244,7 +244,7 @@ return array(
|
|||||||
'ul_field' => $email_forwarders_ul
|
'ul_field' => $email_forwarders_ul
|
||||||
),
|
),
|
||||||
'email_quota' => array(
|
'email_quota' => array(
|
||||||
'label' => $lng['customer']['email_quota'],
|
'label' => $lng['customer']['email_quota'] . ' (' . $lng['customer']['mib'] . ')',
|
||||||
'type' => 'textul',
|
'type' => 'textul',
|
||||||
'value' => $result['email_quota'],
|
'value' => $result['email_quota'],
|
||||||
'maxlength' => 9,
|
'maxlength' => 9,
|
||||||
|
|||||||
@@ -265,7 +265,6 @@ return array(
|
|||||||
'desc' => $lng['serversettings']['ssl']['ssl_protocols']['description'],
|
'desc' => $lng['serversettings']['ssl']['ssl_protocols']['description'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => array(
|
'value' => array(
|
||||||
'TLSv1',
|
|
||||||
'TLSv1.2'
|
'TLSv1.2'
|
||||||
),
|
),
|
||||||
'values' => array(
|
'values' => array(
|
||||||
|
|||||||
@@ -23,12 +23,6 @@ return array(
|
|||||||
'title' => $lng['domains']['domain_import'],
|
'title' => $lng['domains']['domain_import'],
|
||||||
'image' => 'icons/domain_add.png',
|
'image' => 'icons/domain_add.png',
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'customerid' => array(
|
|
||||||
'label' => $lng['admin']['customer'],
|
|
||||||
'type' => 'select',
|
|
||||||
'select_var' => $customers,
|
|
||||||
'mandatory' => true
|
|
||||||
),
|
|
||||||
'separator' => array(
|
'separator' => array(
|
||||||
'label' => $lng['domains']['import_separator'],
|
'label' => $lng['domains']['import_separator'],
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
|
|||||||
32
lib/init.php
32
lib/init.php
@@ -20,6 +20,17 @@
|
|||||||
// define default theme for configurehint, etc.
|
// define default theme for configurehint, etc.
|
||||||
$_deftheme = 'Sparkle';
|
$_deftheme = 'Sparkle';
|
||||||
|
|
||||||
|
// validate correct php version
|
||||||
|
if (version_compare("7.1.0", PHP_VERSION, ">=")) {
|
||||||
|
// get hint-template
|
||||||
|
$vendor_hint = file_get_contents(dirname(__DIR__) . '/templates/' . $_deftheme . '/misc/phprequirementfailed.tpl');
|
||||||
|
// replace values
|
||||||
|
$vendor_hint = str_replace("<FROXLOR_PHPMIN>", "7.1.0", $vendor_hint);
|
||||||
|
$vendor_hint = str_replace("<CURRENT_VERSION>", PHP_VERSION, $vendor_hint);
|
||||||
|
$vendor_hint = str_replace("<CURRENT_YEAR>", date('Y', time()), $vendor_hint);
|
||||||
|
die($vendor_hint);
|
||||||
|
}
|
||||||
|
|
||||||
if (! file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
|
if (! file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
|
||||||
// get hint-template
|
// get hint-template
|
||||||
$vendor_hint = file_get_contents(dirname(__DIR__) . '/templates/' . $_deftheme . '/misc/vendormissinghint.tpl');
|
$vendor_hint = file_get_contents(dirname(__DIR__) . '/templates/' . $_deftheme . '/misc/vendormissinghint.tpl');
|
||||||
@@ -33,6 +44,8 @@ require dirname(__DIR__) . '/vendor/autoload.php';
|
|||||||
|
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
use Froxlor\Settings;
|
use Froxlor\Settings;
|
||||||
|
use voku\helper\AntiXSS;
|
||||||
|
use Froxlor\PhpHelper;
|
||||||
|
|
||||||
header("Content-Type: text/html; charset=UTF-8");
|
header("Content-Type: text/html; charset=UTF-8");
|
||||||
|
|
||||||
@@ -75,6 +88,17 @@ foreach ($_REQUEST as $key => $value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check for xss attempts and clean important globals
|
||||||
|
*/
|
||||||
|
$antiXss = new AntiXSS();
|
||||||
|
// check $_GET
|
||||||
|
PhpHelper::cleanGlobal($_GET, $antiXss);
|
||||||
|
// check $_POST
|
||||||
|
PhpHelper::cleanGlobal($_POST, $antiXss);
|
||||||
|
// check $_COOKIE
|
||||||
|
PhpHelper::cleanGlobal($_COOKIE, $antiXss);
|
||||||
|
|
||||||
unset($_);
|
unset($_);
|
||||||
unset($value);
|
unset($value);
|
||||||
unset($key);
|
unset($key);
|
||||||
@@ -462,9 +486,9 @@ unset($js);
|
|||||||
unset($css);
|
unset($css);
|
||||||
|
|
||||||
if (isset($_POST['action'])) {
|
if (isset($_POST['action'])) {
|
||||||
$action = $_POST['action'];
|
$action = trim(strip_tags($_POST['action']));
|
||||||
} elseif (isset($_GET['action'])) {
|
} elseif (isset($_GET['action'])) {
|
||||||
$action = $_GET['action'];
|
$action = trim(strip_tags($_GET['action']));
|
||||||
} else {
|
} else {
|
||||||
$action = '';
|
$action = '';
|
||||||
// clear request data
|
// clear request data
|
||||||
@@ -474,9 +498,9 @@ if (isset($_POST['action'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['page'])) {
|
if (isset($_POST['page'])) {
|
||||||
$page = $_POST['page'];
|
$page = trim(strip_tags($_POST['page']));
|
||||||
} elseif (isset($_GET['page'])) {
|
} elseif (isset($_GET['page'])) {
|
||||||
$page = $_GET['page'];
|
$page = trim(strip_tags($_GET['page']));
|
||||||
} else {
|
} else {
|
||||||
$page = '';
|
$page = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ define('TABLE_PANEL_TEMPLATES', 'panel_templates');
|
|||||||
define('TABLE_PANEL_TRAFFIC', 'panel_traffic');
|
define('TABLE_PANEL_TRAFFIC', 'panel_traffic');
|
||||||
define('TABLE_PANEL_TRAFFIC_ADMINS', 'panel_traffic_admins');
|
define('TABLE_PANEL_TRAFFIC_ADMINS', 'panel_traffic_admins');
|
||||||
define('TABLE_PANEL_DISKSPACE', 'panel_diskspace');
|
define('TABLE_PANEL_DISKSPACE', 'panel_diskspace');
|
||||||
define('TABLE_PANEL_DISKSPACE_ADMINS', 'panel_diskspace_admins');
|
|
||||||
define('TABLE_PANEL_LANGUAGE', 'panel_languages');
|
define('TABLE_PANEL_LANGUAGE', 'panel_languages');
|
||||||
define('TABLE_PANEL_IPSANDPORTS', 'panel_ipsandports');
|
define('TABLE_PANEL_IPSANDPORTS', 'panel_ipsandports');
|
||||||
define('TABLE_PANEL_LOG', 'panel_syslog');
|
define('TABLE_PANEL_LOG', 'panel_syslog');
|
||||||
|
|||||||
@@ -1080,8 +1080,6 @@ $lng['panel']['unlock'] = 'ontgrendelen';
|
|||||||
$lng['question']['customer_reallyunlock'] = 'Weet u zeker dat u klant %s? wilt ontgrendelen';
|
$lng['question']['customer_reallyunlock'] = 'Weet u zeker dat u klant %s? wilt ontgrendelen';
|
||||||
|
|
||||||
// ADDED IN FROXLOR 0.9.15-svn1
|
// ADDED IN FROXLOR 0.9.15-svn1
|
||||||
$lng['serversettings']['perl_server']['title'] = 'Server locatie Perl';
|
|
||||||
$lng['serversettings']['perl_server']['description'] = 'Standaard is ingesteld op de gids: <a target="blank" href="http://wiki.nginx.org/SimpleCGI">http://wiki.nginx.org/SimpleCGI</a>';
|
|
||||||
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend';
|
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend';
|
||||||
$lng['serversettings']['nginx_php_backend']['description'] = 'dit is waar het PHP-proces luistert naar verzoeken van nginx, kan een unix socket van ip:poort combinatie zijn';
|
$lng['serversettings']['nginx_php_backend']['description'] = 'dit is waar het PHP-proces luistert naar verzoeken van nginx, kan een unix socket van ip:poort combinatie zijn';
|
||||||
$lng['serversettings']['phpreload_command']['title'] = 'Commando voor het herladen van PHP';
|
$lng['serversettings']['phpreload_command']['title'] = 'Commando voor het herladen van PHP';
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ $lng['customer']['phone'] = 'Phone';
|
|||||||
$lng['customer']['fax'] = 'Fax';
|
$lng['customer']['fax'] = 'Fax';
|
||||||
$lng['customer']['email'] = 'Email';
|
$lng['customer']['email'] = 'Email';
|
||||||
$lng['customer']['customernumber'] = 'Customer ID';
|
$lng['customer']['customernumber'] = 'Customer ID';
|
||||||
$lng['customer']['diskspace'] = 'Webspace (MiB)';
|
$lng['customer']['diskspace'] = 'Webspace';
|
||||||
$lng['customer']['traffic'] = 'Traffic (GiB)';
|
$lng['customer']['traffic'] = 'Traffic';
|
||||||
$lng['customer']['mysqls'] = 'MySQL-databases';
|
$lng['customer']['mysqls'] = 'MySQL-databases';
|
||||||
$lng['customer']['emails'] = 'Email-addresses';
|
$lng['customer']['emails'] = 'Email-addresses';
|
||||||
$lng['customer']['accounts'] = 'Email-accounts';
|
$lng['customer']['accounts'] = 'Email-accounts';
|
||||||
@@ -71,6 +71,7 @@ $lng['customer']['subdomains'] = 'Subdomains';
|
|||||||
$lng['customer']['domains'] = 'Domains';
|
$lng['customer']['domains'] = 'Domains';
|
||||||
$lng['customer']['unlimited'] = '∞';
|
$lng['customer']['unlimited'] = '∞';
|
||||||
$lng['customer']['mib'] = 'MiB';
|
$lng['customer']['mib'] = 'MiB';
|
||||||
|
$lng['customer']['gib'] = 'GiB';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customermenue
|
* Customermenue
|
||||||
@@ -619,7 +620,7 @@ $lng['traffic']['months'][9] = "September";
|
|||||||
$lng['traffic']['months'][10] = "October";
|
$lng['traffic']['months'][10] = "October";
|
||||||
$lng['traffic']['months'][11] = "November";
|
$lng['traffic']['months'][11] = "November";
|
||||||
$lng['traffic']['months'][12] = "December";
|
$lng['traffic']['months'][12] = "December";
|
||||||
$lng['traffic']['mb'] = "Traffic (MiB)";
|
$lng['traffic']['mb'] = "Traffic";
|
||||||
$lng['traffic']['distribution'] = '<font color="#019522">FTP</font> | <font color="#0000FF">HTTP</font> | <font color="#800000">Mail</font>';
|
$lng['traffic']['distribution'] = '<font color="#019522">FTP</font> | <font color="#0000FF">HTTP</font> | <font color="#800000">Mail</font>';
|
||||||
$lng['traffic']['sumhttp'] = 'Total HTTP-Traffic';
|
$lng['traffic']['sumhttp'] = 'Total HTTP-Traffic';
|
||||||
$lng['traffic']['sumftp'] = 'Total FTP-Traffic';
|
$lng['traffic']['sumftp'] = 'Total FTP-Traffic';
|
||||||
@@ -701,6 +702,8 @@ $lng['dkim']['dkim_dkimkeys']['title'] = 'KeyList filename';
|
|||||||
$lng['dkim']['dkim_dkimkeys']['description'] = '<em>Filename</em> of the DKIM KeyList parameter specified in the dkim-milter configuration';
|
$lng['dkim']['dkim_dkimkeys']['description'] = '<em>Filename</em> of the DKIM KeyList parameter specified in the dkim-milter configuration';
|
||||||
$lng['dkim']['dkimrestart_command']['title'] = 'Milter restart command';
|
$lng['dkim']['dkimrestart_command']['title'] = 'Milter restart command';
|
||||||
$lng['dkim']['dkimrestart_command']['description'] = 'Please specify the restart command for the DKIM milter service';
|
$lng['dkim']['dkimrestart_command']['description'] = 'Please specify the restart command for the DKIM milter service';
|
||||||
|
$lng['dkim']['privkeysuffix']['title'] = 'Private keys suffix';
|
||||||
|
$lng['dkim']['privkeysuffix']['description'] = 'You can specify an (optional) filename extension/suffix for the generate dkim private keys. Some services like dkim-filter requires this to be empty';
|
||||||
|
|
||||||
// ADDED IN 1.2.19-svn9
|
// ADDED IN 1.2.19-svn9
|
||||||
|
|
||||||
@@ -805,7 +808,7 @@ $lng['serversettings']['mail_quota_enabled']['enforcelink'] = 'Click here to enf
|
|||||||
$lng['question']['admin_quotas_reallywipe'] = 'Do you really want to wipe all quotas on table mail_users? This cannot be reverted!';
|
$lng['question']['admin_quotas_reallywipe'] = 'Do you really want to wipe all quotas on table mail_users? This cannot be reverted!';
|
||||||
$lng['question']['admin_quotas_reallyenforce'] = 'Do you really want to enforce the default quota to all Users? This cannot be reverted!';
|
$lng['question']['admin_quotas_reallyenforce'] = 'Do you really want to enforce the default quota to all Users? This cannot be reverted!';
|
||||||
$lng['error']['vmailquotawrong'] = 'The quotasize must be positive number.';
|
$lng['error']['vmailquotawrong'] = 'The quotasize must be positive number.';
|
||||||
$lng['customer']['email_quota'] = 'E-mail quota (MiB)';
|
$lng['customer']['email_quota'] = 'E-mail quota';
|
||||||
$lng['customer']['email_imap'] = 'E-mail IMAP';
|
$lng['customer']['email_imap'] = 'E-mail IMAP';
|
||||||
$lng['customer']['email_pop3'] = 'E-mail POP3';
|
$lng['customer']['email_pop3'] = 'E-mail POP3';
|
||||||
$lng['customer']['mail_quota'] = 'Mailquota';
|
$lng['customer']['mail_quota'] = 'Mailquota';
|
||||||
@@ -1173,8 +1176,8 @@ $lng['panel']['unlock'] = 'Unlock';
|
|||||||
$lng['question']['customer_reallyunlock'] = 'Do you really want to unlock customer %s?';
|
$lng['question']['customer_reallyunlock'] = 'Do you really want to unlock customer %s?';
|
||||||
|
|
||||||
// ADDED IN FROXLOR 0.9.15
|
// ADDED IN FROXLOR 0.9.15
|
||||||
$lng['serversettings']['perl_server']['title'] = 'Perl server location';
|
$lng['serversettings']['perl_server']['title'] = 'Perl server socket location';
|
||||||
$lng['serversettings']['perl_server']['description'] = 'Default is set for using the guide found at: <a target="blank" href="http://wiki.nginx.org/SimpleCGI">http://wiki.nginx.org/SimpleCGI</a>';
|
$lng['serversettings']['perl_server']['description'] = 'A simple guide can be found at: <a target="blank" href="https://www.nginx.com/resources/wiki/start/topics/examples/fcgiwrap/">nginx.com</a>';
|
||||||
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend';
|
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend';
|
||||||
$lng['serversettings']['nginx_php_backend']['description'] = 'this is where the PHP process is listening for requests from nginx, can be a unix socket of ip:port combination<br />*NOT used with php-fpm';
|
$lng['serversettings']['nginx_php_backend']['description'] = 'this is where the PHP process is listening for requests from nginx, can be a unix socket of ip:port combination<br />*NOT used with php-fpm';
|
||||||
$lng['serversettings']['phpreload_command']['title'] = 'PHP reload command';
|
$lng['serversettings']['phpreload_command']['title'] = 'PHP reload command';
|
||||||
@@ -1540,9 +1543,9 @@ $lng['mysql']['size'] = 'Size';
|
|||||||
|
|
||||||
$lng['error']['invalidhostname'] = 'Hostname needs to be a valid domain. It can\'t be empty nor can it consist only of whitespaces';
|
$lng['error']['invalidhostname'] = 'Hostname needs to be a valid domain. It can\'t be empty nor can it consist only of whitespaces';
|
||||||
|
|
||||||
$lng['traffic']['http'] = 'HTTP (MiB)';
|
$lng['traffic']['http'] = 'HTTP';
|
||||||
$lng['traffic']['ftp'] = 'FTP (MiB)';
|
$lng['traffic']['ftp'] = 'FTP';
|
||||||
$lng['traffic']['mail'] = 'Mail (MiB)';
|
$lng['traffic']['mail'] = 'Mail';
|
||||||
|
|
||||||
// ADDED IN 0.9.27-svn1
|
// ADDED IN 0.9.27-svn1
|
||||||
$lng['serversettings']['mod_fcgid']['idle_timeout']['title'] = 'Idle Timeout';
|
$lng['serversettings']['mod_fcgid']['idle_timeout']['title'] = 'Idle Timeout';
|
||||||
@@ -1993,7 +1996,7 @@ $lng['serversettings']['leapiversion']['title'] = "Choose Let's Encrypt ACME imp
|
|||||||
$lng['serversettings']['leapiversion']['description'] = "Currently only ACME v2 implementation for Let's Encrypt is supported.";
|
$lng['serversettings']['leapiversion']['description'] = "Currently only ACME v2 implementation for Let's Encrypt is supported.";
|
||||||
$lng['admin']['phpsettings']['pass_authorizationheader'] = 'Add "-pass-header Authorization" / "CGIPassAuth On" to vhosts';
|
$lng['admin']['phpsettings']['pass_authorizationheader'] = 'Add "-pass-header Authorization" / "CGIPassAuth On" to vhosts';
|
||||||
$lng['serversettings']['ssl']['ssl_protocols']['title'] = 'Configure the TLS protocol version';
|
$lng['serversettings']['ssl']['ssl_protocols']['title'] = 'Configure the TLS protocol version';
|
||||||
$lng['serversettings']['ssl']['ssl_protocols']['description'] = 'This is a list of ssl protocols that you want (or don\'t want) to use when using SSL. <b>Notice:</b> Some older browsers may not support the newest protcol versions.<br /><br /><b>Default value is:</b><pre>TLSv1, TLSv1.2</pre>';
|
$lng['serversettings']['ssl']['ssl_protocols']['description'] = 'This is a list of ssl protocols that you want (or don\'t want) to use when using SSL. <b>Notice:</b> Some older browsers may not support the newest protcol versions.<br /><br /><b>Default value is:</b><pre>TLSv1.2</pre>';
|
||||||
$lng['serversettings']['phpfpm_settings']['limit_extensions']['title'] = 'Allowed extensions';
|
$lng['serversettings']['phpfpm_settings']['limit_extensions']['title'] = 'Allowed extensions';
|
||||||
$lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] = 'Limits the extensions of the main script FPM will allow to parse. This can prevent configuration mistakes on the web server side. You should only limit FPM to .php extensions to prevent malicious users to use other extensions to execute php code. Default value: .php';
|
$lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] = 'Limits the extensions of the main script FPM will allow to parse. This can prevent configuration mistakes on the web server side. You should only limit FPM to .php extensions to prevent malicious users to use other extensions to execute php code. Default value: .php';
|
||||||
$lng['phpfpm']['ini_flags'] = 'Enter possible <strong>php_flag</strong>s for php.ini. One entry per line';
|
$lng['phpfpm']['ini_flags'] = 'Enter possible <strong>php_flag</strong>s for php.ini. One entry per line';
|
||||||
@@ -2038,7 +2041,7 @@ $lng['apikeys']['valid_until_help'] = 'Date until valid, format YYYY-MM-DD';
|
|||||||
$lng['serversettings']['enable_api']['title'] = 'Enable external API usage';
|
$lng['serversettings']['enable_api']['title'] = 'Enable external API usage';
|
||||||
$lng['serversettings']['enable_api']['description'] = 'In order to use the froxlor API you need to activate this option. For more detailed information see <a href="https://api.froxlor.org/" target="_new">https://api.froxlor.org/</a>';
|
$lng['serversettings']['enable_api']['description'] = 'In order to use the froxlor API you need to activate this option. For more detailed information see <a href="https://api.froxlor.org/" target="_new">https://api.froxlor.org/</a>';
|
||||||
$lng['serversettings']['dhparams_file']['title'] = 'DHParams file (Diffie–Hellman key exchange)';
|
$lng['serversettings']['dhparams_file']['title'] = 'DHParams file (Diffie–Hellman key exchange)';
|
||||||
$lng['serversettings']['dhparams_file']['description'] = 'If a dhparams.pem file is specified here it will be included in the webserver configuration. Leave empty to disable.<br>Example: /etc/apache2/ssl/dhparams.pem<br><br>If the file does not exist, it will be created automatically with the following command: <em>openssl dhparam -out /etc/apache2/ssl/dhparams.pem 4096<em>. It is recommended to create the file prior to specifying it here as the creation takes quite a while and blocks the cronjob.';
|
$lng['serversettings']['dhparams_file']['description'] = 'If a dhparams.pem file is specified here it will be included in the webserver configuration. Leave empty to disable.<br>Example: /etc/ssl/webserver/dhparams.pem<br><br>If the file does not exist, it will be created automatically with the following command: <em>openssl dhparam -out /etc/ssl/webserver/dhparams.pem 4096<em>. It is recommended to create the file prior to specifying it here as the creation takes quite a while and blocks the cronjob.';
|
||||||
$lng['2fa']['2fa'] = '2FA options';
|
$lng['2fa']['2fa'] = '2FA options';
|
||||||
$lng['2fa']['2fa_enabled'] = 'Activate Two-factor authentication (2FA)';
|
$lng['2fa']['2fa_enabled'] = 'Activate Two-factor authentication (2FA)';
|
||||||
$lng['login']['2fa'] = 'Two-factor authentication (2FA)';
|
$lng['login']['2fa'] = 'Two-factor authentication (2FA)';
|
||||||
@@ -2080,7 +2083,7 @@ $lng['serversettings']['default_sslvhostconf']['title'] = 'Default SSL vHost-set
|
|||||||
$lng['serversettings']['includedefault_sslvhostconf'] = 'Include non-SSL vHost-settings in SSL-vHost';
|
$lng['serversettings']['includedefault_sslvhostconf'] = 'Include non-SSL vHost-settings in SSL-vHost';
|
||||||
$lng['admin']['ownsslvhostsettings'] = 'Own SSL vHost-settings';
|
$lng['admin']['ownsslvhostsettings'] = 'Own SSL vHost-settings';
|
||||||
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Default SSL vHost-settings for every domain container';
|
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Default SSL vHost-settings for every domain container';
|
||||||
$lng['customer']['total_diskspace'] = 'Total diskspace (MiB)';
|
$lng['customer']['total_diskspace'] = 'Total diskspace';
|
||||||
$lng['admin']['domain_override_tls'] = 'Override system TLS settings';
|
$lng['admin']['domain_override_tls'] = 'Override system TLS settings';
|
||||||
$lng['domains']['isaliasdomainof'] = 'Is aliasdomain for %s';
|
$lng['domains']['isaliasdomainof'] = 'Is aliasdomain for %s';
|
||||||
$lng['serversettings']['apply_specialsettings_default']['title'] = 'Default value for "' . $lng['admin']['specialsettingsforsubdomains'] . "' setting when editing a domain";
|
$lng['serversettings']['apply_specialsettings_default']['title'] = 'Default value for "' . $lng['admin']['specialsettingsforsubdomains'] . "' setting when editing a domain";
|
||||||
@@ -2098,3 +2101,6 @@ $lng['serversettings']['phpfpm_settings']['custom_config']['description'] = 'Add
|
|||||||
|
|
||||||
$lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat setting';
|
$lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat setting';
|
||||||
$lng['serversettings']['awstats']['logformat']['description'] = 'If you use customized logformat for your webserver, you need change the awstats LogFormat too.<br/>Default is 1. For more information check documentation <a target="_blank" href="https://awstats.sourceforge.io/docs/awstats_config.html#LogFormat">here</a>.';
|
$lng['serversettings']['awstats']['logformat']['description'] = 'If you use customized logformat for your webserver, you need change the awstats LogFormat too.<br/>Default is 1. For more information check documentation <a target="_blank" href="https://awstats.sourceforge.io/docs/awstats_config.html#LogFormat">here</a>.';
|
||||||
|
$lng['error']['cannotdeletesuperadmin'] = 'The first admin cannot be deleted.';
|
||||||
|
$lng['error']['no_wwwcnamae_ifwwwalias'] = 'Cannot set CNAME record for "www" as domain is set to generate a www-alias. Please change settings to either "No alias" or "Wildcard alias"';
|
||||||
|
$lng['serversettings']['hide_incompatible_settings'] = 'Hide incompatible settings';
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ $lng['customer']['phone'] = 'Telefon';
|
|||||||
$lng['customer']['fax'] = 'Fax';
|
$lng['customer']['fax'] = 'Fax';
|
||||||
$lng['customer']['email'] = 'E-Mail-Adresse';
|
$lng['customer']['email'] = 'E-Mail-Adresse';
|
||||||
$lng['customer']['customernumber'] = 'Kundennummer';
|
$lng['customer']['customernumber'] = 'Kundennummer';
|
||||||
$lng['customer']['diskspace'] = 'Webspace (MiB)';
|
$lng['customer']['diskspace'] = 'Webspace';
|
||||||
$lng['customer']['traffic'] = 'Traffic (GiB)';
|
$lng['customer']['traffic'] = 'Traffic';
|
||||||
$lng['customer']['mysqls'] = 'MySQL-Datenbanken';
|
$lng['customer']['mysqls'] = 'MySQL-Datenbanken';
|
||||||
$lng['customer']['emails'] = 'E-Mail-Adressen';
|
$lng['customer']['emails'] = 'E-Mail-Adressen';
|
||||||
$lng['customer']['accounts'] = 'E-Mail-Konten';
|
$lng['customer']['accounts'] = 'E-Mail-Konten';
|
||||||
@@ -612,7 +612,7 @@ $lng['traffic']['months'][9] = "September";
|
|||||||
$lng['traffic']['months'][10] = "Oktober";
|
$lng['traffic']['months'][10] = "Oktober";
|
||||||
$lng['traffic']['months'][11] = "November";
|
$lng['traffic']['months'][11] = "November";
|
||||||
$lng['traffic']['months'][12] = "Dezember";
|
$lng['traffic']['months'][12] = "Dezember";
|
||||||
$lng['traffic']['mb'] = "Traffic (MiB)";
|
$lng['traffic']['mb'] = "Traffic";
|
||||||
$lng['traffic']['day'] = "Tag";
|
$lng['traffic']['day'] = "Tag";
|
||||||
$lng['traffic']['distribution'] = '<span color="#019522">FTP</span> | <span color="#0000FF">HTTP</span> | <span color="#800000">Mail</span>';
|
$lng['traffic']['distribution'] = '<span color="#019522">FTP</span> | <span color="#0000FF">HTTP</span> | <span color="#800000">Mail</span>';
|
||||||
$lng['traffic']['sumhttp'] = 'Gesamt HTTP-Traffic';
|
$lng['traffic']['sumhttp'] = 'Gesamt HTTP-Traffic';
|
||||||
@@ -695,6 +695,8 @@ $lng['dkim']['dkim_dkimkeys']['title'] = 'KeyList Dateiname';
|
|||||||
$lng['dkim']['dkim_dkimkeys']['description'] = 'Dateiname der DKIM-KeyList-Angabe aus der DKIM-Milter-Konfigurationsdatei.';
|
$lng['dkim']['dkim_dkimkeys']['description'] = 'Dateiname der DKIM-KeyList-Angabe aus der DKIM-Milter-Konfigurationsdatei.';
|
||||||
$lng['dkim']['dkimrestart_command']['title'] = 'Milter-Restart-Kommando';
|
$lng['dkim']['dkimrestart_command']['title'] = 'Milter-Restart-Kommando';
|
||||||
$lng['dkim']['dkimrestart_command']['description'] = 'Wie lautet das Kommando zum Neustarten des DKIM-Milter-Dienstes?';
|
$lng['dkim']['dkimrestart_command']['description'] = 'Wie lautet das Kommando zum Neustarten des DKIM-Milter-Dienstes?';
|
||||||
|
$lng['dkim']['privkeysuffix']['title'] = 'Suffix für Private Keys';
|
||||||
|
$lng['dkim']['privkeysuffix']['description'] = 'Hier kann eine (optionale) Dateiendung für die generierten Private Keys angegeben werden. Manche Dienste, wie dkim-filter, erwarten, dass die Schlüssel keine Dateiendung haben (leer).';
|
||||||
|
|
||||||
// ADDED IN 1.2.19-svn9
|
// ADDED IN 1.2.19-svn9
|
||||||
|
|
||||||
@@ -800,7 +802,7 @@ $lng['serversettings']['mail_quota_enabled']['enforcelink'] = 'Hier klicken, um
|
|||||||
$lng['question']['admin_quotas_reallywipe'] = 'Sind Sie sicher, dass alle E-Mail-Kontingente aus der Tabelle mail_users entfernt werden sollen? Dieser Schritt kann nicht rückgängig gemacht werden!';
|
$lng['question']['admin_quotas_reallywipe'] = 'Sind Sie sicher, dass alle E-Mail-Kontingente aus der Tabelle mail_users entfernt werden sollen? Dieser Schritt kann nicht rückgängig gemacht werden!';
|
||||||
$lng['question']['admin_quotas_reallyenforce'] = 'Sind Sie sicher, dass Sie allen Benutzern das Default-Quota zuweisen wollen? Dies kann nicht rückgängig gemacht werden!';
|
$lng['question']['admin_quotas_reallyenforce'] = 'Sind Sie sicher, dass Sie allen Benutzern das Default-Quota zuweisen wollen? Dies kann nicht rückgängig gemacht werden!';
|
||||||
$lng['error']['vmailquotawrong'] = 'Die Kontingent-Größe muss positiv sein.';
|
$lng['error']['vmailquotawrong'] = 'Die Kontingent-Größe muss positiv sein.';
|
||||||
$lng['customer']['email_quota'] = 'E-Mail-Kontingent (MiB)';
|
$lng['customer']['email_quota'] = 'E-Mail-Kontingent';
|
||||||
$lng['customer']['email_imap'] = 'IMAP';
|
$lng['customer']['email_imap'] = 'IMAP';
|
||||||
$lng['customer']['email_pop3'] = 'POP3';
|
$lng['customer']['email_pop3'] = 'POP3';
|
||||||
$lng['customer']['mail_quota'] = 'E-Mail-Kontingent';
|
$lng['customer']['mail_quota'] = 'E-Mail-Kontingent';
|
||||||
@@ -1150,8 +1152,8 @@ $lng['panel']['unlock'] = 'entsperren';
|
|||||||
$lng['question']['customer_reallyunlock'] = 'Wollen Sie den Kunden "%s" wirklich entsperren?';
|
$lng['question']['customer_reallyunlock'] = 'Wollen Sie den Kunden "%s" wirklich entsperren?';
|
||||||
|
|
||||||
// ADDED IN FROXLOR 0.9.15
|
// ADDED IN FROXLOR 0.9.15
|
||||||
$lng['serversettings']['perl_server']['title'] = 'Perl-Server-Ort';
|
$lng['serversettings']['perl_server']['title'] = 'Perl Server-Socket';
|
||||||
$lng['serversettings']['perl_server']['description'] = 'Der Standardwert ist diesem Guide entnommen: <a target="blank" href="http://wiki.nginx.org/SimpleCGI">http://wiki.nginx.org/SimpleCGI</a>';
|
$lng['serversettings']['perl_server']['description'] = 'Eine einfache Anleitung hier zu findet man unter <a target="blank" href="http://wiki.nginx.org/SimpleCGIhttps://www.nginx.com/resources/wiki/start/topics/examples/fcgiwrap/">nginx.com</a>';
|
||||||
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx-PHP-Backend';
|
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx-PHP-Backend';
|
||||||
$lng['serversettings']['nginx_php_backend']['description'] = 'Dies ist das Backend, auf dem PHP auf Anfragen von Nginx hört. Kann ein UNIX Socket oder eine IP:Port Kombination sein<br />*NICHT relevant bei php-fpm';
|
$lng['serversettings']['nginx_php_backend']['description'] = 'Dies ist das Backend, auf dem PHP auf Anfragen von Nginx hört. Kann ein UNIX Socket oder eine IP:Port Kombination sein<br />*NICHT relevant bei php-fpm';
|
||||||
$lng['serversettings']['phpreload_command']['title'] = 'PHP-Reload-Befehl';
|
$lng['serversettings']['phpreload_command']['title'] = 'PHP-Reload-Befehl';
|
||||||
@@ -1266,9 +1268,9 @@ $lng['mysql']['size'] = 'Datenbankgröße';
|
|||||||
|
|
||||||
$lng['error']['invalidhostname'] = 'Hostname muss eine gültige Domain sein. Er darf weder leer sein noch nur aus Leerzeichen bestehen';
|
$lng['error']['invalidhostname'] = 'Hostname muss eine gültige Domain sein. Er darf weder leer sein noch nur aus Leerzeichen bestehen';
|
||||||
|
|
||||||
$lng['traffic']['http'] = 'HTTP (MiB)';
|
$lng['traffic']['http'] = 'HTTP';
|
||||||
$lng['traffic']['ftp'] = 'FTP (MiB)';
|
$lng['traffic']['ftp'] = 'FTP';
|
||||||
$lng['traffic']['mail'] = 'Mail (MiB)';
|
$lng['traffic']['mail'] = 'Mail';
|
||||||
|
|
||||||
// ADDED IN 0.9.27-svn1
|
// ADDED IN 0.9.27-svn1
|
||||||
$lng['serversettings']['mod_fcgid']['idle_timeout']['title'] = 'Idle-Timeout';
|
$lng['serversettings']['mod_fcgid']['idle_timeout']['title'] = 'Idle-Timeout';
|
||||||
@@ -1643,7 +1645,7 @@ $lng['serversettings']['leapiversion']['title'] = "Wählen Sie die Let's Encrypt
|
|||||||
$lng['serversettings']['leapiversion']['description'] = "Aktuell unterstützt froxlor lediglich die ACME v2 Implementierung von Let's Encrypt.";
|
$lng['serversettings']['leapiversion']['description'] = "Aktuell unterstützt froxlor lediglich die ACME v2 Implementierung von Let's Encrypt.";
|
||||||
$lng['admin']['phpsettings']['pass_authorizationheader'] = 'Füge "-pass-header Authorization" / "CGIPassAuth On" in Vhosts ein';
|
$lng['admin']['phpsettings']['pass_authorizationheader'] = 'Füge "-pass-header Authorization" / "CGIPassAuth On" in Vhosts ein';
|
||||||
$lng['serversettings']['ssl']['ssl_protocols']['title'] = 'SSL Protokollversion festlegen';
|
$lng['serversettings']['ssl']['ssl_protocols']['title'] = 'SSL Protokollversion festlegen';
|
||||||
$lng['serversettings']['ssl']['ssl_protocols']['description'] = 'Dies ist eine Liste von SSL/TLS Protokollversionen die genutzt werden sollen (oder auch nicht genutzt werden sollen), wenn SSL verwendet wird. <b>Hinweis:</b> Ältere Browser sind möglicherweise nicht vollständig zum neusten Protokoll kompatibel.<br /><br /><b>Standard-Wert ist:</b><pre>TLSv1, TLSv1.2</pre>';
|
$lng['serversettings']['ssl']['ssl_protocols']['description'] = 'Dies ist eine Liste von SSL/TLS Protokollversionen die genutzt werden sollen (oder auch nicht genutzt werden sollen), wenn SSL verwendet wird. <b>Hinweis:</b> Ältere Browser sind möglicherweise nicht vollständig zum neusten Protokoll kompatibel.<br /><br /><b>Standard-Wert ist:</b><pre>TLSv1.2</pre>';
|
||||||
$lng['serversettings']['phpfpm_settings']['limit_extensions']['title'] = 'Erlaubte Dateiendungen';
|
$lng['serversettings']['phpfpm_settings']['limit_extensions']['title'] = 'Erlaubte Dateiendungen';
|
||||||
$lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] = 'Beschränkt die Dateierweiterungen des Haupt-Skripts, das FPM zu parsen erlaubt. Dies kann Konfigurationsfehler auf der Webserverseite verhindern. Sie sollten FPM nur auf .php Erweiterungen beschränken, um zu verhindern, dass bösartige Nutzter andere Erweiterungen verwenden, um PHP Code auszuführen. Standardwert: .php';
|
$lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] = 'Beschränkt die Dateierweiterungen des Haupt-Skripts, das FPM zu parsen erlaubt. Dies kann Konfigurationsfehler auf der Webserverseite verhindern. Sie sollten FPM nur auf .php Erweiterungen beschränken, um zu verhindern, dass bösartige Nutzter andere Erweiterungen verwenden, um PHP Code auszuführen. Standardwert: .php';
|
||||||
$lng['phpfpm']['ini_flags'] = 'Mögliche <strong>php_flag</strong>s für die php.ini. Pro Zeile eine Direktive';
|
$lng['phpfpm']['ini_flags'] = 'Mögliche <strong>php_flag</strong>s für die php.ini. Pro Zeile eine Direktive';
|
||||||
@@ -1685,7 +1687,7 @@ $lng['apikeys']['valid_until_help'] = 'Datum Gültigkeitsende, Format JJJJ-MM-TT
|
|||||||
$lng['serversettings']['enable_api']['title'] = 'Aktiviere externe API Nutzung';
|
$lng['serversettings']['enable_api']['title'] = 'Aktiviere externe API Nutzung';
|
||||||
$lng['serversettings']['enable_api']['description'] = 'Um die froxlor API nutzen zu können, muss diese Option aktiviert sein. Für detaillierte Informationen siehe <a href="https://api.froxlor.org/" target="_new">https://api.froxlor.org/</a>';
|
$lng['serversettings']['enable_api']['description'] = 'Um die froxlor API nutzen zu können, muss diese Option aktiviert sein. Für detaillierte Informationen siehe <a href="https://api.froxlor.org/" target="_new">https://api.froxlor.org/</a>';
|
||||||
$lng['serversettings']['dhparams_file']['title'] = 'DHParams Datei (Diffie–Hellman key exchange)';
|
$lng['serversettings']['dhparams_file']['title'] = 'DHParams Datei (Diffie–Hellman key exchange)';
|
||||||
$lng['serversettings']['dhparams_file']['description'] = 'Wird eine dhparams.pem Datei hier angegeben, wir sie in die Webserver Konfiguration mit eingefügt.<br>Beispiel: /etc/apache2/ssl/dhparams.pem<br><br>Existiert die Datei nicht, wird sie wie folgt erstellt: <em>openssl dhparam -out /etc/apache2/ssl/dhparams.pem 4096<em>. Es wird empfohlen die Datei zu erstellen, bevor sie hier angegeben wird, da die Erstellung längere Zeit in Anspruch nimmt und den Cronjob blockiert.';
|
$lng['serversettings']['dhparams_file']['description'] = 'Wird eine dhparams.pem Datei hier angegeben, wir sie in die Webserver Konfiguration mit eingefügt.<br>Beispiel: /etc/ssl/webserver/dhparams.pem<br><br>Existiert die Datei nicht, wird sie wie folgt erstellt: <em>openssl dhparam -out /etc/ssl/webserver/dhparams.pem 4096<em>. Es wird empfohlen die Datei zu erstellen, bevor sie hier angegeben wird, da die Erstellung längere Zeit in Anspruch nimmt und den Cronjob blockiert.';
|
||||||
$lng['2fa']['2fa'] = '2FA Optionen';
|
$lng['2fa']['2fa'] = '2FA Optionen';
|
||||||
$lng['2fa']['2fa_enabled'] = 'Aktiviere Zwei-Faktor Authentifizierung (2FA)';
|
$lng['2fa']['2fa_enabled'] = 'Aktiviere Zwei-Faktor Authentifizierung (2FA)';
|
||||||
$lng['login']['2fa'] = 'Zwei-Faktor Authentifizierung (2FA)';
|
$lng['login']['2fa'] = 'Zwei-Faktor Authentifizierung (2FA)';
|
||||||
@@ -1727,7 +1729,7 @@ $lng['serversettings']['default_sslvhostconf']['title'] = 'Standard SSL vHost-Ei
|
|||||||
$lng['serversettings']['includedefault_sslvhostconf'] = 'Nicht-SSL vHost-Einstellungen in SSL-vHost inkludieren';
|
$lng['serversettings']['includedefault_sslvhostconf'] = 'Nicht-SSL vHost-Einstellungen in SSL-vHost inkludieren';
|
||||||
$lng['admin']['ownsslvhostsettings'] = 'Eigene SSL vHost-Einstellungen';
|
$lng['admin']['ownsslvhostsettings'] = 'Eigene SSL vHost-Einstellungen';
|
||||||
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Standard SSL vHost-Einstellungen für jeden Domain-Container';
|
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Standard SSL vHost-Einstellungen für jeden Domain-Container';
|
||||||
$lng['customer']['total_diskspace'] = 'Gesamtspeicherplatz (MiB)';
|
$lng['customer']['total_diskspace'] = 'Gesamtspeicherplatz';
|
||||||
$lng['admin']['domain_override_tls'] = 'Überschreibe System TLS Einstellungen';
|
$lng['admin']['domain_override_tls'] = 'Überschreibe System TLS Einstellungen';
|
||||||
$lng['domains']['isaliasdomainof'] = 'Ist Aliasdomain für %s';
|
$lng['domains']['isaliasdomainof'] = 'Ist Aliasdomain für %s';
|
||||||
$lng['serversettings']['apply_specialsettings_default']['title'] = 'Standardwert für "' . $lng['admin']['specialsettingsforsubdomains'] . "' Einstellung beim Bearbeiten einer Domain";
|
$lng['serversettings']['apply_specialsettings_default']['title'] = 'Standardwert für "' . $lng['admin']['specialsettingsforsubdomains'] . "' Einstellung beim Bearbeiten einer Domain";
|
||||||
@@ -1745,3 +1747,6 @@ $lng['serversettings']['phpfpm_settings']['custom_config']['description'] = 'Fü
|
|||||||
|
|
||||||
$lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat Einstellung';
|
$lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat Einstellung';
|
||||||
$lng['serversettings']['awstats']['logformat']['description'] = 'Wenn ein benutzerdefiniertes LogFormat beim Webserver verwendet wird, muss LogFormat von awstats ebenso angepasst werden.<br/>Standard ist 1. Für weitere Informationen siehe Dokumentation unter <a target="_blank" href="https://awstats.sourceforge.io/docs/awstats_config.html#LogFormat">hier</a>.';
|
$lng['serversettings']['awstats']['logformat']['description'] = 'Wenn ein benutzerdefiniertes LogFormat beim Webserver verwendet wird, muss LogFormat von awstats ebenso angepasst werden.<br/>Standard ist 1. Für weitere Informationen siehe Dokumentation unter <a target="_blank" href="https://awstats.sourceforge.io/docs/awstats_config.html#LogFormat">hier</a>.';
|
||||||
|
$lng['error']['cannotdeletesuperadmin'] = 'Der erste Administrator kann nicht gelöscht werden.';
|
||||||
|
$lng['error']['no_wwwcnamae_ifwwwalias'] = 'Es kann kein CNAME Eintrag für "www" angelegt werden, da die Domain einen www-Alias aktiviert hat. Ändere diese Einstellung auf "Kein Alias" oder "Wildcard Alias"';
|
||||||
|
$lng['serversettings']['hide_incompatible_settings'] = 'Inkompatible Einstellungen ausblenden';
|
||||||
|
|||||||
@@ -1107,9 +1107,6 @@ $lng['panel']['unlock'] = 'unlock';
|
|||||||
$lng['question']['customer_reallyunlock'] = 'Sei sicuro di voler sbloccare il cliente %s?';
|
$lng['question']['customer_reallyunlock'] = 'Sei sicuro di voler sbloccare il cliente %s?';
|
||||||
|
|
||||||
// ADDED IN FROXLOR 0.9.15-svn1
|
// ADDED IN FROXLOR 0.9.15-svn1
|
||||||
$lng['serversettings']['perl_server']['title'] = 'Localizzazione del server Perl';
|
|
||||||
$lng['serversettings']['perl_server']['description'] = 'Di default è impostato per utilizzare la guida disponibile sul sito: <a target="blank" href="http://wiki.nginx.org/SimpleCGI">http://wiki.nginx.org/SimpleCGI</a>';
|
|
||||||
|
|
||||||
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend';
|
$lng['serversettings']['nginx_php_backend']['title'] = 'Nginx PHP backend';
|
||||||
$lng['serversettings']['nginx_php_backend']['description'] = 'questo è dove in ascolto il processo PHP per le richieste da nginx, può essere un socket unix combinazione IP:Porta';
|
$lng['serversettings']['nginx_php_backend']['description'] = 'questo è dove in ascolto il processo PHP per le richieste da nginx, può essere un socket unix combinazione IP:Porta';
|
||||||
$lng['serversettings']['phpreload_command']['title'] = 'Comando riavvio PHP';
|
$lng['serversettings']['phpreload_command']['title'] = 'Comando riavvio PHP';
|
||||||
|
|||||||
@@ -14,6 +14,12 @@
|
|||||||
* @package Cron
|
* @package Cron
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// validate correct php version
|
||||||
|
if (version_compare("7.0.0", PHP_VERSION, ">=")) {
|
||||||
|
die('Froxlor requires at least php-7.0. Please validate that your php-cli version and the cron execution command are correct.');
|
||||||
|
}
|
||||||
|
|
||||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
\Froxlor\Cron\MasterCron::setArguments($argv);
|
\Froxlor\Cron\MasterCron::setArguments($argv);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
<else>
|
<else>
|
||||||
<div class="progress">∞
|
<div class="progress tipper" title="{$row['diskspace_used']} MiB {$lng['panel']['used']}">∞
|
||||||
<div class="bar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
<div class="bar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
</div>
|
</div>
|
||||||
</if>
|
</if>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
<else>
|
<else>
|
||||||
<div class="progress">∞
|
<div class="progress tipper" title="{$row['traffic_used']} GiB {$lng['panel']['used']}">∞
|
||||||
<div class="bar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
<div class="bar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
</div>
|
</div>
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
<else>
|
<else>
|
||||||
<div class="progress">∞
|
<div class="progress tipper" title="{$lng['panel']['used']}:<br>web: {$row['webspace_used']} {$lng['customer']['mib']}<br>mail: {$row['mailspace_used']} {$lng['customer']['mib']}<br>mysql: {$row['dbspace_used']} MiB">∞
|
||||||
<div class="bar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
<div class="bar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
</div>
|
</div>
|
||||||
</if>
|
</if>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
<else>
|
<else>
|
||||||
<div class="progress">∞
|
<div class="progress tipper" title="{$row['traffic_used']} GiB {$lng['panel']['used']}">∞
|
||||||
<div class="bar" aria-valuenow="{$traffic_percent}" aria-valuemin="0" aria-valuemax="100"></div>
|
<div class="bar" aria-valuenow="{$traffic_percent}" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
</div>
|
</div>
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user