Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
smartpublicbuilding
openhab-pb-stack
Commits
b3f6a8d8
Commit
b3f6a8d8
authored
Feb 13, 2019
by
Dobli
Browse files
prepared to modify users
parent
914d9ee2
Changes
1
Hide whitespace changes
Inline
Side-by-side
building_manager.py
View file @
b3f6a8d8
...
...
@@ -1112,11 +1112,12 @@ def user_menu(args):
# Ask for action
choice
=
qust
.
select
(
"What do you want to do?"
,
choices
=
[
'Add a new user'
,
'
Remove
existing user'
],
'Add a new user'
,
'
Modify
existing user'
],
style
=
st
).
ask
()
if
"Add"
in
choice
:
new_user_menu
(
base_dir
)
print
(
choice
)
elif
"Modify"
in
choice
:
modify_user_menu
(
base_dir
)
def
new_user_menu
(
base_dir
):
...
...
@@ -1148,6 +1149,17 @@ def new_user_menu(base_dir):
add_user_to_traefik_file
(
base_dir
,
username
,
password
)
def
modify_user_menu
(
base_dir
):
"""Menu entry to remove users or delete passwords
:base_dir: Directory of config files
"""
current_users
=
get_users_from_files
(
base_dir
)
qust
.
select
(
"Choose user to modify:"
,
choices
=
current_users
,
style
=
st
).
ask
()
pass
# *** Menu Helper Functions ***
def
generate_cb_choices
(
list
,
checked
=
False
):
"""Generates checkbox entries for lists of strings
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment