From 727d1c65071d67cfca81ad2e5bc685b3ae2e079d Mon Sep 17 00:00:00 2001 From: Shandem Date: Mon, 10 May 2010 14:34:18 +0000 Subject: [PATCH] Fixes: 27009 [TFS Changeset #66056] --- umbraco/cms/businesslogic/member/Member.cs | 4 +- .../cms/businesslogic/member/MemberType.cs | 10 +++-- umbraco/presentation/macro.cs | 41 +++++++++++++------ 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/umbraco/cms/businesslogic/member/Member.cs b/umbraco/cms/businesslogic/member/Member.cs index 311c666c79..956fc28163 100644 --- a/umbraco/cms/businesslogic/member/Member.cs +++ b/umbraco/cms/businesslogic/member/Member.cs @@ -76,7 +76,7 @@ namespace umbraco.cms.businesslogic.member /// /// The name of the member /// - public new string Text + public override string Text { get { @@ -1177,6 +1177,8 @@ namespace umbraco.cms.businesslogic.member /// directly on the UmbracoMemberShipMember class. /// This is a helper implementation only to be able to use the encryption functionality /// of the membership provides (which are protected). + /// + /// ... which means this class should have been marked internal with a Friend reference to the other assembly right?? /// public class MemberShipHelper : MembershipProvider { diff --git a/umbraco/cms/businesslogic/member/MemberType.cs b/umbraco/cms/businesslogic/member/MemberType.cs index 961ff027c5..017184437d 100644 --- a/umbraco/cms/businesslogic/member/MemberType.cs +++ b/umbraco/cms/businesslogic/member/MemberType.cs @@ -85,9 +85,11 @@ namespace umbraco.cms.businesslogic.member /// Propertytype to edit /// True if the Member can edit the data public bool MemberCanEdit(propertytype.PropertyType pt) { - if(propertyTypeRegistered(pt)) { - return (Convert.ToBoolean(SqlHelper.ExecuteScalar("Select memberCanEdit from cmsMemberType where NodeId = " + this.Id + " And propertytypeId = " + pt.Id))); - } + if (propertyTypeRegistered(pt)) + { + var memberCanEdit = SqlHelper.ExecuteScalar("Select memberCanEdit from cmsMemberType where NodeId = " + this.Id + " And propertytypeId = " + pt.Id); + return (Convert.ToBoolean(memberCanEdit)); + } return false; } @@ -112,7 +114,7 @@ namespace umbraco.cms.businesslogic.member { if(propertyTypeRegistered(pt)) { - return Convert.ToBoolean(SqlHelper.ExecuteScalar("Select viewOnProfile from cmsMemberType where NodeId = " + this.Id + " And propertytypeId = " + pt.Id)); + return Convert.ToBoolean(SqlHelper.ExecuteScalar("Select viewOnProfile from cmsMemberType where NodeId = " + this.Id + " And propertytypeId = " + pt.Id)); } return false; } diff --git a/umbraco/presentation/macro.cs b/umbraco/presentation/macro.cs index 7305d4ecc2..5d86149d40 100644 --- a/umbraco/presentation/macro.cs +++ b/umbraco/presentation/macro.cs @@ -796,34 +796,51 @@ namespace umbraco } Assembly appCodeAssembly; - try { - if (Directory.Exists(GlobalSettings.FullpathToRoot + System.IO.Path.DirectorySeparatorChar + "App_Code") { + try + { + if (Directory.Exists(GlobalSettings.FullpathToRoot + System.IO.Path.DirectorySeparatorChar + "App_Code")) + { if (Directory.GetFiles(GlobalSettings.FullpathToRoot + System.IO.Path.DirectorySeparatorChar + "App_Code", "*.*", - SearchOption.AllDirectories).Length > 0) { + SearchOption.AllDirectories).Length > 0) + { appCodeAssembly = Assembly.Load("__code"); Type[] appCodeType = appCodeAssembly.GetExportedTypes(); - if (appCodeType.Length == 0) { + if (appCodeType.Length == 0) + { Log.Add(LogTypes.System, Node.GetCurrent().Id, String.Format("Could not load types in App_Code ({0}) for XSLT extensions. Ensure you have used the public keyword to ensure class and method exposure.", appCodeAssembly.FullName)); - } else { + } + else + { // create an instance and add it to the extensions list - foreach (Type tp in appCodeType) { + foreach (Type tp in appCodeType) + { object[] tpAttributes = tp.GetCustomAttributes(typeof(XsltExtensionAttribute), true); - foreach (XsltExtensionAttribute tpAttribute in tpAttributes) { - if (tpAttribute.Namespace != String.Empty) { + foreach (XsltExtensionAttribute tpAttribute in tpAttributes) + { + if (tpAttribute.Namespace != String.Empty) + { extensions.Add(tpAttribute.Namespace, Activator.CreateInstance(tp)); - } else { + } + else + { extensions.Add(tp.FullName, Activator.CreateInstance(tp)); } } } } } - } else { + } + else + { Directory.CreateDirectory(GlobalSettings.FullpathToRoot + System.IO.Path.DirectorySeparatorChar + "App_Code"); } - } catch (FileNotFoundException) { //Do nothing - just means there's nothing to load. - } catch (Exception ex) { + } + catch (FileNotFoundException) + { //Do nothing - just means there's nothing to load. + } + catch (Exception ex) + { throw new Exception("Could not load App_Code classes for XSLT extensions.", ex); }