| Summary | single-user ldap bind |
| Queue | Passwd |
| Queue Version | HEAD |
| Type | Enhancement |
| State | Resolved |
| Priority | 1. Low |
| Owners | |
| Requester | ian (at) mrzesty (dot) net |
| Created | 1/7/05 (7843 days ago) |
| Due | |
| Updated | 9/13/05 (7594 days ago) |
| Assigned | |
| Resolved | 9/13/05 (7594 days ago) |
| Milestone | |
| Patch | No |
State ⇒ Resolved
State ⇒ New
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ single-user ldap bind
Queue ⇒ Passwd
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];
}