Revert "Latest"

This reverts commit 95a9e4b5ff.
This commit is contained in:
TimoPerplex
2015-10-27 13:10:25 +01:00
parent 95a9e4b5ff
commit 43baba1733
4 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="umbraco.aspx.cs" Inherits="Umbraco.Web.UI.Umbraco.umbraco" %>

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Umbraco.Core.Configuration;
namespace Umbraco.Web.UI.Umbraco
{
public partial class umbraco : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location", GlobalSettings.Path);
}
}
}

View File

@@ -0,0 +1,15 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Umbraco.Web.UI.Umbraco {
public partial class umbraco {
}
}

View File

@@ -0,0 +1,42 @@
<%@ Page Language="C#" %>
<%@ Import Namespace="Umbraco.Core" %>
<%@ Import Namespace="Umbraco.Core.IO" %>
<%@ Import Namespace="Umbraco.Web" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
// This page is here purely to deal with legacy logout redirects.
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
//We need to check the token in the URL to ensure it is correct otherwise malicious GET requests using CSRF attacks
// can easily just log the user out.
var token = Request["t"];
//only perform the logout if the token matches
if (token.IsNullOrWhiteSpace() == false && token == UmbracoContext.Current.Security.GetSessionId())
{
//ensure the person is definitely logged out
UmbracoContext.Current.Security.ClearCurrentLogin();
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Logout</title>
<script type="text/javascript">
//if this is not the top window, we'll assume we're in an iframe
// so we actually won't do anything. Otherwise if this is the top window
// we'll redirect to the login dialog
if (window == top) {
document.location.href = '<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco).EnsureEndsWith('/') + "#/login" %>';
}
</script>
</head>
<body>
</body>
</html>