Cancel
+
+
+
}
@code {
@@ -78,6 +92,13 @@
List profiles;
Dictionary settings;
string category = "";
+ string createdby;
+ DateTime createdon;
+ string modifiedby;
+ DateTime modifiedon;
+ string deletedby;
+ DateTime? deletedon;
+ string isdeleted;
protected override async Task OnInitializedAsync()
{
@@ -93,6 +114,13 @@
email = user.Email;
displayname = user.DisplayName;
settings = await SettingService.GetUserSettingsAsync(user.UserId);
+ createdby = user.CreatedBy;
+ createdon = user.CreatedOn;
+ modifiedby = user.ModifiedBy;
+ modifiedon = user.ModifiedOn;
+ deletedby = user.DeletedBy;
+ deletedon = user.DeletedOn;
+ isdeleted = user.IsDeleted.ToString();
}
}
catch (Exception ex)
@@ -115,7 +143,9 @@
user.Username = username;
user.Password = password;
user.Email = email;
- user.DisplayName = displayname;
+ user.DisplayName = string.IsNullOrWhiteSpace(user.DisplayName) ? user.Username : user.DisplayName;
+ user.IsDeleted = (isdeleted == null ? true : Boolean.Parse(isdeleted));
+
user = await UserService.UpdateUserAsync(user);
await SettingService.UpdateUserSettingsAsync(settings, user.UserId);
diff --git a/Oqtane.Server/Controllers/UserController.cs b/Oqtane.Server/Controllers/UserController.cs
index c767e479..a2bbd4bd 100644
--- a/Oqtane.Server/Controllers/UserController.cs
+++ b/Oqtane.Server/Controllers/UserController.cs
@@ -152,9 +152,19 @@ namespace Oqtane.Controllers
// DELETE api//5?siteid=x
[HttpDelete("{id}")]
[Authorize(Roles = Constants.AdminRole)]
- public void Delete(int id)
+ public async Task Delete(int id)
{
- Users.DeleteUser(id);
+ IdentityUser identityuser = await IdentityUserManager.FindByNameAsync(Users.GetUser(id).Username);
+
+ if (identityuser != null)
+ {
+ var result = await IdentityUserManager.DeleteAsync(identityuser);
+
+ if (result != null)
+ {
+ Users.DeleteUser(id);
+ }
+ }
}
// POST api//login
diff --git a/Oqtane.Server/Scripts/00.00.00.sql b/Oqtane.Server/Scripts/00.00.00.sql
index fd1a0233..d50dce0a 100644
--- a/Oqtane.Server/Scripts/00.00.00.sql
+++ b/Oqtane.Server/Scripts/00.00.00.sql
@@ -14,6 +14,9 @@ CREATE TABLE [dbo].[Site](
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [nvarchar](256) NOT NULL,
[ModifiedOn] [datetime] NOT NULL,
+ [DeletedBy] [nvarchar](256) NULL,
+ [DeletedOn] [datetime] NULL,
+ [IsDeleted][bit] NOT NULL
CONSTRAINT [PK_Site] PRIMARY KEY CLUSTERED
(
[SiteId] ASC
@@ -91,6 +94,9 @@ CREATE TABLE [dbo].[User](
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [nvarchar](256) NOT NULL,
[ModifiedOn] [datetime] NOT NULL,
+ [DeletedBy] [nvarchar](256) NULL,
+ [DeletedOn] [datetime] NULL,
+ [IsDeleted][bit] NOT NULL
CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED
(
[UserId] ASC
diff --git a/Oqtane.Shared/Models/Site.cs b/Oqtane.Shared/Models/Site.cs
index f1384879..05c659ef 100644
--- a/Oqtane.Shared/Models/Site.cs
+++ b/Oqtane.Shared/Models/Site.cs
@@ -2,7 +2,7 @@
namespace Oqtane.Models
{
- public class Site : IAuditable
+ public class Site : IAuditable, IDeletable
{
public int SiteId { get; set; }
public string Name { get; set; }
@@ -15,5 +15,8 @@ namespace Oqtane.Models
public DateTime CreatedOn { get; set; }
public string ModifiedBy { get; set; }
public DateTime ModifiedOn { get; set; }
+ public string DeletedBy { get; set; }
+ public DateTime? DeletedOn { get; set; }
+ public bool IsDeleted { get; set; }
}
}
diff --git a/Oqtane.Shared/Models/User.cs b/Oqtane.Shared/Models/User.cs
index 001c4472..bec8f3e2 100644
--- a/Oqtane.Shared/Models/User.cs
+++ b/Oqtane.Shared/Models/User.cs
@@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Oqtane.Models
{
- public class User : IAuditable
+ public class User : IAuditable, IDeletable
{
public int UserId { get; set; }
public string Username { get; set; }
@@ -19,6 +19,9 @@ namespace Oqtane.Models
public DateTime CreatedOn { get; set; }
public string ModifiedBy { get; set; }
public DateTime ModifiedOn { get; set; }
+ public string DeletedBy { get; set; }
+ public DateTime? DeletedOn { get; set; }
+ public bool IsDeleted { get; set; }
[NotMapped]
public string Password { get; set; }
diff --git a/README.md b/README.md
index 5c44003e..1dc1e8d4 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera
2. Install the latest edition of [Visual Studio 2019](https://visualstudio.com/vs/) with the **ASP.NET and web development** workload. Installing the latest edition will also install the latest version of .NET Core 3.0.
- 3. Download or Clone the Oqtane source code to your local system. Open the **Oqtane.sln** solution file. If you want to develop using **server-side** Blazor ( which includes a full debugging experience in Visual Studio ) you should choose to Build the solution using the default Debug configuration. If you want to develop using **client-side** Blazor ( WebAssembly ) you should first choose the "Wasm" configuration option in the Visual Studio toolbar and then Build.
+ 3. Download or Clone the Oqtane source code to your local system. Open the **Oqtane.sln** solution file. If you want to develop using **server-side** Blazor (which includes a full debugging experience in Visual Studio) you should choose to Build the solution using the default Debug configuration. If you want to develop using **client-side** Blazor (WebAssembly) you should first choose the "Wasm" configuration option in the Visual Studio toolbar and then Build.
NOTE: If you have already installed a previous version of Oqtane and you wish to install a newer version, there is currently no upgrade path from one version to the next. The recommended upgrade approach is to get the latest code and build it, and then reset the DefaultConnection value to "" in the appsettings.json file in the Oqtane.server project. This will trigger a re-install when you run the application which will execute the latest database scripts.
@@ -27,7 +27,6 @@ Design
- Need to cleanly separate site.css
Admin
-- Need fully functional administrative modules for all core entities ( user, role, site, etc… )
- Need ability to soft delete core entities
- Drag and Drop modules
@@ -40,7 +39,7 @@ Database
- Need ability to run on SQLite
# Background
-Oqtane was created by [Shaun Walker](https://www.linkedin.com/in/shaunbrucewalker/) and is inspired by the DotNetNuke web application framework. Initially created as a proof of concept, Oqtane is a native Blazor application written from the ground up using modern .NET Core technology. It is a modular framework offering a fully dynamic page compositing model, multi-site support, designer friendly templates ( skins ), and extensibility via third party modules.
+Oqtane was created by [Shaun Walker](https://www.linkedin.com/in/shaunbrucewalker/) and is inspired by the DotNetNuke web application framework. Initially created as a proof of concept, Oqtane is a native Blazor application written from the ground up using modern .NET Core technology. It is a modular framework offering a fully dynamic page compositing model, multi-site support, designer friendly templates (skins), and extensibility via third party modules.
At this point Oqtane offers a minimum of desired functionality and is not recommended for production usage. The expectation is that Oqtane will rapidly evolve as a community driven open source project. At this point in time we do not promise any upgrade path from one version to the next, and developers should expect breaking changes as the framework stabilizes.