continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r480950 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java webapp/WEB-INF/jsp/admin/configuration.jsp webapp/WEB-INF/jsp/admin/configurationEdit.jsp
Date Thu, 30 Nov 2006 14:58:37 GMT
Author: evenisse
Date: Thu Nov 30 06:58:35 2006
New Revision: 480950

URL: http://svn.apache.org/viewvc?view=rev&rev=480950
Log:
Remove guest info, it isn't needed in configuration

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java?view=diff&rev=480950&r1=480949&r2=480950
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
Thu Nov 30 06:58:35 2006
@@ -24,44 +24,30 @@
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.web.action.ContinuumActionSupport;
-import org.codehaus.plexus.security.policy.UserSecurityPolicy;
 import org.codehaus.plexus.security.rbac.Resource;
-import org.codehaus.plexus.security.system.SecuritySystem;
 import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
 import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
 import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
-import org.codehaus.plexus.security.user.User;
-import org.codehaus.plexus.security.user.UserManager;
-import org.codehaus.plexus.security.user.UserNotFoundException;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.io.File;
 import javax.servlet.http.HttpServletRequest;
+import java.io.File;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
- *
- * @plexus.component
- *   role="com.opensymphony.xwork.Action"
- *   role-hint="configuration"
+ * @plexus.component role="com.opensymphony.xwork.Action"
+ * role-hint="configuration"
  */
 public class ConfigurationAction
     extends ContinuumActionSupport
     implements Preparable, SecureAction
 {
-    
-    /**
-     * @plexus.requirement
-     */
-    private ContinuumStore store;
 
     /**
      * @plexus.requirement
      */
-    private SecuritySystem securitySystem;
-
-    private boolean guestAccountEnabled;
+    private ContinuumStore store;
 
     private String workingDirectory;
 
@@ -80,142 +66,68 @@
 
     public void prepare()
     {
-        try{
-
-
-        ConfigurationService configuration = getContinuum().getConfiguration();
-
-        guestAccountEnabled = getGuestAccountLockingStatus();
-
-        workingDirectory = configuration.getWorkingDirectory().getAbsolutePath();
-
-        buildOutputDirectory = configuration.getBuildOutputDirectory().getAbsolutePath();
-
-        baseUrl = configuration.getUrl();
-
-        if ( StringUtils.isEmpty( baseUrl ) )
-        {
-            HttpServletRequest request = ServletActionContext.getRequest();
-            baseUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
-                + request.getContextPath();
-            getLogger().info( "baseUrl='" + baseUrl + "'" );
-        }
-
-        companyLogo = configuration.getCompanyLogo();
-
-        companyName = configuration.getCompanyName();
-
-        companyUrl = configuration.getCompanyUrl();
-        } catch ( Exception e)
-        {
-            e.printStackTrace( );
-        }
-    }
-
-    public String save()
-        throws ConfigurationStoringException, ContinuumStoreException
-    {
-
         try
         {
-        ConfigurationService configuration = getContinuum().getConfiguration();
-
-        configuration.setGuestAccountEnabled( guestAccountEnabled );
 
-        resolveGuestAccountLockingStatus();
+            ConfigurationService configuration = getContinuum().getConfiguration();
 
-        configuration.setWorkingDirectory( new File( workingDirectory ) );
+            workingDirectory = configuration.getWorkingDirectory().getAbsolutePath();
 
-        configuration.setBuildOutputDirectory( new File( buildOutputDirectory ) );
+            buildOutputDirectory = configuration.getBuildOutputDirectory().getAbsolutePath();
 
-        configuration.setDeploymentRepositoryDirectory( new File( deploymentRepositoryDirectory
) );
+            baseUrl = configuration.getUrl();
 
-        configuration.setUrl( baseUrl );
+            if ( StringUtils.isEmpty( baseUrl ) )
+            {
+                HttpServletRequest request = ServletActionContext.getRequest();
+                baseUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+
+                    request.getContextPath();
+                getLogger().info( "baseUrl='" + baseUrl + "'" );
+            }
 
-        configuration.setCompanyLogo( companyLogo );
+            companyLogo = configuration.getCompanyLogo();
 
-        configuration.setCompanyName( companyName );
+            companyName = configuration.getCompanyName();
 
-        configuration.setCompanyUrl( companyUrl );
-
-        configuration.setInitialized( true );
-        configuration.store();
+            companyUrl = configuration.getCompanyUrl();
         }
-        catch (Exception e)
+        catch ( Exception e )
         {
-            e.printStackTrace( );
+            e.printStackTrace();
         }
-        return SUCCESS;
-
     }
 
-
-    private void resolveGuestAccountLockingStatus()
+    public String save()
+        throws ConfigurationStoringException, ContinuumStoreException
     {
 
-        UserManager userManager = securitySystem.getUserManager();
-        UserSecurityPolicy policy = securitySystem.getPolicy();
-
-        User guest;
-
         try
         {
-            guest = userManager.findUser( "guest" );
-            guest.setLocked( guestAccountEnabled );
-            userManager.updateUser( guest );
-        }
-        catch ( UserNotFoundException ne )
-        {
-            policy.setEnabled( false );
+            ConfigurationService configuration = getContinuum().getConfiguration();
 
-            guest = userManager.createUser( "guest", "Guest", "" );
-            guest.setLocked( guestAccountEnabled );
-            guest = userManager.addUser( guest );
+            configuration.setWorkingDirectory( new File( workingDirectory ) );
 
-        }
-        finally
-        {
-            policy.setEnabled( true );
-        }       
-    }
+            configuration.setBuildOutputDirectory( new File( buildOutputDirectory ) );
 
-    private boolean getGuestAccountLockingStatus()
-    {
-        UserManager userManager = securitySystem.getUserManager();
-        UserSecurityPolicy policy = securitySystem.getPolicy();
+            configuration.setDeploymentRepositoryDirectory( new File( deploymentRepositoryDirectory
) );
 
-        User guest;
+            configuration.setUrl( baseUrl );
 
-        try
-        {
-            guest = userManager.findUser( "guest" );
+            configuration.setCompanyLogo( companyLogo );
 
-            return guest.isLocked();
-        }
-        catch ( UserNotFoundException ne )
-        {
-            policy.setEnabled( false );
+            configuration.setCompanyName( companyName );
 
-            guest = userManager.createUser( "guest", "Guest", "" );
-            guest = userManager.addUser( guest );
+            configuration.setCompanyUrl( companyUrl );
 
-            return guest.isLocked();
+            configuration.setInitialized( true );
+            configuration.store();
         }
-        finally
+        catch ( Exception e )
         {
-            policy.setEnabled( true );
+            e.printStackTrace();
         }
-    }
-
-
-    public boolean isGuestAccountEnabled()
-    {
-        return guestAccountEnabled;
-    }
+        return SUCCESS;
 
-    public void setGuestAccountEnabled( boolean guestAccountEnabled )
-    {
-        this.guestAccountEnabled = guestAccountEnabled;
     }
 
     public String getWorkingDirectory()

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp?view=diff&rev=480950&r1=480949&r2=480950
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configuration.jsp
Thu Nov 30 06:58:35 2006
@@ -11,16 +11,6 @@
 
         <div class="axial">
           <table border="1" cellspacing="2" cellpadding="3" width="100%">
-            <c1:data label="%{getText('configuration.guest.label')}">
-                <ww:param name="after">
-                    <ww:text name="configuration.guest.value">
-                        <ww:param>
-                            <ww:if test="%{guestAccountEnabled == true}"><ww:text
name="enabled"/></ww:if>
-                            <ww:else><ww:text name="disabled"/></ww:else>
-                        </ww:param>
-                    </ww:text>
-                </ww:param>
-            </c1:data>
             <c1:data label="%{getText('configuration.workingDirectory.label')}" name="workingDirectory"/>
             <c1:data label="%{getText('configuration.buildOutputDirectory.label')}" name="buildOutputDirectory"/>
             <c1:data label="%{getText('configuration.deploymentRepositoryDirectory.label')}"
name="deploymentRepositoryDirectory"/>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp?view=diff&rev=480950&r1=480949&r2=480950
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
Thu Nov 30 06:58:35 2006
@@ -24,11 +24,6 @@
         <table>
           <tbody>
 
-            <ww:checkbox label="%{getText('configuration.guest.label')}" name="guestAccountEnabled"
-                         value="guestAccountEnabled">
-              <ww:param name="desc"><p><ww:text name="configuration.guest.message"/></p></ww:param>
-            </ww:checkbox>
-
             <ww:textfield label="%{getText('configuration.workingDirectory.label')}" name="workingDirectory"
                           required="true">
               <ww:param name="desc"><p><ww:text name="configuration.workingDirectory.message"/></p></ww:param>



Mime
View raw message