[PATCH V2 nm-openconnect 3/3] auth-dialog: Add support for OC_FORM_OPT_IGNORE
Kevin Cernekee
cernekee at gmail.com
Mon Dec 30 20:49:37 EST 2013
Hide any options that libopenconnect doesn't want us to display.
---
auth-dialog/main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index f4c772b..3f9b77e 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -76,11 +76,13 @@
#define AUTHGROUP_FIELD(form) (form)->authgroup_field
#define AUTHGROUP_SELECTION(form) (form)->authgroup_selection
#define FORMCHOICE(sopt, i) ((sopt)->choices[i])
+#define IGNORE_OPT(opt) ((opt)->flags & OC_FORM_OPT_IGNORE)
#else
#define NEWGROUP_SUPPORTED 0
#define AUTHGROUP_FIELD(form) NULL
#define AUTHGROUP_SELECTION(form) 0
#define FORMCHOICE(sopt, i) (&(sopt)->choices[i])
+#define IGNORE_OPT(opt) 0
#define OC_FORM_RESULT_ERR -1
#define OC_FORM_RESULT_OK 0
#define OC_FORM_RESULT_CANCELLED 1
@@ -687,7 +689,8 @@ static gboolean ui_form (struct oc_auth_form *form)
for (opt = form->opts; opt; opt = opt->next) {
ui_fragment_data *data;
- if (opt->type == OC_FORM_OPT_HIDDEN)
+ if (opt->type == OC_FORM_OPT_HIDDEN ||
+ IGNORE_OPT(opt))
continue;
data = g_slice_new0 (ui_fragment_data);
--
1.8.3.2
More information about the openconnect-devel
mailing list