Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
policyd
policyd
Commits
9da62565
Commit
9da62565
authored
Oct 17, 2008
by
Nigel Kukard
Browse files
* Tagged snapshot-200810170639
parent
db2c9b72
Changes
5
Hide whitespace changes
Inline
Side-by-side
cbp/policies.pm
View file @
9da62565
...
...
@@ -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
);
}
}
}
}
...
...
cbp/version.pm
View file @
9da62565
...
...
@@ -33,7 +33,7 @@ our (@ISA,@EXPORT,@EXPORT_OK);
use
constant
{
VERSION
=>
"
2.1.0a
",
VERSION
=>
"
snapshot-200810170639
",
};
# vim: ts=4
...
...
webui/accounting-add.php
View file @
9da62565
...
...
@@ -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
...
...
webui/policy-add.php
View file @
9da62565
...
...
@@ -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
...
...
webui/quotas-add.php
View file @
9da62565
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment