<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="http://bugs.horde.org/themes/feed-rss.xsl" type="text/xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <title>change exim-ldap to qmail-ldap support</title>
  <pubDate>Sun, 07 Sep 2008 04:07:03 -0400</pubDate>
  <link>http://bugs.horde.org/ticket/1100</link>
  <atom:link rel="self" type="application/rss+xml" title="change exim-ldap to qmail-ldap support" href="http://bugs.horde.org/ticket/1100/rss" />
  <description>change exim-ldap to qmail-ldap support</description>

  
  
  <item>
   <title>
also implement single LDAP user for updates

diff -ur fo</title>
   <description>
also implement single LDAP user for updates

diff -ur forwards/config/conf.xml horde-3.0/forwards/config/conf.xml
--- forwards/config/conf.xml    2004-11-15 22:23:01.000000000 -0500
+++ horde-3.0/forwards/config/conf.xml  2004-12-27 13:09:06.899453548 -0500
@@ -100,6 +100,31 @@
     &lt;/configsection&gt;
    &lt;/case&gt;

+   &lt;case name=&quot;ldap&quot; desc=&quot;qmail-ldap based LDAP driver&quot;&gt;
+    &lt;configdescription&gt;
+     If not using realms (multiple domains or virtual hosting) then there is
+     only one possible default configuration.
+     Even if you are using realms/hosting, you have to set a default
+     configuration.  This may be overriden by realm/domain specific values by
+     defining additional arrays, one per realm/domain, with the realm/domain
+     name as the key instead of the key 'default'. This not possible with this
+     interface though.
+    &lt;/configdescription&gt;
+    &lt;configsection name=&quot;params&quot;&gt;
+     &lt;configsection name=&quot;default&quot;&gt;
+      &lt;configstring name=&quot;host&quot; desc=&quot;Hostname where the LDAP server is running on&quot;&gt;localhost&lt;/configstring&gt;
+      &lt;configinteger name=&quot;port&quot; desc=&quot;Port that the LDAP server is using&quot;&gt;389&lt;/configinteger&gt;
+      &lt;configinteger name=&quot;version&quot; required=&quot;false&quot; desc=&quot;LDAP version&quot;&gt;3&lt;/configinteger&gt;
+      &lt;configstring name=&quot;basedn&quot; desc=&quot;Basedn&quot;&gt;ou=mailaccount,dc=example,dc=com&lt;/configstring&gt;
+      &lt;configstring name=&quot;binddn&quot; required=&quot;false&quot; desc=&quot;Bind DN string&quot;&gt;cn=Manager,dc=example,dc=com&lt;/configstring&gt;
+      &lt;configstring name=&quot;bindpass&quot; required=&quot;false&quot; desc=&quot;Bind password string&quot;&gt;&lt;/configstring&gt;
+      &lt;configstring name=&quot;realm&quot; required=&quot;false&quot; desc=&quot;Realm&quot;&gt;&lt;/configstring&gt;
+      &lt;configstring name=&quot;uid&quot; desc=&quot;The attribute that is searched for the user ID&quot;&gt;uid&lt;/configstring&gt;
+      &lt;configstring name=&quot;forwards&quot; desc=&quot;The attribute that defines where the mail should go&quot;&gt;mailForwardingAddress&lt;/configstring&gt;
+     &lt;/configsection&gt;
+    &lt;/configsection&gt;
+   &lt;/case&gt;
+
    &lt;case name=&quot;customsql&quot; desc=&quot;Custom SQL based forwarding driver&quot;&gt;
     &lt;configsection name=&quot;params&quot;&gt;
      &lt;configsql switchname=&quot;driverconfig&quot;/&gt;
diff -ur forwards/lib/Driver/ldap.php horde-3.0/forwards/lib/Driver/ldap.php
--- forwards/lib/Driver/ldap.php        2004-03-30 12:38:20.000000000 -0500
+++ horde-3.0/forwards/lib/Driver/ldap.php      2004-12-27 14:40:18.326271513 -0500
@@ -67,17 +67,13 @@
         }

         // Connect as the user.
-        $res = $this-&gt;_connect($userdn, $pass, $realm);
+        $res = $this-&gt;_connect($this-&gt;_params[$realm]['binddn'], $this-&gt;_params[$realm]['bindpass'], $realm);
         if (is_a($res, 'PEAR_Error')) {
             $this-&gt;_error = $res-&gt;getMessage();
             $this-&gt;_error .= ' - ' .  _(&quot;Check your password&quot;);
@@ -86,7 +82,7 @@

         // Change the user's forwards.
         $newDetails[$this-&gt;_params[$realm]['forwards']] = $message;
-        $res = ldap_mod_replace($this-&gt;_ds, $userdn, $newDetails);
+        $res = ldap_mod_replace($this-&gt;_ds, $userdn, $newDetails) or ldap_mod_add($this-&gt;_ds, $userdn, $newDetails);
         if (!$res) {
             $res = PEAR::raiseError(ldap_error($this-&gt;_ds));
         }
@@ -308,8 +304,8 @@
                             $this-&gt;_params[$realm]['version']);
         }

-        if (!is_null($userdn)) {
-            $result = @ldap_bind($this-&gt;_ds, $userdn, $password);
+        if (!is_null($this-&gt;_params[$realm]['binddn'])) {
+            $result = @ldap_bind($this-&gt;_ds, $this-&gt;_params[$realm]['binddn'], $this-&gt;_params[$realm]['bindpass']);
         } else {
             $result = @ldap_bind($this-&gt;_ds);
         }</description>
   <pubDate>Thu, 06 Jan 2005 21:43:52 -0500</pubDate>
   <link>http://bugs.horde.org/ticket/1100#t4270</link>
  </item>
  <item>
   <title>This won't work. You can't have two configsections with the </title>
   <description>This won't work. You can't have two configsections with the same name.</description>
   <pubDate>Sat, 22 Oct 2005 11:26:59 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/1100#t12731</link>
  </item>
  <item>
   <title>No feedback.</title>
   <description>No feedback.</description>
   <pubDate>Mon, 28 Nov 2005 10:14:33 -0500</pubDate>
   <link>http://bugs.horde.org/ticket/1100#t14218</link>
  </item>
  

 </channel>
</rss>
