diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index 7605e58755e44047c1134d0584c78a16e74e2173..01179e40448caf5ad31b84f3a889c7bcda7a11a3 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -6,6 +6,7 @@
  * Copyright (C) 2005-2012 Regis Houssin        <regis@dolibarr.fr>
  * Copyright (C) 2005      Lionel Cousteix      <etm_ltd@tiscali.co.uk>
  * Copyright (C) 2011      Herve Prot           <herve.prot@symeos.com>
+ * Copyright (C) 2012      Juanjo Menent        <jmenent@2byte.es>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -886,7 +887,7 @@ else
             $result=$ldap->connect_bind();
             if ($result > 0)
             {
-                $userSearchFilter = '('.$conf->global->LDAP_FILTER_CONNECTION.'('.$this->getUserIdentifier().'='.$fuser->login.'))';
+                $userSearchFilter = '('.$conf->global->LDAP_FILTER_CONNECTION.'('.$ldap->getUserIdentifier().'='.$fuser->login.'))';
                 $entries = $ldap->fetch($fuser->login,$userSearchFilter);
                 if (! $entries)
                 {