Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
5f1d344b
Commit
5f1d344b
authored
Mar 07, 2017
by
Côme Chilliet
Browse files
Fixes
#5410
Fixed read only feature which was broken by
#5154
fixes
parent
9cb049fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/functions.inc
View file @
5f1d344b
...
...
@@ -792,10 +792,13 @@ function get_lock($object)
*
* \param mixed $objects Array of dns for which a lock will be searched or dn of a single object
*
* \param boolean $allow_readonly TRUE if readonly access should be permitted,
* FALSE if not (default).
*
* \return A numbered array containing all found locks as an array with key 'object'
* and key 'user', or FALSE if an error occured.
*/
function
get_locks
(
$objects
)
function
get_locks
(
$objects
,
$allow_readonly
=
FALSE
)
{
global
$config
;
...
...
@@ -803,12 +806,19 @@ function get_locks($objects)
$objects
=
reset
(
$objects
);
}
if
(
is_array
(
$objects
))
{
if
(
$allow_readonly
)
{
trigger_error
(
'Read only is not possible for several objects'
);
}
$filter
=
'(&(objectClass=fdLockEntry)(|'
;
foreach
(
$objects
as
$obj
)
{
$filter
.
=
'(fdObjectDn='
.
base64_encode
(
$obj
)
.
')'
;
}
$filter
.
=
'))'
;
}
else
{
if
(
$allow_readonly
&&
isset
(
$_POST
[
'open_readonly'
]))
{
/* If readonly is allowed and asked and there is only one object, bypass lock detection */
return
array
();
}
$filter
=
'(&(objectClass=fdLockEntry)(fdObjectDn='
.
base64_encode
(
$objects
)
.
'))'
;
}
...
...
include/simpleplugin/class_simpleManagement.inc
View file @
5f1d344b
...
...
@@ -862,7 +862,7 @@ class simpleManagement
// Get the dn of the object and creates lock
$this
->
dn
=
array_pop
(
$target
);
set_object_info
(
$this
->
dn
);
if
(
$locks
=
get_locks
(
$this
->
dn
))
{
if
(
$locks
=
get_locks
(
$this
->
dn
,
TRUE
))
{
return
gen_locked_message
(
$locks
,
$this
->
dn
,
TRUE
);
}
add_lock
(
$this
->
dn
,
$ui
->
dn
);
...
...
mhamant
@mhamant
mentioned in issue
#1727 (closed)
·
Sep 02, 2017
mentioned in issue
#1727 (closed)
mentioned in issue #1727
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment