|
|
@ -1,4 +1,6 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
use LAM\TYPES\ConfiguredType;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
$Id$
|
|
|
|
$Id$
|
|
|
|
|
|
|
|
|
|
|
@ -103,7 +105,7 @@ class lamList {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param string $type account type
|
|
|
|
* @param LAM\TYPES\ConfiguredType $type account type
|
|
|
|
* @return lamList list object
|
|
|
|
* @return lamList list object
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function __construct($type) {
|
|
|
|
public function __construct($type) {
|
|
|
@ -122,8 +124,8 @@ class lamList {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private function listReadOptionsFromCookie() {
|
|
|
|
private function listReadOptionsFromCookie() {
|
|
|
|
if (sizeof($this->configOptions) > 0) {
|
|
|
|
if (sizeof($this->configOptions) > 0) {
|
|
|
|
if (isset($_COOKIE["ListOptions_" . $this->type])) {
|
|
|
|
if (isset($_COOKIE["ListOptions_" . $this->type->getId()])) {
|
|
|
|
$cookieValue = $_COOKIE["ListOptions_" . $this->type];
|
|
|
|
$cookieValue = $_COOKIE["ListOptions_" . $this->type->getId()];
|
|
|
|
$valueParts = explode(";", $cookieValue);
|
|
|
|
$valueParts = explode(";", $cookieValue);
|
|
|
|
$values = array();
|
|
|
|
$values = array();
|
|
|
|
for ($i = 0; $i < sizeof($valueParts); $i++) {
|
|
|
|
for ($i = 0; $i < sizeof($valueParts); $i++) {
|
|
|
@ -172,7 +174,7 @@ class lamList {
|
|
|
|
// show form
|
|
|
|
// show form
|
|
|
|
echo "<div class=\"ui-tabs-panel ui-widget-content ui-corner-bottom\">";
|
|
|
|
echo "<div class=\"ui-tabs-panel ui-widget-content ui-corner-bottom\">";
|
|
|
|
echo "<div id=\"listTabContentArea\">\n";
|
|
|
|
echo "<div id=\"listTabContentArea\">\n";
|
|
|
|
echo ("<form action=\"list.php?type=" . $this->type . "&norefresh=true\" method=\"post\">\n");
|
|
|
|
echo ("<form action=\"list.php?type=" . $this->type->getId() . "&norefresh=true\" method=\"post\">\n");
|
|
|
|
// draw account list if accounts were found
|
|
|
|
// draw account list if accounts were found
|
|
|
|
if (sizeof($this->entries) > 0) {
|
|
|
|
if (sizeof($this->entries) > 0) {
|
|
|
|
// buttons
|
|
|
|
// buttons
|
|
|
@ -289,12 +291,12 @@ class lamList {
|
|
|
|
if ($count > $this->maxPageEntries) {
|
|
|
|
if ($count > $this->maxPageEntries) {
|
|
|
|
echo("<td class=\"activepage\" align=\"right\">");
|
|
|
|
echo("<td class=\"activepage\" align=\"right\">");
|
|
|
|
if ($this->page != 1) {
|
|
|
|
if ($this->page != 1) {
|
|
|
|
echo("<a title=\"" . _('Jump to first page') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=1" .
|
|
|
|
echo("<a title=\"" . _('Jump to first page') . "\" href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=1" .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
|
|
|
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-first.png\"></a>\n");
|
|
|
|
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-first.png\"></a>\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($this->page > 11) {
|
|
|
|
if ($this->page > 11) {
|
|
|
|
echo("<a title=\"" . _('Jump 10 pages backward') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . ($this->page - 10) .
|
|
|
|
echo("<a title=\"" . _('Jump 10 pages backward') . "\" href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . ($this->page - 10) .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
|
|
|
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-previous.png\"></a>\n");
|
|
|
|
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-previous.png\"></a>\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -307,24 +309,24 @@ class lamList {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($i == $this->page - 1) {
|
|
|
|
if ($i == $this->page - 1) {
|
|
|
|
$url = "list.php?type=" . $this->type . "&norefresh=true" .
|
|
|
|
$url = "list.php?type=" . $this->type->getId() . "&norefresh=true" .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter;
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter;
|
|
|
|
echo '<input type="number" class="listPageInput" id="listNavPage" name="listNavPage"'
|
|
|
|
echo '<input type="number" class="listPageInput" id="listNavPage" name="listNavPage"'
|
|
|
|
. ' value="' . ($i + 1) . '" min="1" max="' . $pageCount . '"'
|
|
|
|
. ' value="' . ($i + 1) . '" min="1" max="' . $pageCount . '"'
|
|
|
|
. ' onkeypress="listPageNumberKeyPress(\'' . $url . '\', event);">';
|
|
|
|
. ' onkeypress="listPageNumberKeyPress(\'' . $url . '\', event);">';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
echo " <a href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . ($i + 1) .
|
|
|
|
echo " <a href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . ($i + 1) .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" . ($i + 1) . "</a>\n";
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" . ($i + 1) . "</a>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($this->page < ($pageCount - 10)) {
|
|
|
|
if ($this->page < ($pageCount - 10)) {
|
|
|
|
echo("<a title=\"" . _('Jump 10 pages forward') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . ($this->page + 10) .
|
|
|
|
echo("<a title=\"" . _('Jump 10 pages forward') . "\" href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . ($this->page + 10) .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
|
|
|
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-next.png\"></a>\n");
|
|
|
|
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-next.png\"></a>\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($this->page < $pageCount) {
|
|
|
|
if ($this->page < $pageCount) {
|
|
|
|
echo("<a title=\"" . _('Jump to last page') . "\" href=\"list.php?type=" . $this->type . "&norefresh=true&page=" . $pageCount .
|
|
|
|
echo("<a title=\"" . _('Jump to last page') . "\" href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . $pageCount .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
|
|
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
|
|
|
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-last.png\"></a>\n");
|
|
|
|
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-last.png\"></a>\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -352,8 +354,8 @@ class lamList {
|
|
|
|
protected function listPrintTableHeader() {
|
|
|
|
protected function listPrintTableHeader() {
|
|
|
|
$filter = $this->getFilterAsTextForURL();
|
|
|
|
$filter = $this->getFilterAsTextForURL();
|
|
|
|
// print table header
|
|
|
|
// print table header
|
|
|
|
echo "<table id=\"accountTable\" frame=\"box\" rules=\"none\" class=\"" . $this->type . "-border collapse accountlist ui-corner-all\" width=\"100%\"><thead>\n";
|
|
|
|
echo "<table id=\"accountTable\" frame=\"box\" rules=\"none\" class=\"" . $this->type->getScope() . "-border collapse accountlist ui-corner-all\" width=\"100%\"><thead>\n";
|
|
|
|
echo "<tr class=\"" . $this->type . "-dark\">\n";
|
|
|
|
echo "<tr class=\"" . $this->type->getScope() . "-dark\">\n";
|
|
|
|
echo "<th width=22 height=34><a href=\"#\" onClick=\"list_switchAccountSelection();\"><img height=16 width=16 src=\"../../graphics/selectDown.png\" alt=\"select all\"></a></th>\n";
|
|
|
|
echo "<th width=22 height=34><a href=\"#\" onClick=\"list_switchAccountSelection();\"><img height=16 width=16 src=\"../../graphics/selectDown.png\" alt=\"select all\"></a></th>\n";
|
|
|
|
echo "<td> <a href=\"#\" onClick=\"list_switchAccountSelection();\">" .
|
|
|
|
echo "<td> <a href=\"#\" onClick=\"list_switchAccountSelection();\">" .
|
|
|
|
"<font color=\"black\"><small>" . _("Select all") . "</small></font></a></td>\n";
|
|
|
|
"<font color=\"black\"><small>" . _("Select all") . "</small></font></a></td>\n";
|
|
|
@ -364,17 +366,17 @@ class lamList {
|
|
|
|
if ($this->sortDirection < 0) {
|
|
|
|
if ($this->sortDirection < 0) {
|
|
|
|
$sortImage = "sort_desc.png";
|
|
|
|
$sortImage = "sort_desc.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "<th align=\"left\"><a href=\"list.php?type=" . $this->type . "&".
|
|
|
|
echo "<th align=\"left\"><a href=\"list.php?type=" . $this->type->getId() . "&".
|
|
|
|
"sort=" . strtolower($this->attrArray[$k]) . $filter . "&norefresh=y" . "\">" . $this->descArray[$k] .
|
|
|
|
"sort=" . strtolower($this->attrArray[$k]) . $filter . "&norefresh=y" . "\">" . $this->descArray[$k] .
|
|
|
|
" <img height=16 width=16 style=\"vertical-align: middle;\" src=\"../../graphics/$sortImage\" alt=\"sort direction\"></a></th>\n";
|
|
|
|
" <img height=16 width=16 style=\"vertical-align: middle;\" src=\"../../graphics/$sortImage\" alt=\"sort direction\"></a></th>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else echo "<th align=\"left\"><a href=\"list.php?type=" . $this->type . "&".
|
|
|
|
else echo "<th align=\"left\"><a href=\"list.php?type=" . $this->type->getId() . "&".
|
|
|
|
"sort=" . strtolower($this->attrArray[$k]) . $filter . "&norefresh=y" . "\">" . $this->descArray[$k] . "</a></th>\n";
|
|
|
|
"sort=" . strtolower($this->attrArray[$k]) . $filter . "&norefresh=y" . "\">" . $this->descArray[$k] . "</a></th>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</tr>\n";
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
|
|
// print filter row
|
|
|
|
// print filter row
|
|
|
|
echo "<tr align=\"center\" class=\"" . $this->type . "-bright\">\n";
|
|
|
|
echo "<tr align=\"center\" class=\"" . $this->type->getScope() . "-bright\">\n";
|
|
|
|
echo "<td width=22 height=34>";
|
|
|
|
echo "<td width=22 height=34>";
|
|
|
|
printHelpLink(getHelp('', '250'), '250');
|
|
|
|
printHelpLink(getHelp('', '250'), '250');
|
|
|
|
echo "</td>\n";
|
|
|
|
echo "</td>\n";
|
|
|
@ -389,7 +391,7 @@ class lamList {
|
|
|
|
$clearFilterButton->setTitle(_('Clear filter'));
|
|
|
|
$clearFilterButton->setTitle(_('Clear filter'));
|
|
|
|
$filterGroup->addElement($clearFilterButton);
|
|
|
|
$filterGroup->addElement($clearFilterButton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parseHtml(null, $filterGroup, array(), false, $this->tabindex, $this->type);
|
|
|
|
parseHtml(null, $filterGroup, array(), false, $this->tabindex, $this->type->getScope());
|
|
|
|
echo "</td>\n";
|
|
|
|
echo "</td>\n";
|
|
|
|
// print input boxes for filters
|
|
|
|
// print input boxes for filters
|
|
|
|
for ($k = 0; $k < sizeof($this->descArray); $k++) {
|
|
|
|
for ($k = 0; $k < sizeof($this->descArray); $k++) {
|
|
|
@ -416,10 +418,10 @@ class lamList {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$filterInput = new htmlInputField('filter' . strtolower($attrName), $value);
|
|
|
|
$filterInput = new htmlInputField('filter' . strtolower($attrName), $value);
|
|
|
|
$filterInput->setCSSClasses(array($this->type . '-dark'));
|
|
|
|
$filterInput->setCSSClasses(array($this->type->getScope() . '-dark'));
|
|
|
|
$filterInput->setFieldSize('15');
|
|
|
|
$filterInput->setFieldSize('15');
|
|
|
|
$filterInput->setOnKeyPress("SubmitForm('apply_filter', event);");
|
|
|
|
$filterInput->setOnKeyPress("SubmitForm('apply_filter', event);");
|
|
|
|
parseHtml(null, $filterInput, array(), false, $this->tabindex, $this->type);
|
|
|
|
parseHtml(null, $filterInput, array(), false, $this->tabindex, $this->type->getScope());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -459,14 +461,14 @@ class lamList {
|
|
|
|
$index = $sortMapping[$i];
|
|
|
|
$index = $sortMapping[$i];
|
|
|
|
$rowID = base64_encode($info[$index]['dn']);
|
|
|
|
$rowID = base64_encode($info[$index]['dn']);
|
|
|
|
if ((($i - $table_begin) % 2) == 1) {
|
|
|
|
if ((($i - $table_begin) % 2) == 1) {
|
|
|
|
$classes = ' ' . $this->type . '-bright';
|
|
|
|
$classes = ' ' . $this->type->getScope() . '-bright';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
$classes = ' ' . $this->type . '-dark';
|
|
|
|
$classes = ' ' . $this->type->getScope() . '-dark';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo("<tr class=\"$classes\"" .
|
|
|
|
echo("<tr class=\"$classes\"" .
|
|
|
|
" onClick=\"list_click('" . $rowID . "')\"\n" .
|
|
|
|
" onClick=\"list_click('" . $rowID . "')\"\n" .
|
|
|
|
" onDblClick=\"top.location.href='../account/edit.php?type=" . $this->type . "&DN=" . rawurlencode($info[$index]['dn']) . "'\">\n");
|
|
|
|
" onDblClick=\"top.location.href='../account/edit.php?type=" . $this->type->getId() . "&DN=" . rawurlencode($info[$index]['dn']) . "'\">\n");
|
|
|
|
echo " <td align=\"center\"><input class=\"accountBoxUnchecked\" onClick=\"list_click('" . $rowID . "')\"" .
|
|
|
|
echo " <td align=\"center\"><input class=\"accountBoxUnchecked\" onClick=\"list_click('" . $rowID . "')\"" .
|
|
|
|
" type=\"checkbox\" name=\"" . $rowID . "\"></td>\n";
|
|
|
|
" type=\"checkbox\" name=\"" . $rowID . "\"></td>\n";
|
|
|
|
$this->listPrintToolLinks($info[$index], $rowID);
|
|
|
|
$this->listPrintToolLinks($info[$index], $rowID);
|
|
|
@ -480,7 +482,7 @@ class lamList {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// display select all link
|
|
|
|
// display select all link
|
|
|
|
$colspan = sizeof($this->attrArray) + 1;
|
|
|
|
$colspan = sizeof($this->attrArray) + 1;
|
|
|
|
echo "<tr class=\"" . $this->type . "-bright\">\n";
|
|
|
|
echo "<tr class=\"" . $this->type->getScope() . "-bright\">\n";
|
|
|
|
echo "<td align=\"center\"><a href=\"#\" onClick=\"list_switchAccountSelection();\"><img height=16 width=16 src=\"../../graphics/select.png\" alt=\"select all\"></a></td>\n";
|
|
|
|
echo "<td align=\"center\"><a href=\"#\" onClick=\"list_switchAccountSelection();\"><img height=16 width=16 src=\"../../graphics/select.png\" alt=\"select all\"></a></td>\n";
|
|
|
|
echo "<td colspan=$colspan> <a href=\"#\" onClick=\"list_switchAccountSelection();\">" .
|
|
|
|
echo "<td colspan=$colspan> <a href=\"#\" onClick=\"list_switchAccountSelection();\">" .
|
|
|
|
"<font color=\"black\"><small>" . _("Select all") . "</small></font></a></td>\n";
|
|
|
|
"<font color=\"black\"><small>" . _("Select all") . "</small></font></a></td>\n";
|
|
|
@ -499,13 +501,13 @@ class lamList {
|
|
|
|
$toolCount = 0;
|
|
|
|
$toolCount = 0;
|
|
|
|
$group = new htmlGroup();
|
|
|
|
$group = new htmlGroup();
|
|
|
|
// edit link
|
|
|
|
// edit link
|
|
|
|
$editLink = new htmlLink('', "../account/edit.php?type=" . $this->type . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/edit.png');
|
|
|
|
$editLink = new htmlLink('', "../account/edit.php?type=" . $this->type->getId() . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/edit.png');
|
|
|
|
$editLink->setTitle(_("Edit"));
|
|
|
|
$editLink->setTitle(_("Edit"));
|
|
|
|
$group->addElement($editLink);
|
|
|
|
$group->addElement($editLink);
|
|
|
|
$toolCount++;
|
|
|
|
$toolCount++;
|
|
|
|
// delete link
|
|
|
|
// delete link
|
|
|
|
if (checkIfWriteAccessIsAllowed($this->type) && checkIfDeleteEntriesIsAllowed($this->type)) {
|
|
|
|
if (checkIfWriteAccessIsAllowed($this->type->getId()) && checkIfDeleteEntriesIsAllowed($this->type->getId())) {
|
|
|
|
$deleteLink = new htmlLink('', "deletelink.php?type=" . $this->type . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/delete.png');
|
|
|
|
$deleteLink = new htmlLink('', "deletelink.php?type=" . $this->type->getId() . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/delete.png');
|
|
|
|
$deleteLink->setTitle(_("Delete"));
|
|
|
|
$deleteLink->setTitle(_("Delete"));
|
|
|
|
$group->addElement($deleteLink);
|
|
|
|
$group->addElement($deleteLink);
|
|
|
|
$toolCount++;
|
|
|
|
$toolCount++;
|
|
|
@ -518,14 +520,14 @@ class lamList {
|
|
|
|
// additional tools
|
|
|
|
// additional tools
|
|
|
|
$tools = $this->getAdditionalTools();
|
|
|
|
$tools = $this->getAdditionalTools();
|
|
|
|
for ($i = 0; $i < sizeof($tools); $i++) {
|
|
|
|
for ($i = 0; $i < sizeof($tools); $i++) {
|
|
|
|
$toolLink = new htmlLink('', $tools[$i]->getLinkTarget() . "?type=" . $this->type . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/' . $tools[$i]->getImage());
|
|
|
|
$toolLink = new htmlLink('', $tools[$i]->getLinkTarget() . "?type=" . $this->type->getId() . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/' . $tools[$i]->getImage());
|
|
|
|
$toolLink->setTitle($tools[$i]->getName());
|
|
|
|
$toolLink->setTitle($tools[$i]->getName());
|
|
|
|
$group->addElement($toolLink);
|
|
|
|
$group->addElement($toolLink);
|
|
|
|
$toolCount++;
|
|
|
|
$toolCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$width = ($toolCount * 20) + 20;
|
|
|
|
$width = ($toolCount * 20) + 20;
|
|
|
|
echo "<td align='center' style=\"white-space: nowrap; width: ${width}px;\">";
|
|
|
|
echo "<td align='center' style=\"white-space: nowrap; width: ${width}px;\">";
|
|
|
|
parseHtml(null, $group, array(), false, $this->tabindex, $this->type);
|
|
|
|
parseHtml(null, $group, array(), false, $this->tabindex, $this->type->getScope());
|
|
|
|
echo "</td>\n";
|
|
|
|
echo "</td>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -560,16 +562,16 @@ class lamList {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check if button was pressed and if we have to add/delete an account or call file upload
|
|
|
|
// check if button was pressed and if we have to add/delete an account or call file upload
|
|
|
|
if (isset($_POST['new']) || isset($_POST['del']) || isset($_POST['fileUpload'])){
|
|
|
|
if (isset($_POST['new']) || isset($_POST['del']) || isset($_POST['fileUpload'])){
|
|
|
|
if (!checkIfWriteAccessIsAllowed($this->type)) {
|
|
|
|
if (!checkIfWriteAccessIsAllowed($this->type->getId())) {
|
|
|
|
die();
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// add new account
|
|
|
|
// add new account
|
|
|
|
if (isset($_POST['new']) && checkIfNewEntriesAreAllowed($this->type)){
|
|
|
|
if (isset($_POST['new']) && checkIfNewEntriesAreAllowed($this->type->getId())){
|
|
|
|
metaRefresh("../account/edit.php?type=" . $this->type . "&suffix=" . $this->suffix);
|
|
|
|
metaRefresh("../account/edit.php?type=" . $this->type->getId() . "&suffix=" . $this->suffix);
|
|
|
|
exit;
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// delete account(s)
|
|
|
|
// delete account(s)
|
|
|
|
elseif (isset($_POST['del']) && checkIfDeleteEntriesIsAllowed($this->type)){
|
|
|
|
elseif (isset($_POST['del']) && checkIfDeleteEntriesIsAllowed($this->type->getId())){
|
|
|
|
// search for checkboxes
|
|
|
|
// search for checkboxes
|
|
|
|
$accounts = array_keys($_POST, "on");
|
|
|
|
$accounts = array_keys($_POST, "on");
|
|
|
|
// build DN list
|
|
|
|
// build DN list
|
|
|
@ -578,13 +580,13 @@ class lamList {
|
|
|
|
$_SESSION['delete_dn'][] = base64_decode($accounts[$i]);
|
|
|
|
$_SESSION['delete_dn'][] = base64_decode($accounts[$i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sizeof($accounts) > 0) {
|
|
|
|
if (sizeof($accounts) > 0) {
|
|
|
|
metaRefresh("../delete.php?type=" . $this->type);
|
|
|
|
metaRefresh("../delete.php?type=" . $this->type->getId());
|
|
|
|
exit;
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// file upload
|
|
|
|
// file upload
|
|
|
|
elseif (isset($_POST['fileUpload']) && checkIfNewEntriesAreAllowed($this->type)){
|
|
|
|
elseif (isset($_POST['fileUpload']) && checkIfNewEntriesAreAllowed($this->type->getId())){
|
|
|
|
metaRefresh("../upload/masscreate.php?type=" . $this->type);
|
|
|
|
metaRefresh("../upload/masscreate.php?type=" . $this->type->getId());
|
|
|
|
exit;
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -662,7 +664,7 @@ class lamList {
|
|
|
|
$cookieValue .= $this->configOptions[$i]->getID() . "=" . $this->configOptions[$i]->getValue() . ';';
|
|
|
|
$cookieValue .= $this->configOptions[$i]->getID() . "=" . $this->configOptions[$i]->getValue() . ';';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// save options as cookie for one year
|
|
|
|
// save options as cookie for one year
|
|
|
|
setcookie("ListOptions_" . $this->type, $cookieValue, time()+60*60*24*365, "/", null, null, true);
|
|
|
|
setcookie("ListOptions_" . $this->type->getId(), $cookieValue, time()+60*60*24*365, "/", null, null, true);
|
|
|
|
// notify subclasses
|
|
|
|
// notify subclasses
|
|
|
|
$this->listConfigurationChanged();
|
|
|
|
$this->listConfigurationChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -688,17 +690,17 @@ class lamList {
|
|
|
|
$selAccounts[] = $id;
|
|
|
|
$selAccounts[] = $id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// get possible PDF structures
|
|
|
|
// get possible PDF structures
|
|
|
|
$pdf_structures = getPDFStructureDefinitions($this->type);
|
|
|
|
$pdf_structures = getPDFStructureDefinitions($this->type->getId());
|
|
|
|
|
|
|
|
|
|
|
|
$this->listPrintHeader();
|
|
|
|
$this->listPrintHeader();
|
|
|
|
|
|
|
|
|
|
|
|
echo "<div class=\"ui-tabs-nav " . $this->type . "-bright\">";
|
|
|
|
echo "<div class=\"ui-tabs-nav " . $this->type->getScope() . "-bright\">";
|
|
|
|
echo "<div class=\"smallPaddingContent\">\n";
|
|
|
|
echo "<div class=\"smallPaddingContent\">\n";
|
|
|
|
$refresh = '&norefresh=true';
|
|
|
|
$refresh = '&norefresh=true';
|
|
|
|
if (isset($_GET['refresh']) && ($_GET['refresh'] == 'true')) {
|
|
|
|
if (isset($_GET['refresh']) && ($_GET['refresh'] == 'true')) {
|
|
|
|
$refresh = '&refresh=true';
|
|
|
|
$refresh = '&refresh=true';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "<form action=\"list.php?type=" . $this->type . $refresh . "\" method=\"post\">\n";
|
|
|
|
echo "<form action=\"list.php?type=" . $this->type->getId() . $refresh . "\" method=\"post\">\n";
|
|
|
|
|
|
|
|
|
|
|
|
$container = new htmlTable();
|
|
|
|
$container = new htmlTable();
|
|
|
|
$container->addElement(new htmlSubTitle(_('Create PDF file')), true);
|
|
|
|
$container->addElement(new htmlSubTitle(_('Create PDF file')), true);
|
|
|
@ -735,7 +737,7 @@ class lamList {
|
|
|
|
$container->addElement(new htmlHiddenInput('clickedAccount', $id));
|
|
|
|
$container->addElement(new htmlHiddenInput('clickedAccount', $id));
|
|
|
|
addSecurityTokenToMetaHTML($container);
|
|
|
|
addSecurityTokenToMetaHTML($container);
|
|
|
|
|
|
|
|
|
|
|
|
parseHtml(null, $container, array(), false, $this->tabindex, $this->type);
|
|
|
|
parseHtml(null, $container, array(), false, $this->tabindex, $this->type->getScope());
|
|
|
|
|
|
|
|
|
|
|
|
$this->listPrintFooter();
|
|
|
|
$this->listPrintFooter();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -753,7 +755,7 @@ class lamList {
|
|
|
|
$suffixList[getAbstractDN($this->possibleSuffixes[$i])] = $this->possibleSuffixes[$i];
|
|
|
|
$suffixList[getAbstractDN($this->possibleSuffixes[$i])] = $this->possibleSuffixes[$i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$suffixSelect = new htmlSelect('suffix', $suffixList, array($this->suffix));
|
|
|
|
$suffixSelect = new htmlSelect('suffix', $suffixList, array($this->suffix));
|
|
|
|
$suffixSelect->setOnchangeEvent("listOUchanged('" . $this->type . "', this)");
|
|
|
|
$suffixSelect->setOnchangeEvent("listOUchanged('" . $this->type->getId() . "', this)");
|
|
|
|
$suffixSelect->setRightToLeftTextDirection(true);
|
|
|
|
$suffixSelect->setRightToLeftTextDirection(true);
|
|
|
|
$suffixSelect->setSortElements(false);
|
|
|
|
$suffixSelect->setSortElements(false);
|
|
|
|
$suffixSelect->setHasDescriptiveElements(true);
|
|
|
|
$suffixSelect->setHasDescriptiveElements(true);
|
|
|
@ -774,23 +776,22 @@ class lamList {
|
|
|
|
$left = new htmlGroup();
|
|
|
|
$left = new htmlGroup();
|
|
|
|
// button part
|
|
|
|
// button part
|
|
|
|
$left->alignment = htmlElement::ALIGN_LEFT;
|
|
|
|
$left->alignment = htmlElement::ALIGN_LEFT;
|
|
|
|
if (checkIfWriteAccessIsAllowed($this->type)) {
|
|
|
|
if (checkIfWriteAccessIsAllowed($this->type->getId())) {
|
|
|
|
// add button
|
|
|
|
// add button
|
|
|
|
if (checkIfNewEntriesAreAllowed($this->type)) {
|
|
|
|
if (checkIfNewEntriesAreAllowed($this->type->getId())) {
|
|
|
|
$newButton = new htmlButton('new', $this->labels['newEntry']);
|
|
|
|
$newButton = new htmlButton('new', $this->labels['newEntry']);
|
|
|
|
$newButton->setIconClass('createButton');
|
|
|
|
$newButton->setIconClass('createButton');
|
|
|
|
$left->addElement($newButton);
|
|
|
|
$left->addElement($newButton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// delete button
|
|
|
|
// delete button
|
|
|
|
if (!$createOnly && checkIfDeleteEntriesIsAllowed($this->type)) {
|
|
|
|
if (!$createOnly && checkIfDeleteEntriesIsAllowed($this->type->getId())) {
|
|
|
|
$left->addElement(new htmlSpacer('1px', null));
|
|
|
|
$left->addElement(new htmlSpacer('1px', null));
|
|
|
|
$delButton = new htmlButton('del', $this->labels['deleteEntry']);
|
|
|
|
$delButton = new htmlButton('del', $this->labels['deleteEntry']);
|
|
|
|
$delButton->setIconClass('deleteButton');
|
|
|
|
$delButton->setIconClass('deleteButton');
|
|
|
|
$left->addElement($delButton);
|
|
|
|
$left->addElement($delButton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$type = new $this->type();
|
|
|
|
|
|
|
|
$toolSettings = $_SESSION['config']->getToolSettings();
|
|
|
|
$toolSettings = $_SESSION['config']->getToolSettings();
|
|
|
|
if ($type->supportsFileUpload() && checkIfNewEntriesAreAllowed($this->type)
|
|
|
|
if ($this->type->getBaseType()->supportsFileUpload() && checkIfNewEntriesAreAllowed($this->type->getId())
|
|
|
|
&& !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) {
|
|
|
|
&& !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) {
|
|
|
|
$left->addElement(new htmlSpacer('20px', null));
|
|
|
|
$left->addElement(new htmlSpacer('20px', null));
|
|
|
|
$uploadButton = new htmlButton('fileUpload', _('File upload'));
|
|
|
|
$uploadButton = new htmlButton('fileUpload', _('File upload'));
|
|
|
@ -815,7 +816,7 @@ class lamList {
|
|
|
|
$this->addExtraInputElementsToTopArea($left, $right);
|
|
|
|
$this->addExtraInputElementsToTopArea($left, $right);
|
|
|
|
$table->addElement($left);
|
|
|
|
$table->addElement($left);
|
|
|
|
$table->addElement($right);
|
|
|
|
$table->addElement($right);
|
|
|
|
parseHtml(null, $table, array(), false, $this->tabindex, $this->type);
|
|
|
|
parseHtml(null, $table, array(), false, $this->tabindex, $this->type->getScope());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -844,8 +845,8 @@ class lamList {
|
|
|
|
</form></div></div>
|
|
|
|
</form></div></div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
jQuery(document).ready(function() {
|
|
|
|
jQuery(document).ready(function() {
|
|
|
|
jQuery('#tab_<?php echo $this->type; ?>').addClass('ui-tabs-active');
|
|
|
|
jQuery('#tab_<?php echo $this->type->getId(); ?>').addClass('ui-tabs-active');
|
|
|
|
jQuery('#tab_<?php echo $this->type; ?>').addClass('ui-state-active');
|
|
|
|
jQuery('#tab_<?php echo $this->type->getId(); ?>').addClass('ui-state-active');
|
|
|
|
window.onload = listResizeITabContentDiv;
|
|
|
|
window.onload = listResizeITabContentDiv;
|
|
|
|
window.onresize = listResizeITabContentDiv;
|
|
|
|
window.onresize = listResizeITabContentDiv;
|
|
|
|
jQuery('#filterButton').button();
|
|
|
|
jQuery('#filterButton').button();
|
|
|
@ -862,33 +863,10 @@ class lamList {
|
|
|
|
* @return array attribute list
|
|
|
|
* @return array attribute list
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected function listGetAttributeDescriptionList() {
|
|
|
|
protected function listGetAttributeDescriptionList() {
|
|
|
|
|
|
|
|
$attrs = $this->type->getAttributes();
|
|
|
|
$ret = array();
|
|
|
|
$ret = array();
|
|
|
|
$attr_string = $_SESSION["config"]->get_listAttributes($this->type);
|
|
|
|
foreach ($attrs as $attr) {
|
|
|
|
$temp_array = explode(";", $attr_string);
|
|
|
|
$ret[$attr->getAttributeName()] = $attr->getAlias();
|
|
|
|
$hash_table = LAM\TYPES\getListAttributeDescriptions($this->type);
|
|
|
|
|
|
|
|
$hash_table = array_change_key_case($hash_table, CASE_LOWER);
|
|
|
|
|
|
|
|
// generate column attributes and descriptions
|
|
|
|
|
|
|
|
for ($i = 0; $i < sizeof($temp_array); $i++) {
|
|
|
|
|
|
|
|
// if value is predifined, look up description in hash_table
|
|
|
|
|
|
|
|
if (substr($temp_array[$i],0,1) == "#") {
|
|
|
|
|
|
|
|
$attr = strtolower(substr($temp_array[$i],1));
|
|
|
|
|
|
|
|
if (isset($hash_table[$attr])) {
|
|
|
|
|
|
|
|
$ret[$attr] = $hash_table[$attr];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
$ret[$attr] = $attr;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// if not predefined, the attribute is seperated by a ":" from description
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
$attr = explode(":", $temp_array[$i]);
|
|
|
|
|
|
|
|
if (isset($attr[1])) {
|
|
|
|
|
|
|
|
$ret[$attr[0]] = $attr[1];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
$ret[$attr[0]] = $attr[0];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $ret;
|
|
|
|
return $ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -932,9 +910,18 @@ class lamList {
|
|
|
|
$this->sortDirection = $_GET['sortdirection'];
|
|
|
|
$this->sortDirection = $_GET['sortdirection'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check search suffix
|
|
|
|
// check search suffix
|
|
|
|
if (isset($_POST['suffix'])) $this->suffix = $_POST['suffix']; // new suffix selected via combobox
|
|
|
|
if (isset($_POST['suffix'])) {
|
|
|
|
elseif (isset($_GET['suffix'])) $this->suffix = $_GET['suffix']; // new suffix selected via combobox
|
|
|
|
// new suffix selected via combobox
|
|
|
|
elseif (!$this->suffix) $this->suffix = $_SESSION["config"]->get_Suffix($this->type); // default suffix
|
|
|
|
$this->suffix = $_POST['suffix'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
elseif (isset($_GET['suffix'])) {
|
|
|
|
|
|
|
|
// new suffix selected via combobox
|
|
|
|
|
|
|
|
$this->suffix = $_GET['suffix'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
elseif (!$this->suffix) {
|
|
|
|
|
|
|
|
// default suffix
|
|
|
|
|
|
|
|
$this->suffix = $this->type->getSuffix();
|
|
|
|
|
|
|
|
}
|
|
|
|
// check if LDAP data should be refreshed
|
|
|
|
// check if LDAP data should be refreshed
|
|
|
|
$this->refresh = true;
|
|
|
|
$this->refresh = true;
|
|
|
|
if (isset($_GET['norefresh'])) $this->refresh = false;
|
|
|
|
if (isset($_GET['norefresh'])) $this->refresh = false;
|
|
|
@ -949,10 +936,10 @@ class lamList {
|
|
|
|
protected function listRefreshData() {
|
|
|
|
protected function listRefreshData() {
|
|
|
|
// check suffix
|
|
|
|
// check suffix
|
|
|
|
if (!$this->suffix) {
|
|
|
|
if (!$this->suffix) {
|
|
|
|
$this->suffix = $_SESSION["config"]->get_Suffix($this->type); // default suffix
|
|
|
|
$this->suffix = $this->type->getSuffix(); // default suffix
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// configure search filter
|
|
|
|
// configure search filter
|
|
|
|
$module_filter = get_ldap_filter($this->type); // basic filter is provided by modules
|
|
|
|
$module_filter = get_ldap_filter($this->type->getId()); // basic filter is provided by modules
|
|
|
|
$filter = "(&" . $module_filter . $this->buildLDAPAttributeFilter() . ")";
|
|
|
|
$filter = "(&" . $module_filter . $this->buildLDAPAttributeFilter() . ")";
|
|
|
|
$attrs = $this->attrArray;
|
|
|
|
$attrs = $this->attrArray;
|
|
|
|
// remove virtual attributes from list
|
|
|
|
// remove virtual attributes from list
|
|
|
@ -975,8 +962,7 @@ class lamList {
|
|
|
|
call_user_func_array('StatusMessage', $lastError);
|
|
|
|
call_user_func_array('StatusMessage', $lastError);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// generate list of possible suffixes
|
|
|
|
// generate list of possible suffixes
|
|
|
|
$typeObj = new $this->type();
|
|
|
|
$this->possibleSuffixes = $this->type->getBaseType()->getSuffixList();
|
|
|
|
$this->possibleSuffixes = $typeObj->getSuffixList();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1039,7 +1025,7 @@ class lamList {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected function listPrintConfigurationPage() {
|
|
|
|
protected function listPrintConfigurationPage() {
|
|
|
|
echo "<div id=\"settingsDialog\" class=\"hidden\">\n";
|
|
|
|
echo "<div id=\"settingsDialog\" class=\"hidden\">\n";
|
|
|
|
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->getId() . "&norefresh=true\" method=\"post\">\n";
|
|
|
|
echo '<table width="100%"><tr><td>';
|
|
|
|
echo '<table width="100%"><tr><td>';
|
|
|
|
|
|
|
|
|
|
|
|
$configContainer = new htmlTable();
|
|
|
|
$configContainer = new htmlTable();
|
|
|
@ -1049,7 +1035,7 @@ class lamList {
|
|
|
|
$configContainer->addElement(new htmlHiddenInput('saveConfigOptions', 'ok'));
|
|
|
|
$configContainer->addElement(new htmlHiddenInput('saveConfigOptions', 'ok'));
|
|
|
|
addSecurityTokenToMetaHTML($configContainer);
|
|
|
|
addSecurityTokenToMetaHTML($configContainer);
|
|
|
|
|
|
|
|
|
|
|
|
parseHtml('', $configContainer, array(), false, $this->tabindex, $this->type);
|
|
|
|
parseHtml('', $configContainer, array(), false, $this->tabindex, $this->type->getScope());
|
|
|
|
|
|
|
|
|
|
|
|
echo "</td></tr></table>\n";
|
|
|
|
echo "</td></tr></table>\n";
|
|
|
|
echo '</form>';
|
|
|
|
echo '</form>';
|
|
|
|