Updated the remainder of the legacy UmbracoSettings calls to use the new format, now to just fix up the unit tests
This commit is contained in:
@@ -8,6 +8,7 @@ using System.Web.Mvc;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Dynamics;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Profiling;
|
||||
@@ -65,7 +66,7 @@ namespace Umbraco.Web
|
||||
if (UmbracoContext.Current.InPreviewMode)
|
||||
{
|
||||
var htmlBadge =
|
||||
String.Format(UmbracoSettings.PreviewBadge,
|
||||
String.Format(UmbracoConfiguration.Current.UmbracoSettings.Content.PreviewBadge,
|
||||
IOHelper.ResolveUrl(SystemDirectories.Umbraco),
|
||||
IOHelper.ResolveUrl(SystemDirectories.UmbracoClient),
|
||||
UmbracoContext.Current.HttpContext.Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path));
|
||||
|
||||
@@ -2,7 +2,8 @@ using System;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using Umbraco.Core;
|
||||
using umbraco;
|
||||
using Umbraco.Core.Configuration;
|
||||
using GlobalSettings = umbraco.GlobalSettings;
|
||||
|
||||
namespace Umbraco.Web
|
||||
{
|
||||
@@ -68,7 +69,7 @@ namespace Umbraco.Web
|
||||
{
|
||||
if (!GlobalSettings.UseDirectoryUrls)
|
||||
path += ".aspx";
|
||||
else if (UmbracoSettings.AddTrailingSlash)
|
||||
else if (UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.AddTrailingSlash)
|
||||
path += "/";
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace umbraco {
|
||||
string langXpath = CreateXPathQuery(domainUrl + "/" + url, false);
|
||||
if (content.Instance.XmlContent.DocumentElement.SelectSingleNode(langXpath) != null)
|
||||
return langXpath;
|
||||
else if (UmbracoSettings.UseDomainPrefixes)
|
||||
else if (UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.UseDomainPrefixes)
|
||||
return "/domainprefixes-are-used-so-i-do-not-work";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace umbraco
|
||||
/// <returns>Returns true of the XML was not populated, returns false if it was already populated</returns>
|
||||
private bool CheckXmlContentPopulation()
|
||||
{
|
||||
if (UmbracoSettings.XmlContentCheckForDiskChanges)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.XmlContentCheckForDiskChanges)
|
||||
CheckDiskCacheForUpdate();
|
||||
|
||||
if (_xmlContent == null)
|
||||
@@ -510,7 +510,7 @@ namespace umbraco
|
||||
{
|
||||
// modify a clone of the cache because even though we're into the write-lock
|
||||
// we may have threads reading at the same time. why is this an option?
|
||||
XmlDocument wip = UmbracoSettings.CloneXmlCacheOnPublish
|
||||
XmlDocument wip = UmbracoConfiguration.Current.UmbracoSettings.Content.CloneXmlContent
|
||||
? CloneXmlDoc(XmlContentInternal)
|
||||
: XmlContentInternal;
|
||||
|
||||
@@ -1320,7 +1320,7 @@ order by umbracoNode.level, umbracoNode.sortOrder";
|
||||
else
|
||||
{
|
||||
//// Save copy of content
|
||||
if (UmbracoSettings.CloneXmlCacheOnPublish)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.CloneXmlContent)
|
||||
{
|
||||
XmlDocument xmlContentCopy = CloneXmlDoc(_xmlContent);
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace umbraco
|
||||
if (pos > -1)
|
||||
{
|
||||
string htmlBadge =
|
||||
String.Format(UmbracoSettings.PreviewBadge,
|
||||
String.Format(UmbracoConfiguration.Current.UmbracoSettings.Content.PreviewBadge,
|
||||
IOHelper.ResolveUrl(SystemDirectories.Umbraco),
|
||||
IOHelper.ResolveUrl(SystemDirectories.UmbracoClient),
|
||||
Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Mail;
|
||||
using System.Text;
|
||||
@@ -12,6 +13,7 @@ using System.Xml.XPath;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Cache;
|
||||
@@ -1864,40 +1866,51 @@ namespace umbraco
|
||||
|
||||
internal static string GetCurrentNotFoundPageId()
|
||||
{
|
||||
string error404 = "";
|
||||
XmlNode error404Node = UmbracoSettings.GetKeyAsNode("/settings/content/errors/error404");
|
||||
if (error404Node.SelectNodes("errorPage").Count > 0 && error404Node.SelectNodes("errorPage")[0].HasChildNodes)
|
||||
//XmlNode error404Node = UmbracoSettings.GetKeyAsNode("/settings/content/errors/error404");
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.Errors.Error404Collection.Count() > 1)
|
||||
{
|
||||
// try to get the 404 based on current culture (via domain)
|
||||
XmlNode cultureErrorNode;
|
||||
IContentErrorPage cultureErr;
|
||||
if (Domain.Exists(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]))
|
||||
{
|
||||
Domain d = Domain.GetDomain(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]);
|
||||
var d = Domain.GetDomain(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]);
|
||||
|
||||
// test if a 404 page exists with current culture
|
||||
cultureErrorNode = error404Node.SelectSingleNode(String.Format("errorPage [@culture = '{0}']", d.Language.CultureAlias));
|
||||
if (cultureErrorNode != null && cultureErrorNode.FirstChild != null)
|
||||
error404 = cultureErrorNode.FirstChild.Value;
|
||||
cultureErr = UmbracoConfiguration.Current.UmbracoSettings.Content.Errors.Error404Collection
|
||||
.FirstOrDefault(x => x.Culture == d.Language.CultureAlias);
|
||||
|
||||
if (cultureErr != null)
|
||||
{
|
||||
return cultureErr.ContentId.ToInvariantString();
|
||||
}
|
||||
|
||||
}
|
||||
else if (error404Node.SelectSingleNode(string.Format("errorPage [@culture = '{0}']", System.Threading.Thread.CurrentThread.CurrentUICulture.Name)) != null)
|
||||
|
||||
// test if a 404 page exists with current culture thread
|
||||
cultureErr = UmbracoConfiguration.Current.UmbracoSettings.Content.Errors.Error404Collection
|
||||
.FirstOrDefault(x => x.Culture == System.Threading.Thread.CurrentThread.CurrentUICulture.Name);
|
||||
if (cultureErr != null)
|
||||
{
|
||||
cultureErrorNode = error404Node.SelectSingleNode(string.Format("errorPage [@culture = '{0}']", System.Threading.Thread.CurrentThread.CurrentUICulture.Name));
|
||||
if (cultureErrorNode.FirstChild != null)
|
||||
error404 = cultureErrorNode.FirstChild.Value;
|
||||
return cultureErr.ContentId.ToInvariantString();
|
||||
}
|
||||
else
|
||||
|
||||
// there should be a default one!
|
||||
cultureErr = UmbracoConfiguration.Current.UmbracoSettings.Content.Errors.Error404Collection
|
||||
.FirstOrDefault(x => x.Culture == "default");
|
||||
if (cultureErr != null)
|
||||
{
|
||||
cultureErrorNode = error404Node.SelectSingleNode("errorPage [@culture = 'default']");
|
||||
if (cultureErrorNode != null && cultureErrorNode.FirstChild != null)
|
||||
error404 = cultureErrorNode.FirstChild.Value;
|
||||
return cultureErr.ContentId.ToInvariantString();
|
||||
}
|
||||
}
|
||||
else
|
||||
error404 = UmbracoSettings.GetKey("/settings/content/errors/error404");
|
||||
return error404;
|
||||
{
|
||||
|
||||
return UmbracoConfiguration.Current.UmbracoSettings.Content.Errors.Error404Collection.First().ContentId.ToInvariantString();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Template Control Mapping Functions
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Diagnostics;
|
||||
using System.Net;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
@@ -61,40 +62,30 @@ namespace umbraco.presentation
|
||||
// run scheduled url tasks
|
||||
try
|
||||
{
|
||||
XmlNode scheduledTasks = UmbracoSettings.ScheduledTasks;
|
||||
if(scheduledTasks != null)
|
||||
{
|
||||
XmlNodeList tasks = scheduledTasks.SelectNodes("./task");
|
||||
if(tasks != null)
|
||||
{
|
||||
foreach (XmlNode task in tasks)
|
||||
{
|
||||
bool runTask = false;
|
||||
if (!ScheduledTaskTimes.ContainsKey(task.Attributes.GetNamedItem("alias").Value))
|
||||
{
|
||||
runTask = true;
|
||||
ScheduledTaskTimes.Add(task.Attributes.GetNamedItem("alias").Value, DateTime.Now);
|
||||
}
|
||||
// Add 1 second to timespan to compensate for differencies in timer
|
||||
else if (
|
||||
new TimeSpan(DateTime.Now.Ticks -
|
||||
((DateTime) ScheduledTaskTimes[task.Attributes.GetNamedItem("alias").Value]).Ticks).TotalSeconds +
|
||||
1 >=
|
||||
int.Parse(task.Attributes.GetNamedItem("interval").Value))
|
||||
{
|
||||
runTask = true;
|
||||
ScheduledTaskTimes[task.Attributes.GetNamedItem("alias").Value] = DateTime.Now;
|
||||
}
|
||||
foreach (var t in UmbracoConfiguration.Current.UmbracoSettings.ScheduledTasks.Tasks)
|
||||
{
|
||||
bool runTask = false;
|
||||
if (!ScheduledTaskTimes.ContainsKey(t.Alias))
|
||||
{
|
||||
runTask = true;
|
||||
ScheduledTaskTimes.Add(t.Alias, DateTime.Now);
|
||||
}
|
||||
// Add 1 second to timespan to compensate for differencies in timer
|
||||
else if (
|
||||
new TimeSpan(
|
||||
DateTime.Now.Ticks - ((DateTime)ScheduledTaskTimes[t.Alias]).Ticks).TotalSeconds + 1 >= t.Interval)
|
||||
{
|
||||
runTask = true;
|
||||
ScheduledTaskTimes[t.Alias] = DateTime.Now;
|
||||
}
|
||||
|
||||
if (runTask)
|
||||
{
|
||||
bool taskResult = getTaskByHttp(task.Attributes.GetNamedItem("url").Value);
|
||||
if (bool.Parse(task.Attributes.GetNamedItem("log").Value))
|
||||
LogHelper.Info<publishingService>(string.Format("{0} has been called with response: {1}", task.Attributes.GetNamedItem("alias").Value, taskResult));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (runTask)
|
||||
{
|
||||
bool taskResult = getTaskByHttp(t.Url);
|
||||
if (t.Log)
|
||||
LogHelper.Info<publishingService>(string.Format("{0} has been called with response: {1}", t.Alias, taskResult));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ee)
|
||||
{
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace umbraco.presentation
|
||||
}
|
||||
|
||||
// show splash?
|
||||
else if (UmbracoSettings.EnableSplashWhileLoading && content.Instance.isInitializing)
|
||||
else if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnableSplashWhileLoading && content.Instance.isInitializing)
|
||||
context.RewritePath(string.Format("{0}/splashes/booting.aspx", SystemDirectories.Config));
|
||||
// rewrite page path
|
||||
else
|
||||
@@ -361,7 +361,7 @@ namespace umbraco.presentation
|
||||
{
|
||||
LogHelper.Info<requestModule>(string.Format("Application started at {0}", DateTime.Now));
|
||||
|
||||
if (UmbracoSettings.AutoCleanLogs)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Logging.AutoCleanLogs)
|
||||
{
|
||||
AddTask(LOG_SCRUBBER_TASK_NAME, GetLogScrubbingInterval());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.BusinessLogic.Actions;
|
||||
@@ -36,7 +37,8 @@ namespace umbraco.ActionHandlers
|
||||
/// <returns>Returns true if successfull, otherwise false</returns>
|
||||
public bool Execute(umbraco.cms.businesslogic.web.Document documentObject, interfaces.IAction action)
|
||||
{
|
||||
if (UmbracoSettings.EnsureUniqueNaming)
|
||||
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnsureUniqueNaming)
|
||||
{
|
||||
string currentName = documentObject.Text;
|
||||
int uniqueNumber = 1;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Configuration;
|
||||
using umbraco.BusinessLogic.Actions;
|
||||
using umbraco.businesslogic;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
@@ -114,7 +115,7 @@ namespace umbraco
|
||||
{
|
||||
actions.Clear();
|
||||
actions.Add(ActionNew.Instance);
|
||||
if (UmbracoSettings.EnableCanvasEditing)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing)
|
||||
{
|
||||
actions.Add(ActionLiveEdit.Instance);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace umbraco
|
||||
RenderTemplateFolderItems(folder, folderPath, ref tree);
|
||||
else
|
||||
{
|
||||
if(UmbracoSettings.EnableTemplateFolders)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Templates.EnableTemplateFolders)
|
||||
RenderTemplateFolders(ref tree);
|
||||
|
||||
RenderTemplates(ref tree);
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Text;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using System.Configuration;
|
||||
using Umbraco.Core.Configuration;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.businesslogic;
|
||||
@@ -71,7 +72,8 @@ function openUser(id) {
|
||||
bool currUserIsAdmin = currUser.IsAdmin();
|
||||
foreach (User u in users.OrderBy(x => x.Disabled))
|
||||
{
|
||||
if (!UmbracoSettings.HideDisabledUsersInBackoffice || (UmbracoSettings.HideDisabledUsersInBackoffice && !u.Disabled))
|
||||
if (!UmbracoConfiguration.Current.UmbracoSettings.Security.HideDisabledUsersInBackoffice
|
||||
|| (UmbracoConfiguration.Current.UmbracoSettings.Security.HideDisabledUsersInBackoffice && !u.Disabled))
|
||||
{
|
||||
|
||||
XmlTreeNode xNode = XmlTreeNode.Create(this);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Umbraco.Core.Configuration;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.businesslogic.Exceptions;
|
||||
@@ -14,7 +15,7 @@ namespace umbraco.presentation
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if ((UmbracoSettings.EnableCanvasEditing || !String.IsNullOrEmpty(Request["umbSkinning"]) ) && getUser() != null)
|
||||
if ((UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing || !String.IsNullOrEmpty(Request["umbSkinning"])) && getUser() != null)
|
||||
{
|
||||
UmbracoContext.Current.LiveEditingContext.Enabled = true;
|
||||
|
||||
@@ -27,7 +28,7 @@ namespace umbraco.presentation
|
||||
Response.Redirect(redirUrl +
|
||||
(string.IsNullOrEmpty(Request["umbSkinning"]) ? "" : "?umbSkinning=true") + (string.IsNullOrEmpty(Request["umbSkinningConfigurator"]) ? "" : "&umbSkinningConfigurator=true"), true);
|
||||
}
|
||||
else if (!UmbracoSettings.EnableCanvasEditing)
|
||||
else if (!UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing)
|
||||
{
|
||||
throw new UserAuthorizationException(
|
||||
"Canvas editing isn't enabled. It can be enabled via the UmbracoSettings.config");
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Web;
|
||||
using CookComputing.Blogger;
|
||||
using CookComputing.MetaWeblog;
|
||||
using CookComputing.XmlRpc;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.cms.businesslogic;
|
||||
@@ -74,7 +75,8 @@ namespace umbraco.presentation.channels
|
||||
if (userChannel.FieldExcerptAlias != null && userChannel.FieldExcerptAlias != "")
|
||||
doc.getProperty(userChannel.FieldExcerptAlias).Value = removeLeftUrl(post.mt_excerpt);
|
||||
|
||||
if (UmbracoSettings.TidyEditorContent)
|
||||
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.TidyEditorContent)
|
||||
doc.getProperty(userChannel.FieldDescriptionAlias).Value = library.Tidy(removeLeftUrl(post.description), false);
|
||||
else
|
||||
doc.getProperty(userChannel.FieldDescriptionAlias).Value = removeLeftUrl(post.description);
|
||||
@@ -385,7 +387,7 @@ namespace umbraco.presentation.channels
|
||||
|
||||
|
||||
// Description
|
||||
if (UmbracoSettings.TidyEditorContent)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.TidyEditorContent)
|
||||
doc.getProperty(userChannel.FieldDescriptionAlias).Value = library.Tidy(removeLeftUrl(post.description), false);
|
||||
else
|
||||
doc.getProperty(userChannel.FieldDescriptionAlias).Value = removeLeftUrl(post.description);
|
||||
@@ -514,7 +516,8 @@ namespace umbraco.presentation.channels
|
||||
|
||||
private static bool validateUser(string username, string password)
|
||||
{
|
||||
return Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].ValidateUser(username, password);
|
||||
|
||||
return Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].ValidateUser(username, password);
|
||||
}
|
||||
|
||||
[XmlRpcMethod("blogger.getUsersBlogs",
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Models;
|
||||
using umbraco.BasePages;
|
||||
@@ -526,7 +527,7 @@ namespace umbraco.controls
|
||||
{
|
||||
string caption = p.PropertyType.Name;
|
||||
if (p.PropertyType.Description != null && p.PropertyType.Description != String.Empty)
|
||||
switch (UmbracoSettings.PropertyContextHelpOption)
|
||||
switch (UmbracoConfiguration.Current.UmbracoSettings.Content.PropertyContextHelpOption)
|
||||
{
|
||||
case "icon":
|
||||
caption += " <img src=\"" + this.ResolveUrl(SystemDirectories.Umbraco) + "/images/help.png\" class=\"umbPropertyContextHelp\" alt=\"" + p.PropertyType.Description + "\" title=\"" + p.PropertyType.Description + "\" />";
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Web.UI.HtmlControls;
|
||||
using System.Web.UI.WebControls;
|
||||
using ClientDependency.Core;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web.UI.Controls;
|
||||
@@ -444,7 +445,7 @@ namespace umbraco.controls
|
||||
{
|
||||
// Still shows the selected even if we tell it to hide sprite duplicates so as not to break an existing selection
|
||||
if (_contentType.IconUrl.Equals(iconClass, StringComparison.InvariantCultureIgnoreCase) == false
|
||||
&& UmbracoSettings.IconPickerBehaviour == IconPickerBehaviour.HideSpriteDuplicates
|
||||
&& UmbracoConfiguration.Current.UmbracoSettings.Content.IconPickerBehaviour == IconPickerBehaviour.HideSpriteDuplicates
|
||||
&& diskFileNames.Contains(IconClassToIconFileName(iconClass)))
|
||||
continue;
|
||||
|
||||
@@ -459,7 +460,7 @@ namespace umbraco.controls
|
||||
|
||||
// Still shows the selected even if we tell it to hide file duplicates so as not to break an existing selection
|
||||
if (_contentType.IconUrl.Equals(file.Name, StringComparison.InvariantCultureIgnoreCase) == false
|
||||
&& UmbracoSettings.IconPickerBehaviour == IconPickerBehaviour.HideFileDuplicates
|
||||
&& UmbracoConfiguration.Current.UmbracoSettings.Content.IconPickerBehaviour == IconPickerBehaviour.HideFileDuplicates
|
||||
&& spriteFileNames.Contains(FileNameToIconFileName(file)))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
using ClientDependency.Core;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.BusinessLogic;
|
||||
@@ -247,7 +248,8 @@ namespace umbraco.controls.GenericProperties
|
||||
|
||||
private void SetDefaultDocumentTypeProperty()
|
||||
{
|
||||
var itemToSelect = ddlTypes.Items.Cast<ListItem>().FirstOrDefault(item => item.Text.ToLowerInvariant() == UmbracoSettings.DefaultDocumentTypeProperty.ToLowerInvariant());
|
||||
var itemToSelect = ddlTypes.Items.Cast<ListItem>()
|
||||
.FirstOrDefault(item => item.Text.ToLowerInvariant() == UmbracoConfiguration.Current.UmbracoSettings.Content.DefaultDocumentTypeProperty.ToLowerInvariant());
|
||||
|
||||
if (itemToSelect != null)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Web.UI;
|
||||
using Umbraco.Core;
|
||||
using umbraco.BusinessLogic;
|
||||
@@ -11,7 +12,7 @@ namespace umbraco
|
||||
{
|
||||
|
||||
var mediaType = cms.businesslogic.media.MediaType.MakeNew(User, Alias.Replace("'", "''"));
|
||||
mediaType.IconUrl = UmbracoSettings.IconPickerBehaviour == IconPickerBehaviour.HideFileDuplicates ? ".sprTreeFolder" : "folder.gif";
|
||||
mediaType.IconUrl = UmbracoConfiguration.Current.UmbracoSettings.Content == IconPickerBehaviour.HideFileDuplicates ? ".sprTreeFolder" : "folder.gif";
|
||||
|
||||
if (ParentID != -1)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Web.Security;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web.UI;
|
||||
using umbraco.BusinessLogic;
|
||||
@@ -27,7 +28,7 @@ namespace umbraco
|
||||
contentType.CreatorId = User.Id;
|
||||
contentType.Alias = Alias.Replace("'", "''");
|
||||
contentType.Name = Alias.Replace("'", "''");
|
||||
contentType.Icon = UmbracoSettings.IconPickerBehaviour == IconPickerBehaviour.HideFileDuplicates
|
||||
contentType.Icon = UmbracoConfiguration.Current.UmbracoSettings.Content.IconPickerBehaviour == IconPickerBehaviour.HideFileDuplicates
|
||||
? ".sprTreeFolder"
|
||||
: "folder.gif";
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@ using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Web.UI;
|
||||
using umbraco.cms.helpers;
|
||||
using umbraco.BasePages;
|
||||
@@ -73,7 +75,7 @@ namespace umbraco.presentation.umbraco.create
|
||||
this.sbmt.Click += new System.EventHandler(this.sbmt_Click);
|
||||
this.Load += new System.EventHandler(this.Page_Load);
|
||||
|
||||
string[] fileTypes = UmbracoSettings.ScriptFileTypes.Split(',');
|
||||
string[] fileTypes = UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptEditor.ScriptFileTypes.ToArray();
|
||||
|
||||
scriptType.Items.Add(new ListItem(ui.Text("folder"), ""));
|
||||
scriptType.Items.FindByText(ui.Text("folder")).Selected = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Web.Security;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Web.UI;
|
||||
using umbraco.BusinessLogic;
|
||||
@@ -36,10 +37,10 @@ namespace umbraco
|
||||
try
|
||||
{
|
||||
// Password is auto-generated. They are they required to change the password by editing the user information.
|
||||
var u = Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].CreateUser(Alias,
|
||||
var u = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].CreateUser(Alias,
|
||||
Membership.GeneratePassword(
|
||||
Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].MinRequiredPasswordLength,
|
||||
Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].MinRequiredNonAlphanumericCharacters),
|
||||
Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].MinRequiredPasswordLength,
|
||||
Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].MinRequiredNonAlphanumericCharacters),
|
||||
"", "", "", true, null, out status);
|
||||
|
||||
_returnUrl = string.Format("users/EditUser.aspx?id={0}", u.ProviderUserKey);
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.Security;
|
||||
using Umbraco.Core.Configuration;
|
||||
using umbraco.BusinessLogic;
|
||||
|
||||
namespace umbraco.presentation.umbraco.dashboard
|
||||
@@ -19,7 +20,7 @@ namespace umbraco.presentation.umbraco.dashboard
|
||||
protected void changePassword_Click(object sender, EventArgs e)
|
||||
{
|
||||
User u = User.GetCurrent();
|
||||
MembershipProvider provider = Membership.Providers[UmbracoSettings.DefaultBackofficeProvider];
|
||||
MembershipProvider provider = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider];
|
||||
MembershipUser user = provider.GetUser(u.LoginName, true);
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Web.SessionState;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using System.Web.Security;
|
||||
@@ -69,16 +70,16 @@ namespace umbraco.cms.presentation
|
||||
protected void Button1_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
// Authenticate users by using the provider specified in umbracoSettings.config
|
||||
if (Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].ValidateUser(lname.Text, passw.Text))
|
||||
if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].ValidateUser(lname.Text, passw.Text))
|
||||
{
|
||||
if (Membership.Providers[UmbracoSettings.DefaultBackofficeProvider] is ActiveDirectoryMembershipProvider)
|
||||
ActiveDirectoryMapping(lname.Text, Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].GetUser(lname.Text, false).Email);
|
||||
if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider] is ActiveDirectoryMembershipProvider)
|
||||
ActiveDirectoryMapping(lname.Text, Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].GetUser(lname.Text, false).Email);
|
||||
|
||||
BusinessLogic.User u = new User(lname.Text);
|
||||
doLogin(u);
|
||||
|
||||
// Check if the user should be redirected to live editing
|
||||
if (UmbracoSettings.EnableCanvasEditing && u.DefaultToLiveEditing)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing && u.DefaultToLiveEditing)
|
||||
{
|
||||
int startNode = u.StartNodeId;
|
||||
// If the startnode is -1 (access to all content), we'll redirect to the top root node
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Web.UI;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Xml;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.BusinessLogic;
|
||||
@@ -79,7 +80,7 @@ namespace umbraco.cms.presentation.user
|
||||
}
|
||||
|
||||
// check if canvas editing is enabled
|
||||
DefaultToLiveEditing.Visible = UmbracoSettings.EnableCanvasEditing;
|
||||
DefaultToLiveEditing.Visible = UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing;
|
||||
|
||||
// Populate usertype list
|
||||
foreach (UserType ut in UserType.getAll)
|
||||
@@ -156,7 +157,7 @@ namespace umbraco.cms.presentation.user
|
||||
|
||||
//Generel umrbaco access
|
||||
Pane ppAccess = new Pane();
|
||||
if (UmbracoSettings.EnableCanvasEditing)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing)
|
||||
{
|
||||
ppAccess.addProperty(ui.Text("user", "defaultToLiveEditing", base.getUser()), DefaultToLiveEditing);
|
||||
}
|
||||
@@ -311,7 +312,7 @@ namespace umbraco.cms.presentation.user
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
MembershipUser user = Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].GetUser(u.LoginName, true);
|
||||
MembershipUser user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].GetUser(u.LoginName, true);
|
||||
uname.Text = u.Name;
|
||||
lname.Text = (user == null) ? u.LoginName : user.UserName;
|
||||
email.Text = (user == null) ? u.Email : user.Email;
|
||||
@@ -376,7 +377,7 @@ namespace umbraco.cms.presentation.user
|
||||
{
|
||||
try
|
||||
{
|
||||
MembershipUser user = Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].GetUser(u.LoginName, true);
|
||||
MembershipUser user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].GetUser(u.LoginName, true);
|
||||
|
||||
|
||||
string tempPassword = ((controls.passwordChanger)passw.Controls[0]).Password;
|
||||
@@ -388,14 +389,14 @@ namespace umbraco.cms.presentation.user
|
||||
}
|
||||
|
||||
// Is it using the default membership provider
|
||||
if (Membership.Providers[UmbracoSettings.DefaultBackofficeProvider] is UsersMembershipProvider)
|
||||
if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider] is UsersMembershipProvider)
|
||||
{
|
||||
// Save user in membership provider
|
||||
UsersMembershipUser umbracoUser = user as UsersMembershipUser;
|
||||
umbracoUser.FullName = uname.Text.Trim();
|
||||
umbracoUser.Language = userLanguage.SelectedValue;
|
||||
umbracoUser.UserType = UserType.GetUserType(int.Parse(userType.SelectedValue));
|
||||
Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].UpdateUser(umbracoUser);
|
||||
Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].UpdateUser(umbracoUser);
|
||||
|
||||
// Save user details
|
||||
u.Email = email.Text.Trim();
|
||||
@@ -406,7 +407,7 @@ namespace umbraco.cms.presentation.user
|
||||
u.Name = uname.Text.Trim();
|
||||
u.Language = userLanguage.SelectedValue;
|
||||
u.UserType = UserType.GetUserType(int.Parse(userType.SelectedValue));
|
||||
if (!(Membership.Providers[UmbracoSettings.DefaultBackofficeProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].UpdateUser(user);
|
||||
if (!(Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider].UpdateUser(user);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.BusinessLogic;
|
||||
@@ -222,7 +223,7 @@ namespace umbraco.presentation.umbraco.webservices
|
||||
|
||||
if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
|
||||
{
|
||||
var mp = Membership.Providers[UmbracoSettings.DefaultBackofficeProvider];
|
||||
var mp = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.Users.DefaultBackOfficeProvider];
|
||||
if (mp != null && mp.ValidateUser(username, password))
|
||||
{
|
||||
var user = new User(username);
|
||||
|
||||
@@ -380,7 +380,7 @@ namespace umbraco.presentation.webservices
|
||||
SystemDirectories.Scripts);
|
||||
// validate extension
|
||||
IOHelper.ValidateFileExtension(IOHelper.MapPath(SystemDirectories.Scripts + "/" + filename),
|
||||
UmbracoSettings.ScriptFileTypes.Split(',').ToList());
|
||||
UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptEditor.ScriptFileTypes.ToList());
|
||||
|
||||
|
||||
var val = contents;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Web;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections;
|
||||
using Umbraco.Core.Configuration;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -26,7 +27,7 @@ namespace umbraco.presentation
|
||||
|
||||
void IHttpModule.Init(HttpApplication context)
|
||||
{
|
||||
if (UmbracoSettings.UseViewstateMoverModule)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.ViewstateMoverModule.Enable)
|
||||
{
|
||||
context.BeginRequest += new EventHandler(context_BeginRequest);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Dynamics;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.interfaces;
|
||||
@@ -483,8 +484,19 @@ namespace umbraco.MacroEngines
|
||||
//contextAlias is the node which the property data was returned from
|
||||
//Guid dataType = ContentType.GetDataType(data.ContextAlias, data.Alias);
|
||||
var dataType = GetDataType(propResult.ContextAlias, propResult.Alias);
|
||||
|
||||
var staticMapping = UmbracoSettings.RazorDataTypeModelStaticMapping
|
||||
|
||||
//now we need to map to the old object until we can clean all this nonsense up
|
||||
var configMapping = UmbracoConfiguration.Current.UmbracoSettings.Scripting.Razor.DataTypeModelStaticMappings
|
||||
.Select(x => new RazorDataTypeModelStaticMappingItem()
|
||||
{
|
||||
DataTypeGuid = x.DataTypeGuid,
|
||||
NodeTypeAlias = x.NodeTypeAlias,
|
||||
PropertyTypeAlias = x.PropertyTypeAlias,
|
||||
Raw = string.Empty,
|
||||
TypeName = x.MappingName
|
||||
}).ToList();
|
||||
|
||||
var staticMapping = configMapping
|
||||
.FirstOrDefault(mapping => mapping.Applies(dataType, propResult.ContextAlias, propResult.Alias));
|
||||
|
||||
if (staticMapping != null)
|
||||
@@ -800,8 +812,8 @@ namespace umbraco.MacroEngines
|
||||
//check that the document element is not one of the disallowed elements
|
||||
//allows RTE to still return as html if it's valid xhtml
|
||||
string documentElement = e.Name.LocalName;
|
||||
if (UmbracoSettings.NotDynamicXmlDocumentElements.Any(tag =>
|
||||
string.Equals(tag, documentElement, StringComparison.CurrentCultureIgnoreCase)) == false)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.Razor.NotDynamicXmlDocumentElements.Any(tag =>
|
||||
string.Equals(tag.Element, documentElement, StringComparison.CurrentCultureIgnoreCase)) == false)
|
||||
{
|
||||
result = new DynamicXml(e);
|
||||
return true;
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace umbraco
|
||||
[Obsolete("Use UmbracoConfiguration.Current.UmbracoSettings instead, it offers all settings in strongly typed formats. This class will be removed in future versions.")]
|
||||
public class UmbracoSettings
|
||||
{
|
||||
[Obsolete("This hasn't been used since 4.1!")]
|
||||
public const string TEMP_FRIENDLY_XML_CHILD_CONTAINER_NODENAME = ""; // "children";
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Runtime.CompilerServices;
|
||||
using System.Linq;
|
||||
using ICSharpCode.SharpZipLib.Zip;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.cms.businesslogic.propertytype;
|
||||
@@ -16,7 +17,6 @@ using umbraco.DataLayer;
|
||||
using System.Diagnostics;
|
||||
using umbraco.cms.businesslogic.macro;
|
||||
using umbraco.cms.businesslogic.template;
|
||||
using umbraco.IO;
|
||||
|
||||
namespace umbraco.cms.businesslogic.packager
|
||||
{
|
||||
@@ -35,6 +35,8 @@ namespace umbraco.cms.businesslogic.packager
|
||||
/// </remarks>
|
||||
public class Installer
|
||||
{
|
||||
private const string PackageServer = "packages.umbraco.org";
|
||||
|
||||
private string _name;
|
||||
private string _version;
|
||||
private string _url;
|
||||
@@ -918,7 +920,7 @@ namespace umbraco.cms.businesslogic.packager
|
||||
var wc = new System.Net.WebClient();
|
||||
|
||||
wc.DownloadFile(
|
||||
"http://" + UmbracoSettings.PackageServer + "/fetch?package=" + Package.ToString(),
|
||||
"http://" + PackageServer + "/fetch?package=" + Package.ToString(),
|
||||
IOHelper.MapPath(SystemDirectories.Packages + "/" + Package.ToString() + ".umb"));
|
||||
|
||||
return "packages\\" + Package.ToString() + ".umb";
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Net.Mail;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.cms.businesslogic.property;
|
||||
@@ -157,11 +158,11 @@ namespace umbraco.cms.businesslogic.workflow
|
||||
};
|
||||
|
||||
// create the mail message
|
||||
var mail = new MailMessage(UmbracoSettings.NotificationEmailSender, mailingUser.Email);
|
||||
var mail = new MailMessage(UmbracoConfiguration.Current.UmbracoSettings.Content.Notifications.EmailAddress, mailingUser.Email);
|
||||
|
||||
// populate the message
|
||||
mail.Subject = ui.Text("notifications", "mailSubject", subjectVars, mailingUser);
|
||||
if (UmbracoSettings.NotificationDisableHtmlEmail)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.Notifications.DisableHtmlEmail)
|
||||
{
|
||||
mail.IsBodyHtml = false;
|
||||
mail.Body = ui.Text("notifications", "mailBody", bodyVars, mailingUser);
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using Umbraco.Core.Configuration;
|
||||
|
||||
|
||||
namespace umbraco.cms.helpers
|
||||
@@ -39,7 +40,7 @@ namespace umbraco.cms.helpers
|
||||
tidy.Options.TidyMark = false;
|
||||
|
||||
// To avoid entity encoding
|
||||
tidy.Options.CharEncoding = (TidyNet.CharEncoding)Enum.Parse(typeof(TidyNet.CharEncoding), UmbracoSettings.TidyCharEncoding);
|
||||
tidy.Options.CharEncoding = (TidyNet.CharEncoding)Enum.Parse(typeof(TidyNet.CharEncoding), UmbracoConfiguration.Current.UmbracoSettings.Content.TidyCharEncoding);
|
||||
|
||||
|
||||
/* Declare the parameters that is needed */
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.Web.UI.HtmlControls;
|
||||
using ClientDependency.Core;
|
||||
using System.Linq;
|
||||
using ClientDependency.Core.Controls;
|
||||
using Umbraco.Core.Configuration;
|
||||
using umbraco.IO;
|
||||
|
||||
namespace umbraco.uicontrols
|
||||
@@ -57,7 +58,7 @@ namespace umbraco.uicontrols
|
||||
{
|
||||
get
|
||||
{
|
||||
return UmbracoSettings.ScriptDisableEditor == false;
|
||||
return UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptEditor.DisableScriptEditor == false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.BasePages;
|
||||
using umbraco.BusinessLogic;
|
||||
@@ -328,7 +329,7 @@ namespace umbraco.editorControls.tinyMCE3
|
||||
parsedString = replaceMacroTags(parsedString).Trim();
|
||||
|
||||
// tidy html - refactored, see #30534
|
||||
if (UmbracoSettings.TidyEditorContent)
|
||||
if (UmbracoConfiguration.Current.UmbracoSettings.Content.TidyEditorContent)
|
||||
{
|
||||
// always wrap in a <div> - using <p> was a bad idea
|
||||
parsedString = "<div>" + parsedString + "</div>";
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using umbraco.cms.businesslogic.Files;
|
||||
@@ -13,7 +14,7 @@ namespace umbraco.editorControls.tinymce
|
||||
{
|
||||
public static string cleanImages(string html)
|
||||
{
|
||||
var allowedAttributes = UmbracoSettings.ImageAllowedAttributes.ToLower().Split(',').ToList();
|
||||
var allowedAttributes = UmbracoConfiguration.Current.UmbracoSettings.Content.Imaging.AllowedAttributes.Select(x => x.ToLower()).ToList();
|
||||
|
||||
//Always add src as it's essential to output any image at all
|
||||
if (allowedAttributes.Contains("src") == false)
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
using umbraco.interfaces;
|
||||
using Umbraco.Core;
|
||||
@@ -88,8 +89,8 @@ namespace umbraco.editorControls
|
||||
|
||||
//now check the file type
|
||||
var extension = Path.GetExtension(postedFile.FileName).TrimStart(".");
|
||||
|
||||
return UmbracoSettings.DisallowedUploadFiles.Any(x => x.InvariantEquals(extension)) == false;
|
||||
|
||||
return UmbracoConfiguration.Current.UmbracoSettings.Content.DisallowedUploadFiles.Any(x => x.InvariantEquals(extension)) == false;
|
||||
}
|
||||
|
||||
public string Text
|
||||
|
||||
Reference in New Issue
Block a user