diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index c98f93da..f9e4c084 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -90,6 +90,9 @@ class lamList { /** configuration options */ private $configOptions; + + /** tabindex for GUI elements */ + protected $tabindex = 1; /** ID for list size config option */ const LIST_SIZE_OPTION_NAME = "L_SIZE"; @@ -144,6 +147,7 @@ class lamList { * Prints the HTML code to display the list view. */ public function showPage() { + $this->tabindex = 1; // do POST actions $postFragment = $this->listDoPost(); // get some parameters @@ -396,8 +400,7 @@ class lamList { else { $classes = ' ' . $this->type . 'list-dark'; } - echo("type . "&DN=" . rawurlencode($info[$i]['dn']) . "'\">\n"); echo " addElement(new htmlButton('createPDFCancel', _('Cancel'))); $container->addElement($buttonContainer); - $tabindex = 1; - parseHtml(null, $container, array(), false, $tabindex, $this->type); + parseHtml(null, $container, array(), false, $this->tabindex, $this->type); $this->listPrintFooter(); } @@ -670,14 +672,19 @@ class lamList { */ protected function listShowOUSelection() { if (sizeof($this->possibleSuffixes) > 1) { - echo ("   \n"); + $suffixSelect = new htmlSelect('suffix', $suffixList, array($this->suffix)); + $suffixSelect->setOnchangeEvent("listOUchanged('" . $this->type . "', this)"); + $suffixSelect->setRightToLeftTextDirection(true); + $suffixSelect->setSortElements(false); + $suffixSelect->setHasDescriptiveElements(true); + $group->addElement($suffixSelect); + $group->addElement(new htmlSpacer('5px', null)); + parseHtml(null, $group, array(), true, $this->tabindex, $this->type); } } @@ -921,14 +928,13 @@ class lamList { echo "
type . "&norefresh=true\" method=\"post\">\n"; echo '
'; - $tabindex = 1; $configContainer = new htmlTable(); for ($i = 0; $i < sizeof($this->configOptions); $i++) { $configContainer->mergeTableElements($this->configOptions[$i]->getMetaHTML()); } $configContainer->addElement(new htmlHiddenInput('saveConfigOptions', 'ok')); - parseHtml('', $configContainer, array(), false, $tabindex, $this->type); + parseHtml('', $configContainer, array(), false, $this->tabindex, $this->type); echo "
\n"; echo '
'; diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index bacd850e..adb3b942 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -899,6 +899,7 @@ class accountContainer { * @param boolean $stopProcessing true if page should end after displaying the messages */ private function printModuleContent($result, $stopProcessing) { + $tabindex = 1; $this->printPageHeader(); $this->printPasswordPromt(); // display error messages @@ -915,7 +916,7 @@ class accountContainer { echo "type."list-bright\" border=0 width=\"100%\" style=\"border-collapse: collapse;\">\n"; if (checkIfWriteAccessIsAllowed()) { echo "type."list-bright\">\n"; } echo "type."list-bright\" valign=\"top\">'; echo ''; echo '
\n"; - $this->printCommonControls(); + $this->printCommonControls($tabindex); echo "
"; @@ -926,35 +927,28 @@ class accountContainer { echo $this->titleBarTitle; echo ''; - echo _('Suffix'); - echo " \n"; - echo '    '; + $group = new htmlGroup(); + // suffix + $group->addElement(new htmlOutputText(_('Suffix'))); + $suffixList = array(); + foreach ($this->getOUs() as $suffix) { + $suffixList[getAbstractDN($suffix)] = $suffix; + } + if (!($this->dnSuffix == '') && !in_array($this->dnSuffix, $this->getOUs())) { + $suffixList[getAbstractDN($this->dnSuffix)] = $this->dnSuffix; + } + $selectedSuffix = array($this->dnSuffix); + $suffixSelect = new htmlSelect('accountContainerSuffix', $suffixList, $selectedSuffix); + $suffixSelect->setHasDescriptiveElements(true); + $suffixSelect->setRightToLeftTextDirection(true); + $group->addElement($suffixSelect); + $group->addElement(new htmlSpacer('10px', null)); // RDN selection + $group->addElement(new htmlOutputText(_('RDN identifier'))); $rdnlist = getRDNAttributes($this->type); - echo _('RDN identifier'); - echo " \n"; - printHelpLink(getHelp('', '301'), '301'); + $group->addElement(new htmlSelect('accountContainerRDN', $rdnlist, array($this->rdn))); + $group->addElement(new htmlHelpLink('301')); + parseHtml(null, $group, array(), true, $tabindex, $this->type); echo '
'; if ($this->titleBarSubtitle != null) { @@ -1129,64 +1123,51 @@ class accountContainer { /** * Prints common controls like the save button and the ou selection. + * + * @param int $tabindex tabindex for GUI elements */ - private function printCommonControls() { - echo ""; - echo ""; - echo ""; - echo "
"; + private function printCommonControls(&$tabindex) { + $table = new htmlTable('100%'); + $leftButtonGroup = new htmlGroup(); + $leftButtonGroup->alignment = htmlElement::ALIGN_LEFT; // save button - echo " \n"; + $saveButton = new htmlButton('accountContainerSaveAccount', _('Save')); + $saveButton->setIconClass('saveButton'); + $leftButtonGroup->addElement($saveButton); + $leftButtonGroup->addElement(new htmlSpacer('1px', null)); // reset button - if ($this->dn_orig!='') { - echo "\n"; - } + $resetButton = new htmlButton('accountContainerReset', _('Reset changes')); + $resetButton->setIconClass('undoButton'); + $leftButtonGroup->addElement($resetButton); + // set password button if ($this->showSetPasswordButton()) { - echo "    "; - echo ' \n"; + $leftButtonGroup->addElement(new htmlSpacer('15px', null)); + $passwordButton = new htmlButton('accountContainerPassword', _('Set password')); + $passwordButton->setIconClass('passwordButton'); + $passwordButton->setOnClick('passwordShowChangeDialog(\'' . _('Set password') . '\', \'' . _('Ok') . '\', \'' + . _('Cancel') . '\', \'' . _('Set random password') . '\', \'../misc/ajax.php?function=passwordChange\');'); + $leftButtonGroup->addElement($passwordButton); } - echo ""; + $table->addElement($leftButtonGroup); + + $rightGroup = new htmlGroup(); + $rightGroup->alignment = htmlElement::ALIGN_RIGHT; // profile selection $profilelist = getAccountProfiles($this->type); if (sizeof($profilelist) > 0) { - sort($profilelist); - echo " \n"; - echo " \n"; - printHelpLink(getHelp('', '401'), '401'); + $rightGroup->addElement(new htmlSelect('accountContainerSelectLoadProfile', $profilelist, array($this->lastLoadedProfile))); + $profileButton = new htmlButton('accountContainerLoadProfile', _('Load profile')); + $profileButton->setIconClass('loadProfileButton'); + $rightGroup->addElement($profileButton); + $rightGroup->addElement(new htmlSpacer('1px', null)); + $rightGroup->addElement(new htmlHelpLink('401')); } - echo "
"; + $table->addElement($rightGroup); + + parseHtml(null, $table, array(), false, $tabindex, $this->type); ?> \n"; ?> + +
@@ -209,7 +224,7 @@ function display_LoginPage($config_object) {
-



+

"; } ?> +

- -
- Logo + Logo +
- - - - - - - - - - - - - - - - - - - - - - -
-
- -    - getLoginMethod() == LAMConfig::LOGIN_LIST) { - echo ''; - } - else { - if ($config_object->getHttpAuthentication() == 'true') { - echo htmlspecialchars($_SERVER['PHP_AUTH_USER']); - } - else { - echo ''; - } - } - ?> -
- -    - getLoginMethod() == LAMConfig::LOGIN_SEARCH) && ($config_object->getHttpAuthentication() == 'true')) { - echo '**********'; - } - else { - echo ''; - } - ?> -
- -    - -
- - -
- " . $error_message . ""; - } - ?> -
+ colspan = 3; + $table->addElement($spacer, true); + // user name + $userLabel = new htmlOutputText(_("User name")); + $userLabel->alignment = htmlElement::ALIGN_RIGHT; + $table->addElement($userLabel); + $gap = new htmlSpacer('5px', '30px'); + $table->addElement($gap); + if ($config_object->getLoginMethod() == LAMConfig::LOGIN_LIST) { + $admins = $config_object->get_Admins(); + $adminList = array(); + for($i = 0; $i < count($admins); $i++) { + $text = explode(",", $admins[$i]); + $text = explode("=", $text[0]); + $adminList[$text[1]] = $admins[$i]; + } + $userSelect = new htmlSelect('username', $adminList); + $userSelect->setHasDescriptiveElements(true); + $userSelect->alignment = htmlElement::ALIGN_LEFT; + $table->addElement($userSelect); + } + else { + if ($config_object->getHttpAuthentication() == 'true') { + $httpAuth = new htmlOutputText($_SERVER['PHP_AUTH_USER']); + $httpAuth->alignment = htmlElement::ALIGN_LEFT; + $table->addElement($httpAuth); + } + else { + $userInput = new htmlInputField('username'); + $userInput->alignment = htmlElement::ALIGN_LEFT; + $table->addElement($userInput); + } + } + $table->addNewLine(); + // password + $passwordLabel = new htmlOutputText(_("Password")); + $passwordLabel->alignment = htmlElement::ALIGN_RIGHT; + $table->addElement($passwordLabel); + $table->addElement($gap); + if (($config_object->getLoginMethod() == LAMConfig::LOGIN_SEARCH) && ($config_object->getHttpAuthentication() == 'true')) { + $passwordInputFake = new htmlOutputText('**********'); + $passwordInputFake->alignment = htmlElement::ALIGN_LEFT; + $table->addElement($passwordInputFake); + } + else { + $passwordInput = new htmlInputField('passwd'); + $passwordInput->alignment = htmlElement::ALIGN_LEFT; + $passwordInput->setIsPassword(true); + $passwordInput->setFieldSize('20px'); + $table->addElement($passwordInput); + } + $table->addNewLine(); + // language + $languageLabel = new htmlOutputText(_("Language")); + $languageLabel->alignment = htmlElement::ALIGN_RIGHT; + $table->addElement($languageLabel); + $table->addElement($gap); + $languageList = array(); + $defaultLanguage = array(); + for($i = 0; $i < count($languages); $i++) { + $languageList[$languages[$i]["descr"]] = $languages[$i]["link"] . ":" . $languages[$i]["descr"]; + if($languages[$i]["default"] == "YES") { + $defaultLanguage[] = $languages[$i]["link"] . ":" . $languages[$i]["descr"]; + } + } + $languageSelect = new htmlSelect('language', $languageList, $defaultLanguage); + $languageSelect->setHasDescriptiveElements(true); + $languageSelect->alignment = htmlElement::ALIGN_LEFT; + $table->addElement($languageSelect, true); + // login button + $table->addElement(new htmlSpacer(null, '35px')); + $table->addElement(new htmlHiddenInput('checklogin', 'checklogin')); + $loginButton = new htmlButton('submit', _("Login")); + $loginButton->alignment = htmlElement::ALIGN_LEFT; + $table->addElement($loginButton, true); + // error message + if($error_message != "") { + $message = new htmlStatusMessage('ERROR', $error_message); + $message->colspan = 3; + $table->addElement($message, true); + } + + $tabindex = 1; + parseHtml(null, $table, array(), false, $tabindex, 'user'); + ?>
+
- - - - - - - - - - - - - - - -
-
-
- -    - - get_ServerURL(); ?> -
- -    - - -
+ colspan = 2; + $table->addElement($line, true); + $subTable = new htmlTable(); + $subTable->alignment = htmlElement::ALIGN_LEFT; + // LDAP server + $serverLabel = new htmlOutputText(_("LDAP server")); + $serverLabel->alignment = htmlElement::ALIGN_RIGHT; + $subTable->addElement($serverLabel); + $subTable->addElement($gap); + $serverName = new htmlOutputText($config_object->get_ServerURL()); + $serverName->alignment = htmlElement::ALIGN_LEFT; + $subTable->addElement($serverName, true); + // server profile + $profileLabel = new htmlOutputText(_("Server profile")); + $profileLabel->alignment = htmlElement::ALIGN_RIGHT; + $subTable->addElement($profileLabel); + $subTable->addElement($gap); + $profileSelect = new htmlSelect('profile', $profiles, array($_SESSION['config']->getName())); + $profileSelect->alignment = htmlElement::ALIGN_LEFT; + $profileSelect->setOnchangeEvent('loginProfileChanged(this)'); + $subTable->addElement($profileSelect, true); + $subTable->addElement(new htmlSpacer(null, '10px')); + $table->addElement($subTable); + + parseHtml(null, $table, array(), true, $tabindex, 'user'); + ?>