';
echo '';
?>
get_ServerURL(), '201');
$urlInput->setRequired(true);
$serverSettingsContent->addElement($urlInput, true);
// use TLS
$tlsOptions = array(_("yes") => 'yes', _("no") => 'no');
$tlsSelect = new htmlTableExtendedSelect('useTLS', $tlsOptions, array($conf->getUseTLS()), _("Activate TLS"), '201');
$tlsSelect->setHasDescriptiveElements(true);
$serverSettingsContent->addElement($tlsSelect, true);
// tree suffix
$serverSettingsContent->addElement(new htmlTableExtendedInputField(_("Tree suffix"), 'sufftree', $conf->get_Suffix('tree'), '203'), true);
// LDAP search limit
$searchLimitOptions = array(
'-' => 0, 100 => 100, 500 => 500,
1000 => 1000, 5000 => 5000, 10000 => 10000,
50000 => 50000, 100000 => 100000);
$limitSelect = new htmlTableExtendedSelect('searchLimit', $searchLimitOptions, array($conf->get_searchLimit()), _("LDAP search limit"), '222');
$limitSelect->setHasDescriptiveElements(true);
$serverSettingsContent->addElement($limitSelect, true);
// access level is only visible in Pro version
if (isLAMProVersion()) {
$accessOptions = array(
_('Write access') => LAMConfig::ACCESS_ALL,
_('Change passwords') => LAMConfig::ACCESS_PASSWORD_CHANGE,
_('Read-only') => LAMConfig::ACCESS_READ_ONLY
);
$accessSelect = new htmlTableExtendedSelect('accessLevel', $accessOptions, array($conf->getAccessLevel()), _("Access level"), '215');
$accessSelect->setHasDescriptiveElements(true);
$serverSettingsContent->addElement($accessSelect, true);
}
// advanced options
$advancedOptionsContent = new htmlTable();
// referrals
$followReferrals = ($conf->getFollowReferrals() === 'true');
$advancedOptionsContent->addElement(new htmlTableExtendedInputCheckbox('followReferrals', $followReferrals , _('Follow referrals'), '205'), true);
// paged results
$pagedResults = ($conf->getPagedResults() === 'true');
$advancedOptionsContent->addElement(new htmlTableExtendedInputCheckbox('pagedResults', $pagedResults , _('Paged results'), '266'), true);
// build advanced options box
$advancedOptions = new htmlAccordion('advancedOptions_server', array(_('Advanced options') => $advancedOptionsContent), false);
$advancedOptions->colspan = 15;
$serverSettingsContent->addElement($advancedOptions, true);
$serverSettings = new htmlFieldset($serverSettingsContent, _("Server settings"), '../../graphics/profiles.png');
$container->addElement($serverSettings, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
// language
$languageSettingsContent = new htmlTable();
// read available languages
$possibleLanguages = getLanguages();
$defaultLanguage = array('en_GB.utf8');
if(!empty($possibleLanguages)) {
foreach ($possibleLanguages as $lang) {
$languages[$lang->description] = $lang->code;
if (strpos($conf->get_defaultLanguage(), $lang->code) === 0) {
$defaultLanguage = array($lang->code);
}
}
$languageSelect = new htmlTableExtendedSelect('lang', $languages, $defaultLanguage, _("Default language"), '209');
$languageSelect->setHasDescriptiveElements(true);
$languageSettingsContent->addElement($languageSelect, true);
}
else {
$languageSettingsContent->addElement(new htmlStatusMessage('ERROR', "Unable to load available languages. Setting English as default language."));
}
$languageSettings = new htmlFieldset($languageSettingsContent, _("Language settings"), '../../graphics/language.png');
$container->addElement($languageSettings, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
// lamdaemon settings
$lamdaemonSettingsContent = new htmlTable();
$lamdaemonSettingsContent->addElement(new htmlTableExtendedInputField(_("Server list"), 'scriptservers', $conf->get_scriptServers(), '218'), true);
$lamdaemonSettingsContent->addElement(new htmlTableExtendedInputField(_("Path to external script"), 'scriptpath', $conf->get_scriptPath(), '210'), true);
$lamdaemonSettingsContent->addElement(new htmlSpacer(null, '5px'), true);
$lamdaemonSettingsContent->addElement(new htmlOutputText(_("Rights for the home directory")));
$chmod = $conf->get_scriptRights();
$rightsTable = new htmlTable();
$rightsTable->addElement(new htmlOutputText(''));
$rightsTable->addElement(new htmlOutputText(_("Read")));
$rightsTable->addElement(new htmlOutputText(_("Write")));
$rightsTable->addElement(new htmlOutputText(_("Execute")), true);
$rightsTable->addElement(new htmlOutputText(_("Owner")));
$rightsTable->addElement(new htmlInputCheckbox('chmod_owr', checkChmod("read","owner", $chmod)));
$rightsTable->addElement(new htmlInputCheckbox('chmod_oww', checkChmod("write","owner", $chmod)));
$rightsTable->addElement(new htmlInputCheckbox('chmod_owe', checkChmod("execute","owner", $chmod)), true);
$rightsTable->addElement(new htmlOutputText(_("Group")));
$rightsTable->addElement(new htmlInputCheckbox('chmod_grr', checkChmod("read","group", $chmod)));
$rightsTable->addElement(new htmlInputCheckbox('chmod_grw', checkChmod("write","group", $chmod)));
$rightsTable->addElement(new htmlInputCheckbox('chmod_gre', checkChmod("execute","group", $chmod)), true);
$rightsTable->addElement(new htmlOutputText(_("Other")));
$rightsTable->addElement(new htmlInputCheckbox('chmod_otr', checkChmod("read","other", $chmod)));
$rightsTable->addElement(new htmlInputCheckbox('chmod_otw', checkChmod("write","other", $chmod)));
$rightsTable->addElement(new htmlInputCheckbox('chmod_ote', checkChmod("execute","other", $chmod)), true);
$lamdaemonSettingsContent->addElement($rightsTable);
$lamdaemonSettingsContent->addElement(new htmlHelpLink('219'));
$lamdaemonSettings = new htmlFieldset($lamdaemonSettingsContent, _("Lamdaemon settings"), '../../graphics/lamdaemon.png');
$container->addElement($lamdaemonSettings, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
// LAM Pro settings
if (isLAMProVersion()) {
$pwdMailContent = new htmlTable();
$pwdMailFrom = new htmlTableExtendedInputField(_('From address'), 'pwdResetMail_from', $conf->getLamProMailFrom(), '550');
$pwdMailContent->addElement($pwdMailFrom, true);
$pwdMailReplyTo = new htmlTableExtendedInputField(_('Reply-to address'), 'pwdResetMail_replyTo', $conf->getLamProMailReplyTo(), '554');
$pwdMailContent->addElement($pwdMailReplyTo, true);
$pwdMailSubject = new htmlTableExtendedInputField(_('Subject'), 'pwdResetMail_subject', $conf->getLamProMailSubject(), '551');
$pwdMailContent->addElement($pwdMailSubject, true);
$pwdMailIsHTML = false;
if ($conf->getLamProMailIsHTML() == 'true') {
$pwdMailIsHTML = true;
}
$pwdMailContent->addElement(new htmlTableExtendedInputCheckbox('pwdResetMail_isHTML',$pwdMailIsHTML , _('HTML format'), '553'), true);
$pwdMailAllowAlternate = true;
if ($conf->getLamProMailAllowAlternateAddress() == 'false') {
$pwdMailAllowAlternate = false;
}
$pwdMailContent->addElement(new htmlTableExtendedInputCheckbox('pwdResetMail_allowAlternate',$pwdMailAllowAlternate , _('Allow alternate address'), '555'), true);
$pwdMailBody = new htmlTableExtendedInputTextarea('pwdResetMail_body', $conf->getLamProMailText(), 50, 4, _('Text'), '552');
$pwdMailContent->addElement($pwdMailBody, true);
$pwdMailFieldset = new htmlFieldset($pwdMailContent, _("Password mail settings"), '../../graphics/mailBig.png');
$container->addElement($pwdMailFieldset, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
}
// tool settings
$toolSettings = $conf->getToolSettings();
$toolSettingsContent = new htmlTable();
$toolsLabel = new htmlOutputText(_('Hidden tools'));
$toolsLabel->colspan = 5;
$toolSettingsContent->addElement($toolsLabel, true);
$tools = getTools();
for ($i = 0; $i < sizeof($tools); $i++) {
$tool = new $tools[$i]();
if ($tool->isHideable()) {
$tools[$i] = $tool;
}
else {
unset($tools[$i]);
$i--;
$tools = array_values($tools);
}
}
for ($r = 0; $r < (sizeof($tools) / 4); $r++) {
for ($c = 0; $c < 4; $c++) {
if (!isset($tools[($r * 4) + $c])) {
break;
}
$tool = $tools[($r * 4) + $c];
$toolClass = get_class($tool);
$selected = false;
if (isset($toolSettings['tool_hide_' . $toolClass]) && ($toolSettings['tool_hide_' . $toolClass] === 'true')) {
$selected = true;
}
$toolSettingsContent->addElement(new htmlTableExtendedInputCheckbox('tool_hide_' . $toolClass, $selected, $tool->getName(), null, false));
$toolSettingsContent->addElement(new htmlSpacer('10px', null));
}
$toolSettingsContent->addNewLine();
}
$toolSettingsFieldset = new htmlFieldset($toolSettingsContent, _("Tool settings"), '../../graphics/bigTools.png');
$container->addElement($toolSettingsFieldset, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
// security setings
$securitySettingsContent = new htmlTable();
// login method
$loginOptions = array(
_('Fixed list') => LAMConfig::LOGIN_LIST,
_('LDAP search') => LAMConfig::LOGIN_SEARCH
);
$loginSelect = new htmlTableExtendedSelect('loginMethod', $loginOptions, array($conf->getLoginMethod()), _("Login method"), '220');
$loginSelect->setHasDescriptiveElements(true);
$loginSelect->setTableRowsToHide(array(
LAMConfig::LOGIN_LIST => array('loginSearchSuffix', 'loginSearchFilter', 'loginSearchDN', 'loginSearchPassword', 'httpAuthentication'),
LAMConfig::LOGIN_SEARCH => array('admins')
));
$loginSelect->setTableRowsToShow(array(
LAMConfig::LOGIN_LIST => array('admins'),
LAMConfig::LOGIN_SEARCH => array('loginSearchSuffix', 'loginSearchFilter', 'loginSearchDN', 'loginSearchPassword', 'httpAuthentication')
));
$securitySettingsContent->addElement($loginSelect, true);
// admin list
$adminText = implode("\n", explode(";", $conf->get_Adminstring()));
$adminTextInput = new htmlTableExtendedInputTextarea('admins', $adminText, '50', '3', _("List of valid users"), '207');
$adminTextInput->setRequired(true);
$securitySettingsContent->addElement($adminTextInput, true);
// search suffix
$searchSuffixInput = new htmlTableExtendedInputField(_("LDAP suffix"), 'loginSearchSuffix', $conf->getLoginSearchSuffix(), '221');
$searchSuffixInput->setRequired(true);
$securitySettingsContent->addElement($searchSuffixInput, true);
// login search filter
$searchFilterInput = new htmlTableExtendedInputField(_("LDAP filter"), 'loginSearchFilter', $conf->getLoginSearchFilter(), '221');
$searchFilterInput->setRequired(true);
$securitySettingsContent->addElement($searchFilterInput, true);
// login search bind user
$securitySettingsContent->addElement(new htmlTableExtendedInputField(_("Bind user"), 'loginSearchDN', $conf->getLoginSearchDN(), '224'), true);
// login search bind password
$searchPasswordInput = new htmlTableExtendedInputField(_("Bind password"), 'loginSearchPassword', $conf->getLoginSearchPassword(), '224');
$searchPasswordInput->setIsPassword(true);
$securitySettingsContent->addElement($searchPasswordInput, true);
// HTTP authentication
$securitySettingsContent->addElement(new htmlTableExtendedInputCheckbox('httpAuthentication', ($conf->getHttpAuthentication() == 'true'), _('HTTP authentication'), '223', true), true);
$securitySettingsContent->addElement(new htmlSpacer(null, '10px'), true);
// new password
$password1 = new htmlTableExtendedInputField(_("New password"), 'passwd1', null, '212');
$password1->setIsPassword(true);
$password2 = new htmlTableExtendedInputField(_("Reenter password"), 'passwd2');
$password2->setIsPassword(true);
$password2->setSameValueFieldID('passwd1');
$securitySettingsContent->addElement($password1, true);
$securitySettingsContent->addElement($password2, true);
$securitySettings = new htmlFieldset($securitySettingsContent, _("Security settings"), '../../graphics/security.png');
$container->addElement($securitySettings, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
parseHtml(null, $container, array(), false, $tabindex, 'user');
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 "