Skip to content

Commit 1e9d111

Browse files
committed
Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
2 parents 0166c12 + 99d4a96 commit 1e9d111

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

install/lib/installer_base.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ public function grant_master_database_rights($verbose = false) {
526526
$hosts[$from_host]['pwd'] = $conf['mysql']['master_ispconfig_password'];
527527

528528
$host_ips = $this->get_host_ips();
529-
if(is_arary($host_ips) && !empty($host_ips)) {
529+
if(is_array($host_ips) && !empty($host_ips)) {
530530
foreach($host_ips as $ip) {
531531
$hosts[$ip]['user'] = $conf['mysql']['master_ispconfig_user'];
532532
$hosts[$ip]['db'] = $conf['mysql']['master_database'];

interface/lib/classes/listform_actions.inc.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class listform_actions {
3939
private $sortKeys;
4040

4141
private function _sort($aOne, $aTwo) {
42+
$suffixes=array('k' => 1, 'M' => 1024, 'G' => 1048576, 'T' => 1099511627776);
4243
if(!is_array($aOne) || !is_array($aTwo)) return 0;
4344

4445
if(!is_array($this->sortKeys)) $this->sortKeys = array($this->sortKeys);
@@ -49,6 +50,15 @@ private function _sort($aOne, $aTwo) {
4950
}
5051
$a = $aOne[$sKey];
5152
$b = $aTwo[$sKey];
53+
54+
if(preg_match('/(\d+\.?\d*) ([kMGT])B/', $a, $match)) {
55+
$a = $match[1] * $suffixes[$match[2]];
56+
}
57+
58+
if(preg_match('/(\d+\.?\d*) ([kMGT])B/', $b, $match)) {
59+
$b = $match[1] * $suffixes[$match[2]];
60+
}
61+
5262
if(is_string($a)) $a = strtolower($a);
5363
if(is_string($b)) $b = strtolower($b);
5464
if($a < $b) return $sDir == 'DESC' ? 1 : -1;
@@ -129,7 +139,7 @@ public function onLoad()
129139

130140
// Getting Datasets from DB
131141
$records = $app->db->queryAllRecords($this->getQueryString($php_sort));
132-
142+
133143
$csrf_token = $app->auth->csrf_token_get($app->listform->listDef['name']);
134144
$_csrf_id = $csrf_token['csrf_id'];
135145
$_csrf_key = $csrf_token['csrf_key'];

interface/web/sites/database_quota_stats.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
} else {
3838
$temp['username'] = 'admin';
3939
}
40-
40+
4141
if(is_array($temp) && !empty($temp)) {
4242
$monitor_data[$server_id.'.'.$db_name]['database_name'] = $data['database_name'];
4343
$monitor_data[$server_id.'.'.$db_name]['client'] = isset($temp['username']) ? $temp['username'] : '';
@@ -61,7 +61,7 @@ function prepareDataRow($rec) {
6161
$rec['bgcolor'] = $this->DataRowColor;
6262

6363
$database_name = $rec['database_name'];
64-
64+
6565
if(!empty($monitor_data[$rec['server_id'].'.'.$database_name])){
6666
$rec['database'] = $monitor_data[$rec['server_id'].'.'.$database_name]['database_name'];
6767
$rec['client'] = $monitor_data[$rec['server_id'].'.'.$database_name]['client'];
@@ -71,7 +71,7 @@ function prepareDataRow($rec) {
7171
$rec['used'] = $monitor_data[$rec['server_id'].'.'.$database_name]['used'];
7272
$rec['quota'] = $monitor_data[$rec['server_id'].'.'.$database_name]['quota'];
7373

74-
if($rec['quota'] == 0){
74+
if($rec['quota'] <= 0){
7575
$rec['quota'] = $app->lng('unlimited_txt');
7676
$rec['percentage'] = '';
7777
} else {

0 commit comments

Comments
 (0)