@@ -59,6 +59,7 @@ public function onRunJob() {
5959
6060 //* Initialize data array
6161 $ data = array ();
62+ $ df = array ();
6263
6364 //* the id of the server as int
6465 $ server_id = intval ($ conf ['server_id ' ]);
@@ -72,19 +73,21 @@ public function onRunJob() {
7273 if (!$ app ->system ->is_installed ('setquota ' )) {
7374 //* No Quota on this System ...
7475
75- //** Fetch the data for all users
76- $ dfData = shell_exec ('du -s /var/www/clients/client*/web[0-9]* ' );
77-
78- //* split into array
79- $ df = explode ("\n" , $ dfData );
80-
8176 //* Get Limits for Calculation
8277 $ records = $ app ->db ->queryAllRecords ('SELECT hd_quota, system_user, system_group FROM `web_domain` WHERE `server_id` = ? ' , $ conf ['server_id ' ]);
8378 foreach ($ records as $ record ) {
8479 $ options ['group ' ][$ record ['system_group ' ]] = $ record ['hd_quota ' ]*1024 ;
8580 $ options ['user ' ][$ record ['system_user ' ]] = $ record ['hd_quota ' ]*1024 ;
8681 }
8782
83+ if (!empty ($ records )) {
84+ //** Fetch the data for all users
85+ $ dfData = shell_exec ('du -s /var/www/clients/client*/web[0-9]* ' );
86+
87+ //* split into array
88+ $ df = explode ("\n" , $ dfData );
89+ }
90+
8891 //* Loop over all the output lines, for groups.
8992 for ($ i = 0 ; $ i <= sizeof ($ df ); $ i ++) {
9093 if (isset ($ df [$ i ]) && $ df [$ i ] != '' ) {
0 commit comments