parent
9d1f815c6e
commit
88152ba4ed
|
@ -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("<tr class=\"$classes\" onMouseOver=\"list_over(this)\"\n" .
|
||||
" onMouseOut=\"list_out(this)\"\n" .
|
||||
echo("<tr class=\"$classes\"" .
|
||||
" onClick=\"list_click('" . $rowID . "')\"\n" .
|
||||
" onDblClick=\"top.location.href='../account/edit.php?type=" . $this->type . "&DN=" . rawurlencode($info[$i]['dn']) . "'\">\n");
|
||||
echo " <td align=\"center\"><input class=\"accountBoxUnchecked\" onClick=\"list_click('" . $rowID . "')\"" .
|
||||
|
@ -659,8 +662,7 @@ class lamList {
|
|||
$buttonContainer->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 ("<select title=\"" . _("Suffix") . "\" class=\"" . $this->type . " rightToLeftText\" size=1 name=\"suffix\" onchange=\"listOUchanged('" . $this->type . "', this)\">\n");
|
||||
$group = new htmlGroup();
|
||||
$suffixList = array();
|
||||
for ($i = 0; $i < sizeof($this->possibleSuffixes); $i++) {
|
||||
if ($this->suffix == $this->possibleSuffixes[$i]) {
|
||||
echo ("<option value=\"" . $this->possibleSuffixes[$i] . "\" selected>" . getAbstractDN($this->possibleSuffixes[$i]) . "</option>\n");
|
||||
}
|
||||
else echo("<option value=\"" . $this->possibleSuffixes[$i] . "\">" . getAbstractDN($this->possibleSuffixes[$i]) . "</option>\n");
|
||||
$suffixList[getAbstractDN($this->possibleSuffixes[$i])] = $this->possibleSuffixes[$i];
|
||||
}
|
||||
echo ("</select> \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 "<form id=\"settingsDialogForm\" action=\"list.php?type=" . $this->type . "&norefresh=true\" method=\"post\">\n";
|
||||
echo '<table width="100%"><tr><td>';
|
||||
|
||||
$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 "</td></tr></table>\n";
|
||||
echo '</form>';
|
||||
|
|
|
@ -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 "<table class=\"".$this->type."list-bright\" border=0 width=\"100%\" style=\"border-collapse: collapse;\">\n";
|
||||
if (checkIfWriteAccessIsAllowed()) {
|
||||
echo "<tr class=\"".$this->type."list-bright\"><td style=\"padding: 15px 15px 0px 15px;\">\n";
|
||||
$this->printCommonControls();
|
||||
$this->printCommonControls($tabindex);
|
||||
echo "</td></tr>\n";
|
||||
}
|
||||
echo "<tr class=\"".$this->type."list-bright\" valign=\"top\"><td style=\"padding: 15px;\">";
|
||||
|
@ -926,35 +927,28 @@ class accountContainer {
|
|||
echo $this->titleBarTitle;
|
||||
echo '</div></td>';
|
||||
echo '<td align="right">';
|
||||
echo _('Suffix');
|
||||
echo " <select class=\"rightToLeftText\" name=\"accountContainerSuffix\" size=1>\n";
|
||||
// loop through all suffixes
|
||||
$rootsuffix = $_SESSION['config']->get_Suffix($this->type);
|
||||
foreach ($this->getOUs() as $suffix) {
|
||||
echo '<option value="' . $suffix . '" ';
|
||||
if ($this->dnSuffix == $suffix) {
|
||||
echo 'selected';
|
||||
}
|
||||
echo ">" . getAbstractDN($suffix) . "</option>\n";
|
||||
}
|
||||
if (!($this->dnSuffix == '') && !in_array($this->dnSuffix, $this->getOUs())) {
|
||||
echo '<option value="' . $this->dnSuffix . '" selected>' . getAbstractDN($this->dnSuffix) . "</option>\n";;
|
||||
}
|
||||
echo "</select>\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 " <select name=\"accountContainerRDN\" size=1>\n";
|
||||
for ($i = 0; $i < sizeof($rdnlist); $i++) {
|
||||
echo "<option ";
|
||||
if ($this->rdn === $rdnlist[$i]) {
|
||||
echo 'selected';
|
||||
}
|
||||
echo ">" . $rdnlist[$i] . "</option>\n";
|
||||
}
|
||||
echo "</select>\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 '</td>';
|
||||
echo '</tr></table>';
|
||||
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 "<table style=\"border-width:0px;\" width=\"100%\"><tr>";
|
||||
echo "<td align=\"left\">";
|
||||
private function printCommonControls(&$tabindex) {
|
||||
$table = new htmlTable('100%');
|
||||
$leftButtonGroup = new htmlGroup();
|
||||
$leftButtonGroup->alignment = htmlElement::ALIGN_LEFT;
|
||||
// save button
|
||||
echo "<button id=\"modSaveButton\" name=\"accountContainerSaveAccount\">" . _('Save') . "</button> \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 "<button id=\"modResetButton\" name=\"accountContainerReset\">" . _('Reset changes') . "</button>\n";
|
||||
}
|
||||
$resetButton = new htmlButton('accountContainerReset', _('Reset changes'));
|
||||
$resetButton->setIconClass('undoButton');
|
||||
$leftButtonGroup->addElement($resetButton);
|
||||
// set password button
|
||||
if ($this->showSetPasswordButton()) {
|
||||
echo " ";
|
||||
echo '<button type="button" onclick="passwordShowChangeDialog(\'' . _('Set password') . '\', \'' . _('Ok') . '\', \''
|
||||
. _('Cancel') . '\', \'' . _('Set random password') . '\', \'../misc/ajax.php?function=passwordChange\');" id="modPasswordButton">' . _('Set password') . "</button> \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 "</td>";
|
||||
echo "<td align=\"right\">";
|
||||
$table->addElement($leftButtonGroup);
|
||||
|
||||
$rightGroup = new htmlGroup();
|
||||
$rightGroup->alignment = htmlElement::ALIGN_RIGHT;
|
||||
// profile selection
|
||||
$profilelist = getAccountProfiles($this->type);
|
||||
if (sizeof($profilelist) > 0) {
|
||||
sort($profilelist);
|
||||
echo "<select name=\"accountContainerSelectLoadProfile\" size=1>\n";
|
||||
for ($i = 0; $i < sizeof($profilelist); $i++) {
|
||||
$selected = '';
|
||||
if ($profilelist[$i] === $this->lastLoadedProfile) {
|
||||
$selected = 'selected';
|
||||
}
|
||||
echo "<option $selected>" . $profilelist[$i] . "</option>\n";
|
||||
}
|
||||
echo "</select> \n";
|
||||
echo "<button id=\"modLoadProfileButton\" name=\"accountContainerLoadProfile\">" . _('Load profile') . "</button> \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 "</td>";
|
||||
echo "</tr></table>";
|
||||
$table->addElement($rightGroup);
|
||||
|
||||
parseHtml(null, $table, array(), false, $tabindex, $this->type);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('#modSaveButton').button({
|
||||
icons: {
|
||||
primary: 'saveButton'
|
||||
}
|
||||
});
|
||||
jQuery('#modResetButton').button({
|
||||
icons: {
|
||||
primary: 'undoButton'
|
||||
}
|
||||
});
|
||||
jQuery('#modPasswordButton').button({
|
||||
icons: {
|
||||
primary: 'passwordButton'
|
||||
}
|
||||
});
|
||||
jQuery('#modLoadProfileButton').button({
|
||||
icons: {
|
||||
primary: 'loadProfileButton'
|
||||
}
|
||||
});
|
||||
var maxHeight = 0;
|
||||
jQuery('.lamEqualHeightTabContent').each(function() {
|
||||
if (jQuery(this).height() > maxHeight) {
|
||||
|
@ -1945,7 +1926,6 @@ class accountContainer {
|
|||
if ($this->cachedOUs != null) {
|
||||
return $this->cachedOUs;
|
||||
}
|
||||
$rootsuffix = $_SESSION['config']->get_Suffix($this->type);
|
||||
$typeObj = new $this->type();
|
||||
$this->cachedOUs = $typeObj->getSuffixList();
|
||||
return $this->cachedOUs;
|
||||
|
|
|
@ -116,12 +116,6 @@ table.lamHeader {
|
|||
height: 35px;
|
||||
}
|
||||
|
||||
tr.highlight {
|
||||
border-color: red;
|
||||
border-style: dotted;
|
||||
border-width: 1px 0px 1px 0px;
|
||||
}
|
||||
|
||||
.rightToLeftText {
|
||||
text-align: right;
|
||||
}
|
||||
|
|
|
@ -21,24 +21,6 @@ $Id$
|
|||
|
||||
*/
|
||||
|
||||
/**
|
||||
* Used to highlight the row under the mouse cursor.
|
||||
*
|
||||
* @param list table row
|
||||
*/
|
||||
function list_over(list) {
|
||||
jQuery(list).addClass('highlight');
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to unhighlight a row if the mouse cursor leaves it.
|
||||
*
|
||||
* @param list table row
|
||||
*/
|
||||
function list_out(list) {
|
||||
jQuery(list).removeClass('highlight');
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when user clicks on a table row. This toggles the checkbox in the row.
|
||||
*
|
||||
|
|
|
@ -4,7 +4,7 @@ $Id$
|
|||
|
||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||
Copyright (C) 2003 - 2006 Michael Duergner
|
||||
2005 - 2011 Roland Gruber
|
||||
2005 - 2012 Roland Gruber
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -198,6 +198,21 @@ function display_LoginPage($config_object) {
|
|||
echo "</script>\n";
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
var equalWidthElements = new Array('#username', '#password', '#language');
|
||||
var maxWidth = 0;
|
||||
for (var i = 0; i < equalWidthElements.length; ++i) {
|
||||
if (jQuery(equalWidthElements[i]).width() > maxWidth) {
|
||||
maxWidth = jQuery(equalWidthElements[i]).width();
|
||||
};
|
||||
}
|
||||
for (var i = 0; i < equalWidthElements.length; ++i) {
|
||||
jQuery(equalWidthElements[i]).css({'width': maxWidth});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<table border=0 width="100%" class="lamHeader ui-corner-all">
|
||||
<tr>
|
||||
<td align="left" height="30">
|
||||
|
@ -209,7 +224,7 @@ function display_LoginPage($config_object) {
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<br><br><br><br>
|
||||
<br><br>
|
||||
|
||||
<?php
|
||||
// check extensions
|
||||
|
@ -253,155 +268,138 @@ function display_LoginPage($config_object) {
|
|||
echo "<br>";
|
||||
}
|
||||
?>
|
||||
<br><br>
|
||||
<div style="position:relative; z-index:5;">
|
||||
<table width="650" align="center" border="2" rules="none" bgcolor="white">
|
||||
<tr>
|
||||
<td style="border-style:none" width="70" rowspan="2">
|
||||
<img src="../graphics/lam.png" alt="Logo">
|
||||
<img src="../graphics/lam.png" alt="Logo" style="margin-top: 5px; margin-bottom: 5px;">
|
||||
</td>
|
||||
<td style="border-style:none" width="580">
|
||||
<td style="border-style:none" width="580px">
|
||||
<form action="login.php" method="post">
|
||||
<table width="580">
|
||||
<tr>
|
||||
<td style="border-style:none" height="30" colspan="2" align="center">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-style:none" height="35" align="right"><b>
|
||||
<?php
|
||||
echo _("User name");
|
||||
?>
|
||||
</b> </td>
|
||||
<td style="border-style:none" height="35" align="left">
|
||||
<?php
|
||||
if ($config_object->getLoginMethod() == LAMConfig::LOGIN_LIST) {
|
||||
echo '<select name="username" size="1" tabindex="1">';
|
||||
$admins = $config_object->get_Admins();
|
||||
for($i = 0; $i < count($admins); $i++) {
|
||||
$text = explode(",", $admins[$i]);
|
||||
$text = explode("=", $text[0]);
|
||||
echo '<option value="' . $admins[$i] . '">' . $text[1] . '</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
}
|
||||
else {
|
||||
if ($config_object->getHttpAuthentication() == 'true') {
|
||||
echo htmlspecialchars($_SERVER['PHP_AUTH_USER']);
|
||||
}
|
||||
else {
|
||||
echo '<input type="text" name="username" tabindex="1">';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-style:none" height="35" align="right"><b>
|
||||
<?php
|
||||
echo _("Password");
|
||||
?>
|
||||
</b> </td>
|
||||
<td style="border-style:none" height="35" align="left">
|
||||
<?php
|
||||
if (($config_object->getLoginMethod() == LAMConfig::LOGIN_SEARCH) && ($config_object->getHttpAuthentication() == 'true')) {
|
||||
echo '**********';
|
||||
}
|
||||
else {
|
||||
echo '<input type="password" name="passwd" tabindex="2">';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-style:none" align="right"><b>
|
||||
<?php
|
||||
echo _("Language");
|
||||
?>
|
||||
</b> </td>
|
||||
<td style="border-style:none" height="35" align="left">
|
||||
<select name="language" size="1" tabindex="3">
|
||||
<?php
|
||||
for($i = 0; $i < count($languages); $i++) {
|
||||
if($languages[$i]["default"] == "YES") {
|
||||
?>
|
||||
<option selected value="<?php echo $languages[$i]["link"] . ":" . $languages[$i]["descr"]; ?>"><?php echo $languages[$i]["descr"]; ?></option>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $languages[$i]["link"] . ":" . $languages[$i]["descr"]; ?>"><?php echo $languages[$i]["descr"]; ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-style:none" height="50" colspan="2" align="center">
|
||||
<input name="checklogin" type="hidden" value="checklogin">
|
||||
<button type="submit" id="loginButton" class="smallPadding" name="submit" tabindex="4"><?php echo _("Login"); ?></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-style:none" colspan="2" align="center">
|
||||
<?php
|
||||
if($error_message != "") {
|
||||
echo "<font color=\"red\"><b>" . $error_message . "</b></font>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
$table = new htmlTable('580px');
|
||||
$spacer = new htmlSpacer(null, '30px');
|
||||
$spacer->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');
|
||||
?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-style:none">
|
||||
<td align="left" style="border-style:none">
|
||||
<form action="login.php" method="post">
|
||||
<table width="580">
|
||||
<tr>
|
||||
<td height="30" colspan=2>
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" style="white-space: nowrap">
|
||||
<b>
|
||||
<?php
|
||||
echo _("LDAP server");
|
||||
?></b>
|
||||
</td>
|
||||
<td width="100%" height="30">
|
||||
<?php echo $config_object->get_ServerURL(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="30" style="white-space: nowrap">
|
||||
<b>
|
||||
<?php
|
||||
echo _("Server profile");
|
||||
?></b>
|
||||
</td>
|
||||
<td height="30">
|
||||
<select name="profile" size="1" tabindex="5" onchange="loginProfileChanged(this)">
|
||||
<?php
|
||||
for($i=0;$i<count($profiles);$i++) {
|
||||
$selected = '';
|
||||
if ($profiles[$i] == $_SESSION['config']->getName()) {
|
||||
$selected = ' selected';
|
||||
}
|
||||
echo '<option value="' . $profiles[$i] . '"' . $selected . '>' . $profiles[$i] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="10" colspan="2"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
$table = new htmlTable('580px');
|
||||
$line = new htmlHorizontalLine();
|
||||
$line->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');
|
||||
?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue