Index: main/trunk/greenstone3/build.xml
===================================================================
--- main/trunk/greenstone3/build.xml	(revision 25321)
+++ main/trunk/greenstone3/build.xml	(revision 25338)
@@ -1117,5 +1117,5 @@
   </target>
 
-  <target name="check-tomcat-running">
+  <target name="check-tomcat-running"><!--if you update this target, may want to change similar elements in config-admin-->
     <!--can also try the "socket" condition in place of the "http" condition-->
     <condition property="tomcat.isrunning"><!--<waitfor maxwait="5" maxwaitunit="second" timeoutproperty="tomcat.isstopped">-->
@@ -1179,4 +1179,79 @@
     </if>
   </target>
+
+  <!-- ======================= Admin Targets ============================ -->  
+
+  <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it. 
+    See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant 
+    But you can do: echo mypassword | ant config-admin -->
+  <target name="config-admin" description="Reset admin password">
+    <input addproperty="admin.password" defaultvalue="admin" message="New admin password (3-8 characters):&gt;">
+      <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->
+    </input>
+    <echo>PWD: ${admin.password}</echo>
+    <antcall target="update-userdb">
+      <param name="user.username" value="admin"/>
+      <param name="user.password" value="${admin.password}"/>
+      <param name="user.groups" value=""/>
+      <param name="user.status" value=""/>
+      <param name="user.comment" value="Password updated."/>
+      <param name="user.email" value=""/>
+    </antcall>
+  </target>
+
+  <target name="config-user" description="Add or modify users" depends="get-user-data,update-userdb"/>
+
+  <target name="get-user-data" description="Get user details">
+    <input addproperty="user.username" message="Username:&gt;"/>
+    <input addproperty="user.password" defaultvalue="" message="Password (3-8 characters):&gt;">
+      <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->
+    </input>
+    <input addproperty="user.groups" defaultvalue="" message="Groups (comma-separated list):&gt;"/>
+    <input addproperty="user.status" defaultvalue="true" message="Enabled (true/false):&gt;"/>
+    <input addproperty="user.comment" defaultvalue="" message="Comment:&gt;"/>
+    <input addproperty="user.email" defaultvalue="" message="Email:&gt;"/>
+  </target>
+
+<!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it. 
+    See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant 
+    But you can do: echo mypassword | ant config-admin -->
+  <target name="update-userdb" description="Add or modify users">
+    <echo>username: ${user.username}</echo>
+    <echo>groups: ${user.groups}</echo>
+
+    <!-- stop tomcat if running, since derby db is embedded and only allows connections from one jvm instance at a time 
+      See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html -->
+    <!--<antcall target="check-tomcat-running"/>--><!--won't set the tomcat.isrunning property for use below-->
+    <condition property="tomcat.isrunning">
+      <http url="http://${tomcat.server}:${tomcat.port}${app.path}"/><!--can also try the "socket" condition in place of the "http" condition-->
+    </condition>
+    <if>
+      <bool>
+	<istrue value="${tomcat.isrunning}"/>
+      </bool>
+      <antcall target="force-stop-tomcat"/>
+    </if>
+
+    <!--<echo>${admin.password}</echo>--> <!-- for testing -->
+    <java classname="org.greenstone.gsdl3.util.ModifyUsersDB">
+      <classpath refid="compile.classpath"/> <!--for ${web.lib}/gsdl3.jar and supporting files-->
+      <arg file="${web.home}/sites/localsite/etc/usersDB"/>
+      <arg value="${user.username}"/>
+      <arg value="password=${user.password}"/>
+      <arg value="groups=${user.groups}"/>
+      <arg value="status=${user.status}"/>
+      <arg value="comment=${user.comment}"/>
+      <arg value="email=${user.email}"/>
+    </java>
+    
+    <!-- run tomcat again if it used to be running -->
+    <if>
+      <bool>
+	<istrue value="${tomcat.isrunning}"/>
+	</bool>
+      <antcall target="start-tomcat"/>
+    </if>
+  </target>
+
 
   <!-- ======================= Axis Targets ============================ -->  
@@ -1225,43 +1300,4 @@
       </else>
 
-    </if>
-  </target>
-
-  <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it. 
-    See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant 
-    But you can do: echo mypassword | ant config-admin -->
-  <target name="config-admin" description="Reset admin password">
-    <input addproperty="admin.password" defaultvalue="admin" message="New admin password (3-8 characters):&gt;">
-      <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->
-    </input>
-
-    <!-- stop tomcat if running, since derby db is embedded and only allows connections from one jvm instance at a time 
-      See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html -->
-
-    <!--<antcall target="check-tomcat-running"/>--><!--won't set the tomcat.isrunning property for use below-->
-    <condition property="tomcat.isrunning">
-      <http url="http://${tomcat.server}:${tomcat.port}${app.path}"/><!--can also try the "socket" condition in place of the "http" condition-->
-    </condition>
-    <if>
-      <bool>
-	<istrue value="${tomcat.isrunning}"/>
-      </bool>
-      <antcall target="force-stop-tomcat"/>
-    </if>
-
-    <!--<echo>${admin.password}</echo>--> <!-- for testing -->
-    <java classname="org.greenstone.gsdl3.util.ChangePwdUsersDB">
-      <classpath refid="compile.classpath"/> <!--for ${web.lib}/gsdl3.jar and supporting files-->
-      <arg file="${web.home}/sites/localsite/etc/usersDB"/>
-      <arg value="admin"/>
-      <arg value="${admin.password}"/>
-    </java>
-
-    <!-- run tomcat again if it used to be running -->
-    <if>
-      <bool>
-	<istrue value="${tomcat.isrunning}"/>
-	</bool>
-      <antcall target="start-tomcat"/>
     </if>
   </target>
