summaryrefslogtreecommitdiffstats
path: root/base/common/src/org
diff options
context:
space:
mode:
authorJack Magne <jmagne@localhost.localdomain>2016-01-08 10:01:18 -0800
committerJack Magne <jmagne@localhost.localdomain>2016-01-18 13:29:12 -0800
commit18e834450956352fab9dfdef1d10e115df9acbb8 (patch)
tree0c32ae757525630f0d529241b4becda6898ccde2 /base/common/src/org
parente7f4ecd0cf8455c6c6ce57dae48da246a02f76d0 (diff)
downloadpki-18e834450956352fab9dfdef1d10e115df9acbb8.tar.gz
pki-18e834450956352fab9dfdef1d10e115df9acbb8.tar.xz
pki-18e834450956352fab9dfdef1d10e115df9acbb8.zip
Make sure the ESC auth dialog displays the User Id field first.
With the latest TPS the ESC auth dialog has displayed the password field before the UID field. This patch addresses this in the simplest fashion by modifying the class that presents the field data to the client to make sure that UID field is encountered first.
Diffstat (limited to 'base/common/src/org')
-rw-r--r--base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequestMsg.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequestMsg.java b/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequestMsg.java
index d776fe1cd..e90449650 100644
--- a/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequestMsg.java
+++ b/base/common/src/org/dogtagpki/tps/msg/ExtendedLoginRequestMsg.java
@@ -18,8 +18,10 @@
package org.dogtagpki.tps.msg;
import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import org.dogtagpki.tps.main.Util;
@@ -45,30 +47,39 @@ public class ExtendedLoginRequestMsg extends TPSMessage {
@Override
public String encode() {
- if (!params.isEmpty()) {
+ List<String> orderedParams = new ArrayList<String>();
- int i = 0;
+ //The UID param will always be first in the list
+ if (!params.isEmpty()) {
+ String cur = null;
for (Iterator<String> iter = params.iterator(); iter.hasNext();) {
-
- String curParam = null;
-
try {
- curParam = Util.uriEncode(iter.next());
+ cur = Util.uriEncode(iter.next());
} catch (UnsupportedEncodingException e) {
- curParam = null;
+ cur = null;
}
+ if (cur != null && cur.length() > 0) {
+ if (cur.contains("UID")) {
+ orderedParams.add(0, cur);
+ } else {
+ orderedParams.add(cur);
+ }
+ }
+ }
+
+ int i = 0;
+ for (Iterator<String> iter = orderedParams.iterator(); iter.hasNext();) {
+ String curParam = iter.next();
if (curParam != null && curParam.length() > 0) {
- String name = /*"&" + */ REQUIRED_PARAMETER_NAME + Integer.toString(i++);
+ String name = /*"&" + */REQUIRED_PARAMETER_NAME + Integer.toString(i++);
String value = curParam;
put(name, value);
}
-
}
-
}
return super.encode();