session synchronization

sledhead45

Joined: 2007-01-26
Posts: 10
Posted: Tue, 2007-02-13 04:36

Ok I'm having an issue figuring out the session synchronization for my site. All the site files are at /var/www/ on the server and G2 is at /var/www/gallery2/. My site login and session files work fine for the rest of the site, and i want to build in the code so when a user logs into the main site, they get logged into G2 also (currently using cookies for session). So i am working from this guide this page . Right now i have a g_id from a registered user (from the g2_users table; is this the correct user id to use?) hardcoded into the activeuserid argument. And to be sure of other arguments i manually entered them; resulting in this:
$ret = GalleryEmbed::init(array( 'embedUri' => 'http://isetest.spatial.maine.edu/gallery2/main.php?module=gallery2', 'g2Uri' => 'http://isetest.spatial.maine.edu/gallery2/main.php', 'loginRedirect' => '/index.php', 'activeUserId' => 53)); .. Running my login.php page leaves me a blank white screen with no errors and apparently no one logged in, and that is the statement where the page gets hung-up. So I think im missing something fundamental here, but not sure what it is based on that guide and numerous google searches. Help would be great, thanks

--travis

Gallery version = 2.1.2 core 1.1.0.2
PHP version = 5.1.2 apache2handler
Webserver = Apache/2.0.55 (Ubuntu) PHP/5.1.2
Database = mysql 5.0.22-Debian_0ubuntu6.06.2-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, ImageMagick, NetPBM
Acceleration = none, none
Operating system = Linux isetest 2.6.15-27-server #1 SMP Sat Sep 16 02:57:21 UTC 2006 i686
Default theme = matrix
Locale = en_US
Browser = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20060601 Firefox/2.0.0.1 (Ubuntu-edgy)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-02-13 09:47

Did you alrwady see the more involving integration docs at:
http://codex.gallery2.org/Gallery2:Embedding:Integration#Login_And_Session_Management

the article you're referring to is mostly about getting the g2Uri / embedUri right while the above mentioned document should cover all integration topics, including session management.

Quote:
Right now i have a g_id from a registered user (from the g2_users table; is this the correct user id to use?) hardcoded into the activeuserid argument.

nope.
activeUserId is for integrations, where the other application (not g2) has a user management as well and where you need to map g2 user ids with the user ids of your application. activeUserId should be an id from your own user management.

do you have 2 separate user managements or do you just want to use g2's user management for the whole site?

--------------
Enter the Gallery 2 Theme Contest today!

 
sledhead45

Joined: 2007-01-26
Posts: 10
Posted: Tue, 2007-02-13 19:27
Quote:
nope.
activeUserId is for integrations, where the other application (not g2) has a user management as well and where you need to map g2 user ids with the user ids of your application. activeUserId should be an id from your own user management.

AHH ok i get it now... For other lost souls; to correctly use the activeuserid method in gallery2embedded.php, you must have the users getting mapped in the g2_ExternalIdMap table. activeuserid looks to log in a user by their g_externalId value.. and it works now.. Thanks again valiant :)