Skip to content

Commit

Permalink
Merge pull request #460 from Blazam-App/Beta-Nightly
Browse files Browse the repository at this point in the history
v0.9.5 Update
  • Loading branch information
jacobsen9026 authored Jul 30, 2024
2 parents f721e98 + 2d271fa commit 28eedfb
Show file tree
Hide file tree
Showing 64 changed files with 619 additions and 393 deletions.
4 changes: 2 additions & 2 deletions BLAZAM.Tests/BLAZAM.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
28 changes: 14 additions & 14 deletions BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>0.9.4</AssemblyVersion>
<Version>2024.07.23.0006</Version>
<AssemblyVersion>0.9.5</AssemblyVersion>
<Version>2024.07.27.2017</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
Expand Down Expand Up @@ -57,12 +57,12 @@
<PackageReference Include="BlazorTemplater" Version="1.5.1" />
<PackageReference Include="Cassia" Version="2.0.0.60" />
<PackageReference Include="DuoUniversal" Version="1.2.5" />
<PackageReference Include="MailKit" Version="4.6.0" />
<PackageReference Include="MailKit" Version="4.7.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.30" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.30" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.30" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.30" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.32" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.32" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.32" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.32" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.20" />
Expand All @@ -75,16 +75,16 @@
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.5" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.7" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.16" />
<PackageReference Include="MudBlazor.Markdown" Version="0.1.3" />
<PackageReference Include="MudBlazor.ThemeManager" Version="1.0.9" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.17" />
<PackageReference Include="MudBlazor.Markdown" Version="1.0.2" />
<PackageReference Include="MudBlazor.ThemeManager" Version="1.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Octokit" Version="11.0.1" />
<PackageReference Include="Octokit" Version="13.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.3" />
<PackageReference Include="System.DirectoryServices" Version="8.0.0" />

<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.0" />
Expand Down
3 changes: 2 additions & 1 deletion BLAZAM/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
global using BLAZAM.Logger;
global using BLAZAM.FileSystem;
global using BLAZAM.Helpers;
global using BLAZAM.Common.Exceptions;
global using BLAZAM.Services.Background;


1 change: 0 additions & 1 deletion BLAZAM/Pages/Error/UnhandledExceptionPage.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@using BLAZAM.Email.Services;
@inject EmailService email
@inject ApplicationInfo ApplicationInfo
@inject IAppDatabaseFactory factory
Expand Down
4 changes: 4 additions & 0 deletions BLAZAM/Pages/Groups/ConfirmNewGroup.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@inherits AppComponentBase
@inject OUNotificationService OUNotificationService

<AppPageTitle>Confirm Group Creation</AppPageTitle>

@if (Group != null)
Expand Down Expand Up @@ -41,6 +43,8 @@

}
await AuditLogger.Group.Created(Group);
_ = OUNotificationService.PostAsync(Group, NotificationType.Create);

var commitJob = Group.CommitChanges();
await Confirmed.InvokeAsync(Group);
}
Expand Down
9 changes: 1 addition & 8 deletions BLAZAM/Pages/Groups/CreateGroup.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@page "/groups/create"
@inherits TabbedAppComponentBase
@attribute [Authorize]
@inject OUNotificationService OUNotificationService
<AppPageTitle>Create Group</AppPageTitle>

<Row>
Expand Down Expand Up @@ -54,7 +53,7 @@
<MudTabPanel Disabled=@(newGroup==null || newGroupName.IsNullOrEmpty())>
<ChildContent>
<MudText>
<ConfirmNewGroup Group="@newGroup" Confirmed="GroupCreated" />
<ConfirmNewGroup Group="@newGroup" />

</MudText>
</ChildContent>
Expand Down Expand Up @@ -121,10 +120,4 @@

await InvokeAsync(StateHasChanged);
}
async Task GroupCreated(IADGroup ou)
{
await AuditLogger.Group.Created(ou);
_ = OUNotificationService.PostAsync(ou, NotificationType.Create);

}
}
4 changes: 4 additions & 0 deletions BLAZAM/Pages/OU/ConfirmNewOU.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@inherits AppComponentBase
@inject OUNotificationService OUNotificationService

