summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9787536)
raw | patch | inline | side by side (parent: 9787536)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 14 May 2008 12:21:03 +0000 (12:21 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 14 May 2008 12:21:03 +0000 (12:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10892 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc | patch | blob | history | |
gosa-plugins/gofon/gofon/conference/main.inc | patch | blob | history |
diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceManagment.inc
index 9e9d805ab4febc359bb5f096a78f613785692e10..3e527f01e3410e73f6f02e7e63df18fb11103b87 100644 (file)
var $ui = NULL;
var $DivListConference = NULL;
- var $CopyPasteHandler = NULL;
+ var $CopyPasteHandler = NULL;
var $start_pasting_copied_objects = FALSE;
+ var $dns = array();
/* Initialise Class */
function phoneConferenceManagment (&$config, $ui)
/* Call parent execute */
plugin::execute();
- session::set('LOCK_VARS_TO_USE',array("/^id$/","/^act$/","/^conference_/","/^item_selected/","/^remove_multiple_conferences/"));
+ session::set('LOCK_VARS_TO_USE',array("/^menu_action/","/^id$/","/^act$/","/^conference_/","/^item_selected/","/^remove_multiple_conferences/"));
/***************
Variable initialisation
/* Reset requested? */
if (isset($_POST['edit_cancel'])){
- if (isset($this->conftab)){
- del_lock ($this->conftab->dn);
- unset ($this->conftab);
- }
+ $this->remove_lock();
$this->conftab= NULL;
$this->lognames= array();;
$this->cn= "";
if(count($ids)){
+ /* Collect dns */
foreach($ids as $id){
- $dn = $this->conferences[$id]['dn'];
- if (($user= get_lock($dn)) != ""){
- return(gen_locked_message ($user, $dn));
- }
- $this->dns[$id] = $dn;
+ $this->dns[$id] = $this->conferences[$id]['dn'];
}
+ /* Check locks */
+ if ($user= get_multiple_locks($this->dns)){
+ return(gen_locked_message($user,$this->dns));
+ }
+
+ /* Prepare entry list to be displayed */
$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,_("conference")));
} else {
msg_dialog::display(_("Permission error"), _("You have not permission to delete this entry!"), ERROR_DIALOG);
}
- /* Remove lock file after successfull deletion */
- del_lock ($dn);
- unset($this->dns[$key]);
}
+ /* Remove lock file after successfull deletion */
+ $this->remove_lock();
+ $this->dns = array();
}
/* Remove lock */
if(isset($_POST['delete_multiple_conference_cancel'])){
- foreach($this->dns as $key => $dn){
- del_lock ($dn);
- unset($this->dns[$key]);
- }
+ $this->remove_lock();
+ $this->dns =array();
}
gosa_log ("goFonConference object '".$this->dn."' has been saved");
if (!isset($_POST['edit_apply'])){
- if ($this->dn != "new"){
- del_lock ($this->dn);
- }
- del_lock ($this->conftab->dn);;
+ $this->remove_lock();
unset ($this->conftab);
$this->conftab= NULL;
session::un_set('objectinfo');
$this->DivListConference->save_object();
}
+
+ /*! \brief Remove entry locks if the plugin was aborted.
+ */
function remove_lock()
{
- if (isset($this->dn)){
- del_lock ($this->dn);
+ if($this->dn) del_lock($this->dn);
+ if(is_array($this->dns) && count($this->dns)) del_lock($this->dns);
+ if(isset($this->conftab) && isset($this->conftab->dn)){
+ del_lock ($this->conftab->dn);
}
}
diff --git a/gosa-plugins/gofon/gofon/conference/main.inc b/gosa-plugins/gofon/gofon/conference/main.inc
index e557c1d3d3aa9b38c6687f86af5424e24947b40d..d8f7626127f5f4cd5e8c71723bb7ee8c545ae957 100644 (file)
if(session::is_set('conference')){
$conference = session::get('conference');
$conference->remove_lock();
- del_lock ($ui->dn);
session::un_set ('conference');
}
} else {