Changeset 217

Show
Ignore:
Timestamp:
10/15/07 02:07:58 (15 months ago)
Author:
jonas
Message:

display mailbox size

Location:
trunk
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r215 r217  
     1CpVES 0.11 YYYY-MM-DD - Jonas Genannt - <jonas.genannt@brachium-system.net> 
     2        o Removed: fetchmail check from create_mailbox_size.pl (wrong) 
     3        o Fixed: recipient classes VIEW 
     4        o Improved: display mailbox size with units 
    15CpVES 0.10 2007-10-11 - Jonas Genannt - <jonas.genannt@brachium-system.net> 
    26        o Improved: sa_learn.pl no longer debug output 
  • trunk/includes/func.inc.php

    r205 r217  
    6767} 
    6868 
     69function mailbox_size_human($size) { 
     70        if ($size > 1024) { 
     71                $mb_size['size']=sprintf("%01.2f",$size/1024); 
     72                $mb_size['unit']="gb"; 
     73                 
     74        } 
     75        else { 
     76                $mb_size['size']=$size; 
     77                $mb_size['unit']="mb"; 
     78        } 
     79        return $mb_size; 
     80} 
     81 
    6982function insert_mailarchive($uid,$options) { 
    7083        global $db; 
  • trunk/includes/sites/domain_view.php

    r205 r217  
    229229        'email' =>$data['email'], 
    230230        'access' =>$data['access'], 
    231         'mb_size' =>$data['mb_size'], 
     231        'mb_size' => mailbox_size_human($data['mb_size']), 
    232232        'autoresponder' => $autoresponder) ); 
    233233} //ENDE WHILE eMails 
  • trunk/includes/sites/main.php

    r211 r217  
    7777                $db->escapeSimple($row['id'])); 
    7878        $res_mb_size=&$db->query($sql); 
    79         $data_mb_size=$res_mb_size->fetchrow(DB_FETCHMODE_ASSOC); 
     79        $mb_size=$res_mb_size->fetchrow(DB_FETCHMODE_ASSOC); 
     80        $mb_size=mailbox_size_human($mb_size['sum']); 
    8081        if( empty($data_mb_size['sum']) ) $data_mb_size['sum'] = 0; 
    8182        array_push($table_data, array( 
     
    8990         'vacation' => $vaction, 
    9091         'vacation_infos' => $vaction_infos, 
    91          'mb_size'        => $data_mb_size['sum'] 
     92         'mb_size'        => $mb_size 
    9293         ) 
    9394      ); 
  • trunk/sql_upgrades

    r206 r217  
    173173ALTER TABLE `domains` ADD `p_spam_fwd` TINYINT( 1 ) NOT NULL DEFAULT '0'; 
    174174ALTER TABLE `users` ADD `p_spam_fwd` TINYINT( 1 ) NOT NULL DEFAULT '0'; 
    175 ALTER TABLE `adm_users` CHANGE `web_lang` `web_lang` VARCHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL  
     175ALTER TABLE `adm_users` CHANGE `web_lang` `web_lang` VARCHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL 
     176 
     177Version 0.10 to 0.11 
     178DROP VIEW IF EXISTS smtpd_recipient_classes; 
     179CREATE VIEW smtpd_recipient_classes AS  SELECT email,if(p_check_polw=1,'check_polw','') AS polw,if(p_check_grey=1,'check_grey','') AS grey FROM users WHERE access=1 AND p_check_polw!=0 AND p_check_polw!=0 UNION SELECT efrom,if(p_check_polw=1,'check_polw','') AS polw,if(p_check_grey=1,'check_grey','') AS grey FROM forwardings WHERE access=1 AND p_check_polw!=0 AND p_check_polw!=0 AND efrom NOT REGEXP '^@'; 
     180  
  • trunk/system_scripts/create_mailbox_size.pl

    r171 r217  
    11#!/usr/bin/perl  
    2 #create_fetchmail.pl 
     2#create_mailbox_size.pl 
    33#Copyright (C) 2007 Jonas Genannt <jonas.genannt@brachium-system.net> 
    44# 
     
    3737die ("Error: " .$config{'vmail_home'} . " does not exists!\n" ) 
    3838        unless ( -d $config{'vmail_home'}); 
    39 die ("Error: " .$config{'fetchmail'} . " does not exists!\n" ) 
    40         unless ( -x $config{'fetchmail'}); 
    4139die "Already running!" if Proc::PID::File->running('dir' => '/tmp/' ); 
    4240die ("Error: Please run $0 as mailbox owner!") unless ($user eq $config{'vmail_user'});   
  • trunk/templates/domain_view.tpl

    r205 r217  
    2828{if $display_mb_size == 1} 
    2929<td style="width:250px;"> </td> 
    30 <td style="text-align:left;width:50px;">{$row.mb_size} M</td> 
     30<td style="text-align:left;width:50px;">{$row.mb_size.size} {if $row.mb_size.unit == 'gb'}GB{else}MB{/if}</td> 
    3131{else} 
    3232 <td style="width:300px;"> </td> 
  • trunk/templates/index_admin.tpl

    r205 r217  
    1515        <td style="text-align:right;">{$table_data[row].count_forward}</td> 
    1616        {if $config.display_mb_size == 1 } 
    17         <td>{$row.mb_size} MB</td> 
     17        <td>{$row.mb_size.size} {if $row.mb_size.unit == 'gb'}GB{else}MB{/if}</td> 
    1818        {/if} 
    1919</tr> 
  • trunk/templates/index_sadmin.tpl

    r205 r217  
    2525                <td>{$row.count_forward}</td> 
    2626                {if $config.display_mb_size == 1 } 
    27                 <td>{$row.mb_size} MB</td> 
     27                <td>{$row.mb_size.size} {if $row.mb_size.unit == 'gb'}GB{else}MB{/if}</td> 
    2828                {/if} 
    2929                <td>