git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 8335d234 authored by Zach Copley's avatar Zach Copley

Don't try to show search and tag subs unless a user is logged in

parent ea820862
......@@ -324,11 +324,13 @@ class SearchSubPlugin extends Plugin
{
$user = common_current_user();
$searches = SearchSub::forProfile($user->getProfile());
if (!empty($user)) {
$searches = SearchSub::forProfile($user->getProfile());
if (!empty($searches) && count($searches) > 0) {
$searchSubMenu = new SearchSubMenu($menu->out, $user, $searches);
$menu->submenu(_m('Searches'), $searchSubMenu);
if (!empty($searches) && count($searches) > 0) {
$searchSubMenu = new SearchSubMenu($menu->out, $user, $searches);
$menu->submenu(_m('Searches'), $searchSubMenu);
}
}
return true;
......
......@@ -245,11 +245,14 @@ class TagSubPlugin extends Plugin
{
$user = common_current_user();
$tags = TagSub::forProfile($user->getProfile());
if (!empty($user)) {
if (!empty($tags) && count($tags) > 0) {
$tagSubMenu = new TagSubMenu($menu->out, $user, $tags);
$menu->submenu(_m('Tags'), $tagSubMenu);
$tags = TagSub::forProfile($user->getProfile());
if (!empty($tags) && count($tags) > 0) {
$tagSubMenu = new TagSubMenu($menu->out, $user, $tags);
$menu->submenu(_m('Tags'), $tagSubMenu);
}
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment