summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee517ff)
raw | patch | inline | side by side (parent: ee517ff)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 15 May 2008 08:59:59 +0000 (08:59 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 15 May 2008 08:59:59 +0000 (08:59 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10907 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc | patch | blob | history | |
gosa-core/plugins/admin/ogroups/main.inc | patch | blob | history |
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc
index 64899b4e4e3e97d873acbaa569cd66e9ecc7a33c..13a211bd0056d358e7f0e1e4160da2dc31a3ce91 100644 (file)
var $DivListOGroup = NULL;
var $start_pasting_copied_objects = FALSE;
+ var $dns = array();
+
function ogroupManagement (&$config, $dn= NULL)
{
/* Include config object */
Variable intialisation && Check posts for commands
****************/
- session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^group_edit_/","/^group_del_/","/^item_selected/","/^remove_multiple_ogroups/"));
+ session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^group_edit_/","/^group_del_/","/^item_selected/","/^remove_multiple_ogroups/","/^menu_action/"));
$smarty = get_smarty();
$s_action = "";
********************/
if ($s_action=="del_multiple"){
$ids = $this->list_get_selected_items();
+
if(count($ids)){
foreach($ids as $id){
- $dn = $this->ogrouplist[$id]['dn'];
- if (($user= get_lock($dn)) != ""){
- return(gen_locked_message ($user, $dn));
- }
- $this->dns[$id] = $dn;
+ $this->dns[$id] = $this->ogrouplist[$id]['dn'];
}
+
+ /* Check locks */
+ 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,_("object group")));
$smarty->assign("multiple", true);
msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
new log("security","ogroups/".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_ogroup_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 */
- del_lock ($this->dn);
+ $this->remove_lock();
session::un_set('objectinfo');
}
/* Delete group canceled? */
if (isset($_POST['delete_cancel'])){
- del_lock ($this->dn);
+ $this->remove_lock();
session::un_set('objectinfo');
}
/* Group has been saved successfully, remove lock from
LDAP. */
if ($this->dn != "new"){
- del_lock ($this->dn);
+ $this->remove_lock();
}
unset ($this->ogroup);
/* Cancel dialogs */
if ((isset($_POST['edit_cancel'])) && (isset($this->ogroup->dn))){
- del_lock ($this->ogroup->dn);
- unset ($this->ogroup);
+ $this->remove_lock();
$this->ogroup= NULL;
session::un_set('objectinfo');
}
}
+ 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->DivListOGroup->save_object();
}
}
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 84b7b4019d6b2a0093ce1fe802da9150089d1bef..aa6cd07ceacd07297ae8a7d69ecb884545cafd5f 100644 (file)
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-if (!$remove_lock){
+
+
+if ($remove_lock){
+ if(session::is_set('ogroup')){
+ $ogroup = session::get('ogroup');
+ $ogroup->remove_lock();
+ session::un_set ('ogroup');
+ }
+} else {
+
/* Create object object on demand */
if (!session::is_set('ogroup') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
session::set('ogroup',new ogroupManagement ($config));