From 91dbcf4a6e0990ae0f19fe841489f1fb6d598fe6 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 13 Feb 2015 13:55:28 +0100 Subject: [PATCH] LSldapObject : Fix method to get rdn value --- public_html/includes/class/class.LSldapObject.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public_html/includes/class/class.LSldapObject.php b/public_html/includes/class/class.LSldapObject.php index 60b6cdd9..96fe335b 100644 --- a/public_html/includes/class/class.LSldapObject.php +++ b/public_html/includes/class/class.LSldapObject.php @@ -865,7 +865,7 @@ class LSldapObject { return $this -> dn; } else if(($val=='rdn')||($val=='%{rdn}')) { - return $this -> attrs[ $this -> config['rdn'] ] -> getValue(); + return $this -> rdn; } else if(($val=='subDn')||($val=='%{subDn}')) { return $this -> subDnValue; @@ -1805,13 +1805,19 @@ class LSldapObject { $this -> cache['subDnValue'] = self :: getSubDnValue($this -> dn); return $this -> cache['subDnValue']; } - if ($key=='subDnName') { + elseif ($key=='subDnName') { if ($this -> cache['subDnName']) { return $this -> cache['subDnName']; } $this -> cache['subDnName'] = self :: getSubDnName($this -> dn); return $this -> cache['subDnName']; } + elseif ($key=='rdn') { + if ($this -> config['rdn'] && isset($this -> attrs[ $this -> config['rdn'] ])) { + return $this -> attrs[ $this -> config['rdn'] ] -> getValue(); + } + return false; + } } }