[TYPO3] Name of Logged in user to display

Erik Svendsen erik at linnearad.no
Wed May 3 18:18:23 CEST 2006


Hello Sébastien,

> Hello
> 
> Do you know how to retrieve the name of the currently logged in user?
> I
> want to display the name of the user in the header.
> There does not seem to be any embedded solution which I could find,
> except
> the one of playing with SQL and fe users and fe sesssions.
> Thanks
> Seb

I'm using the following solution to display a link to login page with the 
username when he/her i logged in, and only a link to login page when the 
user isn't logged in.

[loginUser = *] #If there are logged in user, do this
lib.login = COA
lib.login {
10 = HTML
10.value = <span><a href="index.php?id=18">Logget inn:&nbsp;<!--###USERNAME###--></a></span>
}

[ELSE] #If nobody is logged in
lib.login = COA
lib.login {
10 = HTML
10.value = <span><a href="index.php?id=18">Logg inn/status</a></span>
}
[END]

But to only display the username, drop the a-tags, and make the value under 
else empty.

I'm using newloginbox, newloginbox_tmplable and sr_feuser_register.

But I suppose there are other solution to get the users name, either with 
field value or maybe with TSFE. Haven't tried. If you are using newloginbox

And there are plenty of embedded solutions in TYPO3, but you need to read 
in TSref to find them. It's the only TYPO3 manual I have in print on my desk.

WBR,
Erik Svendsen
www.linnearad.no





More information about the TYPO3-english mailing list