WP 3.4 Breaks password protected galleries

•

Bring Your Business to Life › Support › Image Store › WP 3.4 Breaks password protected galleries

Tagged: ,

Viewing 12 posts – 1 through 12 (of 12 total)
  • Author
    Posts
  • #47915
    #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( );
    }
    #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.

    #47955
    Xpark Media
    Keymaster

    update to version 3.0.9 a fixed has been applied.

    #47972
    DecafMan
    Participant

    Updated to 3.0.9, working fine now. Thanks Hax.

    #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.

    #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.

    #48010
    Xpark Media
    Keymaster

    do you have a cache plugin? clear your server cache

    #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.

    #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.

    #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)

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

Viewing 12 posts – 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.