Merge pull request #267 from sbwalker/master
completed client state invalidation in multi-user environment
This commit is contained in:
commit
44c9c050d7
|
@ -152,7 +152,7 @@
|
||||||
}
|
}
|
||||||
await FolderService.UpdateFolderOrderAsync(folder.SiteId, folder.FolderId, folder.ParentId);
|
await FolderService.UpdateFolderOrderAsync(folder.SiteId, folder.FolderId, folder.ParentId);
|
||||||
await logger.LogInformation("Folder Saved {Folder}", folder);
|
await logger.LogInformation("Folder Saved {Folder}", folder);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
{
|
{
|
||||||
await logger.LogInformation("Login Successful For Username {Username}", Username);
|
await logger.LogInformation("Login Successful For Username {Username}", Username);
|
||||||
authstateprovider.NotifyAuthenticationChanged();
|
authstateprovider.NotifyAuthenticationChanged();
|
||||||
NavigationManager.NavigateTo(NavigateUrl(ReturnUrl, Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl(ReturnUrl));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
moduledefinition.Permissions = permissiongrid.GetPermissions();
|
moduledefinition.Permissions = permissiongrid.GetPermissions();
|
||||||
await ModuleDefinitionService.UpdateModuleDefinitionAsync(moduledefinition);
|
await ModuleDefinitionService.UpdateModuleDefinitionAsync(moduledefinition);
|
||||||
await logger.LogInformation("ModuleDefinition Saved {ModuleDefinition}", moduledefinition);
|
await logger.LogInformation("ModuleDefinition Saved {ModuleDefinition}", moduledefinition);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,7 +78,7 @@ else
|
||||||
await PackageService.DownloadPackageAsync(moduledefinitionname, version, "Modules");
|
await PackageService.DownloadPackageAsync(moduledefinitionname, version, "Modules");
|
||||||
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
||||||
await logger.LogInformation("Module Downloaded {ModuleDefinitionName} {Version}", moduledefinitionname, version);
|
await logger.LogInformation("Module Downloaded {ModuleDefinitionName} {Version}", moduledefinitionname, version);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,7 @@ else
|
||||||
{
|
{
|
||||||
await ModuleDefinitionService.DeleteModuleDefinitionAsync(ModuleDefinition.ModuleDefinitionId, ModuleDefinition.SiteId);
|
await ModuleDefinitionService.DeleteModuleDefinitionAsync(ModuleDefinition.ModuleDefinitionId, ModuleDefinition.SiteId);
|
||||||
await logger.LogInformation("Module Deleted {ModuleDefinition}", ModuleDefinition);
|
await logger.LogInformation("Module Deleted {ModuleDefinition}", ModuleDefinition);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ModuleService.ImportModuleAsync(ModuleState.ModuleId, content);
|
await ModuleService.ImportModuleAsync(ModuleState.ModuleId, content);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Page));
|
StateHasChanged();
|
||||||
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
moduleType.GetMethod("UpdateSettings").Invoke(settings, null); // method must be public in settings component
|
moduleType.GetMethod("UpdateSettings").Invoke(settings, null); // method must be public in settings component
|
||||||
}
|
}
|
||||||
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Page));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,7 +315,7 @@
|
||||||
await PageService.UpdatePageOrderAsync(page.SiteId, page.PageId, page.ParentId);
|
await PageService.UpdatePageOrderAsync(page.SiteId, page.PageId, page.ParentId);
|
||||||
|
|
||||||
await logger.LogInformation("Page Added {Page}", page);
|
await logger.LogInformation("Page Added {Page}", page);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(page.Path, Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl(page.Path));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -400,7 +400,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
await logger.LogInformation("Page Saved {Page}", page);
|
await logger.LogInformation("Page Saved {Page}", page);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(page.Path, Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl(page.Path));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
Page.IsDeleted = true;
|
Page.IsDeleted = true;
|
||||||
await PageService.UpdatePageAsync(Page);
|
await PageService.UpdatePageAsync(Page);
|
||||||
await logger.LogInformation("Page Deleted {Page}", Page);
|
await logger.LogInformation("Page Deleted {Page}", Page);
|
||||||
NavigationManager.NavigateTo(NavigateUrl("admin/pages", Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl("admin/pages"));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
await logger.LogInformation("Page Restored {Page}", Page);
|
await logger.LogInformation("Page Restored {Page}", Page);
|
||||||
await Load();
|
await Load();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -134,7 +134,7 @@
|
||||||
await logger.LogInformation("Page Permanently Deleted {Page}", Page);
|
await logger.LogInformation("Page Permanently Deleted {Page}", Page);
|
||||||
await Load();
|
await Load();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -329,7 +329,7 @@
|
||||||
|
|
||||||
await logger.LogInformation("Site Saved {Site}", site);
|
await logger.LogInformation("Site Saved {Site}", site);
|
||||||
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -243,7 +243,7 @@
|
||||||
|
|
||||||
await Log(Alias, LogLevel.Information, "Edit", null, "Site Saved {Site}", site);
|
await Log(Alias, LogLevel.Information, "Edit", null, "Site Saved {Site}", site);
|
||||||
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -61,7 +61,7 @@ else
|
||||||
{
|
{
|
||||||
await AliasService.DeleteAliasAsync(alias.AliasId);
|
await AliasService.DeleteAliasAsync(alias.AliasId);
|
||||||
}
|
}
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
private async Task InstallThemes()
|
private async Task InstallThemes()
|
||||||
{
|
{
|
||||||
await ThemeService.InstallThemesAsync();
|
await ThemeService.InstallThemesAsync();
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DownloadTheme(string packageid, string version)
|
private async Task DownloadTheme(string packageid, string version)
|
||||||
|
|
|
@ -66,13 +66,13 @@ else
|
||||||
await PackageService.DownloadPackageAsync(themename, version, "Themes");
|
await PackageService.DownloadPackageAsync(themename, version, "Themes");
|
||||||
await logger.LogInformation("Theme Downloaded {ThemeName} {Version}", themename, version);
|
await logger.LogInformation("Theme Downloaded {ThemeName} {Version}", themename, version);
|
||||||
await ThemeService.InstallThemesAsync();
|
await ThemeService.InstallThemesAsync();
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DeleteTheme(Theme Theme)
|
private async Task DeleteTheme(Theme Theme)
|
||||||
{
|
{
|
||||||
await ThemeService.DeleteThemeAsync(Theme.ThemeName);
|
await ThemeService.DeleteThemeAsync(Theme.ThemeName);
|
||||||
await logger.LogInformation("Theme Deleted {Theme}", Theme);
|
await logger.LogInformation("Theme Deleted {Theme}", Theme);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -47,13 +47,13 @@
|
||||||
private async Task Upgrade()
|
private async Task Upgrade()
|
||||||
{
|
{
|
||||||
await InstallationService.Upgrade();
|
await InstallationService.Upgrade();
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Download(string packageid, string version)
|
private async Task Download(string packageid, string version)
|
||||||
{
|
{
|
||||||
await PackageService.DownloadPackageAsync(packageid, version, "Framework");
|
await PackageService.DownloadPackageAsync(packageid, version, "Framework");
|
||||||
await InstallationService.Upgrade();
|
await InstallationService.Upgrade();
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -189,7 +189,7 @@
|
||||||
await htmltextservice.AddHtmlTextAsync(htmltext);
|
await htmltextservice.AddHtmlTextAsync(htmltext);
|
||||||
}
|
}
|
||||||
await logger.LogInformation("Html/Text Content Saved {HtmlText}", htmltext);
|
await logger.LogInformation("Html/Text Content Saved {HtmlText}", htmltext);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Page));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Oqtane.Shared
|
namespace Oqtane.Modules
|
||||||
{
|
{
|
||||||
public enum MessageType
|
public enum MessageType
|
||||||
{
|
{
|
|
@ -2,9 +2,9 @@
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Linq;
|
|
||||||
using Oqtane.Services;
|
using Oqtane.Services;
|
||||||
using System;
|
using System;
|
||||||
|
using Oqtane.UI;
|
||||||
|
|
||||||
namespace Oqtane.Modules
|
namespace Oqtane.Modules
|
||||||
{
|
{
|
||||||
|
@ -49,29 +49,14 @@ namespace Oqtane.Modules
|
||||||
return NavigateUrl(PageState.Page.Path);
|
return NavigateUrl(PageState.Page.Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string NavigateUrl(Reload reload)
|
|
||||||
{
|
|
||||||
return NavigateUrl(PageState.Page.Path, reload);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path)
|
public string NavigateUrl(string path)
|
||||||
{
|
{
|
||||||
return NavigateUrl(path, "", Reload.None);
|
return NavigateUrl(path, "");
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path, Reload reload)
|
|
||||||
{
|
|
||||||
return NavigateUrl(path, "", reload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string NavigateUrl(string path, string parameters)
|
public string NavigateUrl(string path, string parameters)
|
||||||
{
|
{
|
||||||
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters, Reload.None);
|
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters);
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path, string parameters, Reload reload)
|
|
||||||
{
|
|
||||||
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters, reload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string EditUrl(string action)
|
public string EditUrl(string action)
|
||||||
|
|
|
@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
|
using Oqtane.UI;
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
using System.Threading.Tasks;
|
using Oqtane.UI;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Oqtane.Themes
|
namespace Oqtane.Themes
|
||||||
{
|
{
|
||||||
|
@ -30,29 +29,14 @@ namespace Oqtane.Themes
|
||||||
return NavigateUrl(PageState.Page.Path);
|
return NavigateUrl(PageState.Page.Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string NavigateUrl(Reload reload)
|
|
||||||
{
|
|
||||||
return NavigateUrl(PageState.Page.Path, reload);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path)
|
public string NavigateUrl(string path)
|
||||||
{
|
{
|
||||||
return NavigateUrl(path, "", Reload.None);
|
return NavigateUrl(path, "");
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path, Reload reload)
|
|
||||||
{
|
|
||||||
return NavigateUrl(path, "", reload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string NavigateUrl(string path, string parameters)
|
public string NavigateUrl(string path, string parameters)
|
||||||
{
|
{
|
||||||
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters, Reload.None);
|
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters);
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path, string parameters, Reload reload)
|
|
||||||
{
|
|
||||||
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters, reload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string EditUrl(string action, string parameters)
|
public string EditUrl(string action, string parameters)
|
||||||
|
|
|
@ -29,9 +29,12 @@
|
||||||
<button type="button" class="btn btn-primary btn-block mx-auto" @onclick=@(async () => Navigate("Admin"))>Admin Dashboard</button>
|
<button type="button" class="btn btn-primary btn-block mx-auto" @onclick=@(async () => Navigate("Admin"))>Admin Dashboard</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr class="app-rule" />
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col text-center">
|
||||||
<label class="control-label">Page: </label>
|
<label class="control-label">Page Management: </label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -69,10 +72,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<hr class="app-rule"/>
|
<hr class="app-rule" />
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col text-center">
|
||||||
<label for="Module" class="control-label">Module: </label>
|
<label for="Module" class="control-label">Module: </label>
|
||||||
<select class="form-control" @bind="@_moduleType">
|
<select class="form-control" @bind="@_moduleType">
|
||||||
<option value="new">Add New Module</option>
|
<option value="new">Add New Module</option>
|
||||||
|
@ -121,17 +124,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col text-center">
|
||||||
<label for="Title" class="control-label">Title: </label>
|
<label for="Title" class="control-label">Title: </label>
|
||||||
<input type="text" name="Title" class="form-control" @bind="@_title"/>
|
<input type="text" name="Title" class="form-control" @bind="@_title" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col text-center">
|
||||||
<label for="Pane" class="control-label">Pane: </label>
|
<label for="Pane" class="control-label">Pane: </label>
|
||||||
<select class="form-control" @bind="@_pane">
|
<select class="form-control" @bind="@_pane">
|
||||||
<option value=""><Select Pane></option>
|
<option value=""><Select Pane></option>
|
||||||
@foreach (string pane in PageState.Page.Panes.Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries))
|
@foreach (string pane in PageState.Page.Panes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
|
||||||
{
|
{
|
||||||
<option value="@pane">@pane Pane</option>
|
<option value="@pane">@pane Pane</option>
|
||||||
}
|
}
|
||||||
|
@ -139,7 +142,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col text-center">
|
||||||
<label for="Container" class="control-label">Container: </label>
|
<label for="Container" class="control-label">Container: </label>
|
||||||
<select class="form-control" @bind="@_containerType">
|
<select class="form-control" @bind="@_containerType">
|
||||||
@foreach (KeyValuePair<string, string> container in _containers)
|
@foreach (KeyValuePair<string, string> container in _containers)
|
||||||
|
@ -150,6 +153,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary btn-block mx-auto" @onclick="@AddModule">Add Module To Page</button>
|
<button type="button" class="btn btn-primary btn-block mx-auto" @onclick="@AddModule">Add Module To Page</button>
|
||||||
@((MarkupString) _message)
|
@((MarkupString) _message)
|
||||||
</div>
|
</div>
|
||||||
|
@ -325,7 +330,7 @@
|
||||||
|
|
||||||
var pageModule = new PageModule
|
var pageModule = new PageModule
|
||||||
{
|
{
|
||||||
PageId = (_pageId == "-") ? PageState.Page.PageId : int.Parse(_pageId),
|
PageId = PageState.Page.PageId,
|
||||||
ModuleId = int.Parse(_moduleId),
|
ModuleId = int.Parse(_moduleId),
|
||||||
Title = _title
|
Title = _title
|
||||||
};
|
};
|
||||||
|
@ -361,7 +366,7 @@
|
||||||
_pageId = "-";
|
_pageId = "-";
|
||||||
_moduleId = "-";
|
_moduleId = "-";
|
||||||
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Page));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -386,7 +391,7 @@
|
||||||
{
|
{
|
||||||
PageState.EditMode = true;
|
PageState.EditMode = true;
|
||||||
}
|
}
|
||||||
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + ((PageState.EditMode) ? "1" : "0"), Reload.Page));
|
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + ((PageState.EditMode) ? "1" : "0")));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -394,7 +399,7 @@
|
||||||
{
|
{
|
||||||
await PageService.AddPageAsync(PageState.Page.PageId, PageState.User.UserId);
|
await PageService.AddPageAsync(PageState.Page.PageId, PageState.User.UserId);
|
||||||
PageState.EditMode = true;
|
PageState.EditMode = true;
|
||||||
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + ((PageState.EditMode) ? "1" : "0"), Reload.Page));
|
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + ((PageState.EditMode) ? "1" : "0")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -469,13 +474,13 @@
|
||||||
page.IsDeleted = true;
|
page.IsDeleted = true;
|
||||||
await PageService.UpdatePageAsync(page);
|
await PageService.UpdatePageAsync(page);
|
||||||
await logger.Log(page.PageId, null, PageState.User.UserId, GetType().AssemblyQualifiedName, "ControlPanel", LogFunction.Delete, LogLevel.Information, null, "Page Deleted {Page}", page);
|
await logger.Log(page.PageId, null, PageState.User.UserId, GetType().AssemblyQualifiedName, "ControlPanel", LogFunction.Delete, LogLevel.Information, null, "Page Deleted {Page}", page);
|
||||||
NavigationManager.NavigateTo(NavigateUrl("", Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl(""));
|
||||||
}
|
}
|
||||||
else // personalized page
|
else // personalized page
|
||||||
{
|
{
|
||||||
await PageService.DeletePageAsync(page.PageId);
|
await PageService.DeletePageAsync(page.PageId);
|
||||||
await logger.Log(page.PageId, null, PageState.User.UserId, GetType().AssemblyQualifiedName, "ControlPanel", LogFunction.Delete, LogLevel.Information, null, "Page Deleted {Page}", page);
|
await logger.Log(page.PageId, null, PageState.User.UserId, GetType().AssemblyQualifiedName, "ControlPanel", LogFunction.Delete, LogLevel.Information, null, "Page Deleted {Page}", page);
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Page));
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
{
|
{
|
||||||
// client-side Blazor
|
// client-side Blazor
|
||||||
authstateprovider.NotifyAuthenticationChanged();
|
authstateprovider.NotifyAuthenticationChanged();
|
||||||
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "logout", Reload.Site));
|
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "logout"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
{
|
{
|
||||||
PageModule pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId);
|
PageModule pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId);
|
||||||
|
|
||||||
string url = NavigateUrl(Reload.Page);
|
string url = NavigateUrl();
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case "<<":
|
case "<<":
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
|
using Oqtane.UI;
|
||||||
|
|
||||||
namespace Oqtane.Themes
|
namespace Oqtane.Themes
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
|
using Oqtane.UI;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Oqtane.Themes
|
namespace Oqtane.Themes
|
||||||
|
@ -34,29 +35,14 @@ namespace Oqtane.Themes
|
||||||
return NavigateUrl(PageState.Page.Path);
|
return NavigateUrl(PageState.Page.Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string NavigateUrl(Reload reload)
|
|
||||||
{
|
|
||||||
return NavigateUrl(PageState.Page.Path, reload);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path)
|
public string NavigateUrl(string path)
|
||||||
{
|
{
|
||||||
return NavigateUrl(path, "", Reload.None);
|
return NavigateUrl(path, "");
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path, Reload reload)
|
|
||||||
{
|
|
||||||
return NavigateUrl(path, "", reload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string NavigateUrl(string path, string parameters)
|
public string NavigateUrl(string path, string parameters)
|
||||||
{
|
{
|
||||||
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters, Reload.None);
|
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters);
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path, string parameters, Reload reload)
|
|
||||||
{
|
|
||||||
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters, reload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string EditUrl(int moduleid, string action)
|
public string EditUrl(int moduleid, string action)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
|
using Oqtane.UI;
|
||||||
|
|
||||||
namespace Oqtane.Themes
|
namespace Oqtane.Themes
|
||||||
{
|
{
|
||||||
|
@ -13,29 +14,14 @@ namespace Oqtane.Themes
|
||||||
return NavigateUrl(PageState.Page.Path);
|
return NavigateUrl(PageState.Page.Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string NavigateUrl(Reload reload)
|
|
||||||
{
|
|
||||||
return NavigateUrl(PageState.Page.Path, reload);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path)
|
public string NavigateUrl(string path)
|
||||||
{
|
{
|
||||||
return NavigateUrl(path, "", Reload.None);
|
return NavigateUrl(path, "");
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path, Reload reload)
|
|
||||||
{
|
|
||||||
return NavigateUrl(path, "", reload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string NavigateUrl(string path, string parameters)
|
public string NavigateUrl(string path, string parameters)
|
||||||
{
|
{
|
||||||
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters, Reload.None);
|
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters);
|
||||||
}
|
|
||||||
|
|
||||||
public string NavigateUrl(string path, string parameters, Reload reload)
|
|
||||||
{
|
|
||||||
return Utilities.NavigateUrl(PageState.Alias.Path, path, parameters, reload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string EditUrl(int moduleid, string action)
|
public string EditUrl(int moduleid, string action)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@namespace Oqtane.Shared
|
@namespace Oqtane.UI
|
||||||
|
|
||||||
<CascadingValue Value="@ModuleState">
|
<CascadingValue Value="@ModuleState">
|
||||||
@DynamicComponent
|
@DynamicComponent
|
|
@ -1,4 +1,4 @@
|
||||||
@namespace Oqtane.Shared
|
@namespace Oqtane.UI
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@inject IInstallationService InstallationService
|
@inject IInstallationService InstallationService
|
||||||
@inject ISiteService SiteService
|
@inject ISiteService SiteService
|
|
@ -3,7 +3,7 @@ using Microsoft.JSInterop;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Oqtane.Shared
|
namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
public class Interop
|
public class Interop
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
@namespace Oqtane.Shared
|
@namespace Oqtane.UI
|
||||||
|
|
||||||
<ModuleMessage Message="@message" Type="MessageType.Error" />
|
<ModuleMessage Message="@message" Type="MessageType.Error" />
|
||||||
<CascadingValue Value="this">
|
<CascadingValue Value="this">
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
|
|
||||||
namespace Oqtane.Shared
|
namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
public class PageState
|
public class PageState
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
@namespace Oqtane.Shared
|
@namespace Oqtane.UI
|
||||||
@inject IUserService UserService
|
@inject IUserService UserService
|
||||||
@inject IModuleService ModuleService
|
@inject IModuleService ModuleService
|
||||||
@inject IModuleDefinitionService ModuleDefinitionService
|
@inject IModuleDefinitionService ModuleDefinitionService
|
|
@ -1,4 +1,4 @@
|
||||||
@namespace Oqtane.Shared
|
@namespace Oqtane.UI
|
||||||
|
|
||||||
@DynamicComponent
|
@DynamicComponent
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Oqtane.Shared
|
namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
public enum Reload
|
public enum Reload
|
||||||
{
|
{
|
|
@ -2,7 +2,7 @@
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Oqtane.Modules.Controls
|
namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
public static class RichTextEditorInterop
|
public static class RichTextEditorInterop
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
@namespace Oqtane.Shared
|
@namespace Oqtane.UI
|
||||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||||
@inject SiteState SiteState
|
@inject SiteState SiteState
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
@ -92,10 +92,6 @@
|
||||||
querystring = ParseQueryString(path);
|
querystring = ParseQueryString(path);
|
||||||
path = path.Substring(0, path.IndexOf("?"));
|
path = path.Substring(0, path.IndexOf("?"));
|
||||||
}
|
}
|
||||||
if (querystring.ContainsKey("reload"))
|
|
||||||
{
|
|
||||||
reload = (Reload)int.Parse(querystring["reload"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PageState != null)
|
if (PageState != null)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
@namespace Oqtane.Shared
|
@namespace Oqtane.UI
|
||||||
@inject IJSRuntime jsRuntime
|
@inject IJSRuntime jsRuntime
|
||||||
|
|
||||||
@DynamicComponent
|
@DynamicComponent
|
|
@ -16,4 +16,5 @@
|
||||||
@using Oqtane.Services
|
@using Oqtane.Services
|
||||||
@using Oqtane.Shared
|
@using Oqtane.Shared
|
||||||
@using Oqtane.Themes
|
@using Oqtane.Themes
|
||||||
@using Oqtane.Themes.Controls
|
@using Oqtane.Themes.Controls
|
||||||
|
@using Oqtane.UI
|
|
@ -130,6 +130,7 @@ namespace Oqtane.Controllers
|
||||||
page.IsPersonalizable = false;
|
page.IsPersonalizable = false;
|
||||||
page.UserId = int.Parse(userid);
|
page.UserId = int.Parse(userid);
|
||||||
page = _pages.AddPage(page);
|
page = _pages.AddPage(page);
|
||||||
|
_syncManager.AddSyncEvent("Site", page.SiteId);
|
||||||
|
|
||||||
// copy modules
|
// copy modules
|
||||||
List<PageModule> pagemodules = _pageModules.GetPageModules(page.SiteId).ToList();
|
List<PageModule> pagemodules = _pageModules.GetPageModules(page.SiteId).ToList();
|
||||||
|
@ -173,6 +174,7 @@ namespace Oqtane.Controllers
|
||||||
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, "Page", Page.PageId, "Edit"))
|
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, "Page", Page.PageId, "Edit"))
|
||||||
{
|
{
|
||||||
Page = _pages.UpdatePage(Page);
|
Page = _pages.UpdatePage(Page);
|
||||||
|
_syncManager.AddSyncEvent("Site", Page.SiteId);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Page Updated {Page}", Page);
|
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Page Updated {Page}", Page);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -202,6 +204,7 @@ namespace Oqtane.Controllers
|
||||||
}
|
}
|
||||||
order += 2;
|
order += 2;
|
||||||
}
|
}
|
||||||
|
_syncManager.AddSyncEvent("Site", siteid);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Page Order Updated {SiteId} {PageId} {ParentId}", siteid, pageid, parentid);
|
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Page Order Updated {SiteId} {PageId} {ParentId}", siteid, pageid, parentid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -216,14 +219,16 @@ namespace Oqtane.Controllers
|
||||||
[Authorize(Roles = Constants.RegisteredRole)]
|
[Authorize(Roles = Constants.RegisteredRole)]
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
if (_userPermissions.IsAuthorized(User, "Page", id, "Edit"))
|
Page page = _pages.GetPage(id);
|
||||||
|
if (_userPermissions.IsAuthorized(User, "Page", page.PageId, "Edit"))
|
||||||
{
|
{
|
||||||
_pages.DeletePage(id);
|
_pages.DeletePage(page.PageId);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Page Deleted {PageId}", id);
|
_syncManager.AddSyncEvent("Site", page.SiteId);
|
||||||
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Page Deleted {PageId}", page.PageId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.Log(LogLevel.Error, this, LogFunction.Delete, "User Not Authorized To Delete Page {PageId}", id);
|
_logger.Log(LogLevel.Error, this, LogFunction.Delete, "User Not Authorized To Delete Page {PageId}", page.PageId);
|
||||||
HttpContext.Response.StatusCode = 401;
|
HttpContext.Response.StatusCode = 401;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,13 +16,15 @@ namespace Oqtane.Controllers
|
||||||
private readonly IPageModuleRepository _pageModules;
|
private readonly IPageModuleRepository _pageModules;
|
||||||
private readonly IModuleRepository _modules;
|
private readonly IModuleRepository _modules;
|
||||||
private readonly IUserPermissions _userPermissions;
|
private readonly IUserPermissions _userPermissions;
|
||||||
|
private readonly ISyncManager _syncManager;
|
||||||
private readonly ILogManager _logger;
|
private readonly ILogManager _logger;
|
||||||
|
|
||||||
public PageModuleController(IPageModuleRepository pageModules, IModuleRepository modules, IUserPermissions userPermissions, ILogManager logger)
|
public PageModuleController(IPageModuleRepository pageModules, IModuleRepository modules, IUserPermissions userPermissions, ISyncManager syncManager, ILogManager logger)
|
||||||
{
|
{
|
||||||
_pageModules = pageModules;
|
_pageModules = pageModules;
|
||||||
_modules = modules;
|
_modules = modules;
|
||||||
_userPermissions = userPermissions;
|
_userPermissions = userPermissions;
|
||||||
|
_syncManager = syncManager;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +70,7 @@ namespace Oqtane.Controllers
|
||||||
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, "Page", PageModule.PageId, "Edit"))
|
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, "Page", PageModule.PageId, "Edit"))
|
||||||
{
|
{
|
||||||
PageModule = _pageModules.AddPageModule(PageModule);
|
PageModule = _pageModules.AddPageModule(PageModule);
|
||||||
|
_syncManager.AddSyncEvent("Page", PageModule.PageId);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Page Module Added {PageModule}", PageModule);
|
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Page Module Added {PageModule}", PageModule);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -87,6 +90,7 @@ namespace Oqtane.Controllers
|
||||||
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, "Module", PageModule.ModuleId, "Edit"))
|
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, "Module", PageModule.ModuleId, "Edit"))
|
||||||
{
|
{
|
||||||
PageModule = _pageModules.UpdatePageModule(PageModule);
|
PageModule = _pageModules.UpdatePageModule(PageModule);
|
||||||
|
_syncManager.AddSyncEvent("Page", PageModule.PageId);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Page Module Updated {PageModule}", PageModule);
|
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Page Module Updated {PageModule}", PageModule);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -116,6 +120,7 @@ namespace Oqtane.Controllers
|
||||||
}
|
}
|
||||||
order += 2;
|
order += 2;
|
||||||
}
|
}
|
||||||
|
_syncManager.AddSyncEvent("Page", pageid);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Page Module Order Updated {PageId} {Pane}", pageid, pane);
|
_logger.Log(LogLevel.Information, this, LogFunction.Update, "Page Module Order Updated {PageId} {Pane}", pageid, pane);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -134,6 +139,7 @@ namespace Oqtane.Controllers
|
||||||
if (_userPermissions.IsAuthorized(User, "Page", pagemodule.PageId, "Edit"))
|
if (_userPermissions.IsAuthorized(User, "Page", pagemodule.PageId, "Edit"))
|
||||||
{
|
{
|
||||||
_pageModules.DeletePageModule(id);
|
_pageModules.DeletePageModule(id);
|
||||||
|
_syncManager.AddSyncEvent("Page", pagemodule.PageId);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Page Module Deleted {PageModuleId}", id);
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Page Module Deleted {PageModuleId}", id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -17,13 +17,15 @@ namespace Oqtane.Controllers
|
||||||
private readonly ISiteRepository _sites;
|
private readonly ISiteRepository _sites;
|
||||||
private readonly ITenantResolver _tenants;
|
private readonly ITenantResolver _tenants;
|
||||||
private readonly IWebHostEnvironment _environment;
|
private readonly IWebHostEnvironment _environment;
|
||||||
|
private readonly ISyncManager _syncManager;
|
||||||
private readonly ILogManager _logger;
|
private readonly ILogManager _logger;
|
||||||
|
|
||||||
public SiteController(ISiteRepository sites, ITenantResolver tenants, IWebHostEnvironment environment, ILogManager logger)
|
public SiteController(ISiteRepository sites, ITenantResolver tenants, IWebHostEnvironment environment, ISyncManager syncManager, ILogManager logger)
|
||||||
{
|
{
|
||||||
_sites = sites;
|
_sites = sites;
|
||||||
_tenants = tenants;
|
_tenants = tenants;
|
||||||
_environment = environment;
|
_environment = environment;
|
||||||
|
_syncManager = syncManager;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,6 +79,7 @@ namespace Oqtane.Controllers
|
||||||
if (ModelState.IsValid)
|
if (ModelState.IsValid)
|
||||||
{
|
{
|
||||||
Site = _sites.UpdateSite(Site);
|
Site = _sites.UpdateSite(Site);
|
||||||
|
_syncManager.AddSyncEvent("Site", Site.SiteId);
|
||||||
_logger.Log(Site.SiteId, LogLevel.Information, this, LogFunction.Update, "Site Updated {Site}", Site);
|
_logger.Log(Site.SiteId, LogLevel.Information, this, LogFunction.Update, "Site Updated {Site}", Site);
|
||||||
}
|
}
|
||||||
return Site;
|
return Site;
|
||||||
|
|
|
@ -27,9 +27,10 @@ namespace Oqtane.Controllers
|
||||||
private readonly ITenantResolver _tenants;
|
private readonly ITenantResolver _tenants;
|
||||||
private readonly INotificationRepository _notifications;
|
private readonly INotificationRepository _notifications;
|
||||||
private readonly IFolderRepository _folders;
|
private readonly IFolderRepository _folders;
|
||||||
|
private readonly ISyncManager _syncManager;
|
||||||
private readonly ILogManager _logger;
|
private readonly ILogManager _logger;
|
||||||
|
|
||||||
public UserController(IUserRepository users, IRoleRepository roles, IUserRoleRepository userRoles, UserManager<IdentityUser> identityUserManager, SignInManager<IdentityUser> identitySignInManager, ITenantResolver tenants, INotificationRepository notifications, IFolderRepository folders, ILogManager logger)
|
public UserController(IUserRepository users, IRoleRepository roles, IUserRoleRepository userRoles, UserManager<IdentityUser> identityUserManager, SignInManager<IdentityUser> identitySignInManager, ITenantResolver tenants, INotificationRepository notifications, IFolderRepository folders, ISyncManager syncManager, ILogManager logger)
|
||||||
{
|
{
|
||||||
_users = users;
|
_users = users;
|
||||||
_roles = roles;
|
_roles = roles;
|
||||||
|
@ -39,6 +40,7 @@ namespace Oqtane.Controllers
|
||||||
_tenants = tenants;
|
_tenants = tenants;
|
||||||
_folders = folders;
|
_folders = folders;
|
||||||
_notifications = notifications;
|
_notifications = notifications;
|
||||||
|
_syncManager = syncManager;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,6 +187,7 @@ namespace Oqtane.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
User = _users.UpdateUser(User);
|
User = _users.UpdateUser(User);
|
||||||
|
_syncManager.AddSyncEvent("User", User.UserId);
|
||||||
User.Password = ""; // remove sensitive information
|
User.Password = ""; // remove sensitive information
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Update, "User Updated {User}", User);
|
_logger.Log(LogLevel.Information, this, LogFunction.Update, "User Updated {User}", User);
|
||||||
}
|
}
|
||||||
|
@ -240,6 +243,7 @@ namespace Oqtane.Controllers
|
||||||
user.LastLoginOn = DateTime.Now;
|
user.LastLoginOn = DateTime.Now;
|
||||||
user.LastIPAddress = HttpContext.Connection.RemoteIpAddress.ToString();
|
user.LastIPAddress = HttpContext.Connection.RemoteIpAddress.ToString();
|
||||||
_users.UpdateUser(user);
|
_users.UpdateUser(user);
|
||||||
|
_syncManager.AddSyncEvent("User", User.UserId);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Security, "User Login Successful {Username}", User.Username);
|
_logger.Log(LogLevel.Information, this, LogFunction.Security, "User Login Successful {Username}", User.Username);
|
||||||
if (SetCookie)
|
if (SetCookie)
|
||||||
{
|
{
|
||||||
|
@ -268,6 +272,7 @@ namespace Oqtane.Controllers
|
||||||
public async Task Logout([FromBody] User User)
|
public async Task Logout([FromBody] User User)
|
||||||
{
|
{
|
||||||
await HttpContext.SignOutAsync(IdentityConstants.ApplicationScheme);
|
await HttpContext.SignOutAsync(IdentityConstants.ApplicationScheme);
|
||||||
|
_syncManager.AddSyncEvent("User", User.UserId);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Security, "User Logout {Username}", User.Username);
|
_logger.Log(LogLevel.Information, this, LogFunction.Security, "User Logout {Username}", User.Username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
public const string PackageId = "Oqtane.Framework";
|
public const string PackageId = "Oqtane.Framework";
|
||||||
public const string Version = "0.0.1";
|
public const string Version = "0.0.1";
|
||||||
|
|
||||||
public const string PageComponent = "Oqtane.Shared.ThemeBuilder, Oqtane.Client";
|
public const string PageComponent = "Oqtane.UI.ThemeBuilder, Oqtane.Client";
|
||||||
public const string ContainerComponent = "Oqtane.Shared.ContainerBuilder, Oqtane.Client";
|
public const string ContainerComponent = "Oqtane.UI.ContainerBuilder, Oqtane.Client";
|
||||||
|
|
||||||
public const string DefaultTheme = "Oqtane.Themes.BlazorTheme.Default, Oqtane.Client";
|
public const string DefaultTheme = "Oqtane.Themes.BlazorTheme.Default, Oqtane.Client";
|
||||||
public const string DefaultLayout = "";
|
public const string DefaultLayout = "";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Oqtane.Shared
|
namespace Oqtane.Shared
|
||||||
{
|
{
|
||||||
// this class is used for passing state between Blazor components and Services
|
// this class is used for passing state between components and services, or controllers and repositories
|
||||||
public class SiteState
|
public class SiteState
|
||||||
{
|
{
|
||||||
public Alias Alias { get; set; }
|
public Alias Alias { get; set; }
|
|
@ -5,7 +5,7 @@ namespace Oqtane.Shared
|
||||||
{
|
{
|
||||||
public class Utilities
|
public class Utilities
|
||||||
{
|
{
|
||||||
public static string NavigateUrl(string alias, string path, string parameters, Reload reload)
|
public static string NavigateUrl(string alias, string path, string parameters)
|
||||||
{
|
{
|
||||||
string url = "";
|
string url = "";
|
||||||
if (alias != "")
|
if (alias != "")
|
||||||
|
@ -24,10 +24,6 @@ namespace Oqtane.Shared
|
||||||
{
|
{
|
||||||
url += "?" + parameters;
|
url += "?" + parameters;
|
||||||
}
|
}
|
||||||
if (reload != Reload.None)
|
|
||||||
{
|
|
||||||
url += ((string.IsNullOrEmpty(parameters)) ? "?" : "&") + "reload=" + ((int)reload).ToString();
|
|
||||||
}
|
|
||||||
if (!url.StartsWith("/"))
|
if (!url.StartsWith("/"))
|
||||||
{
|
{
|
||||||
url = "/" + url;
|
url = "/" + url;
|
||||||
|
@ -37,7 +33,7 @@ namespace Oqtane.Shared
|
||||||
|
|
||||||
public static string EditUrl(string alias, string path, int moduleid, string action, string parameters)
|
public static string EditUrl(string alias, string path, int moduleid, string action, string parameters)
|
||||||
{
|
{
|
||||||
string url = NavigateUrl(alias, path, "", Reload.None);
|
string url = NavigateUrl(alias, path, "");
|
||||||
if (url == "/") url = "";
|
if (url == "/") url = "";
|
||||||
if (moduleid != -1)
|
if (moduleid != -1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user