Hello,
I recently installed G2 and I have to say , bravo ;-)
The only thing is, i should like to have an external log-in for my G2 gallery so that people can log-in trough my homepage.. it's because my site is very private... i don't want to have 2 separate logins on my website
Could anybody help me plz ?
Thx a lot !
greetz
Posts: 32509
take a look at docs/EMBEDDING and click on the link in my signature (Embedding & Integration). please take your time reading the extisting questions/answers concerning embedding and feel free to ask further questions.
Posts: 8
okay , i've checked them all , but there'll all to big , for me it just has to be a simple log-in screen and when you log-in here , you will redirect to my gallery and be logged in .. according to me it's very simple but I'm not that big php freak ;-)
thx
Posts: 32509
no, it's not that simple and you will have to use embed.php.
here's why...
- you want that the user has to login only once.
- this implicates that the user exists in both applications, in your websites user management as well as in G2.
- therefore you need to synchronize create user events from your website to G2.
this part of embed.php is also very simple. either call GalleryEmbed::login and you will be logged in automatically or pass all request to G2 through a wrapper which calls GalleryEmbed::init and GalleryEMbed::handlerequest.
it's explained all over the forum. please, take your time reading these posts.
Posts: 8
<form method="post" action="http://...... ">
Naam : <input type="text" name="username" class="inputfield" /><br>
Paswoord : <input type="password" name="password" maxlength="32" class="inputfield"/>
<input type="submit" name="login" value="Login"/>
</form>
Something like this won't work ? Instead of the http:// a g2 url of course ?
I don't really understand the embed.php :s i'm sorry
Posts: 32509
all you would achieve with such a login box is that the user is logged in in G2. I thought you already have a login box for your homepage. which would mean that you already have a user and session management in your homepage.
what you propose is a solution where the visitors of your website have to login twice. first for your homepage, then for G2.
Posts: 8
okaaayyy ,
It's the first one you told you know , it's a site for my friend , the site only contains his gallery, i only want to achieve that you are logged in in G2 ...
how should my form look like then ?
Posts: 32509
just copy the html of the login box of G2 to your own website.
replace all "http://192.168.123.123/gallery2/" by your url and add/replace all css/javascript as needed.
Posts: 8
thank you a lot !!!
Posts: 35
Hi
I tried using this code with the latest version 2.2.1 but have found that if the user doesn't "logout", ie the move away or just close the browser when they log back in again it generates a 404 page which if you refresh takes them into gallery
Has anyone experienced anything similar?
Is this due to a change in the G2 security?
Is there a way to reset the login cookies?
Aaron
Posts: 180
I have the same thing as Aaron wenn people just move away without logging out and then enter through the form again. Well it's not a 404 but this message "Authentication Failure
Your change cannot be completed due to a loss of session data. Please try again. If it still doesn't work, try logging out and logging back in.
Back to the Gallery"
Error (ERROR_REQUEST_FORGED)
in modules/core/classes/GalleryController.class at line 239 (GalleryCoreApi::error)
in main.php at line 224 (GalleryController::assertIsGenuineRequest)
in main.php at line 94
in main.php at line 83
in main.php at line 3
Is there anyway to prevent this from happening if a user is logged in already?
Gallery version is 2.2.3
I have read this: http://gallery.menalto.com/node/63118 but the server where the login-form is, is a not a PHP-server.