aboutsummaryrefslogtreecommitdiffstats
path: root/config/dansguardian/dansguardian_ldap.php
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-03-16 00:08:57 -0300
committermarcelloc <marcellocoutinho@gmail.com>2012-03-16 00:08:57 -0300
commit58b843ead972b5b660cbb0ed2a2ca468141616f0 (patch)
treead276ea9834d53bfe359456ddc800823df67b66b /config/dansguardian/dansguardian_ldap.php
parent85e8988f685fa12327d6970cba2c1a5b7acf6a5d (diff)
downloadpfsense-packages-58b843ead972b5b660cbb0ed2a2ca468141616f0.tar.gz
pfsense-packages-58b843ead972b5b660cbb0ed2a2ca468141616f0.tar.bz2
pfsense-packages-58b843ead972b5b660cbb0ed2a2ca468141616f0.zip
dansguardian - fix missing check on ldap user mask fetch and group count
Diffstat (limited to 'config/dansguardian/dansguardian_ldap.php')
-rw-r--r--config/dansguardian/dansguardian_ldap.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/config/dansguardian/dansguardian_ldap.php b/config/dansguardian/dansguardian_ldap.php
index 79a6b21a..90ab1b99 100644
--- a/config/dansguardian/dansguardian_ldap.php
+++ b/config/dansguardian/dansguardian_ldap.php
@@ -96,7 +96,7 @@ $apply_config=0;
if (is_array($config['installedpackages']['dansguardiangroups']['config']))
foreach($config['installedpackages']['dansguardiangroups']['config'] as $group) {
#ignore default group
- if ($id > 1)
+ if ($id > 0)
if ($argv[1] == "" || $argv[1] == $group['name']){
$members="";
$ldap_servers= explode (',',$group['ldap']);
@@ -106,6 +106,7 @@ if (is_array($config['installedpackages']['dansguardiangroups']['config']))
if (in_array($server['dc'],$ldap_servers)){
$ldap_dn = $server['dn'];
$ldap_host=$server['dc'];
+ $mask=(empty($server['mask'])?"USER":$server['mask']);
$result = get_ldap_members($group['name'],$server['username'].','.$server['dn'],$server['password']);
foreach($result as $key => $value) {
if (preg_match ("/\w+/",$value[0])){
@@ -117,7 +118,7 @@ if (is_array($config['installedpackages']['dansguardiangroups']['config']))
$replace[0]=$value[0];
$replace[1]="\n";
$replace[2]="$name";
- $members .= preg_replace($pattern,$replace,$server['mask'])."\n";
+ $members .= preg_replace($pattern,$replace,$mask)."\n";
}
}
}