I have a new Wordpress plugin available: "ZenPhoto Single Sign-On"
plaintext:
http://elbedesign.com/projects/zp_plus_wp/zenphoto-single-sign-on.phpszipped:
http://elbedesign.com/projects/zp_plus_wp/zenphoto-single-sign-on.zipThe plugin is hopefully pretty self-explanatory:
- When you log in to Wordpress, you are auto-logged in to ZenPhoto.
- When you log out of Wordpress, you are auto-logged out of ZenPhoto.
- No changes are required to your ZenPhoto installation--the plugin is completely self-contained.
- You can even log in and out of ZenPhoto separately from Wordpress if you wish (although logging in/out of Wordpress will override the login state of ZenPhoto)
How it works/what it does: When a user logs in to Wordpress, the plugin checks to see whether they are authorized to perform a certain
capability, as defined by the user's role (Administrator, Author, etc.) by default, the plugin required that the user be able to "publish_posts" in order to be logged into ZenPhoto. You can easily change the required capability (configuration options can be changed directly in the plugin file)
To configure and install this plugin: The plugin needs to know
- Your ZenPhoto username
- Your ZenPhoto password
- What capability must the Wordpress user have to get admin access to ZenPhoto? ('publish_posts' by default)
Set these options in the top of the plugin file, then upload the file to your wp-plugins folder and activate the plugin.
I have only tested this plugin on my own installation so far, so there may be some scenarios that aren't covered. Reply in this thread with any questions/problems/suggestions and I will try to get them rolled in promptly.
- Josh
Comments
Nice work by the way I have been looking for an easy way to do this... Works great!!
I updated the plugin to use md5. Download links above are still current.
Thanks for the plugin! It looks good!
and in shuffling things, new download links as well:
plaintext: http://elbedesign.com/files/zenphoto-single-sign-on.phps
zipped: http://elbedesign.com/files/zenphoto-single-sign-on.zip
Can you describe your install and what is not working for you? (full path to WP, full path to ZP, expected behavior, behavior you are seeing)
My process:
Log out of ZP
Login into WP
Go to my WP admin.php and I still get prompted for username/pass.
There have been some password changes in the trunk, the password is now hashed, perhaps that's the problem?
my code: `setcookie("zenphoto_auth", md5($zp_user.$zp_pass), time()+5184000, '/');`
zp code: `setcookie("zenphoto_auth", md5($user.$pass), time()+5184000, $cookiepath);`
My plugin doesn't know the path to the ZP install, which is why ZP is having trouble unsetting the cookie that my plugin is setting.
As I mention, my install seems to work just fine (with the exception fo the logout bug, which I am working on). My Wordpress is at /zpwp/wordpress/ and my zenphoto is /zpwp/zenphoto/.
Sleary and aitf311: what is your path to ZP and path to WP? Are they in sibling folders? It would be very helpful to see what your cookie values look like to see where the problem is (I use the View Cookies Firefox Extension). Or if I can reproduce your install paths on my end I can try to reproduce the problem. feel free to email me with specifics or whatnot: jlb at elbedesign dot com. thanks for any help nailing down this problem...
plaintext: http://elbedesign.com/projects/zp_plus_wp/zenphoto-single-sign-on.phps
zipped: http://elbedesign.com/projects/zp_plus_wp/zenphoto-single-sign-on.zip
Changes in 0.2b1:
- Configuration no longer requires editing the plugin file. An admin sub-page controls all plugin features ("ZenPhoto" tab under "Options").
As I said, this is a beta release of 0.2 because it does nothing to address the problems reported by sleary and aitf311 above, which I am unable to reproduce on either my local machine or my server. Bug reports or other issues are welcome: jlb at elbedesign dot com.Options are now stored in the WP "options" table using the standard "`add_option`"/"`get_option`" functions.
A new option has been added to allow you to specify your ZenPhoto install path. This eliminates the problem of WP "guessing" that ZP is installed is the root of your site, which means that in some cases ZP's logout functionality would not work. If this option is set correctly, this problem no longer occurs.
Known Issue: ZP password is stored as plaintext in the WP database, due to the complexities of post-processing user options after the form is submitted and before the db is updated. Fixing this is on my to-do list, but it will not happen in this release
Unlike you, I have ZenPhoto in a subdirectory of the WP site.
WP: /
ZP: /photos
Cookies are:
wordpresspass_foo
wordpressuser_foo
wordpress_test_cookie
PHPSESSID
... where "foo" is actually a long, messy string.
HTH.
ETA: forgot to mention -- ZP is 1.1.2, WP is 2.3.1.
First, sorry for the delay -- damn holidays!
sleary, I replicated your setup with ZP in a subdirectory of the WP install, and I think I found the bug that was causing problems. Although my version of the plugin WAS reporting itself as 0.2b1 correctly, so I'm not sure if you had the latest version installed.
plaintext: http://elbedesign.com/projects/zp_plus_wp/zenphoto-single-sign-on.phps
zipped: http://elbedesign.com/projects/zp_plus_wp/zenphoto-single-sign-on.zip
This version should report itself as v0.2. If it doesn't, something strange is going on.
Give it a shot and let me know if it does not behave as promised.
Thanks for your patience.
my cookies typically look exactly like - sleary's -
What i see happening is when i log into WP and then check my ZP page at /gallery i see the zenphoto_auth cookie there, but as soon as i refresh my page the cookie disappears.
am i missing something?
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/zmus/public_html/blog/wp-content/plugins/zenphoto-single-sign-on.php on line 124
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/zmus/public_html/blog/wp-content/plugins/zenphoto-single-sign-on.php on line 129
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/zmus/public_html/blog/wp-content/plugins/zenphoto-single-sign-on.php on line 129
Warning: Cannot modify header information - headers already sent by (output started at /home/zmus/public_html/blog/wp-content/plugins/zenphoto-single-sign-on.php:124) in /home/zmus/public_html/blog/wp-content/plugins/zenphoto-single-sign-on.php on line 147
Warning: Cannot modify header information - headers already sent by (output started at /home/zmus/public_html/blog/wp-content/plugins/zenphoto-single-sign-on.php:124) in /home/zmus/public_html/blog/wp-includes/pluggable.php on line 694
im using wordpress 2.5.1 and zenphoto 1.1.7
thx
does anyone know why?
I am looking for someone to take over maintenance of this plugin, as I have clearly not been "keeping up" as well as I could be.
I have been moving my sites from Wordpress to Chyrp, and redirecting my development efforts accordingly, to the point where I only have a single site still running Wordpress, and that site doesn't even integrate with ZenPhoto. I also have a new baby, so I have less free time than ever.
If you are interested in inheriting the ZenPhoto Single Sign-on plugin, please post here or send an email to jlb /at/ elbedesign /dot/ com
-Josh
What's different about this plugin from the original is that, all you need to do is upload and activate the plugin and you're done. There is however, no menus or tabs to find this plugin in wordpress, it just simply does its thing by using cookies.
The only requirement is that you need to have the same username in both wordpress and zenphoto but, not the same passwords and it will just log you in automatically with you login in wordpress.
Here is the link for it(label this as unofficial 0.3 I guess):
http://www.mediafire.com/file/ixnmamyggyu/zenphotosinglelogin.php
If its against the rules to put links of files from other locations or I needed consent first, please delete the link.
I would love to do so, but unfortunately it doesn't work with WP2.6.5 and the recent ZenPhoto version. My dream is that each logged in Wordpress User has access to the ZenPhoto albums. No Wordpress Account - no ZenPhoto access...
Does anyone have a clue and can give some advices?
Thanks,
stef
I've been using this to integrate my bbpress and wordpress, and so far it's been great.
http://www.altert.net/upload/zenphoto-single-sign-on.zip
I'm not sure I can properly take over the project, as I have no expereince in writing wordpress plugins, but at least I will check it against next zenphoto version. If it tests ok, I think it's better to move it to extensions page - I've changed version to 0.3