";
p.addProperty(txt);
foreach (cms.businesslogic.language.Language l in cms.businesslogic.language.Language.getAll)
@@ -92,7 +93,7 @@ namespace umbraco.settings
currentItem.setValue(int.Parse(t.ID),t.Text);
}
}
- ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "dictionaryItemSaved"), "");
+ ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "dictionaryItemSaved"), "");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs
index 73c11643a9..175eacbbab 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs
@@ -13,6 +13,7 @@ using umbraco.cms.presentation.Trees;
using Umbraco.Core;
using Umbraco.Web;
using Umbraco.Web.Trees;
+using Umbraco.Web.UI;
namespace umbraco.settings
{
@@ -20,7 +21,7 @@ namespace umbraco.settings
/// Summary description for editLanguage.
///
[WebformsPageTreeAuthorize(Constants.Trees.Languages)]
- public partial class editLanguage : BasePages.UmbracoEnsuredPage
+ public partial class editLanguage : Umbraco.Web.UI.Pages.UmbracoEnsuredPage
{
public editLanguage()
{
@@ -38,7 +39,7 @@ namespace umbraco.settings
// Put user code to initialize the page here
Panel1.Text = ui.Text("editlanguage");
- pp_language.Text = ui.Text("language", "displayName", base.getUser());
+ pp_language.Text = ui.Text("language", "displayName", Security.CurrentUser);
if (!IsPostBack)
{
updateCultureList();
@@ -75,7 +76,7 @@ namespace umbraco.settings
currentLanguage.Save();
updateCultureList();
- ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "languageSaved"), "");
+ ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "languageSaved"), "");
}
#region Web Form Designer generated code
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs
index d8b56c94b3..a4692f57e4 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs
@@ -6,7 +6,6 @@ using System.Web.UI.WebControls;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
-using umbraco.BasePages;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.template;
@@ -14,6 +13,7 @@ using umbraco.cms.presentation.Trees;
using umbraco.DataLayer;
using umbraco.uicontrols;
using System.Linq;
+using Umbraco.Web.UI.Pages;
namespace umbraco.cms.presentation.settings
{
@@ -112,7 +112,7 @@ namespace umbraco.cms.presentation.settings
// Editing buttons
MenuIconI umbField = editorSource.Menu.NewIcon();
- umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif";
+ umbField.ImageURL = SystemDirectories.Umbraco + "/images/editor/insField.gif";
umbField.OnClickCommand =
ClientTools.Scripts.OpenModalWindow(
IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" +
@@ -135,7 +135,7 @@ namespace umbraco.cms.presentation.settings
if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages)
{
MenuIconI umbContainer = editorSource.Menu.NewIcon();
- umbContainer.ImageURL = UmbracoPath + "/images/editor/masterpagePlaceHolder.gif";
+ umbContainer.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpagePlaceHolder.gif";
umbContainer.AltText = ui.Text("template", "insertContentAreaPlaceHolder");
umbContainer.OnClickCommand =
ClientTools.Scripts.OpenModalWindow(
@@ -144,7 +144,7 @@ namespace umbraco.cms.presentation.settings
ui.Text("template", "insertContentAreaPlaceHolder"), 470, 320);
MenuIconI umbContent = editorSource.Menu.NewIcon();
- umbContent.ImageURL = UmbracoPath + "/images/editor/masterpageContent.gif";
+ umbContent.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpageContent.gif";
umbContent.AltText = ui.Text("template", "insertContentArea");
umbContent.OnClickCommand =
ClientTools.Scripts.OpenModalWindow(
@@ -165,7 +165,7 @@ namespace umbraco.cms.presentation.settings
ClientTools.Scripts.OpenModalWindow(
IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=" +
_template.Alias, ui.Text("template", "quickGuide"), 600, 580);
- helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png";
+ helpIcon.ImageURL = SystemDirectories.Umbraco + "/images/editor/help.png";
helpIcon.AltText = ui.Text("template", "quickGuide");
}
@@ -198,19 +198,17 @@ namespace umbraco.cms.presentation.settings
private void LoadMacros()
{
- IRecordsReader macroRenderings =
- SqlHelper.ExecuteReader("select id, macroAlias, macroName from cmsMacro order by macroName");
+ var macroRenderings =
+ DatabaseContext.Database.Fetch("select id, macroAlias, macroName from cmsMacro order by macroName");
rpt_macros.DataSource = macroRenderings;
rpt_macros.DataBind();
-
- macroRenderings.Close();
}
public string DoesMacroHaveSettings(string macroId)
{
if (
- SqlHelper.ExecuteScalar(string.Format("select 1 from cmsMacroProperty where macro = {0}", macroId)) ==
+ DatabaseContext.Database.ExecuteScalar(string.Format("select 1 from cmsMacroProperty where macro = {0}", macroId)) ==
1)
return "1";
else
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/modals/ShowUmbracoTags.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/modals/ShowUmbracoTags.aspx.cs
index d69e97d939..0938a1a377 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/modals/ShowUmbracoTags.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/modals/ShowUmbracoTags.aspx.cs
@@ -16,7 +16,7 @@ namespace umbraco.cms.presentation.settings.modal
///
/// Summary description for ShowUmbracoTags.
///
- public partial class ShowUmbracoTags : BasePages.UmbracoEnsuredPage
+ public partial class ShowUmbracoTags : Umbraco.Web.UI.Pages.UmbracoEnsuredPage
{
public ShowUmbracoTags()
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx.cs
index 12f9eee317..4432223561 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx.cs
@@ -19,7 +19,7 @@ using umbraco.uicontrols;
namespace umbraco.cms.presentation.settings.scripts
{
- public partial class editScript : BasePages.UmbracoEnsuredPage
+ public partial class editScript : Umbraco.Web.UI.Pages.UmbracoEnsuredPage
{
public editScript()
{
@@ -67,9 +67,9 @@ namespace umbraco.cms.presentation.settings.scripts
// name derives from filename, clean for xss
NameTxt.Text = filename.CleanForXss('\\', '/');
- Panel1.Text = ui.Text("editscript", base.getUser());
- pp_name.Text = ui.Text("name", base.getUser());
- pp_path.Text = ui.Text("path", base.getUser());
+ Panel1.Text = ui.Text("editscript", Security.CurrentUser);
+ pp_name.Text = ui.Text("name", Security.CurrentUser);
+ pp_path.Text = ui.Text("path", Security.CurrentUser);
if (IsPostBack == false)
{
@@ -110,27 +110,27 @@ namespace umbraco.cms.presentation.settings.scripts
// Editing buttons
Panel1.Menu.InsertSplitter();
uicontrols.MenuIconI umbField = Panel1.Menu.NewIcon();
- umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif";
- umbField.OnClickCommand = BasePages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDATA", ui.Text("template", "insertPageField"), 640, 550);
+ umbField.ImageURL = SystemDirectories.Umbraco + "/images/editor/insField.gif";
+ umbField.OnClickCommand = Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDATA", ui.Text("template", "insertPageField"), 640, 550);
umbField.AltText = ui.Text("template", "insertPageField");
// TODO: Update icon
uicontrols.MenuIconI umbDictionary = Panel1.Menu.NewIcon();
umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif";
- umbDictionary.OnClickCommand = BasePages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", ui.Text("template", "insertDictionaryItem"), 640, 550);
+ umbDictionary.OnClickCommand = Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", ui.Text("template", "insertDictionaryItem"), 640, 550);
umbDictionary.AltText = "Insert umbraco dictionary item";
uicontrols.MenuIconI umbMacro = Panel1.Menu.NewIcon();
- umbMacro.ImageURL = UmbracoPath + "/images/editor/insMacro.gif";
+ umbMacro.ImageURL = SystemDirectories.Umbraco + "/images/editor/insMacro.gif";
umbMacro.AltText = ui.Text("template", "insertMacro");
- umbMacro.OnClickCommand = BasePages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/editMacro.aspx?objectId=" + editorSource.ClientID, ui.Text("template", "insertMacro"), 470, 530);
+ umbMacro.OnClickCommand = Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/editMacro.aspx?objectId=" + editorSource.ClientID, ui.Text("template", "insertMacro"), 470, 530);
// Help
Panel1.Menu.InsertSplitter();
uicontrols.MenuIconI helpIcon = Panel1.Menu.NewIcon();
- helpIcon.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=", ui.Text("template", "quickGuide"), 600, 580);
- helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png";
+ helpIcon.OnClickCommand = Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenModalWindow(Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=", ui.Text("template", "quickGuide"), 600, 580);
+ helpIcon.ImageURL = SystemDirectories.Umbraco + "/images/editor/help.png";
helpIcon.AltText = ui.Text("template", "quickGuide");
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs
index 4cb321ae0a..dcc2409e61 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs
@@ -4,12 +4,12 @@ using System.Linq;
using System.Web.UI;
using Umbraco.Core.IO;
using Umbraco.Web;
-using umbraco.BasePages;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.web;
using umbraco.cms.presentation.Trees;
using umbraco.uicontrols;
using Umbraco.Core;
+using Umbraco.Web.UI.Pages;
namespace umbraco.cms.presentation.settings.stylesheet
{
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs
index 6836376837..a44ddf466f 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs
@@ -15,13 +15,14 @@ using Umbraco.Core;
using Umbraco.Web;
using umbraco.cms.presentation.Trees;
using Umbraco.Core;
+using Umbraco.Web.UI;
namespace umbraco.cms.presentation.settings.stylesheet
{
///
/// Summary description for EditStyleSheetProperty.
///
- public partial class EditStyleSheetProperty : BasePages.UmbracoEnsuredPage
+ public partial class EditStyleSheetProperty : Umbraco.Web.UI.Pages.UmbracoEnsuredPage
{
public EditStyleSheetProperty()
{
@@ -97,7 +98,7 @@ namespace umbraco.cms.presentation.settings.stylesheet
Services.FileService.SaveStylesheet(_sheet);
- ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editStylesheetPropertySaved", UmbracoUser), "");
+ ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "editStylesheetPropertySaved", UmbracoUser), "");
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs
index 6d0465f693..fa76f9aa17 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs
@@ -5,7 +5,8 @@ using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Umbraco.Core.Models;
-using umbraco.BusinessLogic.Actions;
+using Umbraco.Web;
+using Umbraco.Web.LegacyActions;
namespace umbraco.presentation.templateControls
{
@@ -302,8 +303,8 @@ namespace umbraco.presentation.templateControls
///
/// true if the current item is editable by the current user; otherwise, false.
protected virtual bool FieldEditableWithUserPermissions()
- {
- BusinessLogic.User u = helper.GetCurrentUmbracoUser();
+ {
+ BusinessLogic.User u = UmbracoContext.Current.UmbracoUser;
return u != null && u.GetPermissions(PageElements["path"].ToString()).Contains(ActionUpdate.Instance.Letter.ToString());
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs
index 5c86c3a4da..ad9cc6bed3 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs
@@ -6,6 +6,7 @@ using System.Web.UI.WebControls;
using System.Collections;
using umbraco.cms.businesslogic.macro;
using System.Web;
+using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Web;
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs
index 9dff5305b4..62e2a91593 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs
@@ -1,29 +1,14 @@
using System;
using System.Data;
-using System.Globalization;
using System.IO;
using System.Text;
using System.Xml;
using Umbraco.Core;
-using Umbraco.Core.Configuration;
-using Umbraco.Core.Models.EntityBase;
-using Umbraco.Web;
-using umbraco.BasePages;
-using umbraco.BusinessLogic;
-using umbraco.BusinessLogic.Actions;
-using umbraco.cms.businesslogic.propertytype;
using umbraco.cms.businesslogic.task;
-using umbraco.cms.businesslogic.translation;
//using umbraco.cms.businesslogic.utilities;
-using umbraco.cms.businesslogic.web;
-
-using ICSharpCode.SharpZipLib.BZip2;
-using ICSharpCode.SharpZipLib.Zip;
-using ICSharpCode.SharpZipLib.Zip.Compression;
-using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
-using ICSharpCode.SharpZipLib.GZip;
using Umbraco.Core.IO;
using System.Collections.Generic;
+using Umbraco.Web.UI.Pages;
namespace umbraco.presentation.translation
{
@@ -54,13 +39,13 @@ namespace umbraco.presentation.translation
Tasks ts = new Tasks();
if (Request["mode"] == "owned")
{
- ts = Task.GetOwnedTasks(base.getUser(), false);
+ ts = Task.GetOwnedTasks(UmbracoContext.UmbracoUser, false);
pane_tasks.Text = ui.Text("translation", "ownedTasks");
Panel2.Text = ui.Text("translation", "ownedTasks");
}
else
{
- ts = Task.GetTasks(base.getUser(), false);
+ ts = Task.GetTasks(UmbracoContext.UmbracoUser, false);
pane_tasks.Text = ui.Text("translation", "assignedTasks");
Panel2.Text = ui.Text("translation", "assignedTasks");
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs
index ee3df0cc43..ff27556053 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs
@@ -1,28 +1,12 @@
using System;
using System.Data;
-using System.IO;
-using System.Text;
-using System.Xml;
-using System.Web;
-using System.Web.UI;
using System.Web.UI.WebControls;
-
-using umbraco.BasePages;
-using umbraco.BusinessLogic;
-using umbraco.cms.businesslogic.propertytype;
using umbraco.cms.businesslogic.task;
-using umbraco.cms.businesslogic.translation;
using umbraco.cms.businesslogic.web;
-
-using ICSharpCode.SharpZipLib.BZip2;
-using ICSharpCode.SharpZipLib.Zip;
-using ICSharpCode.SharpZipLib.Zip.Compression;
-using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
-using ICSharpCode.SharpZipLib.GZip;
using Umbraco.Core;
namespace umbraco.presentation.umbraco.translation {
- public partial class details : BasePages.UmbracoEnsuredPage {
+ public partial class details : Umbraco.Web.UI.Pages.UmbracoEnsuredPage {
public details()
{
@@ -33,7 +17,7 @@ namespace umbraco.presentation.umbraco.translation {
int translationId = int.Parse(Request["id"]);
Task t = new Task(translationId);
- if (t != null && (t.ParentUser.Id == base.getUser().Id || t.User.Id == base.getUser().Id)) {
+ if (t != null && (t.ParentUser.Id == Security.CurrentUser.Id || t.User.Id == Security.CurrentUser.Id)) {
t.Closed = true;
t.Save();
Response.Redirect("default.aspx");
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs
index 25808f1814..457e2eb5f9 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs
@@ -17,7 +17,7 @@ using Umbraco.Web;
namespace umbraco.presentation.translation
{
- public partial class preview : BasePages.UmbracoEnsuredPage
+ public partial class preview : Umbraco.Web.UI.Pages.UmbracoEnsuredPage
{
public string originalUrl = "";
public string translatedUrl = "";
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs
index 5ebdd61861..d59c634006 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs
@@ -20,7 +20,7 @@ using Umbraco.Core.IO;
namespace umbraco.presentation.translation
{
- public partial class xml : BasePages.UmbracoEnsuredPage
+ public partial class xml : Umbraco.Web.UI.Pages.UmbracoEnsuredPage
{
private readonly XmlDocument _xd = new XmlDocument();
@@ -39,7 +39,7 @@ namespace umbraco.presentation.translation
if (int.TryParse(Request["id"], out pageId))
{
var t = new Task(pageId);
- if (t.User.Id == base.getUser().Id || t.ParentUser.Id == base.getUser().Id)
+ if (t.User.Id == Security.CurrentUser.Id || t.ParentUser.Id == Security.CurrentUser.Id)
{
XmlNode x = CreateTaskNode(t, _xd);
root.AppendChild(x);
@@ -54,7 +54,7 @@ namespace umbraco.presentation.translation
var nodes = new SortedList();
int totalWords = 0;
- foreach (Task t in Task.GetTasks(base.getUser(), false))
+ foreach (Task t in Task.GetTasks(UmbracoContext.UmbracoUser, false))
{
if (!nodes.ContainsKey(t.Node.Path))
{
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/tree.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/tree.aspx.cs
deleted file mode 100644
index 9a620dbba6..0000000000
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/tree.aspx.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Web;
-using System.Web.SessionState;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using System.Web.UI.HtmlControls;
-using System.Xml;
-
-using System.Reflection;
-using umbraco.DataLayer;
-using umbraco.cms.presentation.Trees;
-using umbraco.BusinessLogic.Utils;
-using umbraco.interfaces;
-using umbraco.BusinessLogic;
-
-using System.Collections.Generic;
-
-namespace umbraco.cms.presentation
-{
-
- ///
- /// This still outputs the xml format of the tree in case developers are using it.
- ///
- [Obsolete("this is no longer used for the client side tree")]
- public partial class tree : umbraco.BasePages.UmbracoEnsuredPage
- {
-
- private XmlTree m_xTree = new XmlTree();
- TreeRequestParams m_treeParams = TreeRequestParams.FromQueryStrings();
-
- ///
- /// This checks to see which request parameters have been set for the Tree xml service
- /// to run. If there is no Tree Type specified, then this will return the xml structure
- /// of the initial tree nodes for all trees required for the current application. Otherwise
- /// this will return thre required tree xml based on the request parameters specified.
- ///
- ///
- ///
- protected void Page_Load(object sender, System.EventArgs e)
- {
-
- if (string.IsNullOrEmpty(m_treeParams.TreeType))
- if (!string.IsNullOrEmpty(m_treeParams.Application))
- LoadAppTrees(m_treeParams.Application);
- else
- LoadNullTree();
- else
- LoadTree(m_treeParams.TreeType);
-
- Response.Write(m_xTree.ToString(SerializedTreeType.XmlTree));
- }
-
- ///
- /// If the application supports multiple trees, then this function iterates over all of the trees assigned to it
- /// and creates their top level nodes and context menus.
- ///
- ///
- private void LoadAppTrees(string appAlias)
- {
- //find all tree definitions that have the current application alias
- List treeDefs = TreeDefinitionCollection.Instance.FindActiveTrees(appAlias);
-
- foreach (TreeDefinition treeDef in treeDefs)
- {
- BaseTree bTree = treeDef.CreateInstance();
- bTree.SetTreeParameters(m_treeParams);
- m_xTree.Add(bTree.RootNode);
- }
- }
-
- ///
- /// This will load the particular ITree object and call it's render method to get the nodes that need to be rendered.
- ///
- ///
- ///
- private void LoadTree(string treeAlias)
- {
-
- TreeDefinition treeDef = TreeDefinitionCollection.Instance.FindTree(treeAlias);
-
- if (treeDef != null)
- {
- BaseTree bTree = treeDef.CreateInstance();
- bTree.SetTreeParameters(m_treeParams);
- bTree.Render(ref m_xTree);
- }
- else
- LoadNullTree();
- }
-
- ///
- /// Load an empty tree structure to show the end user that there was a problem loading the tree.
- ///
- private void LoadNullTree()
- {
- BaseTree nullTree = new NullTree(m_treeParams.Application);
- nullTree.SetTreeParameters(m_treeParams);
- nullTree.Render(ref m_xTree);
- }
-
- #region Web Form Designer generated code
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN: This call is required by the ASP.NET Web Form Designer.
- //
- InitializeComponent();
- base.OnInit(e);
- }
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
-
- }
- #endregion
- }
-
-
-}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/treeInit.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/treeInit.aspx.cs
deleted file mode 100644
index a8921f2394..0000000000
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/treeInit.aspx.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-using System;
-using System.Data;
-using System.Reflection;
-using System.Text;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using umbraco.BasePages;
-using umbraco.cms.businesslogic;
-using umbraco.interfaces;
-using umbraco.DataLayer;
-using umbraco.cms.presentation.Trees;
-using System.Collections.Generic;
-using System.Web;
-using umbraco.BusinessLogic.Actions;
-using System.Web.Services;
-using Umbraco.Web.UI.JavaScript;
-
-namespace umbraco.cms.presentation
-{
- [Obsolete("This class is no longer used and will be removed in future versions. The page that supercedes this is Umbraco.Web.UI.Umbraco.TreeInit")]
- public partial class TreeInit : UmbracoEnsuredPage
- {
-
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- TreeParams = TreeRequestParams.FromQueryStrings().CreateTreeService();
- DataBind();
- }
-
- protected TreeService TreeParams { get; private set; }
-
- ///
- /// Head1 control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlHead Head1;
-
- ///
- /// ClientLoader control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected UmbracoClientDependencyLoader ClientLoader;
-
- ///
- /// CssInclude1 control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::ClientDependency.Core.Controls.CssInclude CssInclude1;
-
- ///
- /// form1 control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
- ///
- /// ScriptManager1 control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.ScriptManager ScriptManager1;
-
- ///
- /// JTree control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::umbraco.controls.Tree.TreeControl JTree;
- }
-}
\ No newline at end of file
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs
index c0e20cd99a..481e0705cd 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs
@@ -1,29 +1,24 @@
using System;
-using System.Collections;
using System.Configuration.Provider;
using System.Globalization;
-using System.IO;
using System.Web;
using System.Web.Security;
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.Web;
using Umbraco.Web.Security;
-using umbraco.BasePages;
using umbraco.BusinessLogic;
-using umbraco.cms.businesslogic.web;
using umbraco.controls;
using umbraco.uicontrols;
using umbraco.cms.presentation.Trees;
using Umbraco.Core.IO;
using Umbraco.Core;
using Umbraco.Core.Models;
-using Umbraco.Core.Services;
-using PropertyType = umbraco.cms.businesslogic.propertytype.PropertyType;
+using Umbraco.Web.UI;
+using Umbraco.Web.UI.Pages;
namespace umbraco.cms.presentation.user
{
@@ -78,13 +73,13 @@ namespace umbraco.cms.presentation.user
u = BusinessLogic.User.GetUser(UID);
//the true admin can only edit the true admin
- if (u.Id == 0 && CurrentUser.Id != 0)
+ if (u.Id == 0 && Security.CurrentUser.Id != 0)
{
throw new Exception("Only the root user can edit the 'root' user (id:0)");
}
//only another admin can edit another admin (who is not the true admin)
- if (u.IsAdmin() && CurrentUser.IsAdmin() == false)
+ if (u.IsAdmin() && UmbracoContext.UmbracoUser.IsAdmin() == false)
{
throw new Exception("Admin users can only be edited by admins");
}
@@ -92,7 +87,7 @@ namespace umbraco.cms.presentation.user
// Populate usertype list
foreach (UserType ut in UserType.getAll)
{
- if (CurrentUser.IsAdmin() || ut.Alias != "admin")
+ if (UmbracoContext.UmbracoUser.IsAdmin() || ut.Alias != "admin")
{
ListItem li = new ListItem(ui.Text("user", ut.Name.ToLower(), UmbracoUser), ut.Id.ToString());
if (ut.Id == u.UserType.Id)
@@ -245,13 +240,13 @@ namespace umbraco.cms.presentation.user
// get the current users applications
string currentUserApps = ";";
- foreach (Application a in CurrentUser.Applications)
- currentUserApps += a.alias + ";";
+ foreach (var a in Security.CurrentUser.AllowedSections)
+ currentUserApps += a + ";";
Application[] uapps = u.Applications;
foreach (Application app in BusinessLogic.Application.getAll())
{
- if (CurrentUser.IsAdmin() || currentUserApps.Contains(";" + app.alias + ";"))
+ if (UmbracoContext.UmbracoUser.IsAdmin() || currentUserApps.Contains(";" + app.alias + ";"))
{
ListItem li = new ListItem(ui.Text("sections", app.alias), app.alias);
if (!IsPostBack) foreach (Application tmp in uapps) if (app.alias == tmp.alias) li.Selected = true;
@@ -386,17 +381,17 @@ namespace umbraco.cms.presentation.user
u.Save();
- ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editUserSaved", UmbracoUser), "");
+ ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "editUserSaved", UmbracoUser), "");
}
catch (Exception ex)
{
- ClientTools.ShowSpeechBubble(speechBubbleIcon.error, ui.Text("speechBubbles", "editUserError", UmbracoUser), "");
+ ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, ui.Text("speechBubbles", "editUserError", UmbracoUser), "");
LogHelper.Error("Exception", ex);
}
}
else
{
- ClientTools.ShowSpeechBubble(speechBubbleIcon.error, ui.Text("speechBubbles", "editUserError", UmbracoUser), "");
+ ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, ui.Text("speechBubbles", "editUserError", UmbracoUser), "");
}
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs
index 8b90630f48..3bb71b88cb 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs
@@ -1,22 +1,13 @@
using System;
-using System.Data;
-using System.Configuration;
-using System.Collections;
-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.BasePages;
using System.Collections.Generic;
using umbraco.interfaces;
-using umbraco.BusinessLogic.Actions;
using umbraco.BusinessLogic;
-using umbraco.uicontrols;
using umbraco.cms.presentation.Trees;
using Umbraco.Core;
-using Umbraco.Core.IO;
+using Umbraco.Web.UI;
+using Umbraco.Web.UI.Pages;
+using Action = Umbraco.Web.LegacyActions.Action;
namespace umbraco.cms.presentation.user
{
@@ -28,7 +19,7 @@ namespace umbraco.cms.presentation.user
}
protected void Page_Load(object sender, EventArgs e)
{
- pnlUmbraco.Text = umbraco.ui.Text("usertype", base.getUser());
+ pnlUmbraco.Text = umbraco.ui.Text("usertype", Security.CurrentUser);
var save = pnlUmbraco.Menu.NewButton();
save.Click += save_Click;
@@ -36,10 +27,10 @@ namespace umbraco.cms.presentation.user
save.ToolTip = ui.Text("save");
save.Text = ui.Text("save");
- pp_alias.Text = umbraco.ui.Text("usertype", base.getUser()) + " " + umbraco.ui.Text("alias", base.getUser());
- pp_name.Text = umbraco.ui.Text("usertype", base.getUser()) + " " + umbraco.ui.Text("name", base.getUser());
+ pp_alias.Text = umbraco.ui.Text("usertype", Security.CurrentUser) + " " + umbraco.ui.Text("alias", Security.CurrentUser);
+ pp_name.Text = umbraco.ui.Text("usertype", Security.CurrentUser) + " " + umbraco.ui.Text("name", Security.CurrentUser);
- pp_rights.Text = umbraco.ui.Text("default", base.getUser()) + " " + umbraco.ui.Text("rights", base.getUser());
+ pp_rights.Text = umbraco.ui.Text("default", Security.CurrentUser) + " " + umbraco.ui.Text("rights", Security.CurrentUser);
//ensure we have a query string
if (string.IsNullOrEmpty(Request.QueryString["id"]))
@@ -73,7 +64,7 @@ namespace umbraco.cms.presentation.user
userType.DefaultPermissions = actions;
userType.Save();
- ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editUserTypeSaved", base.getUser()), "");
+ ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "editUserTypeSaved", Security.CurrentUser), "");
}
protected List CurrentUserTypeActions
@@ -81,7 +72,7 @@ namespace umbraco.cms.presentation.user
get
{
if (m_userTypeActions == null)
- m_userTypeActions = umbraco.BusinessLogic.Actions.Action.FromString(CurrentUserType.DefaultPermissions);
+ m_userTypeActions = Action.FromString(CurrentUserType.DefaultPermissions);
return m_userTypeActions;
}
}
@@ -105,9 +96,9 @@ namespace umbraco.cms.presentation.user
txtUserTypeName.Text = CurrentUserType.Name;
hidUserTypeID.Value = CurrentUserType.Id.ToString();
- foreach (IAction ai in global::umbraco.BusinessLogic.Actions.Action.GetPermissionAssignable()) {
+ foreach (IAction ai in Action.GetPermissionAssignable()) {
- ListItem li = new ListItem(umbraco.ui.Text(ai.Alias, base.getUser()), ai.Letter.ToString());
+ ListItem li = new ListItem(umbraco.ui.Text(ai.Alias, Security.CurrentUser), ai.Letter.ToString());
if(CurrentUserTypeActions.Contains(ai))
li.Selected = true;
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs
index 26a601a9ac..68ca5f1440 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs
@@ -1,19 +1,10 @@
using System;
-using System.Data;
-using System.Configuration;
-using System.Collections;
-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.BusinessLogic.Actions;
using System.Collections.Generic;
using umbraco.interfaces;
-using System.Drawing;
using umbraco.BusinessLogic;
-using umbraco.BasePages;
+using Umbraco.Web;
+using Umbraco.Web.LegacyActions;
+using Action = Umbraco.Web.LegacyActions.Action;
namespace umbraco.cms.presentation.user
{
@@ -78,7 +69,7 @@ namespace umbraco.cms.presentation.user
throw new ArgumentNullException("No User specified");
//get the logged in user's permissions
- UserPermissions currUserPermissions = new UserPermissions(UmbracoEnsuredPage.CurrentUser);
+ UserPermissions currUserPermissions = new UserPermissions(UmbracoContext.Current.UmbracoUser);
//lookup permissions for last node selected
int selectedNodeId = m_nodeID[m_nodeID.Length - 1];
@@ -86,7 +77,7 @@ namespace umbraco.cms.presentation.user
List lstCurrUserActions = currUserPermissions.GetExistingNodePermission(selectedNodeId);
List lstLookupUserActions = m_userPermissions.GetExistingNodePermission(selectedNodeId);
- List lstAllActions = umbraco.BusinessLogic.Actions.Action.GetPermissionAssignable();
+ List lstAllActions = Action.GetPermissionAssignable();
//no node is selected, disable the check boxes
if (m_nodeID[0] == -1)
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs
index 27157f38d6..b4e49308f5 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs
@@ -1,25 +1,10 @@
using System;
-using System.Data;
-using System.Configuration;
-using System.Collections;
-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 System.Xml;
-using System.IO;
using Umbraco.Core;
-using umbraco;
using umbraco.BusinessLogic;
-using System.Collections.Generic;
-using umbraco.BasePages;
-using umbraco.BusinessLogic.Actions;
-using umbraco.interfaces;
using umbraco.cms.presentation.Trees;
-using System.Xml.XPath;
using Umbraco.Core.IO;
+using Umbraco.Web.UI.Pages;
namespace umbraco.cms.presentation.user
{
@@ -74,7 +59,7 @@ namespace umbraco.cms.presentation.user
///
/// Since Umbraco stores users in cache, we'll use this method to retrieve our user object by the selected id
///
- public override User UmbracoUser
+ public User UmbracoUser
{
get
{
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionsHandler.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionsHandler.asmx.cs
index 7813e7e5cb..00371aa8bd 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionsHandler.asmx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionsHandler.asmx.cs
@@ -1,20 +1,14 @@
-using System;
-using System.Data;
using System.Web;
-using System.Collections;
using System.Web.Services;
-using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Script.Services;
using System.Web.UI;
using System.IO;
-using System.Reflection;
-using System.Web.UI.HtmlControls;
-using umbraco.BasePages;
using System.Collections.Generic;
using umbraco.interfaces;
-using umbraco.BusinessLogic.Actions;
using Umbraco.Core.IO;
+using Umbraco.Web.LegacyActions;
+using Umbraco.Web.WebServices;
namespace umbraco.cms.presentation.user
{
@@ -25,7 +19,7 @@ namespace umbraco.cms.presentation.user
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
[ScriptService]
- public class PermissionsHandler : System.Web.Services.WebService
+ public class PermissionsHandler : UmbracoAuthorizedWebService
{
///
@@ -37,7 +31,7 @@ namespace umbraco.cms.presentation.user
[WebMethod]
public string GetNodePermissions(int userID, string nodes)
{
- Authorize();
+ AuthorizeRequest(true);
Page page = new Page();
@@ -60,21 +54,15 @@ namespace umbraco.cms.presentation.user
[WebMethod]
public string SaveNodePermissions(int userID, string nodes, string permissions, bool replaceChild)
{
- Authorize();
+ AuthorizeRequest(true);
UserPermissions uPermissions = new UserPermissions(BusinessLogic.User.GetUser(userID));
- List actions = umbraco.BusinessLogic.Actions.Action.FromString(permissions);
+ List actions = Action.FromString(permissions);
uPermissions.SaveNewPermissions(toIntArray(nodes), actions, replaceChild);
return GetNodePermissions(userID, nodes);
}
-
- private void Authorize()
- {
- if (!BasePage.ValidateUserContextID(BasePage.umbracoUserContextID))
- throw new Exception("Client authorization failed. User is not logged in");
-
- }
+
private int[] toIntArray(string nodeIds) {
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs
index 33818d43df..1b6350d80c 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs
@@ -1,25 +1,11 @@
-using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Xml;
-using System.IO;
-using System.Collections;
-using System.Web.UI.WebControls;
-using System.Data.SqlClient;
-using System.Data;
using Umbraco.Core;
using Umbraco.Web;
-using Umbraco.Web.Security;
-using umbraco;
using umbraco.BusinessLogic;
-using System.Web;
-using umbraco.BusinessLogic.Actions;
-using umbraco.DataLayer;
-using umbraco.cms.businesslogic;
using umbraco.interfaces;
-using umbraco.BasePages;
using umbraco.cms.businesslogic.web;
+using Umbraco.Web.LegacyActions;
namespace umbraco.cms.presentation.user
{
@@ -51,7 +37,7 @@ namespace umbraco.cms.presentation.user
foreach (var nodeId in nodeIDs)
{
var nodeActions = UmbracoContext.Current.UmbracoUser.GetPermissions(GetNodePath(nodeId));
- var lstActions = BusinessLogic.Actions.Action.FromString(nodeActions);
+ var lstActions = Action.FromString(nodeActions);
if (lstActions == null || !lstActions.Contains(ActionRights.Instance))
lstNoPermissions.Add(nodeId);
}
@@ -105,7 +91,7 @@ namespace umbraco.cms.presentation.user
{
//get the user and their permissions
string permissions = _user.GetPermissions(path);
- return umbraco.BusinessLogic.Actions.Action.FromString(permissions);
+ return Action.FromString(permissions);
}
return null;
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CheckForUpgrade.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CheckForUpgrade.asmx.cs
index 909b89b96b..eb9ce84a6c 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CheckForUpgrade.asmx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CheckForUpgrade.asmx.cs
@@ -40,12 +40,12 @@ namespace umbraco.presentation.webservices
{
bool isUpgrade = false;
// if it's an upgrade, you'll need to be logged in before we allow this call
- if (!String.IsNullOrEmpty(global::Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus))
+ if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus) == false)
{
isUpgrade = true;
try
{
- legacyAjaxCalls.Authorize();
+ AuthorizeRequest(true);
}
catch (Exception)
{
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeClientService.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeClientService.asmx.cs
index 8f71d235c0..e231627002 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeClientService.asmx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeClientService.asmx.cs
@@ -92,12 +92,6 @@ namespace umbraco.presentation.webservices
return returnVal;
}
- [Obsolete("Use the AuthorizeRequest methods on the base class UmbracoAuthorizedWebService instead")]
- public static void Authorize()
- {
- if (!BasePages.BasePage.ValidateUserContextID(BasePages.BasePage.umbracoUserContextID))
- throw new Exception("Client authorization failed. User is not logged in");
- }
}
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeDataService.ashx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeDataService.ashx.cs
index d4de749989..f283ab7f0e 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeDataService.ashx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeDataService.ashx.cs
@@ -40,15 +40,7 @@ namespace umbraco.presentation.webservices
return false;
}
}
-
- [Obsolete("Use the base class AuthorizeRequest methods in UmbracoAuthorizedHttpHandler")]
- public static void Authorize()
- {
- if (!BasePages.BasePage.ValidateUserContextID(BasePages.BasePage.umbracoUserContextID))
- throw new Exception("Client authorization failed. User is not logged in");
-
- }
-
+
///
/// Returns the an XmlTree based on the current http request
///
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs
index 3b20ac1fdf..ac681391f4 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs
@@ -126,7 +126,7 @@ namespace umbraco.presentation.webservices
{
//errorMessage = ui.Text("developer", "xsltErrorNoNodesPublished");
File.Delete(tempFileName);
- //base.speechBubble(speechBubbleIcon.info, ui.Text("errors", "xsltErrorHeader", base.getUser()), "Unable to validate xslt as no published content nodes exist.");
+ //base.speechBubble(speechBubbleIcon.info, ui.Text("errors", "xsltErrorHeader", Security.CurrentUser), "Unable to validate xslt as no published content nodes exist.");
}
}
catch (Exception errorXslt)
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs
index e4e292e53f..aa7a0c0fef 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs
@@ -8,7 +8,6 @@ using System.Xml.Xsl;
using System.IO;
using System.Text.RegularExpressions;
using System.Net;
-using System.Security;
using System.Web.UI;
using Umbraco.Core;
using Umbraco.Core.IO;
@@ -19,7 +18,6 @@ using Umbraco.Web.WebServices;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.web;
using umbraco.cms.businesslogic.media;
-using umbraco.BasePages;
namespace umbraco.presentation.webservices
@@ -34,19 +32,7 @@ namespace umbraco.presentation.webservices
public class legacyAjaxCalls : UmbracoAuthorizedWebService
{
private User _currentUser;
-
- [WebMethod]
- public bool ValidateUser(string username, string password)
- {
- if (ValidateCredentials(username, password))
- {
- var u = new BusinessLogic.User(username);
- BasePage.doLogin(u);
- return true;
- }
- return false;
- }
-
+
///
/// method to accept a string value for the node id. Used for tree's such as python
/// and xslt since the file names are the node IDs
@@ -182,34 +168,7 @@ namespace umbraco.presentation.webservices
return Application[Context.Request.GetItemAsString("key")].ToString();
}
-
- [Obsolete("This is no longer used and will be removed in future versions")]
- [WebMethod]
- [ScriptMethod]
- public void RenewUmbracoSession()
- {
- AuthorizeRequest(true);
-
- BasePage.RenewLoginTimeout();
-
- }
-
- [Obsolete("This is no longer used and will be removed in future versions")]
- [WebMethod]
- [ScriptMethod]
- public int GetSecondsBeforeUserLogout()
- {
- //TODO: Change this to not throw an exception otherwise we end up with JS errors all the time when recompiling!!
-
- AuthorizeRequest(true);
- var timeout = BasePage.GetTimeout(true);
- var timeoutDate = new DateTime(timeout);
- var currentDate = DateTime.Now;
-
- return (int) timeoutDate.Subtract(currentDate).TotalSeconds;
-
- }
-
+
[WebMethod]
[ScriptMethod]
public string TemplateMasterPageContentContainer(int templateId, int masterTemplateId)
@@ -448,16 +407,5 @@ namespace umbraco.presentation.webservices
return retVal;
}
- [Obsolete("You should use the AuthorizeRequest methods on the base class of UmbracoAuthorizedWebService and ensure you inherit from that class for umbraco asmx web services")]
- public static void Authorize()
- {
- // check for secure connection
- if (GlobalSettings.UseSSL && !HttpContext.Current.Request.IsSecureConnection)
- throw new SecurityException("This installation requires a secure connection (via SSL). Please update the URL to include https://");
-
- if (!BasePage.ValidateUserContextID(BasePages.BasePage.umbracoUserContextID))
- throw new Exception("Client authorization failed. User is not logged in");
-
- }
}
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs
index eb73d78b5b..aacd162f47 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs
@@ -1,23 +1,15 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
-using System.Globalization;
using System.Linq;
using System.Web.Script.Services;
using System.Web.Services;
-using System.Xml;
using Umbraco.Core;
-using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
-using Umbraco.Core.Models.EntityBase;
using Umbraco.Web;
+using Umbraco.Web.LegacyActions;
using Umbraco.Web.WebServices;
-using umbraco.BasePages;
-using umbraco.BusinessLogic;
-using umbraco.BusinessLogic.Actions;
-using umbraco.cms.businesslogic.web;
namespace umbraco.presentation.webservices
{
@@ -33,7 +25,7 @@ namespace umbraco.presentation.webservices
[WebMethod]
public SortNode GetNodes(string ParentId, string App)
{
- if (BasePage.ValidateUserContextID(BasePage.umbracoUserContextID))
+ if (AuthorizeRequest())
{
var nodes = new List();
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs
index 85b8f383f6..baa692ef34 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs
@@ -3,8 +3,6 @@ using System.Web.Script.Services;
using System.Web.Services;
using System.ComponentModel;
using Umbraco.Web.WebServices;
-using umbraco.BasePages;
-using umbraco.BusinessLogic;
using umbraco.cms.businesslogic;
using Umbraco.Core;
diff --git a/src/UmbracoExamine/BaseUmbracoIndexer.cs b/src/UmbracoExamine/BaseUmbracoIndexer.cs
index ee77f5d05c..ca0d3063d0 100644
--- a/src/UmbracoExamine/BaseUmbracoIndexer.cs
+++ b/src/UmbracoExamine/BaseUmbracoIndexer.cs
@@ -1,20 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Net;
-using System.Security;
using System.Text;
-using System.Threading;
-using System.Web;
using Examine.LuceneEngine.Config;
using Examine.LuceneEngine.Providers;
using Examine.Providers;
using Lucene.Net.Analysis;
-using Lucene.Net.Documents;
using Lucene.Net.Index;
using Umbraco.Core;
-using umbraco.BasePages;
-using umbraco.BusinessLogic;
using UmbracoExamine.DataServices;
using Examine;
using System.IO;
diff --git a/src/UmbracoExamine/UmbracoContentIndexer.cs b/src/UmbracoExamine/UmbracoContentIndexer.cs
index 5f168f3237..86f8487a56 100644
--- a/src/UmbracoExamine/UmbracoContentIndexer.cs
+++ b/src/UmbracoExamine/UmbracoContentIndexer.cs
@@ -1,33 +1,20 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
-using System.IO;
using System.Linq;
-using System.Security;
-using System.Text;
-using System.Web;
using System.Xml.Linq;
using Examine;
-using Examine.Config;
-using Examine.Providers;
using Lucene.Net.Documents;
-using Lucene.Net.Index;
using Umbraco.Core;
-using umbraco.cms.businesslogic;
using Umbraco.Core.Models;
-using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using UmbracoExamine.DataServices;
using Examine.LuceneEngine;
using Examine.LuceneEngine.Config;
using UmbracoExamine.Config;
-using Examine.LuceneEngine.Providers;
using Lucene.Net.Analysis;
-using umbraco.BasePages;
using IContentService = Umbraco.Core.Services.IContentService;
-using UmbracoExamine.LocalStorage;
using IMediaService = Umbraco.Core.Services.IMediaService;
diff --git a/src/umbraco.businesslogic/BasePages/BasePage.cs b/src/umbraco.businesslogic/BasePages/BasePage.cs
deleted file mode 100644
index d78bc7d2dd..0000000000
--- a/src/umbraco.businesslogic/BasePages/BasePage.cs
+++ /dev/null
@@ -1,411 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Web;
-using System.Linq;
-using System.Web.Mvc;
-using System.Web.Routing;
-using System.Web.Security;
-using System.Web.UI;
-using Umbraco.Core;
-using Umbraco.Core.Configuration;
-using Umbraco.Core.IO;
-using Umbraco.Core.Cache;
-using Umbraco.Core.Logging;
-using Umbraco.Core.Services;
-using umbraco.BusinessLogic;
-using umbraco.DataLayer;
-using Umbraco.Core;
-using Umbraco.Core.Security;
-
-namespace umbraco.BasePages
-{
- ///
- /// umbraco.BasePages.BasePage is the default page type for the umbraco backend.
- /// The basepage keeps track of the current user and the page context. But does not
- /// Restrict access to the page itself.
- /// The keep the page secure, the umbracoEnsuredPage class should be used instead
- ///
- [Obsolete("This class has been superceded by Umbraco.Web.UI.Pages.BasePage")]
- public class BasePage : System.Web.UI.Page
- {
- private User _user;
- private bool _userisValidated = false;
- private ClientTools _clientTools;
-
- ///
- /// The path to the umbraco root folder
- ///
- protected string UmbracoPath = SystemDirectories.Umbraco;
-
- ///
- /// The current user ID
- ///
- protected int uid = 0;
-
- ///
- /// The page timeout in seconds.
- ///
- protected long timeout = 0;
-
- ///
- /// Gets the SQL helper.
- ///
- /// The SQL helper.
- protected static ISqlHelper SqlHelper
- {
- get { return BusinessLogic.Application.SqlHelper; }
- }
-
- ///
- /// Returns the current ApplicationContext
- ///
- public ApplicationContext ApplicationContext
- {
- get { return ApplicationContext.Current; }
- }
-
- ///
- /// Returns a ServiceContext
- ///
- public ServiceContext Services
- {
- get { return ApplicationContext.Services; }
- }
-
- ///
- /// Returns a DatabaseContext
- ///
- public DatabaseContext DatabaseContext
- {
- get { return ApplicationContext.DatabaseContext; }
- }
-
- ///
- /// Returns the current BasePage for the current request.
- /// This assumes that the current page is a BasePage, otherwise, returns null;
- ///
- [Obsolete("Should use the Umbraco.Web.UmbracoContext.Current singleton instead to access common methods and properties")]
- public static BasePage Current
- {
- get
- {
- var page = HttpContext.Current.CurrentHandler as BasePage;
- if (page != null) return page;
- //the current handler is not BasePage but people might be expecting this to be the case if they
- // are using this singleton accesor... which is legacy code now and shouldn't be used. When people
- // start using Umbraco.Web.UI.Pages.BasePage then this will not be the case! So, we'll just return a
- // new instance of BasePage as a hack to make it work.
- if (HttpContext.Current.Items["umbraco.BasePages.BasePage"] == null)
- {
- HttpContext.Current.Items["umbraco.BasePages.BasePage"] = new BasePage();
- }
- return (BasePage)HttpContext.Current.Items["umbraco.BasePages.BasePage"];
- }
- }
-
- private UrlHelper _url;
- ///
- /// Returns a UrlHelper
- ///
- ///
- /// This URL helper is created without any route data and an empty request context
- ///
- public UrlHelper Url
- {
- get { return _url ?? (_url = new UrlHelper(new RequestContext(new HttpContextWrapper(Context), new RouteData()))); }
- }
-
- ///
- /// Returns a refernce of an instance of ClientTools for access to the pages client API
- ///
- public ClientTools ClientTools
- {
- get
- {
- if (_clientTools == null)
- _clientTools = new ClientTools(this);
- return _clientTools;
- }
- }
-
- [Obsolete("Use ClientTools instead")]
- public void RefreshPage(int Seconds)
- {
- ClientTools.RefreshAdmin(Seconds);
- }
-
- //NOTE: This is basically replicated in WebSecurity because this class exists in a poorly placed assembly. - also why it is obsolete.
- private void ValidateUser()
- {
- var ticket = Context.GetUmbracoAuthTicket();
-
- if (ticket != null)
- {
- if (ticket.Expired == false)
- {
- _user = BusinessLogic.User.GetUser(GetUserId(""));
-
- // Check for console access
- if (_user.Disabled || (_user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(Context)))
- {
- throw new ArgumentException("You have no priviledges to the umbraco console. Please contact your administrator");
- }
- _userisValidated = true;
- UpdateLogin();
- }
- else
- {
- throw new ArgumentException("User has timed out!!");
- }
- }
- else
- {
- throw new InvalidOperationException("The user has no umbraco contextid - try logging in");
- }
- }
-
- ///
- /// Gets the user id.
- ///
- /// This is not used
- ///
- [Obsolete("This method is no longer used, use the GetUserId() method without parameters instead")]
- public static int GetUserId(string umbracoUserContextID)
- {
- return GetUserId();
- }
-
- ///
- /// Gets the currnet user's id.
- ///
- ///
- public static int GetUserId()
- {
- var identity = HttpContext.Current.GetCurrentIdentity(
- //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS!
- // Without this check, anything that is using this legacy API, like ui.Text will
- // automatically log the back office user in even if it is a front-end request (if there is
- // a back office user logged in. This can cause problems becaues the identity is changing mid
- // request. For example: http://issues.umbraco.org/issue/U4-4010
- HttpContext.Current.CurrentHandler is Page);
-
- if (identity == null)
- return -1;
- return Convert.ToInt32(identity.Id);
- }
-
- // Added by NH to use with webservices authentications
- ///
- /// Validates the user context ID.
- ///
- /// This doesn't do anything
- ///
- [Obsolete("This method is no longer used, use the ValidateCurrentUser() method instead")]
- public static bool ValidateUserContextID(string currentUmbracoUserContextID)
- {
- return ValidateCurrentUser();
- }
-
- ///
- /// Validates the currently logged in user and ensures they are not timed out
- ///
- ///
- public static bool ValidateCurrentUser()
- {
- var identity = HttpContext.Current.GetCurrentIdentity(
- //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS!
- // Without this check, anything that is using this legacy API, like ui.Text will
- // automatically log the back office user in even if it is a front-end request (if there is
- // a back office user logged in. This can cause problems becaues the identity is changing mid
- // request. For example: http://issues.umbraco.org/issue/U4-4010
- HttpContext.Current.CurrentHandler is Page);
-
- if (identity != null)
- {
- return true;
- }
- return false;
- }
-
- //[Obsolete("Use Umbraco.Web.Security.WebSecurity.GetTimeout instead")]
- public static long GetTimeout(bool bypassCache)
- {
- var ticket = HttpContext.Current.GetUmbracoAuthTicket();
- if (ticket.Expired) return 0;
- var ticks = ticket.Expiration.Ticks - DateTime.Now.Ticks;
- return ticks;
- }
-
- // Changed to public by NH to help with webservice authentication
- ///
- /// Gets or sets the umbraco user context ID.
- ///
- /// The umbraco user context ID.
- [Obsolete("Returns the current user's unique umbraco sesion id - this cannot be set and isn't intended to be used in your code")]
- public static string umbracoUserContextID
- {
- get
- {
- var identity = HttpContext.Current.GetCurrentIdentity(
- //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS!
- // Without this check, anything that is using this legacy API, like ui.Text will
- // automatically log the back office user in even if it is a front-end request (if there is
- // a back office user logged in. This can cause problems becaues the identity is changing mid
- // request. For example: http://issues.umbraco.org/issue/U4-4010
- HttpContext.Current.CurrentHandler is Page);
-
- return identity == null ? "" : identity.SessionId;
- }
- set
- {
- }
- }
-
-
- ///
- /// Clears the login.
- ///
- public void ClearLogin()
- {
- Context.UmbracoLogout();
- }
-
- private void UpdateLogin()
- {
- Context.RenewUmbracoAuthTicket();
- }
-
- public static void RenewLoginTimeout()
- {
- HttpContext.Current.RenewUmbracoAuthTicket();
- }
-
- ///
- /// Logs a user in.
- ///
- /// The user
- public static void doLogin(User u)
- {
- HttpContext.Current.CreateUmbracoAuthTicket(new UserData(Guid.NewGuid().ToString("N"))
- {
- Id = u.Id,
- AllowedApplications = u.GetApplications().Select(x => x.alias).ToArray(),
- RealName = u.Name,
- //currently we only have one user type!
- Roles = new[] { u.UserType.Alias },
- StartContentNode = u.StartNodeId,
- StartMediaNode = u.StartMediaId,
- Username = u.LoginName,
- Culture = ui.Culture(u)
-
- });
- LogHelper.Info("User {0} (Id: {1}) logged in", () => u.Name, () => u.Id);
- }
-
-
- ///
- /// Gets the user.
- ///
- ///
- [Obsolete("Use UmbracoUser property instead.")]
- public User getUser()
- {
- return UmbracoUser;
- }
-
- ///
- /// Gets the user.
- ///
- ///
- public virtual User UmbracoUser
- {
- get
- {
- if (!_userisValidated) ValidateUser();
- return _user;
- }
- }
-
- ///
- /// Ensures the page context.
- ///
- public void ensureContext()
- {
- ValidateUser();
- }
-
- [Obsolete("Use ClientTools instead")]
- public void speechBubble(speechBubbleIcon i, string header, string body)
- {
- ClientTools.ShowSpeechBubble(i, header, body);
- }
-
- //[Obsolete("Use ClientTools instead")]
- //public void reloadParentNode()
- //{
- // ClientTools.ReloadParentNode(true);
- //}
-
- ///
- /// a collection of available speechbubble icons
- ///
- [Obsolete("This has been superceded by Umbraco.Web.UI.SpeechBubbleIcon but that requires the use of the Umbraco.Web.UI.Pages.BasePage or Umbraco.Web.UI.Pages.EnsuredPage objects")]
- public enum speechBubbleIcon
- {
- ///
- /// Save icon
- ///
- save,
- ///
- /// Info icon
- ///
- info,
- ///
- /// Error icon
- ///
- error,
- ///
- /// Success icon
- ///
- success,
- ///
- /// Warning icon
- ///
- warning
- }
-
- protected override void OnInit(EventArgs e)
- {
- base.OnInit(e);
-
- //This must be set on each page to mitigate CSRF attacks which ensures that this unique token
- // is added to the viewstate of each request
- if (umbracoUserContextID.IsNullOrWhiteSpace() == false)
- {
- ViewStateUserKey = umbracoUserContextID;
- }
- }
-
- ///
- /// Raises the event.
- ///
- /// The object that contains the event data.
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
-
- if (!Request.IsSecureConnection && GlobalSettings.UseSSL)
- {
- string serverName = HttpUtility.UrlEncode(Request.ServerVariables["SERVER_NAME"]);
- Response.Redirect(string.Format("https://{0}{1}", serverName, Request.FilePath));
- }
- }
-
- ///
- /// Override client target.
- ///
- [Obsolete("This is no longer supported")]
- public bool OverrideClientTarget = false;
- }
-}
diff --git a/src/umbraco.businesslogic/BasePages/ClientTools.cs b/src/umbraco.businesslogic/BasePages/ClientTools.cs
deleted file mode 100644
index 0f5aab184b..0000000000
--- a/src/umbraco.businesslogic/BasePages/ClientTools.cs
+++ /dev/null
@@ -1,351 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using umbraco.BasePages;
-using System.Web.UI;
-using Umbraco.Core.IO;
-using umbraco.BusinessLogic;
-
-namespace umbraco.BasePages
-{
-
- ///
- /// Renders the client side code necessary to interact with the Umbraco client side API.
- /// Each method returns an instance of this class so you can chain calls together.
- ///
- [Obsolete("This class has been superceded by Umbraco.Web.UI.Pages.ClientTools but requires the use of Umbraco.Web.UI.Pages.BasePage")]
- public sealed class ClientTools
- {
-
- public ClientTools(Page page)
- {
- m_page = page;
- }
-
- ///
- /// Returns the string markup for the JavaScript that is rendered.
- /// If referencing JavaScript scripts in the backend, this class should be used
- /// in case future changes to the client code is change, this will remain intact.
- ///
- public static class Scripts
- {
- internal const string ClientMgrScript = "UmbClientMgr";
- public static string GetAppActions { get { return string.Format("{0}.appActions()", ClientMgrScript); } }
- public static string GetMainWindow { get { return string.Format("{0}.mainWindow()", ClientMgrScript); } }
- public static string GetMainTree { get { return string.Format("{0}.mainTree()", ClientMgrScript); } }
- public static string GetContentFrame() { return string.Format("{0}.contentFrame()", ClientMgrScript); }
- public static string ShiftApp(string appAlias)
- {
- return string.Format(ClientMgrScript + ".historyManager().addHistory('{0}')", appAlias);
- }
- public static string OpenDashboard(string app)
- {
- return string.Format(GetAppActions + ".openDashboard('{0}');", app);
- }
- public static string RefreshAdmin { get { return "setTimeout('" + GetMainWindow + ".location.reload()', {0});"; } }
- public static string ShowSpeechBubble { get { return GetMainWindow + ".UmbSpeechBubble.ShowMessage('{0}','{1}', '{2}');"; } }
- public static string ChangeContentFrameUrl(string url) {
- return string.Format(ClientMgrScript + ".contentFrame('{0}');", url);
- }
- public static string ReloadContentFrameUrlIfPathLoaded(string url) {
- return string.Format(ClientMgrScript + ".reloadContentFrameUrlIfPathLoaded('{0}');", url);
- }
-
- public static string ChildNodeCreated = GetMainTree + ".childNodeCreated();";
- public static string SyncTree { get { return GetMainTree + ".syncTree('{0}', {1});"; } }
- public static string ClearTreeCache { get { return GetMainTree + ".clearTreeCache();"; } }
- public static string CopyNode { get { return GetMainTree + ".copyNode('{0}', '{1}');"; } }
- public static string MoveNode { get { return GetMainTree + ".moveNode('{0}', '{1}');"; } }
- public static string ReloadActionNode { get { return GetMainTree + ".reloadActionNode({0}, {1}, null);"; } }
- public static string SetActiveTreeType { get { return GetMainTree + ".setActiveTreeType('{0}');"; } }
- public static string RefreshTree { get { return GetMainTree + ".refreshTree();"; } }
- public static string RefreshTreeType { get { return GetMainTree + ".refreshTree('{0}');"; } }
- public static string CloseModalWindow()
- {
- return string.Format("{0}.closeModalWindow();", ClientMgrScript);
- }
- public static string CloseModalWindow(string rVal)
- {
- return string.Format("{0}.closeModalWindow('{1}');", ClientMgrScript, rVal);
- }
- public static string OpenModalWindow(string url, string name, int width, int height)
- {
- return OpenModalWindow(url, name, true, width, height, 0, 0, "", "");
- }
- public static string OpenModalWindow(string url, string name, bool showHeader, int width, int height, int top, int leftOffset, string closeTriggers, string onCloseCallback)
- {
- return string.Format("{0}.openModalWindow('{1}', '{2}', {3}, {4}, {5}, {6}, {7}, '{8}', '{9}');",
- new object[] { ClientMgrScript, url, name, showHeader.ToString().ToLower(), width, height, top, leftOffset, closeTriggers, onCloseCallback });
- }
- }
-
- private Page m_page;
-
- ///
- /// This removes all tree JSON data cached in the client browser.
- /// Useful when you want to ensure that the tree is reloaded from live data.
- ///
- ///
- public ClientTools ClearClientTreeCache()
- {
- RegisterClientScript(Scripts.ClearTreeCache);
- return this;
- }
-
- ///
- /// Change applications
- ///
- ///
- public ClientTools ShiftApp(string appAlias)
- {
- RegisterClientScript(Scripts.ShiftApp(appAlias));
- return this;
- }
-
- ///
- /// Refresh the entire administration console after a specified amount of time.
- ///
- ///
- ///
- public ClientTools RefreshAdmin(int seconds)
- {
- RegisterClientScript(string.Format(Scripts.RefreshAdmin, seconds * 1000));
- return this;
- }
-
- ///
- /// Refreshes the entire current tree
- ///
- ///
- public ClientTools RefreshTree()
- {
- RegisterClientScript(Scripts.RefreshTree);
- return this;
- }
-
- public ClientTools RefreshTree(string treeType)
- {
- RegisterClientScript(string.Format(Scripts.RefreshTreeType, treeType));
- return this;
- }
-
- ///
- /// A reference to the umbraco UI component "speechbubble". The speechbubble appears in the lower right corner of the screen, notifying users of events
- ///
- /// The speechbubble icon.
- /// The speechbubble header.
- /// The body text
- public ClientTools ShowSpeechBubble(BasePage.speechBubbleIcon i, string header, string body)
- {
- RegisterClientScript(string.Format(Scripts.ShowSpeechBubble, i.ToString(), header.Replace("'", "\\'"), body.Replace("'", "\\'")));
- return this;
- }
-
- ///
- /// Changes the content in the content frame to the specified URL
- ///
- ///
- public ClientTools ChangeContentFrameUrl(string url)
- {
- //don't load if there is no url
- if (string.IsNullOrEmpty(url)) return this;
-
- url = EnsureUmbracoUrl(url);
-
- if (url.Trim().StartsWith("~"))
- url = IOHelper.ResolveUrl(url);
-
- RegisterClientScript(Scripts.ChangeContentFrameUrl(url));
-
- return this;
- }
-
- ///
- /// Reloads the content in the content frame if the specified URL is currently loaded
- ///
- ///
- public ClientTools ReloadContentFrameUrlIfPathLoaded(string url)
- {
- if (string.IsNullOrEmpty(url)) return this;
-
- url = EnsureUmbracoUrl(url);
-
- RegisterClientScript(Scripts.ReloadContentFrameUrlIfPathLoaded(url));
-
- return this;
- }
-
- private string EnsureUmbracoUrl(string url)
- {
- if (url.StartsWith("/") && !url.StartsWith(IOHelper.ResolveUrl(SystemDirectories.Umbraco)))
- {
- url = IOHelper.ResolveUrl(SystemDirectories.Umbraco) + url;
- }
- return url;
- }
-
- ///
- /// Shows the dashboard for the given application
- ///
- ///
- ///
- public ClientTools ShowDashboard(string app)
- {
- return ChangeContentFrameUrl(SystemDirectories.Umbraco + string.Format("/dashboard.aspx?app={0}", app));
- }
-
- ///
- /// Reloads the children of the current action node and selects the node that didn't exist there before.
- /// If the client side system cannot determine which node is new, then no node is selected.
- ///
- ///
- /// This is used by many create dialogs, however the sync method should be used based on the full path of the
- /// node but because the current Umbraco implementation of ITask only returns a url to load, there's no way
- /// to determine what the full path of the new child is.
- ///
- ///
- public ClientTools ChildNodeCreated()
- {
- //RegisterClientScript(Scripts.ChildNodeCreated);
- return this;
- }
-
- ///
- /// Synchronizes the tree to the path specified.
- ///
- ///
- ///
- /// If set to true, will ensure that the node to be synced has it's data
- /// reloaded from the server. Otherwise, if the node already exists, the tree will simply sync to the node
- /// that is already there.
- ///
- ///
- /// This will work for any tree, however you would need to know the path of the node. Currently, media and content
- /// are the only trees that store a path, however, if you were working in the template tree for example, a path to a
- /// node could be "init,1090" and this method would still work.
- ///
- /// Sync tree will works by syncing the active tree type. This can be specified explicitly by calling SetActiveTreeType.
- /// This will allow developers to sync many trees in one application at one time if needed.
- ///
- ///
- ///
- ///
- public ClientTools SyncTree(string path, bool forceReload)
- {
- RegisterClientScript(string.Format(Scripts.SyncTree, path, forceReload.ToString().ToLower()));
- return this;
- }
-
- public ClientTools CopyNode(string currNodeId, string newParentPath)
- {
- RegisterClientScript(string.Format(Scripts.CopyNode, currNodeId, newParentPath));
- return this;
- }
-
- public ClientTools MoveNode(string currNodeId, string newParentPath)
- {
- RegisterClientScript(string.Format(Scripts.MoveNode, currNodeId, newParentPath));
- return this;
- }
-
- ///
- /// Reloads only the last node that the user interacted with via the context menu. To reload a specify node, use SyncTree.
- ///
- ///
- ///
- ///
- /// If for whatever reason the client side system cannot just refresh the one node, the system will use jsTree's built in
- /// refresh tool, this however won't allow for reselect or reloadChildren. Most trees will work with the single node
- /// refresh but 3rd party tools may have poorly built tree data models.
- ///
- public ClientTools ReloadActionNode(bool reselect, bool reloadChildren)
- {
- RegisterClientScript(string.Format(Scripts.ReloadActionNode, (!reselect).ToString().ToLower(), (!reloadChildren).ToString().ToLower()));
- return this;
- }
-
- ///
- /// When the application searches for a node, it searches for nodes in specific tree types.
- /// If SyncTree is used, it will sync the tree nodes with the active tree type, therefore if
- /// a developer wants to sync a specific tree, they can call this method to set the type to sync.
- ///
- ///
- /// Each branch of a particular tree should theoretically be the same type, however, developers can
- /// override the type of each branch in their BaseTree's but this is not standard practice. If there
- /// are multiple types of branches in one tree, then only those branches that have the Active tree type
- /// will be searched for syncing.
- ///
- ///
- ///
- public ClientTools SetActiveTreeType(string treeType)
- {
- RegisterClientScript(string.Format(Scripts.SetActiveTreeType, treeType));
- return this;
- }
-
- ///
- /// Closes the Umbraco dialog window if it is open
- ///
- /// specify a value to return to add to the onCloseCallback method if one was specified in the OpenModalWindow method
- ///
- public ClientTools CloseModalWindow(string returnVal)
- {
- RegisterClientScript(Scripts.CloseModalWindow(returnVal));
- return this;
- }
- ///
- /// Closes the umbraco dialog window if it is open
- ///
- ///
- public ClientTools CloseModalWindow()
- {
- return CloseModalWindow("");
- }
-
-
- ///
- /// Opens a modal window
- ///
- ///
- ///
- ///
- ///
- ///
- public ClientTools OpenModalWindow(string url, string name, bool showHeader, int width, int height, int top, int leftOffset, string closeTriggers, string onCloseCallback)
- {
- RegisterClientScript(Scripts.OpenModalWindow(url, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback));
- return this;
- }
-
- ///
- /// This will use the ScriptManager to register the script if one is available, otherwise will default to the ClientScript
- /// class of the page.
- ///
- ///
- private void RegisterClientScript(string script)
- {
- //use the hash code of the script to generate the key, this way, the exact same script won't be
- //inserted more than once.
- if (ScriptManager.GetCurrent(m_page) != null)
- {
- ScriptManager.RegisterStartupScript(m_page, m_page.GetType(), script.GetHashCode().ToString(), script, true);
- }
- else
- {
- m_page.ClientScript.RegisterStartupScript(m_page.GetType(), script.GetHashCode().ToString(), script, true);
- }
- }
-
-
-
-
- }
-}
diff --git a/src/umbraco.businesslogic/BasePages/DialogPage.cs b/src/umbraco.businesslogic/BasePages/DialogPage.cs
deleted file mode 100644
index 8c7e5c5d87..0000000000
--- a/src/umbraco.businesslogic/BasePages/DialogPage.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace umbraco.BasePages
-{
- ///
- /// Summary description for DialogPage.
- ///
- public class DialogPage
- {
- public DialogPage()
- {
- //
- // TODO: Add constructor logic here
- //
- }
- }
-}
diff --git a/src/umbraco.businesslogic/BasePages/UmbracoEnsuredPage.cs b/src/umbraco.businesslogic/BasePages/UmbracoEnsuredPage.cs
deleted file mode 100644
index f7bf1f7a28..0000000000
--- a/src/umbraco.businesslogic/BasePages/UmbracoEnsuredPage.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-using System;
-using Umbraco.Core.Logging;
-using System.Linq;
-using System.Security;
-using System.Web;
-using Umbraco.Core;
-using Umbraco.Core.IO;
-using umbraco.BusinessLogic;
-using Umbraco.Core.Security;
-
-namespace umbraco.BasePages
-{
- ///
- /// UmbracoEnsuredPage is the standard protected page in the umbraco backend, and forces authentication.
- ///
- [Obsolete("This class has been superceded by Umbraco.Web.UI.Pages.UmbracoEnsuredPage")]
- public class UmbracoEnsuredPage : BasePage
- {
- ///
- /// Checks if the page exists outside of the /umbraco route, in which case the request will not have been authenticated for the back office
- /// so we'll force authentication.
- ///
- ///
- protected override void OnPreInit(EventArgs e)
- {
- base.OnPreInit(e);
-
- //If this is not a back office request, then the module won't have authenticated it, in this case we
- // need to do the auth manually and since this is an UmbracoEnsuredPage, this is the anticipated behavior
- // TODO: When we implement Identity, this process might not work anymore, will be an interesting challenge
- if (Context.Request.Url.IsBackOfficeRequest(HttpRuntime.AppDomainAppVirtualPath) == false)
- {
- var http = new HttpContextWrapper(Context);
- var ticket = http.GetUmbracoAuthTicket();
- http.AuthenticateCurrentRequest(ticket, true);
- }
- }
-
- ///
- /// Gets/sets the app for which this page belongs to so that we can validate the current user's security against it
- ///
- ///
- /// If no app is specified then all logged in users will have access to the page
- ///
- public string CurrentApp { get; set; }
-
- ///
- /// Initializes a new instance of the class.
- ///
- public UmbracoEnsuredPage()
- {
- //Assign security automatically if the attribute is found
- var treeAuth = this.GetType().GetCustomAttribute(true);
- if (treeAuth != null)
- {
- var treeByAlias = ApplicationContext.Current.Services.ApplicationTreeService
- .GetByAlias(treeAuth.TreeAlias);
- if (treeByAlias != null)
- {
- CurrentApp = treeByAlias.ApplicationAlias;
- }
- }
- }
-
- ///
- /// If true then umbraco will force any window/frame to reload umbraco in the main window
- ///
- public bool RedirectToUmbraco { get; set; }
-
- ///
- /// Validates the user for access to a certain application
- ///
- /// The application alias.
- ///
- public bool ValidateUserApp(string app)
- {
- return getUser().Applications.Any(uApp => uApp.alias.InvariantEquals(app));
- }
-
- ///
- /// Validates the user node tree permissions.
- ///
- /// The path.
- /// The action.
- ///
- public bool ValidateUserNodeTreePermissions(string Path, string Action)
- {
- string permissions = getUser().GetPermissions(Path);
- if (permissions.IndexOf(Action) > -1 && (Path.Contains("-20") || ("," + Path + ",").Contains("," + getUser().StartNodeId.ToString() + ",")))
- return true;
-
- var user = getUser();
- LogHelper.Info("User {0} has insufficient permissions in UmbracoEnsuredPage: '{1}', '{2}', '{3}'", () => user.Name, () => Path, () => permissions, () => Action);
- return false;
- }
-
- ///
- /// Gets the current user.
- ///
- /// The current user.
- public static User CurrentUser
- {
- get
- {
- return BusinessLogic.User.GetCurrent();
- }
- }
-
- ///
- /// Raises the event to initialize the page.
- ///
- /// An that contains the event data.
- protected override void OnInit(EventArgs e)
- {
- base.OnInit(e);
- try
- {
- ensureContext();
-
- if (!string.IsNullOrEmpty(CurrentApp))
- {
- if (!ValidateUserApp(CurrentApp))
- throw new SecurityException(string.Format("The current user doesn't have access to the section/app '{0}'", CurrentApp));
- }
- }
- catch (SecurityException ex)
- {
- LogHelper.Warn(string.Format("{0} tried to access '{1}'", CurrentUser.Id, CurrentApp));
- throw;
- }
- catch
- {
- // Clear content as .NET transfers rendered content.
- Response.Clear();
-
- // Some umbraco pages should not be loaded on timeout, but instead reload the main application in the top window. Like the treeview for instance
- if (RedirectToUmbraco)
- Response.Redirect(SystemDirectories.Umbraco + "/logout.aspx?t=" + umbracoUserContextID, true);
- else
- Response.Redirect(SystemDirectories.Umbraco + "/logout.aspx?redir=" + Server.UrlEncode(Request.RawUrl) + "&t=" + umbracoUserContextID, true);
- }
- }
-
- ///
- /// Used to assign a webforms page's security to a specific tree which will in turn check to see
- /// if the current user has access to the specified tree's registered section
- ///
- [AttributeUsage(AttributeTargets.Class)]
- public sealed class WebformsPageTreeAuthorizeAttribute : Attribute
- {
- public string TreeAlias { get; private set; }
-
- public WebformsPageTreeAuthorizeAttribute(string treeAlias)
- {
- TreeAlias = treeAlias;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/umbraco.businesslogic/GlobalSettings.cs b/src/umbraco.businesslogic/GlobalSettings.cs
deleted file mode 100644
index 3d3721f783..0000000000
--- a/src/umbraco.businesslogic/GlobalSettings.cs
+++ /dev/null
@@ -1,492 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Web;
-using System.Web.Hosting;
-using System.Web.Configuration;
-using System.Xml;
-using Umbraco.Core;
-using Umbraco.Core.Configuration;
-using umbraco.BusinessLogic;
-using umbraco.DataLayer;
-using Umbraco.Core.IO;
-
-namespace umbraco
-{
- ///
- /// The GlobalSettings Class contains general settings information for the entire Umbraco instance based on information from web.config appsettings
- ///
- public class GlobalSettings
- {
-
- ///
- /// Gets the reserved urls from web.config.
- ///
- /// The reserved urls.
- public static string ReservedUrls
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.ReservedUrls; }
- }
-
- ///
- /// Gets the reserved paths from web.config
- ///
- /// The reserved paths.
- public static string ReservedPaths
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.ReservedPaths; }
- }
-
- ///
- /// Gets the name of the content XML file.
- ///
- /// The content XML.
- public static string ContentXML
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.ContentXmlFile; }
- }
-
- ///
- /// Gets the path to the storage directory (/data by default).
- ///
- /// The storage directory.
- public static string StorageDirectory
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.StorageDirectory; }
- }
-
- ///
- /// Gets the path to umbraco's root directory (/umbraco by default).
- ///
- /// The path.
- public static string Path
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.Path; }
- }
-
- ///
- /// Gets the path to umbraco's client directory (/umbraco_client by default).
- /// This is a relative path to the Umbraco Path as it always must exist beside the 'umbraco'
- /// folder since the CSS paths to images depend on it.
- ///
- /// The path.
- public static string ClientPath
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.ClientPath; }
- }
-
- ///
- /// Gets the database connection string
- ///
- /// The database connection string.
- [Obsolete("Use System.ConfigurationManager.ConnectionStrings to get the connection with the key Umbraco.Core.Configuration.GlobalSettings.UmbracoConnectionName instead")]
- public static string DbDSN
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.DbDsn; }
- set { Umbraco.Core.Configuration.GlobalSettings.DbDsn = value; }
- }
-
- ///
- /// Gets or sets the configuration status. This will return the version number of the currently installed umbraco instance.
- ///
- /// The configuration status.
- public static string ConfigurationStatus
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus; }
- set { Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus = value; }
- }
-
- public static AspNetHostingPermissionLevel ApplicationTrustLevel
- {
- get { return Umbraco.Core.SystemUtilities.GetCurrentTrustLevel(); }
- }
-
- ///
- /// Saves a setting into the configuration file.
- ///
- /// Key of the setting to be saved.
- /// Value of the setting to be saved.
- protected static void SaveSetting(string key, string value)
- {
- Umbraco.Core.Configuration.GlobalSettings.SaveSetting(key, value);
- }
-
- ///
- /// Gets the full path to root.
- ///
- /// The fullpath to root.
- public static string FullpathToRoot
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.FullpathToRoot; }
- }
-
- ///
- /// Gets a value indicating whether umbraco is running in [debug mode].
- ///
- /// true if [debug mode]; otherwise, false.
- public static bool DebugMode
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.DebugMode; }
- }
-
- ///
- /// Gets a value indicating whether the current version of umbraco is configured.
- ///
- /// true if configured; otherwise, false.
- [Obsolete("Do not use this, it is no longer in use and will be removed from the codebase in future versions")]
- public static bool Configured
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.Configured; }
- }
-
- ///
- /// Gets the time out in minutes.
- ///
- /// The time out in minutes.
- public static int TimeOutInMinutes
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.TimeOutInMinutes; }
- }
-
- ///
- /// Gets a value indicating whether umbraco uses directory urls.
- ///
- /// true if umbraco uses directory urls; otherwise, false.
- public static bool UseDirectoryUrls
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.UseDirectoryUrls; }
- }
-
- ///
- /// Returns a string value to determine if umbraco should skip version-checking.
- ///
- /// The version check period in days (0 = never).
- public static int VersionCheckPeriod
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.VersionCheckPeriod; }
- }
-
- ///
- /// Gets the URL forbitten characters.
- ///
- /// The URL forbitten characters.
- [Obsolete("This property is no longer used and will be removed in future versions")]
- public static string UrlForbittenCharacters
- {
- get
- {
- return ConfigurationManager.AppSettings.ContainsKey("umbracoUrlForbittenCharacters")
- ? ConfigurationManager.AppSettings["umbracoUrlForbittenCharacters"]
- : string.Empty;
- }
- }
-
- ///
- /// Gets the URL space character.
- ///
- /// The URL space character.
- [Obsolete("This property is no longer used and will be removed in future versions")]
- public static string UrlSpaceCharacter
- {
- get
- {
- return ConfigurationManager.AppSettings.ContainsKey("umbracoUrlSpaceCharacter")
- ? ConfigurationManager.AppSettings["umbracoUrlSpaceCharacter"]
- : string.Empty;
- }
- }
-
- ///
- /// Gets the SMTP server IP-address or hostname.
- ///
- /// The SMTP server.
- [Obsolete("This property is no longer used and will be removed in future versions")]
- public static string SmtpServer
- {
- get
- {
- try
- {
- var mailSettings = ConfigurationManager.GetSection("system.net/mailSettings") as System.Net.Configuration.MailSettingsSectionGroup;
-
- if (mailSettings != null)
- return mailSettings.Smtp.Network.Host;
- else
- return ConfigurationManager.AppSettings["umbracoSmtpServer"];
- }
- catch
- {
- return "";
- }
- }
- }
-
- ///
- /// Returns a string value to determine if umbraco should disbable xslt extensions
- ///
- /// "true" if version xslt extensions are disabled, otherwise, "false"
- [Obsolete("This is no longer used and will be removed from the codebase in future releases")]
- public static string DisableXsltExtensions
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.DisableXsltExtensions; }
- }
-
- ///
- /// Returns a string value to determine if umbraco should use Xhtml editing mode in the wysiwyg editor
- ///
- /// "true" if Xhtml mode is enable, otherwise, "false"
- [Obsolete("This is no longer used and will be removed from the codebase in future releases")]
- public static string EditXhtmlMode
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.EditXhtmlMode; }
- }
-
- ///
- /// Gets the default UI language.
- ///
- /// The default UI language.
- public static string DefaultUILanguage
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.DefaultUILanguage; }
- }
-
- ///
- /// Gets the profile URL.
- ///
- /// The profile URL.
- public static string ProfileUrl
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.ProfileUrl; }
- }
-
- ///
- /// Gets a value indicating whether umbraco should hide top level nodes from generated urls.
- ///
- ///
- /// true if umbraco hides top level nodes from urls; otherwise, false.
- ///
- public static bool HideTopLevelNodeFromPath
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.HideTopLevelNodeFromPath; }
- }
-
- ///
- /// Gets the current version.
- ///
- /// The current version.
- [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)]
- public static string CurrentVersion
- {
- get { return UmbracoVersion.Current.ToString(3); }
- }
-
- ///
- /// Gets the major version number.
- ///
- /// The major version number.
- [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)]
- public static int VersionMajor
- {
- get { return UmbracoVersion.Current.Major; }
- }
-
- ///
- /// Gets the minor version number.
- ///
- /// The minor version number.
- [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)]
- public static int VersionMinor
- {
- get { return UmbracoVersion.Current.Minor; }
- }
-
- ///
- /// Gets the patch version number.
- ///
- /// The patch version number.
- [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)]
- public static int VersionPatch
- {
- get { return UmbracoVersion.Current.Build; }
- }
-
- ///
- /// Gets the version comment (like beta or RC).
- ///
- /// The version comment.
- [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)]
- public static string VersionComment
- {
- get { return UmbracoVersion.CurrentComment; }
- }
-
-
- ///
- /// Requests the is in umbraco application directory structure.
- ///
- /// The context.
- ///
- public static bool RequestIsInUmbracoApplication(HttpContext context)
- {
- return Umbraco.Core.Configuration.GlobalSettings.RequestIsInUmbracoApplication(context);
- }
-
- ///
- /// Gets a value indicating whether umbraco should force a secure (https) connection to the backoffice.
- ///
- /// true if [use SSL]; otherwise, false.
- public static bool UseSSL
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.UseSSL; }
- }
-
- ///
- /// Gets the umbraco license.
- ///
- /// The license.
- public static string License
- {
- get { return Umbraco.Core.Configuration.GlobalSettings.License; }
- }
-
-
- ///
- /// Developer method to test if configuration settings are loaded properly.
- ///
- /// true if succesfull; otherwise, false.
- [Obsolete("This method is no longer used and will be removed in future versions")]
- public static bool test
- {
- get
- {
- var databaseSettings = ConfigurationManager.ConnectionStrings[Umbraco.Core.Configuration.GlobalSettings.UmbracoConnectionName];
- var dataHelper = DataLayerHelper.CreateSqlHelper(databaseSettings.ConnectionString, false);
-
- if (HttpContext.Current != null)
- {
- HttpContext.Current.Response.Write("ContentXML :" + ContentXML + "\n");
- HttpContext.Current.Response.Write("DbDSN :" + dataHelper.ConnectionString + "\n");
- HttpContext.Current.Response.Write("DebugMode :" + DebugMode + "\n");
- HttpContext.Current.Response.Write("DefaultUILanguage :" + DefaultUILanguage + "\n");
- HttpContext.Current.Response.Write("VersionCheckPeriod :" + VersionCheckPeriod + "\n");
- HttpContext.Current.Response.Write("DisableXsltExtensions :" + DisableXsltExtensions + "\n");
- HttpContext.Current.Response.Write("EditXhtmlMode :" + EditXhtmlMode + "\n");
- HttpContext.Current.Response.Write("HideTopLevelNodeFromPath :" + HideTopLevelNodeFromPath + "\n");
- HttpContext.Current.Response.Write("Path :" + Path + "\n");
- HttpContext.Current.Response.Write("ProfileUrl :" + ProfileUrl + "\n");
- HttpContext.Current.Response.Write("ReservedPaths :" + ReservedPaths + "\n");
- HttpContext.Current.Response.Write("ReservedUrls :" + ReservedUrls + "\n");
- HttpContext.Current.Response.Write("StorageDirectory :" + StorageDirectory + "\n");
- HttpContext.Current.Response.Write("TimeOutInMinutes :" + TimeOutInMinutes + "\n");
- //HttpContext.Current.Response.Write("UrlForbittenCharacters :" + UrlForbittenCharacters + "\n");
- //HttpContext.Current.Response.Write("UrlSpaceCharacter :" + UrlSpaceCharacter + "\n");
- HttpContext.Current.Response.Write("UseDirectoryUrls :" + UseDirectoryUrls + "\n");
- return true;
- }
- return false;
- }
- }
-
-
- ///
- /// Determines whether the specified URL is reserved or is inside a reserved path.
- ///
- /// The URL to check.
- ///
- /// true if the specified URL is reserved; otherwise, false.
- ///
- public static bool IsReservedPathOrUrl(string url)
- {
- return Umbraco.Core.Configuration.GlobalSettings.IsReservedPathOrUrl(url);
- }
- }
-
-
-
- ///
- /// Structure that checks in logarithmic time
- /// if a given string starts with one of the added keys.
- ///
- [Obsolete("Use Umbraco.Core.Configuration.GlobalSettings.StartsWithContainer container instead")]
- public class StartsWithContainer
- {
- /// Internal sorted list of keys.
- public SortedList _list
- = new SortedList(StartsWithComparator.Instance);
-
- ///
- /// Adds the specified new key.
- ///
- /// The new key.
- public void Add(string newKey)
- {
- // if the list already contains an element that begins with newKey, return
- if (String.IsNullOrEmpty(newKey) || StartsWith(newKey))
- return;
-
- // create a new collection, so the old one can still be accessed
- SortedList newList
- = new SortedList(_list.Count + 1, StartsWithComparator.Instance);
-
- // add only keys that don't already start with newKey, others are unnecessary
- foreach (string key in _list.Keys)
- if (!key.StartsWith(newKey))
- newList.Add(key, null);
- // add the new key
- newList.Add(newKey, null);
-
- // update the list (thread safe, _list was never in incomplete state)
- _list = newList;
- }
-
- ///
- /// Checks if the given string starts with any of the added keys.
- ///
- /// The target.
- /// true if a key is found that matches the start of target
- ///
- /// Runs in O(s*log(n)), with n the number of keys and s the length of target.
- ///
- public bool StartsWith(string target)
- {
- return _list.ContainsKey(target);
- }
-
- /// Comparator that tests if a string starts with another.
- /// Not a real comparator, since it is not reflexive. (x==y does not imply y==x)
- private sealed class StartsWithComparator : IComparer
- {
- /// Default string comparer.
- private readonly static Comparer _stringComparer = Comparer.Default;
-
- /// Gets an instance of the StartsWithComparator.
- public static readonly StartsWithComparator Instance = new StartsWithComparator();
-
- ///
- /// Tests if whole begins with all characters of part.
- ///
- /// The part.
- /// The whole.
- ///
- /// Returns 0 if whole starts with part, otherwise performs standard string comparison.
- ///
- public int Compare(string part, string whole)
- {
- // let the default string comparer deal with null or when part is not smaller then whole
- if (part == null || whole == null || part.Length >= whole.Length)
- return _stringComparer.Compare(part, whole);
-
- // loop through all characters that part and whole have in common
- int pos = 0;
- bool match;
- do
- {
- match = (part[pos] == whole[pos]);
- } while (match && ++pos < part.Length);
-
- // return result of last comparison
- return match ? 0 : (part[pos] < whole[pos] ? -1 : 1);
- }
- }
- }
-}
diff --git a/src/umbraco.businesslogic/User.cs b/src/umbraco.businesslogic/User.cs
index 475a2614dd..90ed9065cc 100644
--- a/src/umbraco.businesslogic/User.cs
+++ b/src/umbraco.businesslogic/User.cs
@@ -358,17 +358,7 @@ namespace umbraco.BusinessLogic
/// A user or null
public static User GetCurrent()
{
- try
- {
- if (BasePages.BasePage.umbracoUserContextID != "")
- return GetUser(BasePages.BasePage.GetUserId(BasePages.BasePage.umbracoUserContextID));
- else
- return null;
- }
- catch (Exception)
- {
- return null;
- }
+ throw new NotImplementedException("NOTHING USING THIS WILL WORK UNTIL THIS USER CLASS IS REMOVED AND ALL CODE REFERENCING IT IS MIGRATED");
}
///
diff --git a/src/umbraco.businesslogic/ui.cs b/src/umbraco.businesslogic/ui.cs
index b289b6d6c5..ff24ceb0b4 100644
--- a/src/umbraco.businesslogic/ui.cs
+++ b/src/umbraco.businesslogic/ui.cs
@@ -1,12 +1,9 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
-using System.Text.RegularExpressions;
using System.Threading;
-using System.Web;
using System.Web.Caching;
using System.Xml;
using Umbraco.Core;
@@ -14,8 +11,6 @@ using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
-using umbraco.BasePages;
-using Umbraco.Core.Services;
using File = System.IO.File;
using User = umbraco.BusinessLogic.User;
@@ -31,7 +26,7 @@ namespace umbraco
[Obsolete("Use the ILocalizedTextService instead which is on the ApplicationContext.Services.TextService")]
public class ui
{
- private static readonly string UmbracoDefaultUiLanguage = GlobalSettings.DefaultUILanguage;
+ private static readonly string UmbracoDefaultUiLanguage = Umbraco.Core.Configuration.GlobalSettings.DefaultUILanguage;
private static readonly string UmbracoPath = SystemDirectories.Umbraco;
[EditorBrowsable(EditorBrowsableState.Never)]
@@ -54,10 +49,10 @@ namespace umbraco
return found == null ? string.Empty : found.Name;
}
+
private static string GetLanguage()
{
- var user = UmbracoEnsuredPage.CurrentUser;
- return GetLanguage(user);
+ throw new NotImplementedException("NOTHING WILL WORK UNTIL WE REPLACE ALL USAGES OF THE ui CLASS");
}
private static string GetLanguage(User u)
diff --git a/src/umbraco.businesslogic/umbraco.businesslogic.csproj b/src/umbraco.businesslogic/umbraco.businesslogic.csproj
index daffbe8601..2f32fb3204 100644
--- a/src/umbraco.businesslogic/umbraco.businesslogic.csproj
+++ b/src/umbraco.businesslogic/umbraco.businesslogic.csproj
@@ -195,16 +195,6 @@
Code
-
- ASPXCodeBehind
-
-
-
- ASPXCodeBehind
-
-
- Code
- Code
diff --git a/src/umbraco.cms/PluginManagerExtensions.cs b/src/umbraco.cms/PluginManagerExtensions.cs
index 86605a356d..63702a2ead 100644
--- a/src/umbraco.cms/PluginManagerExtensions.cs
+++ b/src/umbraco.cms/PluginManagerExtensions.cs
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using Umbraco.Core;
-using umbraco.BusinessLogic.Actions;
-using umbraco.businesslogic;
using umbraco.cms.businesslogic.macro;
using umbraco.cms.businesslogic.media;
using umbraco.interfaces;
diff --git a/src/umbraco.cms/businesslogic/Packager/Installer.cs b/src/umbraco.cms/businesslogic/Packager/Installer.cs
index 0b28c434c0..fdbe26cecf 100644
--- a/src/umbraco.cms/businesslogic/Packager/Installer.cs
+++ b/src/umbraco.cms/businesslogic/Packager/Installer.cs
@@ -299,13 +299,16 @@ namespace umbraco.cms.businesslogic.packager
// Get current user, with a fallback
var currentUser = new User(0);
- if (string.IsNullOrEmpty(BasePages.UmbracoEnsuredPage.umbracoUserContextID) == false)
- {
- if (BasePages.UmbracoEnsuredPage.ValidateUserContextID(BasePages.UmbracoEnsuredPage.umbracoUserContextID))
- {
- currentUser = User.GetCurrent();
- }
- }
+
+ //TODO: Need to migrate this class/code/logic so that we can replicate this functionality, until then everything will be installed by ADMIN
+
+ //if (string.IsNullOrEmpty(Umbraco.Web.UI.Pages.UmbracoEnsuredPage.umbracoUserContextID) == false)
+ //{
+ // if (Umbraco.Web.UI.Pages.UmbracoEnsuredPage.ValidateUserContextID(Umbraco.Web.UI.Pages.UmbracoEnsuredPage.umbracoUserContextID))
+ // {
+ // currentUser = User.GetCurrent();
+ // }
+ //}
//Xml as XElement which is used with the new PackagingService
var rootElement = Config.DocumentElement.GetXElement();
diff --git a/src/umbraco.cms/businesslogic/Packager/PackageInstance/PackageActions.cs b/src/umbraco.cms/businesslogic/Packager/PackageInstance/PackageActions.cs
index bd312343e4..eaba8f8f0a 100644
--- a/src/umbraco.cms/businesslogic/Packager/PackageInstance/PackageActions.cs
+++ b/src/umbraco.cms/businesslogic/Packager/PackageInstance/PackageActions.cs
@@ -5,7 +5,7 @@ using System.Web;
using System.Xml;
using Umbraco.Core;
using Umbraco.Core.Logging;
-using umbraco.BasePages;
+
using umbraco.BusinessLogic.Utils;
using umbraco.cms.businesslogic.web;
using umbraco.cms.businesslogic.workflow;
diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs
index e0039e9d09..5d2b417428 100644
--- a/src/umbraco.cms/businesslogic/web/Document.cs
+++ b/src/umbraco.cms/businesslogic/web/Document.cs
@@ -1,23 +1,12 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Threading;
using System.Xml;
using Umbraco.Core;
-using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
-using Umbraco.Core.Logging;
using Umbraco.Core.Models.EntityBase;
-
-using Umbraco.Core.Publishing;
-using Umbraco.Core.Services;
using umbraco.BusinessLogic;
-using umbraco.BusinessLogic.Actions;
using umbraco.DataLayer;
-using Umbraco.Core.Events;
-using Umbraco.Core.Strings;
namespace umbraco.cms.businesslogic.web
{
diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj
index 662b732773..b01b098a90 100644
--- a/src/umbraco.cms/umbraco.cms.csproj
+++ b/src/umbraco.cms/umbraco.cms.csproj
@@ -172,44 +172,6 @@
Properties\SolutionInfo.cs
-
- Code
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
-