Compare commits
137 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a37d795ff3 | ||
|
|
d9331cca61 | ||
|
|
f169129e27 | ||
|
|
746548492b | ||
|
|
4ad8b62576 | ||
|
|
1eed3d1166 | ||
|
|
6a32720c9a | ||
|
|
e389ae4bf8 | ||
|
|
970ecb469e | ||
|
|
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 | ||
|
|
b3db4dd887 | ||
|
|
14413a3e8d | ||
|
|
a02a081c6b | ||
|
|
43070e4808 | ||
|
|
98c636c282 | ||
|
|
8dace6eca5 | ||
|
|
78fc4f84b2 | ||
|
|
9018404faa | ||
|
|
8bdd843bd9 | ||
|
|
0d35f5cb29 | ||
|
|
6815c1c20b | ||
|
|
048e6c13ae | ||
|
|
aedb829a74 | ||
|
|
4745581720 | ||
|
|
489ccbe07a | ||
|
|
a46e7a3bc4 | ||
|
|
a4431e25d3 | ||
|
|
1fe9f1e9d6 | ||
|
|
13767df562 | ||
|
|
02c5f80854 | ||
|
|
d7550ae58a | ||
|
|
cf2c7fa31c | ||
|
|
32b6285589 | ||
|
|
7e361274c5 | ||
|
|
62ce21c9ec | ||
|
|
6b09720ef8 | ||
|
|
8807ae7dad | ||
|
|
5f3f208534 | ||
|
|
f11ceacf89 | ||
|
|
26e43077c2 | ||
|
|
d6c8b92523 | ||
|
|
03450dcfa2 | ||
|
|
f39aab6f32 | ||
|
|
7f999302fa | ||
|
|
8294985588 |
@@ -1,4 +0,0 @@
|
|||||||
codecov:
|
|
||||||
notify:
|
|
||||||
require_ci_to_pass: no
|
|
||||||
|
|
||||||
@@ -52,13 +52,10 @@ 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: "irc.freenode.org#froxlor"
|
irc: "chat.freenode.net#froxlor"
|
||||||
webhooks:
|
webhooks:
|
||||||
urls:
|
urls:
|
||||||
- https://webhooks.gitter.im/e/bdf91d1c3f745e51f796
|
- https://webhooks.gitter.im/e/bdf91d1c3f745e51f796
|
||||||
|
|||||||
2
2fa.php
2
2fa.php
@@ -38,7 +38,7 @@ if (AREA == 'admin') {
|
|||||||
}
|
}
|
||||||
$success_message = "";
|
$success_message = "";
|
||||||
|
|
||||||
$tfa = new \Froxlor\FroxlorTwoFactorAuth('Froxlor');
|
$tfa = new \Froxlor\FroxlorTwoFactorAuth('Froxlor ' . Settings::Get('system.hostname'));
|
||||||
|
|
||||||
// do the delete and then just show a success-message
|
// do the delete and then just show a success-message
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
|
|||||||
@@ -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',
|
||||||
@@ -122,10 +122,7 @@ return array(
|
|||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => true,
|
'default' => true,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') && (\Froxlor\Settings::Get('system.webserver') == "nginx" || (\Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1)) && call_user_func(array(
|
'visible' => \Froxlor\Settings::Get('system.use_ssl') && (\Froxlor\Settings::Get('system.webserver') == "nginx" || (\Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1))
|
||||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
|
||||||
'hasVhostContainerEnabled'
|
|
||||||
), true)
|
|
||||||
),
|
),
|
||||||
'system_leenabled' => array(
|
'system_leenabled' => array(
|
||||||
'label' => $lng['serversettings']['leenabled'],
|
'label' => $lng['serversettings']['leenabled'],
|
||||||
@@ -217,11 +214,11 @@ return array(
|
|||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField'
|
||||||
),
|
),
|
||||||
'system_disable_le_selfcheck' => array(
|
'system_disable_le_selfcheck' => array(
|
||||||
'label' => $lng['serversettings']['disable_le_selfcheck'],
|
'label' => $lng['serversettings']['le_domain_dnscheck'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'disable_le_selfcheck',
|
'varname' => 'le_domain_dnscheck',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => true,
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
|
|
||||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_domains");
|
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_domains");
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'd.domain' => $lng['domains']['domainname'],
|
'd.domain_ace' => $lng['domains']['domainname'],
|
||||||
'c.name' => $lng['customer']['name'],
|
'c.name' => $lng['customer']['name'],
|
||||||
'c.firstname' => $lng['customer']['firstname'],
|
'c.firstname' => $lng['customer']['firstname'],
|
||||||
'c.company' => $lng['customer']['company'],
|
'c.company' => $lng['customer']['company'],
|
||||||
@@ -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") . "\";");
|
||||||
|
|||||||
@@ -160,5 +160,14 @@ if ($page == 'ipsandports' || $page == 'overview') {
|
|||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_edit") . "\";");
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_edit") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} elseif ($action == 'jqCheckIP') {
|
||||||
|
$ip = $_POST['ip'] ?? "";
|
||||||
|
if ((filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE) == false) {
|
||||||
|
// returns notice if private network detected so we can display it
|
||||||
|
echo json_encode($lng['admin']['ipsandports']['ipnote']);
|
||||||
|
} else {
|
||||||
|
echo 0;
|
||||||
|
}
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
composer.lock
generated
11
composer.lock
generated
@@ -139,16 +139,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpmailer/phpmailer",
|
"name": "phpmailer/phpmailer",
|
||||||
"version": "v6.1.4",
|
"version": "v6.1.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||||
"reference": "c5e61d0729507049cec9673aa1a679f9adefd683"
|
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c5e61d0729507049cec9673aa1a679f9adefd683",
|
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
|
||||||
"reference": "c5e61d0729507049cec9673aa1a679f9adefd683",
|
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||||
"time": "2019-12-10T11:17:38+00:00"
|
"time": "2020-05-27T12:24:03+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/log",
|
"name": "psr/log",
|
||||||
@@ -2849,6 +2849,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "An XSL wrapper / extension to the PHP 5.x XSLTProcessor with Exception and extended Callback support",
|
"description": "An XSL wrapper / extension to the PHP 5.x XSLTProcessor with Exception and extended Callback support",
|
||||||
|
"abandoned": true,
|
||||||
"time": "2014-11-27T20:08:52+00:00"
|
"time": "2014-11-27T20:08:52+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if ($page == 'overview') {
|
|||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
|
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'd.domain' => $lng['domains']['domainname'],
|
'd.domain_ace' => $lng['domains']['domainname'],
|
||||||
'd.aliasdomain' => $lng['domains']['aliasdomain']
|
'd.aliasdomain' => $lng['domains']['aliasdomain']
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
define('AREA', 'customer');
|
define('AREA', 'customer');
|
||||||
require './lib/init.php';
|
require './lib/init.php';
|
||||||
|
|
||||||
use Froxlor\Api\Commands\SubDomains;
|
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
use Froxlor\Settings;
|
use Froxlor\Settings;
|
||||||
use Froxlor\Api\Commands\Emails as Emails;
|
use Froxlor\Api\Commands\Emails as Emails;
|
||||||
@@ -44,7 +43,7 @@ if ($page == 'overview') {
|
|||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
|
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'd.domain' => $lng['domains']['domainname'],
|
'd.domain_ace' => $lng['domains']['domainname'],
|
||||||
'm.email_full' => $lng['emails']['emailaddress'],
|
'm.email_full' => $lng['emails']['emailaddress'],
|
||||||
'm.destination' => $lng['emails']['forwarders']
|
'm.destination' => $lng['emails']['forwarders']
|
||||||
);
|
);
|
||||||
@@ -76,7 +75,7 @@ if ($page == 'overview') {
|
|||||||
$emails[$row['domain']][$row['email_full']] = $row;
|
$emails[$row['domain']][$row['email_full']] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
|
if ($paging->sortfield == 'd.domain_ace' && $paging->sortorder == 'desc') {
|
||||||
krsort($emails);
|
krsort($emails);
|
||||||
} else {
|
} else {
|
||||||
ksort($emails);
|
ksort($emails);
|
||||||
@@ -129,16 +128,15 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$json_result = SubDomains::getLocal($userinfo, [
|
$result_stmt = Database::prepare("
|
||||||
'sql_search' => [
|
SELECT COUNT(`id`) as emaildomains
|
||||||
'd.isemaildomain' => [
|
FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||||
'value' => 1,
|
WHERE `customerid`= :cid AND `isemaildomain` = '1'
|
||||||
'op' => '='
|
");
|
||||||
]
|
$result2 = Database::pexecute_first($result_stmt, array(
|
||||||
]
|
"cid" => $userinfo['customerid']
|
||||||
])->listing();
|
));
|
||||||
$result = json_decode($json_result, true)['data'];
|
$emaildomains_count = $result2['emaildomains'];
|
||||||
$emaildomains_count = $result['count'];
|
|
||||||
|
|
||||||
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) {
|
||||||
@@ -196,7 +194,7 @@ if ($page == 'overview') {
|
|||||||
$result_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
|
$result_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||||
WHERE `customerid`= :cid
|
WHERE `customerid`= :cid
|
||||||
AND `isemaildomain`='1'
|
AND `isemaildomain`='1'
|
||||||
ORDER BY `domain` ASC");
|
ORDER BY `domain_ace` ASC");
|
||||||
Database::pexecute($result_stmt, array(
|
Database::pexecute($result_stmt, array(
|
||||||
"cid" => $userinfo['customerid']
|
"cid" => $userinfo['customerid']
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -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 : "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
29
index.php
29
index.php
@@ -393,7 +393,7 @@ if ($action == 'forgotpwd') {
|
|||||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
$loginname = \Froxlor\Validate\Validate::validate($_POST['loginname'], 'loginname');
|
$loginname = \Froxlor\Validate\Validate::validate($_POST['loginname'], 'loginname');
|
||||||
$email = \Froxlor\Validate\Validate::validateEmail($_POST['loginemail'], 'email');
|
$email = \Froxlor\Validate\Validate::validateEmail($_POST['loginemail'], 'email');
|
||||||
$result_stmt = Database::prepare("SELECT `adminid`, `customerid`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language`, `deactivated` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
$result_stmt = Database::prepare("SELECT `adminid`, `customerid`, `customernumber`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language`, `deactivated` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||||
WHERE `loginname`= :loginname
|
WHERE `loginname`= :loginname
|
||||||
AND `email`= :email");
|
AND `email`= :email");
|
||||||
Database::pexecute($result_stmt, array(
|
Database::pexecute($result_stmt, array(
|
||||||
@@ -481,6 +481,10 @@ if ($action == 'forgotpwd') {
|
|||||||
|
|
||||||
$replace_arr = array(
|
$replace_arr = array(
|
||||||
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($user),
|
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($user),
|
||||||
|
'NAME' => $user['name'],
|
||||||
|
'FIRSTNAME' => $user['firstname'] ?? "",
|
||||||
|
'COMPANY' => $user['company'] ?? "",
|
||||||
|
'CUSTOMER_NO' => $user['customernumber'] ?? 0,
|
||||||
'USERNAME' => $loginname,
|
'USERNAME' => $loginname,
|
||||||
'LINK' => $activationlink
|
'LINK' => $activationlink
|
||||||
);
|
);
|
||||||
@@ -598,21 +602,18 @@ if ($action == 'resetpwd') {
|
|||||||
));
|
));
|
||||||
|
|
||||||
if ($result !== false) {
|
if ($result !== false) {
|
||||||
if ($result['admin'] == 1) {
|
try {
|
||||||
$new_password = \Froxlor\Validate\Validate::validate($_POST['new_password'], 'new password');
|
$new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], true);
|
||||||
$new_password_confirm = \Froxlor\Validate\Validate::validate($_POST['new_password_confirm'], 'new password confirm');
|
$new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], true);
|
||||||
} else {
|
} catch (Exception $e) {
|
||||||
$new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password');
|
$message = $e->getMessage();
|
||||||
$new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($new_password == '') {
|
if (empty($message) && (empty($new_password) || $new_password != $new_password_confirm)) {
|
||||||
$message = $new_password;
|
$message = $lng['error']['newpasswordconfirmerror'];
|
||||||
} elseif ($new_password_confirm == '') {
|
}
|
||||||
$message = $new_password_confirm;
|
|
||||||
} elseif ($new_password != $new_password_confirm) {
|
if (empty($message)) {
|
||||||
$message = $new_password . " != " . $new_password_confirm;
|
|
||||||
} else {
|
|
||||||
// Update user password
|
// Update user password
|
||||||
if ($result['admin'] == 1) {
|
if ($result['admin'] == 1) {
|
||||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_ADMINS . "`
|
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_ADMINS . "`
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ CREATE TABLE `panel_activation` (
|
|||||||
`creation` int(11) unsigned NOT NULL default '0',
|
`creation` int(11) unsigned NOT NULL default '0',
|
||||||
`activationcode` varchar(50) default NULL,
|
`activationcode` varchar(50) default NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_admins`;
|
DROP TABLE IF EXISTS `panel_admins`;
|
||||||
@@ -224,6 +224,7 @@ 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 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',
|
||||||
`aliasdomain` int(11) unsigned NULL,
|
`aliasdomain` int(11) unsigned NULL,
|
||||||
@@ -653,8 +654,8 @@ opcache.interned_strings_buffer'),
|
|||||||
('system', 'leregistered', '0'),
|
('system', 'leregistered', '0'),
|
||||||
('system', 'leaccount', ''),
|
('system', 'leaccount', ''),
|
||||||
('system', 'nssextrausers', '0'),
|
('system', 'nssextrausers', '0'),
|
||||||
('system', 'disable_le_selfcheck', '0'),
|
('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'),
|
||||||
@@ -703,8 +704,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.13'),
|
('panel', 'version', '0.10.21'),
|
||||||
('panel', 'db_version', '201912313');
|
('panel', 'db_version', '202009070');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_tasks`;
|
DROP TABLE IF EXISTS `panel_tasks`;
|
||||||
@@ -785,23 +786,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,
|
||||||
@@ -996,7 +980,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');
|
||||||
@@ -332,22 +333,29 @@ class FroxlorInstall
|
|||||||
$userdata .= "?>";
|
$userdata .= "?>";
|
||||||
|
|
||||||
// test if we can store the userdata.inc.php in ../lib
|
// test if we can store the userdata.inc.php in ../lib
|
||||||
|
$umask = @umask(077);
|
||||||
$userdata_file = dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php';
|
$userdata_file = dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php';
|
||||||
if ($fp = @fopen($userdata_file, 'w')) {
|
if (@touch($userdata_file) && @is_writable($userdata_file)) {
|
||||||
$result = @fputs($fp, $userdata, strlen($userdata));
|
$fp = @fopen($userdata_file, 'w');
|
||||||
|
@fputs($fp, $userdata, strlen($userdata));
|
||||||
@fclose($fp);
|
@fclose($fp);
|
||||||
$content .= $this->_status_message('green', 'OK');
|
$content .= $this->_status_message('green', 'OK');
|
||||||
chmod($userdata_file, 0440);
|
|
||||||
} elseif ($fp = @fopen('/tmp/userdata.inc.php', 'w')) {
|
|
||||||
$result = @fputs($fp, $userdata, strlen($userdata));
|
|
||||||
@fclose($fp);
|
|
||||||
$content .= $this->_status_message('orange', $this->_lng['install']['creating_configfile_temp']);
|
|
||||||
chmod('/tmp/userdata.inc.php', 0440);
|
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('red', $this->_lng['install']['creating_configfile_failed']);
|
@unlink($userdata_file);
|
||||||
$escpduserdata = nl2br(htmlspecialchars($userdata));
|
// try creating it in a temporary file
|
||||||
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";");
|
$temp_file = @tempnam(sys_get_temp_dir(), 'fx');
|
||||||
|
if ($temp_file) {
|
||||||
|
$fp = @fopen($temp_file, 'w');
|
||||||
|
@fputs($fp, $userdata, strlen($userdata));
|
||||||
|
@fclose($fp);
|
||||||
|
$content .= $this->_status_message('orange', sprintf($this->_lng['install']['creating_configfile_temp'], $temp_file));
|
||||||
|
} else {
|
||||||
|
$content .= $this->_status_message('red', $this->_lng['install']['creating_configfile_failed']);
|
||||||
|
$escpduserdata = nl2br(htmlspecialchars($userdata));
|
||||||
|
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@umask($umask);
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
@@ -497,6 +505,17 @@ 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');
|
||||||
|
|
||||||
@@ -563,7 +582,7 @@ class FroxlorInstall
|
|||||||
for ($i = 0; $i < sizeof($sql_query); $i ++) {
|
for ($i = 0; $i < sizeof($sql_query); $i ++) {
|
||||||
if (trim($sql_query[$i]) != '') {
|
if (trim($sql_query[$i]) != '') {
|
||||||
try {
|
try {
|
||||||
$result = $db->query($sql_query[$i]);
|
$db->query($sql_query[$i]);
|
||||||
} catch (\PDOException $e) {
|
} catch (\PDOException $e) {
|
||||||
$content .= $this->_status_message('red', $e->getMessage());
|
$content .= $this->_status_message('red', $e->getMessage());
|
||||||
$fatal_fail = true;
|
$fatal_fail = true;
|
||||||
@@ -730,7 +749,7 @@ class FroxlorInstall
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($do_backup) {
|
if ($do_backup) {
|
||||||
$command = $mysql_dump . " " . $this->_data['mysql_database'] . " -u " . $this->_data['mysql_root_user'] . " --password='" . $this->_data['mysql_root_pass'] . "' --result-file=" . $filename;
|
$command = $mysql_dump . " " . escapeshellarg($this->_data['mysql_database']) . " -u " . escapeshellarg($this->_data['mysql_root_user']) . " --password='" . escapeshellarg($this->_data['mysql_root_pass']) . "' --result-file=" . $filename;
|
||||||
$output = exec($command);
|
$output = exec($command);
|
||||||
if (stristr($output, "error")) {
|
if (stristr($output, "error")) {
|
||||||
$content .= $this->_status_message('red', $this->_lng['install']['backup_failed']);
|
$content .= $this->_status_message('red', $this->_lng['install']['backup_failed']);
|
||||||
@@ -833,6 +852,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;';
|
||||||
@@ -854,12 +899,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;';
|
||||||
@@ -911,7 +956,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
|
||||||
@@ -919,8 +964,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"';
|
||||||
@@ -930,6 +976,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
|
||||||
*
|
*
|
||||||
@@ -1266,6 +1331,39 @@ 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
|
||||||
|
|||||||
@@ -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';
|
||||||
@@ -86,7 +87,7 @@ $lng['install']['changing_data'] = 'Adjusting settings...';
|
|||||||
$lng['install']['creating_entries'] = 'Inserting new values...';
|
$lng['install']['creating_entries'] = 'Inserting new values...';
|
||||||
$lng['install']['adding_admin_user'] = 'Creating admin-account...';
|
$lng['install']['adding_admin_user'] = 'Creating admin-account...';
|
||||||
$lng['install']['creating_configfile'] = 'Creating configfile...';
|
$lng['install']['creating_configfile'] = 'Creating configfile...';
|
||||||
$lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to ' . dirname(dirname(__DIR__)) . '/lib/.';
|
$lng['install']['creating_configfile_temp'] = 'File was saved in %s, please move to ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php';
|
||||||
$lng['install']['creating_configfile_failed'] = 'Could not create ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, please create it manually with the following content:';
|
$lng['install']['creating_configfile_failed'] = 'Could not create ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, please create it manually with the following content:';
|
||||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';
|
||||||
|
|
||||||
|
|||||||
@@ -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';
|
||||||
@@ -76,7 +77,7 @@ $lng['install']['changing_data'] = 'Ajustement des paramètres...';
|
|||||||
$lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...';
|
$lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...';
|
||||||
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
|
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
|
||||||
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
|
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
|
||||||
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans ' . dirname(dirname(__DIR__)) . '/lib/.';
|
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans %s, merci de le déplacer dans ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php';
|
||||||
$lng['install']['creating_configfile_failed'] = 'Impossible de créer ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
|
$lng['install']['creating_configfile_failed'] = 'Impossible de créer ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
|
||||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';
|
||||||
|
|
||||||
|
|||||||
@@ -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';
|
||||||
@@ -86,7 +87,7 @@ $lng['install']['changing_data'] = 'Einstellungen anpassen...';
|
|||||||
$lng['install']['creating_entries'] = 'Trage neue Werte ein...';
|
$lng['install']['creating_entries'] = 'Trage neue Werte ein...';
|
||||||
$lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...';
|
$lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...';
|
||||||
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
|
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
|
||||||
$lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach ' . dirname(dirname(__DIR__)) . '/lib/ verschieben.';
|
$lng['install']['creating_configfile_temp'] = 'Datei wurde in %s gespeichert, bitte nach ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php verschieben.';
|
||||||
$lng['install']['creating_configfile_failed'] = 'Konnte ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
|
$lng['install']['creating_configfile_failed'] = 'Konnte ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
|
||||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -546,7 +546,7 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.10')) {
|
|||||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912311')) {
|
if (\Froxlor\Froxlor::isDatabaseVersion('201912311')) {
|
||||||
showUpdateStep("Migrate logfiles_format setting");
|
showUpdateStep("Migrate logfiles_format setting");
|
||||||
$current_format = Settings::Set('system.logfiles_format');
|
$current_format = Settings::Set('system.logfiles_format');
|
||||||
if (!empty($current_format)) {
|
if (! empty($current_format)) {
|
||||||
Settings::Set('system.logfiles_format', '"' . Settings::Get('system.logfiles_format') . '"');
|
Settings::Set('system.logfiles_format', '"' . Settings::Get('system.logfiles_format') . '"');
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
} else {
|
} else {
|
||||||
@@ -571,3 +571,114 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.12')) {
|
|||||||
showUpdateStep("Updating from 0.10.12 to 0.10.13", false);
|
showUpdateStep("Updating from 0.10.12 to 0.10.13", false);
|
||||||
\Froxlor\Froxlor::updateToVersion('0.10.13');
|
\Froxlor\Froxlor::updateToVersion('0.10.13');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isDatabaseVersion('201912313')) {
|
||||||
|
showUpdateStep("Adding new field to domains table");
|
||||||
|
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `domain_ace` varchar(255) NOT NULL default '' AFTER `domain`;");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Updating domain entries");
|
||||||
|
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `domain_ace` = :ace WHERE `id` = :domainid");
|
||||||
|
$sel_stmt = Database::prepare("SELECT id, domain FROM `" . TABLE_PANEL_DOMAINS . "` ORDER BY id ASC");
|
||||||
|
Database::pexecute($sel_stmt);
|
||||||
|
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||||
|
while ($domain = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
|
Database::pexecute($upd_stmt, [
|
||||||
|
'ace' => $idna_convert->decode($domain['domain']),
|
||||||
|
'domainid' => $domain['id']
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
\Froxlor\Froxlor::updateToDbVersion('202002290');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.13')) {
|
||||||
|
showUpdateStep("Updating from 0.10.13 to 0.10.14", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.14');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.14')) {
|
||||||
|
showUpdateStep("Updating from 0.10.14 to 0.10.15", false);
|
||||||
|
\Froxlor\Froxlor::updateToVersion('0.10.15');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isDatabaseVersion('202002290')) {
|
||||||
|
showUpdateStep("Adding new setting to validate DNS when using Let's Encrypt");
|
||||||
|
Database::query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'disable_le_selfcheck'");
|
||||||
|
$le_domain_dnscheck = isset($_POST['system_le_domain_dnscheck']) ? (int) $_POST['system_le_domain_dnscheck'] : '1';
|
||||||
|
Settings::AddNew("system.le_domain_dnscheck", $le_domain_dnscheck);
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
\Froxlor\Froxlor::updateToDbVersion('202004140');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.15')) {
|
||||||
|
showUpdateStep("Updating from 0.10.15 to 0.10.16", false);
|
||||||
|
\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');
|
||||||
|
}
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ function getPreConfig($current_version, $current_db_version)
|
|||||||
include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.9/preconfig_0.9.inc.php');
|
include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.9/preconfig_0.9.inc.php');
|
||||||
parseAndOutputPreconfig($has_preconfig, $return, $current_version, $current_db_version);
|
parseAndOutputPreconfig($has_preconfig, $return, $current_version, $current_db_version);
|
||||||
|
|
||||||
|
include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.10/preconfig_0.10.inc.php');
|
||||||
|
parseAndOutputPreconfig2($has_preconfig, $return, $current_version, $current_db_version);
|
||||||
|
|
||||||
$return .= '<br /><br />' . \Froxlor\UI\HTML::makecheckbox('update_changesagreed', '<strong>I have read the update notifications above and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
|
$return .= '<br /><br />' . \Froxlor\UI\HTML::makecheckbox('update_changesagreed', '<strong>I have read the update notifications above and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
|
||||||
$return .= '</div>';
|
$return .= '</div>';
|
||||||
$return .= '<input type="hidden" name="update_preconfig" value="1" />';
|
$return .= '<input type="hidden" name="update_preconfig" value="1" />';
|
||||||
|
|||||||
42
install/updates/preconfig/0.10/preconfig_0.10.inc.php
Normal file
42
install/updates/preconfig/0.10/preconfig_0.10.inc.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 Updater
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checks if the new-version has some updating to do
|
||||||
|
*
|
||||||
|
* @param boolean $has_preconfig
|
||||||
|
* pointer to check if any preconfig has to be output
|
||||||
|
* @param string $return
|
||||||
|
* pointer to output string
|
||||||
|
* @param string $current_version
|
||||||
|
* current froxlor version
|
||||||
|
*
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
function parseAndOutputPreconfig2(&$has_preconfig, &$return, $current_version, $current_db_version)
|
||||||
|
{
|
||||||
|
global $lng;
|
||||||
|
|
||||||
|
if (versionInUpdate($current_db_version, '202004140')) {
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'Froxlor can now optionally validate the dns entries of domains that request Lets Encrypt certificates to reduce dns-related problems (e.g. freshly registered domain or updated a-record).<br />';
|
||||||
|
$question = '<strong>Validate DNS of domains when using Lets Encrypt ';
|
||||||
|
$question .= \Froxlor\UI\HTML::makeyesno('system_le_domain_dnscheck', '1', '0', '1');
|
||||||
|
|
||||||
|
eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
@@ -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);
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -730,14 +730,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 +771,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 +813,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);
|
||||||
|
|||||||
@@ -109,7 +109,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 +168,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 +202,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 +237,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)
|
||||||
@@ -689,6 +689,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
'name' => $name,
|
'name' => $name,
|
||||||
'company' => $company
|
'company' => $company
|
||||||
)),
|
)),
|
||||||
|
'CUSTOMER_NO' => $customernumber,
|
||||||
'USERNAME' => $loginname,
|
'USERNAME' => $loginname,
|
||||||
'PASSWORD' => $password,
|
'PASSWORD' => $password,
|
||||||
'SERVER_HOSTNAME' => $srv_hostname,
|
'SERVER_HOSTNAME' => $srv_hostname,
|
||||||
@@ -742,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);
|
||||||
}
|
}
|
||||||
@@ -1339,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1409,7 +1410,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
'id' => $id
|
'id' => $id
|
||||||
), true, true);
|
), true, true);
|
||||||
|
|
||||||
// first gather all domain-id's to clean up panel_domaintoip and dns-entries accordingly
|
// first gather all domain-id's to clean up panel_domaintoip, dns-entries and certificates accordingly
|
||||||
$did_stmt = Database::prepare("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
|
$did_stmt = Database::prepare("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
|
||||||
Database::pexecute($did_stmt, array(
|
Database::pexecute($did_stmt, array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
@@ -1425,6 +1426,11 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
|||||||
Database::pexecute($stmt, array(
|
Database::pexecute($stmt, array(
|
||||||
'did' => $row['id']
|
'did' => $row['id']
|
||||||
), true, true);
|
), true, true);
|
||||||
|
// remove domain->certificates entries
|
||||||
|
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :did");
|
||||||
|
Database::pexecute($stmt, array(
|
||||||
|
'did' => $row['id']
|
||||||
|
), true, true);
|
||||||
}
|
}
|
||||||
// remove customer domains
|
// remove customer domains
|
||||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
|
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
|
||||||
@@ -1567,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);
|
||||||
}
|
}
|
||||||
@@ -1609,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);
|
||||||
}
|
}
|
||||||
@@ -1679,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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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);
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ 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));
|
||||||
@@ -360,7 +360,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 +420,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 +464,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 +511,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);
|
||||||
@@ -684,6 +684,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
|
|
||||||
$ins_data = array(
|
$ins_data = array(
|
||||||
'domain' => $domain,
|
'domain' => $domain,
|
||||||
|
'domain_ace' => $idna_convert->decode($domain),
|
||||||
'customerid' => $customerid,
|
'customerid' => $customerid,
|
||||||
'adminid' => $adminid,
|
'adminid' => $adminid,
|
||||||
'documentroot' => $documentroot,
|
'documentroot' => $documentroot,
|
||||||
@@ -732,6 +733,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
|
|||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
||||||
`domain` = :domain,
|
`domain` = :domain,
|
||||||
|
`domain_ace` = :domain_ace,
|
||||||
`customerid` = :customerid,
|
`customerid` = :customerid,
|
||||||
`adminid` = :adminid,
|
`adminid` = :adminid,
|
||||||
`documentroot` = :documentroot,
|
`documentroot` = :documentroot,
|
||||||
@@ -826,7 +828,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);
|
||||||
@@ -1440,6 +1442,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 = '';
|
||||||
@@ -1764,7 +1768,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);
|
||||||
}
|
}
|
||||||
@@ -1925,7 +1932,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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
|||||||
// alternative email address to send info to
|
// alternative email address to send info to
|
||||||
if (Settings::Get('panel.sendalternativemail') == 1) {
|
if (Settings::Get('panel.sendalternativemail') == 1) {
|
||||||
$alternative_email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($alternative_email, 'alternative_email', '', '', array(), true));
|
$alternative_email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($alternative_email, 'alternative_email', '', '', array(), true));
|
||||||
if (! \Froxlor\Validate\Validate::validateEmail($alternative_email)) {
|
if (!empty($alternative_email) && ! \Froxlor\Validate\Validate::validateEmail($alternative_email)) {
|
||||||
\Froxlor\UI\Response::standard_error('emailiswrong', $alternative_email, true);
|
\Froxlor\UI\Response::standard_error('alternativeemailiswrong', $alternative_email, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$alternative_email = '';
|
$alternative_email = '';
|
||||||
@@ -192,7 +192,12 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
|||||||
$replace_arr = array(
|
$replace_arr = array(
|
||||||
'EMAIL' => $email_full,
|
'EMAIL' => $email_full,
|
||||||
'USERNAME' => $username,
|
'USERNAME' => $username,
|
||||||
'PASSWORD' => $password
|
'PASSWORD' => $password,
|
||||||
|
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($customer),
|
||||||
|
'NAME' => $customer['name'],
|
||||||
|
'FIRSTNAME' => $customer['firstname'],
|
||||||
|
'COMPANY' => $customer['company'],
|
||||||
|
'CUSTOMER_NO' => $customer['customernumber']
|
||||||
);
|
);
|
||||||
|
|
||||||
// get the customers admin
|
// get the customers admin
|
||||||
@@ -231,7 +236,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
|||||||
$this->mailer()->clearAddresses();
|
$this->mailer()->clearAddresses();
|
||||||
|
|
||||||
// customer wants to send the e-mail to an alternative email address too
|
// customer wants to send the e-mail to an alternative email address too
|
||||||
if (Settings::Get('panel.sendalternativemail') == 1) {
|
if (Settings::Get('panel.sendalternativemail') == 1 && !empty($alternative_email)) {
|
||||||
// get template for mail subject
|
// get template for mail subject
|
||||||
$mail_subject = $this->getMailTemplate($customer, 'mails', 'pop_success_alternative_subject', $replace_arr, $this->lng['mails']['pop_success_alternative']['subject']);
|
$mail_subject = $this->getMailTemplate($customer, 'mails', 'pop_success_alternative_subject', $replace_arr, $this->lng['mails']['pop_success_alternative']['subject']);
|
||||||
// get template for mail body
|
// get template for mail body
|
||||||
@@ -268,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);
|
||||||
}
|
}
|
||||||
@@ -384,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -487,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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']));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
@@ -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']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,6 +418,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,27 @@ 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());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* can be used to remotely run the integritiy checks froxlor implements
|
||||||
|
*
|
||||||
|
* @access admin
|
||||||
|
* @throws \Exception
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function integrityCheck()
|
||||||
|
{
|
||||||
|
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
|
||||||
|
$integrity = new \Froxlor\Database\IntegrityCheck();
|
||||||
|
$result = $integrity->checkAll();
|
||||||
|
if ($result) {
|
||||||
|
return $this->response(200, "successful", "OK");
|
||||||
|
}
|
||||||
|
throw new \Exception("Some checks failed.", 406);
|
||||||
|
}
|
||||||
|
throw new \Exception("Not allowed to execute given command.", 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -313,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -227,6 +227,10 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
$replace_arr = array(
|
$replace_arr = array(
|
||||||
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($customer),
|
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($customer),
|
||||||
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($customer), // < keep this for compatibility
|
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($customer), // < keep this for compatibility
|
||||||
|
'NAME' => $customer['name'],
|
||||||
|
'FIRSTNAME' => $customer['firstname'],
|
||||||
|
'COMPANY' => $customer['company'],
|
||||||
|
'CUSTOMER_NO' => $customer['customernumber'],
|
||||||
'USR_NAME' => $username,
|
'USR_NAME' => $username,
|
||||||
'USR_PASS' => $password,
|
'USR_PASS' => $password,
|
||||||
'USR_PATH' => \Froxlor\FileDir::makeCorrectDir(str_replace($customer['documentroot'], "/", $path))
|
'USR_PATH' => \Froxlor\FileDir::makeCorrectDir(str_replace($customer['documentroot'], "/", $path))
|
||||||
@@ -264,7 +268,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);
|
||||||
@@ -325,7 +329,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);
|
||||||
@@ -335,7 +339,7 @@ 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
|
||||||
@@ -450,7 +454,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -486,7 +490,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
|
||||||
));
|
));
|
||||||
@@ -514,7 +518,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']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -622,6 +626,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);
|
||||||
}
|
}
|
||||||
@@ -170,7 +170,7 @@ 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, false, 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', '/^(([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(
|
||||||
'stringisempty',
|
'stringisempty',
|
||||||
'myport'
|
'myport'
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
'id' => $id
|
'id' => $id
|
||||||
));
|
));
|
||||||
|
|
||||||
$ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip', true, $result['ip']), false, 'invalidip', false, false, 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', '/^(([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(
|
||||||
'stringisempty',
|
'stringisempty',
|
||||||
'myport'
|
'myport'
|
||||||
@@ -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);
|
||||||
@@ -560,7 +560,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
'ip' => $result['ip']
|
'ip' => $result['ip']
|
||||||
));
|
));
|
||||||
|
|
||||||
if (($result['ip'] != Settings::Get('system.ipaddress')) || ($result['ip'] == Settings::Get('system.ipaddress') && $result_sameipotherport == false)) {
|
if (($result['ip'] != Settings::Get('system.ipaddress')) || ($result['ip'] == Settings::Get('system.ipaddress') && $result_sameipotherport != false)) {
|
||||||
|
|
||||||
$del_stmt = Database::prepare("
|
$del_stmt = Database::prepare("
|
||||||
DELETE FROM `" . TABLE_PANEL_IPSANDPORTS . "`
|
DELETE FROM `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,6 +125,10 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$replace_arr = array(
|
$replace_arr = array(
|
||||||
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($userinfo),
|
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($userinfo),
|
||||||
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($userinfo), // < keep this for compatibility
|
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($userinfo), // < keep this for compatibility
|
||||||
|
'NAME' => $userinfo['name'],
|
||||||
|
'FIRSTNAME' => $userinfo['firstname'],
|
||||||
|
'COMPANY' => $userinfo['company'],
|
||||||
|
'CUSTOMER_NO' => $userinfo['customernumber'],
|
||||||
'DB_NAME' => $username,
|
'DB_NAME' => $username,
|
||||||
'DB_PASS' => $password,
|
'DB_PASS' => $password,
|
||||||
'DB_DESC' => $databasedescription,
|
'DB_DESC' => $databasedescription,
|
||||||
@@ -165,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -254,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);
|
||||||
@@ -346,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -417,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
|
||||||
));
|
));
|
||||||
@@ -444,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']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -506,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
|
||||||
@@ -256,6 +256,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
`customerid` = :customerid,
|
`customerid` = :customerid,
|
||||||
`adminid` = :adminid,
|
`adminid` = :adminid,
|
||||||
`domain` = :domain,
|
`domain` = :domain,
|
||||||
|
`domain_ace` = :domain_ace,
|
||||||
`documentroot` = :documentroot,
|
`documentroot` = :documentroot,
|
||||||
`aliasdomain` = :aliasdomain,
|
`aliasdomain` = :aliasdomain,
|
||||||
`parentdomainid` = :parentdomainid,
|
`parentdomainid` = :parentdomainid,
|
||||||
@@ -287,6 +288,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
"customerid" => $customer['customerid'],
|
"customerid" => $customer['customerid'],
|
||||||
"adminid" => $customer['adminid'],
|
"adminid" => $customer['adminid'],
|
||||||
"domain" => $completedomain,
|
"domain" => $completedomain,
|
||||||
|
"domain_ace" => $idna_convert->decode($completedomain),
|
||||||
"documentroot" => $path,
|
"documentroot" => $path,
|
||||||
"aliasdomain" => $aliasdomain != 0 ? $aliasdomain : null,
|
"aliasdomain" => $aliasdomain != 0 ? $aliasdomain : null,
|
||||||
"parentdomainid" => $domain_check['id'],
|
"parentdomainid" => $domain_check['id'],
|
||||||
@@ -343,7 +345,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);
|
||||||
}
|
}
|
||||||
@@ -407,7 +409,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("
|
||||||
@@ -424,7 +426,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);
|
||||||
@@ -448,7 +450,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
|
||||||
@@ -681,6 +683,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');
|
||||||
@@ -691,7 +695,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -765,6 +769,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
'`d`.`id`',
|
'`d`.`id`',
|
||||||
'`d`.`customerid`',
|
'`d`.`customerid`',
|
||||||
'`d`.`domain`',
|
'`d`.`domain`',
|
||||||
|
'`d`.`domain_ace`',
|
||||||
'`d`.`documentroot`',
|
'`d`.`documentroot`',
|
||||||
'`d`.`isbinddomain`',
|
'`d`.`isbinddomain`',
|
||||||
'`d`.`isemaildomain`',
|
'`d`.`isemaildomain`',
|
||||||
@@ -780,7 +785,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
|
|||||||
|
|
||||||
// prepare select statement
|
// prepare select statement
|
||||||
$domains_stmt = Database::prepare("
|
$domains_stmt = Database::prepare("
|
||||||
SELECT " . implode(",", $select_fields) . ", IF(`d`.`parentdomainid` > 0, `pd`.`domain`, `d`.`domain`) AS `parentdomainname`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias`
|
SELECT " . implode(",", $select_fields) . ", IF(`d`.`parentdomainid` > 0, `pd`.`domain_ace`, `d`.`domain_ace`) AS `parentdomainname`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias`
|
||||||
FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`
|
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`
|
||||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`
|
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`
|
||||||
@@ -794,7 +799,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
|
||||||
));
|
));
|
||||||
@@ -859,7 +864,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']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -870,7 +875,9 @@ 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
|
||||||
|
* required when called as admin, not needed when called as customer
|
||||||
|
*
|
||||||
* @access admin, customer
|
* @access admin, customer
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
* @return string json-encoded array
|
* @return string json-encoded array
|
||||||
@@ -973,7 +980,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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,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
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class FroxlorRPC
|
|||||||
private static function validateAuth($key, $secret)
|
private static function validateAuth($key, $secret)
|
||||||
{
|
{
|
||||||
$sel_stmt = \Froxlor\Database\Database::prepare("
|
$sel_stmt = \Froxlor\Database\Database::prepare("
|
||||||
SELECT ak.*, a.api_allowed as admin_api_allowed, c.api_allowed as cust_api_allowed
|
SELECT ak.*, a.api_allowed as admin_api_allowed, c.api_allowed as cust_api_allowed, c.deactivated
|
||||||
FROM `api_keys` ak
|
FROM `api_keys` ak
|
||||||
LEFT JOIN `panel_admins` a ON a.adminid = ak.adminid
|
LEFT JOIN `panel_admins` a ON a.adminid = ak.adminid
|
||||||
LEFT JOIN `panel_customers` c ON c.customerid = ak.customerid
|
LEFT JOIN `panel_customers` c ON c.customerid = ak.customerid
|
||||||
@@ -67,7 +67,7 @@ class FroxlorRPC
|
|||||||
'as' => $secret
|
'as' => $secret
|
||||||
), true, true);
|
), true, true);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
if ($result['apikey'] == $key && $result['secret'] == $secret && ($result['valid_until'] == - 1 || $result['valid_until'] >= time()) && (($result['customerid'] == 0 && $result['admin_api_allowed'] == 1) || ($result['customerid'] > 0 && $result['cust_api_allowed'] == 1))) {
|
if ($result['apikey'] == $key && $result['secret'] == $secret && ($result['valid_until'] == - 1 || $result['valid_until'] >= time()) && (($result['customerid'] == 0 && $result['admin_api_allowed'] == 1) || ($result['customerid'] > 0 && $result['cust_api_allowed'] == 1 && $result['deactivated'] == 0))) {
|
||||||
// get user to check whether api call is allowed
|
// get user to check whether api call is allowed
|
||||||
if (! empty($result['allowed_from'])) {
|
if (! empty($result['allowed_from'])) {
|
||||||
// @todo allow specification and validating of whole subnets later
|
// @todo allow specification and validating of whole subnets later
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class CronConfig
|
|||||||
$binpath = Settings::Get("system.croncmdline");
|
$binpath = Settings::Get("system.croncmdline");
|
||||||
// fallback as it is important
|
// fallback as it is important
|
||||||
if ($binpath === null) {
|
if ($binpath === null) {
|
||||||
$binpath = "/usr/bin/nice -n 5 /usr/bin/php5 -q";
|
$binpath = "/usr/bin/nice -n 5 /usr/bin/php -q";
|
||||||
}
|
}
|
||||||
|
|
||||||
$cronfile .= "root " . $binpath . " " . \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . "/scripts/froxlor_master_cronjob.php") . " --" . $row_cronentry['cronfile'] . " 1> /dev/null\n";
|
$cronfile .= "root " . $binpath . " " . \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . "/scripts/froxlor_master_cronjob.php") . " --" . $row_cronentry['cronfile'] . " 1> /dev/null\n";
|
||||||
|
|||||||
@@ -195,18 +195,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']);
|
||||||
$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']);
|
||||||
\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));
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class Apache extends HttpConfigBase
|
|||||||
|
|
||||||
$mypath = $this->getMyPath($row_ipsandports);
|
$mypath = $this->getMyPath($row_ipsandports);
|
||||||
|
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= 'DocumentRoot "' . $mypath . '"' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= 'DocumentRoot "' . rtrim($mypath, "/") . '"' . "\n";
|
||||||
|
|
||||||
if ($row_ipsandports['vhostcontainer_servername_statement'] == '1') {
|
if ($row_ipsandports['vhostcontainer_servername_statement'] == '1') {
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' ServerName ' . Settings::Get('system.hostname') . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' ServerName ' . Settings::Get('system.hostname') . "\n";
|
||||||
@@ -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
|
||||||
@@ -661,7 +662,7 @@ class Apache extends HttpConfigBase
|
|||||||
|
|
||||||
if ($domain['deactivated'] == '1' && Settings::Get('system.deactivateddocroot') != '') {
|
if ($domain['deactivated'] == '1' && Settings::Get('system.deactivateddocroot') != '') {
|
||||||
$webroot_text .= ' # Using docroot for deactivated users...' . "\n";
|
$webroot_text .= ' # Using docroot for deactivated users...' . "\n";
|
||||||
$webroot_text .= ' DocumentRoot "' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.deactivateddocroot')) . "\"\n";
|
$webroot_text .= ' DocumentRoot "' . rtrim(\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.deactivateddocroot')), "/") . "\"\n";
|
||||||
$webroot_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.deactivateddocroot')) . '">' . "\n";
|
$webroot_text .= ' <Directory "' . \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.deactivateddocroot')) . '">' . "\n";
|
||||||
// >=apache-2.4 enabled?
|
// >=apache-2.4 enabled?
|
||||||
if (Settings::Get('system.apache24') == '1') {
|
if (Settings::Get('system.apache24') == '1') {
|
||||||
@@ -674,7 +675,7 @@ class Apache extends HttpConfigBase
|
|||||||
$webroot_text .= ' </Directory>' . "\n";
|
$webroot_text .= ' </Directory>' . "\n";
|
||||||
$this->deactivated = true;
|
$this->deactivated = true;
|
||||||
} else {
|
} else {
|
||||||
$webroot_text .= ' DocumentRoot "' . $domain['documentroot'] . "\"\n";
|
$webroot_text .= ' DocumentRoot "' . rtrim($domain['documentroot'], "/") . "\"\n";
|
||||||
$this->deactivated = false;
|
$this->deactivated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -950,7 +951,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
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ namespace Froxlor\Cron\Http\LetsEncrypt;
|
|||||||
use Froxlor\FroxlorLogger;
|
use Froxlor\FroxlorLogger;
|
||||||
use Froxlor\Settings;
|
use Froxlor\Settings;
|
||||||
use Froxlor\Database\Database;
|
use Froxlor\Database\Database;
|
||||||
|
use Froxlor\PhpHelper;
|
||||||
|
use Froxlor\Domain\Domain;
|
||||||
|
use Froxlor\FileDir;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
@@ -18,9 +21,9 @@ use Froxlor\Database\Database;
|
|||||||
* @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
|
||||||
{
|
{
|
||||||
@@ -41,11 +44,416 @@ 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;
|
||||||
|
|
||||||
private static function needRenew()
|
/**
|
||||||
|
* run the task
|
||||||
|
*
|
||||||
|
* @param boolean $internal
|
||||||
|
* @return number
|
||||||
|
*/
|
||||||
|
public static function run($internal = false)
|
||||||
|
{
|
||||||
|
// usually, this is action is called from within the tasks-jobs
|
||||||
|
if (! defined('CRON_IS_FORCED') && ! defined('CRON_DEBUG_FLAG') && $internal == false) {
|
||||||
|
// 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.
|
||||||
|
// check whether we MIGHT need to run although there is no task to regenerate config-files
|
||||||
|
$issue_froxlor = 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
|
||||||
|
\Froxlor\System\Cronjob::inserttask(1);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set server according to settings
|
||||||
|
self::$apiserver = 'https://acme-' . (Settings::Get('system.letsencryptca') == 'testing' ? 'staging-' : '') . 'v0' . \Froxlor\Settings::Get('system.leapiversion') . '.api.letsencrypt.org/directory';
|
||||||
|
|
||||||
|
// validate acme.sh installation
|
||||||
|
if (! self::checkInstall()) {
|
||||||
|
return - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
self::checkUpgrade();
|
||||||
|
|
||||||
|
// flag for re-generation of vhost files
|
||||||
|
$changedetected = 0;
|
||||||
|
|
||||||
|
// prepare update sql
|
||||||
|
self::$updcert_stmt = Database::prepare("
|
||||||
|
REPLACE INTO
|
||||||
|
`" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
||||||
|
SET
|
||||||
|
`id` = :id,
|
||||||
|
`domainid` = :domainid,
|
||||||
|
`ssl_cert_file` = :crt,
|
||||||
|
`ssl_key_file` = :key,
|
||||||
|
`ssl_ca_file` = :ca,
|
||||||
|
`ssl_cert_chainfile` = :chain,
|
||||||
|
`ssl_csr_file` = :csr,
|
||||||
|
`ssl_fullchain_file` = :fullchain,
|
||||||
|
`expirationdate` = :expirationdate
|
||||||
|
");
|
||||||
|
|
||||||
|
// prepare domain update sql
|
||||||
|
self::$upddom_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `ssl_redirect` = '1' WHERE `id` = :domainid");
|
||||||
|
|
||||||
|
// check whether there are certificates to issue
|
||||||
|
$issue_froxlor = self::issueFroxlorVhost();
|
||||||
|
$issue_domains = self::issueDomains();
|
||||||
|
|
||||||
|
// first - generate LE for system-vhost if enabled
|
||||||
|
if ($issue_froxlor) {
|
||||||
|
// build row
|
||||||
|
$certrow = array(
|
||||||
|
'loginname' => 'froxlor.panel',
|
||||||
|
'domain' => Settings::Get('system.hostname'),
|
||||||
|
'domainid' => 0,
|
||||||
|
'documentroot' => \Froxlor\Froxlor::getInstallDir(),
|
||||||
|
'leprivatekey' => Settings::Get('system.leprivatekey'),
|
||||||
|
'lepublickey' => Settings::Get('system.lepublickey'),
|
||||||
|
'leregistered' => Settings::Get('system.leregistered'),
|
||||||
|
'ssl_redirect' => Settings::Get('system.le_froxlor_redirect'),
|
||||||
|
'expirationdate' => null,
|
||||||
|
'ssl_cert_file' => null,
|
||||||
|
'ssl_key_file' => null,
|
||||||
|
'ssl_ca_file' => null,
|
||||||
|
'ssl_csr_file' => null,
|
||||||
|
'id' => null
|
||||||
|
);
|
||||||
|
|
||||||
|
// add to queue
|
||||||
|
$issue_domains[] = $certrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($issue_domains)) {
|
||||||
|
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Requesting " . count($issue_domains) . " new Let's Encrypt certificates");
|
||||||
|
self::runIssueFor($issue_domains);
|
||||||
|
$changedetected = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// compare file-system certificates with the ones in our database
|
||||||
|
// and update if needed
|
||||||
|
$renew_froxlor = self::renewFroxlorVhost();
|
||||||
|
$renew_domains = self::renewDomains();
|
||||||
|
|
||||||
|
if ($renew_froxlor) {
|
||||||
|
// build row
|
||||||
|
$certrow = array(
|
||||||
|
'loginname' => 'froxlor.panel',
|
||||||
|
'domain' => Settings::Get('system.hostname'),
|
||||||
|
'domainid' => 0,
|
||||||
|
'documentroot' => \Froxlor\Froxlor::getInstallDir(),
|
||||||
|
'leprivatekey' => Settings::Get('system.leprivatekey'),
|
||||||
|
'lepublickey' => Settings::Get('system.lepublickey'),
|
||||||
|
'leregistered' => Settings::Get('system.leregistered'),
|
||||||
|
'ssl_redirect' => Settings::Get('system.le_froxlor_redirect'),
|
||||||
|
'expirationdate' => is_array($renew_froxlor) ? $renew_froxlor['expirationdate'] : date('Y-m-d H:i:s', 0),
|
||||||
|
'ssl_cert_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_cert_file'] : null,
|
||||||
|
'ssl_key_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_key_file'] : null,
|
||||||
|
'ssl_ca_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_ca_file'] : null,
|
||||||
|
'ssl_csr_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_csr_file'] : null,
|
||||||
|
'id' => is_array($renew_froxlor) ? $renew_froxlor['id'] : null
|
||||||
|
);
|
||||||
|
$renew_domains[] = $certrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($renew_domains as $domain) {
|
||||||
|
$cronlog = FroxlorLogger::getInstanceOf(array(
|
||||||
|
'loginname' => $domain['loginname'],
|
||||||
|
'adminsession' => 0
|
||||||
|
));
|
||||||
|
if (defined('CRON_IS_FORCED') || self::checkFsFilesAreNewer($domain['domain'], $domain['expirationdate'])) {
|
||||||
|
self::certToDb($domain, $cronlog, array());
|
||||||
|
$changedetected = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we have a change in a certificate, we need to update the webserver - configs
|
||||||
|
// This is easiest done by just creating a new task ;)
|
||||||
|
if ($changedetected) {
|
||||||
|
if (self::$no_inserttask == false) {
|
||||||
|
\Froxlor\System\Cronjob::inserttask(1);
|
||||||
|
}
|
||||||
|
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Let's Encrypt certificates have been updated");
|
||||||
|
} else {
|
||||||
|
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "No new certificates or certificate updates found");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* issue certificates for a list of domains
|
||||||
|
*/
|
||||||
|
private static function runIssueFor($certrows = array())
|
||||||
|
{
|
||||||
|
// prepare aliasdomain-check
|
||||||
|
$aliasdomains_stmt = Database::prepare("
|
||||||
|
SELECT
|
||||||
|
dom.`id` as domainid,
|
||||||
|
dom.`domain`,
|
||||||
|
dom.`wwwserveralias`
|
||||||
|
FROM `" . TABLE_PANEL_DOMAINS . "` AS dom
|
||||||
|
WHERE
|
||||||
|
dom.`aliasdomain` = :id
|
||||||
|
AND dom.`letsencrypt` = 1
|
||||||
|
AND dom.`iswildcarddomain` = 0
|
||||||
|
");
|
||||||
|
// iterate through all domains
|
||||||
|
foreach ($certrows as $certrow) {
|
||||||
|
// set logger to corresponding loginname for the log to appear in the users system-log
|
||||||
|
$cronlog = FroxlorLogger::getInstanceOf(array(
|
||||||
|
'loginname' => $certrow['loginname'],
|
||||||
|
'adminsession' => 0
|
||||||
|
));
|
||||||
|
// Only issue let's encrypt certificate if no broken ssl_redirect is enabled
|
||||||
|
if ($certrow['ssl_redirect'] != 2) {
|
||||||
|
$do_force = false;
|
||||||
|
if (! empty($certrow['ssl_cert_file']) && empty($certrow['expirationdate'])) {
|
||||||
|
// domain changed (SAN or similar)
|
||||||
|
$do_force = true;
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Re-creating certificate for " . $certrow['domain']);
|
||||||
|
} else {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Creating certificate for " . $certrow['domain']);
|
||||||
|
}
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Adding common-name: " . $certrow['domain']);
|
||||||
|
$domains = array(
|
||||||
|
strtolower($certrow['domain'])
|
||||||
|
);
|
||||||
|
// add www.<domain> to SAN list
|
||||||
|
if ($certrow['wwwserveralias'] == 1) {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Adding SAN entry: www." . $certrow['domain']);
|
||||||
|
$domains[] = strtolower('www.' . $certrow['domain']);
|
||||||
|
}
|
||||||
|
if ($certrow['domainid'] == 0) {
|
||||||
|
$froxlor_aliases = Settings::Get('system.froxloraliases');
|
||||||
|
if (! empty($froxlor_aliases)) {
|
||||||
|
$froxlor_aliases = explode(",", $froxlor_aliases);
|
||||||
|
foreach ($froxlor_aliases as $falias) {
|
||||||
|
if (\Froxlor\Validate\Validate::validateDomain(trim($falias))) {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Adding SAN entry: " . strtolower(trim($falias)));
|
||||||
|
$domains[] = strtolower(trim($falias));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// add alias domains (and possibly www.<aliasdomain>) to SAN list
|
||||||
|
Database::pexecute($aliasdomains_stmt, array(
|
||||||
|
'id' => $certrow['domainid']
|
||||||
|
));
|
||||||
|
$aliasdomains = $aliasdomains_stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
foreach ($aliasdomains as $aliasdomain) {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Adding SAN entry: " . $aliasdomain['domain']);
|
||||||
|
$domains[] = strtolower($aliasdomain['domain']);
|
||||||
|
if ($aliasdomain['wwwserveralias'] == 1) {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Adding SAN entry: www." . $aliasdomain['domain']);
|
||||||
|
$domains[] = strtolower('www.' . $aliasdomain['domain']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self::validateDns($domains, $certrow['domainid'], $cronlog);
|
||||||
|
|
||||||
|
self::runAcmeSh($certrow, $domains, $cronlog, $do_force);
|
||||||
|
} else {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_WARNING, "Skipping Let's Encrypt generation for " . $certrow['domain'] . " due to an enabled ssl_redirect");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* validate dns (A / AAAA record) of domain against known system ips
|
||||||
|
*
|
||||||
|
* @param array $domains
|
||||||
|
* @param int $domain_id
|
||||||
|
* @param FroxlorLogger $cronlog
|
||||||
|
*/
|
||||||
|
private static function validateDns(&$domains = array(), $domain_id, &$cronlog)
|
||||||
|
{
|
||||||
|
if (Settings::Get('system.le_domain_dnscheck') == '1' && ! empty($domains)) {
|
||||||
|
$loop_domains = $domains;
|
||||||
|
// ips according to our system
|
||||||
|
$our_ips = Domain::getIpsOfDomain($domain_id);
|
||||||
|
foreach ($loop_domains as $idx => $domain) {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Validating DNS of " . $domain);
|
||||||
|
// ips accordint to NS
|
||||||
|
$domain_ips = PhpHelper::gethostbynamel6($domain);
|
||||||
|
if ($domain_ips == false || count(array_intersect($our_ips, $domain_ips)) <= 0) {
|
||||||
|
// 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");
|
||||||
|
unset($domains[$idx]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function runAcmeSh($certrow = array(), $domains = array(), &$cronlog = null, $force = false)
|
||||||
|
{
|
||||||
|
if (! empty($domains)) {
|
||||||
|
|
||||||
|
$acmesh_cmd = self::$acmesh . " --server " . self::$apiserver . " --issue -d " . implode(" -d ", $domains);
|
||||||
|
// challenge path
|
||||||
|
$acmesh_cmd .= " -w " . Settings::Get('system.letsencryptchallengepath');
|
||||||
|
if (Settings::Get('system.leecc') > 0) {
|
||||||
|
// ecc certificate
|
||||||
|
$acmesh_cmd .= " --keylength ec-" . Settings::Get('system.leecc');
|
||||||
|
} else {
|
||||||
|
$acmesh_cmd .= " --keylength " . Settings::Get('system.letsencryptkeysize');
|
||||||
|
}
|
||||||
|
if (Settings::Get('system.letsencryptreuseold') != '1') {
|
||||||
|
$acmesh_cmd .= " --always-force-new-domain-key";
|
||||||
|
}
|
||||||
|
if (Settings::Get('system.letsencryptca') == 'testing') {
|
||||||
|
$acmesh_cmd .= " --staging";
|
||||||
|
}
|
||||||
|
if ($force) {
|
||||||
|
$acmesh_cmd .= " --force";
|
||||||
|
}
|
||||||
|
if (defined('CRON_DEBUG_FLAG')) {
|
||||||
|
$acmesh_cmd .= " --debug";
|
||||||
|
}
|
||||||
|
|
||||||
|
$acme_result = \Froxlor\FileDir::safe_exec($acmesh_cmd);
|
||||||
|
// debug output of acme.sh run
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_DEBUG, implode("\n", $acme_result));
|
||||||
|
|
||||||
|
self::certToDb($certrow, $cronlog, $acme_result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function certToDb($certrow, &$cronlog, $acme_result)
|
||||||
|
{
|
||||||
|
$return = array();
|
||||||
|
self::readCertificateToVar(strtolower($certrow['domain']), $return, $cronlog);
|
||||||
|
|
||||||
|
if (! empty($return['crt'])) {
|
||||||
|
|
||||||
|
$newcert = openssl_x509_parse($return['crt']);
|
||||||
|
|
||||||
|
if ($newcert) {
|
||||||
|
// Store the new data
|
||||||
|
Database::pexecute(self::$updcert_stmt, array(
|
||||||
|
'id' => $certrow['id'],
|
||||||
|
'domainid' => $certrow['domainid'],
|
||||||
|
'crt' => $return['crt'],
|
||||||
|
'key' => $return['key'],
|
||||||
|
'ca' => $return['chain'],
|
||||||
|
'chain' => $return['chain'],
|
||||||
|
'csr' => $return['csr'],
|
||||||
|
'fullchain' => $return['fullchain'],
|
||||||
|
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
|
||||||
|
));
|
||||||
|
|
||||||
|
if ($certrow['ssl_redirect'] == 3) {
|
||||||
|
Database::pexecute(self::$upddom_stmt, array(
|
||||||
|
'domainid' => $certrow['domainid']
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Updated Let's Encrypt certificate for " . $certrow['domain']);
|
||||||
|
} else {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_ERR, "Got non-successful Let's Encrypt response for " . $certrow['domain'] . ":\n" . implode("\n", $acme_result));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_ERR, "Could not get Let's Encrypt certificate for " . $certrow['domain'] . ":\n" . implode("\n", $acme_result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check whether we need to issue a new certificate for froxlor itself
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private static function issueFroxlorVhost()
|
||||||
|
{
|
||||||
|
if (Settings::Get('system.le_froxlor_enabled') == '1') {
|
||||||
|
// let's encrypt is enabled, now check whether we have a certificate
|
||||||
|
$froxlor_ssl_settings_stmt = Database::prepare("
|
||||||
|
SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
||||||
|
WHERE `domainid` = '0'
|
||||||
|
");
|
||||||
|
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
||||||
|
// also check for possible existing certificate
|
||||||
|
if (! $froxlor_ssl && ! self::checkFsFilesAreNewer(Settings::Get('system.hostname'), date('Y-m-d H:i:s'))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check whether we need to renew-check the certificate for froxlor itself
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private static function renewFroxlorVhost()
|
||||||
|
{
|
||||||
|
if (Settings::Get('system.le_froxlor_enabled') == '1') {
|
||||||
|
// let's encrypt is enabled, now check whether we have a certificate
|
||||||
|
$froxlor_ssl_settings_stmt = Database::prepare("
|
||||||
|
SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
||||||
|
WHERE `domainid` = '0'
|
||||||
|
");
|
||||||
|
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
||||||
|
// also check for possible existing certificate
|
||||||
|
if ($froxlor_ssl && self::checkFsFilesAreNewer(Settings::Get('system.hostname'), $froxlor_ssl['expirationdate'])) {
|
||||||
|
return $froxlor_ssl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a list of domains that have a lets encrypt certificate (possible renew)
|
||||||
|
*/
|
||||||
|
private static function renewDomains($check = false)
|
||||||
|
{
|
||||||
|
$certificates_stmt = Database::query("
|
||||||
|
SELECT
|
||||||
|
domssl.`id`,
|
||||||
|
domssl.`domainid`,
|
||||||
|
domssl.`expirationdate`,
|
||||||
|
domssl.`ssl_cert_file`,
|
||||||
|
domssl.`ssl_key_file`,
|
||||||
|
dom.`domain`,
|
||||||
|
dom.`id` AS 'domainid',
|
||||||
|
dom.`ssl_redirect`,
|
||||||
|
cust.`loginname`
|
||||||
|
FROM
|
||||||
|
`" . TABLE_PANEL_CUSTOMERS . "` AS cust,
|
||||||
|
`" . TABLE_PANEL_DOMAINS . "` AS dom
|
||||||
|
LEFT JOIN
|
||||||
|
`" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` AS domssl ON
|
||||||
|
dom.`id` = domssl.`domainid`
|
||||||
|
WHERE
|
||||||
|
dom.`customerid` = cust.`customerid`
|
||||||
|
AND cust.deactivated = 0
|
||||||
|
AND dom.`letsencrypt` = 1
|
||||||
|
AND dom.`aliasdomain` IS NULL
|
||||||
|
AND dom.`iswildcarddomain` = 0
|
||||||
|
");
|
||||||
|
$renew_certs = $certificates_stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
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 array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a list of domains that require a new certificate (issue)
|
||||||
|
*/
|
||||||
|
private static function issueDomains()
|
||||||
{
|
{
|
||||||
$certificates_stmt = Database::query("
|
$certificates_stmt = Database::query("
|
||||||
SELECT
|
SELECT
|
||||||
@@ -78,322 +486,70 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
AND dom.`letsencrypt` = 1
|
AND dom.`letsencrypt` = 1
|
||||||
AND dom.`aliasdomain` IS NULL
|
AND dom.`aliasdomain` IS NULL
|
||||||
AND dom.`iswildcarddomain` = 0
|
AND dom.`iswildcarddomain` = 0
|
||||||
AND (
|
AND domssl.`expirationdate` IS NULL
|
||||||
domssl.`expirationdate` < DATE_ADD(NOW(), INTERVAL 30 DAY)
|
|
||||||
OR domssl.`expirationdate` IS NULL
|
|
||||||
)
|
|
||||||
");
|
");
|
||||||
$customer_ssl = $certificates_stmt->fetchAll(\PDO::FETCH_ASSOC);
|
$customer_ssl = $certificates_stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
if (! $customer_ssl) {
|
if ($customer_ssl) {
|
||||||
$customer_ssl = array();
|
return $customer_ssl;
|
||||||
}
|
}
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
$froxlor_ssl = array();
|
private static function checkFsFilesAreNewer($domain, $cert_date = 0)
|
||||||
if (Settings::Get('system.le_froxlor_enabled') == '1') {
|
{
|
||||||
$froxlor_ssl_settings_stmt = Database::prepare("
|
$certificate_folder = self::getWorkingDirFromEnv($domain);
|
||||||
SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
$ssl_file = \Froxlor\FileDir::makeCorrectFile($certificate_folder . '/' . $domain . '.cer');
|
||||||
WHERE `domainid` = '0' AND
|
|
||||||
(`expirationdate` < DATE_ADD(NOW(), INTERVAL 30 DAY) OR `expirationdate` IS NULL)
|
if (is_dir($certificate_folder) && file_exists($ssl_file) && is_readable($ssl_file)) {
|
||||||
");
|
$cert_data = openssl_x509_parse(file_get_contents($ssl_file));
|
||||||
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
if ($cert_data && $cert_data['validTo_time_t'] > strtotime($cert_date)) {
|
||||||
if (! $froxlor_ssl) {
|
return true;
|
||||||
$froxlor_ssl = array();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($customer_ssl) > 0 || count($froxlor_ssl) > 0) {
|
|
||||||
return array(
|
|
||||||
'customer_ssl' => $customer_ssl,
|
|
||||||
'froxlor_ssl' => $froxlor_ssl
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function run($internal = false)
|
public static function getWorkingDirFromEnv($domain = "", $forced_noecc = false)
|
||||||
{
|
{
|
||||||
if (! defined('CRON_IS_FORCED') && ! defined('CRON_DEBUG_FLAG') && $internal == false) {
|
if (Settings::Get('system.leecc') > 0 && ! $forced_noecc) {
|
||||||
// Let's Encrypt cronjob is combined with regeneration of webserver configuration files.
|
$domain .= "_ecc";
|
||||||
// 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
|
|
||||||
$needRenew = self::needRenew();
|
|
||||||
if ($needRenew) {
|
|
||||||
// insert task to generate certificates and vhost-configs
|
|
||||||
\Froxlor\System\Cronjob::inserttask(1);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
$env_file = FileDir::makeCorrectFile(dirname(self::$acmesh) . '/acme.sh.env');
|
||||||
self::checkInstall();
|
if (file_exists($env_file)) {
|
||||||
|
$output = [];
|
||||||
self::$apiserver = 'https://acme-'.(Settings::Get('system.letsencryptca') == 'testing' ? 'staging-' : '').'v0' . \Froxlor\Settings::Get('system.leapiversion') . '.api.letsencrypt.org/directory';
|
$cut = <<<EOC
|
||||||
|
cut -d'"' -f2
|
||||||
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Requesting/renewing Let's Encrypt certificates");
|
EOC;
|
||||||
|
exec('grep "LE_WORKING_DIR" ' . escapeshellarg($env_file) . ' | ' . $cut, $output);
|
||||||
$aliasdomains_stmt = Database::prepare("
|
if (is_array($output) && ! empty($output) && isset($output[0]) && ! empty($output[0])) {
|
||||||
SELECT
|
return FileDir::makeCorrectDir($output[0] . "/" . $domain);
|
||||||
dom.`id` as domainid,
|
|
||||||
dom.`domain`,
|
|
||||||
dom.`wwwserveralias`
|
|
||||||
FROM `" . TABLE_PANEL_DOMAINS . "` AS dom
|
|
||||||
WHERE
|
|
||||||
dom.`aliasdomain` = :id
|
|
||||||
AND dom.`letsencrypt` = 1
|
|
||||||
AND dom.`iswildcarddomain` = 0
|
|
||||||
");
|
|
||||||
|
|
||||||
self::$updcert_stmt = Database::prepare("
|
|
||||||
REPLACE INTO
|
|
||||||
`" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
|
||||||
SET
|
|
||||||
`id` = :id,
|
|
||||||
`domainid` = :domainid,
|
|
||||||
`ssl_cert_file` = :crt,
|
|
||||||
`ssl_key_file` = :key,
|
|
||||||
`ssl_ca_file` = :ca,
|
|
||||||
`ssl_cert_chainfile` = :chain,
|
|
||||||
`ssl_csr_file` = :csr,
|
|
||||||
`ssl_fullchain_file` = :fullchain,
|
|
||||||
`expirationdate` = :expirationdate
|
|
||||||
");
|
|
||||||
|
|
||||||
self::$upddom_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `ssl_redirect` = '1' WHERE `id` = :domainid");
|
|
||||||
|
|
||||||
// flag for re-generation of vhost files
|
|
||||||
$changedetected = 0;
|
|
||||||
|
|
||||||
$needRenew = self::needRenew();
|
|
||||||
|
|
||||||
// first - generate LE for system-vhost if enabled
|
|
||||||
if (Settings::Get('system.le_froxlor_enabled') == '1') {
|
|
||||||
|
|
||||||
$certrow = array(
|
|
||||||
'loginname' => 'froxlor.panel',
|
|
||||||
'domain' => Settings::Get('system.hostname'),
|
|
||||||
'domainid' => 0,
|
|
||||||
'documentroot' => \Froxlor\Froxlor::getInstallDir(),
|
|
||||||
'leprivatekey' => Settings::Get('system.leprivatekey'),
|
|
||||||
'lepublickey' => Settings::Get('system.lepublickey'),
|
|
||||||
'leregistered' => Settings::Get('system.leregistered'),
|
|
||||||
'ssl_redirect' => Settings::Get('system.le_froxlor_redirect'),
|
|
||||||
'expirationdate' => null,
|
|
||||||
'ssl_cert_file' => null,
|
|
||||||
'ssl_key_file' => null,
|
|
||||||
'ssl_ca_file' => null,
|
|
||||||
'ssl_csr_file' => null,
|
|
||||||
'id' => null
|
|
||||||
);
|
|
||||||
|
|
||||||
$froxlor_ssl = $needRenew ? $needRenew['froxlor_ssl'] : array();
|
|
||||||
|
|
||||||
$cert_mode = 'issue';
|
|
||||||
if (count($froxlor_ssl) > 0) {
|
|
||||||
$cert_mode = 'renew';
|
|
||||||
$certrow['id'] = $froxlor_ssl['id'];
|
|
||||||
$certrow['expirationdate'] = $froxlor_ssl['expirationdate'];
|
|
||||||
$certrow['ssl_cert_file'] = $froxlor_ssl['ssl_cert_file'];
|
|
||||||
$certrow['ssl_key_file'] = $froxlor_ssl['ssl_key_file'];
|
|
||||||
$certrow['ssl_ca_file'] = $froxlor_ssl['ssl_ca_file'];
|
|
||||||
$certrow['ssl_csr_file'] = $froxlor_ssl['ssl_csr_file'];
|
|
||||||
} else {
|
|
||||||
// check whether we have an entry with valid certificates which just does not need
|
|
||||||
// updating yet, so we need to skip this here
|
|
||||||
$froxlor_ssl_settings_stmt = Database::prepare("
|
|
||||||
SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = '0'
|
|
||||||
");
|
|
||||||
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
|
||||||
if ($froxlor_ssl && ! empty($froxlor_ssl['ssl_cert_file'])) {
|
|
||||||
$cert_mode = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cert_mode) {
|
|
||||||
$domains = array(
|
|
||||||
strtolower($certrow['domain'])
|
|
||||||
);
|
|
||||||
|
|
||||||
$froxlor_aliases = Settings::Get('system.froxloraliases');
|
|
||||||
if (! empty($froxlor_aliases)) {
|
|
||||||
$froxlor_aliases = explode(",", $froxlor_aliases);
|
|
||||||
foreach ($froxlor_aliases as $falias) {
|
|
||||||
if (\Froxlor\Validate\Validate::validateDomain(trim($falias))) {
|
|
||||||
$domains[] = strtolower(trim($falias));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only renew let's encrypt certificate if no broken ssl_redirect is enabled
|
|
||||||
// - this temp. deactivation of the ssl-redirect is handled by the webserver-cronjob
|
|
||||||
$do_force = false;
|
|
||||||
if ($cert_mode == 'renew') {
|
|
||||||
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Updating certificate for " . $certrow['domain']);
|
|
||||||
} else {
|
|
||||||
$do_force = true;
|
|
||||||
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Creating certificate for " . $certrow['domain']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$cronlog = FroxlorLogger::getInstanceOf(array(
|
|
||||||
'loginname' => $certrow['loginname'],
|
|
||||||
'adminsession' => 0
|
|
||||||
));
|
|
||||||
|
|
||||||
self::runAcmeSh($certrow, $domains, $cert_mode, $cronlog, $changedetected, $do_force);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return FileDir::makeCorrectDir(dirname(self::$acmesh) . "/" . $domain);
|
||||||
// customer domains
|
|
||||||
$certrows = $needRenew ? $needRenew['customer_ssl'] : array();
|
|
||||||
foreach ($certrows as $certrow) {
|
|
||||||
|
|
||||||
// initialize mode to 'issue'
|
|
||||||
$cert_mode = 'issue';
|
|
||||||
|
|
||||||
// set logger to corresponding loginname for the log to appear in the users system-log
|
|
||||||
$cronlog = FroxlorLogger::getInstanceOf(array(
|
|
||||||
'loginname' => $certrow['loginname'],
|
|
||||||
'adminsession' => 0
|
|
||||||
));
|
|
||||||
|
|
||||||
// Only renew let's encrypt certificate if no broken ssl_redirect is enabled
|
|
||||||
if ($certrow['ssl_redirect'] != 2) {
|
|
||||||
|
|
||||||
$do_force = false;
|
|
||||||
if (! empty($certrow['ssl_cert_file']) && ! empty($certrow['expirationdate'])) {
|
|
||||||
$cert_mode = 'renew';
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Updating certificate for " . $certrow['domain']);
|
|
||||||
} else if (! empty($certrow['ssl_cert_file']) && empty($certrow['expirationdate'])) {
|
|
||||||
// domain changed (SAN or similar)
|
|
||||||
$do_force = true;
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Re-creating certificate for " . $certrow['domain']);
|
|
||||||
} else {
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Creating certificate for " . $certrow['domain']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Adding SAN entry: " . $certrow['domain']);
|
|
||||||
$domains = array(
|
|
||||||
strtolower($certrow['domain'])
|
|
||||||
);
|
|
||||||
// add www.<domain> to SAN list
|
|
||||||
if ($certrow['wwwserveralias'] == 1) {
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Adding SAN entry: www." . $certrow['domain']);
|
|
||||||
$domains[] = strtolower('www.' . $certrow['domain']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// add alias domains (and possibly www.<aliasdomain>) to SAN list
|
|
||||||
Database::pexecute($aliasdomains_stmt, array(
|
|
||||||
'id' => $certrow['domainid']
|
|
||||||
));
|
|
||||||
$aliasdomains = $aliasdomains_stmt->fetchAll(\PDO::FETCH_ASSOC);
|
|
||||||
foreach ($aliasdomains as $aliasdomain) {
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Adding SAN entry: " . $aliasdomain['domain']);
|
|
||||||
$domains[] = strtolower($aliasdomain['domain']);
|
|
||||||
if ($aliasdomain['wwwserveralias'] == 1) {
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Adding SAN entry: www." . $aliasdomain['domain']);
|
|
||||||
$domains[] = strtolower('www.' . $aliasdomain['domain']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self::runAcmeSh($certrow, $domains, $cert_mode, $cronlog, $changedetected, $do_force);
|
|
||||||
} else {
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_WARNING, "Skipping Let's Encrypt generation for " . $certrow['domain'] . " due to an enabled ssl_redirect");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we have a change in a certificate, we need to update the webserver - configs
|
|
||||||
// This is easiest done by just creating a new task ;)
|
|
||||||
if ($changedetected) {
|
|
||||||
if (self::$no_inserttask == false) {
|
|
||||||
\Froxlor\System\Cronjob::inserttask(1);
|
|
||||||
}
|
|
||||||
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Let's Encrypt certificates have been updated");
|
|
||||||
} else {
|
|
||||||
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "No new certificates or certificates due for renewal found");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function runAcmeSh($certrow = array(), $domains = array(), $cert_mode = 'issue', &$cronlog = null, &$changedetected = 0, $force = false)
|
public static function getAcmeSh()
|
||||||
{
|
{
|
||||||
if (! empty($domains)) {
|
return self::$acmesh;
|
||||||
|
|
||||||
if (self::$do_update) {
|
|
||||||
self::checkUpgrade();
|
|
||||||
self::$do_update = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$acmesh_cmd = self::$acmesh . " --auto-upgrade 0 --server " . self::$apiserver . " --" . $cert_mode . " -d " . implode(" -d ", $domains);
|
|
||||||
|
|
||||||
if ($cert_mode == 'issue') {
|
|
||||||
$acmesh_cmd .= " -w " . Settings::Get('system.letsencryptchallengepath');
|
|
||||||
}
|
|
||||||
if (Settings::Get('system.leecc') > 0) {
|
|
||||||
$acmesh_cmd .= " --keylength ec-" . Settings::Get('system.leecc');
|
|
||||||
} else {
|
|
||||||
$acmesh_cmd .= " --keylength " . Settings::Get('system.letsencryptkeysize');
|
|
||||||
}
|
|
||||||
if (Settings::Get('system.letsencryptreuseold') != '1') {
|
|
||||||
$acmesh_cmd .= " --always-force-new-domain-key";
|
|
||||||
}
|
|
||||||
if (Settings::Get('system.letsencryptca') == 'testing') {
|
|
||||||
$acmesh_cmd .= " --staging";
|
|
||||||
}
|
|
||||||
if ($force) {
|
|
||||||
$acmesh_cmd .= " --force";
|
|
||||||
}
|
|
||||||
if (defined('CRON_DEBUG_FLAG')) {
|
|
||||||
$acmesh_cmd .= " --debug";
|
|
||||||
}
|
|
||||||
|
|
||||||
$acme_result = \Froxlor\FileDir::safe_exec($acmesh_cmd);
|
|
||||||
// debug output of acme.sh run
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_DEBUG, implode("\n", $acme_result));
|
|
||||||
|
|
||||||
$return = array();
|
|
||||||
self::readCertificateToVar($certrow['domain'], $return);
|
|
||||||
|
|
||||||
if (! empty($return['crt'])) {
|
|
||||||
|
|
||||||
$newcert = openssl_x509_parse($return['crt']);
|
|
||||||
|
|
||||||
if ($newcert) {
|
|
||||||
// Store the new data
|
|
||||||
Database::pexecute(self::$updcert_stmt, array(
|
|
||||||
'id' => $certrow['id'],
|
|
||||||
'domainid' => $certrow['domainid'],
|
|
||||||
'crt' => $return['crt'],
|
|
||||||
'key' => $return['key'],
|
|
||||||
'ca' => $return['chain'],
|
|
||||||
'chain' => $return['chain'],
|
|
||||||
'csr' => $return['csr'],
|
|
||||||
'fullchain' => $return['fullchain'],
|
|
||||||
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
|
|
||||||
));
|
|
||||||
|
|
||||||
if ($certrow['ssl_redirect'] == 3) {
|
|
||||||
Database::pexecute(self::$upddom_stmt, array(
|
|
||||||
'domainid' => $certrow['domainid']
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Updated Let's Encrypt certificate for " . $certrow['domain']);
|
|
||||||
$changedetected = 1;
|
|
||||||
} else {
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_ERR, "Got non-successful Let's Encrypt response for " . $certrow['domain'] . ":\n" . implode("\n", $acme_result));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_ERR, "Could not get Let's Encrypt certificate for " . $certrow['domain'] . ":\n" . implode("\n", $acme_result));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function readCertificateToVar($domain, &$return)
|
/**
|
||||||
|
* get certificate files from filesystem and store in $return array
|
||||||
|
*
|
||||||
|
* @param string $domain
|
||||||
|
* @param array $return
|
||||||
|
* @param object $cronlog
|
||||||
|
*/
|
||||||
|
private static function readCertificateToVar($domain, &$return, &$cronlog)
|
||||||
{
|
{
|
||||||
$certificate_folder = dirname(self::$acmesh) . "/" . $domain;
|
$certificate_folder = self::getWorkingDirFromEnv($domain);
|
||||||
|
$certificate_folder_noecc = null;
|
||||||
if (Settings::Get('system.leecc') > 0) {
|
if (Settings::Get('system.leecc') > 0) {
|
||||||
$certificate_folder .= "_ecc";
|
$certificate_folder_noecc = self::getWorkingDirFromEnv($domain, true);
|
||||||
}
|
}
|
||||||
$certificate_folder = \Froxlor\FileDir::makeCorrectDir($certificate_folder);
|
$certificate_folder = \Froxlor\FileDir::makeCorrectDir($certificate_folder);
|
||||||
|
|
||||||
if (is_dir($certificate_folder)) {
|
if (is_dir($certificate_folder) || is_dir($certificate_folder_noecc)) {
|
||||||
foreach ([
|
foreach ([
|
||||||
'crt' => $domain . '.cer',
|
'crt' => $domain . '.cer',
|
||||||
'key' => $domain . '.key',
|
'key' => $domain . '.key',
|
||||||
@@ -405,28 +561,52 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
|
|||||||
if (file_exists($ssl_file)) {
|
if (file_exists($ssl_file)) {
|
||||||
$return[$index] = file_get_contents($ssl_file);
|
$return[$index] = file_get_contents($ssl_file);
|
||||||
} else {
|
} else {
|
||||||
|
if (! empty($certificate_folder_noecc)) {
|
||||||
|
$ssl_file_fb = \Froxlor\FileDir::makeCorrectFile($certificate_folder_noecc . '/' . $sslfile);
|
||||||
|
if (file_exists($ssl_file_fb)) {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_WARNING, "ECC certificates activated but found only non-ecc file");
|
||||||
|
$return[$index] = file_get_contents($ssl_file_fb);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_ERR, "Could not find file '" . $sslfile . "' in '" . $certificate_folder . "'");
|
||||||
$return[$index] = null;
|
$return[$index] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$cronlog->logAction(FroxlorLogger::CRON_ACTION, LOG_ERR, "Could not find certificate-folder '" . $certificate_folder . "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function checkInstall()
|
/**
|
||||||
|
* install acme.sh if not found yet
|
||||||
|
*/
|
||||||
|
private static function checkInstall($tries = 0)
|
||||||
{
|
{
|
||||||
if (! file_exists(self::$acmesh)) {
|
if (! file_exists(self::$acmesh) && $tries > 0) {
|
||||||
|
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_ERR, "Download/installation of acme.sh seems to have failed. Re-run cronjob to try again or install manually to '" . self::$acmesh . "'");
|
||||||
|
echo PHP_EOL . "Download/installation of acme.sh seems to have failed. Re-run cronjob to try again or install manually to '" . self::$acmesh . "'" . PHP_EOL;
|
||||||
|
return false;
|
||||||
|
} else if (! file_exists(self::$acmesh)) {
|
||||||
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Could not find acme.sh - installing it to /root/.acme.sh/");
|
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Could not find acme.sh - installing it to /root/.acme.sh/");
|
||||||
$return = false;
|
$return = false;
|
||||||
\Froxlor\FileDir::safe_exec("wget -O - https://get.acme.sh | sh", $return, array(
|
\Froxlor\FileDir::safe_exec("wget -O - https://get.acme.sh | sh", $return, array(
|
||||||
'|'
|
'|'
|
||||||
));
|
));
|
||||||
|
// check whether the installation worked
|
||||||
|
return self::checkInstall(++ $tries);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* run upgrade
|
||||||
|
*/
|
||||||
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 (which is installed automatically) but we don't need it
|
// check for activated cron
|
||||||
$acmesh_result2 = \Froxlor\FileDir::safe_exec(self::$acmesh . " --uninstall-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
|
||||||
@@ -659,7 +660,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
|
||||||
|
|||||||
@@ -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'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ class BackupCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
|
|
||||||
$del_stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_TASKS . "` WHERE `id` = :id");
|
$del_stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_TASKS . "` WHERE `id` = :id");
|
||||||
|
|
||||||
|
$cronlog = FroxlorLogger::getInstanceOf();
|
||||||
$all_jobs = $result_tasks_stmt->fetchAll();
|
$all_jobs = $result_tasks_stmt->fetchAll();
|
||||||
foreach ($all_jobs as $row) {
|
foreach ($all_jobs as $row) {
|
||||||
|
|
||||||
@@ -96,7 +97,7 @@ class BackupCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($row['data']['destdir']));
|
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg($row['data']['destdir']));
|
||||||
}
|
}
|
||||||
|
|
||||||
self::createCustomerBackup($row['data'], $customerdocroot, FroxlorLogger::getInstanceOf());
|
self::createCustomerBackup($row['data'], $customerdocroot, $cronlog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class Extrausers
|
|||||||
'name' => \Froxlor\Customer\Customer::getCustomerDetail($u['customerid'], 'name'),
|
'name' => \Froxlor\Customer\Customer::getCustomerDetail($u['customerid'], 'name'),
|
||||||
'company' => \Froxlor\Customer\Customer::getCustomerDetail($u['customerid'], 'company')
|
'company' => \Froxlor\Customer\Customer::getCustomerDetail($u['customerid'], 'company')
|
||||||
);
|
);
|
||||||
$u['comment'] = \Froxlor\User::getCorrectUserSalutation($salutation_array);
|
$u['comment'] = self::cleanString(\Froxlor\User::getCorrectUserSalutation($salutation_array));
|
||||||
if ($u['login_enabled'] != 'Y') {
|
if ($u['login_enabled'] != 'Y') {
|
||||||
$u['password'] = '*';
|
$u['password'] = '*';
|
||||||
$u['shell'] = '/bin/false';
|
$u['shell'] = '/bin/false';
|
||||||
@@ -90,4 +90,10 @@ class Extrausers
|
|||||||
$cronlog->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_NOTICE, 'Error when writing ' . $type . ' file entries');
|
$cronlog->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_NOTICE, 'Error when writing ' . $type . ' file entries');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function cleanString($string = null)
|
||||||
|
{
|
||||||
|
$allowed = "/[^a-z0-9\\.\\-\\_\\ ]/i";
|
||||||
|
return preg_replace($allowed, "", $string);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
if ((int) Settings::Get('system.report_trafficmax') > 0) {
|
if ((int) Settings::Get('system.report_trafficmax') > 0) {
|
||||||
// Warn the customers at xx% traffic-usage
|
// Warn the customers at xx% traffic-usage
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT `c`.`customerid`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
||||||
`c`.`company`, `c`.`traffic`, `c`.`email`, `c`.`def_language`,
|
`c`.`company`, `c`.`traffic`, `c`.`email`, `c`.`def_language`,
|
||||||
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`,
|
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`,
|
||||||
(SELECT SUM(`t`.`http` + `t`.`ftp_up` + `t`.`ftp_down` + `t`.`mail`)
|
(SELECT SUM(`t`.`http` + `t`.`ftp_up` + `t`.`ftp_down` + `t`.`mail`)
|
||||||
@@ -55,16 +55,19 @@ 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'],
|
||||||
'firstname' => $row['firstname'],
|
'firstname' => $row['firstname'],
|
||||||
'company' => $row['company']
|
'company' => $row['company'],
|
||||||
|
'customernumber' => $row['customernumber']
|
||||||
);
|
);
|
||||||
$replace_arr = array(
|
$replace_arr = array(
|
||||||
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($rep_userinfo),
|
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($rep_userinfo),
|
||||||
'NAME' => $row['name'], // < keep this for compatibility
|
'NAME' => $rep_userinfo['name'],
|
||||||
|
'FIRSTNAME' => $rep_userinfo['firstname'],
|
||||||
|
'COMPANY' => $rep_userinfo['company'],
|
||||||
|
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
||||||
'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
||||||
'TRAFFICUSED' => round(($row['traffic_used'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
'TRAFFICUSED' => round(($row['traffic_used'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
||||||
'USAGE_PERCENT' => round(($row['traffic_used'] * 100) / $row['traffic'], 2),
|
'USAGE_PERCENT' => round(($row['traffic_used'] * 100) / $row['traffic'], 2),
|
||||||
@@ -89,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("
|
||||||
@@ -142,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,8 +175,8 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
$replace_arr = array(
|
$replace_arr = array(
|
||||||
'NAME' => $row['name'],
|
'NAME' => $row['name'],
|
||||||
'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
||||||
'TRAFFICUSED' => round(($row['traffic_used_total'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
'TRAFFICUSED' => round(($row['traffic_used_total'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
||||||
'USAGE_PERCENT' => round(($row['traffic_used_total'] * 100) / $row['traffic'], 2),
|
'USAGE_PERCENT' => round(($row['traffic_used_total'] * 100) / $row['traffic'], 2),
|
||||||
'MAX_PERCENT' => Settings::Get('system.report_trafficmax')
|
'MAX_PERCENT' => Settings::Get('system.report_trafficmax')
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -191,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("
|
||||||
@@ -322,6 +331,8 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
}
|
}
|
||||||
|
|
||||||
$mail->ClearAddresses();
|
$mail->ClearAddresses();
|
||||||
|
|
||||||
|
unset($lng);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // trafficmax > 0
|
} // trafficmax > 0
|
||||||
@@ -343,7 +354,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
* report about diskusage for customers
|
* report about diskusage for customers
|
||||||
*/
|
*/
|
||||||
$result_stmt = Database::query("
|
$result_stmt = Database::query("
|
||||||
SELECT `c`.`customerid`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
||||||
`c`.`company`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`email`, `c`.`def_language`,
|
`c`.`company`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`email`, `c`.`def_language`,
|
||||||
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`
|
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`
|
||||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c`
|
FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c`
|
||||||
@@ -361,11 +372,15 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
$rep_userinfo = array(
|
$rep_userinfo = array(
|
||||||
'name' => $row['name'],
|
'name' => $row['name'],
|
||||||
'firstname' => $row['firstname'],
|
'firstname' => $row['firstname'],
|
||||||
'company' => $row['company']
|
'company' => $row['company'],
|
||||||
|
'customernumber' => $row['customernumber']
|
||||||
);
|
);
|
||||||
$replace_arr = array(
|
$replace_arr = array(
|
||||||
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($rep_userinfo),
|
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($rep_userinfo),
|
||||||
'NAME' => $row['name'], // < keep this for compatibility
|
'NAME' => $rep_userinfo['name'],
|
||||||
|
'FIRSTNAME' => $rep_userinfo['firstname'],
|
||||||
|
'COMPANY' => $rep_userinfo['company'],
|
||||||
|
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
||||||
'DISKAVAILABLE' => round(($row['diskspace'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
'DISKAVAILABLE' => round(($row['diskspace'] / 1024), 2), /* traffic is stored in KB, template uses MB */
|
||||||
'DISKUSED' => round($row['diskspace_used'] / 1024, 2), /* traffic is stored in KB, template uses MB */
|
'DISKUSED' => round($row['diskspace_used'] / 1024, 2), /* traffic is stored in KB, template uses MB */
|
||||||
'USAGE_PERCENT' => round(($row['diskspace_used'] * 100) / $row['diskspace'], 2),
|
'USAGE_PERCENT' => round(($row['diskspace_used'] * 100) / $row['diskspace'], 2),
|
||||||
@@ -386,13 +401,15 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
|||||||
$lngfile = Database::pexecute_first($lngfile_stmt, array(
|
$lngfile = Database::pexecute_first($lngfile_stmt, array(
|
||||||
'deflang' => Settings::Get('panel.standardlanguage')
|
'deflang' => Settings::Get('panel.standardlanguage')
|
||||||
));
|
));
|
||||||
$langfile = $lngfile['file'];
|
$langfile = $lngfile['file'] ?? 'lng/english.lng.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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("
|
||||||
@@ -443,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,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("
|
||||||
@@ -536,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
|
||||||
|
|||||||
@@ -570,29 +570,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']
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -144,7 +144,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,6 +168,13 @@ 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']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +283,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) == '(') {
|
||||||
|
|||||||
@@ -6,6 +6,41 @@ use Froxlor\Database\Database;
|
|||||||
class Domain
|
class Domain
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return all ip addresses associated with given domain,
|
||||||
|
* returns all ips if domain-id = 0 (froxlor.vhost)
|
||||||
|
*
|
||||||
|
* @param int $domain_id
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getIpsOfDomain($domain_id)
|
||||||
|
{
|
||||||
|
if ($domain_id > 0) {
|
||||||
|
$sel_stmt = Database::prepare("
|
||||||
|
SELECT i.ip FROM `" . TABLE_PANEL_IPSANDPORTS . "` `i`
|
||||||
|
LEFT JOIN `" . TABLE_DOMAINTOIP . "` `dip` ON dip.id_ipandports = i.id
|
||||||
|
AND dip.id_domain = :domainid
|
||||||
|
GROUP BY i.ip
|
||||||
|
");
|
||||||
|
$sel_param = array(
|
||||||
|
'domainid' => $domain_id
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// assuming froxlor.vhost (id = 0)
|
||||||
|
$sel_stmt = Database::prepare("
|
||||||
|
SELECT ip FROM `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||||
|
GROUP BY ip
|
||||||
|
");
|
||||||
|
$sel_param = array();
|
||||||
|
}
|
||||||
|
Database::pexecute($sel_stmt, $sel_param);
|
||||||
|
$result = array();
|
||||||
|
while ($ip = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
|
$result[] = $ip['ip'];
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return an array of all enabled redirect-codes
|
* return an array of all enabled redirect-codes
|
||||||
*
|
*
|
||||||
@@ -294,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.13';
|
const VERSION = '0.10.21';
|
||||||
|
|
||||||
// Database version (YYYYMMDDC where C is a daily counter)
|
// Database version (YYYYMMDDC where C is a daily counter)
|
||||||
const DBVERSION = '201912313';
|
const DBVERSION = '202009070';
|
||||||
|
|
||||||
// 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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -209,12 +209,12 @@ class MailLogParser
|
|||||||
|
|
||||||
$timestamp = $this->getLogTimestamp($line);
|
$timestamp = $this->getLogTimestamp($line);
|
||||||
if ($this->startTime < $timestamp) {
|
if ($this->startTime < $timestamp) {
|
||||||
if (preg_match("/dovecot.*(?::|\]) imap\(.*@([a-z0-9\.\-]+)\):.*(?:in=(\d+) out=(\d+)|bytes=(\d+)\/(\d+))/i", $line, $matches)) {
|
if (preg_match("/dovecot.*(?::|\]) imap\(.*@([a-z0-9\.\-]+)\)(<\d+><[a-z0-9+\/=]+>)?:.*(?:in=(\d+) out=(\d+)|bytes=(\d+)\/(\d+))/i", $line, $matches)) {
|
||||||
// Dovecot IMAP
|
// Dovecot IMAP
|
||||||
$this->addDomainTraffic($matches[1], (int) $matches[2] + (int) $matches[3], $timestamp);
|
$this->addDomainTraffic($matches[1], (int) $matches[3] + (int) $matches[4], $timestamp);
|
||||||
} elseif (preg_match("/dovecot.*(?::|\]) pop3\(.*@([a-z0-9\.\-]+)\):.*in=(\d+).*out=(\d+)/i", $line, $matches)) {
|
} elseif (preg_match("/dovecot.*(?::|\]) pop3\(.*@([a-z0-9\.\-]+)\)(<\d+><[a-z0-9+\/=]+>)?:.*in=(\d+).*out=(\d+)/i", $line, $matches)) {
|
||||||
// Dovecot POP3
|
// Dovecot POP3
|
||||||
$this->addDomainTraffic($matches[1], (int) $matches[2] + (int) $matches[3], $timestamp);
|
$this->addDomainTraffic($matches[1], (int) $matches[3] + (int) $matches[4], $timestamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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}}">
|
||||||
|
|||||||
@@ -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(
|
||||||
@@ -384,7 +383,7 @@ return array(
|
|||||||
'value' => array()
|
'value' => array()
|
||||||
),
|
),
|
||||||
'sessiontickets' => array(
|
'sessiontickets' => array(
|
||||||
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd',
|
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.sessionticketsenabled' != '1'),
|
||||||
'label' => $lng['admin']['domain_sessiontickets'],
|
'label' => $lng['admin']['domain_sessiontickets'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ return array(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
'sessiontickets' => array(
|
'sessiontickets' => array(
|
||||||
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd',
|
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.sessionticketsenabled' != '1'),
|
||||||
'label' => $lng['admin']['domain_sessiontickets'],
|
'label' => $lng['admin']['domain_sessiontickets'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
|
|||||||
11
lib/init.php
11
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.0.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.0.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');
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ $lng['error']['mydomain'] = '\'Domain\'';
|
|||||||
$lng['error']['mydocumentroot'] = '\'Documentroot\'';
|
$lng['error']['mydocumentroot'] = '\'Documentroot\'';
|
||||||
$lng['error']['loginnameexists'] = 'Loginname %s already exists';
|
$lng['error']['loginnameexists'] = 'Loginname %s already exists';
|
||||||
$lng['error']['emailiswrong'] = 'Email-address %s contains invalid characters or is incomplete';
|
$lng['error']['emailiswrong'] = 'Email-address %s contains invalid characters or is incomplete';
|
||||||
|
$lng['error']['alternativeemailiswrong'] = 'The given alternative email address %s to send the credentials to seems to be invalid';
|
||||||
$lng['error']['loginnameiswrong'] = 'Loginname "%s" contains illegal characters.';
|
$lng['error']['loginnameiswrong'] = 'Loginname "%s" contains illegal characters.';
|
||||||
$lng['error']['loginnameiswrong2'] = 'Loginname contains too many characters. Only %s characters are allowed.';
|
$lng['error']['loginnameiswrong2'] = 'Loginname contains too many characters. Only %s characters are allowed.';
|
||||||
$lng['error']['userpathcombinationdupe'] = 'Combination of username and path already exists';
|
$lng['error']['userpathcombinationdupe'] = 'Combination of username and path already exists';
|
||||||
@@ -317,6 +318,7 @@ $lng['admin']['templates']['COMPANY'] = 'Replaces with the customer\'s company n
|
|||||||
$lng['admin']['templates']['USERNAME'] = 'Replaced with the customer\'s account username.';
|
$lng['admin']['templates']['USERNAME'] = 'Replaced with the customer\'s account username.';
|
||||||
$lng['admin']['templates']['PASSWORD'] = 'Replaced with the customer\'s account password.';
|
$lng['admin']['templates']['PASSWORD'] = 'Replaced with the customer\'s account password.';
|
||||||
$lng['admin']['templates']['EMAIL'] = 'Replaced with the address of the POP3/IMAP account.';
|
$lng['admin']['templates']['EMAIL'] = 'Replaced with the address of the POP3/IMAP account.';
|
||||||
|
$lng['admin']['templates']['CUSTOMER_NO'] = 'Replaces with the customer number';
|
||||||
$lng['admin']['webserver'] = 'Webserver';
|
$lng['admin']['webserver'] = 'Webserver';
|
||||||
$lng['admin']['bindzonewarning'] = $lng['panel']['emptyfordefault'] . '<br /><strong class="red">ATTENTION:</strong> If you use a zonefile you will have to manage all required records for all sub-zones manually as well.';
|
$lng['admin']['bindzonewarning'] = $lng['panel']['emptyfordefault'] . '<br /><strong class="red">ATTENTION:</strong> If you use a zonefile you will have to manage all required records for all sub-zones manually as well.';
|
||||||
|
|
||||||
@@ -408,6 +410,7 @@ $lng['admin']['ipsandports']['add'] = 'Add IP/Port';
|
|||||||
$lng['admin']['ipsandports']['edit'] = 'Edit IP/Port';
|
$lng['admin']['ipsandports']['edit'] = 'Edit IP/Port';
|
||||||
$lng['admin']['ipsandports']['ipandport'] = 'IP/Port';
|
$lng['admin']['ipsandports']['ipandport'] = 'IP/Port';
|
||||||
$lng['admin']['ipsandports']['ip'] = 'IP';
|
$lng['admin']['ipsandports']['ip'] = 'IP';
|
||||||
|
$lng['admin']['ipsandports']['ipnote'] = '<div id="ipnote" class="red">Note: Although private ip addresses are allowed, some features like DNS might not behave correctly.<br>Only use private ip addresses if you are sure.</div>';
|
||||||
$lng['admin']['ipsandports']['port'] = 'Port';
|
$lng['admin']['ipsandports']['port'] = 'Port';
|
||||||
|
|
||||||
// ADDED IN 1.2.13-rc3
|
// ADDED IN 1.2.13-rc3
|
||||||
@@ -1695,7 +1698,7 @@ $lng['admin']['integrityresult'] = 'Result';
|
|||||||
$lng['admin']['integrityfix'] = 'Fix problems automatically';
|
$lng['admin']['integrityfix'] = 'Fix problems automatically';
|
||||||
$lng['question']['admin_integritycheck_reallyfix'] = 'Do you really want to try fixing all database integrity problems automatically?';
|
$lng['question']['admin_integritycheck_reallyfix'] = 'Do you really want to try fixing all database integrity problems automatically?';
|
||||||
$lng['serversettings']['system_croncmdline']['title'] = 'Cron execution command (php-binary)';
|
$lng['serversettings']['system_croncmdline']['title'] = 'Cron execution command (php-binary)';
|
||||||
$lng['serversettings']['system_croncmdline']['description'] = 'Command to execute our cronjobs. Change this only if you know what you are doing (default: "/usr/bin/nice -n 5 /usr/bin/php5 -q")!';
|
$lng['serversettings']['system_croncmdline']['description'] = 'Command to execute our cronjobs. Change this only if you know what you are doing (default: "/usr/bin/nice -n 5 /usr/bin/php -q")!';
|
||||||
$lng['error']['cannotdeletehostnamephpconfig'] = 'This PHP-configuration is used by the Froxlor-vhost and cannot be deleted.';
|
$lng['error']['cannotdeletehostnamephpconfig'] = 'This PHP-configuration is used by the Froxlor-vhost and cannot be deleted.';
|
||||||
$lng['error']['cannotdeletedefaultphpconfig'] = 'This PHP-configuration is set as default and cannot be deleted.';
|
$lng['error']['cannotdeletedefaultphpconfig'] = 'This PHP-configuration is set as default and cannot be deleted.';
|
||||||
$lng['serversettings']['system_cron_allowautoupdate']['title'] = 'Allow automatic database updates';
|
$lng['serversettings']['system_cron_allowautoupdate']['title'] = 'Allow automatic database updates';
|
||||||
@@ -1980,8 +1983,8 @@ $lng['admin']['domain_http2']['title'] = 'HTTP2 support';
|
|||||||
$lng['admin']['domain_http2']['description'] = 'See <a target="_blank" href="https://en.wikipedia.org/wiki/HTTP/2">Wikipedia</a> for a detailed explanation of HTTP2';
|
$lng['admin']['domain_http2']['description'] = 'See <a target="_blank" href="https://en.wikipedia.org/wiki/HTTP/2">Wikipedia</a> for a detailed explanation of HTTP2';
|
||||||
$lng['admin']['testmail'] = 'SMTP test';
|
$lng['admin']['testmail'] = 'SMTP test';
|
||||||
$lng['success']['testmailsent'] = 'Test mail sent successfully';
|
$lng['success']['testmailsent'] = 'Test mail sent successfully';
|
||||||
$lng['serversettings']['disable_le_selfcheck']['title'] = "Disable Let's Encrypt local self-check";
|
$lng['serversettings']['le_domain_dnscheck']['title'] = "Validate DNS of domains when using Let's Encrypt";
|
||||||
$lng['serversettings']['disable_le_selfcheck']['description'] = "If activated, froxlor will <strong>not</strong> perform its self-check for token accessibility. Needed for NATed IP's or similar.";
|
$lng['serversettings']['le_domain_dnscheck']['description'] = "If activated, froxlor will validate whether the domain which requests a Let's Encrypt certificate resolves to at least one of the system ip addresses.";
|
||||||
$lng['menue']['phpsettings']['fpmdaemons'] = 'PHP-FPM versions';
|
$lng['menue']['phpsettings']['fpmdaemons'] = 'PHP-FPM versions';
|
||||||
$lng['admin']['phpsettings']['activephpconfigs'] = 'In use for php-config(s)';
|
$lng['admin']['phpsettings']['activephpconfigs'] = 'In use for php-config(s)';
|
||||||
$lng['admin']['phpsettingsforsubdomains'] = 'Apply php-config to all subdomains:';
|
$lng['admin']['phpsettingsforsubdomains'] = 'Apply php-config to all subdomains:';
|
||||||
@@ -1990,7 +1993,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';
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ $lng['error']['mydomain'] = '\'Domain\'';
|
|||||||
$lng['error']['mydocumentroot'] = '\'Documentroot\'';
|
$lng['error']['mydocumentroot'] = '\'Documentroot\'';
|
||||||
$lng['error']['loginnameexists'] = 'Der Login-Name "%s" existiert bereits.';
|
$lng['error']['loginnameexists'] = 'Der Login-Name "%s" existiert bereits.';
|
||||||
$lng['error']['emailiswrong'] = 'Die E-Mail-Adresse "%s" enthält ungültige Zeichen oder ist nicht vollständig.';
|
$lng['error']['emailiswrong'] = 'Die E-Mail-Adresse "%s" enthält ungültige Zeichen oder ist nicht vollständig.';
|
||||||
|
$lng['error']['alternativeemailiswrong'] = 'Die angegebene alternative E-Mail Adresse "%s", an welche die Zugangsdaten geschickt werden soll, scheint ungültig zu sein.';
|
||||||
$lng['error']['loginnameiswrong'] = 'Der Login-Name "%s" enthält ungültige Zeichen.';
|
$lng['error']['loginnameiswrong'] = 'Der Login-Name "%s" enthält ungültige Zeichen.';
|
||||||
$lng['error']['loginnameiswrong2'] = 'Der Login-Name enthält zu viele Zeichen, es sind maximal %s Zeichen erlaubt.';
|
$lng['error']['loginnameiswrong2'] = 'Der Login-Name enthält zu viele Zeichen, es sind maximal %s Zeichen erlaubt.';
|
||||||
$lng['error']['userpathcombinationdupe'] = 'Die Kombination aus Benutzername und Pfad existiert bereits.';
|
$lng['error']['userpathcombinationdupe'] = 'Die Kombination aus Benutzername und Pfad existiert bereits.';
|
||||||
@@ -314,6 +315,7 @@ $lng['admin']['templates']['COMPANY'] = 'Wird mit dem Firmennamen des Kunden ers
|
|||||||
$lng['admin']['templates']['USERNAME'] = 'Wird mit dem Benutzernamen des neuen Kundenkontos ersetzt.';
|
$lng['admin']['templates']['USERNAME'] = 'Wird mit dem Benutzernamen des neuen Kundenkontos ersetzt.';
|
||||||
$lng['admin']['templates']['PASSWORD'] = 'Wird mit dem Passwort des neuen Kundenkontos ersetzt.';
|
$lng['admin']['templates']['PASSWORD'] = 'Wird mit dem Passwort des neuen Kundenkontos ersetzt.';
|
||||||
$lng['admin']['templates']['EMAIL'] = 'Wird mit der Adresse des neuen E-Mail-Kontos ersetzt.';
|
$lng['admin']['templates']['EMAIL'] = 'Wird mit der Adresse des neuen E-Mail-Kontos ersetzt.';
|
||||||
|
$lng['admin']['templates']['CUSTOMER_NO'] = 'Wir mit der Kunden-Nummer ersetzt';
|
||||||
$lng['admin']['bindzonewarning'] = $lng['panel']['emptyfordefault'] . '<br /><strong class="red">WARNUNG:</strong> Bei der Verwendung einer Zonendatei müssen alle benötigten Records aller Subdomains ebenfalls manuell verwaltet werden.';
|
$lng['admin']['bindzonewarning'] = $lng['panel']['emptyfordefault'] . '<br /><strong class="red">WARNUNG:</strong> Bei der Verwendung einer Zonendatei müssen alle benötigten Records aller Subdomains ebenfalls manuell verwaltet werden.';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -403,6 +405,7 @@ $lng['admin']['ipsandports']['add'] = 'IP-Adresse/Port hinzufügen';
|
|||||||
$lng['admin']['ipsandports']['edit'] = 'IP-Adresse/Port bearbeiten';
|
$lng['admin']['ipsandports']['edit'] = 'IP-Adresse/Port bearbeiten';
|
||||||
$lng['admin']['ipsandports']['ipandport'] = 'IP-Adresse/Port';
|
$lng['admin']['ipsandports']['ipandport'] = 'IP-Adresse/Port';
|
||||||
$lng['admin']['ipsandports']['ip'] = 'IP-Adresse';
|
$lng['admin']['ipsandports']['ip'] = 'IP-Adresse';
|
||||||
|
$lng['admin']['ipsandports']['ipnote'] = '<div id="ipnote" class="red">Hinweis: Obwohl private IP Adressen erlaubt sind, kann es bei manchen Features wie DNS zu ungewolltem Verhalten kommen.<br>Verwende private Adressen nur wenn du sicher bist.</div>';
|
||||||
$lng['admin']['ipsandports']['port'] = 'Port';
|
$lng['admin']['ipsandports']['port'] = 'Port';
|
||||||
|
|
||||||
// ADDED IN 1.2.13-rc3
|
// ADDED IN 1.2.13-rc3
|
||||||
@@ -1419,7 +1422,7 @@ $lng['admin']['integrityresult'] = 'Ergebnis';
|
|||||||
$lng['admin']['integrityfix'] = 'Probleme automatisch beheben';
|
$lng['admin']['integrityfix'] = 'Probleme automatisch beheben';
|
||||||
$lng['question']['admin_integritycheck_reallyfix'] = 'Möchten Sie wirklich versuchen sämtliche Datenbank-Integritätsprobleme automatisch zu beheben?';
|
$lng['question']['admin_integritycheck_reallyfix'] = 'Möchten Sie wirklich versuchen sämtliche Datenbank-Integritätsprobleme automatisch zu beheben?';
|
||||||
$lng['serversettings']['system_croncmdline']['title'] = 'Cron Startbefehl (php Programm)';
|
$lng['serversettings']['system_croncmdline']['title'] = 'Cron Startbefehl (php Programm)';
|
||||||
$lng['serversettings']['system_croncmdline']['description'] = 'Befehl zum Ausführen des Cronjobs. Ändern dieser Einstellung nur wenn nötig (Standard: "/usr/bin/nice -n 5 /usr/bin/php5 -q")!';
|
$lng['serversettings']['system_croncmdline']['description'] = 'Befehl zum Ausführen des Cronjobs. Ändern dieser Einstellung nur wenn nötig (Standard: "/usr/bin/nice -n 5 /usr/bin/php -q")!';
|
||||||
$lng['error']['cannotdeletehostnamephpconfig'] = 'Diese PHP-Konfiguration ist dem Froxlor-Vhost zugewiesen und kann daher nicht gelöscht werden.';
|
$lng['error']['cannotdeletehostnamephpconfig'] = 'Diese PHP-Konfiguration ist dem Froxlor-Vhost zugewiesen und kann daher nicht gelöscht werden.';
|
||||||
$lng['error']['cannotdeletedefaultphpconfig'] = 'Diese PHP-Konfiguration ist als Standard hinterlegt und kann daher nicht gelöscht werden.';
|
$lng['error']['cannotdeletedefaultphpconfig'] = 'Diese PHP-Konfiguration ist als Standard hinterlegt und kann daher nicht gelöscht werden.';
|
||||||
$lng['serversettings']['system_cron_allowautoupdate']['title'] = 'Erlaube automatische Datenbank-Aktualisierungen';
|
$lng['serversettings']['system_cron_allowautoupdate']['title'] = 'Erlaube automatische Datenbank-Aktualisierungen';
|
||||||
@@ -1630,8 +1633,8 @@ $lng['admin']['domain_http2']['title'] = 'HTTP2 Unterstützung';
|
|||||||
$lng['admin']['domain_http2']['description'] = 'Siehe <a target="_blank" href="https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol#HTTP.2F2">Wikipedia</a> für eine ausführliche Beschreibung von HTTP2';
|
$lng['admin']['domain_http2']['description'] = 'Siehe <a target="_blank" href="https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol#HTTP.2F2">Wikipedia</a> für eine ausführliche Beschreibung von HTTP2';
|
||||||
$lng['admin']['testmail'] = 'SMTP Test';
|
$lng['admin']['testmail'] = 'SMTP Test';
|
||||||
$lng['success']['testmailsent'] = 'Test E-Mail erfolgreich gesendet';
|
$lng['success']['testmailsent'] = 'Test E-Mail erfolgreich gesendet';
|
||||||
$lng['serversettings']['disable_le_selfcheck']['title'] = "Deaktiviere Let's Encrypt lokale Selbstprüfung";
|
$lng['serversettings']['le_domain_dnscheck']['title'] = "Validiere DNS der Domains wenn Let's Encrypt genutzt wird";
|
||||||
$lng['serversettings']['disable_le_selfcheck']['description'] = "Wenn aktiviert wird Froxlor <strong>keine</strong> Erreichbarkeitsprüfung des Tokens vornehmen. Nötig bei ge-NAT-eten IP-Adressen oder Ähnlichem";
|
$lng['serversettings']['le_domain_dnscheck']['description'] = "Wenn aktiviert wird froxlor überprüfen ob die DNS Einträge der Domains, welche ein Let's Encrypt Zertifikat beantragt, mindestens auf eine der System IP Adressen auflöst.";
|
||||||
$lng['menue']['phpsettings']['fpmdaemons'] = 'PHP-FPM Versionen';
|
$lng['menue']['phpsettings']['fpmdaemons'] = 'PHP-FPM Versionen';
|
||||||
$lng['admin']['phpsettings']['activephpconfigs'] = 'In Verwendung für PHP-Konfiguration(en)';
|
$lng['admin']['phpsettings']['activephpconfigs'] = 'In Verwendung für PHP-Konfiguration(en)';
|
||||||
$lng['admin']['phpsettingsforsubdomains'] = 'PHP-Config für alle Subdomains übernehmen:';
|
$lng['admin']['phpsettingsforsubdomains'] = 'PHP-Config für alle Subdomains übernehmen:';
|
||||||
@@ -1640,7 +1643,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';
|
||||||
|
|||||||
@@ -1635,7 +1635,7 @@ $lng['admin']['integrityresult'] = 'Risultato';
|
|||||||
$lng['admin']['integrityfix'] = 'Risolvi problemi automaticamente';
|
$lng['admin']['integrityfix'] = 'Risolvi problemi automaticamente';
|
||||||
$lng['question']['admin_integritycheck_reallyfix'] = 'Vuoi veramente provare a risolvere i problemi di integrità del database automaticamente?';
|
$lng['question']['admin_integritycheck_reallyfix'] = 'Vuoi veramente provare a risolvere i problemi di integrità del database automaticamente?';
|
||||||
$lng['serversettings']['system_croncmdline']['title'] = 'Commando di esecuzione Cron (binario php)';
|
$lng['serversettings']['system_croncmdline']['title'] = 'Commando di esecuzione Cron (binario php)';
|
||||||
$lng['serversettings']['system_croncmdline']['description'] = 'Commando per eseguire i nostri cronjob. Modificalo soltanto se sai cosa stai facendo (predefinito: "/usr/bin/nice -n 5 /usr/bin/php5 -q")!';
|
$lng['serversettings']['system_croncmdline']['description'] = 'Commando per eseguire i nostri cronjob. Modificalo soltanto se sai cosa stai facendo (predefinito: "/usr/bin/nice -n 5 /usr/bin/php -q")!';
|
||||||
$lng['error']['cannotdeletehostnamephpconfig'] = 'Questa configurazione PHP è utilizzata dal vhost Froxlor e non può essere eliminata.';
|
$lng['error']['cannotdeletehostnamephpconfig'] = 'Questa configurazione PHP è utilizzata dal vhost Froxlor e non può essere eliminata.';
|
||||||
$lng['error']['cannotdeletedefaultphpconfig'] = 'Questa configurazione PHP è impostata come predefinita e non può essere eliminata.';
|
$lng['error']['cannotdeletedefaultphpconfig'] = 'Questa configurazione PHP è impostata come predefinita e non può essere eliminata.';
|
||||||
$lng['serversettings']['system_cron_allowautoupdate']['title'] = 'Permetti aggiornamenti automatici del database';
|
$lng['serversettings']['system_cron_allowautoupdate']['title'] = 'Permetti aggiornamenti automatici del database';
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
2
templates/Sparkle/admin/domains/domains.tpl
vendored
2
templates/Sparkle/admin/domains/domains.tpl
vendored
@@ -30,7 +30,7 @@
|
|||||||
<table class="full hl">
|
<table class="full hl">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{$lng['domains']['domainname']} {$arrowcode['d.domain']}</th>
|
<th>{$lng['domains']['domainname']} {$arrowcode['d.domain_ace']}</th>
|
||||||
<th>{$lng['admin']['ipsandports']['ip']}</th>
|
<th>{$lng['admin']['ipsandports']['ip']}</th>
|
||||||
<th>{$lng['admin']['customer']} {$arrowcode['c.loginname']}</th>
|
<th>{$lng['admin']['customer']} {$arrowcode['c.loginname']}</th>
|
||||||
<th>{$lng['panel']['options']}</th>
|
<th>{$lng['panel']['options']}</th>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ $header
|
|||||||
{$title}
|
{$title}
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
|
<script type="text/javascript" src="templates/{$theme}/assets/js/ipsandports.js"></script>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ $header
|
|||||||
{$title}
|
{$title}
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
|
<script type="text/javascript" src="templates/{$theme}/assets/js/ipsandports.js"></script>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|
||||||
|
|||||||
@@ -40,23 +40,27 @@ $header
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><em>{SALUTATION}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><em>{FIRSTNAME}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['FIRSTNAME']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><em>{NAME}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['NAME']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><em>{COMPANY}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['COMPANY']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><em>{CUSTOMER_NO}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['CUSTOMER_NO']}</td>
|
||||||
|
</tr>
|
||||||
<if ($template == 'createcustomer')>
|
<if ($template == 'createcustomer')>
|
||||||
<tr>
|
|
||||||
<td><em>{SALUTATION}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><em>{FIRSTNAME}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['FIRSTNAME']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><em>{NAME}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['NAME']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><em>{COMPANY}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['COMPANY']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><em>{USERNAME}</em></td>
|
<td><em>{USERNAME}</em></td>
|
||||||
<td>{$lng['admin']['templates']['USERNAME']}</td>
|
<td>{$lng['admin']['templates']['USERNAME']}</td>
|
||||||
@@ -88,10 +92,6 @@ $header
|
|||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
<if ($template == 'password_reset')>
|
<if ($template == 'password_reset')>
|
||||||
<tr>
|
|
||||||
<td><em>{SALUTATION}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><em>{USERNAME}</em></td>
|
<td><em>{USERNAME}</em></td>
|
||||||
<td>{$lng['admin']['templates']['USERNAME']}</td>
|
<td>{$lng['admin']['templates']['USERNAME']}</td>
|
||||||
@@ -138,10 +138,6 @@ $header
|
|||||||
</tr>
|
</tr>
|
||||||
</if>
|
</if>
|
||||||
<if ($template == 'new_database_by_customer')>
|
<if ($template == 'new_database_by_customer')>
|
||||||
<tr>
|
|
||||||
<td><em>{SALUTATION}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><em>{DB_NAME}</em></td>
|
<td><em>{DB_NAME}</em></td>
|
||||||
<td>{$lng['admin']['templates']['DB_NAME']}</td>
|
<td>{$lng['admin']['templates']['DB_NAME']}</td>
|
||||||
@@ -164,10 +160,6 @@ $header
|
|||||||
</tr>
|
</tr>
|
||||||
</if>
|
</if>
|
||||||
<if ($template == 'new_ftpaccount_by_customer')>
|
<if ($template == 'new_ftpaccount_by_customer')>
|
||||||
<tr>
|
|
||||||
<td><em>{SALUTATION}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><em>{USR_NAME}</em></td>
|
<td><em>{USR_NAME}</em></td>
|
||||||
<td>{$lng['admin']['templates']['USR_NAME']}</td>
|
<td>{$lng['admin']['templates']['USR_NAME']}</td>
|
||||||
|
|||||||
@@ -42,23 +42,27 @@ $header
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><em>{SALUTATION}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><em>{FIRSTNAME}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['FIRSTNAME']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><em>{NAME}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['NAME']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><em>{COMPANY}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['COMPANY']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><em>{CUSTOMER_NO}</em></td>
|
||||||
|
<td>{$lng['admin']['templates']['CUSTOMER_NO']}</td>
|
||||||
|
</tr>
|
||||||
<if ($template_name == 'createcustomer')>
|
<if ($template_name == 'createcustomer')>
|
||||||
<tr>
|
|
||||||
<td><em>{SALUTATION}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><em>{FIRSTNAME}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['FIRSTNAME']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><em>{NAME}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['NAME']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><em>{COMPANY}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['COMPANY']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><em>{USERNAME}</em></td>
|
<td><em>{USERNAME}</em></td>
|
||||||
<td>{$lng['admin']['templates']['USERNAME']}</td>
|
<td>{$lng['admin']['templates']['USERNAME']}</td>
|
||||||
@@ -90,10 +94,6 @@ $header
|
|||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
<if ($template_name == 'password_reset')>
|
<if ($template_name == 'password_reset')>
|
||||||
<tr>
|
|
||||||
<td><em>{SALUTATION}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><em>{USERNAME}</em></td>
|
<td><em>{USERNAME}</em></td>
|
||||||
<td>{$lng['admin']['templates']['USERNAME']}</td>
|
<td>{$lng['admin']['templates']['USERNAME']}</td>
|
||||||
@@ -140,10 +140,6 @@ $header
|
|||||||
</tr>
|
</tr>
|
||||||
</if>
|
</if>
|
||||||
<if ($template_name == 'new_database_by_customer')>
|
<if ($template_name == 'new_database_by_customer')>
|
||||||
<tr>
|
|
||||||
<td><em>{SALUTATION}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><em>{DB_NAME}</em></td>
|
<td><em>{DB_NAME}</em></td>
|
||||||
<td>{$lng['admin']['templates']['DB_NAME']}</td>
|
<td>{$lng['admin']['templates']['DB_NAME']}</td>
|
||||||
@@ -166,10 +162,6 @@ $header
|
|||||||
</tr>
|
</tr>
|
||||||
</if>
|
</if>
|
||||||
<if ($template_name == 'new_ftpaccount_by_customer')>
|
<if ($template_name == 'new_ftpaccount_by_customer')>
|
||||||
<tr>
|
|
||||||
<td><em>{SALUTATION}</em></td>
|
|
||||||
<td>{$lng['admin']['templates']['SALUTATION']}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><em>{USR_NAME}</em></td>
|
<td><em>{USR_NAME}</em></td>
|
||||||
<td>{$lng['admin']['templates']['USR_NAME']}</td>
|
<td>{$lng['admin']['templates']['USR_NAME']}</td>
|
||||||
@@ -190,4 +182,3 @@ $header
|
|||||||
|
|
||||||
</article>
|
</article>
|
||||||
$footer
|
$footer
|
||||||
|
|
||||||
|
|||||||
46
templates/Sparkle/assets/js/ipsandports.js
vendored
Normal file
46
templates/Sparkle/assets/js/ipsandports.js
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
var getUrlParameter = function getUrlParameter(sParam) {
|
||||||
|
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||||
|
sURLVariables = sPageURL.split('&'),
|
||||||
|
sParameterName,
|
||||||
|
i;
|
||||||
|
|
||||||
|
for (i = 0; i < sURLVariables.length; i++) {
|
||||||
|
sParameterName = sURLVariables[i].split('=');
|
||||||
|
|
||||||
|
if (sParameterName[0] === sParam) {
|
||||||
|
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check for internal ip and output a notice if private-range ip is given
|
||||||
|
*/
|
||||||
|
$('#ip').change(function() {
|
||||||
|
var ipval = $(this).val();
|
||||||
|
if (ipval.length > 0) {
|
||||||
|
var sid = getUrlParameter('s');
|
||||||
|
$.ajax({
|
||||||
|
url: "admin_ipsandports.php?s="+sid+"&page=overview&action=jqCheckIP",
|
||||||
|
type: "POST",
|
||||||
|
data: {
|
||||||
|
ip: ipval
|
||||||
|
},
|
||||||
|
dataType: "json",
|
||||||
|
success: function(json) {
|
||||||
|
if (json != 0) {
|
||||||
|
$('#ip').parent().append(json);
|
||||||
|
} else {
|
||||||
|
$('#ipnote').remove();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(a, b) {
|
||||||
|
console.log(a, b);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
28
templates/Sparkle/assets/js/traffic.js
vendored
28
templates/Sparkle/assets/js/traffic.js
vendored
@@ -19,8 +19,8 @@ $(document).ready(function() {
|
|||||||
} else {
|
} else {
|
||||||
ticks.push([i, $(row).children().first().html()]);
|
ticks.push([i, $(row).children().first().html()]);
|
||||||
}
|
}
|
||||||
ftp.push([i, parseFloat(ftpd / 1024)]);
|
ftp.push([i, parseFloat(ftpd)]);
|
||||||
http.push([i, parseFloat(httpd / 1024)]);
|
http.push([i, parseFloat(httpd)]);
|
||||||
mail.push([i, parseFloat(maild)]);
|
mail.push([i, parseFloat(maild)]);
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
@@ -107,24 +107,16 @@ $(document).ready(function() {
|
|||||||
"font-size": "11px"
|
"font-size": "11px"
|
||||||
}).appendTo("body");
|
}).appendTo("body");
|
||||||
|
|
||||||
$("#ftpchart, #httpchart").bind("plothover", function(event, pos, item) {
|
$("#ftpchart, #httpchart, #mailchart").bind("plothover", function(event, pos, item) {
|
||||||
if (item) {
|
if (item) {
|
||||||
var y = item.datapoint[1].toFixed(2);
|
var y = item.datapoint[1];
|
||||||
|
var unit = 'MiB';
|
||||||
|
if (y > 1024) {
|
||||||
|
y /= 1024;
|
||||||
|
unit = 'GiB';
|
||||||
|
}
|
||||||
|
|
||||||
$("#tooltip").html(item.series.label + ": " + y + " GiB").css({
|
$("#tooltip").html(item.series.label + ": " + y.toFixed(2) + " " + unit).css({
|
||||||
top: item.pageY + 5,
|
|
||||||
left: item.pageX - $("#tooltip").width() / 2
|
|
||||||
}).fadeIn(200);
|
|
||||||
} else {
|
|
||||||
$("#tooltip").hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#mailchart").bind("plothover", function(event, pos, item) {
|
|
||||||
if (item) {
|
|
||||||
var y = item.datapoint[1].toFixed(2);
|
|
||||||
|
|
||||||
$("#tooltip").html(item.series.label + ": " + y + " MiB").css({
|
|
||||||
top: item.pageY + 5,
|
top: item.pageY + 5,
|
||||||
left: item.pageX - $("#tooltip").width() / 2
|
left: item.pageX - $("#tooltip").width() / 2
|
||||||
}).fadeIn(200);
|
}).fadeIn(200);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<h2>
|
<h2>
|
||||||
<img src="templates/{$theme}/assets/img/icons/domains_big.png" alt="" />
|
<img src="templates/{$theme}/assets/img/icons/domains_big.png" alt="" />
|
||||||
{$lng['domains']['domainsettings']} ({$domains_count})
|
{$lng['domains']['domainsettings']} ({$result['count']} / {$domains_count})
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<table class="full hl">
|
<table class="full hl">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{$lng['domains']['domainname']} {$arrowcode['d.domain']}</th>
|
<th>{$lng['domains']['domainname']} {$arrowcode['d.domain_ace']}</th>
|
||||||
<th>{$lng['panel']['path']}</th>
|
<th>{$lng['panel']['path']}</th>
|
||||||
<th>{$lng['panel']['options']}</th>
|
<th>{$lng['panel']['options']}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
2
templates/Sparkle/customer/email/emails.tpl
vendored
2
templates/Sparkle/customer/email/emails.tpl
vendored
@@ -3,7 +3,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<h2>
|
<h2>
|
||||||
<img src="templates/{$theme}/assets/img/icons/emails_big.png" alt="" />
|
<img src="templates/{$theme}/assets/img/icons/emails_big.png" alt="" />
|
||||||
{$lng['menue']['email']['emails']} ({$emailscount})
|
{$lng['menue']['email']['emails']} ({$result['count']} / {$emailscount})
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
2
templates/Sparkle/customer/ftp/accounts.tpl
vendored
2
templates/Sparkle/customer/ftp/accounts.tpl
vendored
@@ -3,7 +3,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<h2>
|
<h2>
|
||||||
<img src="templates/{$theme}/assets/img/icons/group_edit_big.png" alt="" />
|
<img src="templates/{$theme}/assets/img/icons/group_edit_big.png" alt="" />
|
||||||
{$lng['menue']['ftp']['accounts']} ({$ftps_count})
|
{$lng['menue']['ftp']['accounts']} ({$result['count']} / {$ftps_count})
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
2
templates/Sparkle/customer/mysql/mysqls.tpl
vendored
2
templates/Sparkle/customer/mysql/mysqls.tpl
vendored
@@ -3,7 +3,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<h2>
|
<h2>
|
||||||
<img src="templates/{$theme}/assets/img/icons/mysql_big.png" alt="" />
|
<img src="templates/{$theme}/assets/img/icons/mysql_big.png" alt="" />
|
||||||
{$lng['menue']['mysql']['databases']} ({$mysqls_count})
|
{$lng['menue']['mysql']['databases']} ({$result['count']} / {$mysqls_count})
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
43
templates/Sparkle/misc/phprequirementfailed.tpl
vendored
Normal file
43
templates/Sparkle/misc/phprequirementfailed.tpl
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta http-equiv="Default-Style" content="text/css" />
|
||||||
|
<link rel="stylesheet" href="templates/Sparkle/assets/css/main.css" />
|
||||||
|
<!--[if IE]><link rel="stylesheet" href="templates/Sparkle/assets/css/main_ie.css" /><![endif]-->
|
||||||
|
<!--[if lt IE 9]><script src="js/html5shiv.min.js"></script><![endif]-->
|
||||||
|
<link href="templates/Sparkle/assets/img/favicon.ico" rel="icon" type="image/x-icon" />
|
||||||
|
<title>Froxlor Server Management Panel - Requirements not met</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="loginpage">
|
||||||
|
|
||||||
|
<article class="errorbox bradius">
|
||||||
|
<header class="dark">
|
||||||
|
<img src="templates/Sparkle/assets/img/logo.png" alt="Froxlor Server Management Panel" />
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section class="errorsec">
|
||||||
|
<div class="errorcontainer bradius">
|
||||||
|
<div class="errortitle">Whoops!</div>
|
||||||
|
<div class="error">
|
||||||
|
<p>It seems you are using an older version of PHP</p>
|
||||||
|
<p> </p>
|
||||||
|
<p>Froxlor requires at least PHP version <FROXLOR_PHPMIN><br />The installed version is: <CURRENT_VERSION></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<aside class="right">
|
||||||
|
<a href="index.php" title="Click to refresh">Refresh</a>
|
||||||
|
</aside>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</article>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<footer>
|
||||||
|
<span>
|
||||||
|
Froxlor © 2009-<CURRENT_YEAR> by <a href="https://www.froxlor.org/" rel="external">the Froxlor Team</a>
|
||||||
|
</span>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -64,7 +64,7 @@ class CertificatesTest extends TestCase
|
|||||||
'ssl_key_file' => $certdata['key']
|
'ssl_key_file' => $certdata['key']
|
||||||
))->add();
|
))->add();
|
||||||
$result = json_decode($json_result, true)['data'];
|
$result = json_decode($json_result, true)['data'];
|
||||||
$this->assertEquals(5, $result['domainid']);
|
$this->assertEquals(6, $result['domainid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAdminCertificatesList()
|
public function testAdminCertificatesList()
|
||||||
@@ -148,7 +148,7 @@ class CertificatesTest extends TestCase
|
|||||||
'ssl_key_file' => $certdata['key']
|
'ssl_key_file' => $certdata['key']
|
||||||
))->update();
|
))->update();
|
||||||
$result = json_decode($json_result, true)['data'];
|
$result = json_decode($json_result, true)['data'];
|
||||||
$this->assertEquals(5, $result['domainid']);
|
$this->assertEquals(6, $result['domainid']);
|
||||||
$this->assertEquals(str_replace("\n", "", $certdata['cert']), str_replace("\n", "", $result['ssl_cert_file']));
|
$this->assertEquals(str_replace("\n", "", $certdata['cert']), str_replace("\n", "", $result['ssl_cert_file']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user