Update samy.ps1
This commit is contained in:
11
samy.ps1
11
samy.ps1
@@ -1434,15 +1434,8 @@ function Send-JSON {
|
|||||||
$raw = (New-Object IO.StreamReader $Context.Request.InputStream).ReadToEnd()
|
$raw = (New-Object IO.StreamReader $Context.Request.InputStream).ReadToEnd()
|
||||||
$pw = (ConvertFrom-Json $raw).password
|
$pw = (ConvertFrom-Json $raw).password
|
||||||
|
|
||||||
$trusted = Test-TrustedCaller -Context $Context
|
# Store for next call (can be blank)
|
||||||
if ([string]::IsNullOrWhiteSpace($pw) -and -not $trusted) {
|
$Global:WebhookPassword = [string]$pw
|
||||||
$Context.Response.StatusCode = 401
|
|
||||||
Send-Text $Context "Password required from untrusted IP."
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# ★ Store it globally for the next call ★
|
|
||||||
$Global:WebhookPassword = $pw
|
|
||||||
|
|
||||||
# 2) Delegate to your unified function
|
# 2) Delegate to your unified function
|
||||||
$sites = Install-DattoRMM `
|
$sites = Install-DattoRMM `
|
||||||
|
|||||||
Reference in New Issue
Block a user