diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc
index db673c490b5cc08ba4c91e0da94ebd5e5220f94c..7024e7991199da05e2c41791cfbdcc465f2e8075 100644 (file)
var $app_base ="";
var $app_release ="";
var $app_base ="";
var $app_release ="";
+ var $dns = array();
+
function IsReleaseManagementActivated()
{
/* Check if we should enable the release selection */
function IsReleaseManagementActivated()
{
/* Check if we should enable the release selection */
/* These vars will be stored if you try to open a locked app,
to be able to perform your last requests after showing a warning message */
/* These vars will be stored if you try to open a locked app,
to be able to perform your last requests after showing a warning message */
- session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^appl_edit_/","/^appl_del_/","/^item_selected/","/^remove_multiple_applications/"));
+ session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^appl_edit_/","/^appl_del_/","/^item_selected/","/^remove_multiple_applications/","/^menu_action/"));
$smarty = get_smarty(); // Smarty instance
$s_action = ""; // Contains the action to proceed
$smarty = get_smarty(); // Smarty instance
$s_action = ""; // Contains the action to proceed
/* Cancel dialogs */
if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){
/* Cancel dialogs */
if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){
- del_lock ($this->apptabs->dn);
- unset ($this->apptabs);
+ $this->remove_lock();
$this->apptabs= NULL;
session::un_set('objectinfo');
}
$this->apptabs= NULL;
session::un_set('objectinfo');
}
/* Application has been saved successfully, remove lock from
LDAP. */
if ($this->dn != "new"){
/* Application has been saved successfully, remove lock from
LDAP. */
if ($this->dn != "new"){
- del_lock ($this->dn);
+ $this->remove_lock();
}
}
- unset ($this->apptabs);
$this->apptabs= NULL;
session::un_set('objectinfo');
$this->apptabs= NULL;
session::un_set('objectinfo');
+ }else{
+
+ /* Reinitialize tab */
+ if($this->apptabs instanceof tabs){
+ $this->apptabs->re_init();
+ }
}
} else {
/* Ok. There seem to be errors regarding to the tab data,
}
} else {
/* Ok. There seem to be errors regarding to the tab data,
$ids = $this->list_get_selected_items();
if(count($ids)){
$ids = $this->list_get_selected_items();
if(count($ids)){
-
+ $this->dns = array();
foreach($ids as $id){
foreach($ids as $id){
- $dn = $this->applications[$id]['dn'];
- $this->dns[$id] = $dn;
+ $this->dns[$id] = $this->applications[$id]['dn'];
}
if ($user= get_multiple_locks($this->dns)){
return(gen_locked_message($user,$this->dns));
}
}
if ($user= get_multiple_locks($this->dns)){
return(gen_locked_message($user,$this->dns));
}
- $dns_names[] = array();
+ $dns_names = array();
foreach($this->dns as $dn){
add_lock ($dn, $this->ui->dn);
$dns_names[] =@LDAP::fix($dn);
foreach($this->dns as $dn){
add_lock ($dn, $this->ui->dn);
$dns_names[] =@LDAP::fix($dn);
msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
new log("security","application/".get_class($this),$dn,array(),"Tried to trick deletion.");
}
msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
new log("security","application/".get_class($this),$dn,array(),"Tried to trick deletion.");
}
- /* 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_application_cancel'])){
/* Remove lock */
if(isset($_POST['delete_multiple_application_cancel'])){
- foreach($this->dns as $key => $dn){
- del_lock ($dn);
- unset($this->dns[$key]);
- }
+
+ /* Remove lock file after successfull deletion */
+ $this->remove_lock();
+ $this->dns = array();
}
/****************
}
/****************
}
/* Remove lock file after successfull deletion */
}
/* Remove lock file after successfull deletion */
- del_lock ($this->dn);
+ $this->remove_lock();
}
}
/* Delete application canceled? */
if (isset($_POST['delete_cancel'])){
/* Delete application canceled? */
if (isset($_POST['delete_cancel'])){
- del_lock ($this->dn);
+ $this->remove_lock();
session::un_set('objectinfo');
}
session::un_set('objectinfo');
}
/* Get dialog */
$this->CopyPasteHandler->SetVar("base",$this->app_base);
/* Get dialog */
$this->CopyPasteHandler->SetVar("base",$this->app_base);
- $this->CopyPasteHandler->SetVar("parent",&$this);
+ $this->CopyPasteHandler->SetVar("parent",$this);
$data = $this->CopyPasteHandler->execute();
/* Return dialog data */
$data = $this->CopyPasteHandler->execute();
/* Return dialog data */
$this->postcreate();
}
$this->postcreate();
}
+
function remove_lock()
{
if (isset($this->apptabs->dn)){
del_lock ($this->apptabs->dn);
}
function remove_lock()
{
if (isset($this->apptabs->dn)){
del_lock ($this->apptabs->dn);
}
+ if(isset($this->dn) && !empty($this->dn) && $this->dn != "new"){
+ del_lock($this->dn);
+ }
+ if(isset($this->dns) && is_array($this->dns) && count($this->dns)){
+ del_lock($this->dns);
+ }
}
}
+
function save_object()
{
$this->DivListApplication->save_object();
function save_object()
{
$this->DivListApplication->save_object();