summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 56a7aae)
raw | patch | inline | side by side (parent: 56a7aae)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 14 May 2008 11:37:22 +0000 (11:37 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 14 May 2008 11:37:22 +0000 (11:37 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10889 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc | patch | blob | history | |
gosa-plugins/gofax/gofax/blocklists/main.inc | patch | blob | history |
diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistManagement.inc
index 8d2d9b6fe4190761db61b0782a34c983d2f9e4cc..51bdd3da38ea4f36d0cab06a89a40ba1493a942f 100644 (file)
/* Call parent execute */
plugin::execute();
- session::set('LOCK_VARS_TO_USE',array("/^goFaxBlocklist_/","/^act$/","/^id$/","/^remove_multiple_blocklists/","/^item_selected/"));
+ session::set('LOCK_VARS_TO_USE',array("/^menu_action/","/^goFaxBlocklist_/","/^act$/","/^id$/","/^remove_multiple_blocklists/","/^item_selected/"));
/***************
Init vars
isset($_POST['delete_blocklist_cancel']) ||
isset($_POST['delete_lock'])){
- del_lock ($this->dn);
+ $this->remove_lock();
$this->dialog = NULL;
session::un_set('objectinfo');
}
$this->dialog->save ();
if (!isset($_POST['edit_apply'])){
- del_lock ($this->dn);
+ $this->remove_lock();
$this->dn= "";
$this->dialog = NULL;
session::un_set('objectinfo');
$ids = $this->list_get_selected_items();
if(count($ids)){
+
foreach($ids as $id){
- $dn = $this->blocklists[$id]['dn'];
- if (($user= get_lock($dn)) != ""){
- return(gen_locked_message ($user, $dn));
- }
- $this->dns[$id] = $dn;
+ $this->dns[$id] = $this->blocklists[$id]['dn'];
+ }
+ if ($user= get_multiple_locks($this->dns)){
+ return(gen_locked_message($user,$this->dns));
}
$dns_names = array();
foreach($this->dns as $dn){
- add_lock ($dn, $this->ui->dn);
$dns_names[]=@LDAP::fix( $dn);
}
+ add_lock ($this->dns, $this->ui->dn);
/* Lock the current entry, so nobody will edit it during deletion */
$smarty->assign("info", msgPool::deleteInfo($dns_names,_("blocklist")));
msg_dialog::display(_("Permission error"), msgPool::permDelete($dn), ERROR_DIALOG);
}
/* Remove lock file after successfull deletion */
- del_lock ($dn);
- unset($this->dns[$key]);
}
+ $this->remove_lock();
+ $this->dns = array();
$this->reload();
}
/* Remove lock */
if(isset($_POST['delete_multiple_blocklist_cancel'])){
foreach($this->dns as $key => $dn){
- del_lock ($dn);
+ $this->remove_lock();
unset($this->dns[$key]);
}
}
$this->dialog = new faxblocktabs($this->config,$this->config->data['TABS']['FAXBLOCKTABS'],$this->dn);
$this->dialog->delete();
$this->dialog = NULL;
- del_lock ($this->dn);
+ $this->remove_lock();
} else {
msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG);
}
return("");
}
+
+ /*! \brief Remove entry locks if the plugin was aborted.
+ */
+ function remove_lock()
+ {
+ if($this->dn) del_lock($this->dn);
+ if(is_array($this->dns) && count($this->dns)) del_lock($this->dns);
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/gosa-plugins/gofax/gofax/blocklists/main.inc b/gosa-plugins/gofax/gofax/blocklists/main.inc
index e39ced2a9384db365b3a0cf89a94590b23852924..745800383f71860102cbe1679f5725644b3d2c75 100644 (file)
if ($remove_lock){
if(session::is_set('blocklist')){
$blocklist = session::get('blocklist');
- del_lock ($ui->dn);
+ $blocklist->remove_lock ($ui->dn);
session::un_set ('blocklist');
}
} else {