Page 1 of 1

Joomla UserName Issue

Posted: Wed Aug 20, 2008 4:31 pm
by zeeshanhashmi
I am creating an External Application and that will be attached to Joomla using JUMI.

I want to obtain the current USERNAME and then it is stored in my database (of the external script) and then next time if that user login again, he will be able to see his records on my application.

I am using folllowing code:
Just these 2 lines on the top of my script.

Code: Select all

$user =& JFactory::getUser();
$userId = $user->get('username');
and then I can use $userId.

Is it OK ? or its not the correct way to do this ?

Please guide


Re: Joomla UserName Issue

Posted: Thu Aug 21, 2008 1:39 am
by zeeshanhashmi
Anyone please respond.

I dont know why people do not reply here. There are a lot of other forums where the response is submitted within 1 hour. But I can see that my this post and previous, bot are never answered.

If some one has some knowledge it will be be decreased if you share it with those who doesn't have the required knowledge. (like me)

So please !

Re: Joomla UserName Issue

Posted: Sun Aug 24, 2008 8:45 am
by Gergo Erdosi
zeeshanhashmi wrote:

Code: Select all

$userId = $user->get('username');
If you want to store the username, why did you add userid as the name of the variable? Anyway I would suggest to store the id of the user instead of the username, because the name an be changed, but the id will be the same.