removed get_configDescriptions()

This commit is contained in:
Roland Gruber 2006-11-13 17:43:21 +00:00
parent 3733ea62de
commit 617eed52e3
10 changed files with 275 additions and 396 deletions

View File

@ -1,3 +1,11 @@
??? 1.2.0
- Samba: better handling of date values
Developers:
API changes:
- removed get_configDescription() from module interface
01.11.2006 1.1.1 01.11.2006 1.1.1
- Lamdaemon: added test page (Tools -> Tests -> Lamdaemon test) - Lamdaemon: added test page (Tools -> Tests -> Lamdaemon test)
- LAM Pro: Samba passwords can now be synchronized with Unix password - LAM Pro: Samba passwords can now be synchronized with Unix password
@ -18,6 +26,7 @@
- process_...() functions: returned messages are no longer grouped - process_...() functions: returned messages are no longer grouped
(e.g. return: array(array('INFO', 'headline', 'text'), array('INFO', 'headline2', 'text2'))) (e.g. return: array(array('INFO', 'headline', 'text'), array('INFO', 'headline2', 'text2')))
10.08.2006 1.0.4 10.08.2006 1.0.4
- added Russian translation - added Russian translation
- Samba 3: added policies for domain objects - Samba 3: added policies for domain objects

View File

@ -1,6 +1,23 @@
Upgrade instructions: Upgrade instructions:
===================== =====================
1.1.x -> 1.2.0:
===============
Users:
No changes.
Developers:
API changes:
- removed get_configDescription() from module interface
1.0.4 -> 1.1.0: 1.0.4 -> 1.1.0:
=============== ===============
@ -19,6 +36,7 @@ API changes:
(e.g. return: array(array('INFO', 'headline', 'text'), array('INFO', 'headline2', 'text2'))) (e.g. return: array(array('INFO', 'headline', 'text'), array('INFO', 'headline2', 'text2')))
1.0.0 -> 1.0.2: 1.0.0 -> 1.0.2:
=============== ===============

File diff suppressed because it is too large Load Diff

View File

