1
nuance9
How to check who user is?
  • 2004/9/8 14:02

  • nuance9

  • Just popping in

  • Posts: 19

  • Since: 2004/8/13


What would be the simplest way to access the UID of a logged in user? Is this variable already available in all XOOPS pages, or would I need to execute a new DB query?

I'm very new to Xoops, so I'm unsure of the guts of it's workings.

Thanks!

2
Dave_L
Re: How to check who user is?
  • 2004/9/8 14:38

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Example:

global $xoopsUser// needed if within a function

$uid is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;

if (
$uid 0) {
   echo 
"User #$uid is logged in";
} else {
   echo 
"No one is logged in":
}

3
nuance9
Re: How to check who user is?
  • 2004/9/8 15:23

  • nuance9

  • Just popping in

  • Posts: 19

  • Since: 2004/8/13


Thanks.

I wanted xDirectory to only show the "modify" option if the listing submitter equals the current UID. With your help it is working now, thanks!


4
melmick
Re: How to check who user is?
  • 2004/10/22 10:55

  • melmick

  • Just popping in

  • Posts: 1

  • Since: 2004/10/22


nuance9,

How did you get this to work? This is exactly what we need xdirectory to do, re: only show the "modify" option if the listing submitter equals the current UID.

Thanks in advance for any help.

Login

Who's Online

142 user(s) are online (63 user(s) are browsing Support Forums)


Members: 0


Guests: 142


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits