Working with current username

scaramanga
Joined: 01 Dec 2008

Working with current username

Posted:01 Dec 2008 (22:38 UTC)
Hello there.

Just getting started with bitweaver. Currently I am (trying) to develop my own package where I read and insert comments in a database table which is filled in part from another application.

My Question: How can I obtain the real name of the current user in php? I would like its value assigned to a variable, so I can use it in an SQL INSERT Statement. I tried various things so far, but was only able to print it to the screen in a template file and when I tried to send it to a php file (xyz.ph?user={displayname hash=$gBitUser->mInfo}) it cuts off after '->'.

Thanks for your help.
Greetz Scaramanga
spiderr
Avatar
Joined: 08 Feb 2004

Re: Working with current username

Posted:11 Dec 2008 (17:26 UTC)
Hi Greetz -

We have *two* columns in users_users for this - login, and real_name

login is an email-safe & domain safe alphanumeric string

real_name can be anything and is for nice visual display purposes only.

To get these values, use:


<?php
$username 
$gBitUser->getField('login');
$prettyName $gBitUser->getField('real_name');
?>


HTH
reaven
Joined: 07 Nov 2014

Re: Working with current username

Posted:07 Nov 2014 (11:47 UTC)
How can I obtain the real name of the current user in php? I would like its value assigned to a variable, so I can use it in an SQL INSERT Statement. I tried various things so far???

aaaaaaa

No posts found