@ -340,20 +340,6 @@ class baseModule {
return $return; return $return;
} }
/**
* Returns an array containing descriptions shown on configuration pages.
*
* The returned array has the format array('legend' => '...', descriptions => array('option1' => '...', ...)).
* <br> The "legend" value is used as text for the fieldset, the descriptions are used when the configuration is printed.
*
* @return array configuration elements
*/
function get_configDescriptions() {
$return = array('legend' => 'no description', 'descriptions' => array());
if (isset($this->meta['config_descriptions'])) $return = $this->meta['config_descriptions'];
return $return;
}
/** /**
* Checks input values of module settings. * Checks input values of module settings.
* *

View File

@ -309,32 +309,6 @@ function getConfigOptions($scopes) {
return $return; return $return;
} }
/**
* Returns a hash array (module name => descriptions) containing descriptions shown on configuration pages.
*
* The returned array has the format array('legend' => array('posixAccount' => '...', ...), descriptions => array('option1' => '...', ...)).
* <br> The "legend" value is used as text for the fieldset, the descriptions are used when the configuration is printed.
*
* @return array configuration descriptions
*/
function getConfigDescriptions() {
$return = array('legend' => array(), 'descriptions' => array());
$modules = array();
$types = $_SESSION['config']->get_ActiveTypes();
for ($i = 0; $i < sizeof($types); $i++) {
$modules = array_merge($modules, getAvailableModules($types[$i]));
}
$modules = array_merge(getAvailableModules('user'), getAvailableModules('group'), getAvailableModules('host'));
$modules = array_values(array_unique($modules));
for ($i = 0; $i < sizeof($modules); $i++) {
$m = new $modules[$i]('none');
$desc = $m->get_configDescriptions();
$return['legend'][$modules[$i]] = $desc['legend'];
$return['descriptions'] = array_merge($return['descriptions'], $desc['descriptions']);
}
return $return;
}
/** /**
* Checks if the configuration options are valid * Checks if the configuration options are valid
* *

View File

@ -140,19 +140,19 @@ class posixAccount extends baseModule {
// configuration options // configuration options
$return['config_options']['user'] = array( $return['config_options']['user'] = array(
array( array(
0 => array('kind' => 'text', 'text' => '<b>' . _("Users") . ': &nbsp;</b>' . _('Minimum UID number') . ": "), 0 => array('kind' => 'text', 'text' => '<b>' . _("Users") . ': &nbsp;</b>' . _('Minimum UID number') . "*: "),
1 => array('kind' => 'input', 'name' => 'posixAccount_minUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), 1 => array('kind' => 'input', 'name' => 'posixAccount_minUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
2 => array('kind' => 'text', 'value' => '&nbsp;'), 2 => array('kind' => 'text', 'value' => '&nbsp;'),
3 => array('kind' => 'text', 'text' => _('Maximum UID number') . ": "), 3 => array('kind' => 'text', 'text' => _('Maximum UID number') . "*: "),
4 => array('kind' => 'input', 'name' => 'posixAccount_maxUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), 4 => array('kind' => 'input', 'name' => 'posixAccount_maxUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
5 => array('kind' => 'help', 'value' => 'minMaxUser')) 5 => array('kind' => 'help', 'value' => 'minMaxUser'))
); );
$return['config_options']['host'] = array( $return['config_options']['host'] = array(
array( array(
0 => array('kind' => 'text', 'text' => '<b>' . _("Hosts") . ': &nbsp;</b>' . _('Minimum UID number') . ": "), 0 => array('kind' => 'text', 'text' => '<b>' . _("Hosts") . ': &nbsp;</b>' . _('Minimum UID number') . "*: "),
1 => array('kind' => 'input', 'name' => 'posixAccount_minMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), 1 => array('kind' => 'input', 'name' => 'posixAccount_minMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
2 => array('kind' => 'text', 'value' => '&nbsp;'), 2 => array('kind' => 'text', 'value' => '&nbsp;'),
3 => array('kind' => 'text', 'text' => _('Maximum UID number') . ": "), 3 => array('kind' => 'text', 'text' => _('Maximum UID number') . "*: "),
4 => array('kind' => 'input', 'name' => 'posixAccount_maxMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), 4 => array('kind' => 'input', 'name' => 'posixAccount_maxMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
5 => array('kind' => 'help', 'value' => 'minMaxHost')) 5 => array('kind' => 'help', 'value' => 'minMaxHost'))
); );
@ -166,17 +166,6 @@ class posixAccount extends baseModule {
4 => array('kind' => 'text', 'value' => '&nbsp;'), 4 => array('kind' => 'text', 'value' => '&nbsp;'),
5 => array('kind' => 'help', 'value' => 'pwdHash')) 5 => array('kind' => 'help', 'value' => 'pwdHash'))
); );
// configuration descriptions
$return['config_descriptions'] = array(
'legend' => _("UID ranges for Unix accounts"),
'descriptions' => array(
'posixAccount_minUID' => _("Minimum UID number for Unix accounts (users)"),
'posixAccount_maxUID' => _("Maximum UID number for Unix accounts (users)"),
'posixAccount_minMachine' => _("Minimum UID number for Unix accounts (hosts)"),
'posixAccount_maxMachine' => _("Maximum UID number for Unix accounts (hosts)"),
'posixAccount_pwdHash' => _("Password hash type for Unix accounts"),
)
);
// upload // upload
$return['upload_preDepends'] = array('inetOrgPerson'); $return['upload_preDepends'] = array('inetOrgPerson');
// user specific upload options // user specific upload options

View File

@ -293,22 +293,13 @@ class posixGroup extends baseModule {
// configuration options // configuration options
$return['config_options']['group'] = array( $return['config_options']['group'] = array(
array( array(
0 => array('kind' => 'text', 'text' => '<b>' . _('Minimum GID number') . " *: </b>"), 0 => array('kind' => 'text', 'text' => '<b>' . _("Groups") . ': &nbsp;</b>' . _('Minimum GID number') . " *: "),
1 => array('kind' => 'input', 'name' => 'posixGroup_minGID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), 1 => array('kind' => 'input', 'name' => 'posixGroup_minGID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
2 => array('kind' => 'text', 'value' => '&nbsp;'), 2 => array('kind' => 'text', 'value' => '&nbsp;'),
3 => array('kind' => 'text', 'text' => '<b>' . _('Maximum GID number') . " *: </b>"), 3 => array('kind' => 'text', 'text' => _('Maximum GID number') . " *: "),
4 => array('kind' => 'input', 'name' => 'posixGroup_maxGID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'), 4 => array('kind' => 'input', 'name' => 'posixGroup_maxGID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
5 => array('kind' => 'help', 'value' => 'minMaxGID')) 5 => array('kind' => 'help', 'value' => 'minMaxGID'))
); );
// configuration descriptions
$return['config_descriptions'] = array(
'legend' => _("GID ranges for Unix groups"),
'descriptions' => array(
'posixGroup_minGID' => _("Minimum GID number for Unix groups"),
'posixGroup_maxGID' => _("Maximum GID number for Unix groups"),
'posixAccount_pwdHash' => _("Password hash type for Unix groups"),
)
);
// configuration checks // configuration checks
$return['config_checks']['group']['posixGroup_minGID'] = array ( $return['config_checks']['group']['posixGroup_minGID'] = array (
'type' => 'ext_preg', 'type' => 'ext_preg',

View File

@ -451,8 +451,6 @@ class sambaSamAccount extends baseModule {
'descriptiveOptions' => true), 'descriptiveOptions' => true),
2 => array('kind' => 'help', 'value' => 'timeZone')) 2 => array('kind' => 'help', 'value' => 'timeZone'))
); );
// configuration descriptions
$return['config_descriptions'] = array('legend' => _("Samba 3 settings"), 'descriptions' => array());
return $return; return $return;
} }

View File

@ -194,7 +194,9 @@ echo ("<fieldset><legend><b>" . _("Account types and modules") . "</b></legend>"
// Account modules // Account modules
$types = $conf->get_ActiveTypes(); $types = $conf->get_ActiveTypes();
for ($i = 0; $i < sizeof($types); $i++) { for ($i = 0; $i < sizeof($types); $i++) {
echo "<b>" . getTypeAlias($types[$i]) . ": </b>" . implode(", ", $conf->get_AccountModules($types[$i])) . "<br>\n"; $moduleNames = $conf->get_AccountModules($types[$i]);
for ($m = 0; $m < sizeof($moduleNames); $m++) $moduleNames[$m] = getModuleAlias($moduleNames[$m], $types[$i]);
echo "<b>" . getTypeAlias($types[$i]) . ": </b>" . implode(", ", $moduleNames) . "<br>\n";
} }
echo "<br>\n"; echo "<br>\n";
echo "<input tabindex=\"$tabindex\" type=\"submit\" name=\"edittypes\" value=\"" . _("Edit account types") . "\">&nbsp;&nbsp;"; echo "<input tabindex=\"$tabindex\" type=\"submit\" name=\"edittypes\" value=\"" . _("Edit account types") . "\">&nbsp;&nbsp;";
@ -223,8 +225,6 @@ for ($m = 0; $m < sizeof($types); $m++) {
$options = getConfigOptions($scopes); $options = getConfigOptions($scopes);
// get current setting // get current setting
$old_options = $conf->get_moduleSettings(); $old_options = $conf->get_moduleSettings();
// get module descriptions
$moduleDescriptions = getConfigDescriptions();
// display module boxes // display module boxes
@ -233,7 +233,7 @@ $_SESSION['conf_types'] = array();
for ($i = 0; $i < sizeof($modules); $i++) { for ($i = 0; $i < sizeof($modules); $i++) {
if (sizeof($options[$modules[$i]]) < 1) continue; if (sizeof($options[$modules[$i]]) < 1) continue;
echo "<fieldset>\n"; echo "<fieldset>\n";
echo "<legend><b>" . $moduleDescriptions['legend'][$modules[$i]] . "</b></legend>\n"; echo "<legend><b>" . getModuleAlias($modules[$i], "none") . "</b></legend>\n";
$configTypes = parseHtml($modules[$i], $options[$modules[$i]], $old_options, true, $tabindex, $tabindexLink, 'config'); $configTypes = parseHtml($modules[$i], $options[$modules[$i]], $old_options, true, $tabindex, $tabindexLink, 'config');
$_SESSION['conf_types'] = array_merge($configTypes, $_SESSION['conf_types']); $_SESSION['conf_types'] = array_merge($configTypes, $_SESSION['conf_types']);
echo "</fieldset>\n"; echo "</fieldset>\n";

View File

@ -184,12 +184,12 @@ function config_showAccountModules($scope, $title) {
if (in_array($selected[$i], $available)) { // selected modules must be available if (in_array($selected[$i], $available)) { // selected modules must be available
if (is_base_module($selected[$i], $scope)) { // mark base modules if (is_base_module($selected[$i], $scope)) { // mark base modules
echo "<option value=\"" . $selected[$i] . "\">"; echo "<option value=\"" . $selected[$i] . "\">";
echo $selected[$i] . "(" . getModuleAlias($selected[$i], $scope) . ")(*)"; echo getModuleAlias($selected[$i], $scope) . "(" . $selected[$i] . ")(*)";
echo "</option>\n"; echo "</option>\n";
} }
else { else {
echo "<option value=\"" . $selected[$i] . "\">"; echo "<option value=\"" . $selected[$i] . "\">";
echo $selected[$i] . "(" . getModuleAlias($selected[$i], $scope) . ")"; echo getModuleAlias($selected[$i], $scope) . "(" . $selected[$i] . ")";
echo "</option>\n"; echo "</option>\n";
} }
} }
@ -212,12 +212,12 @@ function config_showAccountModules($scope, $title) {
if (! in_array($available[$i], $selected)) { // display non-selected modules if (! in_array($available[$i], $selected)) { // display non-selected modules
if (is_base_module($available[$i], $scope)) { // mark base modules if (is_base_module($available[$i], $scope)) { // mark base modules
echo "<option value=\"" . $available[$i] . "\">"; echo "<option value=\"" . $available[$i] . "\">";
echo $available[$i] . "(" . getModuleAlias($available[$i], $scope) . ")(*)"; echo getModuleAlias($available[$i], $scope) . "(" . $available[$i] . ")(*)";
echo "</option>\n"; echo "</option>\n";
} }
else { else {
echo "<option value=\"" . $available[$i] . "\">"; echo "<option value=\"" . $available[$i] . "\">";
echo $available[$i] . "(" . getModuleAlias($available[$i], $scope) . ")"; echo getModuleAlias($available[$i], $scope) . "(" . $available[$i] . ")";
echo "</option>\n"; echo "</option>\n";
} }
} }