You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by il...@gmx.net on 2008/10/05 11:58:47 UTC

Get Username

Hi,

although I am still not able to login via JSPWiki using JBoss, I am trying to get the username of the currently logged in user by using a Plugin.

So I tried:
WikiSession session =context.getWikiSession();
String name =context.getEngine().getUserManager().getUserProfile(session).getLoginName();

But I also get "null", although I am logged in as a Guest.

Any ideas?

Regards
-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

Re: Get Username

Posted by Andrew Jaquith <an...@me.com>.
If you are a Guest, you aren't an authenticated user. Users who aren't  
authenticated don't have UserProfiles. The way to do this for all  
users, including Guests, is to call  
WikiSession.getUserPrincipal().getName().

On Oct 5, 2008, at 5:58 AM, illusions2003@gmx.net wrote:

> Hi,
>
> although I am still not able to login via JSPWiki using JBoss, I am  
> trying to get the username of the currently logged in user by using  
> a Plugin.
>
> So I tried:
> WikiSession session =context.getWikiSession();
> String name  
> = 
> context 
> .getEngine().getUserManager().getUserProfile(session).getLoginName();
>
> But I also get "null", although I am logged in as a Guest.
>
> Any ideas?
>
> Regards
> -- 
> Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
> Browser-Versionen downloaden: http://www.gmx.net/de/go/browser