\n");
echo '';
include '../main_footer.php';
}
/**
* Returns an hash array containing with all attributes to be shown and their descriptions.
* Format: array(attribute => description)
*
* @return array attribute list
*/
private function listGetAttributeDescriptionList() {
$ret = array();
$attr_string = $_SESSION["config"]->get_listAttributes($this->type);
$temp_array = explode(";", $attr_string);
$hash_table = getListAttributeDescriptions($this->type);
// 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;
}
/**
* Sets some internal parameters.
*/
protected function listGetParams() {
// check if only PDF should be shown
if (isset($_GET['printPDF'])) {
$this->showPDFPage(null);
exit();
}
// get current page
if (isset($_GET["page"])) $this->page = $_GET["page"];
else $this->page = 1;
// generate attribute-description table
$temp_array = $this->listGetAttributeDescriptionList();
$this->attrArray = array_keys($temp_array); // list of LDAP attributes to show
$this->descArray = array_values($temp_array); // list of descriptions for the attributes
// get sorting column
if (isset($_GET["sort"])) {
if ($_GET["sort"] == $this->sortColumn) {
$this->sortDirection = -$this->sortDirection;
}
else {
$this->sortColumn = $_GET["sort"];
$this->sortDirection = 1;
}
}
else {
$this->sortColumn = strtolower($this->attrArray[0]);
$this->sortDirection = 1;
}
// get sort order
if (isset($_GET['sortdirection'])) {
$this->sortDirection = $_GET['sortdirection'];
}
// check search suffix
if (isset($_POST['suffix'])) $this->suffix = $_POST['suffix']; // new suffix selected via combobox
elseif (isset($_GET['suffix'])) $this->suffix = $_GET['suffix']; // new suffix selected via combobox
elseif (!$this->suffix) $this->suffix = $_SESSION["config"]->get_Suffix($this->type); // default suffix
// check if LDAP data should be refreshed
$this->refresh = true;
if (isset($_GET['norefresh'])) $this->refresh = false;
if (isset($_POST['refresh']) || isset($_POST['apply_filter'])) {
$this->refresh = true;
}
}
/**
* Rereads the entries from LDAP.
*/
protected function listRefreshData() {
// configure search filter
$module_filter = get_ldap_filter($this->type); // basic filter is provided by modules
$filter = "(&" . $module_filter . $this->filterPart . ")";
$attrs = $this->attrArray;
$entries = searchLDAP($this->suffix, $filter, $attrs);
$lastError = getLastLDAPError();
if ($lastError != null) {
call_user_func_array('StatusMessage', $lastError);
}
$this->entries = $entries;
// generate list of possible suffixes
$this->possibleSuffixes = $_SESSION['ldap']->search_units($_SESSION["config"]->get_Suffix($this->type));
}
/**
* Returns a list of lamListTool objects to display next to the edit/delete buttons.
*
* @return lamListTool[] tools
*/
protected function getAdditionalTools() {
return array();
}
/**
* Returns a list of possible configuration options.
*
* @return array list of lamListOption objects
*/
protected function listGetAllConfigOptions() {
$listSizeOption = new lamSelectListOption(_("Maximum list entries"), array(10, 20, 30, 50, 75, 100), self::LIST_SIZE_OPTION_NAME);
return array($listSizeOption);
}
/**
* Prints the list configuration page.
*/
protected function listPrintConfigurationPage() {
$this->listPrintHeader();
echo '