diff options
author | Badlop <badlop@process-one.net> | 2009-12-09 17:47:02 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2009-12-09 17:47:02 +0000 |
commit | 65aed4787389243391c8b455562cff351671d7b2 (patch) | |
tree | 3c3d6bc4caae12d788d1d8292fc89bfa558dd6b8 | |
parent | Call in WebAdmin the proper mod_last backend module (EJAB-1031) (diff) |
Show Last Activity menu item in Webadmin only if vhost has mod_last (EJAB-1031)
SVN Revision: 2799
-rw-r--r-- | src/web/ejabberd_web_admin.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index ccc38d879..b6cb1fb3b 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -1597,6 +1597,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}) -> jlib:jid_to_string({User, Server, ""}). @@ -2707,9 +2712,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), |