<AppPageTitle>Confirm OU Creation</AppPageTitle>

@if (OU != null)
Expand Down Expand Up @@ -27,6 +29,8 @@
{
await OU.CommitChangesAsync();
SnackBarService.Success("OU created");
await AuditLogger.OU.Created(OU);
_ = OUNotificationService.PostAsync(OU, NotificationType.Create);
await Confirmed.InvokeAsync(OU);
Nav.NavigateTo("/ou/create",true);
}
Expand Down
8 changes: 1 addition & 7 deletions BLAZAM/Pages/OU/CreateOU.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@page "/ou/create"
@inherits TabbedAppComponentBase
@attribute [Authorize]
@inject OUNotificationService OUNotificationService

<AppPageTitle>Create OU</AppPageTitle>

Expand Down Expand Up @@ -37,7 +36,7 @@
<MudTabPanel Disabled=@(newOU==null || newOUName.IsNullOrEmpty())>
<ChildContent>
<MudText>
<ConfirmNewOU OU="@newOU" Confirmed="OUCreated" />
<ConfirmNewOU OU="@newOU" />
</MudText>
</ChildContent>
<TabContent>
Expand Down Expand Up @@ -118,10 +117,5 @@

await InvokeAsync(StateHasChanged);
}
async Task OUCreated(IADOrganizationalUnit ou)
{
await AuditLogger.OU.Created(ou);
_ = OUNotificationService.PostAsync(ou, NotificationType.Create);

}
}
7 changes: 6 additions & 1 deletion BLAZAM/Pages/Users/ViewUser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,20 @@
await RefreshEntryComponents();
try
{

var changes = User.Changes;
var jobResults = await User.CommitChangesAsync();
if (jobResults.Result == JobResult.Passed)
{


await AuditLogger.User.Changed(User, changes);
if((changes.Count==1 && changes.First().Field==ActiveDirectoryFields.MemberOf.FieldName)==false)
if(changes.Any(c=>c.Field!=ActiveDirectoryFields.MemberOf.FieldName))
_ = OUNotificationService.PostAsync(User, NotificationType.Modify);
else
{

}
EditMode = false;
Nav.WarnOnNavigation = false;
SnackBarService.Success("The changes made to this user have been saved.");
Expand Down
12 changes: 0 additions & 12 deletions BLAZAM/ProgramHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@

using BLAZAM.Common.Data.Services;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Localization;
using MudBlazor.Services;
using System.Globalization;
using MudBlazor;
using BLAZAM.Server.Data;
using BLAZAM.Update.Services;
using BLAZAM.Update;
using BLAZAM.Database.Context;
using BLAZAM.ActiveDirectory.Interfaces;
using BLAZAM.ActiveDirectory;
using BLAZAM.Session.Interfaces;
using BLAZAM.Notifications.Services;
using BLAZAM.Common.Data;
using BLAZAM.Services.Background;
using BLAZAM.Email.Services;
using BLAZAM.Services;
using BLAZAM.Services.Duo;
using BLAZAM.Server.Data.Services;
using System.Diagnostics;
using System.Reflection;
using BLAZAM.Services.Chat;
using BLAZAM.Services.Audit;
using BLAZAM.Common;
using BLAZAM.Nav;
using BLAZAM.Session;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Org.BouncyCastle.Ocsp;
using System.Management;

namespace BLAZAM.Server
Expand Down
1 change: 1 addition & 0 deletions BLAZAMActiveDirectory/BLAZAMActiveDirectory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<ProjectReference Include="..\BLAZAMDatabase\BLAZAMDatabase.csproj" />
<ProjectReference Include="..\BLAZAMJobs\BLAZAMJobs.csproj" />
<ProjectReference Include="..\BLAZAMLocalization\BLAZAMLocalization.csproj" />
<ProjectReference Include="..\BLAZAMNotifications\BLAZAMNotifications.csproj" />
<ProjectReference Include="..\BLAZAMSession\BLAZAMSession.csproj" />
</ItemGroup>

Expand Down
12 changes: 2 additions & 10 deletions BLAZAMActiveDirectory/Helpers/ActiveDirectoryHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static IEnumerable<IDirectoryEntryAdapter> MoveToTop(this IEnumerable<IDi
var list = enumerable.ToList();
if (list.Count() < 1) return list;
List<IDirectoryEntryAdapter> mathingItems=new List<IDirectoryEntryAdapter>();
for (int x =1; x < list.Count(); x++)
for (int x =0; x < list.Count(); x++)
{

if (matchingPredicate.Invoke(list[x]))
Expand All @@ -63,15 +63,7 @@ public static IEnumerable<IDirectoryEntryAdapter> MoveToTop(this IEnumerable<IDi
return default;
}

public static Process? Shadow(this IRemoteSession session, bool withoutPermission = false)
{
if (session == null || session.Server==null) return null;
string command = "mstsc.exe";
string arguments = "/v:" + session.Server.ServerName + " /shadow:" + session.SessionId;
if (withoutPermission) arguments += " /noConsentPrompt";
return Process.Start(command, arguments);
//Debug.TrackEvent("Shadow (Consent)", properties);
}


public static string FqdnToDn(string fqdn)
{
Expand Down
4 changes: 2 additions & 2 deletions BLAZAMCommon.Tests/BLAZAMCommon.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.20" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions BLAZAMCommon/BLAZAMCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="BlazorTemplater" Version="1.5.1" />
<PackageReference Include="Cassia" Version="2.0.0.60" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="6.0.30" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="6.0.32" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.20" />
Expand All @@ -33,7 +33,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageReference Include="System.DirectoryServices" Version="8.0.0" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.0" />
<PackageReference Include="System.DirectoryServices.Protocols" Version="8.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMDatabase/BLAZAMDatabase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="System.Data.SQLite" Version="1.0.118" />
</ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions BLAZAMDatabase/Context/DatabaseContextBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@
using BLAZAM.Logger;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.Extensions.Configuration;
using BLAZAM.Database.Models.Chat;
using BLAZAM.Server.Data;
using Microsoft.IdentityModel.Tokens;
using System.Data;
using BLAZAM.FileSystem;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using BLAZAM.Database.Models.Notifications;

namespace BLAZAM.Database.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using BLAZAM.Database.Models.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLAZAM.Database.Models.Notifications
{
Expand Down
14 changes: 11 additions & 3 deletions BLAZAMDatabase/Models/Permissions/ObjectAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ public bool IsActionAppropriateForObject(ActiveDirectoryObjectType type)
switch (type)
{
case ActiveDirectoryObjectType.User:
return true;
case ActiveDirectoryObjectType.Computer:
switch (Name)
{
case "Lock":
case "Unlock":
case "Move":
case "Delete":
case "Create":
case "UnAssign":
case "Assign":
case "Enable":
case "Disable":
case "Rename":
Expand All @@ -55,6 +54,7 @@ public bool IsActionAppropriateForObject(ActiveDirectoryObjectType type)
default:
return false;
}
case ActiveDirectoryObjectType.Printer:
case ActiveDirectoryObjectType.OU:
switch (Name)
{
Expand All @@ -66,6 +66,14 @@ public bool IsActionAppropriateForObject(ActiveDirectoryObjectType type)
default:
return false;
}
case ActiveDirectoryObjectType.BitLocker:
switch (Name)
{
case "Delete":
return true;
default:
return false;
}

default:
return false;
Expand Down
6 changes: 5 additions & 1 deletion BLAZAMEmail/BLAZAMEmail.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="BlazorTemplater" Version="1.5.1" />
<PackageReference Include="MailKit" Version="4.6.0" />
<PackageReference Include="MailKit" Version="4.7.1.1" />
<PackageReference Include="PreMailer.Net" Version="2.6.0" />
</ItemGroup>

Expand All @@ -18,4 +18,8 @@
<ProjectReference Include="..\BLAZAMEmailMessage\BLAZAMEmailMessage.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Services\" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions BLAZAMEmailMessage/BLAZAMEmailMessage.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
Expand All @@ -13,8 +13,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.30" />
<PackageReference Include="MudBlazor" Version="6.20.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.32" />
<PackageReference Include="MudBlazor" Version="6.21.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 28eedfb

Please sign in to comment.