PHP 클래스 Application_Passwords

부터: 0.1-dev
파일 보기 프로젝트 열기: georgestephanis/application-passwords 1 사용 예제들

공개 메소드들

메소드 설명
add_hooks ( ) Add various hooks.
authenticate ( WP_User $input_user, string $username, string $password ) : mixed Filter the user to authenticate.
chunk_password ( string $raw_password ) : string Sanitize and then split a password into smaller chunks.
create_new_application_password ( integer $user_id, string $name ) : array Generate a new application password.
delete_all_application_passwords ( integer $user_id ) : integer Deletes all application passwords for the given user.
delete_application_password ( integer $user_id, string $slug ) : boolean Delete a specified application password.
get_user_application_passwords ( integer $user_id ) : array Get a users application passwords.
password_unique_slug ( array $item ) : string Generate a unique repeateable slug from the hashed password, name, and when it was created.
rest_add_application_password ( $data ) : array REST API endpoint to add a new application password for a user.
rest_api_auth_handler ( $input_user ) : WP_User | boolean Loosely Based on https://github.com/WP-API/Basic-Auth/blob/master/basic-auth.php
rest_api_init ( ) Handle declaration of REST API endpoints.
rest_delete_all_application_passwords ( $data ) : integer REST API endpoint to delete all of a user's application passwords.
rest_delete_application_password ( $data ) : boolean REST API endpoint to delete a given application password.
rest_edit_user_callback ( $data ) : boolean Whether or not the current user can edit the specified user.
rest_list_application_passwords ( $data ) : array REST API endpoint to list existing application passwords for a user.
rest_test_basic_authorization_header ( ) : WP_Error | array Test whether PHP can see Basic Authorization headers passed to the web server.
set_user_application_passwords ( integer $user_id, array $passwords ) : boolean Set a users application passwords.
show_user_profile ( WP_User $user ) Display the application password section in a users profile.
wp_rest_server_class ( $class ) Prevent caching of unauthenticated status. See comment below.

메소드 상세

add_hooks() 공개 정적인 메소드

Add various hooks.
부터: 0.1-dev
public static add_hooks ( )

authenticate() 공개 정적인 메소드

Filter the user to authenticate.
부터: 0.1-dev
public static authenticate ( WP_User $input_user, string $username, string $password ) : mixed
$input_user WP_User User to authenticate.
$username string User login.
$password string User password.
리턴 mixed

chunk_password() 공개 정적인 메소드

Sanitize and then split a password into smaller chunks.
부터: 0.1-dev
public static chunk_password ( string $raw_password ) : string
$raw_password string Users raw password.
리턴 string

create_new_application_password() 공개 정적인 메소드

Generate a new application password.
부터: 0.1-dev
public static create_new_application_password ( integer $user_id, string $name ) : array
$user_id integer User ID.
$name string Password name.
리턴 array The first key in the array is the new password, the second is its row in the table.

delete_all_application_passwords() 공개 정적인 메소드

Deletes all application passwords for the given user.
부터: 0.1-dev
public static delete_all_application_passwords ( integer $user_id ) : integer
$user_id integer User ID.
리턴 integer The number of passwords that were deleted.

delete_application_password() 공개 정적인 메소드

Delete a specified application password.
또한 보기: Application_Passwords::password_unique_slug()
부터: 0.1-dev
public static delete_application_password ( integer $user_id, string $slug ) : boolean
$user_id integer User ID.
$slug string The generated slug of the password in question.
리턴 boolean Whether the password was successfully found and deleted.

get_user_application_passwords() 공개 정적인 메소드

Get a users application passwords.
부터: 0.1-dev
public static get_user_application_passwords ( integer $user_id ) : array
$user_id integer User ID.
리턴 array

password_unique_slug() 공개 정적인 메소드

Generate a unique repeateable slug from the hashed password, name, and when it was created.
부터: 0.1-dev
public static password_unique_slug ( array $item ) : string
$item array The current item.
리턴 string

rest_add_application_password() 공개 정적인 메소드

REST API endpoint to add a new application password for a user.
부터: 0.1-dev
public static rest_add_application_password ( $data ) : array
$data
리턴 array

rest_api_auth_handler() 공개 정적인 메소드

Loosely Based on https://github.com/WP-API/Basic-Auth/blob/master/basic-auth.php
부터: 0.1-dev
public static rest_api_auth_handler ( $input_user ) : WP_User | boolean
$input_user
리턴 WP_User | boolean

rest_api_init() 공개 정적인 메소드

Handle declaration of REST API endpoints.
부터: 0.1-dev
public static rest_api_init ( )

rest_delete_all_application_passwords() 공개 정적인 메소드

REST API endpoint to delete all of a user's application passwords.
부터: 0.1-dev
public static rest_delete_all_application_passwords ( $data ) : integer
$data
리턴 integer The number of deleted passwords

rest_delete_application_password() 공개 정적인 메소드

REST API endpoint to delete a given application password.
부터: 0.1-dev
public static rest_delete_application_password ( $data ) : boolean
$data
리턴 boolean

rest_edit_user_callback() 공개 정적인 메소드

Whether or not the current user can edit the specified user.
부터: 0.1-dev
public static rest_edit_user_callback ( $data ) : boolean
$data
리턴 boolean

rest_list_application_passwords() 공개 정적인 메소드

REST API endpoint to list existing application passwords for a user.
부터: 0.1-dev
public static rest_list_application_passwords ( $data ) : array
$data
리턴 array

rest_test_basic_authorization_header() 공개 정적인 메소드

Test whether PHP can see Basic Authorization headers passed to the web server.
public static rest_test_basic_authorization_header ( ) : WP_Error | array
리턴 WP_Error | array

set_user_application_passwords() 공개 정적인 메소드

Set a users application passwords.
부터: 0.1-dev
public static set_user_application_passwords ( integer $user_id, array $passwords ) : boolean
$user_id integer User ID.
$passwords array Application passwords.
리턴 boolean

show_user_profile() 공개 정적인 메소드

This executes during the show_user_security_settings action.
부터: 0.1-dev
public static show_user_profile ( WP_User $user )
$user WP_User WP_User object of the logged-in user.

wp_rest_server_class() 공개 정적인 메소드

We don't actually care about the wp_rest_server_class filter, it just happens right after the constant we do care about is defined.
부터: 0.1-dev
public static wp_rest_server_class ( $class )