mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
Begin admin panel work.
This commit is contained in:
parent
4fd98597b8
commit
46b4bb61a8
9 changed files with 643 additions and 0 deletions
6
ShiftOS.Server.WebAdmin/App.config
Normal file
6
ShiftOS.Server.WebAdmin/App.config
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
188
ShiftOS.Server.WebAdmin/Program.cs
Normal file
188
ShiftOS.Server.WebAdmin/Program.cs
Normal file
|
@ -0,0 +1,188 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Nancy;
|
||||
using Nancy.Authentication.Forms;
|
||||
using Nancy.Bootstrapper;
|
||||
using Nancy.Hosting.Self;
|
||||
using Nancy.Security;
|
||||
using Nancy.TinyIoc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ShiftOS.Server.WebAdmin
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var HostConf = new HostConfiguration();
|
||||
HostConf.UrlReservations.CreateAutomatically = true;
|
||||
|
||||
using(var nancy = new NancyHost(HostConf, new Uri("http://localhost:13371/mudadmin")))
|
||||
{
|
||||
nancy.Start();
|
||||
Console.WriteLine($"[{DateTime.Now}] <AdminPanel/NancyInit> Initiating on localhost:13371...");
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class PageBuilder
|
||||
{
|
||||
public static string Build(string page)
|
||||
{
|
||||
string templatehtml = Properties.Resources.HtmlTemplate;
|
||||
switch (page)
|
||||
{
|
||||
case "login":
|
||||
templatehtml = templatehtml.Replace("{body}", Properties.Resources.LoginView);
|
||||
break;
|
||||
}
|
||||
return templatehtml;
|
||||
}
|
||||
}
|
||||
|
||||
public class MudUserIdentity : IUserIdentity
|
||||
{
|
||||
public MudUserIdentity(string username)
|
||||
{
|
||||
_username = username;
|
||||
}
|
||||
|
||||
public IEnumerable<string> Claims
|
||||
{
|
||||
get
|
||||
{
|
||||
return SystemManager.GetClaims(_username);
|
||||
}
|
||||
}
|
||||
|
||||
private string _username = "";
|
||||
|
||||
public string UserName
|
||||
{
|
||||
get
|
||||
{
|
||||
return _username;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class SystemManager
|
||||
{
|
||||
public static List<string> GetClaims(string username)
|
||||
{
|
||||
foreach (var user in JsonConvert.DeserializeObject<List<MudUser>>(ShiftOS.Server.Program.ReadEncFile("users.json")))
|
||||
{
|
||||
if(user.Username == username)
|
||||
{
|
||||
return user.Claims;
|
||||
}
|
||||
}
|
||||
return new List<string>(new[] { "User" });
|
||||
}
|
||||
|
||||
public static bool Login(string username, string password, out Guid id)
|
||||
{
|
||||
foreach (var user in JsonConvert.DeserializeObject<List<MudUser>>(ShiftOS.Server.Program.ReadEncFile("users.json")))
|
||||
{
|
||||
if (user.Username == username && user.Password == Encryption.Encrypt(password))
|
||||
{
|
||||
id = user.ID;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
id = new Guid();
|
||||
return false;
|
||||
}
|
||||
|
||||
public static MudUserIdentity GetIdentity(Guid id)
|
||||
{
|
||||
foreach (var user in JsonConvert.DeserializeObject<List<MudUser>>(ShiftOS.Server.Program.ReadEncFile("users.json")))
|
||||
{
|
||||
if (user.ID == id)
|
||||
{
|
||||
return new WebAdmin.MudUserIdentity(user.Username);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public class MudUser
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public List<string> Claims { get; set; }
|
||||
public Guid ID { get; set; }
|
||||
}
|
||||
|
||||
public class MudBootstrapper : DefaultNancyBootstrapper
|
||||
{
|
||||
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
|
||||
{
|
||||
var formsAuthConfiguration = new FormsAuthenticationConfiguration();
|
||||
formsAuthConfiguration.RedirectUrl = "~/login";
|
||||
formsAuthConfiguration.UserMapper = container.Resolve<IUserMapper>();
|
||||
FormsAuthentication.Enable(pipelines, formsAuthConfiguration);
|
||||
base.ApplicationStartup(container, pipelines);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class MudUserMapper : IUserMapper
|
||||
{
|
||||
public IUserIdentity GetUserFromIdentifier(Guid identifier, NancyContext context)
|
||||
{
|
||||
return SystemManager.GetIdentity(identifier);
|
||||
}
|
||||
}
|
||||
|
||||
public class LoginModule : NancyModule
|
||||
{
|
||||
public LoginModule()
|
||||
{
|
||||
Get["/login"] = parameters =>
|
||||
{
|
||||
return PageBuilder.Build("login");
|
||||
};
|
||||
|
||||
Get["/logout"] = parameters =>
|
||||
{
|
||||
return this.Logout("/");
|
||||
};
|
||||
|
||||
Post["/login"] = parameters =>
|
||||
{
|
||||
Guid id = new Guid();
|
||||
if (SystemManager.Login(parameters.username, parameters.password, out id) == true)
|
||||
{
|
||||
return this.Login(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PageBuilder.Build("loginFailed");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class UserModule : NancyModule
|
||||
{
|
||||
public UserModule()
|
||||
{
|
||||
this.RequiresAuthentication();
|
||||
this.RequiresClaims("User");
|
||||
Get["/"] = _ =>
|
||||
{
|
||||
return PageBuilder.Build("status");
|
||||
};
|
||||
Get["/status"] = _ =>
|
||||
{
|
||||
return PageBuilder.Build("status");
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
36
ShiftOS.Server.WebAdmin/Properties/AssemblyInfo.cs
Normal file
36
ShiftOS.Server.WebAdmin/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ShiftOS.Server.WebAdmin")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ShiftOS.Server.WebAdmin")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("b29fdd06-e6fe-40a2-8258-283728ced81a")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
102
ShiftOS.Server.WebAdmin/Properties/Resources.Designer.cs
generated
Normal file
102
ShiftOS.Server.WebAdmin/Properties/Resources.Designer.cs
generated
Normal file
|
@ -0,0 +1,102 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ShiftOS.Server.WebAdmin.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ShiftOS.Server.WebAdmin.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <html>
|
||||
/// <head>
|
||||
/// <title>Multi-user domain &bull; ShiftOS</title>
|
||||
/// <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
///
|
||||
/// <link rel="stylesheet" href="css/theme.css"/>
|
||||
///
|
||||
/// <!-- Latest compiled and minified JavaScript -->
|
||||
/// <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkf [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string HtmlTemplate {
|
||||
get {
|
||||
return ResourceManager.GetString("HtmlTemplate", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <h3>Access denied.</h3>
|
||||
///
|
||||
///<p>You require a higher authentication level to access this part of the multi-user domain. Please enter the username and password of whom has access to this sector.</p>
|
||||
///
|
||||
///<form method="post" action="">
|
||||
/// <table class="table">
|
||||
/// <tr>
|
||||
/// <td><strong>Username:</strong></td>
|
||||
/// <td><input class="form-control" type="text" name="username"/></td>
|
||||
/// </tr>
|
||||
/// <tr>
|
||||
/// <td><strong>Password:</strong></td>
|
||||
/// <td><input class="form-control" type="password" name="password"/></td>
|
||||
/// </tr [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string LoginView {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginView", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
127
ShiftOS.Server.WebAdmin/Properties/Resources.resx
Normal file
127
ShiftOS.Server.WebAdmin/Properties/Resources.resx
Normal file
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="HtmlTemplate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\HtmlTemplate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="LoginView" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\LoginView.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
52
ShiftOS.Server.WebAdmin/Resources/HtmlTemplate.txt
Normal file
52
ShiftOS.Server.WebAdmin/Resources/HtmlTemplate.txt
Normal file
|
@ -0,0 +1,52 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Multi-user domain • ShiftOS</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
|
||||
<link rel="stylesheet" href="css/theme.css"/>
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Sidebar -->
|
||||
<div id="sidebar-wrapper">
|
||||
<ul class="sidebar-nav">
|
||||
<li class="sidebar-brand">
|
||||
<a href="http://getshiftos.ml/">
|
||||
<img src="https://cdn.discordapp.com/attachments/241613675545231360/280020406528901131/unknown.png"/>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/status">System status</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/saves">Test subjects</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/shiftnet">Shiftnet</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/scripts">Scripts</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/legions">Legions</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/shops">Shops</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/help">Help</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /#sidebar-wrapper -->
|
||||
|
||||
<!-- Page Content -->
|
||||
<div id="page-content-wrapper">
|
||||
<div class="container-fluid">
|
||||
{body}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
20
ShiftOS.Server.WebAdmin/Resources/LoginView.txt
Normal file
20
ShiftOS.Server.WebAdmin/Resources/LoginView.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
<h3>Access denied.</h3>
|
||||
|
||||
<p>You require a higher authentication level to access this part of the multi-user domain. Please enter the username and password of whom has access to this sector.</p>
|
||||
|
||||
<form method="post" action="">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td><strong>Username:</strong></td>
|
||||
<td><input class="form-control" type="text" name="username"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Password:</strong></td>
|
||||
<td><input class="form-control" type="password" name="password"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" class="btn btn-default">Login</input>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
104
ShiftOS.Server.WebAdmin/ShiftOS.Server.WebAdmin.csproj
Normal file
104
ShiftOS.Server.WebAdmin/ShiftOS.Server.WebAdmin.csproj
Normal file
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B29FDD06-E6FE-40A2-8258-283728CED81A}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ShiftOS.Server.WebAdmin</RootNamespace>
|
||||
<AssemblyName>ShiftOS.Server.WebAdmin</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Nancy, Version=1.4.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Nancy.1.4.3\lib\net40\Nancy.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Nancy.Authentication.Forms, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Nancy.Authentication.Forms.1.4.1\lib\net40\Nancy.Authentication.Forms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Nancy.Authentication.Stateless, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Nancy.Authentication.Stateless.1.4.1\lib\net40\Nancy.Authentication.Stateless.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Nancy.Hosting.Self, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Nancy.Hosting.Self.1.4.1\lib\net40\Nancy.Hosting.Self.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ShiftOS.Server\ShiftOS.Server.csproj">
|
||||
<Project>{226c63b4-e60d-4949-b4e7-7a2ddbb96776}</Project>
|
||||
<Name>ShiftOS.Server</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\HtmlTemplate.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\LoginView.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
8
ShiftOS.Server.WebAdmin/packages.config
Normal file
8
ShiftOS.Server.WebAdmin/packages.config
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Nancy" version="1.4.3" targetFramework="net452" />
|
||||
<package id="Nancy.Authentication.Forms" version="1.4.1" targetFramework="net452" />
|
||||
<package id="Nancy.Authentication.Stateless" version="1.4.1" targetFramework="net452" />
|
||||
<package id="Nancy.Hosting.Self" version="1.4.1" targetFramework="net452" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
|
||||
</packages>
|
Loading…
Reference in a new issue