X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_management.inc;h=2e42c572eca2fd1fd97b342d2064e1a900a9775a;hb=b9fc1972cf2270252fc2a9940feab21c93372e94;hp=26ca752f6e32a979198baacb3da6ad4306453a44;hpb=e13b1556c0e4c2867216a115e7b39f811ff05938;p=gosa.git diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index 26ca752f6..2e42c572e 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -118,6 +118,7 @@ class management $this->registerAction("restore", "restoreSnapshotDialog"); $this->registerAction("saveSnapshot","saveSnapshot"); $this->registerAction("restoreSnapshot","restoreSnapshot"); + $this->registerAction("removeSnapshotConfirmed","removeSnapshotConfirmed"); $this->registerAction("cancelSnapshot","closeDialogs"); $this->registerAction("config-filter","editFilter"); @@ -288,7 +289,7 @@ class management // Check permissons for each target $h = $this->getHeadpage(); - $oTypes = $h->objectTypes; + $oTypes = array_reverse($h->objectTypes); foreach($target as $dn){ $entry = $h->getEntry($dn); $obj = $h->getObjectType($oTypes, $entry['objectClass']); @@ -361,7 +362,7 @@ class management // Check permissons for each target $h = $this->getHeadpage(); - $oTypes = $h->objectTypes; + $oTypes = array_reverse($h->objectTypes); foreach($this->dns as $key => $dn){ $entry = $h->getEntry($dn); $obj = $h->getObjectType($oTypes, $entry['objectClass']); @@ -406,6 +407,7 @@ class management if(isset($_POST['edit_finish'])) $action['action'] = "save"; if(isset($_POST['edit_cancel'])) $action['action'] = "cancel"; if(isset($_POST['delete_confirmed'])) $action['action'] = "removeConfirmed"; + if(isset($_POST['delete_snapshot_confirm'])) $action['action'] = "removeSnapshotConfirmed"; if(isset($_POST['delete_cancel'])) $action['action'] = "cancelDelete"; if(isset($_POST['saveFilter'])) $action['action'] = "saveFilter"; if(isset($_POST['cancelFilter'])) $action['action'] = "cancelFilter"; @@ -457,7 +459,7 @@ class management $this->dialogObject->parent = &$this; }else{ - msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to create a snapshot for %s."),$entry), + msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to create a snapshot for %s!"), bold($entry)), ERROR_DIALOG); } } @@ -504,7 +506,22 @@ class management @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Snaptshot restored!"); $this->closeDialogs(); }else{ - msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to restore a snapshot for %s."),$entry), + msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to restore a snapshot for %s!"), bold($entry)), + ERROR_DIALOG); + } + } + + + /*! \brief Removes a snapshot object. + */ + function removeSnapshotConfirmed($action="",$target=array(),$all=array()) + { + $entry = $this->dialogObject->del_dn; + if(!empty($entry) && $this->ui->allow_snapshot_create($entry,$this->aclCategory)){ + $this->snapHandler->remove_snapshot($entry); + @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$entry,"Snaptshot removed!"); + }else{ + msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to remove a snapshot for %s!"), bold($entry)), ERROR_DIALOG); } } @@ -541,7 +558,7 @@ class management $this->dialogObject->display_restore_dialog = true; $this->dialogObject->parent = &$this; }else{ - msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to restore a snapshot for %s."),$entry), + msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to restore a snapshot for %s!"), bold($entry)), ERROR_DIALOG); } }else{ @@ -555,7 +572,7 @@ class management $this->dialogObject->display_restore_dialog = true; $this->dialogObject->parent = &$this; }else{ - msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to restore a snapshot for %s."),$entry), + msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to restore a snapshot for %s!"), bold($entry)), ERROR_DIALOG); } } @@ -614,7 +631,7 @@ class management $this->tabObject->parent = &$this; @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Create new entry initiated!"); } else { - msg_dialog::display(_("Error"), sprintf(_("No tab declaration for '%s' found in your configuration file. Cannot create plugin instance!"), $tabType), ERROR_DIALOG); + msg_dialog::display(_("Error"), sprintf(_("No tab definition for %s found in configuration file: cannot create plugin instance!"), bold($tabType)), ERROR_DIALOG); } } } @@ -996,7 +1013,7 @@ class management function handle_post_events($mode, $addAttrs= array()) { if(!in_array($mode, array('add','remove','modify'))){ - trigger_error(sprintf("Invalid post event type given '%s'! Valid types are [add,modify,remove].", $mode)); + trigger_error(sprintf("Invalid post event type given %s! Valid types are [add,modify,remove].", bold($mode))); return; } switch ($mode){