Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Aug 10, 2023
1 parent ca15d5d commit ecb1329
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Modules/CIPPCore/Public/Invoke-CIPPWebhookProcessing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ function Invoke-CippWebhookProcessing {
#Custom cipp operations.
Write-Host "Processing $($data.operation)"
switch ($data.operation) {
{ "UserLoggedIn" -and $Country -notin $AllowedLocations } { $data.operation = "UserLoggedInFromUnknownLocation" ; break }
{ "UserloggedIn" -and $data.UserType -eq 2 } { $data.operation = "AdminLoggedIn"; break }
{ "UserLoggedIn" -eq $data.operation -and $Country -notin $AllowedLocations -and $data.ResultStatus -eq "Success" } { $data.operation = "UserLoggedInFromUnknownLocation"; break }
{ "UserloggedIn" -eq $data.operation -and $data.UserType -eq 2 -and $data.ResultStatus -eq "Success" } { $data.operation = "AdminLoggedIn"; break }
default { break }
}

Expand Down Expand Up @@ -121,7 +121,7 @@ function Invoke-CippWebhookProcessing {
$AfterButtonText = "<p>If this is incorrect, use the user management screen to unblock the users sign-in</p>"

}
{ "AdminLoggedIn" -and $data.ResultStatus -eq "Success" } {
"AdminLoggedIn" {
$TableObj = [PSCustomObject]::new()
$Data.ExtendedProperties | ForEach-Object { $TableObj | Add-Member -NotePropertyName $_.Name -NotePropertyValue $_.Value }
$Data.DeviceProperties | ForEach-Object { $TableObj | Add-Member -NotePropertyName $_.Name -NotePropertyValue $_.Value }
Expand All @@ -135,7 +135,7 @@ function Invoke-CippWebhookProcessing {
$AfterButtonText = "<p>If this is incorrect, use the user management screen to block the user and revoke the sessions</p>"

}
{ "UserLoggedInFromUnknownLocation" -and $data.ResultStatus -eq "Success" } {
"UserLoggedInFromUnknownLocation" {
$TableObj = [PSCustomObject]::new()
$Data.ExtendedProperties | ForEach-Object { $TableObj | Add-Member -NotePropertyName $_.Name -NotePropertyValue $_.Value }
$Data.DeviceProperties | ForEach-Object { $TableObj | Add-Member -NotePropertyName $_.Name -NotePropertyValue $_.Value }
Expand Down

0 comments on commit ecb1329

Please sign in to comment.