[Tickets #1101] NEW: single-user ldap bind
bugs at bugs.horde.org
bugs at bugs.horde.org
Thu Jan 6 18:45:42 PST 2005
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=1101
-----------------------------------------------------------------------
Ticket | 1101
Created By | ian at mrzesty.net
Summary | single-user ldap bind
Queue | Passwd
Version | HEAD
State | New
Priority | 1. Low
Type | Enhancement
Owners |
-----------------------------------------------------------------------
ian at mrzesty.net (2005-01-06 18:45) wrote:
I use a single LDAP user account for access.
diff -ur passwd/lib/Driver/ldap.php horde-3.0/passwd/lib/Driver/ldap.php
--- passwd/lib/Driver/ldap.php 2004-08-19 06:40:20.000000000 -0400
+++ horde-3.0/passwd/lib/Driver/ldap.php 2004-12-27
14:28:58.981559289 -0500
@@ -34,6 +34,8 @@
$this->_params['show_encryption'] =
isset($params['show_encryption']) ? $params['show_encryption'] : 'true';
$this->_params['uid'] = isset($params['uid']) ?
$params['uid'] : 'uid';
$this->_params['basedn'] = isset($params['basedn']) ?
$params['basedn'] : '';
+ $this->_params['binddn'] = isset($params['binddn']) ?
$params['binddn'] : '';
+ $this->_params['bindpass'] = isset($params['bindpass']) ?
$params['bindpass'] : '';
$this->_params['realm'] = isset($params['realm']) ?
$params['realm'] : '';
$this->_params['tls'] = isset($params['tls']) ?
$params['tls'] : null;
$this->_params['attribute'] = isset($params['attribute']) ?
$params['attribute'] : 'userPassword';
@@ -71,8 +73,8 @@
// Try to bind as the current userdn with password.
$result = false;
- if (!is_null($userdn)) {
- $result = @ldap_bind($this->_ds, $userdn, $password);
+ if (!is_null($this->_params['binddn'])) {
+ $result = @ldap_bind($this->_ds, $this->_params['binddn'],
$this->_params['bindpass']);
}
// If unable to bind as current user, still try to bind as
@@ -162,12 +164,12 @@
$result = ldap_search($this->_ds, $this->_params['basedn'],
$search);
$entry = ldap_first_entry($this->_ds, $result);
if ($entry !== false) {
- $information = ldap_get_values($this->_ds, $entry,
$this->_params['shadowlastchange']);
+ $information = @ldap_get_values($this->_ds, $entry,
$this->_params['shadowlastchange']);
if ($information) {
$lookupshadow['shadowlastchange'] = $information[0];
}
- $information = ldap_get_values($this->_ds, $entry,
$this->_params['shadowmin']);
+ $information = @ldap_get_values($this->_ds, $entry,
$this->_params['shadowmin']);
if ($information) {
$lookupshadow['shadowmin'] = $information[0];
}
More information about the bugs
mailing list