ALT Linux Bugzilla
– Attachment 4590 Details for
Bug 24248
password plugin LDAP driver
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Патч для RC 0.3.1
roundCube031.passwordPlugin.ldapDriver.patch (text/plain), 1.94 KB, created by
andrey
on 2010-10-08 14:29:23 MSD
(
hide
)
Description:
Патч для RC 0.3.1
Filename:
MIME Type:
Creator:
andrey
Created:
2010-10-08 14:29:23 MSD
Size:
1.94 KB
patch
obsolete
>--- ldap.php.org 2009-08-24 22:18:47 +0300 >+++ ldap.php 2010-07-08 18:26:19 +0300 >@@ -20,7 +20,39 @@ > require_once ('Net/LDAP2.php'); > > // Building user DN > - $userDN = str_replace('%login', $_SESSION['username'], $rcmail->config->get('password_ldap_userDN_mask')); > + if (strstr($rcmail->config->get('password_ldap_userDN_mask'), '*')){ > + if ($rcmail->config->get('password_ldap_host') == NULL){ > + $ldapHost = "localhost"; > + } else { > + $ldapHost = $rcmail->config->get('password_ldap_host'); > + } > + if ($rcmail->config->get('password_ldap_port') == NULL){ > + $ldapPort = 389; > + } else { > + $ldapPort = $rcmail->config->get('password_ldap_port'); > + } > + $ds = ldap_connect($ldapHost, $ldapPort); > + if (!$ds){ > + return PASSWORD_CONNECT_ERROR; > + } > + $br = ldap_bind($ds); > + if (!$br){ > + return PASSWORD_CONNECT_ERROR; > + } > + $nameParts = explode('@', $_SESSION['username']); > + $ldapFilter = "(uid=$nameParts[0])"; > + $ldapAttr = array("dn"); > + $sr = ldap_search($ds, $rcmail->config->get('password_ldap_basedn'), $ldapFilter, $ldapAttr); > + if ($sr){ > + $ldapRes = ldap_get_entries($ds, $sr); > + $userDN = $ldapRes[0]["dn"]; > + } else { > + return PASSWORD_CONNECT_ERROR; > + } > + ldap_close($ds); > + } else { > + $userDN = str_replace('%login', $_SESSION['username'], $rcmail->config->get('password_ldap_userDN_mask')); > + } > > $parts = explode('@', $_SESSION['username']); > if (count($parts) == 2)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 24248
: 4590 |
4591