Add display of quotas

This commit is contained in:
John Supplee 2019-01-28 16:19:36 +02:00
parent d443135155
commit 3cd14bd4b8
2 changed files with 7 additions and 2 deletions

View File

@ -128,13 +128,14 @@ def get_mail_users_ex(env, with_archived=False):
users = [] users = []
active_accounts = set() active_accounts = set()
c = open_database(env) c = open_database(env)
c.execute('SELECT email, privileges FROM users') c.execute('SELECT email, privileges, quota FROM users')
for email, privileges in c.fetchall(): for email, privileges in c.fetchall():
active_accounts.add(email) active_accounts.add(email)
user = { user = {
"email": email, "email": email,
"privileges": parse_privs(privileges), "privileges": parse_privs(privileges),
"user": quota,
"status": "active", "status": "active",
} }
users.append(user) users.append(user)

View File

@ -42,6 +42,7 @@
<thead> <thead>
<tr> <tr>
<th width="50%">Email Address</th> <th width="50%">Email Address</th>
<th>Quota</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
@ -53,6 +54,8 @@
<table> <table>
<tr id="user-template"> <tr id="user-template">
<td class='address'> <td class='address'>
</td>
<td class="quota">
</td> </td>
<td class='actions'> <td class='actions'>
<span class='privs'> <span class='privs'>
@ -152,7 +155,8 @@ function show_users() {
n2.addClass("account_" + user.status); n2.addClass("account_" + user.status);
n.attr('data-email', user.email); n.attr('data-email', user.email);
n.find('.address').text(user.email) n.find('.address').text(user.email);
n.find('.quota').text(user.quota);
n2.find('.restore_info tt').text(user.mailbox); n2.find('.restore_info tt').text(user.mailbox);
if (user.status == 'inactive') continue; if (user.status == 'inactive') continue;