From 5dc591bf7435896f797fbced754b1c539a5b271a Mon Sep 17 00:00:00 2001 From: Simon DELAGE Date: Mon, 2 Feb 2015 09:57:09 +0100 Subject: [PATCH] Fixed helper's getComplexLoggedInAs() Should now correctly default to standard login string when neither page exists --- helper.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/helper.php b/helper.php index 867e35b..d41820f 100644 --- a/helper.php +++ b/helper.php @@ -56,20 +56,18 @@ class helper_plugin_userhomepage extends DokuWiki_Plugin { function getComplexLoggedInAs() { global $INFO; global $lang; - // If user's private namespace and public page exist, return a 'Logged in as' string with both style links) + // If user's private namespace and public page exist, return a 'Logged in as' string with both styled links) if ((page_exists($this->getPrivateID())) && (page_exists($this->getPublicID()))) { return '
  • '.$lang['loggedinas'].' '.$INFO['userinfo']['name'].' ('.$_SERVER['REMOTE_USER'].')
  • '; - // Else if only private namespace exists, return 'Logged in as' string with private namespace link + // Else if only private namespace exists, return 'Logged in as' string with private namespace styled link } elseif (page_exists($this->getPrivateID())) { return $this->getPrivateLink("loggedinas"); - // Else if only ppublic page exists, return 'Logged in as' string with public page link + // Else if only public page exists, return 'Logged in as' string with public page styled link } elseif (page_exists($this->getPublicID())) { return $this->getPublicLink("loggedinas"); // Else default back to standard string } else { - echo '
  • '; - tpl_userinfo(); /* 'Logged in as ...' */ - echo '
  • '; + return '
  • '.$lang['loggedinas'].' '.userlink().'
  • '; } }