[TFS Changeset #68097]

This commit is contained in:
hartvig
2010-06-12 10:37:52 +00:00
parent 0f10c8d14b
commit a4d8fbbd5f
6 changed files with 85 additions and 28 deletions

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="UMBRACOELISE" id="b6b2f4da-833b-497e-b9e0-fbbe2d8fec40" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment enabled="false" />
<Execution>
<Hosts type="ASP.NET" skipUnhostableTests="false">
<AspNet name="ASP.NET" executionType="WebDev" urlToTest="http://localhost:52453">
<DevelopmentServer pathToWebSite="C:\Users\hartvig\Documents\Visual Studio 2008\Projects\Core\branches\4.1.0\umbraco\presentation" webApplicationRoot="/" />
</AspNet>
</Hosts>
<TestTypeSpecific>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207">
<Browser name="Internet Explorer 7.0">
<Headers>
<Header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" />
<Header name="Accept" value="*/*" />
<Header name="Accept-Language" value="{{$IEAcceptLanguage}}" />
<Header name="Accept-Encoding" value="GZIP" />
</Headers>
</Browser>
</WebTestRunConfiguration>
</TestTypeSpecific>
<AgentRule name="LocalMachineDefaultRole">
</AgentRule>
</Execution>
</TestSettings>

View File

@@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
umbraco weekly.build = umbraco weekly.build
umbraco.build = umbraco.build
umbraco.vsmdi = umbraco.vsmdi
UMBRACOELISE.testrunconfig = UMBRACOELISE.testrunconfig
UMBRACOHUMMER.testrunconfig = UMBRACOHUMMER.testrunconfig
EndProjectSection
EndProject

View File

@@ -377,6 +377,26 @@ namespace umbraco.cms.businesslogic.web
}
/// <summary>
/// Check if a node is a document
/// </summary>
/// <param name="nodeId"></param>
/// <returns></returns>
public static bool IsDocument(int nodeId)
{
bool isDoc = false;
using (IRecordsReader dr =
SqlHelper.ExecuteReader(string.Format("select nodeId from cmsDocument where nodeId = @id"),
SqlHelper.CreateParameter("@id", nodeId))) {
if (dr.Read())
{
isDoc = true;
}
}
return isDoc;
}
/// Used to get the firstlevel/root documents of the hierachy
/// </summary>
/// <returns>Root documents</returns>

View File

@@ -1539,7 +1539,7 @@
<Content Include="umbraco\xslt\templates\Schema2\RSSFeed.xslt" />
<Content Include="umbraco\xslt\templates\Schema2\Sitemap.xslt" />
<Content Include="umbraco\xslt\templates\Schema2\TablePrototype.xslt" />
<Content Include="web.config.UMBRACO-MIURA.xslt" />
<Content Include="web.config.UMBRACOELISE.xslt" />
<Content Include="umbraco\dialogs\Preview.aspx" />
<Content Include="umbraco_client\DateTimePicker\images\calSprite.png" />
<Content Include="umbraco_client\DateTimePicker\images\ui-icons_666666_256x240.png" />

View File

@@ -60,7 +60,7 @@ namespace umbraco.cms.presentation.user
);
//ensure that only the nodes that the user has permissions to update are updated
List<int> lstNoPermissions = new List<int>();
List<int> lstNoPermissions = new List<int>();
foreach (int nodeID in nodeIDs)
{
string nodeActions = UmbracoEnsuredPage.CurrentUser.GetPermissions(GetNodePath(nodeID));
@@ -78,11 +78,11 @@ namespace umbraco.cms.presentation.user
//get the complete list of node ids that this change will affect
List<int> allNodes = new List<int>();
if (replaceChildren)
foreach (int nodeID in nodeIDs)
{
allNodes.Add(nodeID);
allNodes.AddRange(FindChildNodes(nodeID));
}
foreach (int nodeID in nodeIDs)
{
allNodes.Add(nodeID);
allNodes.AddRange(FindChildNodes(nodeID));
}
else
allNodes.AddRange(nodeIDs);
@@ -98,7 +98,7 @@ namespace umbraco.cms.presentation.user
//If there are NO permissions for this node, we need to assign the ActionNull permission otherwise
//the node will inherit from it's parent.
InsertPermissions(nodeIDs, ActionNull.Instance);
}
}
//clear umbraco cache (this is the exact syntax umbraco uses... which should be a public method).
HttpRuntime.Cache.Remove(string.Format("UmbracoUser{0}", m_user.Id.ToString()));
@@ -129,8 +129,13 @@ namespace umbraco.cms.presentation.user
/// <returns></returns>
private string GetNodePath(int iNodeID)
{
Document doc = new Document(iNodeID);
return doc.Path;
if (Document.IsDocument(iNodeID))
{
Document doc = new Document(iNodeID);
return doc.Path;
}
return "";
}
/// <summary>
@@ -141,18 +146,18 @@ namespace umbraco.cms.presentation.user
/// <returns></returns>
private List<int> FindChildNodes(int nodeID)
{
Document[] docs = Document.GetChildrenForTree(nodeID);
List<int> nodeIds = new List<int>();
foreach (Document doc in docs)
{
nodeIds.Add(doc.Id);
if (doc.HasChildren)
{
nodeIds.AddRange(FindChildNodes(doc.Id));
}
}
return nodeIds;
}
Document[] docs = Document.GetChildrenForTree(nodeID);
List<int> nodeIds = new List<int>();
foreach (Document doc in docs)
{
nodeIds.Add(doc.Id);
if (doc.HasChildren)
{
nodeIds.AddRange(FindChildNodes(doc.Id));
}
}
return nodeIds;
}
private void InsertPermissions(int[] nodeIDs, IAction permission)
{
@@ -161,12 +166,12 @@ namespace umbraco.cms.presentation.user
}
private void InsertPermission(int nodeID, IAction permission)
{
{
//create a new CMSNode object but don't initialize (this prevents a db query)
CMSNode node = new CMSNode(nodeID, false);
Permission.MakeNew(m_user, node, permission.Letter);
Permission.MakeNew(m_user, node, permission.Letter);
}
private static void DeletePermissions(int iUserID, int iNodeID)
{
DeletePermissions(iUserID, new int[] { iNodeID });
@@ -185,6 +190,6 @@ namespace umbraco.cms.presentation.user
{
return from.ToString();
}
}
}

View File

@@ -4,11 +4,11 @@
<!-- Set up a local connection string -->
<xsl:template match="/configuration/appSettings/add[@key='umbracoDbDSN']/@value">
<xsl:attribute name="value">server=.\sqlexpress;database=niels;user id=DBUSER;password=DBPASSWORD</xsl:attribute>
<xsl:attribute name="value">server=.\sqlexpress;database=41RC;user id=DBUSER;password=DBPASSWORD</xsl:attribute>
</xsl:template>
<xsl:template match="/configuration/appSettings/add[@key='umbracoConfigurationStatus']/@value">
<xsl:attribute name="value">4.1.0.beta</xsl:attribute>
<xsl:attribute name="value"></xsl:attribute>
</xsl:template>
<!-- Default templates to match anything else -->