Removed very dead code

This commit is contained in:
Rick Falkvinge
2017-01-12 20:49:34 +01:00
parent 0f6d01e211
commit 8c2e7cfe41
4 changed files with 0 additions and 254 deletions
-53
View File
@@ -1,53 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="true" Inherits="Swarmops.Pages.Security.LoginOld" Codebehind="Login-Old.aspx.cs" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href='https://fonts.googleapis.com/css?family=Permanent+Marker' rel='stylesheet' type='text/css' />
<link href='https://fonts.googleapis.com/css?family=Arimo:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css' />
<link href="../Style/style-v5.css" rel="stylesheet" type="text/css" />
<title>Swarmops Alpha - Login</title>
</head>
<body class="loginpage">
<div class="center640px">
<div style="height:100px">&nbsp;</div>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<script type="text/javascript">
//Put your JavaScript code here.
</script>
<div class="loginbox">
<div class="content">
<div class="content">
<div style="width:64px;height:64px;float:left"><img src="/Security/Images/iconshock-fingerprint-scanner-unlock-64px.png" alt="unlock icon" /></div><h1>PIRATEWEB5<span class="loginalphabetasign">&beta;</span> LOGIN</h1>
<div class="box">
<div class="content">
<div class="entryLabelsAdmin">
Login:<br />
Password:<br />
</div>
<div class="entryFieldsAdmin">
<asp:TextBox ID="TextLogin" runat="server" CssClass="textinput" />&nbsp;<br />
<asp:TextBox ID="TextPassword" runat="server" CssClass="textinput" TextMode="Password" />&nbsp;<br />
<div class="button-orange-encaps" style="float:right; margin-top:5px; margin-right:2px;margin-bottom:3px;">
<asp:Button ID="ButtonLogin" runat="server"
Text="Login" onclick="ButtonLogin_Click" CssClass="button button-orange" /></div><br clear="all" />
</div>
<div class="entryValidationAdmin">
<asp:RequiredFieldValidator ID="ValidatorRequired_Login" Text="Please enter a valid login." runat="server" Display="Dynamic" EnableClientScript="false" ControlToValidate="TextLogin" CssClass="" />&nbsp;<asp:Label ID="LabelLoginFailed" runat="server" Visible="false" Text="Login failed, please retry." /><br />
<asp:RequiredFieldValidator ID="ValidatorRequired_Password" Text="Please enter your password." runat="server" Display="Dynamic" EnableClientScript="false" ControlToValidate="TextPassword" CssClass="" />&nbsp;<br />
</div>
<div class="break"></div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</body>
</html>
-106
View File
@@ -1,106 +0,0 @@
using System;
using System.Diagnostics;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using Swarmops.Basic.Types;
using Swarmops.Basic.Types.Swarm;
using Swarmops.Interface.Support;
using Swarmops.Logic.Security;
using Swarmops.Logic.Support;
using Swarmops.Logic.Swarm;
namespace Swarmops.Pages.Security
{
public partial class LoginOld : Page
{
protected void Page_Load (object sender, EventArgs e)
{
// Check if this is the first run ever. If so, redirect to Init.
if (!SupportFunctions.DatabaseConfigured)
{
Response.Redirect ("/Pages/v5/Init/", true);
return;
}
// If this is the Dev Sandbox, autologin
if (Request.Url.Host == "dev.swarmops.com" &&
PilotInstallationIds.IsPilot (PilotInstallationIds.DevelopmentSandbox))
{
DashboardMessage.Set ("<p>You have been logged on as <strong>Sandbox Administrator</strong> to the Swarmops Development Sandbox.</p><br/><p>This machine runs the latest development build, so you may run into diagnostic code and half-finished features. All data here is bogus test data and is reset every night.</p><br/><p><strong>In other words, welcome, and play away!</strong></p><br/><br/>");
FormsAuthentication.RedirectFromLoginPage ("1,1", true);
}
// THE DAMN BITID NEEDS TO GO INTO ANDROID WALLET SO WE CAN STREAMLINE AND REWRITE THIS POS
this.LabelLoginFailed.Visible = false;
this.TextLogin.Focus();
// Check for SSL and force it
// Special case for CloudFlare deployments - there is a case where somebody will get their connections de-SSLed at the server
string cloudFlareVisitorScheme = Request.Headers["CF-Visitor"];
bool cloudFlareSsl = false;
if (!string.IsNullOrEmpty (cloudFlareVisitorScheme))
{
if (cloudFlareVisitorScheme.Contains ("\"scheme\":\"https\""))
{
cloudFlareSsl = true;
}
}
// TODO: Same thing for Pound deployments
// Rewrite if applicable
if (Request.Url.ToString().StartsWith ("http://") && !cloudFlareSsl)
// only check client-side as many server sites de-SSL the connection before reaching the web server
{
if (!Request.Url.ToString().StartsWith ("http://dev.swarmops.com/") &&
!Request.Url.ToString().StartsWith ("http://localhost:") &&
!Request.Url.ToString().StartsWith ("http://swarmops-"))
{
Response.Redirect (Request.Url.ToString().Replace ("http:", "https:"));
}
}
}
protected void ButtonLogin_Click (object sender, EventArgs e)
{
string loginToken = this.TextLogin.Text;
string password = this.TextPassword.Text;
if (!string.IsNullOrEmpty (loginToken.Trim()) && !string.IsNullOrEmpty (password.Trim()))
{
try
{
BasicPerson authenticatedPerson = Authentication.Authenticate (loginToken,
password);
Person p = Person.FromIdentity (authenticatedPerson.PersonId);
if (p.PreferredCulture != Thread.CurrentThread.CurrentCulture.Name)
p.PreferredCulture = Thread.CurrentThread.CurrentCulture.Name;
// TODO: Determine logged-on organization; possibly ask for clarification
FormsAuthentication.RedirectFromLoginPage (authenticatedPerson.PersonId + ",1", true);
}
catch (Exception exception)
{
Debug.WriteLine (exception.ToString());
this.LabelLoginFailed.Text = exception.ToString();
this.LabelLoginFailed.Visible = true;
this.TextLogin.Focus();
}
}
}
}
}
-87
View File
@@ -1,87 +0,0 @@
//------------------------------------------------------------------------------
// <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 Swarmops.Pages.Security {
public partial class LoginOld {
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// ScriptManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.ScriptManager ScriptManager1;
/// <summary>
/// TextLogin control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox TextLogin;
/// <summary>
/// TextPassword control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox TextPassword;
/// <summary>
/// ButtonLogin control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button ButtonLogin;
/// <summary>
/// ValidatorRequired_Login control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator ValidatorRequired_Login;
/// <summary>
/// LabelLoginFailed control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label LabelLoginFailed;
/// <summary>
/// ValidatorRequired_Password control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator ValidatorRequired_Password;
}
}
-8
View File
@@ -565,13 +565,6 @@
<Compile Include="Security\FinalizeLogin.aspx.designer.cs">
<DependentUpon>FinalizeLogin.aspx</DependentUpon>
</Compile>
<Compile Include="Security\Login-Old.aspx.cs">
<DependentUpon>Login-Old.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Security\Login-Old.aspx.designer.cs">
<DependentUpon>Login-Old.aspx</DependentUpon>
</Compile>
<Compile Include="Security\Login.aspx.cs">
<DependentUpon>Login.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -1762,7 +1755,6 @@
<Content Include="Security\Images\iconshock-foreign-key-24px.png" />
<Content Include="Security\Images\iconshock-greentick-16px.png" />
<Content Include="Security\Images\Swarmops-Logo.png" />
<Content Include="Security\Login-Old.aspx" />
<Content Include="Security\Login.aspx" />
<Content Include="Security\RequestPasswordReset.aspx" />
<Content Include="Security\ResetPassword.aspx" />