Changeset 30055
- Timestamp:
- 2015-07-24T22:48:03+12:00 (8 years ago)
- Location:
- main/trunk/greenstone3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/build.xml
r30038 r30055 1832 1832 But you can do: echo mypassword | ant config-admin --> 1833 1833 <target name="config-admin" description="Reset admin password"> 1834 <input addproperty="admin.password" defaultvalue="admin" message="New admin password (3- 8characters):>">1834 <input addproperty="admin.password" defaultvalue="admin" message="New admin password (3-20 characters):>"> 1835 1835 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen --> 1836 1836 </input> … … 1850 1850 <target name="get-user-data" description="Get user details"> 1851 1851 <input addproperty="user.username" message="Username:>"/> 1852 <input addproperty="user.password" defaultvalue="" message="Password (3- 8characters):>">1852 <input addproperty="user.password" defaultvalue="" message="Password (3-20 characters):>"> 1853 1853 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen --> 1854 1854 </input> … … 1859 1859 </target> 1860 1860 1861 <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it.1862 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant1863 But you can do: echo mypassword | ant config-admin -->1864 <target name="update-userdb" description="Add or modify users" depends=" check-tomcat-running">1861 <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it. 1862 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant 1863 But you can do: echo mypassword | ant config-admin --> 1864 <target name="update-userdb" description="Add or modify users" depends="start-derby"> 1865 1865 1866 1866 <!-- … … 1870 1870 See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html 1871 1871 The ${tomcat.isrunning} property is set by the depends-target "check-tomcat-running" --> 1872 <!-- 1873 <if> 1874 <bool> 1875 <istrue value="${tomcat.isrunning}"/> 1876 </bool> 1877 <antcall target="stop-tomcat"/> 1878 </if> 1879 --> 1872 1873 <!-- Need the derby networked server to be running in order to modify the usersDB. 1874 The start-derby task will check if derby is already running (if not, ${derby.isstarted} will 1875 be false) and will only start up networked derby if it is not already running. 1876 The ${derby.isstarted} property is set by the depends-target "start-derby", since it won't 1877 set the property if called with antcall (like launching in a subshell). Have to use 'depends'. 1878 We'll check ${derby.isstarted} at the end to stop derby again if we had to start it up now.--> 1879 <!--<antcall target="start-derby"/>--> 1880 1881 <!-- wait a max of 5 seconds for the derbyserver to have started up --> 1882 <waitfor maxwait="5" maxwaitunit="second"> 1883 <socket server="${derby.server}" port="${derby.server.port}"/> 1884 </waitfor> 1880 1885 1881 1886 <!--<echo>${admin.password}</echo>--> <!-- for testing --> … … 1890 1895 <arg value="email=${user.email}"/> 1891 1896 </java> 1892 1893 <!-- run tomcat again if it used to be running --> 1894 <!-- 1897 1898 <!-- Need to stop networked derby again if we ran it for this target with the depends=start-derby call. 1899 The test here is for <not>derby.isstarted</not>, as the property would be the same as before 1900 derby was started, since properties are immutable within a single ant command. --> 1895 1901 <if> 1896 1902 <bool> 1897 < istrue value="${tomcat.isrunning}"/>1898 1899 <antcall target="force-st art-tomcat"/>1900 </if> 1901 --> 1903 <not><istrue value="${derby.isstarted}"/></not> 1904 </bool> 1905 <antcall target="force-stop-derby"/> 1906 </if> 1907 1902 1908 </target> 1903 1909 -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/derby/DerbySQLServer.java
r30043 r30055 12 12 public class DerbySQLServer implements SQLServer{ 13 13 14 static final String PORT = GlobalProperties.getProperty("derby.server.port" );//, "1527");15 static final String DERBYSERVER = GlobalProperties.getProperty("derby.server" );//, "localhost");14 static final String PORT = GlobalProperties.getProperty("derby.server.port", "1527"); 15 static final String DERBYSERVER = GlobalProperties.getProperty("derby.server", "localhost"); 16 16 static final String PROTOCOL = "jdbc:derby://"+DERBYSERVER+":"+PORT+"/"; // "jdbc:derby://localhost:1527"; 17 17 static final String DRIVER = "org.apache.derby.jdbc.ClientDriver"; //"org.apache.derby.jdbc.EmbeddedDriver"; -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DerbyWrapper.java
r30043 r30055 35 35 public class DerbyWrapper 36 36 { 37 static final String PORT = GlobalProperties.getProperty("derby.server.port" );//, "1527");38 static final String DERBYSERVER = GlobalProperties.getProperty("derby.server" );//, "localhost");37 static final String PORT = GlobalProperties.getProperty("derby.server.port", "1527"); 38 static final String DERBYSERVER = GlobalProperties.getProperty("derby.server", "localhost"); 39 39 static final String PROTOCOL = "jdbc:derby://"+DERBYSERVER+":"+PORT+"/"; // "jdbc:derby://localhost:1527"; 40 40 static final String DRIVER = "org.apache.derby.jdbc.ClientDriver"; //"org.apache.derby.jdbc.EmbeddedDriver"; -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/ModifyUsersDB.java
r29467 r30055 27 27 public class ModifyUsersDB 28 28 { 29 public static int PWD_MIN_LENGTH = 3; 30 public static int PWD_MAX_LENGTH = 20; 29 31 30 32 public static void main(String[] args) throws SQLException … … 49 51 50 52 // If the user specifically sets any of the fields on the cmdline, they'll be overwritten in the db, 51 // even if the user had set them to empty. Except the password which must be between 3 and 8characters.53 // even if the user had set them to empty. Except the password which must be between PWD_MIN_LENGTH and PWD_MAX_LENGTH characters. 52 54 for (int i = 2; i < args.length; i++) 53 55 { … … 56 58 password = args[i].substring("password=".length()); 57 59 58 if (password.length() < 3 || password.length() > 8)60 if (password.length() < PWD_MIN_LENGTH || password.length() > PWD_MAX_LENGTH) 59 61 { 60 62 if (!password.equals("")) 61 63 { 62 System.out.println("Password not updated. It should be between 3 and 8characters (inclusive).");64 System.out.println("Password not updated. It should be between " + PWD_MIN_LENGTH + " and " + PWD_MAX_LENGTH + " characters (inclusive)."); 63 65 } 64 66 }
Note:
See TracChangeset
for help on using the changeset viewer.