tbrehm
2012-08-10 512f11d01b3a1c3b94e030091f047596f05639b2
- 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.
2 files modified
10 ■■■■ changed files
interface/web/login/index.php 2 ●●● patch | view | raw | blame | history
server/lib/classes/monitor_tools.inc.php 8 ●●●● patch | view | raw | blame | history
interface/web/login/index.php
@@ -111,7 +111,7 @@
                //* 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 {
server/lib/classes/monitor_tools.inc.php
@@ -238,18 +238,18 @@
        //* 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);