Home › Support › Image Store › WP 3.4 Breaks password protected galleries
-
AuthorPosts
-
June 15, 2012 at 11:03 am #47915DecafManParticipant
The latest WordPress 3.4 update has appeared to have broken the password protected gallery feature.
Existing galleries cannot be accessed even with the password since the 3.4 update. If I remove the password the gallery works fine.
Please advise ASAP.
Thank you.
June 15, 2012 at 12:20 pm #47923Xpark MediaKeymasterI just tested it and you are right, it’s a hash issue; I will fix it as soon as I can.
If you are not afraid of doing a quick fix this is what you have to do. Replace the following code in the store.php file ( image-store/_inc/store.php ) line 893
}elseif( $gal->post_password === $pass ){ setcookie( 'ims_galid_' . COOKIEHASH, $gal->ID, 0, COOKIEPATH, COOKIE_DOMAIN ); setcookie( 'wp-postpass_' . COOKIEHASH, $gal->post_password, 0, COOKIEPATH, COOKIE_DOMAIN ); update_post_meta( $gal->post_id, '_ims_visits', get_post_meta( $gal->ID, '_ims_visits', true ) +1 ); wp_redirect( get_permalink( $gal->ID ) ); die( ); }
with
}elseif( $gal->post_password === stripslashes( $pass ) ){ global $wp_hasher; if ( empty( $wp_hasher ) ) { require_once( ABSPATH . 'wp-includes/class-phpass.php'); $wp_hasher = new PasswordHash(8, true); } setcookie( 'ims_galid_' . COOKIEHASH, $gal->ID, 0, COOKIEPATH, COOKIE_DOMAIN ); setcookie( 'wp-postpass_' . COOKIEHASH, $wp_hasher->HashPassword( stripslashes($gal->post_password) ), 0, COOKIEPATH, COOKIE_DOMAIN ); update_post_meta( $gal->post_id, '_ims_visits', get_post_meta( $gal->ID, '_ims_visits', true ) +1 ); wp_redirect( get_permalink( $gal->ID ) ); die( ); }
June 16, 2012 at 12:02 am #47929DecafManParticipantHi Hax,
Thanks very much for the quick fix. I’ve updated the code as specified, but the gallery still doesn’t open with the password.
Any ideas, as I need to get the site back up and running.
Thanks.
June 17, 2012 at 12:06 am #47955Xpark MediaKeymasterupdate to version 3.0.9 a fixed has been applied.
June 17, 2012 at 1:15 am #47972DecafManParticipantUpdated to 3.0.9, working fine now. Thanks Hax.
June 17, 2012 at 10:13 am #47980DecafManParticipantHi Hax,
Sorry, spoke too soon.
Works fine from the “client area” login where the gallery name and password are required, but if you go straight to the gallery link where only the password is required (which is what my wedding clients are doing) it doesn’t allow access.
Please could you take a look. Thanks.
June 17, 2012 at 10:21 am #47982DecafManParticipantAs an example of the problem, here’s a link to a test password protected image store:
http://michael-allen.co.uk/galleries/password-test/
Password is “WordPress”
This will illustrate what’s happening.
June 18, 2012 at 12:34 am #48010Xpark MediaKeymasterdo you have a cache plugin? clear your server cache
June 20, 2012 at 2:23 am #48060DecafManParticipantHi Hax,
Unlikely to be a cache issue. Just tried it from another computer that has never accessed my site before, and the same problem occurs – that is, direct access to the gallery refuses the password, but going through the “Client Area” link and entering both the gallery name and password works fine.
I’m also getting reports from multiple wedding customers as well who are unable to access the site and place orders.
I’m going to pass on the gallery name & password method to those that get in touch with me but the direct link is what has been published in the bride and groom’s stationery so getting it working again is quite important.
I’ll await your reply…
Thanks.
June 20, 2012 at 6:01 am #48063DecafManParticipantSorry, misread your question about the cache plugin. In answer, no I am not using any cache plugins on the site.
Look forward to your response.
June 22, 2012 at 1:50 am #48117DecafManParticipantOK, tested that… all plugins deactivated (except Image Store, obviously) using the latest update of the WordPress Twenty Ten theme, and then the Twenty Eleven one too.
On both vanilla themes with all plugins deactivated it doesn’t even load the gallery page, just a plain white screen.
Any ideas…?
(I’ve had to reinstate everything after I’d tested as I need the site live and accessible)
June 23, 2012 at 3:26 pm #48145Xpark MediaKeymasterThere is has to be some sort of issue with your theme. I see that is ajax driven. The new version of WordPress encrypts the cookie password and your site is not doing it.
If you want me to fully debug your site. I will need access to your site and it will be down for a while and I will have to change you for the service. If you are interested please send me the information to [email protected].
-
AuthorPosts
- You must be logged in to reply to this topic.