Commit df734c67 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes: #2731 Sync objects class with develop branch

Showing with 17 additions and 2 deletions
+17 -2
...@@ -39,10 +39,15 @@ class objects ...@@ -39,10 +39,15 @@ class objects
* *
* \return The list of objects as an associative array (keys are dns) * \return The list of objects as an associative array (keys are dns)
*/ */
static function ls ($type, $attrs = array(), $ou = NULL, $filter = '') static function ls ($type, $attrs = NULL, $ou = NULL, $filter = '')
{ {
global $config; global $config;
if ($attrs === NULL) {
$infos = self::infos($type);
$attrs = $infos['mainAttr'];
}
if (is_array($attrs)) { if (is_array($attrs)) {
$search_attrs = array_keys($attrs); $search_attrs = array_keys($attrs);
} else { } else {
...@@ -157,7 +162,11 @@ class objects ...@@ -157,7 +162,11 @@ class objects
$tabClass = $infos['tabClass']; $tabClass = $infos['tabClass'];
$tabObject = new $tabClass($config, $config->data['TABS'][$infos['tabGroup']], $dn, $infos['aclCategory']); $tabObject = new $tabClass($config, $config->data['TABS'][$infos['tabGroup']], $dn, $infos['aclCategory']);
$tabObject->set_acl_base($dn); if ($dn == 'new') {
$tabObject->set_acl_base($config->current['BASE']);
} else {
$tabObject->set_acl_base($dn);
}
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, "Openned as $type object"); @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, "Openned as $type object");
return $tabObject; return $tabObject;
...@@ -223,6 +232,12 @@ class objects ...@@ -223,6 +232,12 @@ class objects
$filter = ldapFilter::parse($infos['filter']); $filter = ldapFilter::parse($infos['filter']);
return $filter($attrs); return $filter($attrs);
} }
static function types ()
{
global $config;
return array_keys($config->data['OBJECTS']);
}
} }
?> ?>
  • bmortier @bmortier

    mentioned in issue #941 (closed)

    By Côme Chilliet on 2017-09-02T15:05:23 (imported from GitLab)

    ·

    mentioned in issue #941 (closed)

    By Côme Chilliet on 2017-09-02T15:05:23 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment