aboutsummaryrefslogtreecommitdiffstats
path: root/config/dansguardian/dansguardian_ldap.php
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2013-01-29 15:58:04 -0200
committermarcelloc <marcellocoutinho@gmail.com>2013-01-29 15:58:04 -0200
commit5d3183341f3289c5a7d70a1f584e5e6b5364736b (patch)
tree4609bfe8b4765ec379dbd1d29ff22f2baada7525 /config/dansguardian/dansguardian_ldap.php
parent6eb7ddf66bf8f40a8981a25353bc8a99558eefcd (diff)
downloadpfsense-packages-5d3183341f3289c5a7d70a1f584e5e6b5364736b.tar.gz
pfsense-packages-5d3183341f3289c5a7d70a1f584e5e6b5364736b.tar.bz2
pfsense-packages-5d3183341f3289c5a7d70a1f584e5e6b5364736b.zip
dansguardian - package version 0.1.7. Gui improvements, 2.1 support, pcre fix ,dansguardian 2.12.0.3 and more
Diffstat (limited to 'config/dansguardian/dansguardian_ldap.php')
-rw-r--r--config/dansguardian/dansguardian_ldap.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/config/dansguardian/dansguardian_ldap.php b/config/dansguardian/dansguardian_ldap.php
index c02289ac..d44f3de4 100644
--- a/config/dansguardian/dansguardian_ldap.php
+++ b/config/dansguardian/dansguardian_ldap.php
@@ -8,7 +8,7 @@
/*
dansguardian_ldap.php
part of pfSense (http://www.pfSense.com)
- Copyright (C) 2012 Marcello Coutinho
+ Copyright (C) 2012-2013 Marcello Coutinho
All rights reserved.
*/
@@ -17,7 +17,7 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright notice,
+ 1. Redistributions of source code MUST retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
@@ -107,7 +107,13 @@ if (is_array($config['installedpackages']['dansguardiangroups']['config']))
$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']);
+ if (preg_match("/cn/",$server['username']))
+ $ldap_username=$server['username'].",".$server['dn'];
+ else
+ $ldap_username=$server['username'];
+ #$domainuser=split("cn=",$server['username']);
+ #$ldap_username=preg_replace("/,\./","@",$domainuser[1].preg_replace("/(,|)DC=/i",".",$server['dn']));
+ $result = get_ldap_members($group['name'],$ldap_username,$server['password']);
foreach($result as $key => $value) {
if (preg_match ("/\w+/",$value[0])){
#var_dump($value);