From 2d01af8cd53ea90a596c6813c053809caf22f662 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 31 Mar 2010 08:33:57 +0000 Subject: [PATCH] Updated removal of applications -We were able to remove frozen apps git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17423 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../application-filter-release.xml | 1 + .../admin/applications/application-filter.xml | 1 + .../applications/application-list-release.xml | 4 +-- .../class_applicationManagement.inc | 35 +++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/goto/admin/applications/application-filter-release.xml b/gosa-plugins/goto/admin/applications/application-filter-release.xml index 35702f59a..e0b32866e 100644 --- a/gosa-plugins/goto/admin/applications/application-filter-release.xml +++ b/gosa-plugins/goto/admin/applications/application-filter-release.xml @@ -9,6 +9,7 @@ objectClass cn description + FAIstate auto default diff --git a/gosa-plugins/goto/admin/applications/application-filter.xml b/gosa-plugins/goto/admin/applications/application-filter.xml index 0cfdd58d3..f0f0436e6 100644 --- a/gosa-plugins/goto/admin/applications/application-filter.xml +++ b/gosa-plugins/goto/admin/applications/application-filter.xml @@ -10,6 +10,7 @@ objectClass cn description + FAIstate diff --git a/gosa-plugins/goto/admin/applications/application-list-release.xml b/gosa-plugins/goto/admin/applications/application-list-release.xml index 6ea5a8d8b..f53a65b8a 100644 --- a/gosa-plugins/goto/admin/applications/application-list-release.xml +++ b/gosa-plugins/goto/admin/applications/application-list-release.xml @@ -64,13 +64,13 @@ sub - images/lists/new.png + images/lists/element.png[new] new entry - images/lists/new.png + plugins/goto/images/select_application.png[new] diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc index 08605166e..e8ee575ff 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc @@ -86,6 +86,41 @@ class applicationManagement extends management } + /*! \brief Someone wants to remove some object(s) + * ask for a confirmation now. + */ + function removeEntryRequested($action="",$target=array(),$all=array(), + $altTabClass ="", $altTabType = "", $altAclCategory="") + { + // Close dialogs and remove locks for currently handled dns + $this->cancelEdit(); + + // Do not allow to remove objects with state freeezed + $errors = $disallowed = array(); + $headpage = $this->getHeadpage(); + foreach($target as $dn){ + + $obj = $headpage->getEntry($dn); + $acl = $this->ui->get_permissions($obj['dn'],"application/application"); + if(!preg_match("/d/",$acl)){ + $disallowed[] = $obj['dn']; + }elseif(isset($obj['FAIstate']) && preg_match('/freeze/i', $obj['FAIstate'][0])){ + $errors[] = $obj['dn']; + }else{ + $this->dns[] = $obj['dn']; + } + } + if(count($errors)){ + msg_dialog::display(_("Branch locked"), + sprintf(_("The following entries are locked, you can't remove them %s."),msgPool::buildList($errors)), INFO_DIALOG); + } + if(count($disallowed)){ + msg_dialog::display(_("Permission error"), msgPool::permDelete($disallowed), ERROR_DIALOG); + } + return(management::removeEntryRequested($action, $this->dns)); + } + + /*! \brief Overridden render method of class mangement. * this allows us to add a release selection box. */ -- 2.30.2