From b3f6a8d8559dd2f4e90b5b3720ec7f98cbce99ce Mon Sep 17 00:00:00 2001 From: Dobli <61doal1mst@hft-stuttgart.de> Date: Wed, 13 Feb 2019 16:18:14 +0100 Subject: [PATCH] prepared to modify users --- building_manager.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/building_manager.py b/building_manager.py index 40d318d..b677e74 100755 --- a/building_manager.py +++ b/building_manager.py @@ -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 -- GitLab