]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/output/GroupSelector.java
add: add boolean to separate groups for user and support
[gigi.git] / src / org / cacert / gigi / output / GroupSelector.java
index a26be9b8bbae20174ac3165d62b4da5f3e64a841..f65fab750f4f14ae8260e43fedd8b23d4c379be9 100644 (file)
@@ -13,12 +13,15 @@ import org.cacert.gigi.util.HTMLEncoder;
 
 public class GroupSelector implements Outputable {
 
-    String name;
+    private final String name;
 
-    Group value = null;
+    private Group value = null;
 
-    public GroupSelector(String name) {
+    private final boolean supportFlag;
+
+    public GroupSelector(String name, boolean supportFlag) {
         this.name = HTMLEncoder.encodeHTML(name);
+        this.supportFlag = supportFlag;
     }
 
     public void update(HttpServletRequest r) throws GigiApiException {
@@ -35,11 +38,13 @@ public class GroupSelector implements Outputable {
     public void output(PrintWriter out, Language l, Map<String, Object> vars) {
         out.println("<select name='" + name + "'>");
         for (Group g : Group.values()) {
-            out.print("<option name='" + g.getDatabaseName());
-            if (g.equals(value)) {
-                out.print(" selected");
+            if (supportFlag == g.isManagedBySupport()) {
+                out.print("<option name='" + g.getDatabaseName());
+                if (g.equals(value)) {
+                    out.print(" selected");
+                }
+                out.println("'>" + g.getDatabaseName() + "</option>");
             }
-            out.println("'>" + g.getDatabaseName() + "</option>");
         }
         out.println("</select>");
     }