index 179d327c02d60ed7f4b13e63b5873af25fa6884b..78fe1fc024d4447e3ea10356278a4fe90232a563 100644 (file)
$this->registerAction("config-filter","editFilter");
$this->registerAction("saveFilter","saveFilter");
$this->registerAction("config-filter","editFilter");
$this->registerAction("saveFilter","saveFilter");
+ $this->registerAction("cancelFilter","cancelFilter");
// To temporay disable the filter caching UNcomment this line.
#session::global_un_set(get_class($this)."_filter");
// To temporay disable the filter caching UNcomment this line.
#session::global_un_set(get_class($this)."_filter");
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel requested!");
// Check permissons for each target
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel requested!");
// Check permissons for each target
+ $h = $this->getHeadpage();
+ $oTypes = $h->objectTypes;
foreach($target as $dn){
foreach($target as $dn){
- $acl = $this->ui->get_permissions($dn, $this->aclCategory."/".$this->aclPlugin);
+ $entry = $h->getEntry($dn);
+ $obj = $h->getObjectType($oTypes, $entry['objectClass']);
+ $acl = $this->ui->get_permissions($dn, $obj['category']."/".$obj['class']);
if(preg_match("/d/",$acl)){
$this->dns[] = $dn;
}else{
if(preg_match("/d/",$acl)){
$this->dns[] = $dn;
}else{
// Add locks
$dns_names = array();
// Add locks
$dns_names = array();
+ $types = array();
+
+ // Build list of object -labels
+ foreach($h->objectTypes as $type){
+ $map[$type['objectClass']]= $type['label'];
+ }
+
foreach($this->dns as $dn){
foreach($this->dns as $dn){
- $dns_names[] =LDAP::fix($dn);
+ $tmp = $h->getType($dn);
+ if(isset($map[$tmp])){
+ $dns_names[LDAP::fix($dn)] = _($map[$tmp]);
+ }else{
+ $dns_names[] =LDAP::fix($dn);
+ }
}
add_lock ($this->dns, $this->ui->dn);
// Display confirmation dialog.
$smarty = get_smarty();
}
add_lock ($this->dns, $this->ui->dn);
// Display confirmation dialog.
$smarty = get_smarty();
- $smarty->assign("info", msgPool::deleteInfo($dns_names,_($this->objectName)));
+ $smarty->assign("info", msgPool::deleteInfo($dns_names));
$smarty->assign("multiple", true);
return($smarty->fetch(get_template_path('removeEntries.tpl')));
}
$smarty->assign("multiple", true);
return($smarty->fetch(get_template_path('removeEntries.tpl')));
}
* @param Array 'all' A combination of both 'action' and 'target'.
*/
function removeEntryConfirmed($action="",$target=array(),$all=array(),
* @param Array 'all' A combination of both 'action' and 'target'.
*/
function removeEntryConfirmed($action="",$target=array(),$all=array(),
- $altTabClass="",$altTabType="",$altAclCategory="")
+ $altTabClass="",$altTabType="", $altAclCategory="",$altAclPlugin="")
{
$tabType = $this->tabType;
$tabClass = $this->tabClass;
$aclCategory = $this->aclCategory;
{
$tabType = $this->tabType;
$tabClass = $this->tabClass;
$aclCategory = $this->aclCategory;
+ $aclPlugin = $this->aclPlugin;
if(!empty($altTabClass)) $tabClass = $altTabClass;
if(!empty($altTabType)) $tabType = $altTabType;
if(!empty($altAclCategory)) $aclCategory = $altAclCategory;
if(!empty($altTabClass)) $tabClass = $altTabClass;
if(!empty($altTabType)) $tabType = $altTabType;
if(!empty($altAclCategory)) $aclCategory = $altAclCategory;
+ if(!empty($altAclPlugin)) $aclPlugin = $altAclPlugin;
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel confirmed!");
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel confirmed!");
+ // Check permissons for each target
+ $h = $this->getHeadpage();
+ $oTypes = $h->objectTypes;
foreach($this->dns as $key => $dn){
foreach($this->dns as $key => $dn){
+ $entry = $h->getEntry($dn);
+ $obj = $h->getObjectType($oTypes, $entry['objectClass']);
+ $acl = $this->ui->get_permissions($dn, $obj['category']."/".$obj['class']);
// Check permissions, are we allowed to remove this object?
// Check permissions, are we allowed to remove this object?
- $acl = $this->ui->get_permissions($dn, $this->aclCategory."/".$this->aclPlugin);
if(preg_match("/d/",$acl)){
// Delete the object
$this->dn = $dn;
if(preg_match("/d/",$acl)){
// Delete the object
$this->dn = $dn;
- $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory, true, true);
+ $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn,
+ $aclCategory, true, true);
$this->tabObject->set_acl_base($this->dn);
$this->tabObject->parent = &$this;
$this->tabObject->delete ();
$this->tabObject->set_acl_base($this->dn);
$this->tabObject->parent = &$this;
$this->tabObject->delete ();
if(isset($_POST['delete_confirmed'])) $action['action'] = "removeConfirmed";
if(isset($_POST['delete_cancel'])) $action['action'] = "cancelDelete";
if(isset($_POST['saveFilter'])) $action['action'] = "saveFilter";
if(isset($_POST['delete_confirmed'])) $action['action'] = "removeConfirmed";
if(isset($_POST['delete_cancel'])) $action['action'] = "cancelDelete";
if(isset($_POST['saveFilter'])) $action['action'] = "saveFilter";
- if(isset($_POST['cancelFilter'])) $action['action'] = "cancel";
+ if(isset($_POST['cancelFilter'])) $action['action'] = "cancelFilter";
// Detect Snapshot actions
if(isset($_POST['CreateSnapshot'])) $action['action'] = "saveSnapshot";
// Detect Snapshot actions
if(isset($_POST['CreateSnapshot'])) $action['action'] = "saveSnapshot";
$once =TRUE;
if(preg_match("/^RestoreSnapShot_/",$name) && $once){
$once = FALSE;
$once =TRUE;
if(preg_match("/^RestoreSnapShot_/",$name) && $once){
$once = FALSE;
- $entry = base64_decode(preg_replace("/^RestoreSnapShot_([^_]*)_[xy]$/i","\\1",$name));
+ $entry = base64_decode(preg_replace("/^RestoreSnapShot_(.*)$/i","\\1",$name));
$action['action'] = "restoreSnapshot";
$action['targets'] = array($entry);
}
$action['action'] = "restoreSnapshot";
$action['targets'] = array($entry);
}
}
}
+ /*! \brief Close filter dialog
+ */
+ protected function cancelFilter()
+ {
+ if($this->dialogObject instanceOf userFilter){
+ $this->remove_lock();
+ $this->closeDialogs();
+ }
+ }
+
+
/*! \brief Save filter modifcations.
*/
protected function saveFilter()
/*! \brief Save filter modifcations.
*/
protected function saveFilter()