get_ActiveTypes();
for ($i = 0; $i < sizeof($activeTypes); $i++) {
$selectedModules = $conf->get_AccountModules($activeTypes[$i]);
if (sizeof($selectedModules) == 0) {
// go to module selection
metaRefresh("confmodules.php");
exit;
}
}
// go to final page
if (isset($_POST['saveSettings'])) {
metaRefresh("confsave.php");
exit;
}
// go to modules page
elseif (isset($_POST['editmodules'])) {
metaRefresh("confmodules.php");
exit;
}
// go to general page
elseif (isset($_POST['generalSettingsButton'])) {
metaRefresh("confmain.php");
exit;
}
// go to module settings page
elseif (isset($_POST['moduleSettings'])) {
metaRefresh("moduleSettings.php");
exit;
}
// go to jobs page
elseif (isset($_POST['jobs'])) {
metaRefresh("jobs.php");
exit;
}
}
}
$typeSettings = $conf->get_typeSettings();
$allTypes = LAM\TYPES\getTypes();
$activeTypes = $conf->get_ActiveTypes();
$availableTypes = array();
for ($i = 0; $i < sizeof($allTypes); $i++) {
if (!in_array($allTypes[$i], $activeTypes)) {
$availableTypes[$allTypes[$i]] = LAM\TYPES\getTypeAlias($allTypes[$i]);
}
}
natcasesort($availableTypes);
echo $_SESSION['header'];
echo "
';
echo '';
?>
0) {
$container->addElement(new htmlSubTitle(_("Available account types")), true);
$availableContainer = new htmlTable();
foreach ($availableTypes as $key => $value) {
$availableContainer->addElement(new htmlImage('../../graphics/' . $key . '.png'));
$availableContainer->addElement(new htmlOutputText($value));
$availableContainer->addElement(new htmlSpacer('10px', null));
$availableContainer->addElement(new htmlOutputText(LAM\TYPES\getTypeDescription($key)));
$button = new htmlButton('add_' . $key, 'add.png', true);
$button->setTitle(_("Add"));
$availableContainer->addElement($button, true);
}
$availableContainer->addElement(new htmlSpacer(null, '20px'), true);
$container->addElement($availableContainer, true);
}
$_SESSION['conftypes_optionTypes'] = array();
// show active types
if (sizeof($activeTypes) > 0) {
$container->addElement(new htmlSubTitle(_("Active account types")), true);
$activeContainer = new htmlTable();
for ($i = 0; $i < sizeof($activeTypes); $i++) {
// title
$titleGroup = new htmlGroup();
$titleGroup->colspan = 6;
$titleGroup->addElement(new htmlImage('../../graphics/' . $activeTypes[$i] . '.png'));
$titleText = new htmlOutputText(LAM\TYPES\getTypeAlias($activeTypes[$i]));
$titleText->setIsBold(true);
$titleGroup->addElement($titleText);
$titleGroup->addElement(new htmlSpacer('10px', null));
$titleGroup->addElement(new htmlOutputText(LAM\TYPES\getTypeDescription($activeTypes[$i])));
$activeContainer->addElement($titleGroup);
// delete button
$delButton = new htmlButton('rem_'. $activeTypes[$i], 'del.png', true);
$delButton->alignment = htmlElement::ALIGN_RIGHT;
$delButton->setTitle(_("Remove this account type"));
$activeContainer->addElement($delButton, true); //del.png
$activeContainer->addElement(new htmlSpacer(null, '5px'), true);
// LDAP suffix
$suffixInput = new htmlTableExtendedInputField(_("LDAP suffix"), 'suffix_' . $activeTypes[$i], $typeSettings['suffix_' . $activeTypes[$i]], '202');
$suffixInput->setFieldSize(40);
$activeContainer->addElement($suffixInput);
$activeContainer->addElement(new htmlSpacer('20px', null));
// list attributes
if (isset($typeSettings['attr_' . $activeTypes[$i]])) {
$attributes = $typeSettings['attr_' . $activeTypes[$i]];
}
else {
$attributes = LAM\TYPES\getDefaultListAttributes($activeTypes[$i]);
}
$attrsInput = new htmlTableExtendedInputField(_("List attributes"), 'attr_' . $activeTypes[$i], $attributes, '206');
$attrsInput->setFieldSize(40);
$attrsInput->setFieldMaxLength(1000);
$activeContainer->addElement($attrsInput, true);
// custom label
$customLabel = '';
if (isset($typeSettings['customLabel_' . $activeTypes[$i]])) {
$customLabel = $typeSettings['customLabel_' . $activeTypes[$i]];
}
$customLabelInput = new htmlTableExtendedInputField(_('Custom label'), 'customLabel_' . $activeTypes[$i], $customLabel, '264');
$customLabelInput->setFieldSize(40);
$activeContainer->addElement($customLabelInput);
$activeContainer->addElement(new htmlSpacer('20px', null));
// LDAP filter
$filter = '';
if (isset($typeSettings['filter_' . $activeTypes[$i]])) {
$filter = $typeSettings['filter_' . $activeTypes[$i]];
}
$filterInput = new htmlTableExtendedInputField(_("Additional LDAP filter"), 'filter_' . $activeTypes[$i], $filter, '260');
$filterInput->setFieldSize(40);
$activeContainer->addElement($filterInput, true);
// type options
$typeObj = new $activeTypes[$i];
$typeConfigOptions = $typeObj->get_configOptions();
if (!empty($typeConfigOptions)) {
foreach ($typeConfigOptions as $typeConfigOption) {
$activeContainer->addElement($typeConfigOption, true);
}
// save option types to session
ob_start();
$dummyIndex = 1;
$typeConfigOptionTypes = parseHtml(null, $typeConfigOptions, array(), true, $dummyIndex, 'user');
ob_end_clean();
$_SESSION['conftypes_optionTypes'] = array_merge($_SESSION['conftypes_optionTypes'], $typeConfigOptionTypes);
}
// advanced options
$advancedOptions = new htmlTable();
$advancedOptions->colspan = 30;
// read-only
if (isLAMProVersion() && ($conf->getAccessLevel() == LAMConfig::ACCESS_ALL)) {
$isReadOnly = false;
if (isset($typeSettings['readOnly_' . $activeTypes[$i]])) {
$isReadOnly = $typeSettings['readOnly_' . $activeTypes[$i]];
}
$readOnly = new htmlTableExtendedInputCheckbox('readOnly_' . $activeTypes[$i], $isReadOnly, _('Read-only'), '265');
$readOnly->setElementsToDisable(array('hideNewButton_' . $activeTypes[$i], 'hideDeleteButton_' . $activeTypes[$i]));
$advancedOptions->addElement($readOnly);
$advancedOptions->addElement(new htmlSpacer('20px', null));
}
// hidden type
$hidden = false;
if (isset($typeSettings['hidden_' . $activeTypes[$i]])) {
$hidden = $typeSettings['hidden_' . $activeTypes[$i]];
}
$advancedOptions->addElement(new htmlTableExtendedInputCheckbox('hidden_' . $activeTypes[$i], $hidden, _('Hidden'), '261'));
if (isLAMProVersion() && ($conf->getAccessLevel() == LAMConfig::ACCESS_ALL)) {
$advancedOptions->addElement(new htmlSpacer('20px', null));
// hide button to create new accounts
$hideNewButton = false;
if (isset($typeSettings['hideNewButton_' . $activeTypes[$i]])) {
$hideNewButton = $typeSettings['hideNewButton_' . $activeTypes[$i]];
}
$advancedOptions->addElement(new htmlTableExtendedInputCheckbox('hideNewButton_' . $activeTypes[$i], $hideNewButton, _('No new entries'), '262'));
$advancedOptions->addElement(new htmlSpacer('20px', null));
// hide button to delete accounts
$hideDeleteButton = false;
if (isset($typeSettings['hideDeleteButton_' . $activeTypes[$i]])) {
$hideDeleteButton = $typeSettings['hideDeleteButton_' . $activeTypes[$i]];
}
$advancedOptions->addElement(new htmlTableExtendedInputCheckbox('hideDeleteButton_' . $activeTypes[$i], $hideDeleteButton, _('Disallow delete'), '263'), true);
}
$activeContainer->addElement($advancedOptions, true);
$activeContainer->addElement(new htmlSpacer(null, '40px'), true);
}
$container->addElement($activeContainer, true);
}
$tabindex = 1;
$dynamicTypeOptions = array();
foreach ($_SESSION['conftypes_optionTypes'] as $key => $value) {
if (isset($typeSettings[$key])) {
$dynamicTypeOptions[$key] = explode(LAMConfig::LINE_SEPARATOR, $typeSettings[$key]);
}
}
parseHtml(null, $container, $dynamicTypeOptions, false, $tabindex, 'user');
echo "\n";
echo "
";
$buttonContainer = new htmlTable();
$buttonContainer->addElement(new htmlSpacer(null, '10px'), true);
$saveButton = new htmlButton('saveSettings', _('Save'));
$saveButton->setIconClass('saveButton');
$buttonContainer->addElement($saveButton);
$cancelButton = new htmlButton('cancelSettings', _('Cancel'));
$cancelButton->setIconClass('cancelButton');
$buttonContainer->addElement($cancelButton, true);
$buttonContainer->addElement(new htmlSpacer(null, '10px'), true);
parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user');
echo "\n";
echo "\n";
echo "