mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +01:00
Code cleaning
This commit is contained in:
parent
9224c54304
commit
0e8009420c
2 changed files with 32 additions and 23 deletions
|
@ -47,7 +47,13 @@ class LSattr_html_select_object extends LSattr_html{
|
|||
*/
|
||||
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);
|
||||
return false;
|
||||
|
|
|
@ -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');
|
||||
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
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue