Changeset 49617
- Timestamp:
- 11/16/2020 10:40:11 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/authorize-application.php
r49562 r49617 91 91 if ( ! wp_is_application_passwords_available_for_user( $user ) ) { 92 92 if ( wp_is_application_passwords_available() ) { 93 $message = __( 'Application passwords are not enabledfor your account. Please contact the site administrator for assistance.' );93 $message = __( 'Application passwords are not available for your account. Please contact the site administrator for assistance.' ); 94 94 } else { 95 $message = __( 'Application passwords are not enabled.' );95 $message = __( 'Application passwords are not available.' ); 96 96 } 97 97 … … 100 100 __( 'Cannot Authorize Application' ), 101 101 array( 102 'response' => 501, 102 103 'link_text' => __( 'Go Back' ), 103 104 'link_url' => $reject_url ? add_query_arg( 'error', 'disabled', $reject_url ) : admin_url(), -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php
r49276 r49617 504 504 return new WP_Error( 505 505 'application_passwords_disabled', 506 __( 'Application passwords are not enabled.' ),507 array( 'status' => 50 0)506 __( 'Application passwords are not available.' ), 507 array( 'status' => 501 ) 508 508 ); 509 509 } … … 548 548 return new WP_Error( 549 549 'application_passwords_disabled_for_user', 550 __( 'Application passwords are not enabledfor your account. Please contact the site administrator for assistance.' ),551 array( 'status' => 50 0)550 __( 'Application passwords are not available for your account. Please contact the site administrator for assistance.' ), 551 array( 'status' => 501 ) 552 552 ); 553 553 } -
trunk/src/wp-includes/user.php
r49475 r49617 351 351 ); 352 352 } 353 } elseif ( ! wp_is_application_passwords_available() ) { 354 $error = new WP_Error( 355 'application_passwords_disabled', 356 'Application passwords are not available.' 357 ); 353 358 } elseif ( ! wp_is_application_passwords_available_for_user( $user ) ) { 354 359 $error = new WP_Error( 355 'application_passwords_disabled ',356 __( 'Application passwords are disabled for the requested user.' )360 'application_passwords_disabled_for_user', 361 __( 'Application passwords are not available for your account. Please contact the site administrator for assistance.' ) 357 362 ); 358 363 } … … 4132 4137 4133 4138 /** 4134 * Checks if Application Passwords is enabledfor a specific user.4139 * Checks if Application Passwords is available for a specific user. 4135 4140 * 4136 4141 * By default all users can use Application Passwords. Use {@see 'wp_is_application_passwords_available_for_user'} -
trunk/tests/phpunit/tests/auth.php
r49603 r49617 528 528 $error = wp_authenticate_application_password( null, self::$_user->user_login, 'password' ); 529 529 $this->assertWPError( $error ); 530 $this->assertSame( 'application_passwords_disabled ', $error->get_error_code() );530 $this->assertSame( 'application_passwords_disabled_for_user', $error->get_error_code() ); 531 531 } 532 532 -
trunk/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php
r49603 r49617 113 113 114 114 $response = rest_do_request( '/wp/v2/users/me/application-passwords' ); 115 $this->assertErrorResponse( 'application_passwords_disabled', $response, 50 0);115 $this->assertErrorResponse( 'application_passwords_disabled', $response, 501 ); 116 116 } 117 117 … … 124 124 125 125 $response = rest_do_request( '/wp/v2/users/me/application-passwords' ); 126 $this->assertErrorResponse( 'application_passwords_disabled_for_user', $response, 50 0);126 $this->assertErrorResponse( 'application_passwords_disabled_for_user', $response, 501 ); 127 127 } 128 128
Note: See TracChangeset
for help on using the changeset viewer.