parent
9d1f815c6e
commit
88152ba4ed
|
@ -91,6 +91,9 @@ class lamList {
|
||||||
/** configuration options */
|
/** configuration options */
|
||||||
private $configOptions;
|
private $configOptions;
|
||||||
|
|
||||||
|
/** tabindex for GUI elements */
|
||||||
|
protected $tabindex = 1;
|
||||||
|
|
||||||
/** ID for list size config option */
|
/** ID for list size config option */
|
||||||
const LIST_SIZE_OPTION_NAME = "L_SIZE";
|
const LIST_SIZE_OPTION_NAME = "L_SIZE";
|
||||||
|
|
||||||
|
@ -144,6 +147,7 @@ class lamList {
|
||||||
* Prints the HTML code to display the list view.
|
* Prints the HTML code to display the list view.
|
||||||
*/
|
*/
|
||||||
public function showPage() {
|
public function showPage() {
|
||||||
|
$this->tabindex = 1;
|
||||||
// do POST actions
|
// do POST actions
|
||||||
$postFragment = $this->listDoPost();
|
$postFragment = $this->listDoPost();
|
||||||
// get some parameters
|
// get some parameters
|
||||||
|
@ -396,8 +400,7 @@ class lamList {
|
||||||
else {
|
else {
|
||||||
$classes = ' ' . $this->type . 'list-dark';
|
$classes = ' ' . $this->type . 'list-dark';
|
||||||
}
|
}
|
||||||
echo("<tr class=\"$classes\" onMouseOver=\"list_over(this)\"\n" .
|
echo("<tr class=\"$classes\"" .
|
||||||
" onMouseOut=\"list_out(this)\"\n" .
|
|
||||||
" onClick=\"list_click('" . $rowID . "')\"\n" .
|
" onClick=\"list_click('" . $rowID . "')\"\n" .
|
||||||
" onDblClick=\"top.location.href='../account/edit.php?type=" . $this->type . "&DN=" . rawurlencode($info[$i]['dn']) . "'\">\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 . "')\"" .
|
echo " <td align=\"center\"><input class=\"accountBoxUnchecked\" onClick=\"list_click('" . $rowID . "')\"" .
|
||||||
|
@ -659,8 +662,7 @@ class lamList {
|
||||||
$buttonContainer->addElement(new htmlButton('createPDFCancel', _('Cancel')));
|
$buttonContainer->addElement(new htmlButton('createPDFCancel', _('Cancel')));
|
||||||
$container->addElement($buttonContainer);
|
$container->addElement($buttonContainer);
|
||||||
|
|
||||||
$tabindex = 1;
|
parseHtml(null, $container, array(), false, $this->tabindex, $this->type);
|
||||||
parseHtml(null, $container, array(), false, $tabindex, $this->type);
|
|
||||||
|
|
||||||
$this->listPrintFooter();
|
$this->listPrintFooter();
|
||||||
}
|
}
|
||||||
|
@ -670,14 +672,19 @@ class lamList {
|
||||||
*/
|
*/
|
||||||
protected function listShowOUSelection() {
|
protected function listShowOUSelection() {
|
||||||
if (sizeof($this->possibleSuffixes) > 1) {
|
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++) {
|
for ($i = 0; $i < sizeof($this->possibleSuffixes); $i++) {
|
||||||
if ($this->suffix == $this->possibleSuffixes[$i]) {
|
$suffixList[getAbstractDN($this->possibleSuffixes[$i])] = $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");
|
$suffixSelect = new htmlSelect('suffix', $suffixList, array($this->suffix));
|
||||||
}
|
$suffixSelect->setOnchangeEvent("listOUchanged('" . $this->type . "', this)");
|
||||||
echo ("</select> \n");
|
$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 "<form id=\"settingsDialogForm\" action=\"list.php?type=" . $this->type . "&norefresh=true\" method=\"post\">\n";
|
||||||
echo '<table width="100%"><tr><td>';
|
echo '<table width="100%"><tr><td>';
|
||||||
|
|
||||||
$tabindex = 1;
|
|
||||||
$configContainer = new htmlTable();
|
$configContainer = new htmlTable();
|
||||||
for ($i = 0; $i < sizeof($this->configOptions); $i++) {
|
for ($i = 0; $i < sizeof($this->configOptions); $i++) {
|
||||||
$configContainer->mergeTableElements($this->configOptions[$i]->getMetaHTML());
|
$configContainer->mergeTableElements($this->configOptions[$i]->getMetaHTML());
|
||||||
}
|
}
|
||||||
$configContainer->addElement(new htmlHiddenInput('saveConfigOptions', 'ok'));
|
$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 "</td></tr></table>\n";
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
|
@ -899,6 +899,7 @@ class accountContainer {
|
||||||
* @param boolean $stopProcessing true if page should end after displaying the messages
|
* @param boolean $stopProcessing true if page should end after displaying the messages
|
||||||
*/
|
*/
|
||||||
private function printModuleContent($result, $stopProcessing) {
|
private function printModuleContent($result, $stopProcessing) {
|
||||||
|
$tabindex = 1;
|
||||||
$this->printPageHeader();
|
$this->printPageHeader();
|
||||||
$this->printPasswordPromt();
|
$this->printPasswordPromt();
|
||||||
// display error messages
|
// 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";
|
echo "<table class=\"".$this->type."list-bright\" border=0 width=\"100%\" style=\"border-collapse: collapse;\">\n";
|
||||||
if (checkIfWriteAccessIsAllowed()) {
|
if (checkIfWriteAccessIsAllowed()) {
|
||||||
echo "<tr class=\"".$this->type."list-bright\"><td style=\"padding: 15px 15px 0px 15px;\">\n";
|
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 "</td></tr>\n";
|
||||||
}
|
}
|
||||||
echo "<tr class=\"".$this->type."list-bright\" valign=\"top\"><td style=\"padding: 15px;\">";
|
echo "<tr class=\"".$this->type."list-bright\" valign=\"top\"><td style=\"padding: 15px;\">";
|
||||||
|
@ -926,35 +927,28 @@ class accountContainer {
|
||||||
echo $this->titleBarTitle;
|
echo $this->titleBarTitle;
|
||||||
echo '</div></td>';
|
echo '</div></td>';
|
||||||
echo '<td align="right">';
|
echo '<td align="right">';
|
||||||
echo _('Suffix');
|
$group = new htmlGroup();
|
||||||
echo " <select class=\"rightToLeftText\" name=\"accountContainerSuffix\" size=1>\n";
|
// suffix
|
||||||
// loop through all suffixes
|
$group->addElement(new htmlOutputText(_('Suffix')));
|
||||||
$rootsuffix = $_SESSION['config']->get_Suffix($this->type);
|
$suffixList = array();
|
||||||
foreach ($this->getOUs() as $suffix) {
|
foreach ($this->getOUs() as $suffix) {
|
||||||
echo '<option value="' . $suffix . '" ';
|
$suffixList[getAbstractDN($suffix)] = $suffix;
|
||||||
if ($this->dnSuffix == $suffix) {
|
|
||||||
echo 'selected';
|
|
||||||
}
|
|
||||||
echo ">" . getAbstractDN($suffix) . "</option>\n";
|
|
||||||
}
|
}
|
||||||
if (!($this->dnSuffix == '') && !in_array($this->dnSuffix, $this->getOUs())) {
|
if (!($this->dnSuffix == '') && !in_array($this->dnSuffix, $this->getOUs())) {
|
||||||
echo '<option value="' . $this->dnSuffix . '" selected>' . getAbstractDN($this->dnSuffix) . "</option>\n";;
|
$suffixList[getAbstractDN($this->dnSuffix)] = $this->dnSuffix;
|
||||||
}
|
}
|
||||||
echo "</select>\n";
|
$selectedSuffix = array($this->dnSuffix);
|
||||||
echo ' ';
|
$suffixSelect = new htmlSelect('accountContainerSuffix', $suffixList, $selectedSuffix);
|
||||||
|
$suffixSelect->setHasDescriptiveElements(true);
|
||||||
|
$suffixSelect->setRightToLeftTextDirection(true);
|
||||||
|
$group->addElement($suffixSelect);
|
||||||
|
$group->addElement(new htmlSpacer('10px', null));
|
||||||
// RDN selection
|
// RDN selection
|
||||||
|
$group->addElement(new htmlOutputText(_('RDN identifier')));
|
||||||
$rdnlist = getRDNAttributes($this->type);
|
$rdnlist = getRDNAttributes($this->type);
|
||||||
echo _('RDN identifier');
|
$group->addElement(new htmlSelect('accountContainerRDN', $rdnlist, array($this->rdn)));
|
||||||
echo " <select name=\"accountContainerRDN\" size=1>\n";
|
$group->addElement(new htmlHelpLink('301'));
|
||||||
for ($i = 0; $i < sizeof($rdnlist); $i++) {
|
parseHtml(null, $group, array(), true, $tabindex, $this->type);
|
||||||
echo "<option ";
|
|
||||||
if ($this->rdn === $rdnlist[$i]) {
|
|
||||||
echo 'selected';
|
|
||||||
}
|
|
||||||
echo ">" . $rdnlist[$i] . "</option>\n";
|
|
||||||
}
|
|
||||||
echo "</select>\n";
|
|
||||||
printHelpLink(getHelp('', '301'), '301');
|
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
echo '</tr></table>';
|
echo '</tr></table>';
|
||||||
if ($this->titleBarSubtitle != null) {
|
if ($this->titleBarSubtitle != null) {
|
||||||
|
@ -1129,64 +1123,51 @@ class accountContainer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints common controls like the save button and the ou selection.
|
* Prints common controls like the save button and the ou selection.
|
||||||
|
*
|
||||||
|
* @param int $tabindex tabindex for GUI elements
|
||||||
*/
|
*/
|
||||||
private function printCommonControls() {
|
private function printCommonControls(&$tabindex) {
|
||||||
echo "<table style=\"border-width:0px;\" width=\"100%\"><tr>";
|
$table = new htmlTable('100%');
|
||||||
echo "<td align=\"left\">";
|
$leftButtonGroup = new htmlGroup();
|
||||||
|
$leftButtonGroup->alignment = htmlElement::ALIGN_LEFT;
|
||||||
// save button
|
// 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
|
// reset button
|
||||||
if ($this->dn_orig!='') {
|
$resetButton = new htmlButton('accountContainerReset', _('Reset changes'));
|
||||||
echo "<button id=\"modResetButton\" name=\"accountContainerReset\">" . _('Reset changes') . "</button>\n";
|
$resetButton->setIconClass('undoButton');
|
||||||
}
|
$leftButtonGroup->addElement($resetButton);
|
||||||
|
// set password button
|
||||||
if ($this->showSetPasswordButton()) {
|
if ($this->showSetPasswordButton()) {
|
||||||
echo " ";
|
$leftButtonGroup->addElement(new htmlSpacer('15px', null));
|
||||||
echo '<button type="button" onclick="passwordShowChangeDialog(\'' . _('Set password') . '\', \'' . _('Ok') . '\', \''
|
$passwordButton = new htmlButton('accountContainerPassword', _('Set password'));
|
||||||
. _('Cancel') . '\', \'' . _('Set random password') . '\', \'../misc/ajax.php?function=passwordChange\');" id="modPasswordButton">' . _('Set password') . "</button> \n";
|
$passwordButton->setIconClass('passwordButton');
|
||||||
|
$passwordButton->setOnClick('passwordShowChangeDialog(\'' . _('Set password') . '\', \'' . _('Ok') . '\', \''
|
||||||
|
. _('Cancel') . '\', \'' . _('Set random password') . '\', \'../misc/ajax.php?function=passwordChange\');');
|
||||||
|
$leftButtonGroup->addElement($passwordButton);
|
||||||
}
|
}
|
||||||
echo "</td>";
|
$table->addElement($leftButtonGroup);
|
||||||
echo "<td align=\"right\">";
|
|
||||||
|
$rightGroup = new htmlGroup();
|
||||||
|
$rightGroup->alignment = htmlElement::ALIGN_RIGHT;
|
||||||
// profile selection
|
// profile selection
|
||||||
$profilelist = getAccountProfiles($this->type);
|
$profilelist = getAccountProfiles($this->type);
|
||||||
if (sizeof($profilelist) > 0) {
|
if (sizeof($profilelist) > 0) {
|
||||||
sort($profilelist);
|
$rightGroup->addElement(new htmlSelect('accountContainerSelectLoadProfile', $profilelist, array($this->lastLoadedProfile)));
|
||||||
echo "<select name=\"accountContainerSelectLoadProfile\" size=1>\n";
|
$profileButton = new htmlButton('accountContainerLoadProfile', _('Load profile'));
|
||||||
for ($i = 0; $i < sizeof($profilelist); $i++) {
|
$profileButton->setIconClass('loadProfileButton');
|
||||||
$selected = '';
|
$rightGroup->addElement($profileButton);
|
||||||
if ($profilelist[$i] === $this->lastLoadedProfile) {
|
$rightGroup->addElement(new htmlSpacer('1px', null));
|
||||||
$selected = 'selected';
|
$rightGroup->addElement(new htmlHelpLink('401'));
|
||||||
}
|
}
|
||||||
echo "<option $selected>" . $profilelist[$i] . "</option>\n";
|
$table->addElement($rightGroup);
|
||||||
}
|
|
||||||
echo "</select> \n";
|
parseHtml(null, $table, array(), false, $tabindex, $this->type);
|
||||||
echo "<button id=\"modLoadProfileButton\" name=\"accountContainerLoadProfile\">" . _('Load profile') . "</button> \n";
|
|
||||||
printHelpLink(getHelp('', '401'), '401');
|
|
||||||
}
|
|
||||||
echo "</td>";
|
|
||||||
echo "</tr></table>";
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function() {
|
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;
|
var maxHeight = 0;
|
||||||
jQuery('.lamEqualHeightTabContent').each(function() {
|
jQuery('.lamEqualHeightTabContent').each(function() {
|
||||||
if (jQuery(this).height() > maxHeight) {
|
if (jQuery(this).height() > maxHeight) {
|
||||||
|
@ -1945,7 +1926,6 @@ class accountContainer {
|
||||||
if ($this->cachedOUs != null) {
|
if ($this->cachedOUs != null) {
|
||||||
return $this->cachedOUs;
|
return $this->cachedOUs;
|
||||||
}
|
}
|
||||||
$rootsuffix = $_SESSION['config']->get_Suffix($this->type);
|
|
||||||
$typeObj = new $this->type();
|
$typeObj = new $this->type();
|
||||||
$this->cachedOUs = $typeObj->getSuffixList();
|
$this->cachedOUs = $typeObj->getSuffixList();
|
||||||
return $this->cachedOUs;
|
return $this->cachedOUs;
|
||||||
|
|
|
@ -116,12 +116,6 @@ table.lamHeader {
|
||||||
height: 35px;
|
height: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.highlight {
|
|
||||||
border-color: red;
|
|
||||||
border-style: dotted;
|
|
||||||
border-width: 1px 0px 1px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rightToLeftText {
|
.rightToLeftText {
|
||||||
text-align: right;
|
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.
|
* 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/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2003 - 2006 Michael Duergner
|
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
|
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
|
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";
|
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">
|
<table border=0 width="100%" class="lamHeader ui-corner-all">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" height="30">
|
<td align="left" height="30">
|
||||||
|
@ -209,7 +224,7 @@ function display_LoginPage($config_object) {
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br><br><br><br>
|
<br><br>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// check extensions
|
// check extensions
|
||||||
|
@ -253,155 +268,138 @@ function display_LoginPage($config_object) {
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
<br><br>
|
||||||
<div style="position:relative; z-index:5;">
|
<div style="position:relative; z-index:5;">
|
||||||
<table width="650" align="center" border="2" rules="none" bgcolor="white">
|
<table width="650" align="center" border="2" rules="none" bgcolor="white">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="border-style:none" width="70" rowspan="2">
|
<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>
|
||||||
<td style="border-style:none" width="580">
|
<td style="border-style:none" width="580px">
|
||||||
<form action="login.php" method="post">
|
<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
|
<?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) {
|
if ($config_object->getLoginMethod() == LAMConfig::LOGIN_LIST) {
|
||||||
echo '<select name="username" size="1" tabindex="1">';
|
|
||||||
$admins = $config_object->get_Admins();
|
$admins = $config_object->get_Admins();
|
||||||
|
$adminList = array();
|
||||||
for($i = 0; $i < count($admins); $i++) {
|
for($i = 0; $i < count($admins); $i++) {
|
||||||
$text = explode(",", $admins[$i]);
|
$text = explode(",", $admins[$i]);
|
||||||
$text = explode("=", $text[0]);
|
$text = explode("=", $text[0]);
|
||||||
echo '<option value="' . $admins[$i] . '">' . $text[1] . '</option>';
|
$adminList[$text[1]] = $admins[$i];
|
||||||
}
|
}
|
||||||
echo '</select>';
|
$userSelect = new htmlSelect('username', $adminList);
|
||||||
|
$userSelect->setHasDescriptiveElements(true);
|
||||||
|
$userSelect->alignment = htmlElement::ALIGN_LEFT;
|
||||||
|
$table->addElement($userSelect);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($config_object->getHttpAuthentication() == 'true') {
|
if ($config_object->getHttpAuthentication() == 'true') {
|
||||||
echo htmlspecialchars($_SERVER['PHP_AUTH_USER']);
|
$httpAuth = new htmlOutputText($_SERVER['PHP_AUTH_USER']);
|
||||||
|
$httpAuth->alignment = htmlElement::ALIGN_LEFT;
|
||||||
|
$table->addElement($httpAuth);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo '<input type="text" name="username" tabindex="1">';
|
$userInput = new htmlInputField('username');
|
||||||
|
$userInput->alignment = htmlElement::ALIGN_LEFT;
|
||||||
|
$table->addElement($userInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
$table->addNewLine();
|
||||||
</td>
|
// password
|
||||||
</tr>
|
$passwordLabel = new htmlOutputText(_("Password"));
|
||||||
<tr>
|
$passwordLabel->alignment = htmlElement::ALIGN_RIGHT;
|
||||||
<td style="border-style:none" height="35" align="right"><b>
|
$table->addElement($passwordLabel);
|
||||||
<?php
|
$table->addElement($gap);
|
||||||
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')) {
|
if (($config_object->getLoginMethod() == LAMConfig::LOGIN_SEARCH) && ($config_object->getHttpAuthentication() == 'true')) {
|
||||||
echo '**********';
|
$passwordInputFake = new htmlOutputText('**********');
|
||||||
|
$passwordInputFake->alignment = htmlElement::ALIGN_LEFT;
|
||||||
|
$table->addElement($passwordInputFake);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo '<input type="password" name="passwd" tabindex="2">';
|
$passwordInput = new htmlInputField('passwd');
|
||||||
|
$passwordInput->alignment = htmlElement::ALIGN_LEFT;
|
||||||
|
$passwordInput->setIsPassword(true);
|
||||||
|
$passwordInput->setFieldSize('20px');
|
||||||
|
$table->addElement($passwordInput);
|
||||||
}
|
}
|
||||||
?>
|
$table->addNewLine();
|
||||||
</td>
|
// language
|
||||||
</tr>
|
$languageLabel = new htmlOutputText(_("Language"));
|
||||||
<tr>
|
$languageLabel->alignment = htmlElement::ALIGN_RIGHT;
|
||||||
<td style="border-style:none" align="right"><b>
|
$table->addElement($languageLabel);
|
||||||
<?php
|
$table->addElement($gap);
|
||||||
echo _("Language");
|
$languageList = array();
|
||||||
?>
|
$defaultLanguage = array();
|
||||||
</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++) {
|
for($i = 0; $i < count($languages); $i++) {
|
||||||
|
$languageList[$languages[$i]["descr"]] = $languages[$i]["link"] . ":" . $languages[$i]["descr"];
|
||||||
if($languages[$i]["default"] == "YES") {
|
if($languages[$i]["default"] == "YES") {
|
||||||
?>
|
$defaultLanguage[] = $languages[$i]["link"] . ":" . $languages[$i]["descr"];
|
||||||
<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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
$languageSelect = new htmlSelect('language', $languageList, $defaultLanguage);
|
||||||
</select>
|
$languageSelect->setHasDescriptiveElements(true);
|
||||||
</td>
|
$languageSelect->alignment = htmlElement::ALIGN_LEFT;
|
||||||
</tr>
|
$table->addElement($languageSelect, true);
|
||||||
<tr>
|
// login button
|
||||||
<td style="border-style:none" height="50" colspan="2" align="center">
|
$table->addElement(new htmlSpacer(null, '35px'));
|
||||||
<input name="checklogin" type="hidden" value="checklogin">
|
$table->addElement(new htmlHiddenInput('checklogin', 'checklogin'));
|
||||||
<button type="submit" id="loginButton" class="smallPadding" name="submit" tabindex="4"><?php echo _("Login"); ?></button>
|
$loginButton = new htmlButton('submit', _("Login"));
|
||||||
</td>
|
$loginButton->alignment = htmlElement::ALIGN_LEFT;
|
||||||
</tr>
|
$table->addElement($loginButton, true);
|
||||||
<tr>
|
// error message
|
||||||
<td style="border-style:none" colspan="2" align="center">
|
|
||||||
<?php
|
|
||||||
if($error_message != "") {
|
if($error_message != "") {
|
||||||
echo "<font color=\"red\"><b>" . $error_message . "</b></font>";
|
$message = new htmlStatusMessage('ERROR', $error_message);
|
||||||
|
$message->colspan = 3;
|
||||||
|
$table->addElement($message, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tabindex = 1;
|
||||||
|
parseHtml(null, $table, array(), false, $tabindex, 'user');
|
||||||
?>
|
?>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="border-style:none">
|
<td align="left" style="border-style:none">
|
||||||
<form action="login.php" method="post">
|
<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
|
<?php
|
||||||
echo _("LDAP server");
|
$table = new htmlTable('580px');
|
||||||
?></b>
|
$line = new htmlHorizontalLine();
|
||||||
</td>
|
$line->colspan = 2;
|
||||||
<td width="100%" height="30">
|
$table->addElement($line, true);
|
||||||
<?php echo $config_object->get_ServerURL(); ?>
|
$subTable = new htmlTable();
|
||||||
</td>
|
$subTable->alignment = htmlElement::ALIGN_LEFT;
|
||||||
</tr>
|
// LDAP server
|
||||||
<tr>
|
$serverLabel = new htmlOutputText(_("LDAP server"));
|
||||||
<td height="30" style="white-space: nowrap">
|
$serverLabel->alignment = htmlElement::ALIGN_RIGHT;
|
||||||
<b>
|
$subTable->addElement($serverLabel);
|
||||||
<?php
|
$subTable->addElement($gap);
|
||||||
echo _("Server profile");
|
$serverName = new htmlOutputText($config_object->get_ServerURL());
|
||||||
?></b>
|
$serverName->alignment = htmlElement::ALIGN_LEFT;
|
||||||
</td>
|
$subTable->addElement($serverName, true);
|
||||||
<td height="30">
|
// server profile
|
||||||
<select name="profile" size="1" tabindex="5" onchange="loginProfileChanged(this)">
|
$profileLabel = new htmlOutputText(_("Server profile"));
|
||||||
<?php
|
$profileLabel->alignment = htmlElement::ALIGN_RIGHT;
|
||||||
for($i=0;$i<count($profiles);$i++) {
|
$subTable->addElement($profileLabel);
|
||||||
$selected = '';
|
$subTable->addElement($gap);
|
||||||
if ($profiles[$i] == $_SESSION['config']->getName()) {
|
$profileSelect = new htmlSelect('profile', $profiles, array($_SESSION['config']->getName()));
|
||||||
$selected = ' selected';
|
$profileSelect->alignment = htmlElement::ALIGN_LEFT;
|
||||||
}
|
$profileSelect->setOnchangeEvent('loginProfileChanged(this)');
|
||||||
echo '<option value="' . $profiles[$i] . '"' . $selected . '>' . $profiles[$i] . '</option>';
|
$subTable->addElement($profileSelect, true);
|
||||||
}
|
$subTable->addElement(new htmlSpacer(null, '10px'));
|
||||||
|
$table->addElement($subTable);
|
||||||
|
|
||||||
|
parseHtml(null, $table, array(), true, $tabindex, 'user');
|
||||||
?>
|
?>
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td height="10" colspan="2"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue