This commit is contained in:
Cyberboss
2017-09-14 16:13:16 -04:00
parent ebdd37d9d0
commit 6f6eff3612
2 changed files with 4 additions and 17 deletions
+2 -15
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.DirectoryServices.AccountManagement;
using System.Security.Principal;
using System.ServiceModel;
using System.ServiceModel.Dispatcher;
using TGServiceInterface;
namespace TGServerService
@@ -106,20 +105,8 @@ namespace TGServerService
}
}
}
var actions = new List<string>();
try
{
var realfilter = (ActionMessageFilter)operationContext.EndpointDispatcher.ContractFilter;
var cnamespace = operationContext.EndpointDispatcher.ContractNamespace;
foreach (var I in realfilter.Actions)
actions.Add(I.Replace(cnamespace, "")); //filter out some garbage
}
catch (Exception e)
{
TGServerService.WriteError("IF YOU SEE THIS CALL CYBERBOSS: " + e.ToString(), TGServerService.EventID.Authentication);
}
TGServerService.WriteAccess(operationContext.ServiceSecurityContext.WindowsIdentity.Name, actions, authSuccess);
TGServerService.WriteAccess(operationContext.ServiceSecurityContext.WindowsIdentity.Name, authSuccess);
return authSuccess;
}
}
+2 -2
View File
@@ -97,9 +97,9 @@ namespace TGServerService
ActiveService.EventLog.WriteEntry(message, EventLogEntryType.Warning, (int)id);
}
public static void WriteAccess(string username, IList<string> actions, bool authSuccess)
public static void WriteAccess(string username, bool authSuccess)
{
ActiveService.EventLog.WriteEntry(String.Format("Access from: {0}. Actions: {1}", username, String.Join(", ", actions)), authSuccess ? EventLogEntryType.SuccessAudit : EventLogEntryType.FailureAudit, (int)EventID.Authentication);
ActiveService.EventLog.WriteEntry(String.Format("Access from: {0}", username), authSuccess ? EventLogEntryType.SuccessAudit : EventLogEntryType.FailureAudit, (int)EventID.Authentication);
}
ServiceHost host; //the WCF host