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
6 years ago
by
Dobli
Browse files
Options
Download
Email Patches
Plain Diff
prepared to modify users
parent
914d9ee2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
building_manager.py
+14
-2
building_manager.py
with
14 additions
and
2 deletions
+14
-2
building_manager.py
+
14
-
2
View file @
b3f6a8d8
...
@@ -1112,11 +1112,12 @@ def user_menu(args):
...
@@ -1112,11 +1112,12 @@ def user_menu(args):
# Ask for action
# Ask for action
choice
=
qust
.
select
(
"What do you want to do?"
,
choices
=
[
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
()
style
=
st
).
ask
()
if
"Add"
in
choice
:
if
"Add"
in
choice
:
new_user_menu
(
base_dir
)
new_user_menu
(
base_dir
)
print
(
choice
)
elif
"Modify"
in
choice
:
modify_user_menu
(
base_dir
)
def
new_user_menu
(
base_dir
):
def
new_user_menu
(
base_dir
):
...
@@ -1148,6 +1149,17 @@ 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
)
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 ***
# *** Menu Helper Functions ***
def
generate_cb_choices
(
list
,
checked
=
False
):
def
generate_cb_choices
(
list
,
checked
=
False
):
"""Generates checkbox entries for lists of strings
"""Generates checkbox entries for lists of strings
...
...
This diff is collapsed.
Click to expand it.
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