From 514d5aab14b2d7ab96f7ed4ee49545e5b8987166 Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 9 Dec 2009 17:48:03 +0000 Subject: [PATCH] Show Last Activity menu item in Webadmin only if vhost has mod_last (EJAB-1031) SVN Revision: 2801 --- src/web/ejabberd_web_admin.erl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index 58448d6ae..8c291af09 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -1628,6 +1628,11 @@ get_lastactivity_module(Server) -> _ -> mod_last_odbc end. +get_lastactivity_menuitem_list(Server) -> + case get_lastactivity_module(Server) of + mod_last -> [{"last-activity", "Last Activity"}]; + mod_last_odbc -> [] + end. us_to_list({User, Server}) -> exmpp_jid:to_list(User, Server, undefined). @@ -2702,9 +2707,9 @@ make_host_menu(Host, HostNodeMenu, Lang, JID) -> HostFixed = [{"acls", "Access Control Lists"}, {"access", "Access Rules"}, {"users", "Users"}, - {"online-users", "Online Users"}, - {"last-activity", "Last Activity"}, - {"nodes", "Nodes", HostNodeMenu}, + {"online-users", "Online Users"}] + ++ get_lastactivity_menuitem_list(Host) ++ + [{"nodes", "Nodes", HostNodeMenu}, {"stats", "Statistics"}] ++ get_menu_items_hook({host, Host}, Lang), HostBasePath = url_to_path(HostBase),