X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_management.inc;h=ba745812558848fc7f379e8718f26fd02479c249;hb=76226dfbd4fe37f09a9cb125cd2818b070e59159;hp=c03e860e55c7dd92337ca4897299733ab65ffc06;hpb=8527e9722912f06e9f2728d79ab993b806b4b841;p=gosa.git diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index c03e860e5..ba7458125 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -122,6 +122,7 @@ class management $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"); @@ -286,8 +287,12 @@ class management @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){ - $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{ @@ -309,7 +314,6 @@ class management // Add locks $dns_names = array(); $types = array(); - $h = $this->getHeadpage(); // Build list of object -labels foreach($h->objectTypes as $type){ @@ -355,10 +359,15 @@ class management @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){ + $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? - $acl = $this->ui->get_permissions($dn, $aclCategory."/".$aclPlugin); if(preg_match("/d/",$acl)){ // Delete the object @@ -399,7 +408,7 @@ class management 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"; @@ -408,7 +417,7 @@ class management $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); } @@ -664,7 +673,7 @@ class management set_object_info($this->dn); $user = get_lock($this->dn); if ($user != ""){ - return(gen_locked_message ($user, $this->dn,TRUE)); + return(gen_locked_message ($user, array($this->dn),TRUE)); } add_lock ($this->dn, $this->ui->dn); @@ -711,6 +720,17 @@ class management } + /*! \brief Close filter dialog + */ + protected function cancelFilter() + { + if($this->dialogObject instanceOf userFilter){ + $this->remove_lock(); + $this->closeDialogs(); + } + } + + /*! \brief Save filter modifcations. */ protected function saveFilter()