WordPress.org

Plugin Directory

Changeset 560757


Ignore:
Timestamp:
06/19/12 19:36:10 (22 months ago)
Author:
BrianLayman
Message:
 
Location:
smart-passworded-pages/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smart-passworded-pages/trunk/readme.txt

    r554999 r560757  
    44Tags: password,security,page,member,login,cms 
    55Requires at least: 2.5 
    6 Tested up to: 3.3.2 
    7 Stable tag: 1.0.1 
     6Tested up to: 3.4 
     7Stable tag: 1.1.0 
    88 
    99Allows a central login page for password protected child pages. Enter a password and you are taken to the newest child page with a matching password. 
     
    4242== Changelog == 
    43431.0 Initial Release 
     44 
    44451.0.1 Added compatiblity with the exclude pages plugin 
     46 
     471.1.0 Updated the plugin to include the security enhancements added in WordPress 3.4 
  • smart-passworded-pages/trunk/smartpwpages.php

    r554996 r560757  
    44Plugin URI: http://thecodecave.com/plugins/smart-passworded-pages-plugin/ 
    55Description: Allows a central login page for password protected child pages. Enter a password and you are taken to the newest child page with a matching password. 
    6 Version: 1.0.1 
     6Version: 1.1.0 
    77Author: Brian Layman 
    88Author URI: http://eHermitsInc.com/ 
     
    2626*/ 
    2727 
     28// constants 
     29define( 'SECONDS_TO_STORE_PW', 864000); // 864000 = 10 Days  
     30 
    2831class smartPWPages { 
    2932     function smartpwpages_shortcode( $atts ) { 
     
    4447 
    4548    function pw_redirect( $perma, $password ) { 
    46         if ( empty( $wp_hasher ) ) { 
     49        global $wp_version; 
     50        $cookiePW = stripslashes( $_POST['post_password'] ); 
     51        if (version_compare($wp_version, '3.4', '>=')) { 
     52            // version is 3.4 and higher has better security on the pw pages 
    4753            require_once( ABSPATH . 'wp-includes/class-phpass.php' ); 
     54             
    4855            // By default, use the portable hash from phpass 
    4956            $wp_hasher = new PasswordHash(8, true); 
    50         } 
     57            $cookiePW = $wp_hasher->HashPassword( $cookiePW ); 
     58        }        
     59         
    5160        // 10 days 
    52         setcookie( 'wp-postpass_' . COOKIEHASH, stripslashes( $password ), time() + 864000, COOKIEPATH ); 
     61        setcookie( 'wp-postpass_' . COOKIEHASH, stripslashes( $password ), time() + SECONDS_TO_STORE_PW, COOKIEPATH ); 
    5362        wp_safe_redirect( $perma ); 
    5463        exit(); 
Note: See TracChangeset for help on using the changeset viewer.