geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r345760 - in /geronimo/trunk: applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/ applications/console-standard/src/webapp/WEB-INF/view/dbwizard/ applications/console-standard/src/webapp/WEB-INF/view/re...
Date Sun, 20 Nov 2005 16:13:58 GMT
Author: ammulder
Date: Sun Nov 20 08:13:48 2005
New Revision: 345760

URL: http://svn.apache.org/viewcvs?rev=345760&view=rev
Log:
Enable editing for security realms (GERONIMO-1209)
Tweak the text a bit
Make sure that fields are submitted even if not editable

Modified:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java?rev=345760&r1=345759&r2=345760&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
Sun Nov 20 08:13:48 2005
@@ -405,6 +405,7 @@
     }
 
     private void actionSaveRealm(PortletRequest request, RealmData data) {
+        normalize(data);
         if(data.objectName == null || data.objectName.equals("")) { // we're creating a new
realm
             try {
                 XmlObject plan = actionGeneratePlan(request, data);
@@ -432,8 +433,29 @@
                 log.error("Unable to save security realm", e);
             }
         } else {
-            //todo: handle editing an existing realm
-            log.error("Saving existing realms is not yet implemented", new UnsupportedOperationException());
+            SecurityRealm realm = (SecurityRealm) PortletManager.getManagedBean(request,
data.getObjectName());
+            // index existing modules
+            Map nodes = new HashMap();
+            JaasLoginModuleChain node = (JaasLoginModuleChain) PortletManager.getManagedBean(request,
realm.getLoginModuleChainName());
+            while(node != null) {
+                LoginModuleSettings module = (LoginModuleSettings) PortletManager.getManagedBean(request,
node.getLoginModuleName());
+                nodes.put(module.getLoginDomainName(), node);
+                final String next = node.getNextName();
+                if(next == null) {
+                    break;
+                }
+                node = (JaasLoginModuleChain) PortletManager.getManagedBean(request, next);
+            }
+            // apply settings
+            for (int i = 0; i < data.getModules().length; i++) {
+                LoginModuleDetails details = data.getModules()[i];
+                node = (JaasLoginModuleChain) nodes.get(details.getLoginDomainName());
+                node.setControlFlag(details.getControlFlag());
+                LoginModuleSettings module = (LoginModuleSettings) PortletManager.getManagedBean(request,
node.getLoginModuleName());
+                module.setOptions(details.getOptions());
+                module.setServerSide(details.isServerSide());
+                module.setLoginModuleClass(details.getClassName());
+            }
         }
     }
 

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp?rev=345760&r1=345759&r2=345760&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp
(original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/edit.jsp
Sun Nov 20 08:13:48 2005
@@ -32,6 +32,7 @@
           <input name="name" type="text" size="30" value="${pool.name}">
         </c:when>
         <c:otherwise>
+          <input name="name" type="hidden" value="${pool.name}" />
           <b><c:out value="${pool.name}" /></b>
         </c:otherwise>
       </c:choose>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp?rev=345760&r1=345759&r2=345760&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp
(original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/edit.jsp
Sun Nov 20 08:13:48 2005
@@ -26,11 +26,12 @@
       <tr>
         <th><div align="right">Realm Name:</div></th>
         <td>
-      <c:choose> <%-- Can't change the pool name after deployment because it's wired
into all the ObjectNames --%>
+      <c:choose> <%-- Can't change the realm name after deployment because it's
wired into all the ObjectNames --%>
         <c:when test="${empty realm.objectName}">
           <input name="name" type="text" size="30" value="${realm.name}">
         </c:when>
         <c:otherwise>
+          <input name="name" type="hidden" value="${realm.name}" />
           <b><c:out value="${realm.name}" /></b>
         </c:otherwise>
       </c:choose>
@@ -38,7 +39,8 @@
       </tr>
       <tr>
         <td></td>
-        <td>A name that is different than the name for any other security realms in
the server (no spaces in the name please).</td>
+        <td>A name that is different than the name for any other security realms in
the server (no spaces in the name please).
+          Other components will use this name to refer to the security realm.</td>
       </tr>
     <!-- HEADER -->
     <c:forEach var="module" items="${realm.modules}" varStatus="status" >
@@ -47,11 +49,25 @@
       </tr>
       <tr>
         <th><div align="right">Login Domain Name:</div></th>
-        <td><input name="module-domain-${status.index}" type="text" size="20" value="${module.loginDomainName}"
/></td>
+        <td>
+      <c:choose> <%-- Can't change the login domain name after deployment because
it's how we know which GBean is which --%>
+        <c:when test="${empty realm.objectName}">
+          <input name="module-domain-${status.index}" type="text" size="20" value="${module.loginDomainName}"
/>
+        </c:when>
+        <c:otherwise>
+          <input name="module-domain-${status.index}" type="hidden" value="${module.loginDomainName}"
/>
+          <b><c:out value="${module.loginDomainName}" /></b>
+        </c:otherwise>
+      </c:choose>
+        </td>
+
+        <td></td>
       </tr>
       <tr>
         <td></td>
-        <td>The login domain for this login module, which must be unique among all
modules in the security realm.</td>
+        <td>The login domain for this login module, which must be unique among all
modules in the security realm.
+          This can be used to distinguish principals from two otherwise identical login modules
(for example,
+          from two LDAP login modules pointing to two different LDAP servers)</td>
       </tr>
       <tr>
         <th><div align="right">Login Module Class:</div></th>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp?rev=345760&r1=345759&r2=345760&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp
(original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/realmwizard/selectType.jsp
Sun Nov 20 08:13:48 2005
@@ -50,7 +50,8 @@
       </tr>
       <tr>
         <td></td>
-        <td>A name that is different than the name for any other security realms in
the server (no spaces in the name please).</td>
+        <td>A name that is different than the name for any other security realms in
the server (no spaces in the name please).
+          Other components will use this name to refer to the security realm.</td>
       </tr>
     <!-- ENTRY FIELD: REALM TYPE -->
       <tr>

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java?rev=345760&r1=345759&r2=345760&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java
(original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java
Sun Nov 20 08:13:48 2005
@@ -40,7 +40,13 @@
     /**
      * The String form of the control flag for the login module at this
      * position in the chain.
-     */ 
+     */
     public String getControlFlag();
+
+    /**
+     * The String form of the control flag for the login module at this
+     * position in the chain.
+     */
+    public void setControlFlag(String controlFlag);
 
 }



Mime
View raw message