Rename the public methods in the session tokens API.

Introduces a new get( $token ) method. get_token() would not have made sense and spurred the overall renaming. Public methods are now get, get_all, verify, create, update, destroy, destroy_others, and destroy_all.

The protected abstract methods designed for alternative implementations remain the same.

props mdawaffe.
see #20276.


git-svn-id: https://develop.svn.wordpress.org/trunk@29635 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-08-27 02:06:53 +00:00
parent 322991024f
commit e3345398aa
4 changed files with 78 additions and 59 deletions

View File

@@ -684,7 +684,7 @@ function wp_validate_auth_cookie($cookie = '', $scheme = '') {
}
$manager = WP_Session_Tokens::get_instance( $user->ID );
if ( ! $manager->verify_token( $token ) ) {
if ( ! $manager->verify( $token ) ) {
do_action( 'auth_cookie_bad_session_token', $cookie_elements );
return false;
}
@@ -728,7 +728,7 @@ function wp_generate_auth_cookie( $user_id, $expiration, $scheme = 'auth', $toke
if ( ! $token ) {
$manager = WP_Session_Tokens::get_instance( $user_id );
$token = $manager->create_token( $expiration );
$token = $manager->create( $expiration );
}
$pass_frag = substr($user->user_pass, 8, 4);
@@ -877,7 +877,7 @@ function wp_set_auth_cookie($user_id, $remember = false, $secure = '') {
}
$manager = WP_Session_Tokens::get_instance( $user_id );
$token = $manager->create_token( $expiration );
$token = $manager->create( $expiration );
$auth_cookie = wp_generate_auth_cookie( $user_id, $expiration, $scheme, $token );
$logged_in_cookie = wp_generate_auth_cookie( $user_id, $expiration, 'logged_in', $token );