[pmwiki-users] Check for a specific user name
Tom Lederer
pmwiki at celok.de
Tue Feb 13 12:57:59 CST 2007
Am 13.02.2007 um 19:26 schrieb K. Buehler:
> Hello,
> I need something like
>
> (:if expr auth admin || auth attr || auth edit :)
> [[Logout -> {$Name}?action=logout]]
> (:if:)
>
> I found on http://pmwiki.org/wiki/PmWiki/ConditionalMarkup,
> but after about an hour searching in the mailinglist and
> the cookbooks I did not find what I searched.
>
> The use case: I would like to check for a special User Name e.g. over
> {$AuthId} (which is installed). If that user is logged in I would like
> to show a special link.
>
> Any solution how to solve this?
>
> Thanks in advance for an answer on this!!
>
> kcb
Hi,
that is farily easy:
(:if equal {$AuthId} tom:)
Hi Tom
(:if:)
(:if equal {$AuthId} bob:)
Hi Bob
(:if:)
If you want the names to be uppercase in first letter, use this in
config.php:
include_once('scripts/authuser.php'); (should already be in there)
$AuthIdUC = substr($AuthId, 0, -1);
Then you have $AuthId (like tom)
and $AuthIdUC (like Tom)
Makes a good greeting:
Welcome {$AuthIdUC}!
best Regards,
Tom
More information about the pmwiki-users
mailing list