continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r420651 - /maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
Date Mon, 10 Jul 2006 23:07:58 GMT
Author: carlos
Date: Mon Jul 10 16:07:57 2006
New Revision: 420651

URL: http://svn.apache.org/viewvc?rev=420651&view=rev
Log:
[CONTINUUM-542] Create admin user during DB initialization

Modified:
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java?rev=420651&r1=420650&r2=420651&view=diff
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
Mon Jul 10 16:07:57 2006
@@ -103,6 +103,8 @@
             createGroups();
 
             createGuestUser();
+
+            createAdminUser();
         }
         catch ( ContinuumStoreException e )
         {
@@ -237,6 +239,25 @@
             guest.setGuest( true );
 
             store.addUser( guest );
+        }
+    }
+
+    private void createAdminUser()
+        throws ContinuumStoreException
+    {
+        if ( store.getUserByUsername( "admin" ) == null )
+        {
+            ContinuumUser admin = new ContinuumUser();
+
+            admin.setUsername( "admin" );
+
+            admin.setFullName( "Administrator" );
+
+            admin.setGroup( store.getUserGroup( ContinuumSecurity.ADMIN_GROUP_NAME ) );
+
+            admin.setPassword( "admin" );
+
+            store.addUser( admin );
         }
     }
 }



Mime
View raw message