mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-16 02:46:44 +02:00
API and cmdline
This commit is contained in:
parent
dec339800f
commit
7b13ceb693
@ -63,6 +63,7 @@ user_fields_put = api.model('UserUpdate', {
|
||||
'quota_bytes': fields.Integer(description='The maximum quota for the user’s email box in bytes', example='1000000000'),
|
||||
'global_admin': fields.Boolean(description='Make the user a global administrator'),
|
||||
'enabled': fields.Boolean(description='Enable the user. When an user is disabled, the user is unable to login to the Admin GUI or webmail or access his email via IMAP/POP3 or send mail'),
|
||||
'change_pw_next_login': fields.Boolean(description='Force the user to change their password at next login'),
|
||||
'enable_imap': fields.Boolean(description='Allow email retrieval via IMAP'),
|
||||
'enable_pop': fields.Boolean(description='Allow email retrieval via POP3'),
|
||||
'allow_spoofing': fields.Boolean(description='Allow the user to spoof the sender (send email as anyone)'),
|
||||
@ -119,6 +120,8 @@ class Users(Resource):
|
||||
user_new.global_admin = data['global_admin']
|
||||
if 'enabled' in data:
|
||||
user_new.enabled = data['enabled']
|
||||
if 'change_pw_next_login' in data:
|
||||
user_new.change_pw_next_login = data['change_pw_next_login']
|
||||
if 'enable_imap' in data:
|
||||
user_new.enable_imap = data['enable_imap']
|
||||
if 'enable_pop' in data:
|
||||
|
@ -103,7 +103,8 @@ def user(localpart, domain_name, password):
|
||||
user = models.User(
|
||||
localpart=localpart,
|
||||
domain=domain,
|
||||
global_admin=False
|
||||
global_admin=False,
|
||||
change_pw_next_login=True,
|
||||
)
|
||||
user.set_password(password)
|
||||
db.session.add(user)
|
||||
|
Loading…
Reference in New Issue
Block a user