[Tickets #1099] NEW: addition of single-user LDAP credentials
bugs at bugs.horde.org
bugs at bugs.horde.org
Thu Jan 6 18:41:46 PST 2005
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=1099
-----------------------------------------------------------------------
Ticket | 1099
Created By | ian at mrzesty.net
Summary | addition of single-user LDAP credentials
Queue | Accounts
Version | HEAD
State | New
Priority | 1. Low
Type | Enhancement
Owners |
-----------------------------------------------------------------------
ian at mrzesty.net (2005-01-06 18:41) wrote:
I use a single LDAP account for all read queries.
This also corrects some PHP warnings re: unintialized variables
diff -ur accounts/config/conf.xml horde-3.0/accounts/config/conf.xml
--- accounts/config/conf.xml 2004-06-24 19:10:04.000000000 -0400
+++ horde-3.0/accounts/config/conf.xml 2004-12-27 12:13:02.407026352 -0500
@@ -26,6 +26,8 @@
<configstring name="host" desc="LDAP
server/host">localhost</configstring>
<configinteger name="port" required="false" desc="Port LDAP is running
on, if non-standard">389</configinteger>
<configstring name="basedn" desc="basedn
string">o=example.com,c=US</configstring>
+ <configstring name="binddn" required="false" desc="binddn
string">cn=Manager,o=example.com,c=US</configstring>
+ <configstring name="bindpass" required="false" desc="bindpass
string">password</configstring>
<configstring name="attr" desc="LDAP attribute to search
on">uid</configstring>
</configsection>
</case>
diff -ur accounts/lib/Driver/ldap.php
horde-3.0/accounts/lib/Driver/ldap.php
--- accounts/lib/Driver/ldap.php 2004-08-19 07:31:31.000000000 -0400
+++ horde-3.0/accounts/lib/Driver/ldap.php 2004-12-27
12:18:54.717588486 -0500
@@ -67,7 +67,9 @@
}
// bind as anonymous
- $result = @ldap_bind($this->_ds);
+ $result = @ldap_bind($this->_ds,
+ $this->_params['binddn'],
+ $this->_params['bindpass']);
if (!$result) {
return PEAR::raiseError(_("Could not bind to ldap
server"));
}
@@ -115,7 +117,8 @@
function getHome()
{
$information = $this->_getAccount();
- $homedir = $information[0]['homedirectory'][0];
+ if(!empty($information[0]['homedirectory'][0]))
+ $homedir = $information[0]['homedirectory'][0];
return (empty($homedir) ? false : $homedir);
}
@@ -127,7 +130,8 @@
function getShell()
{
$information = $this->_getAccount();
- $shell = $information[0]['loginshell'][0];
+ if(!empty($information[0]['loginshell'][0]))
+ $shell = $information[0]['loginshell'][0];
return (empty($shell) ? false : $shell);
}
More information about the bugs
mailing list