]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixed #3093: Admin link shows only for admin users.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Mar 2011 22:22:11 +0000 (22:22 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 12 Mar 2011 22:22:11 +0000 (22:22 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8674 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/admin.php

index 4e0c4f68149dc61169f4478b96d0f40b0b80a425..104b362a9ea5caf37a08ad6e79e986c1500cfa98 100644 (file)
@@ -220,13 +220,15 @@ function admin_init() {
        // plugin settings are added in elgg_admin_add_plugin_settings_menu() via the admin page handler
        // for performance reasons.
 
-       elgg_register_menu_item('topbar', array(
-               'name' => 'administration',
-               'href' => 'admin',
-               'text' => elgg_view_icon('settings') . elgg_echo('admin'),
-               'priority' => 100,
-               'section' => 'alt',
-       ));
+       if (elgg_is_admin_logged_in()) {
+               elgg_register_menu_item('topbar', array(
+                       'name' => 'administration',
+                       'href' => 'admin',
+                       'text' => elgg_view_icon('settings') . elgg_echo('admin'),
+                       'priority' => 100,
+                       'section' => 'alt',
+               ));
+       }
                        
        // widgets
        $widgets = array('online_users', 'new_users', 'content_stats', 'admin_welcome');