Using joomla user information sometime doesn't work RESOLVED

mauromas 25 Nov, 2008
Hi,

I'm a newbie of joomla and chronofroms, and I created a form, linked to a table, and I got user information using info found on this post: http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&p=9286#p9286. I used the syntax just as the post does, and it worked flawlessy on my pc and on other pc I have in my house.

When I published the form online I found that sometime, about one of four users, it did not get user info.

The form is accessible only to registered users, and in any case it works, but it looks like that on some computers it is not working only the function that get user info:

<?php
$user = &JFactory::getUser();
?>


Could it be a cookie problem? Or a browser specific problem?

Is there a parameter to set, that can help me to give more stability to the getuser() function, letting it works for ever?

thank everyone for help and sorry for my bad english
GreyHead 25 Nov, 2008
Hi mauromas ,

It's very unlikely that there is a problem with &JFactory::getUser();, this is the standard Joomla code. More likely is that user's aren't logged in for one reason or another. Is your form visible to guest users?

Bob
mauromas 25 Nov, 2008
no my form is absolutely not visible to guests, the site starts by default to the login page and there is no way to get there without logging.

I'm in trouble because usually it works.

I was able to reproduce the problem on one of my computers, it happened because I had the ip and name in the "hosts" file, when I deleted the static ip from my hosts, and so the pc used the dns to resolve the name, the form started to get user info.

I'm ready to make you try for yourself, if you want I can pm you with a test account and look what happen...🙂
Max_admin 25 Nov, 2008
try :
    <?php
    $user = JFactory::getUser();
    ?>


?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
mauromas 25 Nov, 2008

try :

    <?php
    $user = JFactory::getUser();
    ?>


?


I tried, there's only a "&" less; it actually works, I'll let you know if it is ok forever.

bye
mauromas 25 Nov, 2008
embarassed mode on
Resolved: it was my fault, I made possible for user to go on to the form also without logging in, that's way someone logged in got user data and someone not logged in did not get....😶

I'm sorry for wasting your time, but i'm too much a newbie...
GreyHead 25 Nov, 2008
Hi mauromas,

No problem - it happens to all of us at one time or another.

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger