Commit a2957fe6 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #5154 Cleaned up calls to lock system

parent e920ac80
......@@ -338,8 +338,8 @@ class management
if (count($this->dns)) {
// check locks
if ($user = get_locks($this->dns)) {
return gen_locked_message($user, $this->dns);
if ($locks = get_locks($this->dns)) {
return gen_locked_message($locks, $this->dns);
}
// Add locks
......@@ -741,9 +741,8 @@ class management
// Get the dn of the object and creates lock
$this->dn = array_pop($target);
set_object_info($this->dn);
$user = get_lock($this->dn);
if ($user != "") {
return gen_locked_message($user, $this->dn, TRUE);
if ($locks = get_locks($this->dn)) {
return gen_locked_message($locks, $this->dn, TRUE);
}
add_lock ($this->dn, $ui->dn);
......
......@@ -479,8 +479,8 @@ class simpleManagement extends management
$this->dns = $target;
// check locks
if ($user = get_locks($this->dns)) {
return gen_locked_message($user, $this->dns);
if ($locks = get_locks($this->dns)) {
return gen_locked_message($locks, $this->dns);
}
// Add locks
......@@ -590,9 +590,8 @@ class simpleManagement extends management
// Get the dn of the object and creates lock
$this->dn = array_pop($target);
set_object_info($this->dn);
$user = get_lock($this->dn);
if ($user != "") {
return gen_locked_message($user, $this->dn, TRUE);
if ($locks = get_locks($this->dn)) {
return gen_locked_message($locks, $this->dn, TRUE);
}
add_lock ($this->dn, $ui->dn);
......@@ -658,8 +657,8 @@ class simpleManagement extends management
if (count($this->dns)) {
// check locks
if ($user = get_locks($this->dns)) {
return gen_locked_message($user, $this->dns);
if ($locks = get_locks($this->dns)) {
return gen_locked_message($locks, $this->dns);
}
// Add locks
......
......@@ -880,10 +880,10 @@ class simplePlugin extends plugin
/* Enter edit mode? */
if ((isset($_POST['edit'])) && (!session::is_set('edit'))) {
/* Check locking */
if (($username = get_lock($entry_dn)) != "") {
if ($locks = get_locks($entry_dn)) {
session::set('back_plugin', $plug);
session::set('LOCK_VARS_TO_USE', array("/^edit$/", "/^plug$/"));
$lock_msg = gen_locked_message($username, $entry_dn);
$lock_msg = gen_locked_message($locks, $entry_dn);
} else {
/* Lock the current entry */
add_lock($entry_dn, $ui->dn);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment