Added content to grant access template
This commit is contained in:
parent
8cfa3eed75
commit
a6afac4516
|
@ -55,7 +55,7 @@ class WC_Auth {
|
|||
return add_query_arg( array(
|
||||
'app_name' => wc_clean( $data['app_name'] ),
|
||||
'return_url' => urlencode( $data['return_url'] ),
|
||||
'permission_type' => absint( $data['permission_type'] ),
|
||||
'permission_type' => wc_clean( $data['permission_type'] ),
|
||||
), $url );
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,8 @@ class WC_Auth {
|
|||
'app_name' => $_REQUEST['app_name'],
|
||||
'return_url' => $_REQUEST['return_url'],
|
||||
'permission_type' => $_REQUEST['permission_type'],
|
||||
'redirect' => $this->build_url( $_REQUEST, wc_get_endpoint_url( 'wc-auth', 'login', get_home_url( '/' ) ) )
|
||||
'redirect_url' => $this->build_url( $_REQUEST, wc_get_endpoint_url( 'wc-auth', 'grant_access', get_home_url( '/' ) ) ),
|
||||
'logout_url' => wp_logout_url( $this->build_url( $_REQUEST, wc_get_endpoint_url( 'wc-auth', 'login', get_home_url( '/' ) ) ) )
|
||||
);
|
||||
|
||||
if ( 'login' == $method && ! is_user_logged_in() ) { // Login endpoint
|
||||
|
|
|
@ -11,6 +11,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$user = wp_get_current_user();
|
||||
|
||||
?>
|
||||
|
||||
<?php do_action( 'woocommerce_auth_page_header' ); ?>
|
||||
|
@ -20,8 +22,13 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php wc_print_notices(); ?>
|
||||
|
||||
<form method="post" class="grant-access">
|
||||
<?php echo get_avatar( $user->ID, 70 ); ?>
|
||||
|
||||
<p><?php printf( __( 'Logged in as %s.', 'woocommerce' ), wc_clean( $user->display_name ) ); ?></p>
|
||||
|
||||
<input type="hidden" name="permission_type" value="<?php echo absint( $permission_type ); ?>">
|
||||
|
||||
<p><?php printf( __( 'Not %s? %s', 'woocommerce' ), wc_clean( $user->display_name ), '<a href="' . esc_url( $logout_url ) . '">' . __( 'Logout', 'woocommerce' ) . '</a>' ); ?></p>
|
||||
</form>
|
||||
|
||||
<a href="<?php echo esc_url( urldecode( $return_url ) ); ?>"><?php printf( __( 'Return To %s', 'woocommerce' ), wc_clean( $app_name ) ); ?></a>
|
||||
|
|
|
@ -34,7 +34,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<input type="submit" class="button" name="login" value="<?php _e( 'Login', 'woocommerce' ); ?>" />
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="redirect" value="<?php echo esc_url( $redirect ); ?>" />
|
||||
<input type="hidden" name="redirect" value="<?php echo esc_url( $redirect_url ); ?>" />
|
||||
</form>
|
||||
|
||||
<a href="<?php echo esc_url( urldecode( $return_url ) ); ?>"><?php printf( __( 'Return To %s', 'woocommerce' ), wc_clean( $app_name ) ); ?></a>
|
||||
|
|
Loading…
Reference in New Issue