From 559a3031ac5d60dc3469bd247a87c286012e60b5 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 20 Jun 2012 18:24:51 +0000 Subject: [PATCH] don't say that an account was locked when it wasn't --- bin/ngcp-fraud-auto-lock | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/ngcp-fraud-auto-lock b/bin/ngcp-fraud-auto-lock index e2826fe..7f8571d 100755 --- a/bin/ngcp-fraud-auto-lock +++ b/bin/ngcp-fraud-auto-lock @@ -62,14 +62,16 @@ for my $e (@$a) { my $cur = sprintf('%.2f', $e->{cash_balance_interval} / 100); my $max = sprintf('%.2f', $e->{fraud_interval_limit} / 100); - my $body; + my ($subject, $body); if ($e->{fraud_interval_lock}) { $body = "Account ID " . $e->{id} . " has been locked due to exceeding the configured" . "\n" . "credit balance threshold ($cur >= $max ).\n\n"; + $subject = 'Account ID ' . $e->{id} . ' locked by fraud detection'; } else { $body = "Account ID " . $e->{id} . " is currently exceeding the configured credit balance" . "\n" . "threshold ($cur >= $max), but has not been locked due to configuration.\n\n"; + $subject = 'Account ID ' . $e->{id} . ' exceeding fraud detection limit'; } if (!$subs || !@$subs) { @@ -88,7 +90,7 @@ for my $e (@$a) { header => [ To => $e->{fraud_interval_notify}, From => $$conf{adminmail}, - Subject => 'Account ID ' . $e->{id} . 'locked by fraud detection', + Subject => $subject, ], body => $body, ));