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
25791047
Commit
25791047
authored
Mar 23, 2016
by
Côme Chilliet
Browse files
Fixes
#4638
Department cache is wrong after editing a department
parent
e833d52c
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/class_config.inc
View file @
25791047
...
...
@@ -616,13 +616,10 @@ class config {
}
}
/*!
* \brief Store the departments from ldap in $this->departments
*
* \param string $ignore_dn dn of the department
*/
function
get_departments
(
$ignore_dn
=
""
)
function
get_departments
()
{
/* Initialize result hash */
$result
=
array
();
...
...
@@ -637,14 +634,14 @@ class config {
$types
=
departmentManagement
::
getDepartmentTypes
();
/* Create a list of attributes to fetch */
$filter
=
""
;
$ldap_values
=
array
(
"
objectClass
"
,
"
description
"
);
$filter
=
''
;
$ldap_values
=
array
(
'
objectClass
'
,
'
description
'
);
foreach
(
$types
as
$type
)
{
$i
=
objects
::
infos
(
$type
);
$filter
.
=
$i
[
'filter'
];
$ldap_values
[]
=
$i
[
'mainAttr'
];
// Specific key for departement objectTypes
}
$filter
=
"
(|
"
.
$filter
.
")"
;
$filter
=
'
(|
'
.
$filter
.
')'
;
/* Get list of department objects */
$ldap
=
$this
->
get_ldap_link
();
...
...
@@ -668,17 +665,15 @@ class config {
$dn
=
$ldap
->
getDN
();
$data
=
objects
::
infos
(
$oc
);
$this
->
department_info
[
$dn
]
=
array
(
"img"
=>
$data
[
'icon'
],
"description"
=>
isset
(
$attrs
[
'description'
][
0
])
?
$attrs
[
'description'
][
0
]
:
""
,
"name"
=>
$attrs
[
$data
[
'mainAttr'
]][
0
]);
if
(
$dn
==
$ignore_dn
)
{
continue
;
}
$c_dn
=
convert_department_dn
(
$dn
)
.
" ("
.
$data
[
'mainAttr'
]
.
")"
;
$this
->
department_info
[
$dn
]
=
array
(
'img'
=>
$data
[
'icon'
],
'description'
=>
(
isset
(
$attrs
[
'description'
][
0
])
?
$attrs
[
'description'
][
0
]
:
''
),
'name'
=>
$attrs
[
$data
[
'mainAttr'
]][
0
]
);
/* Only assign non-root departments */
if
(
$dn
!=
$result
[
'/'
])
{
$c_dn
=
convert_department_dn
(
$dn
)
.
' ('
.
$data
[
'mainAttr'
]
.
')'
;
$result
[
$c_dn
]
=
$dn
;
}
}
...
...
plugins/admin/departments/class_department.inc
View file @
25791047
...
...
@@ -179,16 +179,6 @@ class department extends simplePlugin
return
$message
;
}
function
execute
()
{
/* Reload departments */
$this
->
config
->
get_departments
(
$this
->
dn
);
$this
->
config
->
make_idepartments
();
/* Call parent execute */
return
parent
::
execute
();
}
function
get_allowed_bases
()
{
/* Hide all departments, that are subtrees of this department */
...
...
plugins/admin/departments/tabs_department.inc
View file @
25791047
...
...
@@ -28,6 +28,7 @@ class deptabs extends simpleTabs
/* Update department cache */
global
$config
;
$config
->
get_departments
();
$config
->
make_idepartments
();
}
}
?>
mhamant
@mhamant
mentioned in issue
#1477 (closed)
·
Sep 02, 2017
mentioned in issue
#1477 (closed)
mentioned in issue #1477
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