Commit f90a56dc authored by David Woodhouse's avatar David Woodhouse

Merge branch 'fix_authgroup_dropdown_handling' of gitlab.com:dlenski/openconnect

parents 9c8778b1 72243129
......@@ -401,6 +401,8 @@ gateways:
choice->label, choice->name);
}
}
if (!vpninfo->authgroup && opt->nr_choices)
vpninfo->authgroup = strdup(opt->choices[0]->name);
if (vpninfo->write_new_config) {
buf_append(buf, " </ServerList>\n</GPPortal>\n");
......@@ -412,7 +414,7 @@ gateways:
/* process auth form to select gateway */
result = process_auth_form(vpninfo, form);
if (result != OC_FORM_RESULT_NEWGROUP)
if (result == OC_FORM_RESULT_CANCELLED || result < 0)
goto out;
/* redirect to the gateway (no-op if it's the same host) */
......
......@@ -1107,9 +1107,9 @@ int process_auth_form(struct openconnect_info *vpninfo, struct oc_auth_form *for
retry:
auth_choice = NULL;
if (grp && grp->nr_choices && !vpninfo->xmlpost) {
if (grp && grp->nr_choices) {
/* Set group selection from authgroup */
if (vpninfo->authgroup) {
/* For non-XML-POST, the server doesn't tell us which group is selected */
int i;
for (i = 0; i < grp->nr_choices; i++)
if (!strcmp(grp->choices[i]->name, vpninfo->authgroup))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment