summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b56559)
raw | patch | inline | side by side (parent: 4b56559)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 15 May 2008 13:02:12 +0000 (13:02 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 15 May 2008 13:02:12 +0000 (13:02 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10917 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/users/class_userManagement.inc | patch | blob | history | |
gosa-core/plugins/admin/users/main.inc | patch | blob | history |
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index cf05cd81ae8c33c5f397178981ac480deb9ab670..322d0ae403099a789fdf761ee103f429f8ce21ec 100644 (file)
var $start_pasting_copied_objects = FALSE;
var $msg_dialog= NULL;
+ var $dns =array();
+
function userManagement(&$config, $ui)
{
/* Save configuration for internal use */
msg_dialog::display(_("Password change"),_("You have no permission to change this users password!"),WARNING_DIALOG);
}
/* Clean session, delete lock */
- del_lock ($this->dn);
+ $this->remove_lock();
unset ($this->usertab);
$this->usertab= NULL;
$this->lognames= array();;
/* Reset all relevant data, if we get a _cancel request */
if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){
if (isset($this->usertab)){
- del_lock ($this->usertab->dn);
- unset ($this->usertab);
+ $this->remove_lock();
}
$this->usertab= NULL;
$this->lognames= array();;
}
$this->dns = array();
-
if(count($ids)){
foreach($ids as $id){
- $dn = $this->list[$id]['dn'];
- if (($user= get_lock($dn)) != ""){
- return(gen_locked_message ($user, $dn));
- }
- $this->dns[$id] = $dn;
+ $this->dns[$id] = $this->list[$id]['dn'];
+ }
+
+ /* Check locks */
+ if ($user= get_multiple_locks($this->dns)){
+ return(gen_locked_message($user,$this->dns));
}
$dns_names = array();
$dns_names[] = @LDAP::fix($dn);
}
+ add_lock($this->dns, $this->ui->dn);
+
/* Lock the current entry, so nobody will edit it during deletion */
$info = sprintf(msgPool::deleteInfo($dns_names,_("user")));
Delete MULTIPLE entries confirmed
********************/
- if(isset($_POST['delete_user_confirm'])){
-
- /* Remove user by user and check acls before removeing them */
- foreach($this->dns as $key => $dn){
+ if(isset($_POST['delete_user_confirm'])){
- $acl = $this->ui->get_permissions($dn, "users/user");
- if (preg_match('/d/', $acl)){
+ /* Remove user by user and check acls before removeing them */
+ foreach($this->dns as $key => $dn){
- /* Delete request is permitted, perform LDAP action */
- $this->usertab= new usertabs($this->config, $this->config->data['TABS']['USERTABS'],$dn);
- $this->usertab->set_acl_base();
- $this->usertab->delete ();
- unset ($this->usertab);
- $this->usertab= NULL;
- } else {
- msg_dialog::display(_("Warning"),msgPool::permDelete($dn),WARNING_DIALOG);
- if(isset($this->ui->uid)){
- new log("security","users/".get_class($this),$dn,array(),"Tried to trick deletion.");
- }
+ $acl = $this->ui->get_permissions($dn, "users/user");
+ if (preg_match('/d/', $acl)){
+
+ /* Delete request is permitted, perform LDAP action */
+ $this->usertab= new usertabs($this->config, $this->config->data['TABS']['USERTABS'],$dn);
+ $this->usertab->set_acl_base();
+ $this->usertab->delete ();
+ unset ($this->usertab);
+ $this->usertab= NULL;
+ } else {
+ msg_dialog::display(_("Warning"),msgPool::permDelete($dn),WARNING_DIALOG);
+ if(isset($this->ui->uid)){
+ new log("security","users/".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();
}
/* Delete user canceled? */
if (isset($_POST['delete_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();
}
if (!isset($_POST['edit_apply'])){
/* User has been saved successfully, remove lock from LDAP. */
if ($this->dn != "new"){
- del_lock ($this->dn);
+ $this->remove_lock();
}
/* In case of new users, ask for a password, skip this for templates */
}
}
+
function remove_lock()
{
/* Remove user lock if a DN is marked as "currently edited" */
if (isset($this->usertab->dn)){
del_lock ($this->usertab->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);
+ }
}
index 46489c8944a48786bb379f786654fac5dfce40c0..5b28ac343ddc9eb85660e9c64bf10e4eec48457f 100644 (file)
if(session::is_set('userManagement')){
$userManagement = session::get('userManagement');
$userManagement->remove_lock();
- del_lock ($ui->dn);
session::un_set ('userManagement');
}
} else {