XM

Xpark Media

Skip to top navigation
  • Google Plus
  • RSS
  • Twitter
  • WordPress
Skip to main navigation
  • Register
  • Log in
Skip to content
Menu
  • Blog
    • WordPress
    • Tutorials
    • JavaScript
    • Code snippets
  • Plugins
    • Image Store
    • Popular Widget
    • File Un-Attach
  • Themes
    • XClusive
    • XClusive Pro
  • Portfolio
    • Galleries
  • Tools
    • CSS Compresor
    • QR Code Generator
  • Support
    • Image Store
    • Popular Widget
    • File Un-attach
    • XClusive
  • Contact
  • Home
  • »
  • Support
  • »
  • Image Store
  • »
  • WP 3.4 Breaks password protected galleries
InfoReviewsSupport

WP 3.4 Breaks password protected galleries

DecafManJune 15, 2012

Home › Support › Image Store › WP 3.4 Breaks password protected galleries

Tagged: 3.4, login

Viewing 12 posts - 1 through 12 (of 12 total)

Post navigation

Next →
  • Author
    Posts
  • June 15, 2012 at 11:03 am #47915
    DecafMan
    Participant

    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 #47923
    Xpark Media
    Keymaster

    I 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 #47929
    DecafMan
    Participant

    Hi 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 #47955
    Xpark Media
    Keymaster

    update to version 3.0.9 a fixed has been applied.

    June 17, 2012 at 1:15 am #47972
    DecafMan
    Participant

    Updated to 3.0.9, working fine now. Thanks Hax.

    June 17, 2012 at 10:13 am #47980
    DecafMan
    Participant

    Hi 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 #47982
    DecafMan
    Participant

    As 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 #48010
    Xpark Media
    Keymaster

    do you have a cache plugin? clear your server cache

    June 20, 2012 at 2:23 am #48060
    DecafMan
    Participant

    Hi 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 #48063
    DecafMan
    Participant

    Sorry, 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 #48117
    DecafMan
    Participant

    OK, 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 #48145
    Xpark Media
    Keymaster

    There 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].

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Log In

Login form protected by Login LockDown.




Hide Sidebar

Image Store

  • Download (3.5.9)
  • FAQ
  • Secure Images
  • Albums
  • Languages
  • Shortcode
  • Changelog
  • Docs
  • Tutorials
  • Screenshots

Other plugins

  • File Un-Attach
  • Popular Widget

Move Up
  • © 2010-2017 Xpark Media.
  • Terms of Service
  • Privacy Policy
  • Contact
  • Español
Powered by WordPress