@@ -76,7 +76,7 @@ namespace umbraco.cms.businesslogic.member
|
||||
/// <summary>
|
||||
/// The name of the member
|
||||
/// </summary>
|
||||
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??
|
||||
/// </summary>
|
||||
public class MemberShipHelper : MembershipProvider
|
||||
{
|
||||
|
||||
@@ -85,9 +85,11 @@ namespace umbraco.cms.businesslogic.member
|
||||
/// <param name="pt">Propertytype to edit</param>
|
||||
/// <returns>True if the Member can edit the data</returns>
|
||||
public bool MemberCanEdit(propertytype.PropertyType pt) {
|
||||
if(propertyTypeRegistered(pt)) {
|
||||
return (Convert.ToBoolean(SqlHelper.ExecuteScalar<int>("Select memberCanEdit from cmsMemberType where NodeId = " + this.Id + " And propertytypeId = " + pt.Id)));
|
||||
}
|
||||
if (propertyTypeRegistered(pt))
|
||||
{
|
||||
var memberCanEdit = SqlHelper.ExecuteScalar<object>("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<int>("Select viewOnProfile from cmsMemberType where NodeId = " + this.Id + " And propertytypeId = " + pt.Id));
|
||||
return Convert.ToBoolean(SqlHelper.ExecuteScalar<object>("Select viewOnProfile from cmsMemberType where NodeId = " + this.Id + " And propertytypeId = " + pt.Id));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user