nextcloud quotas for froxlor logins

This commit is contained in:
2022-06-20 20:06:50 +02:00
parent b118883013
commit 93c72e6754
6 changed files with 34 additions and 2 deletions

View File

@@ -298,6 +298,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
$email_quota_ul = \Froxlor\UI\HTML::makecheckbox('email_quota_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); $email_quota_ul = \Froxlor\UI\HTML::makecheckbox('email_quota_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$ftps_ul = \Froxlor\UI\HTML::makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); $ftps_ul = \Froxlor\UI\HTML::makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$mysqls_ul = \Froxlor\UI\HTML::makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); $mysqls_ul = \Froxlor\UI\HTML::makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$nextcloud_quota_ul = \Froxlor\UI\HTML::makecheckbox('nextcloud_quota_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$gender_options = \Froxlor\UI\HTML::makeoption($lng['gender']['undef'], 0, true, true, true); $gender_options = \Froxlor\UI\HTML::makeoption($lng['gender']['undef'], 0, true, true, true);
$gender_options .= \Froxlor\UI\HTML::makeoption($lng['gender']['male'], 1, null, true, true); $gender_options .= \Froxlor\UI\HTML::makeoption($lng['gender']['male'], 1, null, true, true);
@@ -397,11 +398,16 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
$result['diskspace'] = round($result['diskspace'] / 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']);
$nextcloud_quota_ul = \Froxlor\UI\HTML::makecheckbox('nextcloud_quota_ul', $lng['customer']['unlimited'], '-1', false, $result['nextcloud_quota'], true, true);
if ($result['nextcloud_quota'] == '-1') {
$result['nextcloud_quota'] = '';
}
$diskspace_ul = \Froxlor\UI\HTML::makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, $result['diskspace'], true, true); $diskspace_ul = \Froxlor\UI\HTML::makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, $result['diskspace'], true, true);
if ($result['diskspace'] == '-1') { if ($result['diskspace'] == '-1') {
$result['diskspace'] = ''; $result['diskspace'] = '';
} }
$traffic_ul = \Froxlor\UI\HTML::makecheckbox('traffic_ul', $lng['customer']['unlimited'], '-1', false, $result['traffic'], true, true); $traffic_ul = \Froxlor\UI\HTML::makecheckbox('traffic_ul', $lng['customer']['unlimited'], '-1', false, $result['traffic'], true, true);
if ($result['traffic'] == '-1') { if ($result['traffic'] == '-1') {
$result['traffic'] = ''; $result['traffic'] = '';

View File

@@ -368,6 +368,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
foreach ($hp_result['value'] as $index => $value) { foreach ($hp_result['value'] as $index => $value) {
$hp_result[$index] = $value; $hp_result[$index] = $value;
} }
$nextcloud_quota = $hp_result['nextcloud_quota'] ?? 0;
$diskspace = $hp_result['diskspace'] ?? 0; $diskspace = $hp_result['diskspace'] ?? 0;
$traffic = $hp_result['traffic'] ?? 0; $traffic = $hp_result['traffic'] ?? 0;
$subdomains = $hp_result['subdomains'] ?? 0; $subdomains = $hp_result['subdomains'] ?? 0;
@@ -385,6 +386,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
$dnsenabled = $hp_result['dnsenabled'] ?? 0; $dnsenabled = $hp_result['dnsenabled'] ?? 0;
$logviewenabled = $hp_result['logviewenabled'] ?? 0; $logviewenabled = $hp_result['logviewenabled'] ?? 0;
} else { } else {
$nextcloud_quota = $this->getUlParam('nextcloud_quota', 'nextcloud_quota_ul', true, 0);
$diskspace = $this->getUlParam('diskspace', 'diskspace_ul', true, 0); $diskspace = $this->getUlParam('diskspace', 'diskspace_ul', true, 0);
$traffic = $this->getUlParam('traffic', 'traffic_ul', true, 0); $traffic = $this->getUlParam('traffic', 'traffic_ul', true, 0);
$subdomains = $this->getUlParam('subdomains', 'subdomains_ul', true, 0); $subdomains = $this->getUlParam('subdomains', 'subdomains_ul', true, 0);
@@ -533,6 +535,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
'api_allowed' => $api_allowed, 'api_allowed' => $api_allowed,
'docroot' => $documentroot, 'docroot' => $documentroot,
'guid' => $guid, 'guid' => $guid,
'nextcloud_quota' => $nextcloud_quota,
'diskspace' => $diskspace, 'diskspace' => $diskspace,
'traffic' => $traffic, 'traffic' => $traffic,
'subdomains' => $subdomains, 'subdomains' => $subdomains,
@@ -574,6 +577,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
`api_allowed` = :api_allowed, `api_allowed` = :api_allowed,
`documentroot` = :docroot, `documentroot` = :docroot,
`guid` = :guid, `guid` = :guid,
`nextcloud_quota` = :nextcloud_quota,
`diskspace` = :diskspace, `diskspace` = :diskspace,
`traffic` = :traffic, `traffic` = :traffic,
`subdomains` = :subdomains, `subdomains` = :subdomains,
@@ -968,6 +972,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
$custom_notes_show = $this->getBoolParam('custom_notes_show', true, $result['custom_notes_show']); $custom_notes_show = $this->getBoolParam('custom_notes_show', true, $result['custom_notes_show']);
$dec_places = Settings::Get('panel.decimal_places'); $dec_places = Settings::Get('panel.decimal_places');
$nextcloud_quota = $this->getUlParam('nextcloud_quota', 'nextcloud_quota_ul', true, round($result['nextcloud_quota'], $dec_places));
$diskspace = $this->getUlParam('diskspace', 'diskspace_ul', true, round($result['diskspace'] / 1024, $dec_places)); $diskspace = $this->getUlParam('diskspace', 'diskspace_ul', true, round($result['diskspace'] / 1024, $dec_places));
$traffic = $this->getUlParam('traffic', 'traffic_ul', true, round($result['traffic'] / (1024 * 1024), $dec_places)); $traffic = $this->getUlParam('traffic', 'traffic_ul', true, round($result['traffic'] / (1024 * 1024), $dec_places));
$subdomains = $this->getUlParam('subdomains', 'subdomains_ul', true, $result['subdomains']); $subdomains = $this->getUlParam('subdomains', 'subdomains_ul', true, $result['subdomains']);
@@ -1234,6 +1239,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
'fax' => $fax, 'fax' => $fax,
'email' => $email, 'email' => $email,
'customerno' => $customernumber, 'customerno' => $customernumber,
'nextcloud_quota' => $nextcloud_quota,
'diskspace' => $diskspace, 'diskspace' => $diskspace,
'traffic' => $traffic, 'traffic' => $traffic,
'subdomains' => $subdomains, 'subdomains' => $subdomains,
@@ -1276,6 +1282,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
`fax` = :fax, `fax` = :fax,
`email` = :email, `email` = :email,
`customernumber` = :customerno, `customernumber` = :customerno,
`nextcloud_quota` = :nextcloud_quota,
`diskspace` = :diskspace, `diskspace` = :diskspace,
`traffic` = :traffic, `traffic` = :traffic,
`subdomains` = :subdomains, `subdomains` = :subdomains,

View File

@@ -1035,8 +1035,10 @@ class Nginx extends HttpConfigBase
protected function getStats($domain, $single) protected function getStats($domain, $single)
{ {
$stats_text = '';
$stats_text = '';
return $stats_text;
// define basic path to the stats // define basic path to the stats
if (Settings::Get('system.awstats_enabled') == '1') { if (Settings::Get('system.awstats_enabled') == '1') {
$alias_dir = \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/'); $alias_dir = \Froxlor\FileDir::makeCorrectFile($domain['customerroot'] . '/awstats/');

View File

@@ -189,6 +189,14 @@ return array(
'title' => $lng['admin']['servicedata'], 'title' => $lng['admin']['servicedata'],
'image' => 'icons/user_add.png', 'image' => 'icons/user_add.png',
'fields' => array( 'fields' => array(
'nextcloud_quota' => array(
'label' => $lng['customer']['nextcloud_quota'] . ' (' . $lng['customer']['gib'] . ')',
'type' => 'textul',
'value' => 0,
'maxlength' => 16,
'mandatory' => true,
'ul_field' => $nextcloud_quota_ul
),
'diskspace' => array( 'diskspace' => array(
'label' => $lng['customer']['diskspace'] . ' (' . $lng['customer']['mib'] . ')', 'label' => $lng['customer']['diskspace'] . ' (' . $lng['customer']['mib'] . ')',
'type' => 'textul', 'type' => 'textul',

View File

@@ -195,6 +195,14 @@ return array(
'title' => $lng['admin']['servicedata'], 'title' => $lng['admin']['servicedata'],
'image' => 'icons/user_edit.png', 'image' => 'icons/user_edit.png',
'fields' => array( 'fields' => array(
'nextcloud_quota' => array(
'label' => $lng['customer']['nextcloud_quota'] . ' (' . $lng['customer']['gib'] . ')',
'type' => 'textul',
'value' => $result['nextcloud_quota'],
'maxlength' => 16,
'mandatory' => true,
'ul_field' => $nextcloud_quota_ul
),
'diskspace' => array( 'diskspace' => array(
'label' => $lng['customer']['diskspace'] . ' (' . $lng['customer']['mib'] . ')', 'label' => $lng['customer']['diskspace'] . ' (' . $lng['customer']['mib'] . ')',
'type' => 'textul', 'type' => 'textul',

View File

@@ -72,6 +72,7 @@ $lng['customer']['domains'] = 'Domains';
$lng['customer']['unlimited'] = '∞'; $lng['customer']['unlimited'] = '∞';
$lng['customer']['mib'] = 'MiB'; $lng['customer']['mib'] = 'MiB';
$lng['customer']['gib'] = 'GiB'; $lng['customer']['gib'] = 'GiB';
$lng['customer']['nextcloud_quota'] = 'Nextcloud Quota';
/** /**
* Customermenue * Customermenue