mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Remove root and nobody users and remove mail forward from user list
This commit is contained in:
parent
001db13296
commit
badc24cb98
1 changed files with 2 additions and 4 deletions
|
@ -69,16 +69,14 @@ def user_list(fields=None, filter=None, limit=None, offset=None):
|
||||||
i = 0 + offset
|
i = 0 + offset
|
||||||
for user in result[i:]:
|
for user in result[i:]:
|
||||||
if i - offset < limit:
|
if i - offset < limit:
|
||||||
|
if user['uid'][0] == 'root' or user['uid'][0] == 'nobody':
|
||||||
|
continue
|
||||||
entry = {
|
entry = {
|
||||||
'Username': user['uid'][0],
|
'Username': user['uid'][0],
|
||||||
'Fullname': user['cn'][0],
|
'Fullname': user['cn'][0],
|
||||||
}
|
}
|
||||||
if 'mail' in user.keys():
|
if 'mail' in user.keys():
|
||||||
entry['Mail'] = user['mail'][0]
|
entry['Mail'] = user['mail'][0]
|
||||||
if len(user['mail']) > 1:
|
|
||||||
entry['Mail Aliases'] = user['mail'][1:]
|
|
||||||
if 'maildrop' in user:
|
|
||||||
entry['Mail Forward'] = user['maildrop']
|
|
||||||
|
|
||||||
result_list.append(entry)
|
result_list.append(entry)
|
||||||
i += 1
|
i += 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue