Commit 512f11d0 authored by tbrehm's avatar tbrehm
Browse files

- Fixed: FS#2292 - monitor_tools.inc.php uses /var/vmail and not the mail...

- Fixed: FS#2292 - monitor_tools.inc.php uses /var/vmail and not the mail directory specified in server config
- Changed code comment in login/index.php file.
parent 1a94982d
......@@ -111,7 +111,7 @@ class login_index {
//* Check if there are already wrong logins
$sql = "SELECT * FROM `attempts_login` WHERE `ip`= '{$ip}' AND `login_time` > (NOW() - INTERVAL 1 MINUTE) LIMIT 1";
$alreadyfailed = $app->db->queryOneRecord($sql);
//* login to much wrong
//* too many failedlogins
if($alreadyfailed['times'] > 5) {
$error = $app->lng('error_user_too_many_logins');
} else {
......
......@@ -238,18 +238,18 @@ class monitor_tools {
//* The state of the email_quota.
$state = 'ok';
$mailboxes = $app->db->queryAllRecords("SELECT email FROM mail_user WHERE server_id = $server_id");
$mailboxes = $app->db->queryAllRecords("SELECT email,maildir FROM mail_user WHERE server_id = $server_id");
if(is_array($mailboxes)) {
foreach($mailboxes as $mb) {
$email = $mb['email'];
$email_parts = explode('@',$mb['email']);
$filename = '/var/vmail/'.$email_parts[1].'/'.$email_parts[0].'/.quotausage';
if(file_exists($filename)) {
$filename = $mb['maildir'].'/.quotausage';
if(file_exists($filename) && !is_link($filename)) {
$quotafile = file($filename);
$data[$email]['used'] = trim($quotafile['1']);
unset($quotafile);
} else {
exec('du -s '.escapeshellcmd('/var/vmail/'.$email_parts[1].'/'.$email_parts[0]),$out);
exec('du -s '.escapeshellcmd($mb['maildir']),$out);
$parts = explode(' ',$out[0]);
$data[$email]['used'] = intval($parts[0])*1024;
unset($out);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment