Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nightly update #335

Merged
merged 15 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BLAZAM.Tests/BLAZAM.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>0.9.1</AssemblyVersion>
<Version>2024.04.22.2312</Version>
<Version>2024.04.27.2251</Version
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
Expand Down Expand Up @@ -80,7 +80,7 @@
<PackageReference Include="MudBlazor.Markdown" Version="0.1.3" />
<PackageReference Include="MudBlazor.ThemeManager" Version="1.0.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Octokit" Version="10.0.0" />
<PackageReference Include="Octokit" Version="11.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" />
Expand Down
1 change: 0 additions & 1 deletion BLAZAM/ProgramHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ private static Guid GetInstallationId()
//Try and get os id
try
{
throw new ApplicationException("TEST");
string ComputerName = "localhost";
ManagementScope Scope;
Scope = new ManagementScope(String.Format("\\\\{0}\\root\\CIMV2", ComputerName), null);
Expand Down
Binary file added BLAZAM/static/img/default_logo5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BLAZAM/wwwroot/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BLAZAM/wwwroot/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BLAZAM/wwwroot/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BLAZAM/wwwroot/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BLAZAM/wwwroot/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BLAZAM/wwwroot/favicon.ico
Binary file not shown.
Binary file added BLAZAM/wwwroot/icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BLAZAM/wwwroot/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BLAZAM/wwwroot/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion BLAZAMActiveDirectory/ActiveDirectoryContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,22 @@ private async void KeepAlive(object? state = null)
else if (Status == DirectoryConnectionStatus.OK)
{
//Throw away query used to keep connection alive
_keepAliveUser = Users?.FindUsersByString(ConnectionSettings?.Username, false)?.FirstOrDefault();
try
{
_keepAliveUser = Users?.FindUsersByString(ConnectionSettings?.Username, false)?.FirstOrDefault();

}catch(DirectoryServicesCOMException ex)
{
//not usernam or password is incorrect
if (ex.HResult != -2147023570)
{
Loggers.ActiveDirectryLogger.Error("Unexpected error performing keep alive search.{@Error}", ex);

}
}
catch (Exception ex) {
Loggers.ActiveDirectryLogger.Error("Unexpected error performing keep alive search.{@Error}", ex);
}
}
await Task.Delay(30000);
}
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMActiveDirectory/Adapters/ADComputerSessions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void Dispose()
session.Dispose();
}
ConnectedSessions.Clear();

}


Expand Down
28 changes: 15 additions & 13 deletions BLAZAMActiveDirectory/Adapters/RemoteSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class RemoteSession : IRemoteSession
public AppEvent<IRemoteSession> OnSessionUpdated { get; set; }

Timer t;
public RemoteSession(ITerminalServicesSession session,IADComputer host)
public RemoteSession(ITerminalServicesSession session, IADComputer host)
{
Host = host;

Expand Down Expand Up @@ -187,7 +187,7 @@ public void Logoff(bool synchronous = false)
{
Host.Directory.Impersonation.Run(() =>
{
if (_session?.Server.IsOpen==false)
if (_session?.Server.IsOpen == false)
_session.Server.Open();
_session?.Logoff(synchronous);
_session?.Server.Close();
Expand All @@ -201,10 +201,10 @@ public void Disconnect(bool synchronous = false)
{
Host.Directory.Impersonation.Run(() =>
{
if (!_session.Server.IsOpen)
if (_session?.Server.IsOpen == false)
_session.Server.Open();
_session.Disconnect(synchronous);
_session.Server.Close();
_session?.Disconnect(synchronous);
_session?.Server.Close();
return true;
});

Expand All @@ -216,10 +216,10 @@ public void SendMessage(string message)
{
Host.Directory.Impersonation.Run(() =>
{
if (!_session.Server.IsOpen)
if (_session?.Server.IsOpen == false)
_session.Server.Open();
_session.MessageBox(message, "Administrator Message");
_session.Server.Close();
_session?.MessageBox(message, "Administrator Message");
_session?.Server.Close();
return true;
});

Expand All @@ -235,9 +235,9 @@ private void GetNewSessionState()
{
Host.Directory.Impersonation.Run(() =>
{
if (!_session.Server.IsOpen)
if (_session?.Server.IsOpen == false)
_session.Server.Open();
if (_session.Server.IsOpen)
if (_session?.Server.IsOpen == true)
{
int id = _session.SessionId;
ITerminalServicesSession updated = _session.Server.GetSession(id);
Expand All @@ -252,7 +252,8 @@ private void GetNewSessionState()
}
catch (Win32Exception ex)
{
if (ex.Message == "The system cannot find the file specified.")
//The system cannot find the file specified
if (ex.ErrorCode == -2147467259)
{

OnSessionDown?.Invoke(this);
Expand All @@ -262,7 +263,8 @@ private void GetNewSessionState()
}
catch (Exception ex)
{
Log.Error("An error occured while refreshing a computer session state.", ex);
Log.Error("An error occurred while refreshing a computer session state.", ex);
this.Dispose();
}
}

Expand All @@ -286,7 +288,7 @@ public override int GetHashCode()
public void Dispose()
{
t?.Dispose();
if(Session!=null && Session.Server!=null)
if (Session != null && Session.Server != null)
Session.Server.Close();
Session = null;
}
Expand Down
1 change: 1 addition & 0 deletions BLAZAMActiveDirectory/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:BLAZAM.ActiveDirectory.Adapters.ADOrganizationalUnit.CreatePrinter(BLAZAM.ActiveDirectory.Adapters.SharedPrinter)~BLAZAM.ActiveDirectory.Interfaces.IADPrinter")]
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:BLAZAM.Helpers.ActiveDirectoryHelpers.Encapsulate(System.DirectoryServices.SearchResultCollection)~System.Collections.Generic.List{BLAZAM.ActiveDirectory.Interfaces.IDirectoryEntryAdapter}")]
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:BLAZAM.Helpers.ActiveDirectoryHelpers.Encapsulate(System.DirectoryServices.DirectoryEntries)~System.Collections.Generic.List{BLAZAM.ActiveDirectory.Interfaces.IDirectoryEntryAdapter}")]
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>", Scope = "member", Target = "~M:BLAZAM.ActiveDirectory.ActiveDirectoryContext.KeepAlive(System.Object)")]
2 changes: 1 addition & 1 deletion BLAZAMCommon.Tests/BLAZAMCommon.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMGui/UI/Users/NewTemplateUser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@

</Row>
<Row>
<MudButton Color=Color.Success Disabled=@(IsValid) OnClick="@(()=>{OnValidSubmit.InvokeAsync();})">Next</MudButton>
<MudButton Color=Color.Success Disabled=@(!IsValid) OnClick="@(()=>{OnValidSubmit.InvokeAsync();})">Next</MudButton>

</Row>

Expand Down
2 changes: 1 addition & 1 deletion BLAZAMSession/ApplicationUserStateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private void AddUserState(IApplicationUserState state)
public void SetMFAUserState(string mfaToken,IApplicationUserState state)
{
_mfaLoginQueue.Add(mfaToken, state);
Task.Delay(60000).ContinueWith((val) => {
Task.Delay(900000).ContinueWith((val) => {
_mfaLoginQueue.Remove(mfaToken);
});
SetUserState(state);
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMStatic/StaticAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class StaticAssets

private static byte[]? GetDefaultIcon()
{
var defaultIconFilePath = Path.GetFullPath(ApplicationInfo.applicationRoot + @"static\img\default_logo4.png");
var defaultIconFilePath = Path.GetFullPath(ApplicationInfo.applicationRoot + @"static\img\default_logo5.png");
if (File.Exists(defaultIconFilePath))
return File.ReadAllBytes(defaultIconFilePath);
return null;
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# BLAZAM

## Introducing Blazam's new Logo
![New logo for Blazam](https://raw.githubusercontent.com/Blazam-App/BLAZAM/Beta-Dev/BLAZAM/static/img/default_logo5.png "Blazam")

## Website
[blazam.org](https://blazam.org)

Expand Down
Loading