From c59482fea12aacd9a15f6f0fa7699137f99b3c2c Mon Sep 17 00:00:00 2001 From: All-3kcis Date: Fri, 13 Nov 2015 11:17:23 +0100 Subject: [PATCH 1/3] Fix #3542 --- htdocs/core/login/functions_ldap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 208ccd0c37c..71b93f8ee82 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -138,7 +138,7 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) $ldap->searchUser=$ldapuserattr."=".$usertotest.",".$ldapdn; // Default dn (will work if LDAP accept a dn with login value inside) // But if LDAP need a dn with name like "cn=Jhon Bloggs,ou=People,dc=foo,dc=com", previous part must have been executed to have // dn detected into ldapUserDN. - if ($resultFetchLdapUser) $ldap->searchUser = $ldap->ldapUserDN; + if ($resultFetchLdapUser AND !empty($ldap->ldapUserDN)) $ldap->searchUser = $ldap->ldapUserDN; $ldap->searchPassword=$passwordtotest; // Test with this->seachUser and this->searchPassword From 965de406d30193ead4e4b7efb5f29ecb69edfbf8 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Fri, 13 Nov 2015 11:47:15 +0100 Subject: [PATCH 2/3] FIX htmlname parameters wasnt applied --- htdocs/core/ajax/contacts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/contacts.php b/htdocs/core/ajax/contacts.php index 97f29c4069d..c0cd9ecfd70 100644 --- a/htdocs/core/ajax/contacts.php +++ b/htdocs/core/ajax/contacts.php @@ -50,7 +50,7 @@ if (! empty($id) && ! empty($action) && ! empty($htmlname)) $return=array(); if (empty($showempty)) $showempty=0; - $return['value'] = $form->selectcontacts($id,'','contactid',$showempty,'','',0,'',true); + $return['value'] = $form->selectcontacts($id,'',$htmlname,$showempty,'','',0,'',true); $return['num'] = $form->num; $return['error'] = $form->error; From 298a67134241ea6fe9f20cd4d2cf86238256e410 Mon Sep 17 00:00:00 2001 From: Paris Liakos Date: Fri, 13 Nov 2015 20:25:12 +0200 Subject: [PATCH 3/3] getListOfProductsOrServices() filters are broken --- htdocs/webservices/server_productorservice.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 9d26ce52fb2..2e3314fff12 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -946,9 +946,9 @@ function getListOfProductsOrServices($authentication,$filterproduct) $sql.=" WHERE entity=".$conf->entity; foreach($filterproduct as $key => $val) { - if ($key == 'type' && $val >= 0) $sql.=" AND fk_product_type = ".$db->escape($val); - if ($key == 'tosell') $sql.=" AND to_sell = ".$db->escape($val); - if ($key == 'tobuy') $sql.=" AND to_buy = ".$db->escape($val); + if ($key == 'type' && $val >= 0) $sql.=" AND fk_product_type = ".$db->escape($val); + if ($key == 'status_tosell') $sql.=" AND tosell = ".$db->escape($val); + if ($key == 'status_tobuy') $sql.=" AND tobuy = ".$db->escape($val); } $resql=$db->query($sql); if ($resql)