Embedding userlogin with Flash MX, useing the G2 database.

TimoJ

Joined: 2006-01-10
Posts: 4
Posted: Tue, 2006-01-10 22:43

Hi,

I have been requested to make a password protected Flash site, that also links to a G2 Gallery.
So the customer would enter a Flash site, and login. Then use the flash site, and click on a link that will open the gallery in a new window, and they should ofcause be loged in to the gallery.

What I would like to do:
- Use the G2's database and CMS, for usermanagement (so if a user sign up on the gallery, and is activated by G2 admin, then they get access to the flash page as well)
- The user should be able to change password as normal in G", and it change password in the flash.
* Ofcause, if anyone know how to put the gallery inside the flash (in a window or mc) then that would be realy cool.

How I see this should work:
- Flash would optain the username and password from the user, and pass it on to a PHP page, that would retrun something like this to flash: "UserLogin=success" or "UserLogin=failed" (and maby a reason)
- A way for Flash to keep the session alive (no informatin from flash would be saved in the session, so is it needed to be keept alive, if G2 can auto login?).
- A way to logout.
* If posible, then I would like flash to see if a session is there (so if users can login to G2 first). So flash would ask a PHP file, that would return something like this: "currentLogin=none" or "currentLogin=username"
* And a way to get the full name of a person, would also be nice. Again something I would be able to return in to Flash (so something that return as variable=value).

I have read the Embeding doc, but I think that the advance use of classes and functions is just over my PHP knowlage, so code examples would be mutch apreciated. And also the embeding doc describe how to get G2 to use your current login, but I would like to use the G2 user database, and use G2 for user sign up and user management.

Thank you so mutch for a wunderfull gallery, and for your support.
Timo J

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2006-01-11 01:55

sidenote: you coild also write a flash theme / front-end to g2.
see:
http://cvs.sourceforge.net/viewcvs.py/gallery-contrib/g2_themes/fluid/

@user management:
existing g2 integrations work with the other application as the master and g2 as the slave.
what you'd like is g2 as the master and your flash thing as the slave.
g2 has save events. so you could write a small g2 module (barely 1 file) which listens for GalleryEntity::save events. check if the entity that was saved is a GalleryUser, if so, notify your flash stuff from g2/php.

 
TimoJ

Joined: 2006-01-10
Posts: 4
Posted: Wed, 2006-01-11 06:42

Hi,

Thank you for your help.

Could you give me a hint to where and how I cen get started in write ing a module for g2?

I am not sure how I can use the GalleryEntity::save. I am verry mutch in a basic state on PHP development, and even more on Flash development, but I am a quick learner, so as long as I have some code to get started, then I think I can do the rest.

I have at one time gotten g1.5 to work as the master for my homepage, but it was big hack in the code, and it never run more than 98%.

 
TimoJ

Joined: 2006-01-10
Posts: 4
Posted: Wed, 2006-01-11 20:12

Hi,

I would just like to thank you again for your help, but I need to get this site up and running from next week, so I will go with the:
http://example.com/gallery2/main.php?g2_controller=core.UserLogin&g2_form[formName]=UserLogin&g2_form[username]=johndoe&g2_form[password]=mysecret&g2_form[action][login]=Login
Methode as you have described before. One thing I need for this, is to disable the password change in G2. Could you help me with that?

Is it also posible to POST the values to main.php, as I dont like to send the password in the URL.

I am still very much interested in writeing a module for G2, and for the flash site I am doing, so I can again get the change password function, and beeing able to add users via G2. But again, my PHP skils is much laging, and G1.x was just understandeble for me. So code examples would help me alot.

Best regards
Timo J

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Thu, 2006-01-12 05:14

You can grab here the little 'module' which does creating/updating of external users using g2 as master:
http://www.site.hu/me/g2/mod_UpdateExternalUser.tar.gz
Note: It's not an official module, neither cleaned up, or finished, it's a user to user, 3rd party contrib.
(feel free to post bugs etc)
It was made to work with phpbb (as slave), so it need to be adapted to any other slave environment.

 
TimoJ

Joined: 2006-01-10
Posts: 4
Posted: Thu, 2006-01-12 07:06

Hi joe7rocks,

Thank you so much for this module, this can deffently get me started.

Now I will go on with my programming.

Best regards
Timo J