Skip to content

Commit

Permalink
result status
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Aug 10, 2023
1 parent 2c3e689 commit 60b6df8
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Modules/CIPPCore/Public/Invoke-CIPPWebhookProcessing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,14 @@ function Invoke-CippWebhookProcessing {
}
#Database for knownlocations
$LocationTable = Get-CIPPTable -TableName 'knownlocationdb'
Write-Host "Processing $($data.operation)"
Write-Host "Country: $Country"
Write-Host "City: $City"
Write-Host "AllowedLocations: $AllowedLocations"
Write-Host "Operations: $Operations"
Write-Host "Allowed: $($Country -in $AllowedLocations)"
#Custom cipp operations.
Write-Host "Processing $($data.operation)"

Write-Host "Result status $($data.ResultStatus))"
switch ($data.operation) {
{ "UserLoggedIn" -eq $data.operation -and $Country -notin $AllowedLocations -and $data.ResultStatus -eq "Success" -and $data.ExtendedProperties.resultstatusdetail -eq "Success" } { $data.operation = "UserLoggedInFromUnknownLocation"; break }
{ "UserloggedIn" -eq $data.operation -and $data.UserType -eq 2 -and $data.ResultStatus -eq "Success" -and $data.ExtendedProperties.resultstatusdetail -eq "Success" } { $data.operation = "AdminLoggedIn"; break }
default { break }
}

Write-Host "Processing $($data.operation)"
#Check if the operation is allowed for this webhook.
if ($data.operation -notin $Operations) {
Write-Host "No need to process this operation."
Expand Down

0 comments on commit 60b6df8

Please sign in to comment.