[commits] [Wiki] changed: LDAPHooksHorde5

Wiki Guest wikiguest at horde.org
Thu Apr 10 23:36:22 UTC 2014


guest [82.196.11.122]  Thu, 10 Apr 2014 23:36:22 +0000

Modified page: http://wiki.horde.org/LDAPHooksHorde5
New Revision:  10
Change log:  Silverdog (silverdog at gmail.com)

@@ -31,9 +31,10 @@
              if (is_null($username)) {
                  return $value;
              }
              $searchBase = 'ou=users,dc=yourdomain,dc=lan';
-            $cmd = '/usr/bin/ldapsearch -ZZ -x -b ' . $searchBase . '  
uid=' . escapeshellcmd($username) . ' | /bin/grep mail | /usr/bin/awk  
\'{print $2}\'';
+            $cmd = '/usr/bin/ldapsearch -ZZ -x -b ' . $searchBase . '  
uid=' . escapeshellcmd($username) . ' mail | /bin/grep mail: |  
/usr/bin/awk \'{print $2}\'';
+// remember use -h for use another ldap host
  	     $mails = `$cmd`;
              $mail_array = explode("\n", $mails);
              $mail = $mail_array['0'];
              return empty($mail)
@@ -44,9 +45,10 @@
              if (is_null($username)) {
                  return $value;
              }
  		$searchBase = 'ou=users,dc=yourdomain,dc=lan';
-		$cmd = '/usr/bin/ldapsearch -ZZ -x -b ' . $searchBase . ' uid=' .  
escapeshellcmd($username) . ' | /bin/grep cn: | /usr/bin/cut -c5-';
+		$cmd = '/usr/bin/ldapsearch -ZZ -x -b ' . $searchBase . ' uid=' .  
escapeshellcmd($username) . ' cn | /bin/grep cn: | /usr/bin/cut -c5-';
+// remember use -h for use another ldap host
  		$cns = `$cmd`;
  		$cn_array = explode("\n", $cns);
  		$cn = $cn_array['0'];
  		return empty($cn)



More information about the commits mailing list