Skip to content

Commit

Permalink
AuthFormHandler: Fix another setAuthgroup() corner case
Browse files Browse the repository at this point in the history
Make sure that autogroupOpt.value always gets populated if we have
a saved authgroup.  If we don't have a saved authgroup but the gateway
offers an authgroup dropdown, don't try to log on using batch mode.

Signed-off-by: Kevin Cernekee <[email protected]>
  • Loading branch information
cernekee committed Jun 1, 2014
1 parent 3c8c529 commit b30cdee
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/app/openconnect/AuthFormHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,18 @@ private void saveAndStore() {

// If the user had saved a preferred authgroup, submit a NEWGROUP request before rendering the form
public boolean setAuthgroup() {
String authgroup = getStringPref("authgroup");

if (mAuthgroupSet || authgroup.equals("")) {
LibOpenConnect.FormOpt opt = mForm.authgroupOpt;
if (opt == null) {
return false;
}

LibOpenConnect.FormOpt opt = mForm.authgroupOpt;
if (opt == null) {
String authgroup = getStringPref("authgroup");
if (authgroup.equals("")) {
return false;
}

LibOpenConnect.FormChoice selected = opt.choices.get(mForm.authgroupSelection);
if (authgroup.equals(selected.name)) {
if (mAuthgroupSet || authgroup.equals(selected.name)) {
// already good to go
opt.value = authgroup;
return false;
Expand Down Expand Up @@ -369,6 +369,12 @@ public Object earlyReturn() {
return null;
}
opt.value = defval;
break;
case LibOpenConnect.OC_FORM_OPT_SELECT:
if (opt.value == null) {
return null;
}
break;
}
}
return LibOpenConnect.OC_FORM_RESULT_OK;
Expand Down

0 comments on commit b30cdee

Please sign in to comment.