new type API
This commit is contained in:
parent
2ce3618ca9
commit
6022dee5a0
|
@ -50,6 +50,11 @@ This is a list of API changes for all LAM releases.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
<h2>5.7 -> 5.8</h2>
|
||||||
|
<ul>
|
||||||
|
<li>All account types allow multiple configurations by default.</li>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
<h2>5.6 -> 5.7</h2>
|
<h2>5.6 -> 5.7</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>module interface: get_pdfEntries() must return an array key =>
|
<li>module interface: get_pdfEntries() must return an array key =>
|
||||||
|
|
|
@ -705,11 +705,8 @@ function searchLDAPByFilter($filter, $attributes, $scopes, $attrsOnly = false) {
|
||||||
$readAttributesOnly = 1;
|
$readAttributesOnly = 1;
|
||||||
}
|
}
|
||||||
$typeManager = new \LAM\TYPES\TypeManager();
|
$typeManager = new \LAM\TYPES\TypeManager();
|
||||||
$types = $typeManager->getConfiguredTypes();
|
$types = $typeManager->getConfiguredTypesForScopes($scopes);
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
if (!in_array($type->getScope(), $scopes)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// search LDAP
|
// search LDAP
|
||||||
$entries = searchLDAPPaged($_SESSION['ldap']->server(), escapeDN($type->getSuffix()),
|
$entries = searchLDAPPaged($_SESSION['ldap']->server(), escapeDN($type->getSuffix()),
|
||||||
$filter, $attributes, $readAttributesOnly, $_SESSION['config']->get_searchLimit());
|
$filter, $attributes, $readAttributesOnly, $_SESSION['config']->get_searchLimit());
|
||||||
|
|
|
@ -1105,15 +1105,15 @@ class LAMConfig {
|
||||||
/**
|
/**
|
||||||
* Returns the LDAP suffix for the given account type
|
* Returns the LDAP suffix for the given account type
|
||||||
*
|
*
|
||||||
* @param string $scope account type
|
* @param string $typeId account type
|
||||||
* @return string the LDAP suffix
|
* @return string the LDAP suffix
|
||||||
*/
|
*/
|
||||||
public function get_Suffix($scope) {
|
public function get_Suffix($typeId) {
|
||||||
if ($scope == "tree") {
|
if ($typeId == "tree") {
|
||||||
return $this->treesuffix;
|
return $this->treesuffix;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $this->typeSettings['suffix_' . $scope];
|
return $this->typeSettings['suffix_' . $typeId];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -268,7 +268,8 @@ class ConfiguredType {
|
||||||
if ($this->additionalLdapFilter !== null) {
|
if ($this->additionalLdapFilter !== null) {
|
||||||
return $this->additionalLdapFilter;
|
return $this->additionalLdapFilter;
|
||||||
}
|
}
|
||||||
$this->additionalLdapFilter = $this->typeManager->getConfig()->get_Suffix($typeId);
|
$typeSettings = $this->typeManager->getConfig()->get_typeSettings();
|
||||||
|
$this->additionalLdapFilter = isset($typeSettings['filter_' . $this->id]) ? $typeSettings['filter_' . $this->id] : '';
|
||||||
return $this->additionalLdapFilter;
|
return $this->additionalLdapFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue