Skip to content

Commit 55ed975

Browse files
committed
Fix regression with login button missing
1 parent 31360f0 commit 55ed975

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/templates/header.inc.phtml

+9-12
Original file line numberDiff line numberDiff line change
@@ -175,22 +175,19 @@ function _header_nav_html($nav)
175175
_line('</ul>');
176176

177177
// Account
178-
if (isset(Common::$database))
178+
if (!Authentication::$user)
179179
{
180-
if (!Authentication::$user)
180+
_line('<a class="btn btn-sm btn-outline-secondary my-2 my-sm-0" tabindex="-1" href="%s">Log in</a>', Common::relativeUrlToAbsolute('/user/login'));
181+
if (!Common::$config->bnetdocs->user_register_disabled)
181182
{
182-
_line('<a class="btn btn-sm btn-outline-secondary my-2 my-sm-0" tabindex="-1" href="%s">Log in</a>', Common::relativeUrlToAbsolute('/user/login'));
183-
if (!Common::$config->bnetdocs->user_register_disabled)
184-
{
185-
_line('<a class="btn btn-sm btn-outline-success my-2 my-sm-0 ml-2" tabindex="-2" href="%s">Register</a>', Common::relativeUrlToAbsolute('/user/register'));
186-
}
187-
}
188-
else
189-
{
190-
_line('<span class="nav-item navbar-text mx-3"><a href="%s">%s</a></span>', Authentication::$user->getURI(), filter_var(Authentication::$user->getName(), FILTER_SANITIZE_FULL_SPECIAL_CHARS));
191-
_line('<a class="btn btn-sm btn-outline-danger my-2 my-sm-0" tabindex="-1" href="%s">Log out</a>', Common::relativeUrlToAbsolute('/user/logout'));
183+
_line('<a class="btn btn-sm btn-outline-success my-2 my-sm-0 ml-2" tabindex="-2" href="%s">Register</a>', Common::relativeUrlToAbsolute('/user/register'));
192184
}
193185
}
186+
else
187+
{
188+
_line('<span class="nav-item navbar-text mx-3"><a href="%s">%s</a></span>', Authentication::$user->getURI(), filter_var(Authentication::$user->getName(), FILTER_SANITIZE_FULL_SPECIAL_CHARS));
189+
_line('<a class="btn btn-sm btn-outline-danger my-2 my-sm-0" tabindex="-1" href="%s">Log out</a>', Common::relativeUrlToAbsolute('/user/logout'));
190+
}
194191

195192
// Collapsible Hamburger Menu (End)
196193
_line('</div>');

0 commit comments

Comments
 (0)