tbrehm
2010-06-30 446416560bbb68f2010b19748ff1a3388aa4a06c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
 
/******************************************
* Begin Form configuration
******************************************/
 
$list_def_file = "list/user_quota_stats.list.php";
 
/******************************************
* End Form configuration
******************************************/
 
//* Check permissions for module
$app->auth->check_module_permissions('sites');
 
$app->load('listform_actions');
 
$tmp_rec = $app->db->queryOneRecord("SELECT data from monitor_data WHERE type = 'harddisk_quota' ORDER BY created DESC");
$monitor_data = unserialize($app->db->unquote($tmp_rec['data']));
 
class list_action extends listform_actions {
    
    function prepareDataRow($rec)
    {
        global $app,$monitor_data;
        
        $rec = $app->listform->decode($rec);
 
        //* Alternating datarow colors
        $this->DataRowColor = ($this->DataRowColor == '#FFFFFF') ? '#EEEEEE' : '#FFFFFF';
        $rec['bgcolor'] = $this->DataRowColor;
        $username = $rec['system_user'];
        
        $rec['used'] = $monitor_data['user'][$username]['used'];
        $rec['soft'] = $monitor_data['user'][$username]['soft'];
        $rec['hard'] = $monitor_data['user'][$username]['hard'];
        
        if($rec['soft'] == '0K') $rec['soft'] = $app->lng('unlimited');
        if($rec['hard'] == '0K') $rec['hard'] = $app->lng('unlimited');
        
        //* The variable "id" contains always the index variable
        $rec['id'] = $rec[$this->idx_key];
        return $rec;
    }
}
 
$list = new list_action;
$list->SQLExtWhere = "type = 'vhost'";
 
$list->onLoad();
 
 
?>