diff --git a/src/includes/class/class.LSattr_html_select_object.php b/src/includes/class/class.LSattr_html_select_object.php
index ba2d3ef9..2fbe25ef 100644
--- a/src/includes/class/class.LSattr_html_select_object.php
+++ b/src/includes/class/class.LSattr_html_select_object.php
@@ -45,11 +45,17 @@ class LSattr_html_select_object extends LSattr_html{
*
* @return LSformElement|false L'element du formulaire ajouté, ou false
*/
- public function addToForm (&$form,$idForm,$data=NULL) {
+ public function addToForm (&$form, $idForm, $data=NULL) {
$this -> config['attrObject'] = $this;
- $element=$form -> addElement($this -> LSformElement_type, $this -> name, $this -> getLabel(), $this -> config, $this);
+ $element = $form -> addElement(
+ $this -> LSformElement_type,
+ $this -> name,
+ $this -> getLabel(),
+ $this -> config,
+ $this
+ );
if(!$element) {
- LSerror :: addErrorCode('LSform_06',$this -> name);
+ LSerror :: addErrorCode('LSform_06', $this -> name);
return false;
}
if ($data) {
@@ -71,8 +77,8 @@ class LSattr_html_select_object extends LSattr_html{
*
* @return array La valeur formatée de l'attribut (array('DNs' => 'displayName'))
**/
- public function refreshForm($data,$fromDNs=false) {
- return $this -> getFormValues($data,$fromDNs);
+ public function refreshForm($data, $fromDNs=false) {
+ return $this -> getFormValues($data, $fromDNs);
}
/**
diff --git a/src/includes/class/class.LSldapObject.php b/src/includes/class/class.LSldapObject.php
index 22c2cabb..172218c8 100644
--- a/src/includes/class/class.LSldapObject.php
+++ b/src/includes/class/class.LSldapObject.php
@@ -1024,37 +1024,40 @@ class LSldapObject extends LSlog_staticLoggerClass {
*
* @param Net_LDAP2_Filter|string|null $filter LDAP search filter
* @param string|null $sbasedn Base DN of the search
- * @param array $sparams Search parameters (as expected by Net_LDAP2::search())
+ * @param array|null $sparams Search parameters (as expected by Net_LDAP2::search())
* @param string|false $displayFormat LSformat of objects's display name
* @param bool $cache Enable/disable cache (default: true)
*
* @return array|false Tableau dn => name correspondant au resultat de la recherche, ou false
*/
- public function listObjectsName($filter=NULL,$sbasedn=NULL,$sparams=array(),$displayFormat=false,$cache=true) {
+ public function listObjectsName($filter=NULL, $sbasedn=NULL, $sparams=null, $displayFormat=false, $cache=true) {
if (!LSsession :: loadLSclass('LSsearch')) {
- LSerror::addErrorCode('LSsession_05','LSsearch');
+ LSerror::addErrorCode('LSsession_05', 'LSsearch');
return false;
}
- if (!$displayFormat) {
- $displayFormat = $this -> getDisplayNameFormat();
- }
-
- $params = array(
- 'displayFormat' => $displayFormat,
+ $params = [
+ 'displayFormat' => $displayFormat?$displayFormat:$this -> getDisplayNameFormat(),
'basedn' => $sbasedn,
'filter' => $filter
+ ];
+
+ $LSsearch = new LSsearch(
+ $this -> type_name,
+ 'LSldapObject::listObjectsName',
+ (
+ is_array($sparams)?
+ $params = array_merge($sparams, $params):
+ $sparams
+ ),
+ true
);
- if (is_array($sparams)) {
- $params=array_merge($sparams,$params);
- }
-
- $LSsearch = new LSsearch($this -> type_name,'LSldapObject::listObjectsName',$params,true);
-
- $LSsearch -> run($cache);
-
- return $LSsearch -> listObjectsName();
+ return (
+ $LSsearch -> run($cache)?
+ $LSsearch -> listObjectsName():
+ false
+ );
}