summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f60f3b3)
raw | patch | inline | side by side (parent: f60f3b3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 Apr 2008 05:44:11 +0000 (05:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 Apr 2008 05:44:11 +0000 (05:44 +0000) |
-Fixed locking
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10259 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10259 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc | patch | blob | history |
diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc b/gosa-plugins/sudo/admin/sudo/class_sudoManagement.inc
index 7be36c35f23547da610bff997e89b4999a7203d4..47fd657a70b349c030866375670d5c6183d0d860 100644 (file)
if ($this->dn != "new"){
del_lock ($this->dn);
}
-
unset ($this->sudotabs);
$this->sudotabs= NULL;
session::un_set('objectinfo');
********************/
if ($s_action=="del_role"){
-
$ids = $this->list_get_selected_items();
-
if(!count($ids) && $s_entry!=""){
$ids = array($s_entry);
}
if(count($ids)){
+
+ /* Create list of entries to delete */
$this->dns = array();
+ $dns_names = array();
foreach($ids as $id){
$dn = $this->list[$id]['dn'];
- if (($user= get_lock($dn)) != ""){
- return(gen_locked_message ($user, $dn));
- }
$this->dns[$id] = $dn;
- }
-
- $dns_names = array();
- foreach($this->dns as $dn){
- add_lock ($dn, $this->ui->dn);
$dns_names[] =@LDAP::fix($dn);
}
+
+ /* Check locking of entries */
+ $users = get_multiple_locks($this->dns);
+ if(count($users)){
+ return(gen_locked_message($users,$this->dns));
+ }
+
+ /* Add locks */
+ 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,_("Sudo role")));
/* Remove lock */
if(isset($_POST['delete_sudo_cancel'])){
- foreach($this->dns as $key => $dn){
- del_lock ($dn);
- unset($this->dns[$key]);
- }
+ del_lock ($this->dns);
+ unset($this->dns);
}
/********************
********************/
/* Cancel dialogs */
- if (isset($_POST['edit_cancel'])){
+ if (isset($_POST['edit_cancel']) && is_object($this->sudotabs)){
if(isset($this->sudotabs->dn)){
del_lock ($this->sudotabs->dn);
}
********************/
/* Show tab dialog if object is present */
- if (isset($this->sudotabs->config)){
+ if (is_object($this->sudotabs)){
$display= $this->sudotabs->execute();
/* Don't show buttons if tab dialog requests this */
}
/* Display dialog with sudo list */
- $this->DivListSudo->parent = &$this;
$this->DivListSudo->execute();
$this->reload ();
$this->DivListSudo->setEntries($this->list);
*/
public function remove_lock()
{
- if (isset($this->sudotabs->dn)){
+ if (is_object($this->sudotabs) && $this->sudotabs->dn != "new"){
del_lock ($this->sudotabs->dn);
}
+ if(isset($this->dns) && is_array($this->dns) && count($this->dns)){
+ del_lock($this->dns);
+ }
}
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: