index 456b3cb8d087bffbe022c7cdf10c81c74de4d57d..5f04cdf3171a7afaec3a68837a978771564a0ba6 100644 (file)
var $departmentRootVisible= false;
var $multiSelect= false;
var $singleSelect= false;
+ var $noAclChecks= false;
var $template;
var $headline;
var $base;
var $height= 0;
var $scrollPosition= 0;
var $baseSelector;
-
+ var $aclToObjectClass = array();
function listing($source, $isString = FALSE)
{
$this->xmlData= $this->xmlData["list"];
// Load some definition values
- foreach (array("departmentBrowser", "departmentRootVisible", "multiSelect","singleSelect", "baseMode") as $token) {
+ foreach (array("departmentBrowser", "departmentRootVisible", "multiSelect","singleSelect", "baseMode", "noAclChecks") as $token) {
if (isset($this->xmlData['definition'][$token]) &&
$this->xmlData['definition'][$token] == "true"){
$this->$token= true;
$this->objectTypes[$tmp['objectClass']]= $tmp;
if (isset($this->xmlData['definition']['objectType'][$index]['category'])){
$this->categories[]= $otype['category'];
+
+ if(isset($otype['category']) && isset($otype['class'])){
+ $this->aclToObjectClass[$otype['category']."/".$otype['class']][] = $otype['objectClass'];
+ }
}
}
}
$height= $this->height;
}
- $result.= "<div class='listContainer' id='d_scrollbody' style='min-height:".($height+25)."px;'>\n";
+ $result.= "<div class='listContainer' id='d_scrollbody' style='height:{$height}px; overflow: auto;min-height:".($height+25)."px;'>\n";
$result.= "<table summary='$this->headline' style='width:100%;table-layout:fixed' cellspacing='0' cellpadding='0' id='t_scrolltable'>\n";
$this->numColumns= count($this->colprops) + (($this->multiSelect|$this->singleSelect)?1:0);
}
// Fill with contents, sort as configured
+ $ui = get_userinfo();
foreach ($this->entries as $row => $entry) {
$trow= "";
$this->filter->setBase($this->base);
$this->entries= $this->filter->query();
+ // Check entry acls
+ if(!$this->noAclChecks){
+ foreach($this->entries as $row => $entry){
+ $acl = "";
+ $found = false;
+ foreach($this->aclToObjectClass as $category => $ocs){
+ if(count(array_intersect($ocs, $entry['objectClass']))){
+ $acl .= $ui->get_permissions($entry['dn'],$category, 0);
+ $found = true;
+ }
+ }
+ if(!preg_match("/r/", $acl) && $found){
+ unset($this->entries[$row]);
+ continue;
+ }
+ }
+ }
+
// Fix filter if querie returns NULL
if ($this->entries == null) {
$this->entries= array();
foreach ($ocs as $oc){
if (preg_match('/^!(.*)$/', $oc, $match)) {
$oc= $match[1];
- if (in_array($oc, $classes)) {
+ if (in_array_strict($oc, $classes)) {
$found= false;
}
} else {
- if (!in_array($oc, $classes)) {
+ if (!in_array_strict($oc, $classes)) {
$found= false;
}
}
$objectclass= $action['objectclass'];
if (preg_match('/^!(.*)$/', $objectclass, $m)){
$objectclass= $m[1];
- if(in_array($objectclass, $classes)) {
+ if(in_array_strict($objectclass, $classes)) {
$result.= image('images/empty.png');
continue;
}
} elseif (is_string($objectclass)) {
- if(!in_array($objectclass, $classes)) {
+ if(!in_array_strict($objectclass, $classes)) {
$result.= image('images/empty.png');
continue;
}
// Analyze list of departments
foreach ($res as $department) {
- if (!in_array($department['dn'], $validDepartments)) {
+ if (!in_array_strict($department['dn'], $validDepartments)) {
continue;
}
// Add the attribute where we use for sorting
$oc= null;
foreach(array_keys($types) as $type) {
- if (in_array($type, $department['objectClass'])) {
+ if (in_array_strict($type, $department['objectClass'])) {
$oc= $type;
break;
}