From 5d3183341f3289c5a7d70a1f584e5e6b5364736b Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Tue, 29 Jan 2013 15:58:04 -0200 Subject: dansguardian - package version 0.1.7. Gui improvements, 2.1 support, pcre fix ,dansguardian 2.12.0.3 and more --- config/dansguardian/dansguardian_ldap.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'config/dansguardian/dansguardian_ldap.php') 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); -- cgit v1.2.3