Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6b34cc8f8 | ||
|
|
cfda35a36b | ||
|
|
57ae625d38 | ||
|
|
65ab064289 | ||
|
|
e6a6f6f9de | ||
|
|
a7b91eb1ed | ||
|
|
a2342ad1d2 | ||
|
|
add1818723 | ||
|
|
51c1d648b2 | ||
|
|
0fca98c652 | ||
|
|
3682116ba2 | ||
|
|
3b99070496 | ||
|
|
25f20e4a7d | ||
|
|
d46b2d1d80 | ||
|
|
4750dad9e2 | ||
|
|
c6830d8e7a | ||
|
|
10b4de4cf9 | ||
|
|
ae39a1759a | ||
|
|
989b4fee0e | ||
|
|
7f6810c5bd | ||
|
|
3fbc9815ea | ||
|
|
11533c2d75 | ||
|
|
652a998188 | ||
|
|
4546c00adb | ||
|
|
3c16fab92c | ||
|
|
c8c1f7e691 | ||
|
|
02d0194b9f | ||
|
|
54876efc8c | ||
|
|
a2f8d02b16 | ||
|
|
0d45e03f19 | ||
|
|
ae74cdda53 |
26
README.md
26
README.md
@@ -54,24 +54,24 @@ May be found in [COPYING](COPYING)
|
||||
### Tarball
|
||||
https://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](https://files.froxlor.org/releases/froxlor-latest.tar.gz.md5) [SHA1](https://files.froxlor.org/releases/froxlor-latest.tar.gz.sha1)
|
||||
|
||||
### Debian repository
|
||||
### Debian / Ubutnu repository
|
||||
|
||||
[HowTo](https://docs.froxlor.org/general/installation/aptpackage.html)
|
||||
|
||||
```
|
||||
apt-get -y install apt-transport-https lsb-release ca-certificates
|
||||
wget -O - https://deb.froxlor.org/froxlor.gpg | apt-key add -
|
||||
echo "deb https://deb.froxlor.org/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list
|
||||
```
|
||||
|
||||
### Ubuntu repository
|
||||
|
||||
[HowTo](https://docs.froxlor.org/general/installation/aptpackage.html)
|
||||
#### Debian
|
||||
|
||||
```
|
||||
apt-get -y install apt-transport-https lsb-release ca-certificates
|
||||
wget -O - https://deb.froxlor.org/froxlor.gpg | apt-key add -
|
||||
echo "deb https://deb.froxlor.org/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list
|
||||
apt-get -y install apt-transport-https lsb-release ca-certificates curl
|
||||
curl -sSLo /usr/share/keyrings/deb.froxlor.org-froxlor.gpg https://deb.froxlor.org/froxlor.gpg
|
||||
sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list'
|
||||
```
|
||||
|
||||
#### Ubuntu
|
||||
|
||||
```
|
||||
apt-get -y install apt-transport-https lsb-release ca-certificates curl
|
||||
curl -sSLo /usr/share/keyrings/deb.froxlor.org-froxlor.gpg https://deb.froxlor.org/froxlor.gpg
|
||||
sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list'
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
0
actions/admin/index.html
Normal file
0
actions/admin/index.html
Normal file
@@ -229,7 +229,7 @@ return array(
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_disable_le_selfcheck' => array(
|
||||
'system_le_domain_dnscheck' => array(
|
||||
'label' => $lng['serversettings']['le_domain_dnscheck'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'le_domain_dnscheck',
|
||||
|
||||
0
actions/admin/settings/index.html
Normal file
0
actions/admin/settings/index.html
Normal file
0
actions/index.html
Normal file
0
actions/index.html
Normal file
@@ -260,7 +260,7 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
$result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places);
|
||||
$result['diskspace'] = round($result['diskspace'] / 1024, $dec_places);
|
||||
$result['email'] = $idna_convert->decode($result['email']);
|
||||
$result['email'] = $idna_convert->decode($result['email'] ?? '');
|
||||
|
||||
$customers_ul = \Froxlor\UI\HTML::makecheckbox('customers_ul', $lng['customer']['unlimited'], '-1', false, $result['customers'], true, true);
|
||||
if ($result['customers'] == '-1') {
|
||||
|
||||
@@ -395,7 +395,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
$result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places);
|
||||
$result['diskspace'] = round($result['diskspace'] / 1024, $dec_places);
|
||||
$result['email'] = $idna_convert->decode($result['email']);
|
||||
$result['email'] = $idna_convert->decode($result['email'] ?? '');
|
||||
|
||||
$diskspace_ul = \Froxlor\UI\HTML::makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, $result['diskspace'], true, true);
|
||||
if ($result['diskspace'] == '-1') {
|
||||
|
||||
@@ -148,7 +148,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$customers = \Froxlor\UI\HTML::makeoption($lng['panel']['please_choose'], 0, 0, true);
|
||||
$result_customers_stmt = Database::prepare("
|
||||
SELECT `customerid`, `loginname`, `name`, `firstname`, `company`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY COALESCE(NULLIF(`name`,''), `company`) ASC");
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid ") . " ORDER BY COALESCE(NULLIF(`name`,''), `company`) ASC");
|
||||
$params = array();
|
||||
if ($userinfo['customers_see_all'] == '0') {
|
||||
$params['adminid'] = $userinfo['adminid'];
|
||||
@@ -674,7 +674,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
function formatDomainEntry(&$row, &$idna_convert)
|
||||
{
|
||||
$row['domain'] = $idna_convert->decode($row['domain']);
|
||||
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
|
||||
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain'] ?? '');
|
||||
|
||||
$row['ipandport'] = '';
|
||||
foreach ($row['ipsandports'] as $rowip) {
|
||||
@@ -685,7 +685,7 @@ function formatDomainEntry(&$row, &$idna_convert)
|
||||
}
|
||||
}
|
||||
$row['ipandport'] = substr($row['ipandport'], 0, - 1);
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']);
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date'] ?? '');
|
||||
|
||||
$row['termination_css'] = "";
|
||||
if ($row['termination_date'] != "") {
|
||||
|
||||
0
css/images/index.html
Normal file
0
css/images/index.html
Normal file
0
css/index.html
Normal file
0
css/index.html
Normal file
@@ -83,7 +83,7 @@ if ($page == 'overview') {
|
||||
$statsapp = 'webalizer';
|
||||
}
|
||||
$row = [
|
||||
'domain' => $idna_convert->decode($parentdomain)
|
||||
'domain' => $idna_convert->decode($parentdomain ?? '')
|
||||
];
|
||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";");
|
||||
|
||||
@@ -472,8 +472,8 @@ if ($page == 'overview') {
|
||||
function formatDomainEntry(&$row, &$idna_convert)
|
||||
{
|
||||
$row['domain'] = $idna_convert->decode($row['domain']);
|
||||
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
|
||||
$row['domainalias'] = $idna_convert->decode($row['domainalias']);
|
||||
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain'] ?? '');
|
||||
$row['domainalias'] = $idna_convert->decode($row['domainalias'] ?? '');
|
||||
|
||||
/**
|
||||
* check for set ssl-certs to show different state-icons
|
||||
@@ -503,7 +503,7 @@ function formatDomainEntry(&$row, &$idna_convert)
|
||||
}
|
||||
}
|
||||
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']);
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date'] ?? '');
|
||||
|
||||
$row['termination_css'] = "";
|
||||
if ($row['termination_date'] != "") {
|
||||
|
||||
0
doc/example/index.html
Normal file
0
doc/example/index.html
Normal file
0
doc/index.html
Normal file
0
doc/index.html
Normal file
@@ -723,7 +723,7 @@ opcache.validate_timestamps'),
|
||||
('panel', 'logo_image_login', ''),
|
||||
('panel', 'logo_overridetheme', '0'),
|
||||
('panel', 'logo_overridecustom', '0'),
|
||||
('panel', 'version', '0.10.33'),
|
||||
('panel', 'version', '0.10.37'),
|
||||
('panel', 'db_version', '202112310');
|
||||
|
||||
|
||||
|
||||
0
install/index.html
Normal file
0
install/index.html
Normal file
@@ -550,16 +550,23 @@ class FroxlorInstall
|
||||
$this->_updateSetting($upd_stmt, 'error', 'system', 'errorlog_level');
|
||||
}
|
||||
|
||||
/*
|
||||
* not yet used in configfiles
|
||||
* -> 0.11.x
|
||||
*
|
||||
$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);
|
||||
if (!empty($defaults)) {
|
||||
foreach ($defaults as $property) {
|
||||
$this->_updateSetting($upd_stmt, $property->attributes()->value, $property->attributes()->settinggroup, $property->attributes()->varname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed');
|
||||
$this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath');
|
||||
@@ -734,8 +741,26 @@ class FroxlorInstall
|
||||
|
||||
private function _grantDbPrivilegesTo(&$db_root, $database, $username, $password, $access_host)
|
||||
{
|
||||
// mariadb
|
||||
if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '10.0.0', '>=')) {
|
||||
// create user
|
||||
$stmt = $db_root->prepare("
|
||||
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED BY :password
|
||||
");
|
||||
$stmt->execute(array(
|
||||
"password" => $password
|
||||
));
|
||||
// grant privileges
|
||||
$stmt = $db_root->prepare("
|
||||
GRANT ALL ON `" . $database . "`.* TO :username@:host
|
||||
");
|
||||
$stmt->execute(array(
|
||||
"username" => $username,
|
||||
"host" => $access_host
|
||||
));
|
||||
}
|
||||
// mysql8 compatibility
|
||||
if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
|
||||
elseif (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
|
||||
// create user
|
||||
$stmt = $db_root->prepare("
|
||||
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH mysql_native_password BY :password
|
||||
|
||||
0
install/lib/index.html
Normal file
0
install/lib/index.html
Normal file
0
install/lng/index.html
Normal file
0
install/lng/index.html
Normal file
@@ -28,4 +28,5 @@ try {
|
||||
\Froxlor\Cli\ConfigServicesCmd::processParameters($argc, $argv);
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\Cli\ConfigServicesCmd::printerr($e->getMessage());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
0
install/scripts/index.html
Normal file
0
install/scripts/index.html
Normal file
@@ -28,4 +28,5 @@ try {
|
||||
\Froxlor\Cli\SwitchServerIpCmd::processParameters($argc, $argv);
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\Cli\SwitchServerIpCmd::printerr($e->getMessage());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
0
install/templates/assets/css/index.html
Normal file
0
install/templates/assets/css/index.html
Normal file
0
install/templates/assets/index.html
Normal file
0
install/templates/assets/index.html
Normal file
0
install/templates/index.html
Normal file
0
install/templates/index.html
Normal file
0
install/updates/froxlor/0.10/index.html
Normal file
0
install/updates/froxlor/0.10/index.html
Normal file
@@ -970,3 +970,34 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.32')) {
|
||||
showUpdateStep("Updating from 0.10.32 to 0.10.33", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.33');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.33')) {
|
||||
showUpdateStep("Updating from 0.10.33 to 0.10.34", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.34');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34')) {
|
||||
showUpdateStep("Updating from 0.10.34 to 0.10.34.1", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.34.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34.1')) {
|
||||
showUpdateStep("Updating from 0.10.34.1 to 0.10.35", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.35');
|
||||
}
|
||||
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.35')) {
|
||||
showUpdateStep("Updating from 0.10.35 to 0.10.35.1", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.35.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.35.1')) {
|
||||
showUpdateStep("Updating from 0.10.35.1 to 0.10.36", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.36');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.36')) {
|
||||
showUpdateStep("Updating from 0.10.36 to 0.10.37", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.37');
|
||||
}
|
||||
|
||||
0
install/updates/froxlor/0.9/index.html
Normal file
0
install/updates/froxlor/0.9/index.html
Normal file
0
install/updates/froxlor/index.html
Normal file
0
install/updates/froxlor/index.html
Normal file
0
install/updates/index.html
Normal file
0
install/updates/index.html
Normal file
0
install/updates/preconfig/0.10/index.html
Normal file
0
install/updates/preconfig/0.10/index.html
Normal file
0
install/updates/preconfig/0.9/index.html
Normal file
0
install/updates/preconfig/0.9/index.html
Normal file
0
install/updates/preconfig/index.html
Normal file
0
install/updates/preconfig/index.html
Normal file
0
js/index.html
Normal file
0
js/index.html
Normal file
0
js/plugins/index.html
Normal file
0
js/plugins/index.html
Normal file
@@ -297,6 +297,10 @@ abstract class ApiCommand extends ApiParameter
|
||||
$sortfield[$id] = $sfield;
|
||||
}
|
||||
$field = implode('.', $sortfield);
|
||||
if (preg_match('/^([a-z0-9\-\._`]+)$/i', $field) == false) {
|
||||
// skip
|
||||
continue;
|
||||
}
|
||||
if (! $first) {
|
||||
$condition .= ' AND ';
|
||||
}
|
||||
@@ -313,6 +317,14 @@ abstract class ApiCommand extends ApiParameter
|
||||
} elseif (strtolower($valoper['op']) == 'in' && is_array($valoper['value']) && count($valoper['value']) > 0) {
|
||||
$condition .= $field . ' ' . $valoper['op'] . ' (';
|
||||
foreach ($valoper['value'] as $incnt => $invalue) {
|
||||
if (!is_numeric($incnt)) {
|
||||
// skip
|
||||
continue;
|
||||
}
|
||||
if (!empty($invalue) && preg_match('/^([a-z0-9\-\._`]+)$/i', $invalue) == false) {
|
||||
// skip
|
||||
continue;
|
||||
}
|
||||
$condition .= ":" . $cleanfield . $incnt . ", ";
|
||||
$query_fields[':' . $cleanfield . $incnt] = $invalue ?? '';
|
||||
}
|
||||
@@ -398,6 +410,10 @@ abstract class ApiCommand extends ApiParameter
|
||||
$sortfield[$id] = $sfield;
|
||||
}
|
||||
$field = implode('.', $sortfield);
|
||||
if (preg_match('/^([a-z0-9\-\._`]+)$/i', $field) == false) {
|
||||
// skip
|
||||
continue;
|
||||
}
|
||||
$by = strtoupper($by);
|
||||
if (! in_array($by, [
|
||||
'ASC',
|
||||
@@ -423,6 +439,7 @@ abstract class ApiCommand extends ApiParameter
|
||||
return $order;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* return logger instance
|
||||
*
|
||||
|
||||
@@ -180,12 +180,18 @@ abstract class ApiParameter
|
||||
*/
|
||||
private function trimArray($input)
|
||||
{
|
||||
if (! is_array($input)) {
|
||||
if ($input === '') {
|
||||
return "";
|
||||
}
|
||||
if (is_numeric($input) || is_null($input)) {
|
||||
return $input;
|
||||
}
|
||||
if (!is_array($input)) {
|
||||
return trim($input);
|
||||
}
|
||||
return array_map(array(
|
||||
return array_map([
|
||||
$this,
|
||||
'trimArray'
|
||||
), $input);
|
||||
], $input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,10 +472,10 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
// parameters
|
||||
$name = $this->getParam('name', true, $result['name']);
|
||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||
$email = $this->getParam('email', true, $idna_convert->decode($result['email']));
|
||||
$email = $this->getParam('email', true, $idna_convert->decode($result['email'] ?? ''));
|
||||
$password = $this->getParam('admin_password', true, '');
|
||||
$def_language = $this->getParam('def_language', true, $result['def_language']);
|
||||
$custom_notes = $this->getParam('custom_notes', true, $result['custom_notes']);
|
||||
$custom_notes = $this->getParam('custom_notes', true, ($result['custom_notes'] ?? ""));
|
||||
$custom_notes_show = $this->getBoolParam('custom_notes_show', true, $result['custom_notes_show']);
|
||||
$theme = $this->getParam('theme', true, $result['theme']);
|
||||
|
||||
|
||||
@@ -950,7 +950,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
||||
$move_to_admin = (int) ($this->getParam('move_to_admin', true, 0));
|
||||
|
||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||
$email = $this->getParam('email', true, $idna_convert->decode($result['email']));
|
||||
$email = $this->getParam('email', true, $idna_convert->decode($result['email'] ?? ''));
|
||||
$name = $this->getParam('name', true, $result['name']);
|
||||
$firstname = $this->getParam('firstname', true, $result['firstname']);
|
||||
$company_required = empty($result['company']) && ((! empty($name) && empty($firstname)) || (empty($name) && ! empty($firstname)) || (empty($name) && empty($firstname)));
|
||||
|
||||
@@ -197,6 +197,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
|
||||
'NAME' => $customer['name'],
|
||||
'FIRSTNAME' => $customer['firstname'],
|
||||
'COMPANY' => $customer['company'],
|
||||
'USERNAME' => $customer['loginname'],
|
||||
'CUSTOMER_NO' => $customer['customernumber']
|
||||
);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class EmailForwarders extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
|
||||
$id = $result['id'];
|
||||
|
||||
// current destination array
|
||||
$result['destination_array'] = explode(' ', $result['destination']);
|
||||
$result['destination_array'] = explode(' ', ($result['destination'] ?? ''));
|
||||
|
||||
// prepare destination
|
||||
$destination = trim($destination);
|
||||
|
||||
@@ -243,6 +243,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
||||
'NAME' => $customer['name'],
|
||||
'FIRSTNAME' => $customer['firstname'],
|
||||
'COMPANY' => $customer['company'],
|
||||
'USERNAME' => $customer['loginname'],
|
||||
'CUSTOMER_NO' => $customer['customernumber'],
|
||||
'USR_NAME' => $username,
|
||||
'USR_PASS' => htmlentities(htmlentities($password)),
|
||||
|
||||
@@ -378,9 +378,9 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
||||
$listen_statement = $this->getBoolParam('listen_statement', true, $result['listen_statement']);
|
||||
$namevirtualhost_statement = $this->getBoolParam('namevirtualhost_statement', true, $result['namevirtualhost_statement']);
|
||||
$vhostcontainer = $this->getBoolParam('vhostcontainer', true, $result['vhostcontainer']);
|
||||
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('specialsettings', true, $result['specialsettings'])), 'specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('specialsettings', true, ($result['specialsettings'] ?? ""))), 'specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
$vhostcontainer_servername_statement = $this->getParam('vhostcontainer_servername_statement', true, $result['vhostcontainer_servername_statement']);
|
||||
$default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('default_vhostconf_domain', true, $result['default_vhostconf_domain'])), 'default_vhostconf_domain', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
$default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('default_vhostconf_domain', true, ($result['default_vhostconf_domain'] ?? ""))), 'default_vhostconf_domain', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
$docroot = \Froxlor\Validate\Validate::validate($this->getParam('docroot', true, $result['docroot']), 'docroot', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
|
||||
|
||||
if ((int) Settings::Get('system.use_ssl') == 1) {
|
||||
@@ -389,9 +389,9 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
||||
$ssl_key_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_key_file', $ssl, $result['ssl_key_file']), 'ssl_key_file', '', '', array(), true);
|
||||
$ssl_ca_file = \Froxlor\Validate\Validate::validate($this->getParam('ssl_ca_file', true, $result['ssl_ca_file']), 'ssl_ca_file', '', '', array(), true);
|
||||
$ssl_cert_chainfile = \Froxlor\Validate\Validate::validate($this->getParam('ssl_cert_chainfile', true, $result['ssl_cert_chainfile']), 'ssl_cert_chainfile', '', '', array(), true);
|
||||
$ssl_specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_specialsettings', true, $result['ssl_specialsettings'])), 'ssl_specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
$ssl_specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_specialsettings', true, ($result['ssl_specialsettings'] ?? ""))), 'ssl_specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
$include_specialsettings = $this->getBoolParam('include_specialsettings', true, $result['include_specialsettings']);
|
||||
$ssl_default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_default_vhostconf_domain', true, $result['ssl_default_vhostconf_domain'])), 'ssl_default_vhostconf_domain', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
$ssl_default_vhostconf_domain = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $this->getParam('ssl_default_vhostconf_domain', true, ($result['ssl_default_vhostconf_domain'] ?? ""))), 'ssl_default_vhostconf_domain', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
$include_default_vhostconf_domain = $this->getBoolParam('include_default_vhostconf_domain', true, $result['include_default_vhostconf_domain']);
|
||||
} else {
|
||||
$ssl = 0;
|
||||
|
||||
@@ -141,6 +141,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
'NAME' => $userinfo['name'],
|
||||
'FIRSTNAME' => $userinfo['firstname'],
|
||||
'COMPANY' => $userinfo['company'],
|
||||
'USERNAME' => $userinfo['loginname'],
|
||||
'CUSTOMER_NO' => $userinfo['customernumber'],
|
||||
'DB_NAME' => $username,
|
||||
'DB_PASS' => htmlentities(htmlentities($password)),
|
||||
|
||||
0
lib/Froxlor/Api/Commands/index.html
Normal file
0
lib/Froxlor/Api/Commands/index.html
Normal file
0
lib/Froxlor/Api/index.html
Normal file
0
lib/Froxlor/Api/index.html
Normal file
0
lib/Froxlor/Bulk/index.html
Normal file
0
lib/Froxlor/Bulk/index.html
Normal file
0
lib/Froxlor/Cli/Action/index.html
Normal file
0
lib/Froxlor/Cli/Action/index.html
Normal file
0
lib/Froxlor/Cli/index.html
Normal file
0
lib/Froxlor/Cli/index.html
Normal file
@@ -182,7 +182,7 @@ class ConfigParser
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the XML and populate $this->services
|
||||
* Parse the XML and populate $this->defaults
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@@ -194,9 +194,9 @@ class ConfigParser
|
||||
}
|
||||
|
||||
// Get all defaults
|
||||
$defaults = $this->xml->xpath('//defaults');
|
||||
$defaults = $this->xml->xpath('//defaults/default');
|
||||
foreach ($defaults as $default) {
|
||||
$this->defaults = $default;
|
||||
$this->defaults[] = $default;
|
||||
}
|
||||
|
||||
// Switch flag to indicate we parsed our data
|
||||
|
||||
0
lib/Froxlor/Config/index.html
Normal file
0
lib/Froxlor/Config/index.html
Normal file
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Froxlor\Cron;
|
||||
|
||||
/**
|
||||
@@ -18,6 +19,7 @@ namespace Froxlor\Cron;
|
||||
* @since 0.10.0
|
||||
*
|
||||
*/
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
|
||||
@@ -56,6 +58,12 @@ class CronConfig
|
||||
SELECT * FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `isactive` = '1'
|
||||
");
|
||||
|
||||
$binpath = Settings::Get("system.croncmdline");
|
||||
// fallback as it is important
|
||||
if ($binpath === null) {
|
||||
$binpath = "/usr/bin/nice -n 5 /usr/bin/php -q";
|
||||
}
|
||||
|
||||
$hour_delay = 0;
|
||||
$day_delay = 5;
|
||||
$month_delay = 7;
|
||||
@@ -96,20 +104,14 @@ class CronConfig
|
||||
}
|
||||
|
||||
// create entry-line
|
||||
$binpath = Settings::Get("system.croncmdline");
|
||||
// fallback as it is important
|
||||
if ($binpath === null) {
|
||||
$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";
|
||||
}
|
||||
}
|
||||
|
||||
// php sessionclean if enabled
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$cronfile .= "# Look for and purge old sessions every 30 minutes".PHP_EOL;
|
||||
$cronfile .= "09,39 * * * * root " . \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . "/scripts/php-sessionclean.php") . " --froxlor-dir=" . escapeshellarg(\Froxlor\Froxlor::getInstallDir()) . " 1> /dev/null" . PHP_EOL;
|
||||
$cronfile .= "# Look for and purge old sessions every 30 minutes" . PHP_EOL;
|
||||
$cronfile .= "09,39 * * * * root " . $binpath . " " . \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . "/scripts/php-sessionclean.php") . " --froxlor-dir=" . escapeshellarg(\Froxlor\Froxlor::getInstallDir()) . " 1> /dev/null" . PHP_EOL;
|
||||
}
|
||||
|
||||
if (\Froxlor\FileDir::isFreeBSD()) {
|
||||
@@ -127,7 +129,7 @@ class CronConfig
|
||||
$newcrontab = "";
|
||||
foreach ($crontablines as $ctl) {
|
||||
$ctl = trim($ctl);
|
||||
if (! empty($ctl) && ! preg_match("/(.*)froxlor_master_cronjob\.php(.*)/", $ctl)) {
|
||||
if (!empty($ctl) && !preg_match("/(.*)froxlor_master_cronjob\.php(.*)/", $ctl)) {
|
||||
$newcrontab .= $ctl . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
0
lib/Froxlor/Cron/Dns/index.html
Normal file
0
lib/Froxlor/Cron/Dns/index.html
Normal file
@@ -773,20 +773,28 @@ class Apache extends HttpConfigBase
|
||||
}
|
||||
|
||||
if (Settings::Get('system.logfiles_piped') == '1' && Settings::Get('system.logfiles_script') != '') {
|
||||
// replace for error_log
|
||||
$command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array(
|
||||
'LOGFILE' => $error_log,
|
||||
'DOMAIN' => $domain['domain'],
|
||||
'CUSTOMER' => $domain['loginname']
|
||||
));
|
||||
$logfiles_text .= ' ErrorLog "|' . $command . "\"\n";
|
||||
// replace for access_log
|
||||
$command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array(
|
||||
'LOGFILE' => $access_log,
|
||||
'DOMAIN' => $domain['domain'],
|
||||
'CUSTOMER' => $domain['loginname']
|
||||
));
|
||||
$logfiles_text .= ' CustomLog "|' . $command . '" ' . $logtype . "\n";
|
||||
if ($domain['writeerrorlog']) {
|
||||
// replace for error_log
|
||||
$command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array(
|
||||
'LOGFILE' => $error_log,
|
||||
'DOMAIN' => $domain['domain'],
|
||||
'CUSTOMER' => $domain['loginname']
|
||||
));
|
||||
$logfiles_text .= ' ErrorLog "|' . $command . "\"\n";
|
||||
} else {
|
||||
$logfiles_text .= ' ErrorLog "' . $error_log . '"' . "\n";
|
||||
}
|
||||
if ($domain['writeaccesslog']) {
|
||||
// replace for access_log
|
||||
$command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array(
|
||||
'LOGFILE' => $access_log,
|
||||
'DOMAIN' => $domain['domain'],
|
||||
'CUSTOMER' => $domain['loginname']
|
||||
));
|
||||
$logfiles_text .= ' CustomLog "|' . $command . '" ' . $logtype . "\n";
|
||||
} else {
|
||||
$logfiles_text .= ' CustomLog "' . $access_log . '" ' . $logtype . "\n";
|
||||
}
|
||||
} else {
|
||||
$logfiles_text .= ' ErrorLog "' . $error_log . '"' . "\n";
|
||||
$logfiles_text .= ' CustomLog "' . $access_log . '" ' . $logtype . "\n";
|
||||
|
||||
@@ -635,6 +635,9 @@ EOC;
|
||||
$acmesh_result = \Froxlor\FileDir::safe_exec(self::getAcmeSh() . " --upgrade --auto-upgrade 0");
|
||||
// check for activated cron
|
||||
$acmesh_result2 = \Froxlor\FileDir::safe_exec(self::getAcmeSh() . " --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));
|
||||
// set default CA
|
||||
$acmesh_result3 = \Froxlor\FileDir::safe_exec(self::getAcmeSh() . " --set-default-ca --server " . self::$apiserver);
|
||||
// log messages
|
||||
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) . "\n" . implode("\n", $acmesh_result3));
|
||||
}
|
||||
}
|
||||
|
||||
0
lib/Froxlor/Cron/Http/LetsEncrypt/index.html
Normal file
0
lib/Froxlor/Cron/Http/LetsEncrypt/index.html
Normal file
@@ -251,7 +251,7 @@ class Lighttpd extends HttpConfigBase
|
||||
// check for existence, #1485
|
||||
if (! file_exists($domain['ssl_ca_file'])) {
|
||||
$this->logger->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_ERR, $ip . ':' . $port . ' :: certificate CA file "' . $domain['ssl_ca_file'] . '" does not exist! Cannot create ssl-directives');
|
||||
echo $ip . ':' . port . ' :: certificate CA file "' . $domain['ssl_ca_file'] . '" does not exist! SSL-directives might not be working' . "\n";
|
||||
echo $ip . ':' . $port . ' :: certificate CA file "' . $domain['ssl_ca_file'] . '" does not exist! SSL-directives might not be working' . "\n";
|
||||
} else {
|
||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.ca-file = "' . \Froxlor\FileDir::makeCorrectFile($domain['ssl_ca_file']) . '"' . "\n";
|
||||
}
|
||||
@@ -760,6 +760,7 @@ class Lighttpd extends HttpConfigBase
|
||||
'customerid' => $domain['customerid']
|
||||
));
|
||||
|
||||
$diroption_text = '';
|
||||
while ($row_htpasswds = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
if ($this->auth_backend_loaded[$domain['ipandport']] != 'yes' && $this->auth_backend_loaded[$domain['ssl_ipandport']] != 'yes') {
|
||||
$filename = $domain['customerid'] . '.htpasswd';
|
||||
@@ -836,6 +837,7 @@ class Lighttpd extends HttpConfigBase
|
||||
}
|
||||
}
|
||||
|
||||
$servernames_text = '';
|
||||
for ($i = 0; $i < sizeof($server_string); $i ++) {
|
||||
$data = $server_string[$i];
|
||||
|
||||
|
||||
0
lib/Froxlor/Cron/Http/Php/index.html
Normal file
0
lib/Froxlor/Cron/Http/Php/index.html
Normal file
0
lib/Froxlor/Cron/Http/index.html
Normal file
0
lib/Froxlor/Cron/Http/index.html
Normal file
@@ -4,6 +4,7 @@ namespace Froxlor\Cron\System;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\FileDir;
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
@@ -150,13 +151,17 @@ class BackupCron extends \Froxlor\Cron\FroxlorCron
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
|
||||
$mysqlcnf_file = tempnam("/tmp", "frx");
|
||||
$mysqlcnf = "[mysqldump]\npassword=".$sql_root['passwd']."\n";
|
||||
file_put_contents($mysqlcnf_file, $mysqlcnf);
|
||||
|
||||
$has_dbs = false;
|
||||
while ($row = $sel_stmt->fetch()) {
|
||||
$cronlog->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_DEBUG, 'shell> mysqldump -u ' . escapeshellarg($sql_root['user']) . ' -pXXXXX ' . $row['databasename'] . ' > ' . \Froxlor\FileDir::makeCorrectFile($tmpdir . '/mysql/' . $row['databasename'] . '_' . date('YmdHi', time()) . '.sql'));
|
||||
$bool_false = false;
|
||||
\Froxlor\FileDir::safe_exec('mysqldump -u ' . escapeshellarg($sql_root['user']) . ' -p' . $sql_root['passwd'] . ' ' . $row['databasename'] . ' > ' . \Froxlor\FileDir::makeCorrectFile($tmpdir . '/mysql/' . $row['databasename'] . '_' . date('YmdHi', time()) . '.sql'), $bool_false, array(
|
||||
\Froxlor\FileDir::safe_exec('mysqldump --defaults-file=' . escapeshellarg($mysqlcnf_file) .' -u ' . escapeshellarg($sql_root['user']) . ' ' . $row['databasename'] . ' > ' . FileDir::makeCorrectFile($tmpdir . '/mysql/' . $row['databasename'] . '_' . date('YmdHi', time()) . '.sql'), $bool_false, [
|
||||
'>'
|
||||
));
|
||||
]);
|
||||
$has_dbs = true;
|
||||
}
|
||||
|
||||
@@ -164,6 +169,8 @@ class BackupCron extends \Froxlor\Cron\FroxlorCron
|
||||
$create_backup_tar_data .= './mysql ';
|
||||
}
|
||||
|
||||
unlink($mysqlcnf_file);
|
||||
|
||||
unset($sql_root);
|
||||
}
|
||||
|
||||
|
||||
@@ -324,8 +324,8 @@ class TasksCron extends \Froxlor\Cron\FroxlorCron
|
||||
|
||||
if (file_exists($logsdir) && $logsdir != '/' && $logsdir != \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.logfiles_directory')) && substr($logsdir, 0, strlen(Settings::Get('system.logfiles_directory'))) == Settings::Get('system.logfiles_directory')) {
|
||||
// build up wildcard for webX-{access,error}.log{*}
|
||||
$logfiles .= '-*';
|
||||
\Froxlor\FileDir::safe_exec('rm -f ' . escapeshellarg($logfiles));
|
||||
$logsdir .= '-*';
|
||||
\Froxlor\FileDir::safe_exec('rm -f ' . escapeshellarg($logsdir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0
lib/Froxlor/Cron/System/index.html
Normal file
0
lib/Froxlor/Cron/System/index.html
Normal file
@@ -36,7 +36,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
if ((int) Settings::Get('system.report_trafficmax') > 0) {
|
||||
// Warn the customers at xx% traffic-usage
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
||||
SELECT `c`.`customerid`, `c`.`loginname`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
||||
`c`.`company`, `c`.`traffic`, `c`.`email`, `c`.`def_language`,
|
||||
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`,
|
||||
(SELECT SUM(`t`.`http` + `t`.`ftp_up` + `t`.`ftp_down` + `t`.`mail`)
|
||||
@@ -60,6 +60,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
'name' => $row['name'],
|
||||
'firstname' => $row['firstname'],
|
||||
'company' => $row['company'],
|
||||
'loginname' => $row['loginname'],
|
||||
'customernumber' => $row['customernumber']
|
||||
);
|
||||
$replace_arr = array(
|
||||
@@ -67,6 +68,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
'NAME' => $rep_userinfo['name'],
|
||||
'FIRSTNAME' => $rep_userinfo['firstname'],
|
||||
'COMPANY' => $rep_userinfo['company'],
|
||||
'USERNAME' => $rep_userinfo['loginname'],
|
||||
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
||||
'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 */
|
||||
@@ -354,7 +356,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
* report about diskusage for customers
|
||||
*/
|
||||
$result_stmt = Database::query("
|
||||
SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
||||
SELECT `c`.`customerid`, `c`.`loginname`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
||||
`c`.`company`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`email`, `c`.`def_language`,
|
||||
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c`
|
||||
@@ -373,6 +375,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
'name' => $row['name'],
|
||||
'firstname' => $row['firstname'],
|
||||
'company' => $row['company'],
|
||||
'loginname' => $row['loginname'],
|
||||
'customernumber' => $row['customernumber']
|
||||
);
|
||||
$replace_arr = array(
|
||||
@@ -380,6 +383,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
|
||||
'NAME' => $rep_userinfo['name'],
|
||||
'FIRSTNAME' => $rep_userinfo['firstname'],
|
||||
'COMPANY' => $rep_userinfo['company'],
|
||||
'USERNAME' => $rep_userinfo['loginname'],
|
||||
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
||||
'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 */
|
||||
|
||||
0
lib/Froxlor/Cron/Traffic/index.html
Normal file
0
lib/Froxlor/Cron/Traffic/index.html
Normal file
0
lib/Froxlor/Cron/index.html
Normal file
0
lib/Froxlor/Cron/index.html
Normal file
0
lib/Froxlor/Customer/index.html
Normal file
0
lib/Froxlor/Customer/index.html
Normal file
@@ -173,7 +173,10 @@ class DbManager
|
||||
|
||||
if (isset($users[$username]) && is_array($users[$username]) && isset($users[$username]['hosts']) && is_array($users[$username]['hosts'])) {
|
||||
|
||||
$password = $users[$username]['password'];
|
||||
$password = [
|
||||
'password' => $users[$username]['password'],
|
||||
'plugin' => $users[$username]['plugin']
|
||||
];
|
||||
|
||||
foreach ($mysql_access_host_array as $mysql_access_host) {
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Froxlor\Database\Manager;
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
@@ -68,7 +69,7 @@ class DbManagerMySQL
|
||||
* username and sets the password for that user the given access_host
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @param string|array $password
|
||||
* @param string $access_host
|
||||
* @param bool $p_encrypted
|
||||
* optional, whether the password is encrypted or not, default false
|
||||
@@ -77,7 +78,13 @@ class DbManagerMySQL
|
||||
*/
|
||||
public function grantPrivilegesTo($username = null, $password = null, $access_host = null, $p_encrypted = false, $update = false)
|
||||
{
|
||||
if (! $update) {
|
||||
$pwd_plugin = 'mysql_native_password';
|
||||
if (is_array($password) && count($password) == 2) {
|
||||
$pwd_plugin = $password['plugin'];
|
||||
$password = $password['password'];
|
||||
}
|
||||
|
||||
if (!$update) {
|
||||
// create user
|
||||
if ($p_encrypted) {
|
||||
if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.7.0', '<')) {
|
||||
@@ -86,7 +93,7 @@ class DbManagerMySQL
|
||||
");
|
||||
} else {
|
||||
$stmt = Database::prepare("
|
||||
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH mysql_native_password AS :password
|
||||
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH " . $pwd_plugin . " AS :password
|
||||
");
|
||||
}
|
||||
} else {
|
||||
@@ -115,7 +122,7 @@ class DbManagerMySQL
|
||||
}
|
||||
} else {
|
||||
if ($p_encrypted) {
|
||||
$stmt = Database::prepare("ALTER USER :username@:host IDENTIFIED WITH mysql_native_password AS :password");
|
||||
$stmt = Database::prepare("ALTER USER :username@:host IDENTIFIED WITH " . $pwd_plugin . " AS :password");
|
||||
} else {
|
||||
$stmt = Database::prepare("ALTER USER :username@:host IDENTIFIED BY :password");
|
||||
}
|
||||
@@ -136,7 +143,7 @@ class DbManagerMySQL
|
||||
*/
|
||||
public function deleteDatabase($dbname = null)
|
||||
{
|
||||
if (Database::getAttribute(\PDO::ATTR_SERVER_VERSION) < '5.0.2') {
|
||||
if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.0.2', '<')) {
|
||||
// failsafe if user has been deleted manually (requires MySQL 4.1.2+)
|
||||
$stmt = Database::prepare("REVOKE ALL PRIVILEGES, GRANT OPTION FROM `" . $dbname . "`");
|
||||
Database::pexecute($stmt, array(), false);
|
||||
@@ -247,9 +254,10 @@ class DbManagerMySQL
|
||||
$allsqlusers = array();
|
||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
if ($user_only == false) {
|
||||
if (! isset($allsqlusers[$row['User']]) || ! is_array($allsqlusers[$row['User']])) {
|
||||
if (!isset($allsqlusers[$row['User']]) || !is_array($allsqlusers[$row['User']])) {
|
||||
$allsqlusers[$row['User']] = array(
|
||||
'password' => $row['Password'] ?? $row['authentication_string'],
|
||||
'plugin' => $row['plugin'] ?? 'mysql_native_password',
|
||||
'hosts' => array()
|
||||
);
|
||||
}
|
||||
|
||||
0
lib/Froxlor/Database/Manager/index.html
Normal file
0
lib/Froxlor/Database/Manager/index.html
Normal file
0
lib/Froxlor/Database/index.html
Normal file
0
lib/Froxlor/Database/index.html
Normal file
0
lib/Froxlor/Dns/index.html
Normal file
0
lib/Froxlor/Dns/index.html
Normal file
0
lib/Froxlor/Domain/index.html
Normal file
0
lib/Froxlor/Domain/index.html
Normal file
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Froxlor;
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
@@ -96,14 +97,14 @@ class FileDir
|
||||
$subdir = self::makeCorrectDir($subdir);
|
||||
$subdirs = array();
|
||||
|
||||
if ($within_homedir || ! $allow_notwithinhomedir) {
|
||||
if ($within_homedir || !$allow_notwithinhomedir) {
|
||||
$subdirlen = strlen($subdir);
|
||||
$offset = 0;
|
||||
|
||||
while ($offset < $subdirlen) {
|
||||
$offset = strpos($subdir, '/', $offset);
|
||||
$subdirelem = substr($subdir, 0, $offset);
|
||||
$offset ++;
|
||||
$offset++;
|
||||
array_push($subdirs, self::makeCorrectDir($homeDir . $subdirelem));
|
||||
}
|
||||
} else {
|
||||
@@ -113,7 +114,7 @@ class FileDir
|
||||
$subdirs = array_unique($subdirs);
|
||||
sort($subdirs);
|
||||
foreach ($subdirs as $sdir) {
|
||||
if (! is_dir($sdir)) {
|
||||
if (!is_dir($sdir)) {
|
||||
$sdir = self::makeCorrectDir($sdir);
|
||||
self::safe_exec('mkdir -p ' . escapeshellarg($sdir));
|
||||
// place index
|
||||
@@ -247,7 +248,7 @@ class FileDir
|
||||
*/
|
||||
public static function makeCorrectFile($filename)
|
||||
{
|
||||
if (! isset($filename) || trim($filename) == '') {
|
||||
if (!isset($filename) || trim($filename) == '') {
|
||||
$error = 'Given filename for function ' . __FUNCTION__ . ' is empty.' . "\n";
|
||||
$error .= 'This is very dangerous and should not happen.' . "\n";
|
||||
$error .= 'Please inform the Froxlor team about this issue so they can fix it.';
|
||||
@@ -278,7 +279,7 @@ class FileDir
|
||||
{
|
||||
if (is_string($dir) && strlen($dir) > 0) {
|
||||
$dir = trim($dir);
|
||||
if (substr($dir, - 1, 1) != '/') {
|
||||
if (substr($dir, -1, 1) != '/') {
|
||||
$dir .= '/';
|
||||
}
|
||||
if (substr($dir, 0, 1) != '/') {
|
||||
@@ -355,7 +356,7 @@ class FileDir
|
||||
$destination = substr($destination, 1);
|
||||
}
|
||||
|
||||
if (substr($destination, - 1, 1) == ' ') {
|
||||
if (substr($destination, -1, 1) == ' ') {
|
||||
$destination = substr($destination, 0, strlen($destination) - 1);
|
||||
}
|
||||
|
||||
@@ -390,7 +391,7 @@ class FileDir
|
||||
// but dirList holds the paths with starting slash
|
||||
// so we just add one here to get the correct
|
||||
// default path selected, #225
|
||||
if (substr($value, 0, 1) != '/' && ! $dom) {
|
||||
if (substr($value, 0, 1) != '/' && !$dom) {
|
||||
$value = '/' . $value;
|
||||
}
|
||||
|
||||
@@ -408,34 +409,22 @@ class FileDir
|
||||
natcasesort($dirList);
|
||||
|
||||
if (sizeof($dirList) > 0) {
|
||||
if (sizeof($dirList) <= 100) {
|
||||
$_field = '';
|
||||
foreach ($dirList as $dir) {
|
||||
if (strpos($dir, $path) === 0) {
|
||||
$dir = substr($dir, strlen($path));
|
||||
// docroot cut off of current directory == empty -> directory is the docroot
|
||||
if (empty($dir)) {
|
||||
$dir = '/';
|
||||
}
|
||||
$dir = self::makeCorrectDir($dir);
|
||||
$_field = '';
|
||||
foreach ($dirList as $dir) {
|
||||
if (strpos($dir, $path) === 0) {
|
||||
$dir = substr($dir, strlen($path));
|
||||
// docroot cut off of current directory == empty -> directory is the docroot
|
||||
if (empty($dir)) {
|
||||
$dir = '/';
|
||||
}
|
||||
$_field .= \Froxlor\UI\HTML::makeoption($dir, $dir, $value);
|
||||
$dir = self::makeCorrectDir($dir);
|
||||
}
|
||||
$field = array(
|
||||
'type' => 'select',
|
||||
'value' => $_field
|
||||
);
|
||||
} else {
|
||||
// remove starting slash we added
|
||||
// for the Dropdown, #225
|
||||
$value = substr($value, 1);
|
||||
// $field = $lng['panel']['toomanydirs'];
|
||||
$field = array(
|
||||
'type' => 'text',
|
||||
'value' => htmlspecialchars($value),
|
||||
'note' => $lng['panel']['toomanydirs']
|
||||
);
|
||||
$_field .= \Froxlor\UI\HTML::makeoption($dir, $dir, $value);
|
||||
}
|
||||
$field = array(
|
||||
'type' => 'select',
|
||||
'value' => $_field
|
||||
);
|
||||
} else {
|
||||
// $field = $lng['panel']['dirsmissing'];
|
||||
// $field = '<input type="hidden" name="path" value="/" />';
|
||||
@@ -489,22 +478,31 @@ class FileDir
|
||||
$filter = function ($file, $key, $iterator) use ($exclude) {
|
||||
if (in_array($file->getFilename(), $exclude)) {
|
||||
return false;
|
||||
} elseif (substr($file->getFilename(), 0, 1) == '.') {
|
||||
// also hide hidden folders
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// create RecursiveIteratorIterator
|
||||
$its = new \RecursiveIteratorIterator(new \RecursiveCallbackFilterIterator(new System\IgnorantRecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), $filter));
|
||||
$its = new \RecursiveIteratorIterator(
|
||||
new \RecursiveCallbackFilterIterator(
|
||||
new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
$filter
|
||||
),
|
||||
\RecursiveIteratorIterator::LEAVES_ONLY,
|
||||
\RecursiveIteratorIterator::CATCH_GET_CHILD
|
||||
);
|
||||
// we can limit the recursion-depth, but will it be helpful or
|
||||
// will people start asking "why do I only see 2 subdirectories, i want to use /a/b/c"
|
||||
// let's keep this in mind and see whether it will be useful
|
||||
// @TODO
|
||||
// $its->setMaxDepth(2);
|
||||
$its->setMaxDepth(2);
|
||||
|
||||
// check every file
|
||||
foreach ($its as $fullFileName => $it) {
|
||||
if ($it->isDir() && (fileowner($fullFileName) == $uid || filegroup($fullFileName) == $gid)) {
|
||||
$_fileList[] = self::makeCorrectDir(dirname($fullFileName));
|
||||
$_fileList[] = self::makeCorrectDir($fullFileName);
|
||||
}
|
||||
}
|
||||
$_fileList[] = $path;
|
||||
@@ -525,7 +523,7 @@ class FileDir
|
||||
*/
|
||||
public static function isFreeBSD($exact = false)
|
||||
{
|
||||
if (($exact && PHP_OS == 'FreeBSD') || (! $exact && stristr(PHP_OS, 'BSD'))) {
|
||||
if (($exact && PHP_OS == 'FreeBSD') || (!$exact && stristr(PHP_OS, 'BSD'))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -7,7 +7,7 @@ final class Froxlor
|
||||
{
|
||||
|
||||
// Main version variable
|
||||
const VERSION = '0.10.33';
|
||||
const VERSION = '0.10.37';
|
||||
|
||||
// Database version (YYYYMMDDC where C is a daily counter)
|
||||
const DBVERSION = '202112310';
|
||||
|
||||
0
lib/Froxlor/Http/index.html
Normal file
0
lib/Froxlor/Http/index.html
Normal file
0
lib/Froxlor/Idna/index.html
Normal file
0
lib/Froxlor/Idna/index.html
Normal file
@@ -63,7 +63,7 @@ class PhpHelper
|
||||
$subject[$field] = self::htmlentitiesArray($subject[$field], $fields, $quote_style, $charset);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} elseif (!empty($subject)) {
|
||||
$subject = htmlentities($subject, $quote_style, $charset);
|
||||
}
|
||||
|
||||
|
||||
0
lib/Froxlor/Settings/index.html
Normal file
0
lib/Froxlor/Settings/index.html
Normal file
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
namespace Froxlor\System;
|
||||
|
||||
/**
|
||||
* If you use RecursiveDirectoryIterator with RecursiveIteratorIterator and run
|
||||
* into UnexpectedValueException you may use this little hack to ignore those
|
||||
* directories, such as lost+found on linux.
|
||||
* (User "antennen" @ http://php.net/manual/en/class.recursivedirectoryiterator.php#101654)
|
||||
*/
|
||||
class IgnorantRecursiveDirectoryIterator extends \RecursiveDirectoryIterator
|
||||
{
|
||||
|
||||
public function getChildren()
|
||||
{
|
||||
try {
|
||||
return new IgnorantRecursiveDirectoryIterator($this->getPathname());
|
||||
} catch (\UnexpectedValueException $e) {
|
||||
return new \RecursiveArrayIterator(array());
|
||||
}
|
||||
}
|
||||
}
|
||||
0
lib/Froxlor/System/index.html
Normal file
0
lib/Froxlor/System/index.html
Normal file
0
lib/Froxlor/UI/index.html
Normal file
0
lib/Froxlor/UI/index.html
Normal file
0
lib/Froxlor/Validate/Form/index.html
Normal file
0
lib/Froxlor/Validate/Form/index.html
Normal file
0
lib/Froxlor/Validate/index.html
Normal file
0
lib/Froxlor/Validate/index.html
Normal file
0
lib/Froxlor/index.html
Normal file
0
lib/Froxlor/index.html
Normal file
@@ -3561,7 +3561,7 @@ postmaster_address = postmaster@<SERVERNAME>
|
||||
|
||||
protocol lda {
|
||||
# Space separated list of plugins to load (default is global mail_plugins).
|
||||
#mail_plugins = $mail_plugins
|
||||
mail_plugins = $mail_plugins quota sieve
|
||||
}
|
||||
]]>
|
||||
</content>
|
||||
|
||||
@@ -3557,7 +3557,7 @@ postmaster_address = postmaster@<SERVERNAME>
|
||||
|
||||
protocol lda {
|
||||
# Space separated list of plugins to load (default is global mail_plugins).
|
||||
#mail_plugins = $mail_plugins
|
||||
mail_plugins = $mail_plugins quota sieve
|
||||
}
|
||||
]]>
|
||||
</content>
|
||||
|
||||
@@ -1600,7 +1600,7 @@ root: root@<SERVERNAME>
|
||||
# is /etc/mailname.
|
||||
#myorigin = /etc/mailname
|
||||
|
||||
smtpd_banner = $myhostname ESMTP $mail_name (@@DISTRO@@)
|
||||
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
|
||||
biff = no
|
||||
|
||||
# appending .domain is the MUA's job.
|
||||
|
||||
0
lib/configfiles/index.html
Normal file
0
lib/configfiles/index.html
Normal file
0
lib/formfields/admin/admin/index.html
Normal file
0
lib/formfields/admin/admin/index.html
Normal file
0
lib/formfields/admin/cronjobs/index.html
Normal file
0
lib/formfields/admin/cronjobs/index.html
Normal file
0
lib/formfields/admin/customer/index.html
Normal file
0
lib/formfields/admin/customer/index.html
Normal file
0
lib/formfields/admin/domains/index.html
Normal file
0
lib/formfields/admin/domains/index.html
Normal file
0
lib/formfields/admin/index.html
Normal file
0
lib/formfields/admin/index.html
Normal file
0
lib/formfields/admin/ipsandports/index.html
Normal file
0
lib/formfields/admin/ipsandports/index.html
Normal file
0
lib/formfields/admin/phpconfig/index.html
Normal file
0
lib/formfields/admin/phpconfig/index.html
Normal file
0
lib/formfields/admin/plans/index.html
Normal file
0
lib/formfields/admin/plans/index.html
Normal file
0
lib/formfields/admin/templates/index.html
Normal file
0
lib/formfields/admin/templates/index.html
Normal file
0
lib/formfields/customer/domains/index.html
Normal file
0
lib/formfields/customer/domains/index.html
Normal file
0
lib/formfields/customer/email/index.html
Normal file
0
lib/formfields/customer/email/index.html
Normal file
0
lib/formfields/customer/extras/index.html
Normal file
0
lib/formfields/customer/extras/index.html
Normal file
0
lib/formfields/customer/ftp/index.html
Normal file
0
lib/formfields/customer/ftp/index.html
Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user