Page 1 of 1

Get data from Flash and save for each user...securely.

Posted: Thu Sep 13, 2007 12:20 am
by rdavis101
Let's say I have a flash file in which the user can pull a slider and change the transparency of a shape. I then want each user to be able to save the alpha value in a table in the database. Each user can have their own value.

But How can I securely transfer this variable back to Joomla? And how do I find the user id for the current user?

I know I can just append the flash variables to end of a URL something like http://www.MySite.com/myPHPFile.php?var1=1&var2=2&id=13, but this isn't secure, because user could just manipulate id in the URL, thus saving the data into another user's fields.

Anyone have any ideas?

Roger

Re: Get data from Flash and save for each user...securely.

Posted: Wed Sep 19, 2007 6:58 am
by CirTap
Hi,

if the receiving script takes part of J!s workflow, you should have the User's ID in the current session.
The session is encrypted in a cookie key. I don't know if Flash will also receive the cookies that are sent along with the "html page".

Just use JFactory::getUser() and you have a valid, authenticated user -- or a guest.
You must not accept any user ids passed via GET or POST data.

Have fun,
CirTap