Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Patch 1 #33

Closed
wants to merge 2 commits into from

2 participants

@fortiko

No description provided.

@dupondje
Owner

could not be merged, but fixed :)

@dupondje dupondje closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 4, 2012
  1. @fortiko

    Use the real base DN *without* the name (so the part after the colon …

    fortiko authored
    …':') instead of the whole definition "Name of LDAP:cn=...."
  2. @fortiko
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 8 deletions.
  1. +12 −8 backend/ldap.php
View
20 backend/ldap.php
@@ -127,7 +127,7 @@ public function GetMessageList($folderid, $cutoffdate)
$folder = explode(":", $base_dn);
if ($folder[0] == $folderid)
{
- $base_dn = str_replace('%u', $this->user, $base_dn);
+ $base_dn = str_replace('%u', $this->user, $folder[1]);
$results = ldap_list($this->ldap_link, $base_dn, $filter, $attributes);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendLDAP->GetMessageList(): Got %s contacts in base_dn '%s'.", ldap_count_entries($this->ldap_link, $results), $base_dn));
$entries = ldap_get_entries($this->ldap_link, $results);
@@ -153,7 +153,7 @@ public function GetMessage($folderid, $id, $contentparameters)
$folder = explode(":", $base_dn);
if ($folder[0] == $folderid)
{
- $base_dn = str_replace('%u', $this->user, $base_dn);
+ $base_dn = str_replace('%u', $this->user, $folder[1]);
$result_id = ldap_list($this->ldap_link, $base_dn, "(entryUUID=".$id.")");
if ($result_id)
{
@@ -268,10 +268,12 @@ public function StatMessage($folderid, $id)
$base_dns = explode("|", LDAP_BASE_DNS);
foreach ($base_dns as $base_dn)
{
- $base_dn = str_replace('%u', $this->user, $base_dn);
- $result_id = ldap_list($this->ldap_link, $base_dn, "(entryUUID=".$id.")", array("modifyTimestamp"));
- if ($result_id)
- {
+ $folder = explode(":", $base_dn);
+ if ($folder[0] == $folderid) {
+ $base_dn = str_replace('%u', $this->user, $folder[1]);
+ $result_id = ldap_list($this->ldap_link, $base_dn, "(entryUUID=".$id.")", array("modifyTimestamp"));
+ if ($result_id)
+ {
$entry_id = ldap_first_entry($this->ldap_link, $result_id);
if ($entry_id)
{
@@ -283,6 +285,7 @@ public function StatMessage($folderid, $id)
return $message;
}
}
+ }
}
}
@@ -295,6 +298,7 @@ public function ChangeMessage($folderid, $id, $message)
if ($folder[0] == $folderid)
{
$ldap_attributes = $this->_GenerateLDAPArray($message);
+ $base_dn = str_replace('%u', $this->user, $folder[1]);
$result_id = ldap_list($this->ldap_link, $base_dn, "(entryUUID=".$id.")", array("modifyTimestamp"));
if ($result_id)
{
@@ -374,7 +378,7 @@ private function _GenerateLDAPArray($message)
}
if ($message->companyname)
{
- $ldap["o"] = $message-companyname;
+ $ldap["o"] = $message->companyname;
}
if ($message->pagernumber)
{
@@ -440,7 +444,7 @@ public function DeleteMessage($folderid, $id)
$folder = explode(":", $base_dn);
if ($folder[0] == $folderid)
{
- $base_dn = str_replace('%u', $this->user, $base_dn);
+ $base_dn = str_replace('%u', $this->user, $folder[1]);
$result_id = ldap_list($this->ldap_link, $base_dn, "(entryUUID=".$id.")", array("entryUUID"));
if ($result_id)
{
Something went wrong with that request. Please try again.