Skip to content

Commit

Permalink
Merge pull request #660 from Blazam-App/v1-Nightly
Browse files Browse the repository at this point in the history
v1.2 update
  • Loading branch information
jacobsen9026 authored Nov 25, 2024
2 parents 85f5f08 + 97b4cdf commit 2492e27
Show file tree
Hide file tree
Showing 139 changed files with 14,736 additions and 614 deletions.
14 changes: 0 additions & 14 deletions BLAZAM.sln
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BLAZAMJobs", "BLAZAMJobs\BL
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlaywrightTests", "PlaywrightTests\PlaywrightTests.csproj", "{7E4AD00B-CA62-4994-A80E-A3900FF98E8E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BLAZAMNav", "BLAZAMNav\BLAZAMNav.csproj", "{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -286,18 +284,6 @@ Global
{7E4AD00B-CA62-4994-A80E-A3900FF98E8E}.Release|x64.Build.0 = Release|Any CPU
{7E4AD00B-CA62-4994-A80E-A3900FF98E8E}.Release|x86.ActiveCfg = Release|Any CPU
{7E4AD00B-CA62-4994-A80E-A3900FF98E8E}.Release|x86.Build.0 = Release|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Debug|x64.ActiveCfg = Debug|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Debug|x64.Build.0 = Debug|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Debug|x86.ActiveCfg = Debug|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Debug|x86.Build.0 = Debug|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Release|Any CPU.Build.0 = Release|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Release|x64.ActiveCfg = Release|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Release|x64.Build.0 = Release|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Release|x86.ActiveCfg = Release|Any CPU
{EB80E5D9-D0A9-4808-AC66-F0094615EAE1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
25 changes: 14 additions & 11 deletions BLAZAM/App.razor
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
@inject IHttpContextAccessor context
@inject IApplicationUserStateService userStateService
@inject ICurrentUserStateService currentUser
<CascadingAuthenticationState>


@{
var dsad = 3;
}
<CascadingAuthenticationState>

<ErrorBoundary>

<ChildContent>

<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
Expand All @@ -17,7 +20,6 @@
<NotAuthorized>
@if (context.User.Identity?.IsAuthenticated != true)
{
<PageTitle>Login</PageTitle>
<LayoutView Layout="@typeof(LoginLayout)">
<Login />
</LayoutView>
Expand All @@ -31,7 +33,6 @@
<p>You are not authorized to access this resource.</p>
}
</NotAuthorized>

</AuthorizeRouteView>
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
Expand All @@ -42,6 +43,8 @@
</LayoutView>
</NotFound>
</Router>


</ChildContent>
<ErrorContent>
<LayoutView Layout="@typeof(MinLayout)">
Expand All @@ -55,13 +58,13 @@



</CascadingAuthenticationState>

<MudThemeProvider IsDarkMode="@darkMode" Theme="@activeTheme.Theme" />
<MudDialogProvider />
<MudPopoverProvider />
<MudSnackbarProvider />
<SessionExpirationWarningProvider />
<MudThemeProvider IsDarkMode="@darkMode" Theme="@activeTheme.Theme" />
<MudDialogProvider />
<MudPopoverProvider />
<MudSnackbarProvider />
<SessionExpirationWarningProvider />
</CascadingAuthenticationState>

@code {
bool darkMode = false;
Expand All @@ -84,7 +87,7 @@
activeTheme = new BlueTheme();

}

}
darkMode = currentUser.State?.Preferences?.DarkMode == true;
}
Expand Down
142 changes: 0 additions & 142 deletions BLAZAM/BLAZAM - Backup.csproj

This file was deleted.

27 changes: 18 additions & 9 deletions BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>1.1.0</AssemblyVersion>
<Version>2024.11.13.2234</Version>
<AssemblyVersion>1.2.0</AssemblyVersion>
<Version>2024.11.25.0412</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<GenerateDocumentationFile>True</GenerateDocumentationFile>

</PropertyGroup>

Expand Down Expand Up @@ -57,23 +57,28 @@
<PackageReference Include="BlazorTemplater" Version="1.5.1" />
<PackageReference Include="Cassia" Version="2.0.0.60" />
<PackageReference Include="DuoUniversal" Version="1.2.5" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.6" />
<PackageReference Include="MudBlazor" Version="7.11.0" />
<PackageReference Include="MudBlazor.Markdown" Version="7.8.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.7" />
<PackageReference Include="MudBlazor" Version="7.15.0" />
<PackageReference Include="MudBlazor.Markdown" Version="7.14.0" />
<PackageReference Include="MudBlazor.ThemeManager" Version="2.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.0.0" />
<PackageReference Include="System.DirectoryServices" Version="8.0.0" />

<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.1" />
Expand Down Expand Up @@ -103,6 +108,10 @@
</Content>
</ItemGroup>

<ItemGroup>
<None Include="..\BLAZAMGui\UI\Settings\WebHooks\NewWebHookModalContent.razor" Link="NewWebHookModalContent.razor" />
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
Expand Down
47 changes: 47 additions & 0 deletions BLAZAM/Helpers/Helpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using BLAZAM.ActiveDirectory.Interfaces;
using BLAZAM.Common.Data;
using BLAZAM.Database.Models.Templates;
using BLAZAM.EmailMessage.Email.Notifications;
using MudBlazor;
using System.Security;

namespace BLAZAM.Helpers
{
public static class Helpers
{
public static IADUser GenerateTemplateUser(this DirectoryTemplate template, NewUserName newUserName, IActiveDirectoryContext directory)
{
IADUser? newUser;
var ou = directory.OUs.FindOuByString(template.EffectiveParentOU).FirstOrDefault();
if (ou == null) throw new ApplicationException("OU could not be found for new user");
var displayName = template.GenerateDisplayName(newUserName);
newUser = ou.CreateUser(displayName);

newUser.SamAccountName = template.GenerateUsername(newUserName);
newUser.DisplayName = displayName;
//newUser.SetPassword(template.GeneratePassword().ToSecureString(),false);
//newUser.CanonicalName = template.GenerateDisplayName(newUserName);
newUser.StagePasswordChange(template.GeneratePassword(newUserName).ToSecureString());
if (template.EffectiveRequirePasswordChange == true)
newUser.StageRequirePasswordChange(true);
if (!newUserName.GivenName.IsNullOrEmpty())
newUser.GivenName = newUserName.GivenName;
if (!newUserName.MiddleName.IsNullOrEmpty())
newUser.MiddleName = newUserName.MiddleName;
if (!newUserName.Surname.IsNullOrEmpty())
newUser.Surname = newUserName.Surname;



template.EffectiveAssignedGroupSids.ForEach(sid =>
{
var group = directory.Groups.FindGroupBySID(sid.GroupSid);
if (group != null)
newUser.AssignTo(group);

});
return newUser;
}

}
}
Loading

0 comments on commit 2492e27

Please sign in to comment.