From badc24cb984b68270edcdf0a37a0df0b3c7a4123 Mon Sep 17 00:00:00 2001 From: Kload Date: Mon, 23 Sep 2013 08:33:15 +0000 Subject: [PATCH] Remove root and nobody users and remove mail forward from user list --- yunohost_user.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/yunohost_user.py b/yunohost_user.py index 3005caf8..d07af3ae 100644 --- a/yunohost_user.py +++ b/yunohost_user.py @@ -69,16 +69,14 @@ def user_list(fields=None, filter=None, limit=None, offset=None): i = 0 + offset for user in result[i:]: if i - offset < limit: + if user['uid'][0] == 'root' or user['uid'][0] == 'nobody': + continue entry = { 'Username': user['uid'][0], 'Fullname': user['cn'][0], } if 'mail' in user.keys(): 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) i += 1