Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
2c2f33e6
Commit
2c2f33e6
authored
Oct 31, 2006
by
drumm
Browse files
#90614
by asimmonds and hunmonk. Avoid linking to inaccessible admin pages.
parent
bda84648
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/system/system.module
View file @
2c2f33e6
...
...
@@ -393,7 +393,7 @@ function system_admin_menu_block($block) {
usort
(
$block
[
'children'
],
'_menu_sort'
);
foreach
(
$block
[
'children'
]
as
$mid
)
{
$item
=
menu_get_item
(
$mid
);
if
(
$item
[
'type'
]
&
MENU_VISIBLE_IN_TREE
)
{
if
(
(
$item
[
'type'
]
&
MENU_VISIBLE_IN_TREE
)
&&
_menu_item_is_accessible
(
$mid
))
{
$content
[]
=
$item
;
}
}
...
...
@@ -2204,7 +2204,9 @@ function theme_admin_block_content($content) {
*/
function
system_admin_by_module
()
{
$modules
=
module_rebuild_cache
();
$menu
=
menu_get_menu
();
$menu_items
=
array
();
$admin_access
=
user_access
(
'administer access control'
);
foreach
(
$modules
as
$file
)
{
$module
=
$file
->
name
;
if
(
$module
==
'help'
)
{
...
...
@@ -2213,7 +2215,7 @@ function system_admin_by_module() {
$admin_tasks
=
array
();
// Check for permissions.
if
(
module_hook
(
$module
,
'perm'
))
{
if
(
module_hook
(
$module
,
'perm'
)
&&
$admin_access
)
{
$admin_tasks
[
-
1
]
=
l
(
t
(
'Configure permissions'
),
'admin/user/access'
);
}
...
...
@@ -2222,7 +2224,7 @@ function system_admin_by_module() {
foreach
(
$items
as
$item
)
{
$parts
=
explode
(
'/'
,
$item
[
'path'
]);
$n
=
count
(
$parts
);
if
((
!
isset
(
$item
[
'type'
])
||
(
$item
[
'type'
]
&
MENU_VISIBLE_IN_TREE
))
&&
(
$parts
[
0
]
==
'admin'
)
&&
(
$n
>=
3
))
{
if
((
!
isset
(
$item
[
'type'
])
||
(
$item
[
'type'
]
&
MENU_VISIBLE_IN_TREE
))
&&
(
$parts
[
0
]
==
'admin'
)
&&
(
$n
>=
3
)
&&
_menu_item_is_accessible
(
$menu
[
'path index'
][
$item
[
'path'
]])
)
{
$admin_tasks
[
$item
[
'title'
]]
=
l
(
$item
[
'title'
],
$item
[
'path'
]);
}
}
...
...
Write
Preview
Markdown
is supported
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