mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Keep aliases for the first user
This commit is contained in:
parent
6fbb153272
commit
b3ccc9273a
1 changed files with 4 additions and 0 deletions
|
@ -192,6 +192,10 @@ def user_create(operation_logger, username, firstname, lastname, mail, password,
|
|||
'loginShell': '/bin/false'
|
||||
}
|
||||
|
||||
# If it is the first user, add some aliases
|
||||
if not ldap.search(base='ou=users,dc=yunohost,dc=org', filter='uid=*'):
|
||||
attr_dict['mail'] = [attr_dict['mail']] + aliases
|
||||
|
||||
try:
|
||||
ldap.add('uid=%s,ou=users' % username, attr_dict)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Reference in a new issue