mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
checking that we are in the cli interface
This commit is contained in:
parent
c2a730f26c
commit
4c25f442c1
1 changed files with 5 additions and 1 deletions
|
@ -325,8 +325,12 @@ def user_update(operation_logger, username, firstname=None, lastname=None, mail=
|
||||||
if lastname and firstname:
|
if lastname and firstname:
|
||||||
new_attr_dict['cn'] = new_attr_dict['displayName'] = [firstname + ' ' + lastname]
|
new_attr_dict['cn'] = new_attr_dict['displayName'] = [firstname + ' ' + lastname]
|
||||||
|
|
||||||
|
# change_password is None if user_update is not called to change the password
|
||||||
if change_password is not None:
|
if change_password is not None:
|
||||||
if not change_password:
|
# when in the cli interface if the option to change the password is called
|
||||||
|
# without a specified value, change_password will be set to the const 0.
|
||||||
|
# In this case we prompt for the new password.
|
||||||
|
if msettings.get('interface') == 'cli' and not change_password:
|
||||||
change_password = msignals.prompt(m18n.n("ask_password"), True, True)
|
change_password = msignals.prompt(m18n.n("ask_password"), True, True)
|
||||||
# Ensure sufficiently complex password
|
# Ensure sufficiently complex password
|
||||||
assert_password_is_strong_enough("user", change_password)
|
assert_password_is_strong_enough("user", change_password)
|
||||||
|
|
Loading…
Add table
Reference in a new issue