From f7103c97cf680a71a012c252b86d75d952a41630 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 1 Oct 2013 17:03:03 +1000 Subject: [PATCH] Completes: U4-2768 Remove legacy/unused webforms files/classes in folder: /umbraco --- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 22 - src/Umbraco.Web.UI/umbraco/Create.aspx.cs | 39 -- .../umbraco/Create.aspx.designer.cs | 25 - src/Umbraco.Web.UI/umbraco/Umbraco.aspx.cs | 185 ----- .../umbraco/Umbraco.aspx.designer.cs | 286 -------- src/Umbraco.Web.UI/umbraco/cacheBrowser.aspx | 16 - src/Umbraco.Web.UI/umbraco/create.aspx | 43 -- src/Umbraco.Web.UI/umbraco/dashboard.aspx | 11 - src/Umbraco.Web.UI/umbraco/editContent.aspx | 62 -- src/Umbraco.Web.UI/umbraco/editMedia.aspx | 28 - src/Umbraco.Web.UI/umbraco/login.aspx | 129 ---- src/Umbraco.Web.UI/umbraco/logout.aspx | 18 - src/Umbraco.Web.UI/umbraco/umbraco.aspx | 399 ----------- src/Umbraco.Web/Umbraco.Web.csproj | 30 - .../umbraco/cacheBrowser.aspx.cs | 42 -- .../umbraco/create.aspx.cs | 50 -- .../umbraco/dashboard.aspx.cs | 377 ---------- .../umbraco/editContent.aspx.cs | 642 ------------------ .../umbraco/editMedia.aspx.cs | 191 ------ .../umbraco/login.aspx.cs | 307 --------- .../umbraco/logout.aspx.cs | 28 - .../umbraco/timerModule.cs | 39 -- .../umbraco.presentation/umbraco/umbWindow.cs | 148 ---- .../umbraco/umbraco.aspx.cs | 460 ------------- 24 files changed, 3577 deletions(-) delete mode 100644 src/Umbraco.Web.UI/umbraco/Create.aspx.cs delete mode 100644 src/Umbraco.Web.UI/umbraco/Create.aspx.designer.cs delete mode 100644 src/Umbraco.Web.UI/umbraco/Umbraco.aspx.cs delete mode 100644 src/Umbraco.Web.UI/umbraco/Umbraco.aspx.designer.cs delete mode 100644 src/Umbraco.Web.UI/umbraco/cacheBrowser.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/create.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/dashboard.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/editContent.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/editMedia.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/login.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/logout.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/umbraco.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/cacheBrowser.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/create.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/dashboard.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/editMedia.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/logout.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/timerModule.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/umbWindow.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/umbraco.aspx.cs diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index ce8005583b..fa90a61110 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -422,13 +422,6 @@ ImageViewer.ascx - - create.aspx - ASPXCodeBehind - - - create.aspx - PartialView.ascx ASPXCodeBehind @@ -588,13 +581,6 @@ treeInit.aspx - - umbraco.aspx - ASPXCodeBehind - - - umbraco.aspx - @@ -695,7 +681,6 @@ - @@ -2048,7 +2033,6 @@ UserControl - Designer @@ -2182,7 +2166,6 @@ - @@ -2191,8 +2174,6 @@ - - @@ -2397,8 +2378,6 @@ - - Form @@ -2422,7 +2401,6 @@ - diff --git a/src/Umbraco.Web.UI/umbraco/Create.aspx.cs b/src/Umbraco.Web.UI/umbraco/Create.aspx.cs deleted file mode 100644 index 304e7ffdb1..0000000000 --- a/src/Umbraco.Web.UI/umbraco/Create.aspx.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Xml; -using Umbraco.Core; -using Umbraco.Core.IO; -using umbraco.cms.presentation.Trees; - -namespace Umbraco.Web.UI.Umbraco -{ - public partial class CreateDialog : global::umbraco.cms.presentation.Create - { - - protected override void OnLoad(EventArgs e) - { - if (SecurityCheck(Request.QueryString["nodeType"])) - { - //if we're allowed, then continue - base.OnLoad(e); - } - else - { - //otherwise show an error - UI.Visible = false; - AccessError.Visible = true; - } - } - - private bool SecurityCheck(string nodeTypeAlias) - { - return LegacyDialogHandler.UserHasCreateAccess( - new HttpContextWrapper(Context), - getUser(), - nodeTypeAlias); - } - - } -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/Create.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/Create.aspx.designer.cs deleted file mode 100644 index 1e11eaf00d..0000000000 --- a/src/Umbraco.Web.UI/umbraco/Create.aspx.designer.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Web.UI.Umbraco { - - - public partial class CreateDialog - { - - /// - /// AccessError control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder AccessError; - } -} diff --git a/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.cs b/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.cs deleted file mode 100644 index 02b0feee92..0000000000 --- a/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.cs +++ /dev/null @@ -1,185 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Web; -using System.Web.UI; -using Umbraco.Core.IO; -using umbraco; -using Umbraco.Core; - -namespace Umbraco.Web.UI.Umbraco -{ - public partial class Umbraco : Pages.UmbracoEnsuredPage - { - public string DefaultApp { get; private set; } - - protected void Page_Load(object sender, System.EventArgs e) - { - var apps = UmbracoUser.Applications.ToList(); - bool userHasAccesstodefaultApp = apps.Any(x => x.alias == Constants.Applications.Content); - - // Load user module icons .. - if (apps.Count() > 1) - { - - var jsEvents = new StringBuilder(); - - PlaceHolderAppIcons.Text = ui.Text("main", "sections", UmbracoUser); - plcIcons.Text = ""; - foreach (global::umbraco.BusinessLogic.Application a in apps.OrderBy(x => x.sortOrder)) - { - - string appClass = a.icon.StartsWith(".") ? a.icon.Substring(1, a.icon.Length - 1) : a.alias; - - //adds client side event handlers to the icon buttons - jsEvents.Append(@"jQuery('." + appClass + "').click(function() { appClick.call(this, '" + a.alias + "'); } );"); - jsEvents.Append(@"jQuery('." + appClass + "').dblclick(function() { appDblClick.call(this, '" + a.alias + "'); } );"); - - string iconElement = String.Format("
  • ", appClass); - if (a.icon.StartsWith(".")) - iconElement += - "\"\"
  • "; - else - iconElement += "\"""; - plcIcons.Text += iconElement; - - } - - //registers the jquery event handlers. - Page.ClientScript.RegisterStartupScript(this.GetType(), "AppIcons", "jQuery(document).ready(function() { " + jsEvents.ToString() + " } );", true); - - } - else - PlaceHolderAppIcons.Visible = false; - - - //if user does not have access to content (ie, he's probably a translator)... - //then change the default tree app - if (!userHasAccesstodefaultApp) - { - JTree.App = apps[0].alias; - DefaultApp = apps[0].alias; - } - else - { - DefaultApp = Constants.Applications.Content; - } - - - // Load globalized labels - treeWindow.Text = ui.Text("main", "tree", UmbracoUser); - - RenderActionJs(); - - // Version check goes here! - - // zb-00004 #29956 : refactor cookies names & handling - var updChkCookie = new global::umbraco.BusinessLogic.StateHelper.Cookies.Cookie("UMB_UPDCHK", GlobalSettings.VersionCheckPeriod); // was "updateCheck" - string updateCheckCookie = updChkCookie.HasValue ? updChkCookie.GetValue() : ""; - - if (GlobalSettings.VersionCheckPeriod > 0 && String.IsNullOrEmpty(updateCheckCookie) && UmbracoUser.UserType.Alias == "admin") - { - - // Add scriptmanager version check - ScriptManager sm = ScriptManager.GetCurrent(Page); - sm.Scripts.Add(new ScriptReference(SystemDirectories.Umbraco + "/js/umbracoUpgradeChecker.js")); - sm.Services.Add(new ServiceReference(SystemDirectories.WebServices + "/CheckForUpgrade.asmx")); - - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "upgradeChecker", "jQuery(document).ready(function() {umbraco.presentation.webservices.CheckForUpgrade.CallUpgradeService(umbracoCheckUpgrade);});", true); - - updChkCookie.SetValue("1"); - } - DataBind(); - - AddIe9Meta(); - } - - private void AddIe9Meta() - { - if (Request.Browser.Browser == "IE" && Request.Browser.MajorVersion == 9) - { - var metadata = new StringBuilder(); - metadata.AppendFormat( - @" - - - - - ", - IOHelper.ResolveUrl(SystemDirectories.Umbraco + "/Images/PinnedIcons/umb.ico"), - HttpContext.Current.Request.Url.Host.ToLower().Replace("www.", "")); - - var user = UmbracoUser; - if (user != null && user.Applications != null && user.Applications.Length > 0) - { - foreach (var app in user.Applications) - { - metadata.AppendFormat( - @"", - ui.Text("sections", app.alias, user), - IOHelper.ResolveUrl(string.Format("{0}/umbraco.aspx#{1}", SystemDirectories.Umbraco, app.alias)), - File.Exists( - IOHelper.MapPath( - IOHelper.ResolveUrl( - string.Format("{0}/Images/PinnedIcons/task_{1}.ico", SystemDirectories.Umbraco, app.alias)))) - ? "/umbraco/Images/PinnedIcons/task_" + app.alias + ".ico" - : "/umbraco/Images/PinnedIcons/task_default.ico"); - } - } - - this.Header.Controls.Add(new LiteralControl(metadata.ToString())); - } - } - - /// - /// Renders out all JavaScript references that have bee declared in IActions - /// - private void RenderActionJs() - { - var item = 0; - foreach (var jsFile in global::umbraco.BusinessLogic.Actions.Action.GetJavaScriptFileReferences()) - { - //validate that this is a url, if it is not, we'll assume that it is a text block and render it as a text - //block instead. - var isValid = true; - try - { - var jsUrl = new Uri(jsFile, UriKind.RelativeOrAbsolute); - //ok it validates, but so does alert('hello'); ! so we need to do more checks - - //here are the valid chars in a url without escaping - if (Regex.IsMatch(jsFile, @"[^a-zA-Z0-9-._~:/?#\[\]@!$&'\(\)*\+,%;=]")) - isValid = false; - - //we'll have to be smarter and just check for certain js patterns now too! - var jsPatterns = new string[] { @"\+\s*\=", @"\);", @"function\s*\(", @"!=", @"==" }; - if (jsPatterns.Any(p => Regex.IsMatch(jsFile, p))) - { - isValid = false; - } - - if (isValid) - { - //add to page - Page.ClientScript.RegisterClientScriptInclude(this.GetType(), item.ToString(), jsFile); - } - } - catch (UriFormatException) - { - isValid = false; - } - - if (!isValid) - { - //it is invalid, let's render it as a script block instead as devs may have written real Javascript instead - //of a JS path - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), item.ToString(), jsFile, true); - } - - item++; - } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.designer.cs deleted file mode 100644 index f7e448af08..0000000000 --- a/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.designer.cs +++ /dev/null @@ -1,286 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Web.UI.Umbraco { - - - public partial class Umbraco - { - - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.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; - - /// - /// CssInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude2; - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// JSON2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JSON2; - - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - - /// - /// JsInclude14 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude14; - - /// - /// JsInclude5 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude5; - - /// - /// JsInclude6 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude6; - - /// - /// JsInclude13 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude13; - - /// - /// JsInclude7 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude7; - - /// - /// JsInclude8 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude8; - - /// - /// JsInclude9 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude9; - - /// - /// JsInclude10 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude10; - - /// - /// JsInclude11 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude11; - - /// - /// JsInclude4 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude4; - - /// - /// JsInclude17 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude17; - - /// - /// JsInclude12 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude12; - - /// - /// JsInclude15 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude15; - - /// - /// JsInclude16 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude16; - - /// - /// 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; - - /// - /// umbracoScriptManager control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.ScriptManager umbracoScriptManager; - - /// - /// FindDocuments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel FindDocuments; - - /// - /// Search control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web.UI.Umbraco.Search.QuickSearch Search; - - /// - /// treeWindow control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoPanel treeWindow; - - /// - /// JTree control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.controls.Tree.TreeControl JTree; - - /// - /// PlaceHolderAppIcons control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoPanel PlaceHolderAppIcons; - - /// - /// plcIcons control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal plcIcons; - - /// - /// bubbleText control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder bubbleText; - } -} diff --git a/src/Umbraco.Web.UI/umbraco/cacheBrowser.aspx b/src/Umbraco.Web.UI/umbraco/cacheBrowser.aspx deleted file mode 100644 index 7aa26dda00..0000000000 --- a/src/Umbraco.Web.UI/umbraco/cacheBrowser.aspx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ Page language="c#" Codebehind="cacheBrowser.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.cacheBrowser" trace="true" %> - - - - cacheBrowser - - - - - - -
    - -
    - - diff --git a/src/Umbraco.Web.UI/umbraco/create.aspx b/src/Umbraco.Web.UI/umbraco/create.aspx deleted file mode 100644 index 782b7f178d..0000000000 --- a/src/Umbraco.Web.UI/umbraco/create.aspx +++ /dev/null @@ -1,43 +0,0 @@ -<%@ Page Language="c#" MasterPageFile="masterpages/umbracoDialog.Master" Codebehind="CreateDialog.aspx.cs" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.CreateDialog" %> -<%@ Register Namespace="umbraco" TagPrefix="umb" Assembly="umbraco" %> - - - - - - - - - -
    -

    - The current user does not have access to create this type of object -

    -
    -
    -
    - - - - \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/dashboard.aspx b/src/Umbraco.Web.UI/umbraco/dashboard.aspx deleted file mode 100644 index 91a4de4c0d..0000000000 --- a/src/Umbraco.Web.UI/umbraco/dashboard.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page language="c#" MasterPageFile="masterpages/umbracoPage.Master" Title="dashboard" Codebehind="dashboard.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.dashboard" trace="false" validateRequest="false"%> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - -
    - -
    -
    - -
    \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/editContent.aspx b/src/Umbraco.Web.UI/umbraco/editContent.aspx deleted file mode 100644 index 8c7ec1317f..0000000000 --- a/src/Umbraco.Web.UI/umbraco/editContent.aspx +++ /dev/null @@ -1,62 +0,0 @@ -<%@ Page Title="Edit content" Language="c#" MasterPageFile="masterpages/umbracoPage.Master" - CodeBehind="editContent.aspx.cs" ValidateRequest="false" AutoEventWireup="True" - Inherits="umbraco.cms.presentation.editContent" Trace="false" %> - -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> - - - - - - - - - - - -
    - - -
    - - - -
    diff --git a/src/Umbraco.Web.UI/umbraco/editMedia.aspx b/src/Umbraco.Web.UI/umbraco/editMedia.aspx deleted file mode 100644 index 50368f0cd7..0000000000 --- a/src/Umbraco.Web.UI/umbraco/editMedia.aspx +++ /dev/null @@ -1,28 +0,0 @@ -<%@ Page Language="c#" CodeBehind="editMedia.aspx.cs" ValidateRequest="false" MasterPageFile="masterpages/umbracoPage.Master" - AutoEventWireup="True" Inherits="umbraco.cms.presentation.editMedia" %> - - - - - - - - - diff --git a/src/Umbraco.Web.UI/umbraco/login.aspx b/src/Umbraco.Web.UI/umbraco/login.aspx deleted file mode 100644 index 5d299e9e0c..0000000000 --- a/src/Umbraco.Web.UI/umbraco/login.aspx +++ /dev/null @@ -1,129 +0,0 @@ -<%@ Page Language="c#" CodeBehind="login.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.login" %> - -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -<%@ Register Namespace="umbraco" TagPrefix="umb" Assembly="umbraco" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> - - - - Login - Umbraco - <%=Request.Url.Host.ToLower().Replace("www.", "") %> - - - - - - - - -
    - -
    -

    - -

    - - - - - - - - - - - - - - - - - - -
    - - - -
    -
    - - - -
    -
    - -
    -
    -
    - - - - - - - - - - - - - diff --git a/src/Umbraco.Web.UI/umbraco/logout.aspx b/src/Umbraco.Web.UI/umbraco/logout.aspx deleted file mode 100644 index 41289b10d2..0000000000 --- a/src/Umbraco.Web.UI/umbraco/logout.aspx +++ /dev/null @@ -1,18 +0,0 @@ -<%@ Page language="c#" Codebehind="logout.aspx.cs" AutoEventWireup="True" Inherits="umbraco.logout" %> - - - - - logout - - - - - - - -
    -
    - - - diff --git a/src/Umbraco.Web.UI/umbraco/umbraco.aspx b/src/Umbraco.Web.UI/umbraco/umbraco.aspx deleted file mode 100644 index 0bcb810d20..0000000000 --- a/src/Umbraco.Web.UI/umbraco/umbraco.aspx +++ /dev/null @@ -1,399 +0,0 @@ -<%@ Page Trace="false" Language="c#" CodeBehind="umbraco.aspx.cs" AutoEventWireup="True" - Inherits="Umbraco.Web.UI.Umbraco.Umbraco" %> - -<%@ Import Namespace="System.Web.Script.Serialization" %> - -<%@ Register Src="controls/Tree/TreeControl.ascx" TagName="TreeControl" TagPrefix="umbraco" %> -<%@ Import Namespace="StackExchange.Profiling" %> -<%@ Import Namespace="Umbraco.Core.Profiling" %> -<%@ Import Namespace="Umbraco.Web" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -<%@ Register TagPrefix="uc1" TagName="quickSearch" Src="Search/QuickSearch.ascx" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> - - - - Umbraco CMS - - <%=Request.Url.Host.ToLower().Replace("www.", "") %> - - " /> - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - - -
    -
    -
    - -   -
    -
    - - - - -
      - -
    -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    - × -
    - -
    -
    - - - <%if(string.IsNullOrEmpty(Request["umbDebug"]) == false && umbraco.GlobalSettings.DebugMode) - { - Response.Write(Html.RenderProfiler()); - }%> - - diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 689715fc24..cd713f4daa 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -691,9 +691,6 @@
    - - ASPXCodeBehind - ASPXCodeBehind @@ -706,21 +703,9 @@ ASPXCodeBehind - - ASPXCodeBehind - - - ASPXCodeBehind - ASPXCodeBehind - - ASPXCodeBehind - - - ASPXCodeBehind - ASPXCodeBehind @@ -728,12 +713,6 @@ ASPXCodeBehind - - ASPXCodeBehind - - - ASPXCodeBehind - ASPXCodeBehind @@ -1558,9 +1537,6 @@ True Resources.resx - - Code - default.aspx ASPXCodeBehind @@ -1632,12 +1608,6 @@ XmlTree.xsd - - ASPXCodeBehind - - - Code - EditUser.aspx diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/cacheBrowser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/cacheBrowser.aspx.cs deleted file mode 100644 index 0e923ffc03..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/cacheBrowser.aspx.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections; -using umbraco.BasePages; - -namespace umbraco.cms.presentation -{ - /// - /// Summary description for cacheBrowser. - /// - public partial class cacheBrowser : UmbracoEnsuredPage - { - public cacheBrowser() - { - CurrentApp = BusinessLogic.DefaultApps.developer.ToString(); - - } - protected void Page_Load(object sender, System.EventArgs e) - { - // Cache removal checks - if (Request.QueryString["clearByType"] != null) - ApplicationContext.ApplicationCache.ClearCacheObjectTypes(Request.QueryString["clearByType"]); - else if (Request.QueryString["clearByKey"] != null) - ApplicationContext.ApplicationCache.ClearCacheItem(Request.QueryString["clearByKey"]); - - // Put user code to initialize the page here - Hashtable ht = cms.businesslogic.cache.Cache.ReturnCacheItemsOrdred(); - foreach (string key in ht.Keys) - { - Response.Write("" + key + ": " + ((ArrayList)ht[key]).Count.ToString() + " (Delete)
    "); - if (Request.QueryString["key"] == key) - for (int i = 0; i < ((ArrayList)ht[key]).Count; i++) - Response.Write(" - " + ((ArrayList)ht[key])[i] + " (Delete)
    "); - } - } - protected void Button1_Click(object sender, System.EventArgs e) - { - ApplicationContext.ApplicationCache.ClearAllCache(); - } - - protected System.Web.UI.HtmlControls.HtmlForm Form1; - protected System.Web.UI.WebControls.Button Button1; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create.aspx.cs deleted file mode 100644 index c8ec4a581d..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create.aspx.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Web.UI.WebControls; - -using System.Xml; -using Umbraco.Core.IO; - -namespace umbraco.cms.presentation -{ - public class Create : BasePages.UmbracoEnsuredPage - { - [Obsolete("This property is no longer used")] - protected umbWindow createWindow; - protected Label helpText; - protected TextBox rename; - protected Label Label1; - protected ListBox nodeType; - protected PlaceHolder UI; - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - // Load create definitions - var nodeType = Request.QueryString["nodeType"]; - - var createDef = new XmlDocument(); - var defReader = new XmlTextReader(IOHelper.MapPath(SystemFiles.CreateUiXml)); - createDef.Load(defReader); - defReader.Close(); - - // Find definition for current nodeType - var def = createDef.SelectSingleNode("//nodeType [@alias = '" + nodeType + "']"); - if (def == null) - { - throw new ArgumentException("The create dialog for \"" + nodeType + "\" does not match anything defined in the \"" + SystemFiles.CreateUiXml + "\". This could mean an incorrectly installed package or a corrupt UI file"); - } - - try - { - var virtualPath = SystemDirectories.Umbraco + def.SelectSingleNode("./usercontrol").FirstChild.Value; - var mainControl = LoadControl(virtualPath); - UI.Controls.Add(mainControl); - } - catch (Exception ex) - { - throw new ArgumentException("ERROR CREATING CONTROL FOR NODETYPE: " + nodeType, ex); - } - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard.aspx.cs deleted file mode 100644 index ee3798c660..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard.aspx.cs +++ /dev/null @@ -1,377 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Reflection; -using System.Web; -using System.Web.SessionState; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; -using System.IO; -using System.Xml; -using System.Xml.XPath; -using umbraco.uicontrols; -using umbraco.IO; -using umbraco.cms.helpers; -using umbraco.BusinessLogic; - -namespace umbraco.cms.presentation -{ - /// - /// Summary description for dashboard. - /// - /// - - public partial class dashboard : BasePages.UmbracoEnsuredPage - { - - - private string _section = ""; - - protected void Page_Load(object sender, System.EventArgs e) - { - // Put user code to initialize the page here - Panel2.Text = ui.Text("dashboard", "welcome", UmbracoUser) + " " + UmbracoUser.Name; - } - - private Control CreateDashBoardWrapperControl(Control control) - { - PlaceHolder placeHolder = new PlaceHolder(); - placeHolder.Controls.Add(new LiteralControl("
    ")); - placeHolder.Controls.Add(control); - placeHolder.Controls.Add(new LiteralControl("
    ")); - return placeHolder; - } - - override protected void OnInit(EventArgs e) - { - - base.OnInit(e); - - /* - // Load dashboard content - if (helper.Request("app") != "") - _section = helper.Request("app"); - else if (getUser().Applications.Length > 0) - _section = "default"; - else - _section = getUser().Applications[0].alias; - - XmlDocument dashBoardXml = new XmlDocument(); - dashBoardXml.Load(IOHelper.MapPath(SystemFiles.DashboardConfig)); - - var control = dashBoardXml.DocumentElement.SelectSingleNode("//control [areas/area = '" + _section.ToLower() + "']"); - */ - /* - // test for new tab interface - foreach (XmlNode section in dashBoardXml.DocumentElement.SelectNodes("//section [areas/area = '" + _section.ToLower() + "']")) - { - if (section != null && validateAccess(section)) - { - Panel2.Visible = false; - dashboardTabs.Visible = true; - - foreach (XmlNode entry in section.SelectNodes("./tab")) - { - if (validateAccess(entry)) - { - TabPage tab = dashboardTabs.NewTabPage(entry.Attributes.GetNamedItem("caption").Value); - tab.HasMenu = true; - tab.Style.Add("padding", "0 10px"); - - foreach (XmlNode uc in entry.SelectNodes("./control")) - { - if (validateAccess(uc)) - { - string control = getFirstText(uc).Trim(' ', '\r', '\n'); - string path = IOHelper.FindFile(control); - - - try - { - Control c = LoadControl(path); - - // set properties - Type type = c.GetType(); - if (type != null) - { - foreach (XmlAttribute att in uc.Attributes) - { - string attributeName = att.Name; - string attributeValue = parseControlValues(att.Value).ToString(); - // parse special type of values - - - PropertyInfo prop = type.GetProperty(attributeName); - if (prop == null) - { - continue; - } - - prop.SetValue(c, Convert.ChangeType(attributeValue, prop.PropertyType), - null); - - } - } - - //resolving files from dashboard config which probably does not map to a virtual fi - tab.Controls.Add(AddPanel(uc, c)); - } - catch (Exception ee) - { - tab.Controls.Add( - new LiteralControl( - "

    Could not load control: '" + path + - "'.
    Error message: " + - ee.ToString() + "

    ")); - } - } - } - } - } - } - else - { - - - foreach ( - XmlNode entry in dashBoardXml.SelectNodes("//entry [@section='" + _section.ToLower() + "']")) - { - PlaceHolder placeHolder = new PlaceHolder(); - if (entry == null || entry.FirstChild == null) - { - placeHolder.Controls.Add( - CreateDashBoardWrapperControl(new LiteralControl("Error loading DashBoard Content"))); - } - else - { - string path = IOHelper.FindFile(entry.FirstChild.Value); - - try - { - placeHolder.Controls.Add(CreateDashBoardWrapperControl(LoadControl(path))); - } - catch (Exception err) - { - Trace.Warn("Dashboard", string.Format("error loading control '{0}'", - path), err); - placeHolder.Controls.Clear(); - placeHolder.Controls.Add(CreateDashBoardWrapperControl(new LiteralControl(string.Format( - "Error loading DashBoard Content '{0}'; {1}", path, - err.Message)))); - } - } - dashBoardContent.Controls.Add(placeHolder); - } - } - }*/ - } - - private object parseControlValues(string value) - { - if (!String.IsNullOrEmpty(value)) - { - if (value.StartsWith("[#")) - { - value = value.Substring(2, value.Length - 3).ToLower(); - switch (value) - { - case "usertype": - return BusinessLogic.User.GetCurrent().UserType.Alias; - case "username": - return BusinessLogic.User.GetCurrent().Name; - case "userlogin": - return BusinessLogic.User.GetCurrent().LoginName; - case "usercontentstartnode": - return BusinessLogic.User.GetCurrent().StartNodeId; - case "usermediastartnode": - return BusinessLogic.User.GetCurrent().StartMediaId; - default: - return value; - } - } - } - - return value; - } - - private Control AddPanel(XmlNode node, Control c) - { - LiteralControl hide = AddShowOnceLink(node); - if (node.Attributes.GetNamedItem("addPanel") != null && - node.Attributes.GetNamedItem("addPanel").Value == "true") - { - Pane p = new Pane(); - PropertyPanel pp = new PropertyPanel(); - if (node.Attributes.GetNamedItem("panelCaption") != null && - !String.IsNullOrEmpty(node.Attributes.GetNamedItem("panelCaption").Value)) - { - string panelCaption = node.Attributes.GetNamedItem("panelCaption").Value; - if (panelCaption.StartsWith("#")) - { - panelCaption = ui.Text(panelCaption.Substring(1)); - } - pp.Text = panelCaption; - } - // check for hide in the future link - if (!String.IsNullOrEmpty(hide.Text)) - { - pp.Controls.Add(hide); - } - pp.Controls.Add(c); - p.Controls.Add(pp); - return p; - } - - if (!String.IsNullOrEmpty(hide.Text)) - { - PlaceHolder ph = new PlaceHolder(); - ph.Controls.Add(hide); - ph.Controls.Add(c); - return ph; - } - else - { - return c; - } - } - - private LiteralControl AddShowOnceLink(XmlNode node) - { - LiteralControl onceLink = new LiteralControl(); - if (node.Attributes.GetNamedItem("showOnce") != null && - node.Attributes.GetNamedItem("showOnce").Value.ToLower() == "true") - { - onceLink.Text = "" + ui.Text("dashboard", "dontShowAgain") + ""; - } - return onceLink; - } - - private string getFirstText(XmlNode node) - { - foreach (XmlNode n in node.ChildNodes) - { - if (n.NodeType == XmlNodeType.Text) - return n.Value; - } - - return ""; - } - - private string generateCookieKey(XmlNode node) - { - string key = String.Empty; - if (node.Name.ToLower() == "control") - { - key = node.FirstChild.Value + "_" + generateCookieKey(node.ParentNode); - } - else if (node.Name.ToLower() == "tab") - { - key = node.Attributes.GetNamedItem("caption").Value; - } - - return Casing.SafeAlias(key.ToLower()); - } - - private bool validateAccess(XmlNode node) - { - // check if this area should be shown at all - string onlyOnceValue = StateHelper.GetCookieValue(generateCookieKey(node)); - if (!String.IsNullOrEmpty(onlyOnceValue)) - { - return false; - } - - // the root user can always see everything - if (CurrentUser.IsRoot()) - { - return true; - } - else if (node != null) - { - XmlNode accessRules = node.SelectSingleNode("access"); - bool retVal = true; - if (accessRules != null && accessRules.HasChildNodes) - { - string currentUserType = CurrentUser.UserType.Alias.ToLowerInvariant(); - - //Update access rules so we'll be comparing lower case to lower case always - - var denies = accessRules.SelectNodes("deny"); - foreach (XmlNode deny in denies) - { - deny.InnerText = deny.InnerText.ToLowerInvariant(); - } - - var grants = accessRules.SelectNodes("grant"); - foreach (XmlNode grant in grants) - { - grant.InnerText = grant.InnerText.ToLowerInvariant(); - } - - string allowedSections = ","; - foreach (BusinessLogic.Application app in CurrentUser.Applications) - { - allowedSections += app.alias.ToLower() + ","; - } - XmlNodeList grantedTypes = accessRules.SelectNodes("grant"); - XmlNodeList grantedBySectionTypes = accessRules.SelectNodes("grantBySection"); - XmlNodeList deniedTypes = accessRules.SelectNodes("deny"); - - // if there's a grant type, everyone who's not granted is automatically denied - if (grantedTypes.Count > 0 || grantedBySectionTypes.Count > 0) - { - retVal = false; - if (grantedBySectionTypes.Count > 0 && accessRules.SelectSingleNode(String.Format("grantBySection [contains('{0}', concat(',',.,','))]", allowedSections)) != null) - { - retVal = true; - } - else if (grantedTypes.Count > 0 && accessRules.SelectSingleNode(String.Format("grant [. = '{0}']", currentUserType)) != null) - { - retVal = true; - } - } - // if the current type of user is denied we'll say nay - if (deniedTypes.Count > 0 && accessRules.SelectSingleNode(String.Format("deny [. = '{0}']", currentUserType)) != null) - { - retVal = false; - } - - } - - return retVal; - } - return false; - } - - /// - /// Panel2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoPanel Panel2; - - /// - /// dashBoardContent control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder dashBoardContent; - - /// - /// dashboardTabs control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.TabView dashboardTabs; - - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs deleted file mode 100644 index 60a6f9048b..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs +++ /dev/null @@ -1,642 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using Umbraco.Core.Models; -using Umbraco.Core.Persistence.Caching; -using Umbraco.Core.IO; -using Umbraco.Core.Publishing; -using Umbraco.Core.Services; -using umbraco.BusinessLogic.Actions; -using umbraco.uicontrols.DatePicker; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.web; -using umbraco.presentation; -using System.Linq; -using Image = System.Web.UI.WebControls.Image; -using Umbraco.Core; - -namespace umbraco.cms.presentation -{ - public class editContent : BasePages.UmbracoEnsuredPage - { - protected uicontrols.TabView TabView1; - protected TextBox documentName; - private Document _document; - private bool _documentHasPublishedVersion = false; - protected Literal jsIds; - private readonly LiteralControl _dp = new LiteralControl(); - private readonly DateTimePicker _dpRelease = new DateTimePicker(); - private readonly DateTimePicker _dpExpire = new DateTimePicker(); - - private controls.ContentControl _cControl; - - private readonly DropDownList _ddlDefaultTemplate = new DropDownList(); - - private readonly uicontrols.Pane _publishProps = new uicontrols.Pane(); - private readonly uicontrols.Pane _linkProps = new uicontrols.Pane(); - - private readonly Button _unPublish = new Button(); - private readonly Literal _littPublishStatus = new Literal(); - - private controls.ContentControl.publishModes _canPublish = controls.ContentControl.publishModes.Publish; - - private int? _contentId = null; - - override protected void OnInit(EventArgs e) - { - base.OnInit(e); - - //validate! - int id; - if (int.TryParse(Request.QueryString["id"], out id) == false) - { - //if this is invalid show an error - this.DisplayFatalError("Invalid query string"); - return; - } - _contentId = id; - - - _unPublish.Click += UnPublishDo; - - //Loading Content via new public service to ensure that the Properties are loaded correct - var content = ApplicationContext.Current.Services.ContentService.GetById(id); - _document = new Document(content); - - //check if the doc exists - if (string.IsNullOrEmpty(_document.Path)) - { - //if this is invalid show an error - this.DisplayFatalError("No document found with id " + _contentId); - //reset the content id to null so processing doesn't continue on OnLoad - _contentId = null; - return; - } - - // we need to check if there's a published version of this document - _documentHasPublishedVersion = _document.Content.HasPublishedVersion(); - - // Check publishing permissions - if (!UmbracoUser.GetPermissions(_document.Path).Contains(ActionPublish.Instance.Letter.ToString())) - { - // Check to see if the user has send to publish permissions - if (!UmbracoUser.GetPermissions(_document.Path).Contains(ActionToPublish.Instance.Letter.ToString())) - { - //If no send to publish permission then revert to NoPublish mode - _canPublish = controls.ContentControl.publishModes.NoPublish; - } - else - { - _canPublish = controls.ContentControl.publishModes.SendToPublish; - } - } - - _cControl = new controls.ContentControl(_document, _canPublish, "TabView1"); - - _cControl.ID = "TabView1"; - - _cControl.Width = Unit.Pixel(666); - _cControl.Height = Unit.Pixel(666); - - // Add preview button - - foreach (uicontrols.TabPage tp in _cControl.GetPanels()) - { - AddPreviewButton(tp.Menu, _document.Id); - } - - plc.Controls.Add(_cControl); - - - var publishStatus = new PlaceHolder(); - if (_documentHasPublishedVersion) - { - _littPublishStatus.Text = ui.Text("content", "lastPublished", UmbracoUser) + ": " + _document.VersionDate.ToShortDateString() + "   "; - - publishStatus.Controls.Add(_littPublishStatus); - if (UmbracoUser.GetPermissions(_document.Path).IndexOf("U") > -1) - _unPublish.Visible = true; - else - _unPublish.Visible = false; - } - else - { - _littPublishStatus.Text = ui.Text("content", "itemNotPublished", UmbracoUser); - publishStatus.Controls.Add(_littPublishStatus); - _unPublish.Visible = false; - } - - _unPublish.Text = ui.Text("content", "unPublish", UmbracoUser); - _unPublish.ID = "UnPublishButton"; - _unPublish.Attributes.Add("onClick", "if (!confirm('" + ui.Text("defaultdialogs", "confirmSure", UmbracoUser) + "')) return false; "); - publishStatus.Controls.Add(_unPublish); - - _publishProps.addProperty(ui.Text("content", "publishStatus", UmbracoUser), publishStatus); - - // Template - var template = new PlaceHolder(); - var documentType = new DocumentType(_document.ContentType.Id); - _cControl.PropertiesPane.addProperty(ui.Text("documentType"), new LiteralControl(documentType.Text)); - - - //template picker - _cControl.PropertiesPane.addProperty(ui.Text("template"), template); - int defaultTemplate; - if (_document.Template != 0) - defaultTemplate = _document.Template; - else - defaultTemplate = documentType.DefaultTemplate; - - if (UmbracoUser.UserType.Name == "writer") - { - if (defaultTemplate != 0) - template.Controls.Add(new LiteralControl(businesslogic.template.Template.GetTemplate(defaultTemplate).Text)); - else - template.Controls.Add(new LiteralControl(ui.Text("content", "noDefaultTemplate"))); - } - else - { - _ddlDefaultTemplate.Items.Add(new ListItem(ui.Text("choose") + "...", "")); - foreach (var t in documentType.allowedTemplates) - { - - var tTemp = new ListItem(t.Text, t.Id.ToString()); - if (t.Id == defaultTemplate) - tTemp.Selected = true; - _ddlDefaultTemplate.Items.Add(tTemp); - } - template.Controls.Add(_ddlDefaultTemplate); - } - - - // Editable update date, release date and expire date added by NH 13.12.04 - _dp.ID = "updateDate"; - _dp.Text = _document.UpdateDate.ToShortDateString() + " " + _document.UpdateDate.ToShortTimeString(); - _publishProps.addProperty(ui.Text("content", "updateDate", UmbracoUser), _dp); - - _dpRelease.ID = "releaseDate"; - _dpRelease.DateTime = _document.ReleaseDate; - _dpRelease.ShowTime = true; - _publishProps.addProperty(ui.Text("content", "releaseDate", UmbracoUser), _dpRelease); - - _dpExpire.ID = "expireDate"; - _dpExpire.DateTime = _document.ExpireDate; - _dpExpire.ShowTime = true; - _publishProps.addProperty(ui.Text("content", "expireDate", UmbracoUser), _dpExpire); - - _cControl.Save += Save; - _cControl.SaveAndPublish += Publish; - _cControl.SaveToPublish += SendToPublish; - - // Add panes to property page... - _cControl.tpProp.Controls.AddAt(1, _publishProps); - _cControl.tpProp.Controls.AddAt(2, _linkProps); - - // add preview to properties pane too - AddPreviewButton(_cControl.tpProp.Menu, _document.Id); - - - } - - protected void Page_Load(object sender, EventArgs e) - { - if (!_contentId.HasValue) - return; - - if (!CheckUserValidation()) - return; - - // clear preview cookie - // zb-00004 #29956 : refactor cookies names & handling - StateHelper.Cookies.Preview.Clear(); - - if (!IsPostBack) - { - - Log.Add(LogTypes.Open, UmbracoUser, _document.Id, ""); - ClientTools.SyncTree(_document.Path, false); - } - - - jsIds.Text = "var umbPageId = " + _document.Id.ToString() + ";\nvar umbVersionId = '" + _document.Version.ToString() + "';\n"; - - } - - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - UpdateNiceUrls(); - } - - /// - /// Handles the Save event for the ContentControl. - /// - /// - /// - /// - /// This will set the document's properties and persist a new document revision - /// - protected void Save(object sender, EventArgs e) - { - //NOTE: This is only here because we have to keep backwards compatibility with events in the ContentControl. - // see: http://issues.umbraco.org/issue/U4-1660 - // in this case both Save and SaveAndPublish will fire when we are publishing but we only want to handle that once, - // so if this is actually doing a publish, we'll exit and rely on the SaveAndPublish handler to do all the work. - if (_cControl.DoesPublish) - { - return; - } - - //update UI and set document properties - PerformSaveLogic(); - - //persist the document - _document.Save(); - - // Run Handler - BusinessLogic.Actions.Action.RunActionHandlers(_document, ActionUpdate.Instance); - - ClientTools.ShowSpeechBubble( - speechBubbleIcon.save, ui.Text("speechBubbles", "editContentSavedHeader"), - ui.Text("speechBubbles", "editContentSavedText")); - - ClientTools.SyncTree(_document.Path, true); - } - - /// - /// Handles the SendToPublish event - /// - /// - /// - protected void SendToPublish(object sender, EventArgs e) - { - if (Page.IsValid) - { - ClientTools.ShowSpeechBubble( - speechBubbleIcon.save, ui.Text("speechBubbles", "editContentSendToPublish", UmbracoUser), - ui.Text("speechBubbles", "editContentSendToPublishText", UmbracoUser)); - _document.SendToPublication(UmbracoUser); - } - } - - /// - /// Handles the SaveAndPublish event - /// - /// - /// - /// - /// Sets the document's properties and if the page is valid continues to publish it, otherwise just saves a revision. - /// - protected void Publish(object sender, EventArgs e) - { - //update UI and set document properties - PerformSaveLogic(); - - //the business logic here will check to see if the doc can actually be published and will return the - // appropriate result so we can display the correct error messages (or success). - var savePublishResult = _document.SaveAndPublishWithResult(UmbracoUser); - - ShowMessageForStatus(savePublishResult.Result); - - if (savePublishResult.Success) - { - _littPublishStatus.Text = string.Format("{0}: {1}
    ", ui.Text("content", "lastPublished", UmbracoUser), _document.VersionDate.ToString()); - - if (UmbracoUser.GetPermissions(_document.Path).IndexOf("U") > -1) - { - _unPublish.Visible = true; - } - - _documentHasPublishedVersion = _document.Content.HasPublishedVersion(); - } - - ClientTools.SyncTree(_document.Path, true); - } - - private void ShowMessageForStatus(PublishStatus status) - { - switch (status.StatusType) - { - case PublishStatusType.Success: - case PublishStatusType.SuccessAlreadyPublished: - ClientTools.ShowSpeechBubble( - speechBubbleIcon.save, - ui.Text("speechBubbles", "editContentPublishedHeader", UmbracoUser), - ui.Text("speechBubbles", "editContentPublishedText", UmbracoUser)); - break; - case PublishStatusType.FailedPathNotPublished: - ClientTools.ShowSpeechBubble( - speechBubbleIcon.warning, - ui.Text("publish"), - ui.Text("publish", "contentPublishedFailedByParent", - string.Format("{0} ({1})", status.ContentItem.Name, status.ContentItem.Id), - UmbracoUser).Trim()); - break; - case PublishStatusType.FailedCancelledByEvent: - ClientTools.ShowSpeechBubble( - speechBubbleIcon.warning, - ui.Text("publish"), - ui.Text("speechBubbles", "contentPublishedFailedByEvent")); - break; - case PublishStatusType.FailedHasExpired: - case PublishStatusType.FailedAwaitingRelease: - case PublishStatusType.FailedIsTrashed: - case PublishStatusType.FailedContentInvalid: - ClientTools.ShowSpeechBubble( - speechBubbleIcon.warning, - ui.Text("publish"), - ui.Text("publish", "contentPublishedFailedInvalid", - new[] - { - string.Format("{0} ({1})", status.ContentItem.Name, status.ContentItem.Id), - string.Join(",", status.InvalidProperties.Select(x => x.Alias)) - }, - UmbracoUser).Trim()); - break; - default: - throw new IndexOutOfRangeException(); - } - } - - protected void UnPublishDo(object sender, EventArgs e) - { - _document.UnPublish(); - _littPublishStatus.Text = ui.Text("content", "itemNotPublished", UmbracoUser); - _unPublish.Visible = false; - _documentHasPublishedVersion = false; - - //library.UnPublishSingleNode(_document.Id); - - Current.ClientTools.SyncTree(_document.Path, true); - ClientTools.ShowSpeechBubble(speechBubbleIcon.success, ui.Text("unpublish"), ui.Text("speechBubbles", "contentUnpublished")); - - //newPublishStatus.Text = "0"; - } - - void UpdateNiceUrlProperties(string niceUrlText, string altUrlsText) - { - _linkProps.Controls.Clear(); - - var lit = new Literal(); - lit.Text = niceUrlText; - _linkProps.addProperty(ui.Text("content", "urls", UmbracoUser), lit); - - if (!string.IsNullOrWhiteSpace(altUrlsText)) - { - lit = new Literal(); - lit.Text = altUrlsText; - _linkProps.addProperty(ui.Text("content", "alternativeUrls", UmbracoUser), lit); - } - } - - void UpdateNiceUrls() - { - if (_documentHasPublishedVersion == false) - { - UpdateNiceUrlProperties("" + ui.Text("content", "itemNotPublished", UmbracoUser) + "", null); - return; - } - - var urlProvider = Umbraco.Web.UmbracoContext.Current.RoutingContext.UrlProvider; - var url = urlProvider.GetUrl(_document.Id); - string niceUrlText = null; - var altUrlsText = new System.Text.StringBuilder(); - - if (url == "#") - { - // document as a published version yet it's url is "#" => a parent must be - // unpublished, walk up the tree until we find it, and report. - var parent = _document; - do - { - parent = parent.ParentId > 0 ? new Document(parent.ParentId) : null; - } - while (parent != null && parent.Published); - - if (parent == null) // oops - internal error - niceUrlText = "" + ui.Text("content", "parentNotPublishedAnomaly", UmbracoUser) + ""; - else - niceUrlText = "" + ui.Text("content", "parentNotPublished", parent.Text, UmbracoUser) + ""; - } - else - { - niceUrlText = string.Format("{0}", url); - - foreach (var otherUrl in urlProvider.GetOtherUrls(_document.Id)) - altUrlsText.AppendFormat("{0}
    ", otherUrl); - } - - UpdateNiceUrlProperties(niceUrlText, altUrlsText.ToString()); - } - - /// - /// When a document is saved or published all of this logic must be performed. - /// - /// - /// This updates both UI controls and business logic object properties but does not persist any data to - /// business logic repositories. - /// - private void PerformSaveLogic() - { - // error handling test - if (!Page.IsValid) - { - foreach (uicontrols.TabPage tp in _cControl.GetPanels()) - { - tp.ErrorControl.Visible = true; - tp.ErrorHeader = ui.Text("errorHandling", "errorButDataWasSaved"); - tp.CloseCaption = ui.Text("close"); - } - } - else if (Page.IsPostBack) - { - // hide validation summaries - foreach (uicontrols.TabPage tp in _cControl.GetPanels()) - { - tp.ErrorControl.Visible = false; - } - } - - if (_dpRelease.DateTime > new DateTime(1753, 1, 1) && _dpRelease.DateTime < new DateTime(9999, 12, 31)) - _document.ReleaseDate = _dpRelease.DateTime; - else - _document.ReleaseDate = new DateTime(1, 1, 1, 0, 0, 0); - if (_dpExpire.DateTime > new DateTime(1753, 1, 1) && _dpExpire.DateTime < new DateTime(9999, 12, 31)) - _document.ExpireDate = _dpExpire.DateTime; - else - _document.ExpireDate = new DateTime(1, 1, 1, 0, 0, 0); - - // Update default template - if (_ddlDefaultTemplate.SelectedIndex > 0) - { - _document.Template = int.Parse(_ddlDefaultTemplate.SelectedValue); - } - else - { - if (new DocumentType(_document.ContentType.Id).allowedTemplates.Length == 0) - { - _document.RemoveTemplate(); - } - } - - //The value of the properties has been set on IData through IDataEditor in the ContentControl - //so we need to 'retrieve' that value and set it on the property of the new IContent object. - //NOTE This is a workaround for the legacy approach to saving values through the DataType instead of the Property - //- (The DataType shouldn't be responsible for saving the value - especically directly to the db). - foreach (var item in _cControl.DataTypes) - { - _document.getProperty(item.Key).Value = item.Value.Data.Value; - } - - // Update the update date - _dp.Text = _document.UpdateDate.ToShortDateString() + " " + _document.UpdateDate.ToShortTimeString(); - } - - /// - /// Clears the page of all controls and shows a simple message. Used if users don't have visible access to the page. - /// - /// - private void ShowUserValidationError(string message) - { - this.Controls.Clear(); - this.Controls.Add(new LiteralControl(String.Format("

    Access denied

    Access denied{0}
    ", message))); - } - - /// - /// Checks if the user cannot view/browse this page/app and displays an html message to the user if this is not the case. - /// - /// - private bool CheckUserValidation() - { - // Validate permissions - if (!base.ValidateUserApp(Constants.Applications.Content)) - { - ShowUserValidationError("

    The current user doesn't have access to this application

    Please contact the system administrator if you think that you should have access.

    "); - return false; - } - if (!ValidateUserNodeTreePermissions(_document.Path, ActionBrowse.Instance.Letter.ToString())) - { - ShowUserValidationError( - "

    The current user doesn't have permissions to browse this document

    Please contact the system administrator if you think that you should have access.

    "); - return false; - } - //TODO: Change this, when we add view capabilities, the user will be able to view but not edit! - if (!ValidateUserNodeTreePermissions(_document.Path, ActionUpdate.Instance.Letter.ToString())) - { - ShowUserValidationError("

    The current user doesn't have permissions to edit this document

    Please contact the system administrator if you think that you should have access.

    "); - return false; - } - return true; - } - - private void AddPreviewButton(uicontrols.ScrollingMenu menu, int id) - { - uicontrols.MenuIconI menuItem; - - // Find the first splitter in the Menu - Should be the rte toolbar's splitter - var startIndex = menu.FindSplitter(1); - - if (startIndex == -1) - { - // No Splitter found - rte toolbar isn't loaded - menu.InsertSplitter(); - menuItem = menu.NewIcon(); - } - else - { - // Rte toolbar is loaded, inject after it's Splitter - menuItem = menu.NewIcon(startIndex + 1); - menu.InsertSplitter(startIndex + 2); - } - - menuItem.ImageURL = SystemDirectories.Umbraco + "/images/editor/vis.gif"; - - if (EnablePreviewButton()) - { - menuItem.AltText = ui.Text("buttons", "showPage", UmbracoUser); - menuItem.OnClickCommand = "window.open('dialogs/preview.aspx?id=" + id + "','umbPreview')"; - } - else - { - var showPageDisabledText = ui.Text("buttons", "showPageDisabled", UmbracoUser); - if (showPageDisabledText.StartsWith("[")) - showPageDisabledText = ui.GetText("buttons", "showPageDisabled", null, "en"); - - menuItem.AltText = showPageDisabledText; - ((Image) menuItem).Attributes.Add("style", "opacity: 0.5"); - } - } - - private bool EnablePreviewButton() - { - // Fix for U4-862, if there's no template, disable the preview button - // Fixed again for U4-2587, apparently at some point "no template" changed from -1 to 0? -SJ - // Now also catches when template doesn't exist any more or is not allowed any more - // Don't think there's a better way to check if the template exists besides trying to instantiate it.. - try - { - var template = new businesslogic.template.Template(_document.Template); - // If template is found check if it's in the list of allowed templates for this document - return _document.Content.ContentType.AllowedTemplates.ToList().Any(t => t.Id == template.Id); - } - catch (Exception) { } - - return false; - } - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - - /// - /// plc control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder plc; - - /// - /// doSave control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlInputHidden doSave; - - /// - /// doPublish control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlInputHidden doPublish; - - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/editMedia.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/editMedia.aspx.cs deleted file mode 100644 index 0245097ce5..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/editMedia.aspx.cs +++ /dev/null @@ -1,191 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Xml; -using Umbraco.Core; -using umbraco.cms.businesslogic.datatype.controls; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.property; -using Umbraco.Core; - -namespace umbraco.cms.presentation -{ - /// - /// Summary description for editMedia. - /// - public partial class editMedia : BasePages.UmbracoEnsuredPage - { - private readonly uicontrols.Pane _mediaPropertiesPane = new uicontrols.Pane(); - private readonly LiteralControl _updateDateLiteral = new LiteralControl(); - private readonly LiteralControl _mediaFileLinksLiteral = new LiteralControl(); - - public editMedia() - { - CurrentApp = BusinessLogic.DefaultApps.media.ToString(); - } - - protected uicontrols.TabView TabView1; - protected TextBox documentName; - private businesslogic.media.Media _media; - controls.ContentControl _contentControl; - - override protected void OnInit(EventArgs e) - { - base.OnInit(e); - - int id = int.Parse(Request.QueryString["id"]); - - //Loading Media via new public service to ensure that the Properties are loaded correct - var media = ApplicationContext.Current.Services.MediaService.GetById(id); - _media = new cms.businesslogic.media.Media(media); - - // Save media on first load - bool exists = SqlHelper.ExecuteScalar("SELECT COUNT(nodeId) FROM cmsContentXml WHERE nodeId = @nodeId", - SqlHelper.CreateParameter("@nodeId", _media.Id)) > 0; - if (!exists) - { - _media.XmlGenerate(new XmlDocument()); - } - - _contentControl = new controls.ContentControl(_media, controls.ContentControl.publishModes.NoPublish, "TabView1"); - _contentControl.Width = Unit.Pixel(666); - _contentControl.Height = Unit.Pixel(666); - - //this must be set to false as we don't want to proceed to save anything if the page is invalid - _contentControl.SavePropertyDataWhenInvalid = false; - - plc.Controls.Add(_contentControl); - - _contentControl.Save += new System.EventHandler(Save); - - this._updateDateLiteral.ID = "updateDate"; - this._updateDateLiteral.Text = _media.VersionDate.ToShortDateString() + " " + _media.VersionDate.ToShortTimeString(); - - this._mediaFileLinksLiteral.ID = "mediaFileLinks"; - _mediaPropertiesPane.addProperty(ui.Text("content", "updateDate", base.getUser()), this._updateDateLiteral); - - this.UpdateMediaFileLinksLiteral(); - _mediaPropertiesPane.addProperty(ui.Text("content", "mediaLinks"), this._mediaFileLinksLiteral); - - // add the property pane to the page rendering - _contentControl.tpProp.Controls.AddAt(1, _mediaPropertiesPane); - } - - protected void Page_Load(object sender, System.EventArgs e) - { - if (!IsPostBack) - { - ClientTools.SyncTree(_media.Path, false); - } - } - - protected void Save(object sender, EventArgs e) - { - // do not continue saving anything if the page is invalid! - // http://issues.umbraco.org/issue/U4-227 - if (!Page.IsValid) - { - foreach (uicontrols.TabPage tp in _contentControl.GetPanels()) - { - tp.ErrorControl.Visible = true; - tp.ErrorHeader = ui.Text("errorHandling", "errorHeader"); - tp.CloseCaption = ui.Text("close"); - } - } - else - { - if (Page.IsPostBack) - { - // hide validation summaries - foreach (uicontrols.TabPage tp in _contentControl.GetPanels()) - { - tp.ErrorControl.Visible = false; - } - } - - //The value of the properties has been set on IData through IDataEditor in the ContentControl - //so we need to 'retrieve' that value and set it on the property of the new IContent object. - //NOTE This is a workaround for the legacy approach to saving values through the DataType instead of the Property - //- (The DataType shouldn't be responsible for saving the value - especically directly to the db). - foreach (var item in _contentControl.DataTypes) - { - _media.getProperty(item.Key).Value = item.Value.Data.Value; - } - - _media.Save(); - - this._updateDateLiteral.Text = _media.VersionDate.ToShortDateString() + " " + _media.VersionDate.ToShortTimeString(); - this.UpdateMediaFileLinksLiteral(); - - _media.XmlGenerate(new XmlDocument()); - ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editMediaSaved"), ui.Text("editMediaSavedText")); - ClientTools.SyncTree(_media.Path, true); - } - } - - private void UpdateMediaFileLinksLiteral() - { - var uploadField = DataTypesResolver.Current.GetById(new Guid(Constants.PropertyEditors.UploadField)); - - // always clear, incase the upload file was removed - this._mediaFileLinksLiteral.Text = string.Empty; - - try - { - var uploadProperties = _media.GenericProperties - .Where(p => p.PropertyType.DataTypeDefinition.DataType.Id == uploadField.Id - && p.Value.ToString() != "" - && File.Exists(IOHelper.MapPath(p.Value.ToString()))); - - var properties = uploadProperties as List ?? uploadProperties.ToList(); - - if (properties.Any()) - { - this._mediaFileLinksLiteral.Text += ""; - - foreach (var property in properties) - { - this._mediaFileLinksLiteral.Text += string.Format("", property.PropertyType.Name, property.Value); - } - - this._mediaFileLinksLiteral.Text += "
    {0} {1}
    "; - } - } - catch - { - //the data type definition may not exist anymore at this point because another thread may - //have deleted it. - } - } - - /// - /// plc control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder plc; - - /// - /// doSave control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlInputHidden doSave; - - /// - /// doPublish control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlInputHidden doPublish; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs deleted file mode 100644 index f5bb290d47..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs +++ /dev/null @@ -1,307 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Globalization; -using System.Security; -using System.Web; -using System.Web.SessionState; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; -using Umbraco.Core.Configuration; -using Umbraco.Core.Logging; -using Umbraco.Core.Models.Membership; -using System.Web.Security; -using umbraco.businesslogic.Exceptions; -using umbraco.IO; -using umbraco.cms.businesslogic.web; -using System.Linq; -using Umbraco.Core; -using User = umbraco.BusinessLogic.User; - -namespace umbraco.cms.presentation -{ - /// - /// Summary description for login. - /// - [Obsolete("This class is no longer used and will be removed")] - public partial class login : BasePages.BasePage - { - [Obsolete("This property is no longer used")] - protected umbWindow treeWindow; - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - ClientLoader.DataBind(); - - // validate redirect url - string redirUrl = Request["redir"]; - if (!String.IsNullOrEmpty(redirUrl)) - { - validateRedirectUrl(redirUrl); - } - } - - - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - Button1.Text = ui.Text("general", "login"); - Panel1.Text = ui.Text("general", "welcome"); - Panel1.Style.Add("padding", "10px;"); - username.Text = ui.Text("general", "username"); - password.Text = ui.Text("general", "password"); - - // Add bottom and top texts - TopText.Text = ui.Text("login", "topText"); - - - BottomText.Text = ui.Text("login", "bottomText", DateTime.Now.Year.ToString(CultureInfo.InvariantCulture)); - - //added this little hack to remove unessary formatting, without breaking all current language files. - if (BottomText.Text.Contains("

    ")) - BottomText.Text = BottomText.Text.Substring(29).Replace("
    ", "").Replace("

    ", ""); - } - - - protected void Button1_Click(object sender, System.EventArgs e) - { - // Authenticate users by using the provider specified in umbracoSettings.config - if (Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].ValidateUser(lname.Text, passw.Text)) - { - if (Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider) - ActiveDirectoryMapping(lname.Text, Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].GetUser(lname.Text, false).Email); - - var u = new User(lname.Text); - doLogin(u); - - if (hf_height.Value != "undefined") - { - Session["windowHeight"] = hf_height.Value; - Session["windowWidth"] = hf_width.Value; - } - - string redirUrl = Request["redir"]; - - if (string.IsNullOrEmpty(redirUrl)) - Response.Redirect("umbraco.aspx"); - else if (validateRedirectUrl(redirUrl)) - { - Response.Redirect(redirUrl, true); - } - } - else - { - loginError.Visible = true; - } - } - - private bool validateRedirectUrl(string url) - { - if (!isUrlLocalToHost(url)) - { - LogHelper.Info(String.Format("Security warning: Login redirect was attempted to a site at another domain: '{0}'", url)); - - throw new UserAuthorizationException( - String.Format(@"There was attempt to redirect to '{0}' which is another domain than where you've logged in. If you clicked a link to reach this login - screen, please double check that the link came from someone you trust. You *might* have been exposed to an *attempt* to breach the security of your website. Nothing - have been compromised, though!", url)); - } - - return true; - } - - private bool isUrlLocalToHost(string url) - { - if (String.IsNullOrEmpty(url)) - { - return false; - } - - Uri absoluteUri; - if (Uri.TryCreate(url, UriKind.Absolute, out absoluteUri)) - { - return String.Equals(HttpContext.Current.Request.Url.Host, absoluteUri.Host, - StringComparison.OrdinalIgnoreCase); - } - - bool isLocal = !url.StartsWith("http:", StringComparison.OrdinalIgnoreCase) - && !url.StartsWith("https:", StringComparison.OrdinalIgnoreCase) - && Uri.IsWellFormedUriString(url, UriKind.Relative); - return isLocal; - } - - /// - /// Maps active directory account to umbraco user account - /// - /// Name of the login. - /// Email address of the user - private void ActiveDirectoryMapping(string loginName, string email) - { - // Password is not copied over because it is stored in active directory for security! - // The user is create with default access to content and as a writer user type - if (BusinessLogic.User.getUserId(loginName) == -1) - { - BusinessLogic.User.MakeNew(loginName, loginName, string.Empty, email ?? "", BusinessLogic.UserType.GetUserType(2)); - var u = new User(loginName); - u.addApplication(Constants.Applications.Content); - } - } - - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.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; - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - - /// - /// 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; - - /// - /// Panel1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoPanel Panel1; - - /// - /// TopText control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal TopText; - - /// - /// username control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label username; - - /// - /// lname control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox lname; - - /// - /// password control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label password; - - /// - /// passw control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox passw; - - /// - /// Button1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button Button1; - - /// - /// BottomText control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal BottomText; - - /// - /// hf_height control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HiddenField hf_height; - - /// - /// hf_width control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HiddenField hf_width; - - /// - /// loginError control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder loginError; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/logout.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/logout.aspx.cs deleted file mode 100644 index 15f8be030f..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/logout.aspx.cs +++ /dev/null @@ -1,28 +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; - -namespace umbraco -{ - /// - /// Summary description for logout. - /// - public partial class logout : BasePages.BasePage - { - protected void Page_Load(object sender, System.EventArgs e) - { - // Put user code to initialize the page here - if (umbracoUserContextID != "") - base.ClearLogin(); - } - - protected System.Web.UI.HtmlControls.HtmlForm Form1; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/timerModule.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/timerModule.cs deleted file mode 100644 index 2f747cf79d..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/timerModule.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Data; -using System.Threading; -using System.Web; -using Umbraco.Core.Logging; -using umbraco.BusinessLogic; - -namespace umbraco -{ - /// - /// Summary description for timerModule. - /// - public class timerModule : IHttpModule - { - protected Timer t; - - #region IHttpModule Members - - public void Init(HttpApplication context) - { - LogHelper.Debug("timer init"); - - t = new Timer(new TimerCallback(this.doStuff), context.Context, 1000, 1000); - } - - private void doStuff(object sender) - { - LogHelper.Debug("timer ping"); - } - - public void Dispose() - { - if(t != null) - t.Dispose(); - t = null; - } - - #endregion - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/umbWindow.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/umbWindow.cs deleted file mode 100644 index 4094c4fe2f..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/umbWindow.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.ComponentModel; - -namespace umbraco -{ - /// - /// Summary description for umbWindow. - /// - [DefaultProperty("Text"), ToolboxData("<{0}:umbWindow runat=server>")] - [Obsolete("This class is no longer used and will be removed from the codebase in future versions")] - public class umbWindow : System.Web.UI.WebControls.PlaceHolder - { - private string content; - private string windowName; - private int width; - private int height; - private string margin; - private bool scroll; - private bool bottomLabel = false; - private string imageUrlPreFix = ""; - private string label; - - [Bindable(true), - Category("Umbraco"), - DefaultValue("")] - public string ImageUrlPreFix - { - get {return imageUrlPreFix;} - set {imageUrlPreFix = value;} - } - - [Bindable(true), - Category("Appearance"), - DefaultValue("")] - public string Content - { - get {return content;} - set {content = value;} - } - [Bindable(true), - Category("Appearance"), - DefaultValue("")] - public int Height - { - get {return height;} - set {height = value;} - } - [Bindable(true), - Category("Appearance"), - DefaultValue("")] - public int Width - { - get {return width;} - set {width = value;} - } - [Bindable(true), - Category("Appearance"), - DefaultValue("")] - public string Margin - { - get {return margin;} - set {margin = value;} - } - [Bindable(true), - Category("Appearance"), - DefaultValue("")] - public string Label - { - get {return label;} - set {label = value;} - } - [Bindable(true), - Category("Appearance"), - DefaultValue("")] - public bool Scroll - { - get {return scroll;} - set {scroll = value;} - } - [Bindable(true), - Category("Appearance"), - DefaultValue("")] - public bool ShowBottomLabel - { - get {return bottomLabel;} - set {bottomLabel = value;} - } - [Bindable(true), - Category("Appearance"), - DefaultValue("")] - public string WindowName - { - get {return windowName;} - set {windowName = value;} - } - - protected override void Render(HtmlTextWriter output) - { - output.Write( - "
    " + - "" + - "" + - "" + - "" + - "" + - "
    \"\"\"\"
    " + label + "
    \"\"
    " + - - "" + - "" + - "" + - "" + - " " + - "" + - "
    "); - if (scroll) - output.Write( - "
    "); - else - output.Write( - "
    "); - - base.RenderChildren(output); - output.Write( - "
    " + - "
    " + - - " " + - ""); - - if (bottomLabel) - output.Write( - "" + - "" + - ""); - else - output.Write( - "" + - "" + - ""); - - output.Write( - "" + - "
    \"\"" + label + "\"\"\"\"\"\"
    "); - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/umbraco.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/umbraco.aspx.cs deleted file mode 100644 index 223cedccb3..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/umbraco.aspx.cs +++ /dev/null @@ -1,460 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -using System.Web; -using System.Web.SessionState; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; -using Umbraco.Core.IO; -using umbraco.BasePages; -using System.Xml; -using System.Xml.XPath; -using umbraco.BusinessLogic.Actions; -using ClientDependency.Core; -using System.Linq; -using System.Text; -using ClientDependency.Core.Controls; -using System.Text.RegularExpressions; - -namespace umbraco.cms.presentation -{ - /// - /// The back office rendering page - /// - public class _umbraco : UmbracoEnsuredPage - { - [Obsolete("This property is no longer used")] - protected umbWindow UmbWindow1; - protected System.Web.UI.WebControls.PlaceHolder bubbleText; - - public string DefaultApp { get; private set; } - - protected void Page_Load(object sender, System.EventArgs e) - { - var apps = UmbracoUser.Applications.ToList(); - bool userHasAccesstodefaultApp = apps.Where(x => x.alias == Umbraco.Core.Constants.Applications.Content).Count() > 0; - - // Load user module icons .. - if (apps.Count() > 1) - { - - var jsEvents = new StringBuilder(); - - PlaceHolderAppIcons.Text = ui.Text("main", "sections", UmbracoUser); - plcIcons.Text = ""; - foreach (var a in apps.OrderBy(x => x.sortOrder)) - { - - string appClass = a.icon.StartsWith(".") ? a.icon.Substring(1, a.icon.Length - 1) : a.alias; - - //adds client side event handlers to the icon buttons - jsEvents.Append(@"jQuery('." + appClass + "').click(function() { appClick.call(this, '" + a.alias + "'); } );"); - jsEvents.Append(@"jQuery('." + appClass + "').dblclick(function() { appDblClick.call(this, '" + a.alias + "'); } );"); - - string iconElement = String.Format("
  • ", appClass); - if (a.icon.StartsWith(".")) - iconElement += - "\"\"
  • "; - else - iconElement += "\"""; - plcIcons.Text += iconElement; - - } - - //registers the jquery event handlers. - Page.ClientScript.RegisterStartupScript(this.GetType(), "AppIcons", "jQuery(document).ready(function() { " + jsEvents.ToString() + " } );", true); - - } - else - PlaceHolderAppIcons.Visible = false; - - - //if user does not have access to content (ie, he's probably a translator)... - //then change the default tree app - if (!userHasAccesstodefaultApp) - { - JTree.App = apps[0].alias; - DefaultApp = apps[0].alias; - } - else - { - DefaultApp = Umbraco.Core.Constants.Applications.Content; - } - - - // Load globalized labels - treeWindow.Text = ui.Text("main", "tree", UmbracoUser); - - RenderActionJS(); - - // Version check goes here! - - // zb-00004 #29956 : refactor cookies names & handling - var updChkCookie = new umbraco.BusinessLogic.StateHelper.Cookies.Cookie("UMB_UPDCHK", GlobalSettings.VersionCheckPeriod); // was "updateCheck" - string updateCheckCookie = updChkCookie.HasValue ? updChkCookie.GetValue() : ""; - - if (GlobalSettings.VersionCheckPeriod > 0 && String.IsNullOrEmpty(updateCheckCookie) && UmbracoUser.UserType.Alias == "admin") - { - - // Add scriptmanager version check - ScriptManager sm = ScriptManager.GetCurrent(Page); - sm.Scripts.Add(new ScriptReference(SystemDirectories.Umbraco + "/js/umbracoUpgradeChecker.js")); - sm.Services.Add(new ServiceReference(SystemDirectories.WebServices + "/CheckForUpgrade.asmx")); - - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "upgradeChecker", "jQuery(document).ready(function() {umbraco.presentation.webservices.CheckForUpgrade.CallUpgradeService(umbracoCheckUpgrade);});", true); - - updChkCookie.SetValue("1"); - } - DataBind(); - - AddIe9Meta(); - } - - private void AddIe9Meta() - { - if (Request.Browser.Browser == "IE" && Request.Browser.MajorVersion == 9) - { - StringBuilder metadata = new StringBuilder(); - metadata.AppendFormat( - @" - - - - - ", - IOHelper.ResolveUrl(SystemDirectories.Umbraco + "/images/pinnedIcons/umb.ico"), - HttpContext.Current.Request.Url.Host.ToLower().Replace("www.", "")); - - var user = UmbracoUser; - if (user != null && user.Applications != null && user.Applications.Length > 0) - { - foreach (var app in user.Applications) - { - metadata.AppendFormat( - @"", - ui.Text("sections", app.alias, user), - IOHelper.ResolveUrl(string.Format("{0}/umbraco.aspx#{1}", SystemDirectories.Umbraco, app.alias)), - File.Exists( - IOHelper.MapPath( - IOHelper.ResolveUrl( - string.Format("{0}/images/pinnedIcons/task_{1}.ico", SystemDirectories.Umbraco, app.alias)))) - ? "/umbraco/images/pinnedIcons/task_" + app.alias + ".ico" - : "/umbraco/images/pinnedIcons/task_default.ico"); - } - } - - this.Header.Controls.Add(new LiteralControl(metadata.ToString())); - } - } - - /// - /// Renders out all JavaScript references that have bee declared in IActions - /// - private void RenderActionJS() - { - var item = 0; - foreach (var jsFile in umbraco.BusinessLogic.Actions.Action.GetJavaScriptFileReferences()) - { - //validate that this is a url, if it is not, we'll assume that it is a text block and render it as a text - //block instead. - var isValid = true; - try - { - var jsUrl = new Uri(jsFile, UriKind.RelativeOrAbsolute); - //ok it validates, but so does alert('hello'); ! so we need to do more checks - - //here are the valid chars in a url without escaping - if (Regex.IsMatch(jsFile, @"[^a-zA-Z0-9-._~:/?#\[\]@!$&'\(\)*\+,%;=]")) - isValid = false; - - //we'll have to be smarter and just check for certain js patterns now too! - var jsPatterns = new string[] { @"\+\s*\=", @"\);", @"function\s*\(", @"!=", @"==" }; - foreach (var p in jsPatterns) - { - if (Regex.IsMatch(jsFile, p)) - { - isValid = false; - break; - } - } - - if (isValid) - { - //add to page - Page.ClientScript.RegisterClientScriptInclude(this.GetType(), item.ToString(), jsFile); - } - } - catch (UriFormatException) - { - isValid = false; - } - - if (!isValid) - { - //it is invalid, let's render it as a script block instead as devs may have written real Javascript instead - //of a JS path - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), item.ToString(), jsFile, true); - } - - item++; - } - } - - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.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; - - /// - /// CssInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude2; - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - - /// - /// JsInclude14 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude14; - - /// - /// JsInclude5 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude5; - - /// - /// JsInclude6 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude6; - - /// - /// JsInclude13 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude13; - - /// - /// JsInclude7 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude7; - - /// - /// JsInclude8 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude8; - - /// - /// JsInclude9 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude9; - - /// - /// JsInclude10 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude10; - - /// - /// JsInclude11 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude11; - - /// - /// JsInclude4 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude4; - - /// - /// JsInclude17 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude17; - - /// - /// JsInclude12 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude12; - - /// - /// JsInclude15 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude15; - - /// - /// JsInclude16 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude16; - - /// - /// 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; - - /// - /// umbracoScriptManager control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.ScriptManager umbracoScriptManager; - - /// - /// FindDocuments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel FindDocuments; - - /// - /// Search control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.presentation.Search.QuickSearch Search; - - /// - /// treeWindow control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoPanel treeWindow; - - /// - /// JTree control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.controls.Tree.TreeControl JTree; - - /// - /// PlaceHolderAppIcons control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoPanel PlaceHolderAppIcons; - - /// - /// plcIcons control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal plcIcons; - - } -}