...
 
Commits (6)
<div class="contentboxh">
<p>{t}Filter{/t}</p>
</div>
<div class="contentboxb">
{if isset($objectFilters)}
{foreach from=$objectFilters item="ofilter"}
<label for="{$ofilter.id}">
{${$ofilter.id}}&nbsp;{$ofilter.label}
</label>
{/foreach}
{/if}
<hr/>
{$SCOPE}
<hr/>
<label for="NAME" title="{$NAMEDESC}">
<img src="geticon.php?context=actions&amp;icon=system-search&amp;size=16" alt="Search"/>
{$NAME}
</label>
<div>
{$APPLY}
</div>
</div>
<table class="listing-container">
<tbody>
<tr>
<td class="list">
<div class="contentboxh">
<p class="contentboxh">&nbsp;{$HEADLINE}&nbsp;{$SIZELIMIT}</p>
</div>
<div class="contentboxb">
<table>
<tbody>
<tr>
{if $BASE}<td>{$ROOT}&nbsp;</td><td>{$BACK}&nbsp;</td><td>{$HOME}&nbsp;</td>{/if}
<td class="optional">{$RELOAD}&nbsp;</td>
{if $BASE}<td><img src="images/lists/seperator.png" alt="-" height="16" width="1" class="center"/>&nbsp;</td><td>{t}Base{/t} {$BASE}&nbsp;</td>{/if}
{if $ACTIONS}<td><img src="images/lists/seperator.png" alt="-" height="16" width="1" class="center"/>&nbsp;</td><td>{$ACTIONS}</td>{/if}
</tr>
</tbody>
</table>
</div>
<div style="margin-top:4px;">
{$LIST}
</div>
</td>
<td class="filter">
{$FILTER}
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="ignore"/>
{include file={filePath file="simple-list.tpl"}}
<p class="plugbottom">
{if $MULTISELECT}
<input type="submit" name="add_finish" value="{msgPool type=addButton}"/>
&nbsp;
{/if}
<input type="submit" formnovalidate="formnovalidate" name="add_cancel" value="{msgPool type=cancelButton}"/>
</p>
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
Copyright (C) 2011-2016 FusionDirectory
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*!
* \file class_departmentSortIterator.inc
* Source code for class departmentSortIterator
*/
/*!
* \brief This class contains all the function needed to sort department
*/
class departmentSortIterator extends listingSortIterator
{
/*!
* \brief departmentSortIterator constructor
*
* \param array $data departmentSortIterator data
*
* \param $direction Direction
*/
public function __construct ($data, $direction)
{
parent::__construct($data, $direction, 'sort-attribute', 'department');
}
}
This diff is collapsed.
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
Copyright (C) 2011-2016 FusionDirectory
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*!
* \file class_filterLDAP.inc
* Source code for class filterLDAP
*/
/*!
* \brief This class contains all the function to manage LDAP filter
*
* \see filter
*/
class filterLDAP
{
/*!
* \brief Query
*
* \param string $parent
*
* \param string $base
*
* \param string $scope
*
* \param string $filter
*
* \param array $attributes
*
* \param string $category
*
* \param array $objectStorage
*/
static function query ($parent, $base, $scope, $filter, $attributes, $category, $objectStorage = [""])
{
return static::get_list($parent, $base, $filter, $attributes, $category, $objectStorage, (($scope == 'sub') ? 'subtree' : 'one'), TRUE);
}
/*!
* \brief Get list
*
* \param string $parent
*
* \param string $base
*
* \param string $filter
*
* \param array $attributes
*
* \param string $category
*
* \param array $objectStorage
*
* \param string $scope subtree or one
*
* \param boolean $sizelimit
*
* \param boolean $skipAcl
*/
static function get_list ($parent, $base, $filter, $attributes, $category, $objectStorage, $scope, $sizelimit = TRUE, $skipAcl = FALSE)
{
global $config, $ui;
// Move to arrays for category and objectStorage
if (!is_array($category)) {
$category = [$category];
}
// Initialize search bases
$bases = [];
foreach ($objectStorage as $oc) {
$oc = preg_replace('/,$/', '', $oc);
if ($scope == 'one') {
if (empty($oc)) {
$bases[$base] = TRUE;
} else {
$bases[$oc.','.$base] = TRUE;
}
} else {
if (empty($oc)) {
/* If we search on the base as well because of an empty storage string,
* it makes no sense to do dn filters */
$bases[$base] = TRUE;
break;
}
$parts = ldap_explode_dn($oc, 0);
unset($parts['count']);
$dnFilter = [];
foreach ($parts as $part) {
preg_match('/([^=]+)=(.*)$/', $part, $m);
$dnFilter[] = '('.$m[1].':dn:='.$m[2].')';
}
if (count($dnFilter) > 1) {
$bases[$base][] = '(&'.implode('', $dnFilter).')';
} else {
$bases[$base][] = $dnFilter[0];
}
}
}
// Get LDAP link
$ldap = $config->get_ldap_link($sizelimit);
// Do search for every base
$result = [];
$limit_exceeded = FALSE;
$ui->getSizeLimitHandler()->setLimitExceeded(FALSE);
foreach ($bases as $base => $dnFilters) {
// Break if the size limit is exceeded
if ($limit_exceeded) {
return $result;
}
// Switch to new base and search
if (is_array($dnFilters)) {
$dnFilter = '(|'.implode('', $dnFilters).')';
} else {
$dnFilter = '';
}
$ldap->cd($base);
$ldap->search('(&'.$filter.$dnFilter.')', $attributes, $scope);
// Check for size limit exceeded messages for GUI feedback
if ($ldap->hitSizeLimit()) {
$ui->getSizeLimitHandler()->setLimitExceeded();
$limit_exceeded = TRUE;
}
/* Crawl through result entries and perform the migration to the
result array */
while ($attrs = $ldap->fetch()) {
$dn = $attrs['dn'];
/* Skip ACL checks if we are forced to skip those checks */
if ($skipAcl) {
$result[] = $attrs;
} else {
// Check entry permission
$obj = $parent->headpage->getObjectTypeInfos($dn, $attrs);
if (isset($obj['category'])) {
$o = $obj['category'].'/'.$obj['class'];
if (strpos($ui->get_permissions($dn, $o), 'r') !== FALSE) {
$result[] = $attrs;
}
} else {
trigger_error('Could not find objectType for '.$dn.'!');
}
}
}
}
return $result;
}
}
This diff is collapsed.
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
Copyright (C) 2011-2016 FusionDirectory
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*!
* \file class_listingSortIterator.inc
* Source code for class listingSortIterator
*/
/*!
* \brief This class contains all the function needed to sort list
* go up, go down , back , next. etc...
*/
class listingSortIterator implements Iterator
{
protected $data;
/*!
* \brief listingSortIterator constructor
*
* \param array $data listingSortIterator data
*
* \param $direction Direction
*
* \param $attribute Attribute
*
* \param string $type
*/
public function __construct ($data, $direction, $attribute, $type = 'string')
{
// Sort for attribute
if ($attribute != '') {
uasort(
$data,
function ($ao, $bo) use ($attribute, $type)
{
if ($attribute == 'sort-attribute') {
// Override sort attribute from data if needed
$attribute_a = $ao['sort-attribute'];
$attribute_b = $bo['sort-attribute'];
} else {
$attribute_a = $attribute;
$attribute_b = $attribute;
}
// Extract values from ao and bo
$a = $b = '';
if (isset($ao[$attribute_a])) {
$a = $ao[$attribute_a];
if (is_array($a)) {
$a = $a[0];
}
}
if (isset($bo[$attribute_b])) {
$b = $bo[$attribute_b];
if (is_array($b)) {
$b = $b[0];
}
}
// Take a look at the several types
switch ($type) {
case 'department':
return strnatcmp($a, $b);
case 'integer':
return $b - $a;
case 'date':
if ($a == '') {
$a = '31.12.0000';
}
if ($b == '') {
$b = '31.12.0000';
}
list($d, $m, $y) = explode('.', $a);
$a = (int)sprintf('%04d%02d%02d', $y, $m, $d);
list($d, $m, $y) = explode('.', $b);
$b = (int)sprintf('%04d%02d%02d', $y, $m, $d);
return $b - $a;
case 'ip':
$parts_a = explode('.', $a, 4);
$parts_b = explode('.', $b, 4);
for ($i = 0; $i < 4; $i++) {
if ((int)($parts_a[$i]) != (int)($parts_b[$i])) {
return (int)($parts_a[$i]) - (int)($parts_b[$i]);
}
}
return 0;
// Sort for string by default
case 'string':
default:
return strcoll($a, $b);
}
}
);
}
// Invert if direction is set
if ($direction) {
$this->data = array_reverse($data, TRUE);
} else {
$this->data = $data;
}
}
/*!
* \brief Put the array pointer to the first element
*
* \return the first element of the array
*/
function rewind ()
{
return reset($this->data);
}
/*!
* \brief Get the current data element
*
* \return The current element pointed by array pointer
*/
function current ()
{
return current($this->data);
}
/*!
* \brief Get the key element
*
* \return the key element of the array
*/
function key ()
{
return key($this->data);
}
/*!
* \brief Get the next data element
*
* \return The next element pointed by array pointer
*/
function next ()
{
return next($this->data);
}
/*!
* \brief Check if the data array is valid
*
* \return TRUE if the array is valid, return FALSE otherwise
*/
function valid ()
{
return (key($this->data) !== NULL);
}
}
......@@ -23,7 +23,7 @@
*/
class templateDialog
{
protected $simpleManagement;
protected $management;
protected $type;
protected $template = NULL;
protected $templates;
......@@ -34,9 +34,9 @@ class templateDialog
protected $post_finish = 'template_continue';
protected $post_cancel = 'template_cancel';
function __construct ($simpleManagement, $type, $dn = NULL, $target = NULL)
function __construct ($management, $type, $dn = NULL, $target = NULL)
{
$this->simpleManagement = $simpleManagement;
$this->management = $management;
$this->type = $type;
$this->templates = objects::getTemplates($this->type);
if ($dn !== NULL) {
......@@ -75,8 +75,8 @@ class templateDialog
}
if (is_object($this->template)) {
if ($this->target !== NULL) {
$this->simpleManagement->openTabObject($this->template->apply($this->target));
$this->simpleManagement->handleTemplateApply();
$this->management->openTabObject($this->template->apply($this->target));
$this->management->handleTemplateApply();
return FALSE;
} else {
$this->template->save_object();
......@@ -111,15 +111,15 @@ class templateDialog
function handle_finish ()
{
$this->simpleManagement->closeDialogs();
$this->simpleManagement->openTabObject($this->template->apply());
$this->management->closeDialogs();
$this->management->openTabObject($this->template->apply());
return FALSE;
}
function handle_cancel ()
{
$this->simpleManagement->remove_lock();
$this->simpleManagement->closeDialogs();
$this->management->remove_lock();
$this->management->closeDialogs();
return FALSE;
}
}
......@@ -71,10 +71,12 @@ class SnapshotsAttribute extends OrderedArrayAttribute
{
}
function addValue ($value)
function addValue (string $dn, $entry = NULL)
{
$this->value[] = $value;
$this->reIndexValues();
if ($entry !== NULL) {
$this->value[] = $entry;
$this->reIndexValues();
}
}
function renderButtons ()
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003 Cajus Pollmeier
Copyright (C) 2011-2016 FusionDirectory
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*!
* \brief filterLDAP backend with blacklist/whitelist handling
*/
class filterLDAPBlacklist
{
static function query ($parent, $base, $scope, $filter, $attributes, $category, $objectStorage = "")
{
$result = filterLDAP::query($parent, $base, $scope, $filter, $attributes, $category, $objectStorage);
return filterLDAPBlacklist::filterByBlacklist($result);
}
static function filterByBlacklist ($entries)
{
if (session::is_set('filterWhitelist')) {
$wlist = session::get('filterWhitelist');
if (!empty($wlist)) {
foreach ($entries as $id => $entry) {
if (in_array($entry['dn'], $wlist['dn'])) {
continue;
}
foreach ($wlist['branches'] as $branch) {
if (preg_match('/'.preg_quote($branch, '/').'$/', $entry['dn'])) {
continue 2;
}
}
unset($entries[$id]);
}
}
}
if (session::is_set('filterBlacklist')) {
$blist = session::get('filterBlacklist');
foreach ($blist as $attr_name => $attr_values) {
foreach ($attr_values as $match) {
foreach ($entries as $id => $entry) {
if (isset($entry[$attr_name])) {
$test = $entry[$attr_name];
if (!is_array($test)) {
$test = [$test];
}
if (in_array($match, $test)) {
unset($entries[$id]);
}
}
}
}
}
}
return array_values($entries);
}
}
......@@ -84,7 +84,7 @@ class MailsAttribute extends DialogAttribute
return ['mail' => $this->getValue()];
}
function addValue ($dn, $attrs)
function addValue (string $dn, $attrs = NULL)
{
$value = (($attrs != NULL) ? $attrs['mail'][0] : $dn);
if (!in_array($value, $this->value)) {
......
......@@ -523,10 +523,11 @@ class OrderedArrayAttribute extends SetAttribute
$img .= $this->renderInputField(
'image', $id.'_up_'.$key,
[
'src' => 'geticon.php?context=actions&amp;icon=view-sort-descending&amp;size=16',
'title' => _('Sort up'),
'alt' => _('Sort up'),
'class' => 'center'
'src' => 'geticon.php?context=actions&amp;icon=view-sort-descending&amp;size=16',
'title' => _('Sort up'),
'alt' => _('Sort up'),
'class' => 'center',
'formnovalidate' => 'formnovalidate',
]
);
} else {
......@@ -536,10 +537,11 @@ class OrderedArrayAttribute extends SetAttribute
$img .= $this->renderInputField(
'image', $id.'_down_'.$key,
[
'src' => 'geticon.php?context=actions&amp;icon=view-sort-ascending&amp;size=16',
'title' => _('Sort down'),
'alt' => _('Sort down'),
'class' => 'center'
'src' => 'geticon.php?context=actions&amp;icon=view-sort-ascending&amp;size=16',
'title' => _('Sort down'),
'alt' => _('Sort down'),
'class' => 'center',
'formnovalidate' => 'formnovalidate',
]
);
} else {
......@@ -551,20 +553,22 @@ class OrderedArrayAttribute extends SetAttribute
$img .= $this->renderInputField(
'image', $id.'_edit_'.$key,
[
'src' => 'geticon.php?context=actions&amp;icon=document-edit&amp;size=16',
'title' => _('Edit'),
'alt' => _('Edit'),
'class' => 'center'
'src' => 'geticon.php?context=actions&amp;icon=document-edit&amp;size=16',
'title' => _('Edit'),
'alt' => _('Edit'),
'class' => 'center',
'formnovalidate' => 'formnovalidate',
]
);
}
$img .= $this->renderInputField(
'image', $id.'_del_'.$key,
[
'src' => 'geticon.php?context=actions&amp;icon=edit-delete&amp;size=16',
'title' => _('Delete'),
'alt' => _('Delete'),
'class' => 'center'
'src' => 'geticon.php?context=actions&amp;icon=edit-delete&amp;size=16',
'title' => _('Delete'),
'alt' => _('Delete'),
'class' => 'center',
'formnovalidate' => 'formnovalidate',
]
);
......
......@@ -63,15 +63,16 @@ class GenericDialog
}
}
/*! \brief Generic dialog for selection using a simpleSelectManagement based class
/*! \brief Generic dialog for selection using a selectManagement class
*/
class GenericSelectDialog extends GenericDialog
class GenericSelectManagementDialog extends GenericDialog
{
function dialog_execute ()
protected $dialogClass = 'selectManagement';
function __construct ($simplePlugin, $attribute)
{
session::set('filterBlacklist', $this->attribute->getFilterBlackList());
session::set('filterWhitelist', $this->attribute->getFilterWhiteList());
return parent::dialog_execute();
$this->attribute = $attribute;
$this->dialog = new $this->dialogClass(...$this->attribute->getSelectManagementParameters());
}
function handle_finish ()
......@@ -150,10 +151,7 @@ abstract class DialogAttribute extends SetAttribute
$this->removeValue($key);
}
function addValue ($value, $attrs)
{
trigger_error("abstract method");
}
abstract function addValue (string $dn, $attrs = NULL);
function searchAndRemove ($value)
{
......@@ -284,10 +282,12 @@ abstract class DialogOrderedArrayAttribute extends OrderedArrayAttribute
{
}
function addValue ($value)
function addValue (string $dn, $attrs = NULL)
{
$this->value[] = $value;
$this->reIndexValues();
if ($attrs !== NULL) {
$this->value[] = $attrs;
$this->reIndexValues();
}
}
function renderButtons ()
......@@ -338,7 +338,7 @@ class GenericDialogAttribute extends DialogAttribute
return [$this->store_attr => $this->getValue()];
}
function addValue ($dn, $attrs)
function addValue (string $dn, $attrs = NULL)
{
if (
($this->isTemplate() && ($attrs === NULL)) ||
......@@ -453,24 +453,6 @@ class GenericDialogAttribute extends DialogAttribute
}
}
/*! \brief Generic dialog for selection using a selectManagement class
*/
class GenericSelectManagementDialog extends GenericSelectDialog
{
protected $dialogClass = 'selectManagement';
function __construct ($simplePlugin, $attribute)
{
$this->attribute = $attribute;
$this->dialog = new $this->dialogClass(...$this->attribute->getSelectManagementParameters());
}
function dialog_execute ()
{
return GenericDialog::dialog_execute();
}
}
/*! \brief Object selection dialog allowing only one object to get selected
*/
class GenericSingleSelectManagementDialog extends GenericSelectManagementDialog
......@@ -883,14 +865,14 @@ class GenericSimplePluginDialog extends GenericDialog
$value[$attr] = $this->dialog->$attr;
}
$this->attribute->addValue($value);
$this->attribute->addValue('', $value);
return FALSE;
}
function handle_cancel ()
{
if ($this->initialDialogValue !== NULL) {
$this->attribute->addValue($this->initialDialogValue);
$this->attribute->addValue('', $this->initialDialogValue);
}
return FALSE;
}
......
This diff is collapsed.
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2013-2016 FusionDirectory
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*!
* \brief Management base class for selection dialogs
*/
class simpleSelectManagement extends simpleManagement
{
protected $skipFooter = TRUE;
protected $skipHeader = TRUE;
protected $skipCpHandler = TRUE;
protected $autoActions = FALSE;
public static $skipSnapshots = TRUE;
protected $departmentRootVisible = FALSE;
function __construct ()
{
if ($this->listXMLPath === NULL) {
$this->listXMLPath = get_template_path('simple-select-list.xml', TRUE, dirname(__FILE__));
}
parent::__construct();
}
/* Build the action menu, fill the object definition, etc, based on objectTypes info */
function configureHeadpage ()
{
parent::configureHeadpage();
$this->headpage->registerElementFilter("selectLink", "simpleSelectManagement::filterSelectLink");
}
function configureFilter ()
{
parent::configureFilter();
if ($this->autoFilter) {
$this->filter->query['0']['backend'] = 'LDAPBlacklist';
}
}
function configureHeadline ()
{
}
function configureFilterCategory ()
{
$infos = objects::infos($this->objectTypes[0]);
$this->filter->category = $infos['aclCategory'];
}
static function filterSelectLink ()
{
if (func_num_args() < 4) {
return '&nbsp';
}
$pid = func_get_arg(0);
$row = func_get_arg(1);
$dn = func_get_arg(2);
$trans = func_get_arg(3);
if (is_array($trans)) {
$trans = $trans[0];
}
if ($trans != '') {
return '<a href="?plug='.$_GET['plug'].'&amp;PID='.$pid.'&amp;act=listing_select_'.$row.'&amp;add_finish=1" title="'.htmlentities($dn, ENT_COMPAT, 'UTF-8').'">'.htmlentities($trans, ENT_COMPAT, 'UTF-8').'</a>';
}
return '';
}
}
<?xml version="1.0" encoding="UTF-8"?>
<filterdef>
<definition>
<category>noneyet</category>
<template>simple-filter.tpl</template>
<initial>true</initial>
</definition>
<search>
<query>
<backend>LDAP</backend>
<filter>FILTER</filter>
<attribute>dn</attribute>
<attribute>cn</attribute>
</query>
<scope>auto</scope>
</search>
<element>
<type>textfield</type>
<tag>NAME</tag>
<size>20</size>
<default></default>
<unset></unset>
<set>FILTER</set>
<autocomplete>
<backend>LDAP</backend>
<filter>FILTER</filter>
<attribute>cn</attribute>
<attribute>description</attribute>
<frequency>0.5</frequency>
<characters>3</characters>
</autocomplete>
</element>
</filterdef>
<?xml version="1.0" encoding="UTF-8"?>
<list>
<definition>
<departmentBrowser>true</departmentBrowser>
<departmentRootVisible>true</departmentRootVisible>
<baseMode>true</baseMode>
<multiSelect>true</multiSelect>
<template>simple-list.tpl</template>
<module>simple</module>
<label>NO LABEL</label>
<defaultSortColumn>1</defaultSortColumn>
</definition>
<table>
<layout>|20px;c|||150px;r|</layout>
<department>
<value>%{filter:departmentType(row,dn)}</value>
</department>
<department>
<value>%{filter:departmentLink(row,dn,description)}</value>
<span>3</span>
</department>
<column>
<value>%{filter:objectType(row,dn)}</value>
</column>
<column>
<label>Name</label>
<sortAttribute>cn</sortAttribute>
<sortType>string</sortType>
<value>%{filter:nameLink(row,dn)}</value>
<export>true</export>
</column>
<column>
<label>Description</label>
<sortAttribute>description</sortAttribute>
<sortType>string</sortType>
<value>%{filter:link(row,dn,"%s",description)}</value>
<export>true</export>
</column>
<column>
<label>Actions</label>
<value>%{filter:actions(dn,row,objectClass)}</value>
</column>
</table>
<actionmenu>
<action>
<type>sub</type>
<image>geticon.php?context=actions&amp;icon=document-new&amp;size=16</image>
<label>Create</label>
<acl>[c]</acl>
</action>
<action>
<name>edit</name>
<type>entry</type>
<image>geticon.php?context=actions&amp;icon=document-edit&amp;size=16</image>
<label>Edit</label>
<acl>[r]</acl>
</action>
<action>
<name>remove</name>
<type>entry</type>
<image>geticon.php?context=actions&amp;icon=edit-delete&amp;size=16</image>
<label>Remove</label>
<acl>[d]</acl>
</action>
<action>
<type>separator</type>
</action>
<action>
<type>exporter</type>
</action>
<action>
<type>separator</type>
</action>
<action>
<type>copypaste</type>
</action>
<action>
<type>snapshot</type>
</action>
</actionmenu>
<actiontriggers snapshot="true" copypaste="true">
<action>
<name>cp</name>
<type>copypaste</type>
</action>
<action>
<name>edit</name>
<type>entry</type>
<image>geticon.php?context=actions&amp;icon=document-edit&amp;size=16</image>
<label>Edit</label>
</action>
<action>
<name>snapshot</name>
<type>snapshot</type>
</action>
<action>
<name>remove</name>
<type>entry</type>
<image>geticon.php?context=actions&amp;icon=edit-delete&amp;size=16</image>
<acl>%acl[d]</acl>
<label>Remove</label>
</action>
</actiontriggers>
</list>
<?xml version="1.0" encoding="UTF-8"?>
<list>
<definition>
<departmentBrowser>true</departmentBrowser>
<departmentRootVisible>true</departmentRootVisible>
<baseMode>true</baseMode>
<multiSelect>true</multiSelect>
<template>simple-select-list.tpl</template>
<module>simple</module>
<label>Please select the desired entries</label>
<defaultSortColumn>1</defaultSortColumn>
</definition>
<table>
<layout>|20px;c|||</layout>
<department>
<value>%{filter:departmentType(row,dn)}</value>
</department>
<department>
<value>%{filter:departmentLink(row,dn,description)}</value>
<span>2</span>
</department>
<column>
<value>%{filter:objectType(row,dn)}</value>
</column>
<column>
<label>Name</label>
<sortAttribute>cn</sortAttribute>
<sortType>string</sortType>
<value>%{filter:selectLink(pid,row,dn,cn)}</value>
<export>true</export>
</column>
<column>
<label>Description</label>
<sortAttribute>description</sortAttribute>
<sortType>string</sortType>
<value>%{filter:selectLink(pid,row,dn,description)}</value>
<export>true</export>
</column>
</table>
<actionmenu>
</actionmenu>
<actiontriggers snapshot="false" copypaste="false">
</actiontriggers>
</list>
......@@ -58,14 +58,14 @@ class ACLsAssignmentDialog extends GenericDialog
msg_dialog::displayChecks($messages);
return $this->dialog->execute();
}
$this->attribute->addValue($this->dialog->getAclEntry());
$this->attribute->addValue('', $this->dialog->getAclEntry());
return FALSE;
}
function handle_cancel ()
{
if ($this->initialAclValue !== NULL) {
$this->attribute->addValue($this->initialAclValue);
$this->attribute->addValue('', $this->initialAclValue);
}
return FALSE;
}
......
......@@ -43,14 +43,14 @@ class ACLEditionDialog extends GenericDialog
function handle_finish ()
{
$this->attribute->addValue($this->aclContents);
$this->attribute->addValue('', $this->aclContents);
return FALSE;
}
function handle_cancel ()
{
if ($this->initialAclValue !== NULL) {
$this->attribute->addValue($this->initialAclValue);
$this->attribute->addValue('', $this->initialAclValue);
}
return FALSE;
}
......
<?xml version="1.0" encoding="UTF-8"?>
<list>
<definition>
<baseMode>true</baseMode>
<multiSelect>true</multiSelect>
<template>simple-list.tpl</template>
<module>departments</module>
<label>List of departments</label>
<defaultSortColumn>1</defaultSortColumn>
</definition>
<table>
<layout>|20px;c|||70px;r|</layout>
<column>
<value>%{filter:objectType(row,dn)}</value>
</column>
<column>
<label>Department</label>
<sortAttribute>ou</sortAttribute>
<sortType>string</sortType>
<value>%{filter:depLabel(row,dn,"%s",ou,pid,base)}</value>
<export>true</export>
</column>
<column>
<label>Description</label>
<sortAttribute>description</sortAttribute>
<sortType>string</sortType>
<value>%{filter:depLabel(row,dn,"%s",description,pid,base)}</value>
<export>true</export>
</column>
<column>
<label>Actions</label>
<value>%{filter:actions(dn,row,objectClass)}</value>
</column>
</table>
<actionmenu>
<action>
<type>sub</type>
<image>geticon.php?context=actions&amp;icon=document-new&amp;size=16</image>
<label>Create</label>
</action>
<action>
<type>separator</type>
</action>
<action>
<type>exporter</type>
</action>
<action>
<type>separator</type>
</action>
<action>
<name>remove</name>
<type>entry</type>
<image>geticon.php?context=actions&amp;icon=edit-delete&amp;size=16</image>
<label>Remove</label>
</action>
</actionmenu>
<actiontriggers snapshot="false" copypaste="false">
<action>
<name>edit</name>
<type>entry</type>
<nospan></nospan>
<image>geticon.php?context=actions&amp;icon=document-edit&amp;size=16</image>
<label>Edit</label>
</action>
<action>
<name>remove</name>
<type>entry</type>
<nospan></nospan>
<image>geticon.php?context=actions&amp;icon=edit-delete&amp;size=16</image>
<acl>department[d]</acl>
<label>Remove</label>
</action>
</actiontriggers>
</list>