Hello.
I'm having trouble reverse engineering the API to understand the login system that you need to embed the api with.
Basically I've been digging for a simple login script example. It'd look something like this:
if (user_logged_in()) {
level = check_level();
if(level==admin) {
do_something();
}
} elseif(submitting_form) {
check_post_data
if(check_post_data) {
login
}
} else {
show_login_page
}
I have a basic script that calls
GalleryEmbed::init
and then
GalleryEmbed::handleRequest
But in between I'm not really sure what component of the API I need to send gallery the username and password. I also cant find out how to attain that they're admin or just a normal user.
The basis for this is i want to create a seperate admin page for my CMS but use gallery2 for my user sessions and authentication as there will need to be heaps of admin related things to do with gallery2.
I have had a look at a few pages in the wiki section and the API reference but there isn't any info on sending username and password information to gallery.
Hope you guys can help.
Thanks
Posts: 180
Embed does not check password. It just check if there's is a username in the externalmapped table (not user table!)
What you can do is use the Embed anyway to check if a user is already loggedin (as far as I know it needs to be in the Gallery-dir...else you will prob end up with cookie problems ) This is something I worked on & I found with info from Valiant.