Browse Source

#683 : allow installation on a DB which names begins with numbers
+ directory cleanup for supporting symblinks

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2639 a333f486-631f-4898-b8df-5754b55c2be0

dflaven 12 years ago
parent
commit
be5cbf5f59
1 changed files with 9 additions and 1 deletions
  1. 9 1
      setup/setuputils.class.inc.php

+ 9 - 1
setup/setuputils.class.inc.php

@@ -535,6 +535,10 @@ class SetupUtils
 						{
 							if (function_exists('symlink'))
 							{
+								if (file_exists($sDest.'/'.$sFile))
+								{
+									unlink($sDest.'/'.$sFile);
+								}
 								symlink($sSource.'/'.$sFile, $sDest.'/'.$sFile);
 							}
 							else
@@ -544,6 +548,10 @@ class SetupUtils
 						}
 						else
 						{
+							if (is_link($sDest.'/'.$sFile))
+							{
+								unlink($sDest.'/'.$sFile);
+							}
 							copy($sSource.'/'.$sFile, $sDest.'/'.$sFile);
 						}
 					}
@@ -738,7 +746,7 @@ function ValidateField(sFieldId, bUsed)
 	{
 		if (sValue != "")
 		{
-			if (sValue.match(/^[A-Za-z][A-Za-z0-9_]*$/))
+			if (sValue.match(/^[A-Za-z0-9_]*$/))
 			{
 				var bCollision = false;
 				if (sFieldId == 'db_new_name')