diff --git a/lam/docs/devel/upgrade.htm b/lam/docs/devel/upgrade.htm
index 2f974373..22f80820 100644
--- a/lam/docs/devel/upgrade.htm
+++ b/lam/docs/devel/upgrade.htm
@@ -60,6 +60,15 @@ This is a list of API changes for all LAM releases.
+
6.2 -> 6.3
+
+ - Module API
+
+ - get_configOptions(): $allScopes contains type ids instead of account types
+ - check_configOptions(): first parameter contains type ids instead of account types
+
+
+
6.1 -> 6.2
- No major API changes
diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc
index 936da685..a9897f9d 100644
--- a/lam/lib/baseModule.inc
+++ b/lam/lib/baseModule.inc
@@ -2,6 +2,7 @@
use \LAM\PDF\PDFLabelValue;
use \LAM\PDF\PDFTable;
use LAM\TYPES\ConfiguredType;
+use function LAM\TYPES\getScopeFromTypeId;
/*
$Id$
@@ -681,15 +682,20 @@ abstract class baseModule {
* If the input data is invalid the return value is an array that contains subarrays to build StatusMessages ('message type', 'message head', 'message text').
*
If no errors occured the function returns an empty array.
*
- * @param array $scopes list of account types which are used
+ * @param array $typeIds list of account type ids which are used
* @param array $options hash array (option name => value) that contains the input. The option values are all arrays containing one or more elements.
* @return array list of error messages
*
* @see baseModule::get_metaData()
*/
- public function check_configOptions($scopes, &$options) {
+ public function check_configOptions($typeIds, &$options) {
$messages = array();
- $scopes[] = 'all'; // add checks that are independent of scope
+ // add checks that are independent of scope
+ $scopes = array('all');
+ foreach ($typeIds as $typeId) {
+ $scopes[] = getScopeFromTypeId($typeId);
+ }
+ $scopes = array_unique($scopes);
for ($s = 0; $s < sizeof($scopes); $s++) {
if (isset($this->meta['config_checks'][$scopes[$s]]) && is_array($this->meta['config_checks'][$scopes[$s]])) {
$identifiers = array_keys($this->meta['config_checks'][$scopes[$s]]);
diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc
index 6ab84893..de5bc91e 100644
--- a/lam/lib/modules.inc
+++ b/lam/lib/modules.inc
@@ -360,7 +360,7 @@ function getConfigOptions($scopes) {
/**
* Checks if the configuration options are valid
*
-* @param array $scopes hash array (module name => array(account types))
+* @param array $scopes hash array (module name => array(account type ids))
* @param array $options hash array containing all options (name => array(...))
* @return array list of error messages
*/
diff --git a/lam/lib/modules/imapAccess.inc b/lam/lib/modules/imapAccess.inc
index 4b6e6142..5b16d226 100644
--- a/lam/lib/modules/imapAccess.inc
+++ b/lam/lib/modules/imapAccess.inc
@@ -497,21 +497,11 @@ class imapAccess extends baseModule {
}
/**
- * Checks input values of module settings.
- *
- * Calling this method does not require the existence of an enclosing {@link accountContainer}.
- *
- * If the input data is invalid the return value is an array that contains subarrays to build StatusMessages ('message type', 'message head', 'message text').
- *
If no errors occured the function returns an empty array.
- *
- * @param array $scopes list of account types which are used
- * @param array $options hash array (option name => value) that contains the input. The option values are all arrays containing one or more elements.
- * @return array list of error messages
- *
- * @see baseModule::get_metaData()
- */
- public function check_configOptions($scopes, &$options) {
- $errors = parent::check_configOptions($scopes, $options);
+ * {@inheritDoc}
+ * @see baseModule::check_configOptions()
+ */
+ public function check_configOptions($typeIds, &$options) {
+ $errors = parent::check_configOptions($typeIds, $options);
if ($options['ImapAccess_ImapAdminPasswordSelect'][0] == 'config') {
if (empty($options['ImapAccess_ImapAdminPassword'][0])) {
$errors[] = $this->messages['config'][2];
diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc
index ae117d27..5e5f8af8 100644
--- a/lam/lib/modules/posixAccount.inc
+++ b/lam/lib/modules/posixAccount.inc
@@ -1,5 +1,6 @@
array('value')))
- * @return array list of error messages
- */
- function check_configOptions($scopes, &$options) {
+ * {@inheritDoc}
+ * @see baseModule::check_configOptions()
+ */
+ function check_configOptions($typeIds, &$options) {
$return = array();
- // user settings
+ $scopes = array();
+ foreach ($typeIds as $typeId) {
+ $scopes[] = getScopeFromTypeId($typeId);
+ } // user settings
if (in_array('user', $scopes)) {
if ($options['posixAccount_uidGeneratorUsers'][0] == 'range') {
// min/maxUID are required, check if they are numeric
diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc
index dad0ef14..69930855 100644
--- a/lam/lib/modules/posixGroup.inc
+++ b/lam/lib/modules/posixGroup.inc
@@ -1016,20 +1016,10 @@ class posixGroup extends baseModule implements passwordService {
}
/**
- * Checks input values of module settings.
- *
- * Calling this method does not require the existence of an enclosing {@link accountContainer}.
- *
- * If the input data is invalid the return value is an array that contains subarrays to build StatusMessages ('message type', 'message head', 'message text').
- *
If no errors occured the function returns an empty array.
- *
- * @param array $scopes list of account types which are used
- * @param array $options hash array (option name => value) that contains the input. The option values are all arrays containing one or more elements.
- * @return array list of error messages
- *
- * @see baseModule::get_metaData()
- */
- public function check_configOptions($scopes, &$options) {
+ * {@inheritDoc}
+ * @see baseModule::check_configOptions()
+ */
+ public function check_configOptions($typeIds, &$options) {
if ($options['posixGroup_gidGenerator'][0] == 'range') {
$this->meta['config_checks']['group']['posixGroup_minGID'] = array (
'type' => 'ext_preg',
@@ -1065,7 +1055,7 @@ class posixGroup extends baseModule implements passwordService {
'required_message' => $this->messages['windowsIDPoolDN'][0],
'error_message' => $this->messages['windowsIDPoolDN'][0]);
}
- return parent::check_configOptions($scopes, $options);
+ return parent::check_configOptions($typeIds, $options);
}
/**
diff --git a/lam/templates/config/moduleSettings.php b/lam/templates/config/moduleSettings.php
index 3a8998d9..11079615 100644
--- a/lam/templates/config/moduleSettings.php
+++ b/lam/templates/config/moduleSettings.php
@@ -224,7 +224,7 @@ function checkInput() {
foreach ($types as $type) {
$mods = $conf->get_AccountModules($type->getId());
for ($i = 0; $i < sizeof($mods); $i++) {
- $scopes[$mods[$i]][] = $type->getScope();
+ $scopes[$mods[$i]][] = $type->getId();
}
}
// check options