geekitude / dokuwiki-plugin-userhomepage

Dokuwiki plugin to automatically create user's homepage and/or namespace
https://www.dokuwiki.org/plugin:userhomepage
5 stars 9 forks source link

Don't show `Logged in as: ()` if nobody is logged in #45

Closed Gamemap closed 2 years ago

Gamemap commented 2 years ago

If nobody is logged into a wiki it shows Logged in as: (). Line 6 should remove this so I think it should be added to the docs. (https://www.dokuwiki.org/plugin:userhomepage#user_links)

if (!plugin_isdisabled('userhomepage')) {
    $userhomepageHelper = plugin_load('helper','userhomepage');
}
// If User HomePage helper is loaded, replace standard 'Logged in as...' link (case where one or both pages don't exist is managed by User HomePage helper
if ($userhomepageHelper) {
    if($INPUT->server->str('REMOTE_USER')) {
        echo $userhomepageHelper->getComplexLoggedInAs();
    }
} else {
    echo '<li class="user">';
    tpl_userinfo(); /* 'Logged in as ...' */
    echo '</li>';
}
geekitude commented 2 years ago

Thanks for your feedback. 👍 I changed "User link" section of documentation to keep original if (!empty($_SERVER['REMOTE_USER'])) { line and that does the trick.

Will keep this issue open for a while.