Showing preview only (395K chars total). Download the full file or copy to clipboard to get everything.
Repository: moemura/AdminLTE.Core
Branch: master
Commit: 70c980db55d0
Files: 132
Total size: 357.6 KB
Directory structure:
gitextract_2k0n1zd6/
├── .gitignore
├── AdminLTE.sln.DotSettings
├── AdminLTE.slnx
├── LICENSE
├── README.md
└── src/
└── AdminLTE/
├── AdminLTE.csproj
├── Common/
│ ├── Attributes/
│ │ └── HelpDefinitionAttribute.cs
│ ├── CustomClaimTypes.cs
│ ├── Extensions/
│ │ └── IdentityExtension.cs
│ ├── GlobalHelper.cs
│ └── ModuleHelper.cs
├── Controllers/
│ ├── AccountController.cs
│ ├── BaseController.cs
│ ├── HomeController.cs
│ ├── ManageController.cs
│ ├── RoleController.cs
│ ├── SuperAdminController.cs
│ └── UserLogsController.cs
├── Data/
│ ├── AppClaimsPrincipalFactory.cs
│ ├── ApplicationDbContext.cs
│ ├── AuditableSignInManager.cs
│ ├── DataSeed.cs
│ └── Migrations/
│ ├── 00000000000000_CreateIdentitySchema.Designer.cs
│ ├── 00000000000000_CreateIdentitySchema.cs
│ ├── 20160801092435_ExtendASPNetUser.Designer.cs
│ ├── 20160801092435_ExtendASPNetUser.cs
│ ├── 20160802025049_UserAuditTable.Designer.cs
│ ├── 20160802025049_UserAuditTable.cs
│ ├── 20160802083550_AddedAdditionalUserFields.Designer.cs
│ ├── 20160802083550_AddedAdditionalUserFields.cs
│ ├── 20251217031644_UpdateEF10.Designer.cs
│ ├── 20251217031644_UpdateEF10.cs
│ └── ApplicationDbContextModelSnapshot.cs
├── Models/
│ ├── AccountViewModels/
│ │ ├── ExternalLoginConfirmationViewModel.cs
│ │ ├── ForgotPasswordViewModel.cs
│ │ ├── LoginViewModel.cs
│ │ ├── RegisterViewModel.cs
│ │ ├── ResetPasswordViewModel.cs
│ │ ├── SendCodeViewModel.cs
│ │ └── VerifyCodeViewModel.cs
│ ├── ApplicationUser.cs
│ ├── ManageViewModels/
│ │ ├── AddPhoneNumberViewModel.cs
│ │ ├── ChangePasswordViewModel.cs
│ │ ├── ConfigureTwoFactorViewModel.cs
│ │ ├── FactorViewModel.cs
│ │ ├── IndexViewModel.cs
│ │ ├── ManageLoginsViewModel.cs
│ │ ├── RemoveLoginViewModel.cs
│ │ ├── SetPasswordViewModel.cs
│ │ └── VerifyPhoneNumberViewModel.cs
│ ├── Message.cs
│ ├── RoleViewModels/
│ │ ├── EditRoleVm.cs
│ │ └── ModifyRoleVm.cs
│ ├── SalesOrderDetail.cs
│ ├── SidebarMenu.cs
│ ├── SuperAdminViewModels/
│ │ └── CreateVm.cs
│ └── UserAudit.cs
├── Program.cs
├── Project_Readme.html
├── Properties/
│ └── launchSettings.json
├── Services/
│ ├── IEmailSender.cs
│ ├── ISmsSender.cs
│ ├── MessageServices.cs
│ └── RequestLoggingMiddleware.cs
├── ViewComponents/
│ ├── BreadcrumbViewComponent.cs
│ ├── ControlSidebarViewComponent.cs
│ ├── FooterViewComponent.cs
│ ├── HeaderViewComponent.cs
│ ├── MenuMessageViewComponent.cs
│ ├── MenuNotificationViewComponent.cs
│ ├── MenuTaskViewComponent.cs
│ ├── MenuUserViewComponent.cs
│ ├── PageAlertViewComponent.cs
│ ├── PageHeaderViewComponent.cs
│ └── SidebarViewComponent.cs
├── Views/
│ ├── Account/
│ │ ├── ConfirmEmail.cshtml
│ │ ├── ExternalLoginConfirmation.cshtml
│ │ ├── ExternalLoginFailure.cshtml
│ │ ├── ForgotPassword.cshtml
│ │ ├── ForgotPasswordConfirmation.cshtml
│ │ ├── Lockout.cshtml
│ │ ├── Login.cshtml
│ │ ├── Register.cshtml
│ │ ├── ResetPassword.cshtml
│ │ ├── ResetPasswordConfirmation.cshtml
│ │ ├── SendCode.cshtml
│ │ └── VerifyCode.cshtml
│ ├── Home/
│ │ ├── About.cshtml
│ │ ├── Contact.cshtml
│ │ ├── Error.cshtml
│ │ └── Index.cshtml
│ ├── Manage/
│ │ ├── AddPhoneNumber.cshtml
│ │ ├── ChangePassword.cshtml
│ │ ├── Index.cshtml
│ │ ├── ManageLogins.cshtml
│ │ ├── SetPassword.cshtml
│ │ └── VerifyPhoneNumber.cshtml
│ ├── Role/
│ │ ├── Create.cshtml
│ │ ├── Edit.cshtml
│ │ └── Index.cshtml
│ ├── Shared/
│ │ ├── Components/
│ │ │ ├── Breadcrumb/
│ │ │ │ └── Default.cshtml
│ │ │ ├── ControlSidebar/
│ │ │ │ └── Default.cshtml
│ │ │ ├── Footer/
│ │ │ │ └── Default.cshtml
│ │ │ ├── Header/
│ │ │ │ └── Default.cshtml
│ │ │ ├── MenuMessage/
│ │ │ │ └── Default.cshtml
│ │ │ ├── MenuNotification/
│ │ │ │ └── Default.cshtml
│ │ │ ├── MenuTask/
│ │ │ │ └── Default.cshtml
│ │ │ ├── MenuUser/
│ │ │ │ └── Default.cshtml
│ │ │ ├── PageAlert/
│ │ │ │ └── Default.cshtml
│ │ │ ├── PageHeader/
│ │ │ │ └── Default.cshtml
│ │ │ └── Sidebar/
│ │ │ └── Default.cshtml
│ │ ├── Error.cshtml
│ │ ├── _Layout.cshtml
│ │ ├── _LoginPartial.cshtml
│ │ └── _ValidationScriptsPartial.cshtml
│ ├── SuperAdmin/
│ │ ├── ChangePassword.cshtml
│ │ ├── Create.cshtml
│ │ ├── Edit.cshtml
│ │ └── Index.cshtml
│ ├── UserLogs/
│ │ └── Index.cshtml
│ ├── _ViewImports.cshtml
│ └── _ViewStart.cshtml
├── appsettings.json
├── bundleconfig.json
├── libman.json
├── web.config
└── wwwroot/
├── _references.js
├── css/
│ ├── animation.css
│ ├── error.css
│ └── site.css
├── files/
│ └── SalesOrderDetail.txt
└── js/
└── site.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
/src/AdminLTE/wwwroot/lib/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
================================================
FILE: AdminLTE.sln.DotSettings
================================================
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue">URL</s:String></wpf:ResourceDictionary>
================================================
FILE: AdminLTE.slnx
================================================
<Solution>
<Folder Name="/Solution Items/" />
<Folder Name="/src/">
<Project Path="src/AdminLTE/AdminLTE.csproj" />
</Folder>
</Solution>
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2016 Baltazar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# **Admin**LTE - MVC Core
This template is based from AdminLTE of http://almsaeedstudio.com.
Converted as a .Net project.
## Prerequisites
as a minimum, you should have the following installed
* Visual Studio 2022+
_built using .NET
## Installation
Just clone or fork this. Whatever you want. [Restore client side libraries](https://github.com/moemura/AdminLTE.Core/issues/1). Run the solution.
## Features
### Controls are ViewComponent like a **UserControl**
see below the body of **_Layouts.cshtml**
```html
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<!-- Main Header -->
@await Component.InvokeAsync("Header")
<!-- Left side column. contains the logo and sidebar -->
@await Component.InvokeAsync("Sidebar")
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
@await Component.InvokeAsync("PageHeader")
</div>
<div class="col-sm-6">
@await Component.InvokeAsync("Breadcrumb")
</div>
<br />
@await Component.InvokeAsync("PageAlert")
</div>
</div>
<!-- Main content -->
<section class="content">
<!-- Your Page Content Here -->
@RenderBody()
</section>
<!-- /.content -->
</div>
</div>
<!-- /.content-wrapper -->
<!-- Main Footer -->
@await Component.InvokeAsync("Footer")
<!-- Control Sidebar -->
@await Component.InvokeAsync("ControlSidebar")
<!-- /.control-sidebar -->
<!-- Add the sidebar's background. This div must be placed
immediately after the control sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
</div>
<!-- ./wrapper -->
<!-- Optionally, you can add Slimscroll and FastClick plugins.
Both of these plugins are recommended to enhance the
user experience. Slimscroll is required when using the
fixed layout. -->
@RenderSection("scripts", required: false)
<script>
useSubmitClass();
</script>
</body>
```
### List of ViewComponents
* Header
* Notification
* Messages
* Task
* User Profile
* Footer
* SideBar
* ControlSideBar (converted to HelpBar)
* PageHeader
* Breadcrumb
* Login & Logout
* Error Page
* Registration*
### ViewComponent Usage
Typically, you should inherit your Controller from `BaseController.cs` to enable convenience helpers.
**PageHeader Title & Description**
```cs
declaration:
AddPageHeader(string pageHeader = "", string pageDescription = "")
usage:
AddPageHeader("Dashboard", "");
```
**Page Alerts**
```cs
declaration:
AddPageAlerts(PageAlertType pageAlertType, string description)
usage:
AddPageAlerts(PageAlertType.Info, "you may view the summary <a href='#'>here</a>");
```
**Page Breadcrumb**
```cs
declaration:
AddBreadcrumb(string displayName, string urlPath)
usage:
AddBreadcrumb("Register", "/Account/Register");
AddBreadcrumb("Contact", "/Account/Contact");
```
**Sidebar Menus**
```cs
var sidebars = new List<SidebarMenu>();
sidebars.Add(ModuleHelper.AddHeader("MAIN NAVIGATION"));
sidebars.Add(ModuleHelper.AddModule(ModuleHelper.Module.Home));
sidebars.Add(ModuleHelper.AddModule(ModuleHelper.Module.Error, Tuple.Create(0, 0, 1)));
sidebars.Add(ModuleHelper.AddModule(ModuleHelper.Module.About, Tuple.Create(0, 1, 0)));
sidebars.Add(ModuleHelper.AddModule(ModuleHelper.Module.Contact, Tuple.Create(1, 0, 0)));
sidebars.Add(ModuleHelper.AddTree("Account"));
sidebars.Last().TreeChild = new List<SidebarMenu>()
{
ModuleHelper.AddModule(ModuleHelper.Module.Login),
ModuleHelper.AddModule(ModuleHelper.Module.Register, Tuple.Create(1, 1, 1)),
};
```
The above code will create a hierarchical sidebar like...
```
>
> LABEL
> LINK 1
> LINK 1
> LINK 1
> TREE
> > LINK
> > LINK 1|1|1
```
...where 1 is the notification color at the right side of the link via Tuple.
Tuple 0 will not display the notification whereas the position of the items will display its corresponding color notification
**Menu Notification**
This implementation is almost the same with Menu Task and Menu Message.
```cs
public class MenuNotificationViewComponent : ViewComponent
{
public MenuNotificationViewComponent()
{
}
public IViewComponentResult Invoke(string filter)
{
var messages = GetData();
return View(messages);
}
private List<Message> GetData()
{
var messages = new List<Message>();
messages.Add(new Message
{
Id = 1,
FontAwesomeIcon = "fa fa-users text-aqua",
ShortDesc = "5 new members joined today",
URLPath = "#",
});
return messages;
}
}
```
**Help Pane**
You can add page help or quick links/info by adding `[HelpDefinition]` attribute above the IActionResult method
```cs
public class HomeController : BaseController
{
[HelpDefinition]
public IActionResult Index()
{
return View();
}
```
You can still specify a filename as parameter in case you want to retrieve it on the wwwroot/files/Shared folder.
```cs
[HelpDefinition("helpdefault")]
public IActionResult Contact()
{
```
> By default, no arguments will get the path via ControllerName\CallerMethod which have the equivalent path to wwwroot/files/{ControllerName}/{CallerMethod}.html
### List of Global Javascript Events
* **Submit Button** - disabled when click once. Auto add progress spinner. No additional codes required for that implementation.
> Usage: You just simply declare the submit button. The script name is `useSubmitClass`
```html
<form asp-controller="Home" asp-action="Index" method="post">
<button class="btn btn-sm btn-primary" type="submit">Submit</button>
</form>
```
* Sidebar Collapse/ Expand
* The sidebar will save the expand & collapse state thru cookie. Using `Mozilla cookie helper`.
> The cookie name is `sidebarstate`
### List of Control Templates
* DataTable
* ...more to follow
### User Audit
The project implements middleware that audits user login activity upon `login, logout & failed login`
### Extended User Properties
The project gives some insight on how to implement extended user properties via Claims
### HTTP Logging
The project provides middleware to log `per HTTP request`.
### Authentication
This uses templated individual authentication and customized `ErrorPage` & `LoginPage`.
It also uses dependency injection that requires controllers by default to be ``[Authorized]``
without typing them on each controller/method
## Copyrights
See MIT License
================================================
FILE: src/AdminLTE/AdminLTE.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>AdminLTE</AssemblyName>
<PackageId>AdminLTE</PackageId>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-AdminLTE-c9131f1e-93fb-4772-8c8b-1d4c77bf4354</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<None Update="wwwroot\**\*;Views\**\*;Areas\**\Views">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.*" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.*">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="10.*">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="3.*" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\lib\" />
</ItemGroup>
</Project>
================================================
FILE: src/AdminLTE/Common/Attributes/HelpDefinitionAttribute.cs
================================================
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace AdminLTE.Common.Attributes
{
[AttributeUsage(AttributeTargets.Method)]
public class HelpDefinitionAttribute : ActionFilterAttribute, IActionFilter
{
private string _fileName { get; set; }
private string _memberName { get; set; }
private string _pageHelpFileName { get; set; }
public override void OnResultExecuting(ResultExecutingContext filterContext)
{
var controller = filterContext.Controller as Controller;
controller.ViewBag.PageHelpFileName = _pageHelpFileName;
}
/// <summary>
/// By declaring this on the IActionResult method, you are enabling
/// </summary>
/// <param name="fileName">specify specific filename located in wwwroot\files\Shared folder</param>
/// <param name="filePath">THIS MUST BE EMPTY</param>
/// <param name="memberName">THIS MUST BE EMPTY</param>
public HelpDefinitionAttribute(string fileName = "",[CallerFilePath] string filePath = "", [CallerMemberName] string memberName = "")
{
var controllerName = filePath.Split('\\').Last().Replace("Controller.cs", string.Empty);
if (fileName == string.Empty) //if not specified, will check it on the common help location plus path from class+method.html
{
_pageHelpFileName = controllerName + @"\" + memberName; //ChildController + ActionMethod
}
else //if specified, will check it in the common help location
{
_pageHelpFileName = @"Shared\" + fileName;
}
}
}
}
================================================
FILE: src/AdminLTE/Common/CustomClaimTypes.cs
================================================
namespace AdminLTE.Common
{
public static class CustomClaimTypes
{
#region Default ClaimTypes (taken from ClaimTypes class)
//
// Summary:
// http://schemas.xmlsoap.org/ws/2009/09/identity/claims/actor.
public const string Actor = "http://schemas.xmlsoap.org/ws/2009/09/identity/claims/actor";
//
// Summary:
// The URI for a claim that specifies the anonymous user; http://schemas.xmlsoap.org/ws/2005/05/identity/claims/anonymous.
public const string Anonymous = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/anonymous";
//
// Summary:
// The URI for a claim that specifies details about whether an identity is authenticated,
// http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authenticated.
public const string Authentication = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authentication";
//
// Summary:
// The URI for a claim that specifies the instant at which an entity was authenticated;
// http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant.
public const string AuthenticationInstant = "http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant";
//
// Summary:
// The URI for a claim that specifies the method with which an entity was authenticated;
// http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod.
public const string AuthenticationMethod = "http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod";
//
// Summary:
// The URI for a claim that specifies an authorization decision on an entity; http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authorizationdecision.
public const string AuthorizationDecision = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authorizationdecision";
//
// Summary:
// The URI for a claim that specifies the cookie path; http://schemas.microsoft.com/ws/2008/06/identity/claims/cookiepath.
public const string CookiePath = "http://schemas.microsoft.com/ws/2008/06/identity/claims/cookiepath";
//
// Summary:
// The URI for a claim that specifies the country/region in which an entity resides,
// http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country.
public const string Country = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country";
//
// Summary:
// The URI for a claim that specifies the date of birth of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth.
public const string DateOfBirth = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth";
//
// Summary:
// The URI for a claim that specifies the deny-only primary group SID on an entity;
// http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid.
// A deny-only SID denies the specified entity to a securable object.
public const string DenyOnlyPrimaryGroupSid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid";
//
// Summary:
// The URI for a claim that specifies the deny-only primary SID on an entity; http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid.
// A deny-only SID denies the specified entity to a securable object.
public const string DenyOnlyPrimarySid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid";
//
// Summary:
// The URI for a claim that specifies a deny-only security identifier (SID) for
// an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/denyonlysid.
// A deny-only SID denies the specified entity to a securable object.
public const string DenyOnlySid = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/denyonlysid";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlywindowsdevicegroup.
public const string DenyOnlyWindowsDeviceGroup = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlywindowsdevicegroup";
//
// Summary:
// The URI for a claim that specifies the DNS name associated with the computer
// name or with the alternative name of either the subject or issuer of an X.509
// certificate, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dns.
public const string Dns = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dns";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/dsa.
public const string Dsa = "http://schemas.microsoft.com/ws/2008/06/identity/claims/dsa";
//
// Summary:
// The URI for a claim that specifies the email address of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/email.
public const string Email = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/expiration.
public const string Expiration = "http://schemas.microsoft.com/ws/2008/06/identity/claims/expiration";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/expired.
public const string Expired = "http://schemas.microsoft.com/ws/2008/06/identity/claims/expired";
//
// Summary:
// The URI for a claim that specifies the gender of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender.
public const string Gender = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender";
//
// Summary:
// The URI for a claim that specifies the given name of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname.
public const string GivenName = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname";
//
// Summary:
// The URI for a claim that specifies the SID for the group of an entity, http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid.
public const string GroupSid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid";
//
// Summary:
// The URI for a claim that specifies a hash value, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/hash.
public const string Hash = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/hash";
//
// Summary:
// The URI for a claim that specifies the home phone number of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone.
public const string HomePhone = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/ispersistent.
public const string IsPersistent = "http://schemas.microsoft.com/ws/2008/06/identity/claims/ispersistent";
//
// Summary:
// The URI for a claim that specifies the locale in which an entity resides, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/locality.
public const string Locality = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/locality";
//
// Summary:
// The URI for a claim that specifies the mobile phone number of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mobilephone.
public const string MobilePhone = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mobilephone";
//
// Summary:
// The URI for a claim that specifies the name of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name.
public const string Name = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name";
//
// Summary:
// The URI for a claim that specifies the name of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier.
public const string NameIdentifier = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier";
//
// Summary:
// The URI for a claim that specifies the alternative phone number of an entity,
// http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone.
public const string OtherPhone = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone";
//
// Summary:
// The URI for a claim that specifies the postal code of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode.
public const string PostalCode = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode";
//
// Summary:
// The URI for a claim that specifies the primary group SID of an entity, http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid.
public const string PrimaryGroupSid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid";
//
// Summary:
// The URI for a claim that specifies the primary SID of an entity, http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid.
public const string PrimarySid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid";
//
// Summary:
// The URI for a claim that specifies the role of an entity, http://schemas.microsoft.com/ws/2008/06/identity/claims/role.
public const string Role = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role";
//
// Summary:
// The URI for a claim that specifies an RSA key, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/rsa.
public const string Rsa = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/rsa";
//
// Summary:
// The URI for a claim that specifies a serial number, http://schemas.microsoft.com/ws/2008/06/identity/claims/serialnumber.
public const string SerialNumber = "http://schemas.microsoft.com/ws/2008/06/identity/claims/serialnumber";
//
// Summary:
// The URI for a claim that specifies a security identifier (SID), http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid.
public const string Sid = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid";
//
// Summary:
// The URI for a claim that specifies a service principal name (SPN) claim, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn.
public const string Spn = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn";
//
// Summary:
// The URI for a claim that specifies the state or province in which an entity resides,
// http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince.
public const string StateOrProvince = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince";
//
// Summary:
// The URI for a claim that specifies the street address of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress.
public const string StreetAddress = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress";
//
// Summary:
// The URI for a claim that specifies the surname of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname.
public const string Surname = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname";
//
// Summary:
// The URI for a claim that identifies the system entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/system.
public const string System = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/system";
//
// Summary:
// The URI for a claim that specifies a thumbprint, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/thumbprint.
// A thumbprint is a globally unique SHA-1 hash of an X.509 certificate.
public const string Thumbprint = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/thumbprint";
//
// Summary:
// The URI for a claim that specifies a user principal name (UPN), http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn.
public const string Upn = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn";
//
// Summary:
// The URI for a claim that specifies a URI, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/uri.
public const string Uri = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/uri";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/userdata.
public const string UserData = "http://schemas.microsoft.com/ws/2008/06/identity/claims/userdata";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/version.
public const string Version = "http://schemas.microsoft.com/ws/2008/06/identity/claims/version";
//
// Summary:
// The URI for a claim that specifies the webpage of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage.
public const string Webpage = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage";
//
// Summary:
// The URI for a claim that specifies the Windows domain account name of an entity,
// http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname.
public const string WindowsAccountName = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdeviceclaim.
public const string WindowsDeviceClaim = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdeviceclaim";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdevicegroup.
public const string WindowsDeviceGroup = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdevicegroup";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsfqbnversion.
public const string WindowsFqbnVersion = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsfqbnversion";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/windowssubauthority.
public const string WindowsSubAuthority = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowssubauthority";
//
// Summary:
// http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsuserclaim.
public const string WindowsUserClaim = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsuserclaim";
//
// Summary:
// The URI for a distinguished name claim of an X.509 certificate, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/x500distinguishedname.
// The X.500 standard defines the methodology for defining distinguished names that
// are used by X.509 certificates.
public const string X500DistinguishedName = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/x500distinguishedname";
#endregion
public const string AvatarURL = "http://schemas.xmlsoap.org/ws/2009/09/identity/claims/avatarurl";
public const string Position = "http://schemas.xmlsoap.org/ws/2009/09/identity/claims/position";
public const string NickName = "http://schemas.xmlsoap.org/ws/2009/09/identity/claims/nickname";
public const string DateRegistered = "http://schemas.xmlsoap.org/ws/2009/09/identity/claims/dateregistered";
}
}
================================================
FILE: src/AdminLTE/Common/Extensions/IdentityExtension.cs
================================================
using System.Linq;
using System.Security.Claims;
namespace AdminLTE.Common.Extensions
{
public static class IdentityExtension
{
/// <summary>
/// //Use CustomClaimTypes when using this method
/// </summary>
/// <param name="user"></param>
/// <param name="claimType">Use [CustomClaimTypes] when using this method</param>
/// <returns></returns>
public static string GetUserProperty(this ClaimsPrincipal user, string claimType)
{
if (user.Identity.IsAuthenticated)
{
return user.Claims.FirstOrDefault(v => v.Type == claimType)?.Value ?? string.Empty;
}
return string.Empty;
}
}
}
================================================
FILE: src/AdminLTE/Common/GlobalHelper.cs
================================================
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AdminLTE.Common
{
public static class GlobalHelper
{
}
}
================================================
FILE: src/AdminLTE/Common/ModuleHelper.cs
================================================
using AdminLTE.Models;
using System;
using System.Collections.Generic;
namespace AdminLTE.Common
{
/// <summary>
/// This is where you customize the navigation sidebar
/// </summary>
public static class ModuleHelper
{
public enum Module
{
Home,
About,
Contact,
Error,
Login,
Register,
SuperAdmin,
Role,
UserLogs
}
public static SidebarMenu AddHeader(string name)
{
return new SidebarMenu
{
Type = SidebarMenuType.Header,
Name = name,
};
}
public static SidebarMenu AddTree(string name, string iconClassName = "bi bi-link")
{
return new SidebarMenu
{
Type = SidebarMenuType.Tree,
IsActive = false,
Name = name,
IconClassName = iconClassName,
URLPath = "#",
};
}
public static SidebarMenu AddModule(Module module, Tuple<int, int, int> counter = null)
{
if (counter == null)
counter = Tuple.Create(0, 0, 0);
switch (module)
{
case Module.Home:
return new SidebarMenu
{
Type = SidebarMenuType.Link,
Name = "Home",
IconClassName = "bi bi-house-door-fill",
URLPath = "/",
LinkCounter = counter,
};
case Module.Login:
return new SidebarMenu
{
Type = SidebarMenuType.Link,
Name = "Login",
IconClassName = "bi bi-door-open-fill",
URLPath = "/Account/Login",
LinkCounter = counter,
};
case Module.Register:
return new SidebarMenu
{
Type = SidebarMenuType.Link,
Name = "Register",
IconClassName = "bi bi-person-fill-add",
URLPath = "/Account/Register",
LinkCounter = counter,
};
case Module.About:
return new SidebarMenu
{
Type = SidebarMenuType.Link,
Name = "About",
IconClassName = "bi bi-people-fill",
URLPath = "/Home/About",
LinkCounter = counter,
};
case Module.Contact:
return new SidebarMenu
{
Type = SidebarMenuType.Link,
Name = "Contact",
IconClassName = "bi bi-telephone-fill",
URLPath = "/Home/Contact",
LinkCounter = counter,
};
case Module.Error:
return new SidebarMenu
{
Type = SidebarMenuType.Link,
Name = "Error",
IconClassName = "bi bi-exclamation-triangle-fill",
URLPath = "/Home/Error",
LinkCounter = counter,
};
case Module.SuperAdmin:
return new SidebarMenu
{
Type = SidebarMenuType.Link,
Name = "User",
IconClassName = "bi bi-people-fill",
URLPath = "/SuperAdmin",
LinkCounter = counter,
};
case Module.Role:
return new SidebarMenu
{
Type = SidebarMenuType.Link,
Name = "Role",
IconClassName = "bi bi-person-fill-gear",
URLPath = "/Role",
LinkCounter = counter,
};
case Module.UserLogs:
return new SidebarMenu
{
Type = SidebarMenuType.Link,
Name = "UserLogs",
IconClassName = "bi bi-clock-history",
URLPath = "/UserLogs",
LinkCounter = counter,
};
default:
break;
}
return null;
}
}
}
================================================
FILE: src/AdminLTE/Controllers/AccountController.cs
================================================
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.Extensions.Logging;
using AdminLTE.Models;
using AdminLTE.Models.AccountViewModels;
using AdminLTE.Services;
using AdminLTE.Common;
using System;
namespace AdminLTE.Controllers
{
[Authorize]
public class AccountController : Controller
{
private readonly UserManager<ApplicationUser> _userManager;
private readonly SignInManager<ApplicationUser> _signInManager;
private readonly IEmailSender _emailSender;
private readonly ISmsSender _smsSender;
private readonly ILogger _logger;
public AccountController(
UserManager<ApplicationUser> userManager,
SignInManager<ApplicationUser> signInManager,
IEmailSender emailSender,
ISmsSender smsSender,
ILoggerFactory loggerFactory)
{
_userManager = userManager;
_signInManager = signInManager;
_emailSender = emailSender;
_smsSender = smsSender;
_logger = loggerFactory.CreateLogger<AccountController>();
}
//
// GET: /Account/Login
[HttpGet]
[AllowAnonymous]
public IActionResult Login(string returnUrl = null)
{
ViewData["ReturnUrl"] = returnUrl;
return View();
}
//
// POST: /Account/Login
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Login(LoginViewModel model, string returnUrl = null)
{
ViewData["ReturnUrl"] = returnUrl;
if (ModelState.IsValid)
{
// This doesn't count login failures towards account lockout
// To enable password failures to trigger account lockout, set lockoutOnFailure: true
var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false);
if (result.Succeeded)
{
_logger.LogInformation(1, "User logged in.");
return RedirectToLocal(returnUrl);
}
if (result.RequiresTwoFactor)
{
return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
}
if (result.IsLockedOut)
{
_logger.LogWarning(2, "User account locked out.");
return View("Lockout");
}
else
{
ModelState.AddModelError(string.Empty, "Invalid login attempt.");
return View(model);
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
//
// GET: /Account/Register
[HttpGet]
[AllowAnonymous]
public IActionResult Register(string returnUrl = null)
{
ViewData["ReturnUrl"] = returnUrl;
return View();
}
//
// POST: /Account/Register
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Register(RegisterViewModel model, string returnUrl = null)
{
ViewData["ReturnUrl"] = returnUrl;
if (ModelState.IsValid)
{
var user = new ApplicationUser
{
UserName = model.Email,
Email = model.Email,
//extended properties
FirstName = model.FirstName,
LastName = model.LastName,
AvatarURL = "/images/user.png",
DateRegistered = DateTime.UtcNow.ToString(),
Position = "",
NickName = "",
};
var result = await _userManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713
// Send an email with this link
//var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
//var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);
//await _emailSender.SendEmailAsync(model.Email, "Confirm your account",
// $"Please confirm your account by clicking this link: <a href='{callbackUrl}'>link</a>");
await _signInManager.SignInAsync(user, isPersistent: false);
_logger.LogInformation(3, "User created a new account with password.");
await _userManager.AddClaimAsync(user, new Claim(CustomClaimTypes.GivenName, user.FirstName));
await _userManager.AddClaimAsync(user, new Claim(CustomClaimTypes.Surname, user.LastName));
await _userManager.AddClaimAsync(user, new Claim(CustomClaimTypes.AvatarURL, user.AvatarURL));
return RedirectToLocal(returnUrl);
}
AddErrors(result);
}
// If we got this far, something failed, redisplay form
return View(model);
}
//
// POST: /Account/LogOff
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> LogOff()
{
await _signInManager.SignOutAsync();
_logger.LogInformation(4, "User logged out.");
return RedirectToAction(nameof(HomeController.Index), "Home");
}
//
// POST: /Account/ExternalLogin
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public IActionResult ExternalLogin(string provider, string returnUrl = null)
{
// Request a redirect to the external login provider.
var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl });
var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl);
return Challenge(properties, provider);
}
//
// GET: /Account/ExternalLoginCallback
[HttpGet]
[AllowAnonymous]
public async Task<IActionResult> ExternalLoginCallback(string returnUrl = null, string remoteError = null)
{
if (remoteError != null)
{
ModelState.AddModelError(string.Empty, $"Error from external provider: {remoteError}");
return View(nameof(Login));
}
var info = await _signInManager.GetExternalLoginInfoAsync();
if (info == null)
{
return RedirectToAction(nameof(Login));
}
// Sign in the user with this external login provider if the user already has a login.
var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false);
if (result.Succeeded)
{
_logger.LogInformation(5, "User logged in with {Name} provider.", info.LoginProvider);
return RedirectToLocal(returnUrl);
}
if (result.RequiresTwoFactor)
{
return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl });
}
if (result.IsLockedOut)
{
return View("Lockout");
}
else
{
// If the user does not have an account, then ask the user to create an account.
ViewData["ReturnUrl"] = returnUrl;
ViewData["LoginProvider"] = info.LoginProvider;
var email = info.Principal.FindFirstValue(ClaimTypes.Email);
return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = email });
}
}
//
// POST: /Account/ExternalLoginConfirmation
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl = null)
{
if (ModelState.IsValid)
{
// Get the information about the user from the external login provider
var info = await _signInManager.GetExternalLoginInfoAsync();
if (info == null)
{
return View("ExternalLoginFailure");
}
var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
var result = await _userManager.CreateAsync(user);
if (result.Succeeded)
{
result = await _userManager.AddLoginAsync(user, info);
if (result.Succeeded)
{
await _signInManager.SignInAsync(user, isPersistent: false);
_logger.LogInformation(6, "User created an account using {Name} provider.", info.LoginProvider);
return RedirectToLocal(returnUrl);
}
}
AddErrors(result);
}
ViewData["ReturnUrl"] = returnUrl;
return View(model);
}
// GET: /Account/ConfirmEmail
[HttpGet]
[AllowAnonymous]
public async Task<IActionResult> ConfirmEmail(string userId, string code)
{
if (userId == null || code == null)
{
return View("Error");
}
var user = await _userManager.FindByIdAsync(userId);
if (user == null)
{
return View("Error");
}
var result = await _userManager.ConfirmEmailAsync(user, code);
return View(result.Succeeded ? "ConfirmEmail" : "Error");
}
//
// GET: /Account/ForgotPassword
[HttpGet]
[AllowAnonymous]
public IActionResult ForgotPassword()
{
return View();
}
//
// POST: /Account/ForgotPassword
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> ForgotPassword(ForgotPasswordViewModel model)
{
if (ModelState.IsValid)
{
var user = await _userManager.FindByNameAsync(model.Email);
if (user == null || !(await _userManager.IsEmailConfirmedAsync(user)))
{
// Don't reveal that the user does not exist or is not confirmed
return View("ForgotPasswordConfirmation");
}
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713
// Send an email with this link
//var code = await _userManager.GeneratePasswordResetTokenAsync(user);
//var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);
//await _emailSender.SendEmailAsync(model.Email, "Reset Password",
// $"Please reset your password by clicking here: <a href='{callbackUrl}'>link</a>");
//return View("ForgotPasswordConfirmation");
}
// If we got this far, something failed, redisplay form
return View(model);
}
//
// GET: /Account/ForgotPasswordConfirmation
[HttpGet]
[AllowAnonymous]
public IActionResult ForgotPasswordConfirmation()
{
return View();
}
//
// GET: /Account/ResetPassword
[HttpGet]
[AllowAnonymous]
public IActionResult ResetPassword(string code = null)
{
return code == null ? View("Error") : View();
}
//
// POST: /Account/ResetPassword
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> ResetPassword(ResetPasswordViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
var user = await _userManager.FindByNameAsync(model.Email);
if (user == null)
{
// Don't reveal that the user does not exist
return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account");
}
var result = await _userManager.ResetPasswordAsync(user, model.Code, model.Password);
if (result.Succeeded)
{
return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account");
}
AddErrors(result);
return View();
}
//
// GET: /Account/ResetPasswordConfirmation
[HttpGet]
[AllowAnonymous]
public IActionResult ResetPasswordConfirmation()
{
return View();
}
//
// GET: /Account/SendCode
[HttpGet]
[AllowAnonymous]
public async Task<ActionResult> SendCode(string returnUrl = null, bool rememberMe = false)
{
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
return View("Error");
}
var userFactors = await _userManager.GetValidTwoFactorProvidersAsync(user);
var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList();
return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe });
}
//
// POST: /Account/SendCode
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> SendCode(SendCodeViewModel model)
{
if (!ModelState.IsValid)
{
return View();
}
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
return View("Error");
}
// Generate the token and send it
var code = await _userManager.GenerateTwoFactorTokenAsync(user, model.SelectedProvider);
if (string.IsNullOrWhiteSpace(code))
{
return View("Error");
}
var message = "Your security code is: " + code;
if (model.SelectedProvider == "Email")
{
await _emailSender.SendEmailAsync(await _userManager.GetEmailAsync(user), "Security Code", message);
}
else if (model.SelectedProvider == "Phone")
{
await _smsSender.SendSmsAsync(await _userManager.GetPhoneNumberAsync(user), message);
}
return RedirectToAction(nameof(VerifyCode), new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe });
}
//
// GET: /Account/VerifyCode
[HttpGet]
[AllowAnonymous]
public async Task<IActionResult> VerifyCode(string provider, bool rememberMe, string returnUrl = null)
{
// Require that the user has already logged in via username/password or external login
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
return View("Error");
}
return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe });
}
//
// POST: /Account/VerifyCode
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> VerifyCode(VerifyCodeViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
// The following code protects for brute force attacks against the two factor codes.
// If a user enters incorrect codes for a specified amount of time then the user account
// will be locked out for a specified amount of time.
var result = await _signInManager.TwoFactorSignInAsync(model.Provider, model.Code, model.RememberMe, model.RememberBrowser);
if (result.Succeeded)
{
return RedirectToLocal(model.ReturnUrl);
}
if (result.IsLockedOut)
{
_logger.LogWarning(7, "User account locked out.");
return View("Lockout");
}
else
{
ModelState.AddModelError(string.Empty, "Invalid code.");
return View(model);
}
}
#region Helpers
private void AddErrors(IdentityResult result)
{
foreach (var error in result.Errors)
{
ModelState.AddModelError(string.Empty, error.Description);
}
}
private Task<ApplicationUser> GetCurrentUserAsync()
{
return _userManager.GetUserAsync(HttpContext.User);
}
private IActionResult RedirectToLocal(string returnUrl)
{
if (Url.IsLocalUrl(returnUrl))
{
return Redirect(returnUrl);
}
else
{
return RedirectToAction(nameof(HomeController.Index), "Home");
}
}
#endregion
}
}
================================================
FILE: src/AdminLTE/Controllers/BaseController.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using AdminLTE.Models;
using System.Runtime.CompilerServices;
namespace AdminLTE.Controllers
{
public class BaseController : Controller
{
internal void AddBreadcrumb(string displayName, string urlPath)
{
List<Message> messages;
if (ViewBag.Breadcrumb == null)
{
messages = new List<Message>();
}
else
{
messages = ViewBag.Breadcrumb as List<Message>;
}
messages.Add(new Message { DisplayName = displayName, URLPath = urlPath });
ViewBag.Breadcrumb = messages;
}
internal void AddPageHeader(string pageHeader = "", string pageDescription = "")
{
ViewBag.PageHeader = Tuple.Create(pageHeader, pageDescription);
}
internal enum PageAlertType
{
Error,
Info,
Warning,
Success
}
internal void AddPageAlerts(PageAlertType pageAlertType, string description)
{
List<Message> messages;
if (ViewBag.PageAlerts == null)
{
messages = new List<Message>();
}
else
{
messages = ViewBag.PageAlerts as List<Message>;
}
messages.Add(new Message { Type = pageAlertType.ToString().ToLower(), ShortDesc = description });
ViewBag.PageAlerts = messages;
}
}
}
================================================
FILE: src/AdminLTE/Controllers/HomeController.cs
================================================
using AdminLTE.Common.Attributes;
using AdminLTE.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace AdminLTE.Controllers
{
public class HomeController : BaseController
{
[HelpDefinition]
public IActionResult Index()
{
AddPageHeader("Dashboard", "");
return View();
}
[HttpPost]
public IActionResult Index(object model)
{
AddPageAlerts(PageAlertType.Info, "you may view the summary <a href='#'>here</a>");
return View("Index");
}
[HelpDefinition]
public IActionResult About()
{
ViewData["Message"] = "Your application description page.";
AddBreadcrumb("About", "/Account/About");
return View();
}
[HelpDefinition("helpdefault")]
public IActionResult Contact()
{
AddBreadcrumb("Contact", "/Account/Contact");
ViewData["Message"] = "Your contact page.";
return View();
}
public IActionResult Error()
{
return View();
}
#region Get data method.
/// <summary>
/// GET: /Home/GetData
/// </summary>
/// <returns>Return data</returns>
public ActionResult GetData()
{
try
{
// Initialization.
string search = Request.Form["search[value]"][0];
string draw = Request.Form["draw"][0];
string order = Request.Form["order[0][column]"][0];
string orderDir = Request.Form["order[0][dir]"][0];
int startRec = Convert.ToInt32(Request.Form["start"][0]);
int pageSize = Convert.ToInt32(Request.Form["length"][0]);
// Loading.
List<SalesOrderDetail> data = this.LoadData();
// Total record count.
int totalRecords = data.Count;
// Verification.
if (!string.IsNullOrEmpty(search) &&
!string.IsNullOrWhiteSpace(search))
{
// Apply search
data = data.Where(p => p.sr.ToString().ToLower().Contains(search.ToLower()) ||
p.ordertracknumber.ToLower().Contains(search.ToLower()) ||
p.quantity.ToString().ToLower().Contains(search.ToLower()) ||
p.productname.ToLower().Contains(search.ToLower()) ||
p.specialoffer.ToLower().Contains(search.ToLower()) ||
p.unitprice.ToString().ToLower().Contains(search.ToLower()) ||
p.unitpricediscount.ToString().ToLower().Contains(search.ToLower())).ToList();
}
// Sorting.
data = this.SortByColumnWithOrder(order, orderDir, data);
// Filter record count.
int recFilter = data.Count;
// Apply pagination.
data = data.Skip(startRec).Take(pageSize).ToList();
// Loading drop down lists.
var result = this.Json(new { draw = Convert.ToInt32(draw), recordsTotal = totalRecords, recordsFiltered = recFilter, data = data });
return result;
}
catch (Exception ex)
{
// Info
Console.Write(ex);
return null;
}
}
#endregion
#region Helpers
#region Load Data
/// <summary>
/// Load data method.
/// </summary>
/// <returns>Returns - Data</returns>
private List<SalesOrderDetail> LoadData()
{
// Initialization.
List<SalesOrderDetail> lst = new List<SalesOrderDetail>();
try
{
// Initialization.
string line = string.Empty;
//string srcFilePath = "content/files/SalesOrderDetail.txt";
//var rootPath = Path.GetDirectoryName(AppContext.BaseDirectory);
//var fullPath = Path.Combine(rootPath, srcFilePath);
//string filePath = new Uri(fullPath).LocalPath;
StreamReader sr = new StreamReader(new FileStream(@"wwwroot\files\SalesOrderDetail.txt", FileMode.Open, FileAccess.Read));
// Read file.
while ((line = sr.ReadLine()) != null)
{
// Initialization.
SalesOrderDetail infoObj = new SalesOrderDetail();
string[] info = line.Split(',');
// Setting.
infoObj.sr = Convert.ToInt32(info[0].ToString());
infoObj.ordertracknumber = info[1].ToString();
infoObj.quantity = Convert.ToInt32(info[2].ToString());
infoObj.productname = info[3].ToString();
infoObj.specialoffer = info[4].ToString();
infoObj.unitprice = Convert.ToDouble(info[5].ToString());
infoObj.unitpricediscount = Convert.ToDouble(info[6].ToString());
// Adding.
lst.Add(infoObj);
}
// Closing.
sr.Dispose();
}
catch (Exception ex)
{
// info.
Console.Write(ex);
}
// info.
return lst;
}
#endregion
#region Sort by column with order method
/// <summary>
/// Sort by column with order method.
/// </summary>
/// <param name="order">Order parameter</param>
/// <param name="orderDir">Order direction parameter</param>
/// <param name="data">Data parameter</param>
/// <returns>Returns - Data</returns>
private List<SalesOrderDetail> SortByColumnWithOrder(string order, string orderDir, List<SalesOrderDetail> data)
{
// Initialization.
List<SalesOrderDetail> lst = new List<SalesOrderDetail>();
try
{
// Sorting
switch (order)
{
case "0":
// Setting.
lst = orderDir.Equals("DESC", StringComparison.CurrentCultureIgnoreCase) ? data.OrderByDescending(p => p.sr).ToList()
: data.OrderBy(p => p.sr).ToList();
break;
case "1":
// Setting.
lst = orderDir.Equals("DESC", StringComparison.CurrentCultureIgnoreCase) ? data.OrderByDescending(p => p.ordertracknumber).ToList()
: data.OrderBy(p => p.ordertracknumber).ToList();
break;
case "2":
// Setting.
lst = orderDir.Equals("DESC", StringComparison.CurrentCultureIgnoreCase) ? data.OrderByDescending(p => p.quantity).ToList()
: data.OrderBy(p => p.quantity).ToList();
break;
case "3":
// Setting.
lst = orderDir.Equals("DESC", StringComparison.CurrentCultureIgnoreCase) ? data.OrderByDescending(p => p.productname).ToList()
: data.OrderBy(p => p.productname).ToList();
break;
case "4":
// Setting.
lst = orderDir.Equals("DESC", StringComparison.CurrentCultureIgnoreCase) ? data.OrderByDescending(p => p.specialoffer).ToList()
: data.OrderBy(p => p.specialoffer).ToList();
break;
case "5":
// Setting.
lst = orderDir.Equals("DESC", StringComparison.CurrentCultureIgnoreCase) ? data.OrderByDescending(p => p.unitprice).ToList()
: data.OrderBy(p => p.unitprice).ToList();
break;
case "6":
// Setting.
lst = orderDir.Equals("DESC", StringComparison.CurrentCultureIgnoreCase) ? data.OrderByDescending(p => p.unitpricediscount).ToList()
: data.OrderBy(p => p.unitpricediscount).ToList();
break;
default:
// Setting.
lst = orderDir.Equals("DESC", StringComparison.CurrentCultureIgnoreCase) ? data.OrderByDescending(p => p.sr).ToList()
: data.OrderBy(p => p.sr).ToList();
break;
}
}
catch (Exception ex)
{
// info.
Console.Write(ex);
}
// info.
return lst;
}
#endregion
#endregion
}
}
================================================
FILE: src/AdminLTE/Controllers/ManageController.cs
================================================
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using AdminLTE.Models;
using AdminLTE.Models.ManageViewModels;
using AdminLTE.Services;
namespace AdminLTE.Controllers
{
[Authorize]
public class ManageController : Controller
{
private readonly UserManager<ApplicationUser> _userManager;
private readonly SignInManager<ApplicationUser> _signInManager;
private readonly IEmailSender _emailSender;
private readonly ISmsSender _smsSender;
private readonly ILogger _logger;
public ManageController(
UserManager<ApplicationUser> userManager,
SignInManager<ApplicationUser> signInManager,
IEmailSender emailSender,
ISmsSender smsSender,
ILoggerFactory loggerFactory)
{
_userManager = userManager;
_signInManager = signInManager;
_emailSender = emailSender;
_smsSender = smsSender;
_logger = loggerFactory.CreateLogger<ManageController>();
}
//
// GET: /Manage/Index
[HttpGet]
public async Task<IActionResult> Index(ManageMessageId? message = null)
{
ViewData["StatusMessage"] =
message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed."
: message == ManageMessageId.SetPasswordSuccess ? "Your password has been set."
: message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set."
: message == ManageMessageId.Error ? "An error has occurred."
: message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added."
: message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed."
: "";
var user = await GetCurrentUserAsync();
if (user == null)
{
return View("Error");
}
var model = new IndexViewModel
{
HasPassword = await _userManager.HasPasswordAsync(user),
PhoneNumber = await _userManager.GetPhoneNumberAsync(user),
TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user),
Logins = await _userManager.GetLoginsAsync(user),
BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user)
};
return View(model);
}
//
// POST: /Manage/RemoveLogin
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> RemoveLogin(RemoveLoginViewModel account)
{
ManageMessageId? message = ManageMessageId.Error;
var user = await GetCurrentUserAsync();
if (user != null)
{
var result = await _userManager.RemoveLoginAsync(user, account.LoginProvider, account.ProviderKey);
if (result.Succeeded)
{
await _signInManager.SignInAsync(user, isPersistent: false);
message = ManageMessageId.RemoveLoginSuccess;
}
}
return RedirectToAction(nameof(ManageLogins), new { Message = message });
}
//
// GET: /Manage/AddPhoneNumber
public IActionResult AddPhoneNumber()
{
return View();
}
//
// POST: /Manage/AddPhoneNumber
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> AddPhoneNumber(AddPhoneNumberViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
// Generate the token and send it
var user = await GetCurrentUserAsync();
if (user == null)
{
return View("Error");
}
var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, model.PhoneNumber);
await _smsSender.SendSmsAsync(model.PhoneNumber, "Your security code is: " + code);
return RedirectToAction(nameof(VerifyPhoneNumber), new { PhoneNumber = model.PhoneNumber });
}
//
// POST: /Manage/EnableTwoFactorAuthentication
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> EnableTwoFactorAuthentication()
{
var user = await GetCurrentUserAsync();
if (user != null)
{
await _userManager.SetTwoFactorEnabledAsync(user, true);
await _signInManager.SignInAsync(user, isPersistent: false);
_logger.LogInformation(1, "User enabled two-factor authentication.");
}
return RedirectToAction(nameof(Index), "Manage");
}
//
// POST: /Manage/DisableTwoFactorAuthentication
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DisableTwoFactorAuthentication()
{
var user = await GetCurrentUserAsync();
if (user != null)
{
await _userManager.SetTwoFactorEnabledAsync(user, false);
await _signInManager.SignInAsync(user, isPersistent: false);
_logger.LogInformation(2, "User disabled two-factor authentication.");
}
return RedirectToAction(nameof(Index), "Manage");
}
//
// GET: /Manage/VerifyPhoneNumber
[HttpGet]
public async Task<IActionResult> VerifyPhoneNumber(string phoneNumber)
{
var user = await GetCurrentUserAsync();
if (user == null)
{
return View("Error");
}
var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, phoneNumber);
// Send an SMS to verify the phone number
return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber });
}
//
// POST: /Manage/VerifyPhoneNumber
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> VerifyPhoneNumber(VerifyPhoneNumberViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
var user = await GetCurrentUserAsync();
if (user != null)
{
var result = await _userManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code);
if (result.Succeeded)
{
await _signInManager.SignInAsync(user, isPersistent: false);
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.AddPhoneSuccess });
}
}
// If we got this far, something failed, redisplay the form
ModelState.AddModelError(string.Empty, "Failed to verify phone number");
return View(model);
}
//
// POST: /Manage/RemovePhoneNumber
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> RemovePhoneNumber()
{
var user = await GetCurrentUserAsync();
if (user != null)
{
var result = await _userManager.SetPhoneNumberAsync(user, null);
if (result.Succeeded)
{
await _signInManager.SignInAsync(user, isPersistent: false);
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess });
}
}
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error });
}
//
// GET: /Manage/ChangePassword
[HttpGet]
public IActionResult ChangePassword()
{
return View();
}
//
// POST: /Manage/ChangePassword
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> ChangePassword(ChangePasswordViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
var user = await GetCurrentUserAsync();
if (user != null)
{
var result = await _userManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword);
if (result.Succeeded)
{
await _signInManager.SignInAsync(user, isPersistent: false);
_logger.LogInformation(3, "User changed their password successfully.");
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.ChangePasswordSuccess });
}
AddErrors(result);
return View(model);
}
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error });
}
//
// GET: /Manage/SetPassword
[HttpGet]
public IActionResult SetPassword()
{
return View();
}
//
// POST: /Manage/SetPassword
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> SetPassword(SetPasswordViewModel model)
{
if (!ModelState.IsValid)
{
return View(model);
}
var user = await GetCurrentUserAsync();
if (user != null)
{
var result = await _userManager.AddPasswordAsync(user, model.NewPassword);
if (result.Succeeded)
{
await _signInManager.SignInAsync(user, isPersistent: false);
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.SetPasswordSuccess });
}
AddErrors(result);
return View(model);
}
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error });
}
//GET: /Manage/ManageLogins
[HttpGet]
public async Task<IActionResult> ManageLogins(ManageMessageId? message = null)
{
ViewData["StatusMessage"] =
message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed."
: message == ManageMessageId.AddLoginSuccess ? "The external login was added."
: message == ManageMessageId.Error ? "An error has occurred."
: "";
var user = await GetCurrentUserAsync();
if (user == null)
{
return View("Error");
}
var userLogins = await _userManager.GetLoginsAsync(user);
var schemes = await _signInManager.GetExternalAuthenticationSchemesAsync();
var otherLogins = schemes.Where(auth => userLogins.All(ul => auth.Name != ul.LoginProvider)).ToList();
ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1;
return View(new ManageLoginsViewModel
{
CurrentLogins = userLogins,
OtherLogins = otherLogins
});
}
//
// POST: /Manage/LinkLogin
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult LinkLogin(string provider)
{
// Request a redirect to the external login provider to link a login for the current user
var redirectUrl = Url.Action("LinkLoginCallback", "Manage");
var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User));
return Challenge(properties, provider);
}
//
// GET: /Manage/LinkLoginCallback
[HttpGet]
public async Task<ActionResult> LinkLoginCallback()
{
var user = await GetCurrentUserAsync();
if (user == null)
{
return View("Error");
}
var info = await _signInManager.GetExternalLoginInfoAsync(await _userManager.GetUserIdAsync(user));
if (info == null)
{
return RedirectToAction(nameof(ManageLogins), new { Message = ManageMessageId.Error });
}
var result = await _userManager.AddLoginAsync(user, info);
var message = result.Succeeded ? ManageMessageId.AddLoginSuccess : ManageMessageId.Error;
return RedirectToAction(nameof(ManageLogins), new { Message = message });
}
#region Helpers
private void AddErrors(IdentityResult result)
{
foreach (var error in result.Errors)
{
ModelState.AddModelError(string.Empty, error.Description);
}
}
public enum ManageMessageId
{
AddPhoneSuccess,
AddLoginSuccess,
ChangePasswordSuccess,
SetTwoFactorSuccess,
SetPasswordSuccess,
RemoveLoginSuccess,
RemovePhoneSuccess,
Error
}
private Task<ApplicationUser> GetCurrentUserAsync()
{
return _userManager.GetUserAsync(HttpContext.User);
}
#endregion
}
}
================================================
FILE: src/AdminLTE/Controllers/RoleController.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.AspNetCore.Mvc;
using AdminLTE.Models;
using AdminLTE.Models.RoleViewModels;
namespace AdminLTE.Controllers
{
[Authorize(Roles = "SuperAdmins")]
public class RoleController : Controller
{
private RoleManager<IdentityRole> roleManager;
private UserManager<ApplicationUser> userManager;
public RoleController(RoleManager<IdentityRole> roleMgr, UserManager<ApplicationUser> userMgr)
{
roleManager = roleMgr;
userManager = userMgr;
}
public IActionResult Index()
{
return View(roleManager.Roles);
}
private void AddErrors(IdentityResult result)
{
foreach (IdentityError error in result.Errors)
{
ModelState.AddModelError("", error.Description);
}
}
public IActionResult Create()
{
return View();
}
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create([Required] string name)
{
if (ModelState.IsValid)
{
IdentityResult result = await roleManager.CreateAsync(new IdentityRole(name));
if (result.Succeeded)
{
return RedirectToAction("Index");
}
else
{
AddErrors(result);
}
}
return View(name);
}
public async Task<IActionResult> Edit(string id)
{
IdentityRole role = await roleManager.FindByIdAsync(id);
List<ApplicationUser> members = new List<ApplicationUser>();
List<ApplicationUser> nonMember = new List<ApplicationUser>();
foreach (ApplicationUser user in userManager.Users.ToArray())
{
var list = await userManager.IsInRoleAsync(user, role.Name)
? members
: nonMember;
list.Add(user);
}
return View(new EditRoleVm
{
Role = role,
Members = members,
NonMembers = nonMember
});
}
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(ModifyRoleVm modifyRole)
{
IdentityResult result;
if (ModelState.IsValid)
{
IdentityRole role = await roleManager.FindByIdAsync(modifyRole.RoleId);
role.Name = modifyRole.RoleName;
result = await roleManager.UpdateAsync(role);
if (!result.Succeeded)
{
AddErrors(result);
}
foreach (string userId in modifyRole.IdsToAdd ?? new string[] { })
{
ApplicationUser user = await userManager.FindByIdAsync(userId);
if (user != null)
{
result = await userManager.AddToRoleAsync(user, modifyRole.RoleName);
if (!result.Succeeded)
{
AddErrors(result);
}
}
}
foreach (string userId in modifyRole.IdsToRemove ?? new string[] { })
{
ApplicationUser user = await userManager.FindByIdAsync(userId);
if (user != null)
{
result = await userManager.RemoveFromRoleAsync(user, modifyRole.RoleName);
if (!result.Succeeded)
{
AddErrors(result);
}
}
}
}
if (ModelState.IsValid)
{
return RedirectToAction("Index");
}
return View(modifyRole.RoleId);
}
public async Task<IActionResult> Delete(string id)
{
IdentityRole role = await roleManager.FindByIdAsync(id);
if (role != null)
{
IdentityResult result = await roleManager.DeleteAsync(role);
if (result.Succeeded)
{
return RedirectToAction("Index");
}
else
{
AddErrors(result);
}
}
else
{
ModelState.AddModelError("", "No role found");
}
return View("Index", roleManager.Roles);
}
}
}
================================================
FILE: src/AdminLTE/Controllers/SuperAdminController.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.AspNetCore.Mvc;
using AdminLTE.Models;
using AdminLTE.Models.SuperAdminViewModels;
namespace AdminLTE.Controllers
{
[Authorize(Roles = "SuperAdmins")]
public class SuperAdminController : Controller
{
private UserManager<ApplicationUser> userManager;
private IUserValidator<ApplicationUser> userValidator;
private IPasswordValidator<ApplicationUser> passwordValidator;
private IPasswordHasher<ApplicationUser> passwordHasher;
private ApplicationUser testUser = new ApplicationUser
{
UserName = "TestTestForPassword",
Email = "testForPassword@test.test"
};
public SuperAdminController(UserManager<ApplicationUser> userMgr,
IUserValidator<ApplicationUser> userValid, IPasswordValidator<ApplicationUser> passValid,
IPasswordHasher<ApplicationUser> passHasher)
{
userManager = userMgr;
userValidator = userValid;
passwordValidator = passValid;
passwordHasher = passHasher;
}
// GET: /<controller>/
public ViewResult Index()
{
return View(userManager.Users);
}
public ViewResult Create()
{
return View();
}
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(CreateVm createVm)
{
if (ModelState.IsValid)
{
ApplicationUser user = new ApplicationUser
{
UserName = createVm.Email,
Email = createVm.Email,
//extended properties
FirstName = createVm.FirstName,
LastName = createVm.LastName,
AvatarURL = "/images/user.png",
DateRegistered = DateTime.UtcNow.ToString(),
Position = "",
NickName = "",
};
IdentityResult result = await userManager.CreateAsync(user, createVm.Password);
if (result.Succeeded)
{
return RedirectToAction("Index");
}
else
{
foreach (IdentityError error in result.Errors)
{
ModelState.AddModelError("", error.Description);
}
}
}
return View(createVm);
}
private void AddErrors(IdentityResult result)
{
foreach (IdentityError error in result.Errors)
{
ModelState.TryAddModelError("", error.Description);
}
}
public async Task<IActionResult> Delete(string id)
{
ApplicationUser user = await userManager.FindByIdAsync(id);
if (user != null)
{
IdentityResult result = await userManager.DeleteAsync(user);
if (result.Succeeded)
{
return RedirectToAction("Index");
}
else
{
AddErrors(result);
}
}
else
{
ModelState.AddModelError("", "User Not Found");
}
return View("Index", userManager.Users);
}
public async Task<IActionResult> Edit(string id)
{
ApplicationUser user = await userManager.FindByIdAsync(id);
if (user != null)
{
return View(user);
}
else
{
return RedirectToAction("Index");
}
}
[HttpPost]
[ValidateAntiForgeryToken]
// the names of its parameters must be the same as the property of the User class if we use asp-for in the view
// otherwise form values won't be passed properly
public async Task<IActionResult> Edit(string id, string userName, string email)
{
ApplicationUser user = await userManager.FindByIdAsync(id);
if (user != null)
{
// Validate UserName and Email
user.UserName = userName; // UserName won't be changed in the database until UpdateAsync is executed successfully
user.Email = email;
IdentityResult validUseResult = await userValidator.ValidateAsync(userManager, user);
if (!validUseResult.Succeeded)
{
AddErrors(validUseResult);
}
// Update user info
if (validUseResult.Succeeded)
{
// UpdateAsync validates user info such as UserName and Email except password since it's been hashed
IdentityResult result = await userManager.UpdateAsync(user);
if (result.Succeeded)
{
return RedirectToAction("Index", "SuperAdmin");
}
else
{
AddErrors(result);
}
}
}
else
{
ModelState.AddModelError("", "User Not Found");
}
;
return View(user);
}
public async Task<IActionResult> ChangePassword(string id)
{
ApplicationUser user = await userManager.FindByIdAsync(id);
if (user != null)
{
return View(user);
}
else
{
return RedirectToAction("Index");
}
}
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> ChangePassword(string id, string password)
{
ApplicationUser user = await userManager.FindByIdAsync(id);
if (user != null)
{
// Validate password
// Step 1: using built in validations
IdentityResult passwordResult = await userManager.CreateAsync(testUser, password);
if (passwordResult.Succeeded)
{
await userManager.DeleteAsync(testUser);
}
else
{
AddErrors(passwordResult);
}
/* Step 2: Because of DI, IPasswordValidator<User> is injected into the custom password validator.
So the built in password validation stop working here */
IdentityResult validPasswordResult = await passwordValidator.ValidateAsync(userManager, user, password);
if (validPasswordResult.Succeeded)
{
user.PasswordHash = passwordHasher.HashPassword(user, password);
}
else
{
AddErrors(validPasswordResult);
}
// Update user info
if (passwordResult.Succeeded && validPasswordResult.Succeeded)
{
// UpdateAsync validates user info such as UserName and Email except password since it's been hashed
IdentityResult result = await userManager.UpdateAsync(user);
if (result.Succeeded)
{
return RedirectToAction("Index", "SuperAdmin");
}
else
{
AddErrors(result);
}
}
}
else
{
ModelState.AddModelError("", "User Not Found");
}
return View(user);
}
}
}
================================================
FILE: src/AdminLTE/Controllers/UserLogsController.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.AspNetCore.Mvc;
using AdminLTE.Models;
using AdminLTE.Models.SuperAdminViewModels;
using AdminLTE.Data;
namespace AdminLTE.Controllers
{
[Authorize(Roles = "SuperAdmins")]
public class UserLogsController : Controller
{
private readonly ApplicationDbContext _context;
public UserLogsController(ApplicationDbContext context)
{
_context = context;
}
// GET: /<controller>/
public ViewResult Index()
{
return View(_context.UserAuditEvents.ToList());
}
}
}
================================================
FILE: src/AdminLTE/Data/AppClaimsPrincipalFactory.cs
================================================
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using AdminLTE.Common;
using AdminLTE.Models;
namespace AdminLTE.Data
{
public class AppClaimsPrincipalFactory : UserClaimsPrincipalFactory<ApplicationUser, IdentityRole>
{
public AppClaimsPrincipalFactory(
UserManager<ApplicationUser> userManager,
RoleManager<IdentityRole> roleManager,
IOptions<IdentityOptions> optionsAccessor) : base(userManager, roleManager, optionsAccessor)
{
}
public override async Task<ClaimsPrincipal> CreateAsync(ApplicationUser user)
{
var principal = await base.CreateAsync(user);
((ClaimsIdentity)principal.Identity).AddClaims(new[] {
new Claim(CustomClaimTypes.GivenName, user.FirstName),
new Claim(CustomClaimTypes.Surname, user.LastName),
new Claim(CustomClaimTypes.AvatarURL, user.AvatarURL),
new Claim(CustomClaimTypes.Position, user.Position),
new Claim(CustomClaimTypes.NickName, user.NickName),
new Claim(CustomClaimTypes.DateRegistered, user.DateRegistered),
});
return principal;
}
}
}
================================================
FILE: src/AdminLTE/Data/ApplicationDbContext.cs
================================================
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using AdminLTE.Models;
namespace AdminLTE.Data
{
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public DbSet<UserAudit> UserAuditEvents { get; set; }
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
// Customize the ASP.NET Identity model and override the defaults if needed.
// For example, you can rename the ASP.NET Identity table names and more.
// Add your customizations after calling base.OnModelCreating(builder);
}
}
}
================================================
FILE: src/AdminLTE/Data/AuditableSignInManager.cs
================================================
using AdminLTE.Models;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Threading.Tasks;
using AdminLTE.Common;
using AdminLTE.Common.Extensions;
using Microsoft.AspNetCore.Authentication;
namespace AdminLTE.Data
{
public class AuditableSignInManager<TUser> : SignInManager<TUser> where TUser : class
{
private readonly UserManager<TUser> _userManager;
private readonly ApplicationDbContext _db;
private readonly IHttpContextAccessor _contextAccessor;
public AuditableSignInManager(UserManager<TUser> userManager, IHttpContextAccessor contextAccessor, IUserClaimsPrincipalFactory<TUser> claimsFactory, IOptions<IdentityOptions> optionsAccessor, ILogger<SignInManager<TUser>> logger, ApplicationDbContext dbContext)
: base(userManager, contextAccessor, claimsFactory, optionsAccessor, logger, null, null)
{
if (userManager == null)
throw new ArgumentNullException(nameof(userManager));
if (dbContext == null)
throw new ArgumentNullException(nameof(dbContext));
if (contextAccessor == null)
throw new ArgumentNullException(nameof(contextAccessor));
_userManager = userManager;
_contextAccessor = contextAccessor;
_db = dbContext;
}
public override async Task<SignInResult> PasswordSignInAsync(TUser user, string password, bool isPersistent, bool lockoutOnFailure)
{
var result = await base.PasswordSignInAsync(user, password, isPersistent, lockoutOnFailure);
var appUser = user as IdentityUser;
if (appUser != null) // We can only log an audit record if we can access the user object and it's ID
{
var ip = _contextAccessor.HttpContext.Connection.RemoteIpAddress.ToString();
UserAudit auditRecord = null;
switch (result.ToString())
{
case "Succeeded":
auditRecord = UserAudit.CreateAuditEvent(appUser.Id, UserAuditEventType.Login, ip);
break;
case "Failed":
auditRecord = UserAudit.CreateAuditEvent(appUser.Id, UserAuditEventType.FailedLogin, ip);
break;
}
if (auditRecord != null)
{
_db.UserAuditEvents.Add(auditRecord);
await _db.SaveChangesAsync();
}
}
return result;
}
public override async Task SignOutAsync()
{
await _contextAccessor.HttpContext.SignOutAsync(_contextAccessor.HttpContext.Features.Get<IAuthenticateResultFeature>().AuthenticateResult?.Ticket?.AuthenticationScheme);
var user = await _userManager.FindByIdAsync(_userManager.GetUserId(_contextAccessor.HttpContext.User)) as IdentityUser;
if (user != null)
{
var ip = _contextAccessor.HttpContext.Connection.RemoteIpAddress.ToString();
var auditRecord = UserAudit.CreateAuditEvent(user.Id, UserAuditEventType.LogOut, ip);
_db.UserAuditEvents.Add(auditRecord);
await _db.SaveChangesAsync();
}
}
}
}
================================================
FILE: src/AdminLTE/Data/DataSeed.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using AdminLTE.Models;
using AdminLTE.Common;
namespace AdminLTE.Data
{
public static class DataSeed
{
public static async Task Seed(IServiceProvider serviceProvider)
{
IServiceScopeFactory scopeFactory = serviceProvider.GetRequiredService<IServiceScopeFactory>();
using (IServiceScope scope = scopeFactory.CreateScope())
{
var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
context.Database.Migrate();
UserManager<ApplicationUser> _userManager = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
RoleManager<IdentityRole> roleManager = scope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>();
// Seed database code goes here
// User Info
//string userName = "SuperAdmin";
string firstName = "Super";
string lastName = "Admin";
string email = "superadmin@admin.com";
string password = "Qwaszx123$";
string role = "SuperAdmins";
string role2 = "SeniorManagers";
string role3 = "Managers";
if (await _userManager.FindByNameAsync(email) == null)
{
// Create SuperAdmins role if it doesn't exist
if (await roleManager.FindByNameAsync(role) == null)
{
await roleManager.CreateAsync(new IdentityRole(role));
}
if (await roleManager.FindByNameAsync(role2) == null)
{
await roleManager.CreateAsync(new IdentityRole(role2));
}
if (await roleManager.FindByNameAsync(role3) == null)
{
await roleManager.CreateAsync(new IdentityRole(role3));
}
// Create user account if it doesn't exist
ApplicationUser user = new ApplicationUser
{
UserName = email,
Email = email,
//extended properties
FirstName = firstName,
LastName = lastName,
AvatarURL = "/images/user.png",
DateRegistered = DateTime.UtcNow.ToString(),
Position = "",
NickName = "",
};
IdentityResult result = await _userManager.CreateAsync(user, password);
// Assign role to the user
if (result.Succeeded)
{
await _userManager.AddClaimAsync(user, new Claim(CustomClaimTypes.GivenName, user.FirstName));
await _userManager.AddClaimAsync(user, new Claim(CustomClaimTypes.Surname, user.LastName));
await _userManager.AddClaimAsync(user, new Claim(CustomClaimTypes.AvatarURL, user.AvatarURL));
//SignInManager<ApplicationUser> _signInManager = serviceProvider.GetRequiredService<SignInManager<ApplicationUser>>();
//await _signInManager.SignInAsync(user, isPersistent: false);
await _userManager.AddToRoleAsync(user, role);
}
}
}
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace AdminLTE.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("00000000000000_CreateIdentitySchema")]
partial class CreateIdentitySchema
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rc3")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b =>
{
b.Property<string>("Id");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider");
b.Property<string>("ProviderKey");
b.Property<string>("ProviderDisplayName");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("RoleId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("LoginProvider");
b.Property<string>("Name");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("AdminLTE.Models.ApplicationUser", b =>
{
b.Property<string>("Id");
b.Property<int>("AccessFailedCount");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Email")
.HasAnnotation("MaxLength", 256);
b.Property<bool>("EmailConfirmed");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedUserName")
.HasAnnotation("MaxLength", 256);
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("SecurityStamp");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
.WithMany("Users")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/00000000000000_CreateIdentitySchema.cs
================================================
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace AdminLTE.Data.Migrations
{
public partial class CreateIdentitySchema : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
Id = table.Column<string>(nullable: false),
ConcurrencyStamp = table.Column<string>(nullable: true),
Name = table.Column<string>(maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(maxLength: 256, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column<string>(nullable: false),
LoginProvider = table.Column<string>(nullable: false),
Name = table.Column<string>(nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
});
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column<string>(nullable: false),
AccessFailedCount = table.Column<int>(nullable: false),
ConcurrencyStamp = table.Column<string>(nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(nullable: false),
LockoutEnabled = table.Column<bool>(nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: true),
PasswordHash = table.Column<string>(nullable: true),
PhoneNumber = table.Column<string>(nullable: true),
PhoneNumberConfirmed = table.Column<bool>(nullable: false),
SecurityStamp = table.Column<string>(nullable: true),
TwoFactorEnabled = table.Column<bool>(nullable: false),
UserName = table.Column<string>(maxLength: 256, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true),
RoleId = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true),
UserId = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
columns: table => new
{
LoginProvider = table.Column<string>(nullable: false),
ProviderKey = table.Column<string>(nullable: false),
ProviderDisplayName = table.Column<string>(nullable: true),
UserId = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
table.ForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column<string>(nullable: false),
RoleId = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName");
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId",
table: "AspNetUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserLogins_UserId",
table: "AspNetUserLogins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_RoleId",
table: "AspNetUserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_UserId",
table: "AspNetUserRoles",
column: "UserId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "AspNetUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AspNetRoleClaims");
migrationBuilder.DropTable(
name: "AspNetUserClaims");
migrationBuilder.DropTable(
name: "AspNetUserLogins");
migrationBuilder.DropTable(
name: "AspNetUserRoles");
migrationBuilder.DropTable(
name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "AspNetUsers");
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/20160801092435_ExtendASPNetUser.Designer.cs
================================================
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using AdminLTE.Data;
namespace AdminLTE.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20160801092435_ExtendASPNetUser")]
partial class ExtendASPNetUser
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("AdminLTE.Models.ApplicationUser", b =>
{
b.Property<string>("Id");
b.Property<int>("AccessFailedCount");
b.Property<string>("AvatarURL");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Email")
.HasAnnotation("MaxLength", 256);
b.Property<bool>("EmailConfirmed");
b.Property<string>("FirstName");
b.Property<string>("LastName");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedUserName")
.HasAnnotation("MaxLength", 256);
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("SecurityStamp");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b =>
{
b.Property<string>("Id");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider");
b.Property<string>("ProviderKey");
b.Property<string>("ProviderDisplayName");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("RoleId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("LoginProvider");
b.Property<string>("Name");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
.WithMany("Users")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/20160801092435_ExtendASPNetUser.cs
================================================
using Microsoft.EntityFrameworkCore.Migrations;
namespace AdminLTE.Data.Migrations
{
public partial class ExtendASPNetUser : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "AvatarURL",
table: "AspNetUsers",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FirstName",
table: "AspNetUsers",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "LastName",
table: "AspNetUsers",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AvatarURL",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "FirstName",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "LastName",
table: "AspNetUsers");
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/20160802025049_UserAuditTable.Designer.cs
================================================
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using AdminLTE.Data;
namespace AdminLTE.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20160802025049_UserAuditTable")]
partial class UserAuditTable
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("AdminLTE.Models.ApplicationUser", b =>
{
b.Property<string>("Id");
b.Property<int>("AccessFailedCount");
b.Property<string>("AvatarURL");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Email")
.HasAnnotation("MaxLength", 256);
b.Property<bool>("EmailConfirmed");
b.Property<string>("FirstName");
b.Property<string>("LastName");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedUserName")
.HasAnnotation("MaxLength", 256);
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("SecurityStamp");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("AdminLTE.Models.UserAudit", b =>
{
b.Property<int>("UserAuditId")
.ValueGeneratedOnAdd();
b.Property<int>("AuditEvent");
b.Property<string>("IpAddress");
b.Property<DateTimeOffset>("Timestamp");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("UserAuditId");
b.ToTable("UserAuditEvents");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b =>
{
b.Property<string>("Id");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider");
b.Property<string>("ProviderKey");
b.Property<string>("ProviderDisplayName");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("RoleId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("LoginProvider");
b.Property<string>("Name");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
.WithMany("Users")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/20160802025049_UserAuditTable.cs
================================================
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Metadata;
namespace AdminLTE.Data.Migrations
{
public partial class UserAuditTable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "UserAuditEvents",
columns: table => new
{
UserAuditId = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
AuditEvent = table.Column<int>(nullable: false),
IpAddress = table.Column<string>(nullable: true),
Timestamp = table.Column<DateTimeOffset>(nullable: false),
UserId = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_UserAuditEvents", x => x.UserAuditId);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "UserAuditEvents");
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/20160802083550_AddedAdditionalUserFields.Designer.cs
================================================
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using AdminLTE.Data;
namespace AdminLTE.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20160802083550_AddedAdditionalUserFields")]
partial class AddedAdditionalUserFields
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("AdminLTE.Models.ApplicationUser", b =>
{
b.Property<string>("Id");
b.Property<int>("AccessFailedCount");
b.Property<string>("AvatarURL");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("DateRegistered");
b.Property<string>("Email")
.HasAnnotation("MaxLength", 256);
b.Property<bool>("EmailConfirmed");
b.Property<string>("FirstName");
b.Property<string>("LastName");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NickName");
b.Property<string>("NormalizedEmail")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedUserName")
.HasAnnotation("MaxLength", 256);
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("Position");
b.Property<string>("SecurityStamp");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("AdminLTE.Models.UserAudit", b =>
{
b.Property<int>("UserAuditId")
.ValueGeneratedOnAdd();
b.Property<int>("AuditEvent");
b.Property<string>("IpAddress");
b.Property<DateTimeOffset>("Timestamp");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("UserAuditId");
b.ToTable("UserAuditEvents");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b =>
{
b.Property<string>("Id");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasAnnotation("MaxLength", 256);
b.Property<string>("NormalizedName")
.HasAnnotation("MaxLength", 256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider");
b.Property<string>("ProviderKey");
b.Property<string>("ProviderDisplayName");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("RoleId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("LoginProvider");
b.Property<string>("Name");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
.WithMany("Users")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("AdminLTE.Models.ApplicationUser")
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/20160802083550_AddedAdditionalUserFields.cs
================================================
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
namespace AdminLTE.Data.Migrations
{
public partial class AddedAdditionalUserFields : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "DateRegistered",
table: "AspNetUsers",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "NickName",
table: "AspNetUsers",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Position",
table: "AspNetUsers",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DateRegistered",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "NickName",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "Position",
table: "AspNetUsers");
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/20251217031644_UpdateEF10.Designer.cs
================================================
// <auto-generated />
using System;
using AdminLTE.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace AdminLTE.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20251217031644_UpdateEF10")]
partial class UpdateEF10
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("AdminLTE.Models.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("AvatarURL")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("DateRegistered")
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<string>("FirstName")
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.HasColumnType("nvarchar(max)");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NickName")
.HasColumnType("nvarchar(max)");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("Position")
.HasColumnType("nvarchar(max)");
b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("AdminLTE.Models.UserAudit", b =>
{
b.Property<int>("UserAuditId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("UserAuditId"));
b.Property<int>("AuditEvent")
.HasColumnType("int");
b.Property<string>("IpAddress")
.HasColumnType("nvarchar(max)");
b.Property<DateTimeOffset>("Timestamp")
.HasColumnType("datetimeoffset");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("UserAuditId");
b.ToTable("UserAuditEvents");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("Name")
.HasColumnType("nvarchar(450)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AdminLTE.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/20251217031644_UpdateEF10.cs
================================================
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AdminLTE.Data.Migrations
{
/// <inheritdoc />
public partial class UpdateEF10 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "UserNameIndex",
table: "AspNetUsers");
migrationBuilder.DropIndex(
name: "IX_AspNetUserRoles_UserId",
table: "AspNetUserRoles");
migrationBuilder.DropIndex(
name: "RoleNameIndex",
table: "AspNetRoles");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true,
filter: "[NormalizedUserName] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true,
filter: "[NormalizedName] IS NOT NULL");
migrationBuilder.AddForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
table: "AspNetUserTokens",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
table: "AspNetUserTokens");
migrationBuilder.DropIndex(
name: "UserNameIndex",
table: "AspNetUsers");
migrationBuilder.DropIndex(
name: "RoleNameIndex",
table: "AspNetRoles");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_UserId",
table: "AspNetUserRoles",
column: "UserId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName");
}
}
}
================================================
FILE: src/AdminLTE/Data/Migrations/ApplicationDbContextModelSnapshot.cs
================================================
// <auto-generated />
using System;
using AdminLTE.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace AdminLTE.Data.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("AdminLTE.Models.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("AvatarURL")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("DateRegistered")
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<string>("FirstName")
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.HasColumnType("nvarchar(max)");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NickName")
.HasColumnType("nvarchar(max)");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("Position")
.HasColumnType("nvarchar(max)");
b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("AdminLTE.Models.UserAudit", b =>
{
b.Property<int>("UserAuditId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("UserAuditId"));
b.Property<int>("AuditEvent")
.HasColumnType("int");
b.Property<string>("IpAddress")
.HasColumnType("nvarchar(max)");
b.Property<DateTimeOffset>("Timestamp")
.HasColumnType("datetimeoffset");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("UserAuditId");
b.ToTable("UserAuditEvents");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("Name")
.HasColumnType("nvarchar(450)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AdminLTE.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("AdminLTE.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
================================================
FILE: src/AdminLTE/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.AccountViewModels
{
public class ExternalLoginConfirmationViewModel
{
[Required]
[EmailAddress]
public string Email { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/AccountViewModels/ForgotPasswordViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.AccountViewModels
{
public class ForgotPasswordViewModel
{
[Required]
[EmailAddress]
public string Email { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/AccountViewModels/LoginViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.AccountViewModels
{
public class LoginViewModel
{
[Required]
[EmailAddress]
public string Email { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
[Display(Name = "Remember Me")]
public bool RememberMe { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/AccountViewModels/RegisterViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.AccountViewModels
{
public class RegisterViewModel
{
[Required]
[EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
[Required]
[Display(Name = "FirstName")]
public string FirstName { get; set; }
[Required]
[Display(Name = "LastName")]
public string LastName { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/AccountViewModels/ResetPasswordViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.AccountViewModels
{
public class ResetPasswordViewModel
{
[Required]
[EmailAddress]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
public string Code { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/AccountViewModels/SendCodeViewModel.cs
================================================
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace AdminLTE.Models.AccountViewModels
{
public class SendCodeViewModel
{
public string SelectedProvider { get; set; }
public ICollection<SelectListItem> Providers { get; set; }
public string ReturnUrl { get; set; }
public bool RememberMe { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/AccountViewModels/VerifyCodeViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.AccountViewModels
{
public class VerifyCodeViewModel
{
[Required]
public string Provider { get; set; }
[Required]
public string Code { get; set; }
public string ReturnUrl { get; set; }
[Display(Name = "Remember this browser?")]
public bool RememberBrowser { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ApplicationUser.cs
================================================
using Microsoft.AspNetCore.Identity;
using System;
namespace AdminLTE.Models
{
// Add profile data for application users by adding properties to the ApplicationUser class
public class ApplicationUser : IdentityUser
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string AvatarURL { get; set; }
public string DateRegistered { get; set; }
public string Position { get; set; }
public string NickName { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ManageViewModels/AddPhoneNumberViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.ManageViewModels
{
public class AddPhoneNumberViewModel
{
[Required]
[Phone]
[Display(Name = "Phone number")]
public string PhoneNumber { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ManageViewModels/ChangePasswordViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.ManageViewModels
{
public class ChangePasswordViewModel
{
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs
================================================
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace AdminLTE.Models.ManageViewModels
{
public class ConfigureTwoFactorViewModel
{
public string SelectedProvider { get; set; }
public ICollection<SelectListItem> Providers { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ManageViewModels/FactorViewModel.cs
================================================
namespace AdminLTE.Models.ManageViewModels
{
public class FactorViewModel
{
public string Purpose { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ManageViewModels/IndexViewModel.cs
================================================
using System.Collections.Generic;
using Microsoft.AspNetCore.Identity;
namespace AdminLTE.Models.ManageViewModels
{
public class IndexViewModel
{
public bool HasPassword { get; set; }
public IList<UserLoginInfo> Logins { get; set; }
public string PhoneNumber { get; set; }
public bool TwoFactor { get; set; }
public bool BrowserRemembered { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ManageViewModels/ManageLoginsViewModel.cs
================================================
using System.Collections.Generic;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;
namespace AdminLTE.Models.ManageViewModels
{
public class ManageLoginsViewModel
{
public IList<UserLoginInfo> CurrentLogins { get; set; }
public IList<AuthenticationScheme> OtherLogins { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ManageViewModels/RemoveLoginViewModel.cs
================================================
namespace AdminLTE.Models.ManageViewModels
{
public class RemoveLoginViewModel
{
public string LoginProvider { get; set; }
public string ProviderKey { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ManageViewModels/SetPasswordViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.ManageViewModels
{
public class SetPasswordViewModel
{
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models.ManageViewModels
{
public class VerifyPhoneNumberViewModel
{
[Required]
public string Code { get; set; }
[Required]
[Phone]
[Display(Name = "Phone number")]
public string PhoneNumber { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/Message.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AdminLTE.Models
{
public class Message
{
public int Id { get; set; }
public string UserId { get; set; }
public string DisplayName { get; set; }
public string FontAwesomeIcon { get; set; }
public string AvatarURL { get; set; }
public string URLPath { get; set; }
public string ShortDesc { get; set; }
public string TimeSpan { get; set; }
public int Percentage { get; set; }
public string Type { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/RoleViewModels/EditRoleVm.cs
================================================
using Microsoft.AspNetCore.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AdminLTE.Models.RoleViewModels
{
public class EditRoleVm
{
public IdentityRole Role { get; set; }
public IEnumerable<ApplicationUser> Members { get; set; }
public IEnumerable<ApplicationUser> NonMembers { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/RoleViewModels/ModifyRoleVm.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AdminLTE.Models.RoleViewModels
{
public class ModifyRoleVm
{
[Required]
public string RoleName { get; set; }
public string RoleId { get; set; }
public string[] IdsToAdd { get; set; }
public string[] IdsToRemove { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/SalesOrderDetail.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AdminLTE.Models
{
public class SalesOrderDetail
{
public int sr { get; set; }
public string ordertracknumber { get; set; }
public int quantity { get; set; }
public string productname { get; set; }
public string specialoffer { get; set; }
public double unitprice { get; set; }
public double unitpricediscount { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/SidebarMenu.cs
================================================
using System;
using System.Collections.Generic;
namespace AdminLTE.Models
{
public class SidebarMenu
{
public SidebarMenuType Type { get; set; }
public bool IsActive { get; set; } = false;
public string Name { get; set; }
public string IconClassName { get; set; }
public string URLPath { get; set; }
public List<SidebarMenu> TreeChild { get; set; }
public Tuple<int, int, int> LinkCounter { get; set; }
}
public enum SidebarMenuType
{
Header,
Link,
Tree
}
}
================================================
FILE: src/AdminLTE/Models/SuperAdminViewModels/CreateVm.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AdminLTE.Models.SuperAdminViewModels
{
public class CreateVm
{
[Required]
[EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
[Required]
[Display(Name = "FirstName")]
public string FirstName { get; set; }
[Required]
[Display(Name = "LastName")]
public string LastName { get; set; }
}
}
================================================
FILE: src/AdminLTE/Models/UserAudit.cs
================================================
using System;
using System.ComponentModel.DataAnnotations;
namespace AdminLTE.Models
{
public class UserAudit
{
[Key]
public int UserAuditId { get; private set; }
[Required]
public string UserId { get; private set; }
[Required]
public DateTimeOffset Timestamp { get; private set; } = DateTime.UtcNow;
[Required]
public UserAuditEventType AuditEvent { get; set; }
public string IpAddress { get; private set; }
public static UserAudit CreateAuditEvent(string userId, UserAuditEventType auditEventType, string ipAddress)
{
return new UserAudit { UserId = userId, AuditEvent = auditEventType, IpAddress = ipAddress };
}
}
public enum UserAuditEventType
{
Login = 1,
FailedLogin = 2,
LogOut = 3
}
}
================================================
FILE: src/AdminLTE/Program.cs
================================================
using AdminLTE.Data;
using AdminLTE.Models;
using AdminLTE.Services;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc.Authorization;
using Microsoft.EntityFrameworkCore;
using System;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(connectionString));
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
builder.Services.AddIdentity<ApplicationUser, IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
builder.Services.AddControllersWithViews();
builder.Services.AddScoped<IUserClaimsPrincipalFactory<ApplicationUser>, AppClaimsPrincipalFactory>();
builder.Services.AddScoped<SignInManager<ApplicationUser>, AuditableSignInManager<ApplicationUser>>();
var mvcBuilder = builder.Services.AddMvc(config =>
{
var policy = new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser()
.Build();
config.Filters.Add(new AuthorizeFilter(policy));
});
builder.Services.Configure<CookieAuthenticationOptions>(options =>
{
options.LoginPath = new PathString("/Account/Login");
});
// Add application services.
builder.Services.AddTransient<IEmailSender, AuthMessageSender>();
builder.Services.AddTransient<ISmsSender, AuthMessageSender>();
builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseMigrationsEndPoint();
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseStatusCodePagesWithRedirects("~/Home/Error/{0}");
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
//Add middleware here
app.UseMiddleware<RequestLoggingMiddleware>();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.MapRazorPages();
// Populate default user admin
DataSeed.Seed(app.Services).Wait();
app.Run();
================================================
FILE: src/AdminLTE/Project_Readme.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="ut
gitextract_2k0n1zd6/
├── .gitignore
├── AdminLTE.sln.DotSettings
├── AdminLTE.slnx
├── LICENSE
├── README.md
└── src/
└── AdminLTE/
├── AdminLTE.csproj
├── Common/
│ ├── Attributes/
│ │ └── HelpDefinitionAttribute.cs
│ ├── CustomClaimTypes.cs
│ ├── Extensions/
│ │ └── IdentityExtension.cs
│ ├── GlobalHelper.cs
│ └── ModuleHelper.cs
├── Controllers/
│ ├── AccountController.cs
│ ├── BaseController.cs
│ ├── HomeController.cs
│ ├── ManageController.cs
│ ├── RoleController.cs
│ ├── SuperAdminController.cs
│ └── UserLogsController.cs
├── Data/
│ ├── AppClaimsPrincipalFactory.cs
│ ├── ApplicationDbContext.cs
│ ├── AuditableSignInManager.cs
│ ├── DataSeed.cs
│ └── Migrations/
│ ├── 00000000000000_CreateIdentitySchema.Designer.cs
│ ├── 00000000000000_CreateIdentitySchema.cs
│ ├── 20160801092435_ExtendASPNetUser.Designer.cs
│ ├── 20160801092435_ExtendASPNetUser.cs
│ ├── 20160802025049_UserAuditTable.Designer.cs
│ ├── 20160802025049_UserAuditTable.cs
│ ├── 20160802083550_AddedAdditionalUserFields.Designer.cs
│ ├── 20160802083550_AddedAdditionalUserFields.cs
│ ├── 20251217031644_UpdateEF10.Designer.cs
│ ├── 20251217031644_UpdateEF10.cs
│ └── ApplicationDbContextModelSnapshot.cs
├── Models/
│ ├── AccountViewModels/
│ │ ├── ExternalLoginConfirmationViewModel.cs
│ │ ├── ForgotPasswordViewModel.cs
│ │ ├── LoginViewModel.cs
│ │ ├── RegisterViewModel.cs
│ │ ├── ResetPasswordViewModel.cs
│ │ ├── SendCodeViewModel.cs
│ │ └── VerifyCodeViewModel.cs
│ ├── ApplicationUser.cs
│ ├── ManageViewModels/
│ │ ├── AddPhoneNumberViewModel.cs
│ │ ├── ChangePasswordViewModel.cs
│ │ ├── ConfigureTwoFactorViewModel.cs
│ │ ├── FactorViewModel.cs
│ │ ├── IndexViewModel.cs
│ │ ├── ManageLoginsViewModel.cs
│ │ ├── RemoveLoginViewModel.cs
│ │ ├── SetPasswordViewModel.cs
│ │ └── VerifyPhoneNumberViewModel.cs
│ ├── Message.cs
│ ├── RoleViewModels/
│ │ ├── EditRoleVm.cs
│ │ └── ModifyRoleVm.cs
│ ├── SalesOrderDetail.cs
│ ├── SidebarMenu.cs
│ ├── SuperAdminViewModels/
│ │ └── CreateVm.cs
│ └── UserAudit.cs
├── Program.cs
├── Project_Readme.html
├── Properties/
│ └── launchSettings.json
├── Services/
│ ├── IEmailSender.cs
│ ├── ISmsSender.cs
│ ├── MessageServices.cs
│ └── RequestLoggingMiddleware.cs
├── ViewComponents/
│ ├── BreadcrumbViewComponent.cs
│ ├── ControlSidebarViewComponent.cs
│ ├── FooterViewComponent.cs
│ ├── HeaderViewComponent.cs
│ ├── MenuMessageViewComponent.cs
│ ├── MenuNotificationViewComponent.cs
│ ├── MenuTaskViewComponent.cs
│ ├── MenuUserViewComponent.cs
│ ├── PageAlertViewComponent.cs
│ ├── PageHeaderViewComponent.cs
│ └── SidebarViewComponent.cs
├── Views/
│ ├── Account/
│ │ ├── ConfirmEmail.cshtml
│ │ ├── ExternalLoginConfirmation.cshtml
│ │ ├── ExternalLoginFailure.cshtml
│ │ ├── ForgotPassword.cshtml
│ │ ├── ForgotPasswordConfirmation.cshtml
│ │ ├── Lockout.cshtml
│ │ ├── Login.cshtml
│ │ ├── Register.cshtml
│ │ ├── ResetPassword.cshtml
│ │ ├── ResetPasswordConfirmation.cshtml
│ │ ├── SendCode.cshtml
│ │ └── VerifyCode.cshtml
│ ├── Home/
│ │ ├── About.cshtml
│ │ ├── Contact.cshtml
│ │ ├── Error.cshtml
│ │ └── Index.cshtml
│ ├── Manage/
│ │ ├── AddPhoneNumber.cshtml
│ │ ├── ChangePassword.cshtml
│ │ ├── Index.cshtml
│ │ ├── ManageLogins.cshtml
│ │ ├── SetPassword.cshtml
│ │ └── VerifyPhoneNumber.cshtml
│ ├── Role/
│ │ ├── Create.cshtml
│ │ ├── Edit.cshtml
│ │ └── Index.cshtml
│ ├── Shared/
│ │ ├── Components/
│ │ │ ├── Breadcrumb/
│ │ │ │ └── Default.cshtml
│ │ │ ├── ControlSidebar/
│ │ │ │ └── Default.cshtml
│ │ │ ├── Footer/
│ │ │ │ └── Default.cshtml
│ │ │ ├── Header/
│ │ │ │ └── Default.cshtml
│ │ │ ├── MenuMessage/
│ │ │ │ └── Default.cshtml
│ │ │ ├── MenuNotification/
│ │ │ │ └── Default.cshtml
│ │ │ ├── MenuTask/
│ │ │ │ └── Default.cshtml
│ │ │ ├── MenuUser/
│ │ │ │ └── Default.cshtml
│ │ │ ├── PageAlert/
│ │ │ │ └── Default.cshtml
│ │ │ ├── PageHeader/
│ │ │ │ └── Default.cshtml
│ │ │ └── Sidebar/
│ │ │ └── Default.cshtml
│ │ ├── Error.cshtml
│ │ ├── _Layout.cshtml
│ │ ├── _LoginPartial.cshtml
│ │ └── _ValidationScriptsPartial.cshtml
│ ├── SuperAdmin/
│ │ ├── ChangePassword.cshtml
│ │ ├── Create.cshtml
│ │ ├── Edit.cshtml
│ │ └── Index.cshtml
│ ├── UserLogs/
│ │ └── Index.cshtml
│ ├── _ViewImports.cshtml
│ └── _ViewStart.cshtml
├── appsettings.json
├── bundleconfig.json
├── libman.json
├── web.config
└── wwwroot/
├── _references.js
├── css/
│ ├── animation.css
│ ├── error.css
│ └── site.css
├── files/
│ └── SalesOrderDetail.txt
└── js/
└── site.js
SYMBOL INDEX (209 symbols across 67 files)
FILE: src/AdminLTE/Common/Attributes/HelpDefinitionAttribute.cs
class HelpDefinitionAttribute (line 11) | [AttributeUsage(AttributeTargets.Method)]
method OnResultExecuting (line 19) | public override void OnResultExecuting(ResultExecutingContext filterCo...
method HelpDefinitionAttribute (line 31) | public HelpDefinitionAttribute(string fileName = "",[CallerFilePath] s...
FILE: src/AdminLTE/Common/CustomClaimTypes.cs
class CustomClaimTypes (line 3) | public static class CustomClaimTypes
FILE: src/AdminLTE/Common/Extensions/IdentityExtension.cs
class IdentityExtension (line 6) | public static class IdentityExtension
method GetUserProperty (line 14) | public static string GetUserProperty(this ClaimsPrincipal user, string...
FILE: src/AdminLTE/Common/GlobalHelper.cs
class GlobalHelper (line 10) | public static class GlobalHelper
FILE: src/AdminLTE/Common/ModuleHelper.cs
class ModuleHelper (line 10) | public static class ModuleHelper
type Module (line 12) | public enum Module
method AddHeader (line 25) | public static SidebarMenu AddHeader(string name)
method AddTree (line 34) | public static SidebarMenu AddTree(string name, string iconClassName = ...
method AddModule (line 46) | public static SidebarMenu AddModule(Module module, Tuple<int, int, int...
FILE: src/AdminLTE/Controllers/AccountController.cs
class AccountController (line 17) | [Authorize]
method AccountController (line 26) | public AccountController(
method Login (line 42) | [HttpGet]
method Login (line 52) | [HttpPost]
method Register (line 91) | [HttpGet]
method Register (line 101) | [HttpPost]
method LogOff (line 149) | [HttpPost]
method ExternalLogin (line 160) | [HttpPost]
method ExternalLoginCallback (line 173) | [HttpGet]
method ExternalLoginConfirmation (line 215) | [HttpPost]
method ConfirmEmail (line 248) | [HttpGet]
method ForgotPassword (line 267) | [HttpGet]
method ForgotPassword (line 276) | [HttpPost]
method ForgotPasswordConfirmation (line 305) | [HttpGet]
method ResetPassword (line 314) | [HttpGet]
method ResetPassword (line 323) | [HttpPost]
method ResetPasswordConfirmation (line 349) | [HttpGet]
method SendCode (line 358) | [HttpGet]
method SendCode (line 374) | [HttpPost]
method VerifyCode (line 412) | [HttpGet]
method VerifyCode (line 427) | [HttpPost]
method AddErrors (line 459) | private void AddErrors(IdentityResult result)
method GetCurrentUserAsync (line 467) | private Task<ApplicationUser> GetCurrentUserAsync()
method RedirectToLocal (line 472) | private IActionResult RedirectToLocal(string returnUrl)
FILE: src/AdminLTE/Controllers/BaseController.cs
class BaseController (line 12) | public class BaseController : Controller
method AddBreadcrumb (line 14) | internal void AddBreadcrumb(string displayName, string urlPath)
method AddPageHeader (line 31) | internal void AddPageHeader(string pageHeader = "", string pageDescrip...
type PageAlertType (line 36) | internal enum PageAlertType
method AddPageAlerts (line 44) | internal void AddPageAlerts(PageAlertType pageAlertType, string descri...
FILE: src/AdminLTE/Controllers/HomeController.cs
class HomeController (line 13) | public class HomeController : BaseController
method Index (line 15) | [HelpDefinition]
method Index (line 22) | [HttpPost]
method About (line 29) | [HelpDefinition]
method Contact (line 38) | [HelpDefinition("helpdefault")]
method Error (line 47) | public IActionResult Error()
method GetData (line 58) | public ActionResult GetData()
method LoadData (line 121) | private List<SalesOrderDetail> LoadData()
method SortByColumnWithOrder (line 180) | private List<SalesOrderDetail> SortByColumnWithOrder(string order, str...
FILE: src/AdminLTE/Controllers/ManageController.cs
class ManageController (line 13) | [Authorize]
method ManageController (line 22) | public ManageController(
method Index (line 38) | [HttpGet]
method RemoveLogin (line 68) | [HttpPost]
method AddPhoneNumber (line 88) | public IActionResult AddPhoneNumber()
method AddPhoneNumber (line 95) | [HttpPost]
method EnableTwoFactorAuthentication (line 116) | [HttpPost]
method DisableTwoFactorAuthentication (line 132) | [HttpPost]
method VerifyPhoneNumber (line 148) | [HttpGet]
method VerifyPhoneNumber (line 163) | [HttpPost]
method RemovePhoneNumber (line 188) | [HttpPost]
method ChangePassword (line 207) | [HttpGet]
method ChangePassword (line 215) | [HttpPost]
method SetPassword (line 241) | [HttpGet]
method SetPassword (line 249) | [HttpPost]
method ManageLogins (line 274) | [HttpGet]
method LinkLogin (line 300) | [HttpPost]
method LinkLoginCallback (line 312) | [HttpGet]
method AddErrors (line 332) | private void AddErrors(IdentityResult result)
type ManageMessageId (line 340) | public enum ManageMessageId
method GetCurrentUserAsync (line 352) | private Task<ApplicationUser> GetCurrentUserAsync()
FILE: src/AdminLTE/Controllers/RoleController.cs
class RoleController (line 15) | [Authorize(Roles = "SuperAdmins")]
method RoleController (line 21) | public RoleController(RoleManager<IdentityRole> roleMgr, UserManager<A...
method Index (line 27) | public IActionResult Index()
method AddErrors (line 32) | private void AddErrors(IdentityResult result)
method Create (line 40) | public IActionResult Create()
method Create (line 45) | [HttpPost]
method Edit (line 66) | public async Task<IActionResult> Edit(string id)
method Edit (line 88) | [HttpPost]
method Delete (line 139) | public async Task<IActionResult> Delete(string id)
FILE: src/AdminLTE/Controllers/SuperAdminController.cs
class SuperAdminController (line 15) | [Authorize(Roles = "SuperAdmins")]
method SuperAdminController (line 29) | public SuperAdminController(UserManager<ApplicationUser> userMgr,
method Index (line 40) | public ViewResult Index()
method Create (line 45) | public ViewResult Create()
method Create (line 50) | [HttpPost]
method AddErrors (line 86) | private void AddErrors(IdentityResult result)
method Delete (line 94) | public async Task<IActionResult> Delete(string id)
method Edit (line 118) | public async Task<IActionResult> Edit(string id)
method Edit (line 132) | [HttpPost]
method ChangePassword (line 175) | public async Task<IActionResult> ChangePassword(string id)
method ChangePassword (line 189) | [HttpPost]
FILE: src/AdminLTE/Controllers/UserLogsController.cs
class UserLogsController (line 16) | [Authorize(Roles = "SuperAdmins")]
method UserLogsController (line 21) | public UserLogsController(ApplicationDbContext context)
method Index (line 27) | public ViewResult Index()
FILE: src/AdminLTE/Data/AppClaimsPrincipalFactory.cs
class AppClaimsPrincipalFactory (line 12) | public class AppClaimsPrincipalFactory : UserClaimsPrincipalFactory<Appl...
method AppClaimsPrincipalFactory (line 14) | public AppClaimsPrincipalFactory(
method CreateAsync (line 21) | public override async Task<ClaimsPrincipal> CreateAsync(ApplicationUse...
FILE: src/AdminLTE/Data/ApplicationDbContext.cs
class ApplicationDbContext (line 7) | public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
method ApplicationDbContext (line 11) | public ApplicationDbContext(DbContextOptions<ApplicationDbContext> opt...
method OnModelCreating (line 16) | protected override void OnModelCreating(ModelBuilder builder)
FILE: src/AdminLTE/Data/AuditableSignInManager.cs
class AuditableSignInManager (line 16) | public class AuditableSignInManager<TUser> : SignInManager<TUser> where ...
method AuditableSignInManager (line 22) | public AuditableSignInManager(UserManager<TUser> userManager, IHttpCon...
method PasswordSignInAsync (line 39) | public override async Task<SignInResult> PasswordSignInAsync(TUser use...
method SignOutAsync (line 72) | public override async Task SignOutAsync()
FILE: src/AdminLTE/Data/DataSeed.cs
class DataSeed (line 22) | public static class DataSeed
method Seed (line 24) | public static async Task Seed(IServiceProvider serviceProvider)
FILE: src/AdminLTE/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
class CreateIdentitySchema (line 12) | [DbContext(typeof(ApplicationDbContext))]
method BuildTargetModel (line 16) | protected override void BuildTargetModel(ModelBuilder modelBuilder)
FILE: src/AdminLTE/Data/Migrations/00000000000000_CreateIdentitySchema.cs
class CreateIdentitySchema (line 7) | public partial class CreateIdentitySchema : Migration
method Up (line 9) | protected override void Up(MigrationBuilder migrationBuilder)
method Down (line 192) | protected override void Down(MigrationBuilder migrationBuilder)
FILE: src/AdminLTE/Data/Migrations/20160801092435_ExtendASPNetUser.Designer.cs
class ExtendASPNetUser (line 10) | [DbContext(typeof(ApplicationDbContext))]
method BuildTargetModel (line 14) | protected override void BuildTargetModel(ModelBuilder modelBuilder)
FILE: src/AdminLTE/Data/Migrations/20160801092435_ExtendASPNetUser.cs
class ExtendASPNetUser (line 5) | public partial class ExtendASPNetUser : Migration
method Up (line 7) | protected override void Up(MigrationBuilder migrationBuilder)
method Down (line 25) | protected override void Down(MigrationBuilder migrationBuilder)
FILE: src/AdminLTE/Data/Migrations/20160802025049_UserAuditTable.Designer.cs
class UserAuditTable (line 10) | [DbContext(typeof(ApplicationDbContext))]
method BuildTargetModel (line 14) | protected override void BuildTargetModel(ModelBuilder modelBuilder)
FILE: src/AdminLTE/Data/Migrations/20160802025049_UserAuditTable.cs
class UserAuditTable (line 7) | public partial class UserAuditTable : Migration
method Up (line 9) | protected override void Up(MigrationBuilder migrationBuilder)
method Down (line 28) | protected override void Down(MigrationBuilder migrationBuilder)
FILE: src/AdminLTE/Data/Migrations/20160802083550_AddedAdditionalUserFields.Designer.cs
class AddedAdditionalUserFields (line 10) | [DbContext(typeof(ApplicationDbContext))]
method BuildTargetModel (line 14) | protected override void BuildTargetModel(ModelBuilder modelBuilder)
FILE: src/AdminLTE/Data/Migrations/20160802083550_AddedAdditionalUserFields.cs
class AddedAdditionalUserFields (line 7) | public partial class AddedAdditionalUserFields : Migration
method Up (line 9) | protected override void Up(MigrationBuilder migrationBuilder)
method Down (line 27) | protected override void Down(MigrationBuilder migrationBuilder)
FILE: src/AdminLTE/Data/Migrations/20251217031644_UpdateEF10.Designer.cs
class UpdateEF10 (line 14) | [DbContext(typeof(ApplicationDbContext))]
method BuildTargetModel (line 19) | protected override void BuildTargetModel(ModelBuilder modelBuilder)
FILE: src/AdminLTE/Data/Migrations/20251217031644_UpdateEF10.cs
class UpdateEF10 (line 8) | public partial class UpdateEF10 : Migration
method Up (line 11) | protected override void Up(MigrationBuilder migrationBuilder)
method Down (line 49) | protected override void Down(MigrationBuilder migrationBuilder)
FILE: src/AdminLTE/Data/Migrations/ApplicationDbContextModelSnapshot.cs
class ApplicationDbContextModelSnapshot (line 13) | [DbContext(typeof(ApplicationDbContext))]
method BuildModel (line 16) | protected override void BuildModel(ModelBuilder modelBuilder)
FILE: src/AdminLTE/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs
class ExternalLoginConfirmationViewModel (line 5) | public class ExternalLoginConfirmationViewModel
FILE: src/AdminLTE/Models/AccountViewModels/ForgotPasswordViewModel.cs
class ForgotPasswordViewModel (line 5) | public class ForgotPasswordViewModel
FILE: src/AdminLTE/Models/AccountViewModels/LoginViewModel.cs
class LoginViewModel (line 5) | public class LoginViewModel
FILE: src/AdminLTE/Models/AccountViewModels/RegisterViewModel.cs
class RegisterViewModel (line 5) | public class RegisterViewModel
FILE: src/AdminLTE/Models/AccountViewModels/ResetPasswordViewModel.cs
class ResetPasswordViewModel (line 5) | public class ResetPasswordViewModel
FILE: src/AdminLTE/Models/AccountViewModels/SendCodeViewModel.cs
class SendCodeViewModel (line 6) | public class SendCodeViewModel
FILE: src/AdminLTE/Models/AccountViewModels/VerifyCodeViewModel.cs
class VerifyCodeViewModel (line 5) | public class VerifyCodeViewModel
FILE: src/AdminLTE/Models/ApplicationUser.cs
class ApplicationUser (line 7) | public class ApplicationUser : IdentityUser
FILE: src/AdminLTE/Models/ManageViewModels/AddPhoneNumberViewModel.cs
class AddPhoneNumberViewModel (line 5) | public class AddPhoneNumberViewModel
FILE: src/AdminLTE/Models/ManageViewModels/ChangePasswordViewModel.cs
class ChangePasswordViewModel (line 5) | public class ChangePasswordViewModel
FILE: src/AdminLTE/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs
class ConfigureTwoFactorViewModel (line 6) | public class ConfigureTwoFactorViewModel
FILE: src/AdminLTE/Models/ManageViewModels/FactorViewModel.cs
class FactorViewModel (line 3) | public class FactorViewModel
FILE: src/AdminLTE/Models/ManageViewModels/IndexViewModel.cs
class IndexViewModel (line 6) | public class IndexViewModel
FILE: src/AdminLTE/Models/ManageViewModels/ManageLoginsViewModel.cs
class ManageLoginsViewModel (line 7) | public class ManageLoginsViewModel
FILE: src/AdminLTE/Models/ManageViewModels/RemoveLoginViewModel.cs
class RemoveLoginViewModel (line 3) | public class RemoveLoginViewModel
FILE: src/AdminLTE/Models/ManageViewModels/SetPasswordViewModel.cs
class SetPasswordViewModel (line 5) | public class SetPasswordViewModel
FILE: src/AdminLTE/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs
class VerifyPhoneNumberViewModel (line 5) | public class VerifyPhoneNumberViewModel
FILE: src/AdminLTE/Models/Message.cs
class Message (line 8) | public class Message
FILE: src/AdminLTE/Models/RoleViewModels/EditRoleVm.cs
class EditRoleVm (line 9) | public class EditRoleVm
FILE: src/AdminLTE/Models/RoleViewModels/ModifyRoleVm.cs
class ModifyRoleVm (line 9) | public class ModifyRoleVm
FILE: src/AdminLTE/Models/SalesOrderDetail.cs
class SalesOrderDetail (line 9) | public class SalesOrderDetail
FILE: src/AdminLTE/Models/SidebarMenu.cs
class SidebarMenu (line 6) | public class SidebarMenu
type SidebarMenuType (line 17) | public enum SidebarMenuType
FILE: src/AdminLTE/Models/SuperAdminViewModels/CreateVm.cs
class CreateVm (line 9) | public class CreateVm
FILE: src/AdminLTE/Models/UserAudit.cs
class UserAudit (line 6) | public class UserAudit
method CreateAuditEvent (line 22) | public static UserAudit CreateAuditEvent(string userId, UserAuditEvent...
type UserAuditEventType (line 28) | public enum UserAuditEventType
FILE: src/AdminLTE/Services/IEmailSender.cs
type IEmailSender (line 5) | public interface IEmailSender
method SendEmailAsync (line 7) | Task SendEmailAsync(string email, string subject, string message);
FILE: src/AdminLTE/Services/ISmsSender.cs
type ISmsSender (line 5) | public interface ISmsSender
method SendSmsAsync (line 7) | Task SendSmsAsync(string number, string message);
FILE: src/AdminLTE/Services/MessageServices.cs
class AuthMessageSender (line 8) | public class AuthMessageSender : IEmailSender, ISmsSender
method SendEmailAsync (line 10) | public Task SendEmailAsync(string email, string subject, string message)
method SendSmsAsync (line 16) | public Task SendSmsAsync(string number, string message)
FILE: src/AdminLTE/Services/RequestLoggingMiddleware.cs
class RequestLoggingMiddleware (line 11) | public class RequestLoggingMiddleware
method RequestLoggingMiddleware (line 16) | public RequestLoggingMiddleware(RequestDelegate next, ILogger<RequestL...
method Invoke (line 22) | public async Task Invoke(HttpContext context)
FILE: src/AdminLTE/ViewComponents/BreadcrumbViewComponent.cs
class BreadcrumbViewComponent (line 7) | public class BreadcrumbViewComponent : ViewComponent
method BreadcrumbViewComponent (line 10) | public BreadcrumbViewComponent()
method Invoke (line 15) | public IViewComponentResult Invoke(string filter)
FILE: src/AdminLTE/ViewComponents/ControlSidebarViewComponent.cs
class ControlSidebarViewComponent (line 8) | public class ControlSidebarViewComponent : ViewComponent
method ControlSidebarViewComponent (line 11) | public ControlSidebarViewComponent()
method Invoke (line 15) | public IViewComponentResult Invoke(string filter)
method LoadData (line 26) | private string LoadData(string filepath)
FILE: src/AdminLTE/ViewComponents/FooterViewComponent.cs
class FooterViewComponent (line 5) | public class FooterViewComponent : ViewComponent
method FooterViewComponent (line 8) | public FooterViewComponent()
method Invoke (line 12) | public IViewComponentResult Invoke(string filter)
FILE: src/AdminLTE/ViewComponents/HeaderViewComponent.cs
class HeaderViewComponent (line 5) | public class HeaderViewComponent : ViewComponent
method HeaderViewComponent (line 8) | public HeaderViewComponent()
method Invoke (line 12) | public IViewComponentResult Invoke(string filter)
FILE: src/AdminLTE/ViewComponents/MenuMessageViewComponent.cs
class MenuMessageViewComponent (line 9) | public class MenuMessageViewComponent : ViewComponent
method MenuMessageViewComponent (line 12) | public MenuMessageViewComponent()
method Invoke (line 16) | public IViewComponentResult Invoke(string filter)
method GetData (line 22) | private List<Message> GetData()
FILE: src/AdminLTE/ViewComponents/MenuNotificationViewComponent.cs
class MenuNotificationViewComponent (line 7) | public class MenuNotificationViewComponent : ViewComponent
method MenuNotificationViewComponent (line 10) | public MenuNotificationViewComponent()
method Invoke (line 14) | public IViewComponentResult Invoke(string filter)
method GetData (line 20) | private List<Message> GetData()
FILE: src/AdminLTE/ViewComponents/MenuTaskViewComponent.cs
class MenuTaskViewComponent (line 7) | public class MenuTaskViewComponent : ViewComponent
method MenuTaskViewComponent (line 10) | public MenuTaskViewComponent()
method Invoke (line 14) | public IViewComponentResult Invoke(string filter)
method GetData (line 20) | private List<Message> GetData()
FILE: src/AdminLTE/ViewComponents/MenuUserViewComponent.cs
class MenuUserViewComponent (line 7) | public class MenuUserViewComponent : ViewComponent
method MenuUserViewComponent (line 10) | public MenuUserViewComponent()
method Invoke (line 14) | public IViewComponentResult Invoke(string filter)
FILE: src/AdminLTE/ViewComponents/PageAlertViewComponent.cs
class PageAlertViewComponent (line 8) | public class PageAlertViewComponent : ViewComponent
method PageAlertViewComponent (line 11) | public PageAlertViewComponent()
method Invoke (line 15) | public IViewComponentResult Invoke(string filter)
FILE: src/AdminLTE/ViewComponents/PageHeaderViewComponent.cs
class PageHeaderViewComponent (line 6) | public class PageHeaderViewComponent : ViewComponent
method PageHeaderViewComponent (line 9) | public PageHeaderViewComponent()
method Invoke (line 13) | public IViewComponentResult Invoke(string filter)
FILE: src/AdminLTE/ViewComponents/SidebarViewComponent.cs
class SidebarViewComponent (line 12) | public class SidebarViewComponent : ViewComponent
method SidebarViewComponent (line 14) | public SidebarViewComponent()
method Invoke (line 18) | public IViewComponentResult Invoke(string filter)
FILE: src/AdminLTE/wwwroot/js/site.js
function useSubmitClass (line 77) | function useSubmitClass() {
function useDeleteConfirmation (line 85) | function useDeleteConfirmation() {
Condensed preview — 132 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (393K chars).
[
{
"path": ".gitignore",
"chars": 4223,
"preview": "/src/AdminLTE/wwwroot/lib/\n\n## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Vi"
},
{
"path": "AdminLTE.sln.DotSettings",
"chars": 414,
"preview": "<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namesp"
},
{
"path": "AdminLTE.slnx",
"chars": 148,
"preview": "<Solution>\n <Folder Name=\"/Solution Items/\" />\n <Folder Name=\"/src/\">\n <Project Path=\"src/AdminLTE/AdminLTE.csproj\""
},
{
"path": "LICENSE",
"chars": 1065,
"preview": "MIT License\n\nCopyright (c) 2016 Baltazar\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
},
{
"path": "README.md",
"chars": 7100,
"preview": "# **Admin**LTE - MVC Core\nThis template is based from AdminLTE of http://almsaeedstudio.com.\nConverted as a .Net project"
},
{
"path": "src/AdminLTE/AdminLTE.csproj",
"chars": 1540,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk.Web\">\n\n <PropertyGroup>\n <TargetFramework>net10.0</TargetFramework>\n <PreserveCo"
},
{
"path": "src/AdminLTE/Common/Attributes/HelpDefinitionAttribute.cs",
"chars": 1837,
"preview": "using Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing System;\nusing System.Collections.Generic;"
},
{
"path": "src/AdminLTE/Common/CustomClaimTypes.cs",
"chars": 16263,
"preview": "namespace AdminLTE.Common\n{\n public static class CustomClaimTypes\n {\n #region Default ClaimTypes (taken fr"
},
{
"path": "src/AdminLTE/Common/Extensions/IdentityExtension.cs",
"chars": 730,
"preview": "using System.Linq;\nusing System.Security.Claims;\n\nnamespace AdminLTE.Common.Extensions\n{\n public static class Identi"
},
{
"path": "src/AdminLTE/Common/GlobalHelper.cs",
"chars": 254,
"preview": "using Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Http.Features;\nusing System;\nusing System.Collections.Gener"
},
{
"path": "src/AdminLTE/Common/ModuleHelper.cs",
"chars": 4793,
"preview": "using AdminLTE.Models;\nusing System;\nusing System.Collections.Generic;\n\nnamespace AdminLTE.Common\n{\n /// <summary>\n "
},
{
"path": "src/AdminLTE/Controllers/AccountController.cs",
"chars": 18382,
"preview": "using System.Linq;\nusing System.Security.Claims;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Authorization"
},
{
"path": "src/AdminLTE/Controllers/BaseController.cs",
"chars": 1656,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetC"
},
{
"path": "src/AdminLTE/Controllers/HomeController.cs",
"chars": 9884,
"preview": "using AdminLTE.Common.Attributes;\nusing AdminLTE.Models;\nusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspN"
},
{
"path": "src/AdminLTE/Controllers/ManageController.cs",
"chars": 13556,
"preview": "using System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCore.I"
},
{
"path": "src/AdminLTE/Controllers/RoleController.cs",
"chars": 4981,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\nusing System.Linq;\nusing S"
},
{
"path": "src/AdminLTE/Controllers/SuperAdminController.cs",
"chars": 8148,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\nusing System.Linq;\nusing S"
},
{
"path": "src/AdminLTE/Controllers/UserLogsController.cs",
"chars": 854,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\nusing System.Linq;\nusing S"
},
{
"path": "src/AdminLTE/Data/AppClaimsPrincipalFactory.cs",
"chars": 1397,
"preview": "using System.Security.Claims;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetC"
},
{
"path": "src/AdminLTE/Data/ApplicationDbContext.cs",
"chars": 822,
"preview": "using Microsoft.AspNetCore.Identity.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore;\nusing AdminLTE.Models;\n\nn"
},
{
"path": "src/AdminLTE/Data/AuditableSignInManager.cs",
"chars": 3535,
"preview": "using AdminLTE.Models;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore."
},
{
"path": "src/AdminLTE/Data/DataSeed.cs",
"chars": 4055,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security.Claims;\nusing System.Threading"
},
{
"path": "src/AdminLTE/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs",
"chars": 7484,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.Entity"
},
{
"path": "src/AdminLTE/Data/Migrations/00000000000000_CreateIdentitySchema.cs",
"chars": 9159,
"preview": "using System;\nusing Microsoft.EntityFrameworkCore.Metadata;\nusing Microsoft.EntityFrameworkCore.Migrations;\n\nnamespace "
},
{
"path": "src/AdminLTE/Data/Migrations/20160801092435_ExtendASPNetUser.Designer.cs",
"chars": 7581,
"preview": "using System;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Infrastructure;\nusing Microsoft."
},
{
"path": "src/AdminLTE/Data/Migrations/20160801092435_ExtendASPNetUser.cs",
"chars": 1147,
"preview": "using Microsoft.EntityFrameworkCore.Migrations;\n\nnamespace AdminLTE.Data.Migrations\n{\n public partial class ExtendAS"
},
{
"path": "src/AdminLTE/Data/Migrations/20160802025049_UserAuditTable.Designer.cs",
"chars": 8135,
"preview": "using System;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Infrastructure;\nusing Microsoft."
},
{
"path": "src/AdminLTE/Data/Migrations/20160802025049_UserAuditTable.cs",
"chars": 1269,
"preview": "using System;\nusing Microsoft.EntityFrameworkCore.Migrations;\nusing Microsoft.EntityFrameworkCore.Metadata;\n\nnamespace "
},
{
"path": "src/AdminLTE/Data/Migrations/20160802083550_AddedAdditionalUserFields.Designer.cs",
"chars": 8322,
"preview": "using System;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Infrastructure;\nusing Microsoft."
},
{
"path": "src/AdminLTE/Data/Migrations/20160802083550_AddedAdditionalUserFields.cs",
"chars": 1212,
"preview": "using System;\nusing System.Collections.Generic;\nusing Microsoft.EntityFrameworkCore.Migrations;\n\nnamespace AdminLTE.Dat"
},
{
"path": "src/AdminLTE/Data/Migrations/20251217031644_UpdateEF10.Designer.cs",
"chars": 11887,
"preview": "// <auto-generated />\nusing System;\nusing AdminLTE.Data;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFra"
},
{
"path": "src/AdminLTE/Data/Migrations/20251217031644_UpdateEF10.cs",
"chars": 2554,
"preview": "using Microsoft.EntityFrameworkCore.Migrations;\n\n#nullable disable\n\nnamespace AdminLTE.Data.Migrations\n{\n /// <inher"
},
{
"path": "src/AdminLTE/Data/Migrations/ApplicationDbContextModelSnapshot.cs",
"chars": 11800,
"preview": "// <auto-generated />\nusing System;\nusing AdminLTE.Data;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFra"
},
{
"path": "src/AdminLTE/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs",
"chars": 243,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.AccountViewModels\n{\n public class ExternalLo"
},
{
"path": "src/AdminLTE/Models/AccountViewModels/ForgotPasswordViewModel.cs",
"chars": 232,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.AccountViewModels\n{\n public class ForgotPass"
},
{
"path": "src/AdminLTE/Models/AccountViewModels/LoginViewModel.cs",
"chars": 412,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.AccountViewModels\n{\n public class LoginViewM"
},
{
"path": "src/AdminLTE/Models/AccountViewModels/RegisterViewModel.cs",
"chars": 970,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.AccountViewModels\n{\n public class RegisterVi"
},
{
"path": "src/AdminLTE/Models/AccountViewModels/ResetPasswordViewModel.cs",
"chars": 739,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.AccountViewModels\n{\n public class ResetPassw"
},
{
"path": "src/AdminLTE/Models/AccountViewModels/SendCodeViewModel.cs",
"chars": 387,
"preview": "using System.Collections.Generic;\nusing Microsoft.AspNetCore.Mvc.Rendering;\n\nnamespace AdminLTE.Models.AccountViewModel"
},
{
"path": "src/AdminLTE/Models/AccountViewModels/VerifyCodeViewModel.cs",
"chars": 505,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.AccountViewModels\n{\n public class VerifyCode"
},
{
"path": "src/AdminLTE/Models/ApplicationUser.cs",
"chars": 517,
"preview": "using Microsoft.AspNetCore.Identity;\nusing System;\n\nnamespace AdminLTE.Models\n{\n // Add profile data for application"
},
{
"path": "src/AdminLTE/Models/ManageViewModels/AddPhoneNumberViewModel.cs",
"chars": 271,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.ManageViewModels\n{\n public class AddPhoneNum"
},
{
"path": "src/AdminLTE/Models/ManageViewModels/ChangePasswordViewModel.cs",
"chars": 818,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.ManageViewModels\n{\n public class ChangePassw"
},
{
"path": "src/AdminLTE/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs",
"chars": 303,
"preview": "using System.Collections.Generic;\nusing Microsoft.AspNetCore.Mvc.Rendering;\n\nnamespace AdminLTE.Models.ManageViewModels"
},
{
"path": "src/AdminLTE/Models/ManageViewModels/FactorViewModel.cs",
"chars": 137,
"preview": "namespace AdminLTE.Models.ManageViewModels\n{\n public class FactorViewModel\n {\n public string Purpose { get"
},
{
"path": "src/AdminLTE/Models/ManageViewModels/IndexViewModel.cs",
"chars": 415,
"preview": "using System.Collections.Generic;\nusing Microsoft.AspNetCore.Identity;\n\nnamespace AdminLTE.Models.ManageViewModels\n{\n "
},
{
"path": "src/AdminLTE/Models/ManageViewModels/ManageLoginsViewModel.cs",
"chars": 348,
"preview": "using System.Collections.Generic;\nusing Microsoft.AspNetCore.Authentication;\nusing Microsoft.AspNetCore.Identity;\n\nname"
},
{
"path": "src/AdminLTE/Models/ManageViewModels/RemoveLoginViewModel.cs",
"chars": 196,
"preview": "namespace AdminLTE.Models.ManageViewModels\n{\n public class RemoveLoginViewModel\n {\n public string LoginPro"
},
{
"path": "src/AdminLTE/Models/ManageViewModels/SetPasswordViewModel.cs",
"chars": 664,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.ManageViewModels\n{\n public class SetPassword"
},
{
"path": "src/AdminLTE/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs",
"chars": 335,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models.ManageViewModels\n{\n public class VerifyPhone"
},
{
"path": "src/AdminLTE/Models/Message.cs",
"chars": 611,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace AdminLTE.Mo"
},
{
"path": "src/AdminLTE/Models/RoleViewModels/EditRoleVm.cs",
"chars": 403,
"preview": "using Microsoft.AspNetCore.Identity;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Th"
},
{
"path": "src/AdminLTE/Models/RoleViewModels/ModifyRoleVm.cs",
"chars": 437,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\nusing System.Linq;\nusing S"
},
{
"path": "src/AdminLTE/Models/SalesOrderDetail.cs",
"chars": 522,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nna"
},
{
"path": "src/AdminLTE/Models/SidebarMenu.cs",
"chars": 566,
"preview": "using System;\nusing System.Collections.Generic;\n\nnamespace AdminLTE.Models\n{\n public class SidebarMenu\n {\n "
},
{
"path": "src/AdminLTE/Models/SuperAdminViewModels/CreateVm.cs",
"chars": 1060,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\nusing System.Linq;\nusing S"
},
{
"path": "src/AdminLTE/Models/UserAudit.cs",
"chars": 858,
"preview": "using System;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace AdminLTE.Models\n{\n public class UserAudit\n "
},
{
"path": "src/AdminLTE/Program.cs",
"chars": 2605,
"preview": "using AdminLTE.Data;\nusing AdminLTE.Models;\nusing AdminLTE.Services;\nusing Microsoft.AspNetCore.Authentication.Cookies;"
},
{
"path": "src/AdminLTE/Project_Readme.html",
"chars": 6657,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\" />\n <title>Welcome to ASP.NET Core</title>\n <st"
},
{
"path": "src/AdminLTE/Properties/launchSettings.json",
"chars": 685,
"preview": "{\n \"iisSettings\": {\n \"windowsAuthentication\": false,\n \"anonymousAuthentication\": true,\n \"iisExpress\": {\n "
},
{
"path": "src/AdminLTE/Services/IEmailSender.cs",
"chars": 185,
"preview": "using System.Threading.Tasks;\n\nnamespace AdminLTE.Services\n{\n public interface IEmailSender\n {\n Task SendE"
},
{
"path": "src/AdminLTE/Services/ISmsSender.cs",
"chars": 166,
"preview": "using System.Threading.Tasks;\n\nnamespace AdminLTE.Services\n{\n public interface ISmsSender\n {\n Task SendSms"
},
{
"path": "src/AdminLTE/Services/MessageServices.cs",
"chars": 758,
"preview": "using System.Threading.Tasks;\n\nnamespace AdminLTE.Services\n{\n // This class is used by the application to send Email"
},
{
"path": "src/AdminLTE/Services/RequestLoggingMiddleware.cs",
"chars": 1504,
"preview": "using Microsoft.AspNetCore.Http;\nusing Microsoft.Extensions.Logging;\nusing System;\nusing System.Collections.Generic;\nus"
},
{
"path": "src/AdminLTE/ViewComponents/BreadcrumbViewComponent.cs",
"chars": 557,
"preview": "using AdminLTE.Models;\nusing Microsoft.AspNetCore.Mvc;\nusing System.Collections.Generic;\n\nnamespace AdminLTE.ViewCompon"
},
{
"path": "src/AdminLTE/ViewComponents/ControlSidebarViewComponent.cs",
"chars": 2380,
"preview": "using Microsoft.AspNetCore.Mvc;\nusing System;\nusing System.Diagnostics;\nusing System.IO;\n\nnamespace AdminLTE.ViewCompon"
},
{
"path": "src/AdminLTE/ViewComponents/FooterViewComponent.cs",
"chars": 301,
"preview": "using Microsoft.AspNetCore.Mvc;\n\nnamespace AdminLTE.ViewComponents\n{\n public class FooterViewComponent : ViewCompone"
},
{
"path": "src/AdminLTE/ViewComponents/HeaderViewComponent.cs",
"chars": 301,
"preview": "using Microsoft.AspNetCore.Mvc;\n\nnamespace AdminLTE.ViewComponents\n{\n public class HeaderViewComponent : ViewCompone"
},
{
"path": "src/AdminLTE/ViewComponents/MenuMessageViewComponent.cs",
"chars": 1445,
"preview": "using AdminLTE.Models;\nusing Microsoft.AspNetCore.Mvc;\nusing System.Collections.Generic;\nusing System.Security.Claims;\n"
},
{
"path": "src/AdminLTE/ViewComponents/MenuNotificationViewComponent.cs",
"chars": 808,
"preview": "using AdminLTE.Models;\nusing Microsoft.AspNetCore.Mvc;\nusing System.Collections.Generic;\n\nnamespace AdminLTE.ViewCompon"
},
{
"path": "src/AdminLTE/ViewComponents/MenuTaskViewComponent.cs",
"chars": 753,
"preview": "using AdminLTE.Models;\nusing Microsoft.AspNetCore.Mvc;\nusing System.Collections.Generic;\n\nnamespace AdminLTE.ViewCompon"
},
{
"path": "src/AdminLTE/ViewComponents/MenuUserViewComponent.cs",
"chars": 362,
"preview": "using AdminLTE.Models;\nusing Microsoft.AspNetCore.Mvc;\nusing System.Collections.Generic;\n\nnamespace AdminLTE.ViewCompon"
},
{
"path": "src/AdminLTE/ViewComponents/PageAlertViewComponent.cs",
"chars": 653,
"preview": "using AdminLTE.Models;\nusing Microsoft.AspNetCore.Mvc;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Admin"
},
{
"path": "src/AdminLTE/ViewComponents/PageHeaderViewComponent.cs",
"chars": 630,
"preview": "using Microsoft.AspNetCore.Mvc;\nusing System;\n\nnamespace AdminLTE.ViewComponents\n{\n public class PageHeaderViewCompo"
},
{
"path": "src/AdminLTE/ViewComponents/SidebarViewComponent.cs",
"chars": 2023,
"preview": "using System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.AspNetCore.Mvc;\nusing AdminLTE.Common;\nusing Admin"
},
{
"path": "src/AdminLTE/Views/Account/ConfirmEmail.cshtml",
"chars": 232,
"preview": "@{\n ViewData[\"Title\"] = \"Confirm Email\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n<div>\n <p>\n Thank you for confirm"
},
{
"path": "src/AdminLTE/Views/Account/ExternalLoginConfirmation.cshtml",
"chars": 1249,
"preview": "@model ExternalLoginConfirmationViewModel\n@{\n ViewData[\"Title\"] = \"Register\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n<h3>As"
},
{
"path": "src/AdminLTE/Views/Account/ExternalLoginFailure.cshtml",
"chars": 164,
"preview": "@{\n ViewData[\"Title\"] = \"Login Failure\";\n}\n\n<header>\n <h2>@ViewData[\"Title\"].</h2>\n <p class=\"text-danger\">Uns"
},
{
"path": "src/AdminLTE/Views/Account/ForgotPassword.cshtml",
"chars": 1042,
"preview": "@model ForgotPasswordViewModel\n@{\n ViewData[\"Title\"] = \"Forgot your password?\";\n}\n\n<h2>@ViewData[\"Title\"]</h2>\n<p>\n "
},
{
"path": "src/AdminLTE/Views/Account/ForgotPasswordConfirmation.cshtml",
"chars": 153,
"preview": "@{\n ViewData[\"Title\"] = \"Forgot Password Confirmation\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n<p>\n Please check your em"
},
{
"path": "src/AdminLTE/Views/Account/Lockout.cshtml",
"chars": 198,
"preview": "@{\n ViewData[\"Title\"] = \"Locked out\";\n}\n\n<header>\n <h1 class=\"text-danger\">Locked out.</h1>\n <p class=\"text-da"
},
{
"path": "src/AdminLTE/Views/Account/Login.cshtml",
"chars": 5406,
"preview": "@using System.Collections.Generic\n@using Microsoft.AspNetCore.Http\n@model LoginViewModel\n@inject SignInManager<Applicat"
},
{
"path": "src/AdminLTE/Views/Account/Register.cshtml",
"chars": 5294,
"preview": "@model RegisterViewModel\n@{\n ViewData[\"Title\"] = \"Register\";\n Layout = \"\";\n}\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<h"
},
{
"path": "src/AdminLTE/Views/Account/ResetPassword.cshtml",
"chars": 1543,
"preview": "@model ResetPasswordViewModel\n@{\n ViewData[\"Title\"] = \"Reset password\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n\n<form asp-c"
},
{
"path": "src/AdminLTE/Views/Account/ResetPasswordConfirmation.cshtml",
"chars": 214,
"preview": "@{\n ViewData[\"Title\"] = \"Reset password confirmation\";\n}\n\n<h1>@ViewData[\"Title\"].</h1>\n<p>\n Your password has bee"
},
{
"path": "src/AdminLTE/Views/Account/SendCode.cshtml",
"chars": 683,
"preview": "@model SendCodeViewModel\n@{\n ViewData[\"Title\"] = \"Send Verification Code\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n\n<form as"
},
{
"path": "src/AdminLTE/Views/Account/VerifyCode.cshtml",
"chars": 1272,
"preview": "@model VerifyCodeViewModel\n@{\n ViewData[\"Title\"] = \"Verify\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n\n<form asp-controller=\""
},
{
"path": "src/AdminLTE/Views/Home/About.cshtml",
"chars": 155,
"preview": "@{\n ViewData[\"Title\"] = \"About\";\n}\n<h2>@ViewData[\"Title\"].</h2>\n<h3>@ViewData[\"Message\"]</h3>\n\n<p>Use this area to p"
},
{
"path": "src/AdminLTE/Views/Home/Contact.cshtml",
"chars": 450,
"preview": "@{\n ViewData[\"Title\"] = \"Contact\";\n}\n<h2>@ViewData[\"Title\"].</h2>\n<h3>@ViewData[\"Message\"]</h3>\n\n<address>\n One M"
},
{
"path": "src/AdminLTE/Views/Home/Error.cshtml",
"chars": 1985,
"preview": "@{\n Layout = \"\";\n}\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <title>AdminLTE</title>\n\n <meta http-equiv=\"Conten"
},
{
"path": "src/AdminLTE/Views/Home/Index.cshtml",
"chars": 4101,
"preview": "<environment names=\"Development\">\n <link rel=\"stylesheet\" href=\"~/lib/datatables-bs/datatables.bootstrap5.css\" asp-a"
},
{
"path": "src/AdminLTE/Views/Manage/AddPhoneNumber.cshtml",
"chars": 917,
"preview": "@model AddPhoneNumberViewModel\n@{\n ViewData[\"Title\"] = \"Add Phone Number\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n<form asp"
},
{
"path": "src/AdminLTE/Views/Manage/ChangePassword.cshtml",
"chars": 1539,
"preview": "@model ChangePasswordViewModel\n@{\n ViewData[\"Title\"] = \"Change Password\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n\n<form asp"
},
{
"path": "src/AdminLTE/Views/Manage/Index.cshtml",
"chars": 2853,
"preview": "@model IndexViewModel\n@{\n ViewData[\"Title\"] = \"Manage your account\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n<p class=\"text-"
},
{
"path": "src/AdminLTE/Views/Manage/ManageLogins.cshtml",
"chars": 2063,
"preview": "@model ManageLoginsViewModel\n@{\n ViewData[\"Title\"] = \"Manage your external logins\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n"
},
{
"path": "src/AdminLTE/Views/Manage/SetPassword.cshtml",
"chars": 1389,
"preview": "@model SetPasswordViewModel\n@{\n ViewData[\"Title\"] = \"Set Password\";\n}\n\n<p class=\"text-info\">\n You do not have a l"
},
{
"path": "src/AdminLTE/Views/Manage/VerifyPhoneNumber.cshtml",
"chars": 1018,
"preview": "@model VerifyPhoneNumberViewModel\n@{\n ViewData[\"Title\"] = \"Verify Phone Number\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n\n<f"
},
{
"path": "src/AdminLTE/Views/Role/Create.cshtml",
"chars": 821,
"preview": "@model string\n@{\n ViewData[\"Title\"] = \"Create Role\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n\n<div class=\"text-danger\" asp-v"
},
{
"path": "src/AdminLTE/Views/Role/Edit.cshtml",
"chars": 2203,
"preview": "@model AdminLTE.Models.RoleViewModels.EditRoleVm\n@{\n ViewData[\"Title\"] = \"Edit Role\";\n}\n\n<h2>@ViewData[\"Title\"].</h2"
},
{
"path": "src/AdminLTE/Views/Role/Index.cshtml",
"chars": 1937,
"preview": "<link rel=\"stylesheet\" href=\"~/lib/datatables-bs/datatables.bootstrap5.min.css\" asp-append-version=\"true\" />\n<script sr"
},
{
"path": "src/AdminLTE/Views/Shared/Components/Breadcrumb/Default.cshtml",
"chars": 459,
"preview": "@model IEnumerable<Message>\n<ol class=\"breadcrumb float-sm-end\">\n <li class=\"breadcrumb-item\"><a href=\"/\">Home</a></"
},
{
"path": "src/AdminLTE/Views/Shared/Components/ControlSidebar/Default.cshtml",
"chars": 1506,
"preview": "<aside class=\"control-sidebar control-sidebar-dark\">\n <!-- Create the tabs -->\n <ul class=\"nav nav-tabs nav-justi"
},
{
"path": "src/AdminLTE/Views/Shared/Components/Footer/Default.cshtml",
"chars": 277,
"preview": "<footer class=\"app-footer\">\n <!-- To the right -->\n <div class=\"float-right hidden-xs\">\n Anything you want"
},
{
"path": "src/AdminLTE/Views/Shared/Components/Header/Default.cshtml",
"chars": 1805,
"preview": "<!--begin::Header-->\n<nav class=\"app-header navbar navbar-expand bg-body\">\n <!--begin::Container-->\n <div class=\""
},
{
"path": "src/AdminLTE/Views/Shared/Components/MenuMessage/Default.cshtml",
"chars": 1636,
"preview": "@model IEnumerable<Message>\n<li class=\"nav-item dropdown\">\n <!-- Menu toggle button -->\n <a class=\"nav-link\" data"
},
{
"path": "src/AdminLTE/Views/Shared/Components/MenuNotification/Default.cshtml",
"chars": 988,
"preview": "@model IEnumerable<Message>\n<li class=\"nav-item dropdown\">\n <!-- Menu toggle button -->\n <a class=\"nav-link\" data"
},
{
"path": "src/AdminLTE/Views/Shared/Components/MenuTask/Default.cshtml",
"chars": 1,
"preview": ""
},
{
"path": "src/AdminLTE/Views/Shared/Components/MenuUser/Default.cshtml",
"chars": 1842,
"preview": "<li class=\"nav-item dropdown user-menu\">\n <a href=\"#\" class=\"nav-link dropdown-toggle\" data-bs-toggle=\"dropdown\">\n "
},
{
"path": "src/AdminLTE/Views/Shared/Components/PageAlert/Default.cshtml",
"chars": 1311,
"preview": "@model IEnumerable<Message>\n\n@foreach (var item in Model)\n{\n if (item.Type == \"error\")\n {\n <div class=\"ale"
},
{
"path": "src/AdminLTE/Views/Shared/Components/PageHeader/Default.cshtml",
"chars": 102,
"preview": "@model Tuple<string, string>\n<h3 class=\"mb-0\">\n @Model.Item1\n <small>@Model.Item2</small>\n</h3>"
},
{
"path": "src/AdminLTE/Views/Shared/Components/Sidebar/Default.cshtml",
"chars": 4633,
"preview": "@model IEnumerable<AdminLTE.Models.SidebarMenu>\n<aside class=\"app-sidebar bg-body-secondary shadow\" data-bs-theme=\"dark"
},
{
"path": "src/AdminLTE/Views/Shared/Error.cshtml",
"chars": 708,
"preview": "@{\n ViewData[\"Title\"] = \"Error\";\n}\n\n<h1 class=\"text-danger\">Error.</h1>\n<h2 class=\"text-danger\">An error occurred wh"
},
{
"path": "src/AdminLTE/Views/Shared/_Layout.cshtml",
"chars": 5419,
"preview": "<!DOCTYPE html>\n<!--\nThis is a starter template page. Use this page to start your new project from\nscratch. This page g"
},
{
"path": "src/AdminLTE/Views/Shared/_LoginPartial.cshtml",
"chars": 943,
"preview": "@using Microsoft.AspNetCore.Identity\n@using AdminLTE.Models\n\n@inject SignInManager<ApplicationUser> SignInManager\n@inje"
},
{
"path": "src/AdminLTE/Views/Shared/_ValidationScriptsPartial.cshtml",
"chars": 899,
"preview": "<environment names=\"Development\">\n <script src=\"~/lib/jquery-validation/jquery.validate.js\"></script>\n <script sr"
},
{
"path": "src/AdminLTE/Views/SuperAdmin/ChangePassword.cshtml",
"chars": 1457,
"preview": "@model ApplicationUser\n@{\n ViewData[\"Title\"] = \"Change Password\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n\n<div asp-validati"
},
{
"path": "src/AdminLTE/Views/SuperAdmin/Create.cshtml",
"chars": 2115,
"preview": "@model AdminLTE.Models.SuperAdminViewModels.CreateVm\n@{\n ViewData[\"Title\"] = \"Create User\";\n}\n\n<h2>@ViewData[\"Title\""
},
{
"path": "src/AdminLTE/Views/SuperAdmin/Edit.cshtml",
"chars": 1297,
"preview": "@model ApplicationUser\n@{\n ViewData[\"Title\"] = \"Edit User\";\n}\n\n<h2>@ViewData[\"Title\"].</h2>\n\n<div asp-validation-sum"
},
{
"path": "src/AdminLTE/Views/SuperAdmin/Index.cshtml",
"chars": 2041,
"preview": "<link rel=\"stylesheet\" href=\"~/lib/datatables-bs/datatables.bootstrap5.min.css\" asp-append-version=\"true\" />\n<script sr"
},
{
"path": "src/AdminLTE/Views/UserLogs/Index.cshtml",
"chars": 1799,
"preview": "<link rel=\"stylesheet\" href=\"~/lib/datatables/css/dataTables.bootstrap4.min.css\" asp-append-version=\"true\" />\n<script s"
},
{
"path": "src/AdminLTE/Views/_ViewImports.cshtml",
"chars": 267,
"preview": "@using AdminLTE\n@using AdminLTE.Models\n@using AdminLTE.Models.AccountViewModels\n@using AdminLTE.Models.ManageViewModels"
},
{
"path": "src/AdminLTE/Views/_ViewStart.cshtml",
"chars": 30,
"preview": "@{\n Layout = \"_Layout\";\n}\n"
},
{
"path": "src/AdminLTE/appsettings.json",
"chars": 309,
"preview": "{\n \"ConnectionStrings\": {\n \"DefaultConnection\": \"Server=(localdb)\\\\MSSQLLocalDB;Database=AdminLTECore-sample;Integr"
},
{
"path": "src/AdminLTE/bundleconfig.json",
"chars": 601,
"preview": "// Configure bundling and minification for the project.\n// More info at https://go.microsoft.com/fwlink/?LinkId=808241\n"
},
{
"path": "src/AdminLTE/libman.json",
"chars": 1561,
"preview": "{\n \"version\": \"1.0\",\n \"defaultProvider\": \"cdnjs\",\n \"libraries\": [\n {\n \"library\": \"twitter-bootstrap@5.3.8\",\n "
},
{
"path": "src/AdminLTE/web.config",
"chars": 575,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <!--\n Configure your application settings in appsettings.js"
},
{
"path": "src/AdminLTE/wwwroot/_references.js",
"chars": 543,
"preview": "/// <autosync enabled=\"true\" />\n/// <reference path=\"lib/admin-lte/dist/js/adminlte.js\" />\n/// <reference path=\"js/site"
},
{
"path": "src/AdminLTE/wwwroot/css/animation.css",
"chars": 11672,
"preview": ".animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-"
},
{
"path": "src/AdminLTE/wwwroot/css/error.css",
"chars": 1330,
"preview": "@charset \"UTF-8\";\n\nhtml * {\n outline: none !important;\n}\nhtml,\nbody {\n font-size: 12px;\n padding: 0px;\n margin: 0px"
},
{
"path": "src/AdminLTE/wwwroot/css/site.css",
"chars": 521,
"preview": "\n/*PACE.js Related*/\n.pace {\n pointer-events: none;\n\n -webkit-user-select: none;\n -moz-user-select: none;\n user-sel"
},
{
"path": "src/AdminLTE/wwwroot/files/SalesOrderDetail.txt",
"chars": 64341,
"preview": "0,1,2,3,4,5,6\n1,4911-403C-98,1,Mountain-100 Black. 42,No Discount,2024.994,0.00\n2,4911-403C-98,3,Mountain-100 Black. 44"
},
{
"path": "src/AdminLTE/wwwroot/js/site.js",
"chars": 3426,
"preview": "/*\\\n|*|\n|*| :: cookies.js ::\n|*|\n|*| A complete cookies reader/writer framework with full unicode support.\n|*|\n|*| R"
}
]
About this extraction
This page contains the full source code of the moemura/AdminLTE.Core GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 132 files (357.6 KB), approximately 99.7k tokens, and a symbol index with 209 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.