diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-06-20 10:45:56 +1000 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-12-03 14:48:41 +1100 |
commit | 07f6db7fc29a93fae3213af18371cccb17e0276a (patch) | |
tree | e6306f75ae6cb0e863d9c096d0a7a56140657634 /ui/ncurses/nc-cui.h | |
parent | 9011b958364f2af965a33681e7375f079ba75d02 (diff) | |
download | talos-petitboot-07f6db7fc29a93fae3213af18371cccb17e0276a.tar.gz talos-petitboot-07f6db7fc29a93fae3213af18371cccb17e0276a.zip |
ui/ncurses: Add nc-auth and authenticate when required.
When the user tries to perform actions that require authentication a new
subscreen 'nc-auth' is launched which accepts a password and will send
an authentication request before performing the action.
This also adds a button in nc-config which launches an nc-auth screen
allowing the user to set or change the system password.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'ui/ncurses/nc-cui.h')
-rw-r--r-- | ui/ncurses/nc-cui.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/ncurses/nc-cui.h b/ui/ncurses/nc-cui.h index abe4db9..8fa27aa 100644 --- a/ui/ncurses/nc-cui.h +++ b/ui/ncurses/nc-cui.h @@ -73,6 +73,7 @@ struct cui { struct help_screen *help_screen; struct subset_screen *subset_screen; struct statuslog_screen *statuslog_screen; + struct auth_screen *auth_screen; struct pjs *pjs; void *platform_info; unsigned int default_item; @@ -98,9 +99,13 @@ void cui_show_subset(struct cui *cui, const char *title, void cui_show_add_url(struct cui *cui); void cui_show_plugin(struct pmenu_item *item); void cui_show_plugin_menu(struct cui *cui); +void cui_show_auth(struct cui *cui, WINDOW *parent, bool set_password, + void (*callback)(struct nc_scr *)); int cui_send_config(struct cui *cui, struct config *config); int cui_send_url(struct cui *cui, char *url); int cui_send_plugin_install(struct cui *cui, char *file); +int cui_send_authenticate(struct cui *cui, char *password); +int cui_send_set_password(struct cui *cui, char *password, char *new_password); void cui_send_reinit(struct cui *cui); /* convenience routines */ @@ -112,6 +117,7 @@ void cui_abort_on_exit(struct pmenu *menu); void cui_on_open(struct pmenu *menu); int cui_run_cmd(struct cui *cui, const char **cmd_argv); int cui_run_cmd_from_item(struct pmenu_item *item); +void cui_update_language(struct cui *cui, const char *lang); static inline struct cui *cui_from_arg(void *arg) { |