From: hickert Date: Tue, 5 Jan 2010 16:41:52 +0000 (+0000) Subject: Updated FAI X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=430ccd620b9f52e3cf0dc49a566b9c855435466c;p=gosa.git Updated FAI git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15064 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index fb7d3091d..73652a2db 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -92,6 +92,18 @@ class faiManagement extends management } + function removeEntryRequested($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") + { + $headpage = $this->getHeadpage(); + if(count($target) == 1){ + $entry = $headpage->getEntry($target[0]); + if($entry){ + $this->dialogObject = new faiGroupHandle($entry['GROUPS'],"remove"); + } + } + } + + function editByGroup() { if($this->dialogObject instanceOf faiGroupHandle && $this->dialogObject->get_mode() == "edit"){ @@ -101,6 +113,68 @@ class faiManagement extends management $data = array_pop($entry); $type = $this->get_type($data); management::editEntry('editEntry',array($data['dn']),array(),$type[0],$type[2],$type[1]); + }elseif($this->dialogObject instanceOf faiGroupHandle && $this->dialogObject->get_mode() == "remove"){ + $this->dialogObject->save_object(); + $to_delete = $entry = $this->dialogObject->get_selected(); + $dns = array(); + + + // Check FAIstate to ensure that we do not remove frozen objects + // additionally check ACLs + $locked = array(); + $disallowed = array(); + foreach($to_delete as $obj){ + if(isset($obj['FAIstate']) && preg_match('/^freeze/', $obj['FAIstate'])){ + $locked[] = $obj['dn']; + }else{ + $type = $this->get_type($obj); + $acl = $this->ui->get_permissions($obj['dn'], 'acl/'.$type[1]); + if(!preg_match("/d/",$acl)){ + $disallowed[] = $obj['dn']; + }else{ + $dns[] = $obj['dn']; + } + } + } + + // Display info dialog about locked and not removeable entries + if(count($locked)){ + msg_dialog::display(_("Branch locked"),sprintf(_("The following entries are locked, you can't remove them %s."), + msgPool::buildList($locked))); + } + + // Display info dialog about not removeable entries due to permissions + if(count($disallowed)){ + msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG); + } + + // There are entries left to be removed + if(count($dns)){ + $this->closeDialogs(); + $this->dns = $dns; + + @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel requested!"); + + // check locks + if ($user= get_multiple_locks($this->dns)){ + return(gen_locked_message($user,$this->dns)); + } + + // Add locks + $dns_names = array(); + foreach($this->dns as $dn){ + $dns_names[] =LDAP::fix($dn); + } + add_lock ($this->dns, $this->ui->dn); + + // Display confirmation dialog. + $smarty = get_smarty(); + $smarty->assign("info", msgPool::deleteInfo($dns_names,_($this->objectName))); + $smarty->assign("multiple", true); + return($smarty->fetch(get_template_path('remove.tpl', TRUE))); + }else{ + $this->closeDialogs(); + } } } diff --git a/gosa-plugins/fai/admin/fai/faiGroupHandle.tpl b/gosa-plugins/fai/admin/fai/faiGroupHandle.tpl index c9794b2d4..7410399e4 100644 --- a/gosa-plugins/fai/admin/fai/faiGroupHandle.tpl +++ b/gosa-plugins/fai/admin/fai/faiGroupHandle.tpl @@ -20,7 +20,7 @@ {$types.$key.NAME} {if $item.freezed}({t}Freezed{/t}){/if} - ({$item.description}) + ({$item.description.0}) {/foreach} diff --git a/gosa-plugins/fai/admin/fai/remove.tpl b/gosa-plugins/fai/admin/fai/remove.tpl index d63f86d14..f60f42d25 100644 --- a/gosa-plugins/fai/admin/fai/remove.tpl +++ b/gosa-plugins/fai/admin/fai/remove.tpl @@ -1,24 +1,18 @@
- {t}Warning{/t} +  {t}Warning{/t}
-

- {$warning} - {t}This includes 'all' object information. Please double check if your really want to do this since there is no way for GOsa to get your data back.{/t} + {$info} + {t}This includes all account data, system access rules, imap settings, etc. for this user. Please double check if your really want to do this since there is no way for GOsa to get your data back.{/t}

- {t}Best thing to do before performing this action would be to save the current contents of your LDAP tree in a file. So - if you've done so - press 'Delete' to continue or 'Cancel' to abort.{/t} + {t}So - if you're sure - press 'Delete' to continue or 'Cancel' to abort.{/t}

-{if $multiple} - -   - -{else} - -   - -{/if} + + +  

+