From 170a5870b6a3e989df07ee1eafd3ed5ece3f23c7 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 23 May 2011 11:31:59 +0200 Subject: [PATCH] LSformElement::password : Fixed bug in verifyPassword() method --- .../includes/class/class.LSformElement_password.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public_html/includes/class/class.LSformElement_password.php b/public_html/includes/class/class.LSformElement_password.php index 073761e3..afb947a7 100644 --- a/public_html/includes/class/class.LSformElement_password.php +++ b/public_html/includes/class/class.LSformElement_password.php @@ -168,7 +168,16 @@ class LSformElement_password extends LSformElement { else { $hash = $this -> attr_html -> attribute -> ldap -> encodePassword($pwd); $find=false; - foreach($this -> attr_html -> attribute -> data as $val) { + if (is_array($this -> attr_html -> attribute -> data)) { + $data = $this -> attr_html -> attribute -> data; + } + elseif (!is_array($this -> attr_html -> attribute -> data) && !empty($this -> attr_html -> attribute -> data)) { + $data = array($this -> attr_html -> attribute -> data); + } + else { + return $find; + } + foreach($data as $val) { if ($hash == $val) $find=true; }