Skip to content

Commit

Permalink
geo ip location
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Aug 10, 2023
1 parent 8b39c39 commit 2d0fe7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Modules/CIPPCore/Public/Invoke-CIPPWebhookProcessing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Invoke-CippWebhookProcessing {
$ExecutingUser
)
Set-Location (Get-Item $PSScriptRoot).FullName
#Create a RO connection or our central geoipdb

$HTML = Get-Content "TemplateEmail.HTML" -Raw | Out-String
$AllowedLocations = $AllowedLocations -split ','
if ($data.clientip) {
Expand All @@ -26,6 +26,7 @@ function Invoke-CippWebhookProcessing {
if ( $Data.ExtendedProperties) { $Data.ExtendedProperties | ForEach-Object { $TableObj | Add-Member -NotePropertyName $_.Name -NotePropertyValue $_.Value } }
if ($Data.DeviceProperties) { $Data.DeviceProperties | ForEach-Object { $TableObj | Add-Member -NotePropertyName $_.Name -NotePropertyValue $_.Value } }
if ($Data.parameters) { $Data.parameters | ForEach-Object { $TableObj | Add-Member -NotePropertyName $_.Name -NotePropertyValue $_.Value } }
Write-Host ($TableObj | ConvertTo-Json -Depth 10)
switch ($data.operation) {
{ "UserLoggedIn" -eq $data.operation -and $Country -notin $AllowedLocations -and $data.ResultStatus -eq "Success" -and $TableObj.ResultStatusDetail -eq "Success" } { $data.operation = "UserLoggedInFromUnknownLocation"; break }
{ "UserloggedIn" -eq $data.operation -and $data.UserType -eq 2 -and $data.ResultStatus -eq "Success" -and $TableObj.ResultStatusDetail -eq "Success" } { $data.operation = "AdminLoggedIn"; break }
Expand Down

0 comments on commit 2d0fe7c

Please sign in to comment.