2003-08-20 18:59:20 -04:00
|
|
|
<?php
|
2008-05-25 11:50:15 -04:00
|
|
|
/**
|
|
|
|
* Creates the password cookie and redirects back to where the
|
|
|
|
* visitor was before.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
*/
|
|
|
|
|
2009-04-20 17:50:29 -04:00
|
|
|
/** Make sure that the WordPress bootstrap has run before continuing. */
|
2012-01-11 11:42:42 -05:00
|
|
|
require( dirname( __FILE__ ) . '/wp-load.php');
|
|
|
|
|
|
|
|
if ( empty( $wp_hasher ) ) {
|
|
|
|
require_once( ABSPATH . 'wp-includes/class-phpass.php');
|
|
|
|
// By default, use the portable hash from phpass
|
|
|
|
$wp_hasher = new PasswordHash(8, true);
|
|
|
|
}
|
2004-10-10 13:46:50 -04:00
|
|
|
|
|
|
|
// 10 days
|
2012-01-11 11:42:42 -05:00
|
|
|
setcookie( 'wp-postpass_' . COOKIEHASH, $wp_hasher->HashPassword( stripslashes( $_POST['post_password'] ) ), time() + 864000, COOKIEPATH );
|
2004-10-10 13:46:50 -04:00
|
|
|
|
2012-01-11 11:42:42 -05:00
|
|
|
wp_safe_redirect( wp_get_referer() );
|
2010-12-09 13:02:54 -05:00
|
|
|
exit;
|