Commits

Zhang Huangbin  committed 10c7656

Fix quota display.

  • Participants
  • Parent commits c2e114d

Comments (0)

Files changed (3)

File controllers/ldap/user.py

         mails = i.get('mail', [])
         for mail in mails:
             dn = ldap.filter.escape_filter_chars(ldaputils.convEmailToUserDN(mail))
-        print >> sys.stderr, i 
         web.seeother('/users/' + web.safestr(domain))

File libs/ldaplib/user.py

                 pass
             else:
                 mod_attrs = [ ( ldap.MOD_REPLACE, 'mailQuota', str(int(mailQuota) * 1024 * 1024) ) ]
-            print >> sys.stderr, 'mailQuota: -%s-' % mailQuota, type(mailQuota)
 
             # Get accountStatus.
             accountStatus = web.safestr(data.get('accountStatus', 'active'))

File templates/default/ldap/users.html

 
 {% extends "layout.html" %}
 
-{% from "macros.html" import set_account_status_img %}
+{% from "macros.html" import set_account_status_img, display_quota, %}
 
 {% block title %}{{ _('Mail users') }}{% endblock %}
 
                     <td><a href="mailto:{{mail}}" title="{{ _('Send mail to %s.') |format(mail) }}">{{ mail }}</a></td>
 
                 {# mail quota #}
-                <td>{{ entries.get('mailQuota', [0])[0] |filesizeformat }}</td>
+                <td>{% if entries.get('mailQuota', ['0'])[0] == '0' %}{{ _('Unlimited') }}{% else %}{{ entries.get('mailQuota', ['0'])[0] |filesizeformat }} {% endif %}</td>
 
                 <td>{{createTimestamp[:4]}}-{{createTimestamp[4:6]}}-{{createTimestamp[6:8]}} {{createTimestamp[8:10]}}:{{createTimestamp[10:12]}}:{{createTimestamp[12:14]}}</td>
             </tr>