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

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Forum rules
Post Reply
rdavis101
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Nov 19, 2005 6:45 pm

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

Post by rdavis101 » Thu Sep 13, 2007 12:20 am

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

User avatar
CirTap
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Mon Dec 12, 2005 5:34 pm
Contact:

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

Post by CirTap » Wed Sep 19, 2007 6:58 am

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
You can have programs written fast, well, and cheap, but you only get to pick 2 ...

"I love deadlines. I like the whooshing sound they make as they fly by." Douglas Adams


Post Reply