Tutorial: WordPress and ZenPhoto login integration
If you log into WordPress successfully, then the changes below will automatically log you into ZenPhoto...
Add the following to wp-login.php (wordpress base directory) at the very begining of the file:
`require_once("zenphoto/zen/functions-db.php");
require_once("zenphoto/zen/auth_zp.php");`
before this line:
`require( dirname(__FILE__) . '/wp-config.php' );`
then go to around line 195, which reads `do_action('wp_login', $user_login);` and replace with the following:
`do_action('wp_login', $user_login);
setcookie("zenphoto_auth", sha1(admin.password), time()+5184000, WEBPATH);
$_zp_loggedin = true;
wp_redirect($redirect_to);
exit();`
Obviously the set cookie function needs you to input your username and password for ZenPhoto (unless of course you keep them at admin and password respectively)
Comments
if you replace admin.password with $user_name.$user_pass wordpress will pass on each person's username and password into the cookie and the admin link will only show up for the person who's information matches the user/pw set in config.php.
do_action('wp_authenticate', array(&$user_login, &$user_pass));
setcookie("zenphoto_auth", sha1(historian.plunger), time()+5184000, WEBPATH);
$_zp_loggedin = true;
could just be a WP2 thing.
http://www.zenphoto.org/support/topic.php?id=755#post-4165
Hope it helps (a bit).
Have a good day,
hip