index 1cc964db6e3cb0905bf37a36ca4d0a9dc20d7075..2e42c572eca2fd1fd97b342d2064e1a900a9775a 100644 (file)
$this->registerAction("restore", "restoreSnapshotDialog");
$this->registerAction("saveSnapshot","saveSnapshot");
$this->registerAction("restoreSnapshot","restoreSnapshot");
$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");
$this->registerAction("saveFilter","saveFilter");
$this->registerAction("cancelSnapshot","closeDialogs");
$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");
// Display ok, (apply) and cancel buttons
$str.= "<p style=\"text-align:right\">\n";
// Display ok, (apply) and cancel buttons
$str.= "<p style=\"text-align:right\">\n";
- $str.= "<button type=\"submit\" name=\"edit_finish\" style=\"width:80px\">".msgPool::okButton()."</button>\n";
+ $str.= "<button type=\"submit\" name=\"edit_finish\">".msgPool::okButton()."</button>\n";
$str.= " \n";
if($this->displayApplyBtn){
$str.= "<button type=\"submit\" name=\"edit_apply\">".msgPool::applyButton()."</button>\n";
$str.= " \n";
if($this->displayApplyBtn){
$str.= "<button type=\"submit\" name=\"edit_apply\">".msgPool::applyButton()."</button>\n";
// Check permissons for each target
$h = $this->getHeadpage();
// 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']);
foreach($target as $dn){
$entry = $h->getEntry($dn);
$obj = $h->getObjectType($oTypes, $entry['objectClass']);
// Check permissons for each target
$h = $this->getHeadpage();
// 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']);
foreach($this->dns as $key => $dn){
$entry = $h->getEntry($dn);
$obj = $h->getObjectType($oTypes, $entry['objectClass']);
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['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";
if(isset($_POST['delete_cancel'])) $action['action'] = "cancelDelete";
if(isset($_POST['saveFilter'])) $action['action'] = "saveFilter";
if(isset($_POST['cancelFilter'])) $action['action'] = "cancelFilter";
$this->dialogObject->parent = &$this;
}else{
$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);
}
}
ERROR_DIALOG);
}
}
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Snaptshot restored!");
$this->closeDialogs();
}else{
@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);
}
}
ERROR_DIALOG);
}
}
$this->dialogObject->display_restore_dialog = true;
$this->dialogObject->parent = &$this;
}else{
$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{
ERROR_DIALOG);
}
}else{
$this->dialogObject->display_restore_dialog = true;
$this->dialogObject->parent = &$this;
}else{
$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);
}
}
ERROR_DIALOG);
}
}
$this->tabObject->parent = &$this;
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Create new entry initiated!");
} else {
$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);
}
}
}
}
}
}
set_object_info($this->dn);
$user = get_lock($this->dn);
if ($user != ""){
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);
}
add_lock ($this->dn, $this->ui->dn);
}
}
}
}
+
/*! \brief Save filter modifcations.
*/
protected function saveFilter()
/*! \brief Save filter modifcations.
*/
protected function saveFilter()
function handle_post_events($mode, $addAttrs= array())
{
if(!in_array($mode, array('add','remove','modify'))){
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){
return;
}
switch ($mode){