Commit 9da62565 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Tagged snapshot-200810170639

parent db2c9b72
......@@ -312,7 +312,7 @@ sub policySourceItemMatches
my $res = 0;
# Match IP
if ($item =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?:\/\d{1,2})$/) {
if ($item =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?:\/\d{1,2})?$/) {
$res = ipMatches($sessionData->{'ClientAddress'},$item);
$server->log(LOG_DEBUG,"[POLICIES] $debugTxt: - Resolved source '$item' to a IP/CIDR specification, match = $res") if ($log);
......@@ -431,7 +431,7 @@ sub ipMatches
# Pull off parts of IP
my ($cidr_address,$cidr_mask) = ($cidr =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\/(\d{1,2}))$/);
my ($cidr_address,$cidr_mask) = ($cidr =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\/(\d{1,2}))?$/);
# Pull long for IP we going to test
my $ip_long = ip_to_long($ip);
......@@ -556,21 +556,25 @@ sub decodePolicyData
my $recipientData = shift;
my %recipientToPolicy;
my %recipientToPolicy = ();
# Build policy str list and recipients list
foreach my $item (split(/\//,$recipientData)) {
# Skip over first /
next if ($item eq "");
my ($email,$rawPolicy) = ($item =~ /<([^>]*)>#(.*)/);
# Loop with raw policies
foreach my $policy (split(/;/,$rawPolicy)) {
# Strip off priority and policy IDs
my ($prio,$policyIDs) = ( $policy =~ /(\d+)=(.*)/ );
# Pull off policyID's from string
foreach my $pid (split(/,/,$policyIDs)) {
push(@{$recipientToPolicy{$email}{$prio}},$pid);
# Make sure that the recipient data in the DB is not null, ie. it may
# of been killed by the admin before it updated it
if (defined($email) && defined($rawPolicy)) {
# Loop with raw policies
foreach my $policy (split(/;/,$rawPolicy)) {
# Strip off priority and policy IDs
my ($prio,$policyIDs) = ( $policy =~ /(\d+)=(.*)/ );
# Pull off policyID's from string
foreach my $pid (split(/,/,$policyIDs)) {
push(@{$recipientToPolicy{$email}{$prio}},$pid);
}
}
}
}
......
......@@ -33,7 +33,7 @@ our (@ISA,@EXPORT,@EXPORT_OK);
use constant {
VERSION => "2.1.0a",
VERSION => "snapshot-200810170639",
};
# vim: ts=4
......
......@@ -180,7 +180,7 @@ if ($_POST['frmaction'] == "add") {
<?php
# Check last accounting
} elseif (empty($_POST['accounting_lastaccounting'])) {
} elseif (!isset($_POST['accounting_lastaccounting'])) {
?>
<div class="warning">Stop procesing here field cannot be empty</div>
<?php
......
......@@ -82,7 +82,7 @@ if ($_POST['frmaction'] == "add") {
<?php
# Check priority
} elseif (empty($_POST['policy_priority'])) {
} elseif (!isset($_POST['policy_priority'])) {
?>
<div class="warning">Policy priority cannot be empty</div>
<?php
......
......@@ -161,7 +161,7 @@ if ($_POST['frmaction'] == "add") {
<?php
# Check last quota
} elseif (empty($_POST['quota_lastquota'])) {
} elseif (!isset($_POST['quota_lastquota'])) {
?>
<div class="warning">Stop procesing here field cannot be empty</div>
<?php
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment