code standards

This commit is contained in:
Max Rice 2015-01-19 00:33:38 -05:00
parent 1f62a53e0e
commit 512d77fb4c
1 changed files with 7 additions and 5 deletions

View File

@ -36,15 +36,17 @@ class WC_API_Authentication {
public function authenticate( $user ) { public function authenticate( $user ) {
// allow access to the index by default // allow access to the index by default
if ( '/' === WC()->api->server->path ) if ( '/' === WC()->api->server->path ) {
return new WP_User(0); return new WP_User( 0 );
}
try { try {
if ( is_ssl() ) if ( is_ssl() ) {
$user = $this->perform_ssl_authentication(); $user = $this->perform_ssl_authentication();
else } else {
$user = $this->perform_oauth_authentication(); $user = $this->perform_oauth_authentication();
}
// check API key-specific permission // check API key-specific permission
$this->check_api_key_permissions( $user ); $this->check_api_key_permissions( $user );
@ -165,7 +167,7 @@ class WC_API_Authentication {
$user_query = new WP_User_Query( $user_query = new WP_User_Query(
array( array(
'meta_key' => 'woocommerce_api_consumer_key', 'meta_key' => 'woocommerce_api_consumer_key',
'meta_value' => $consumer_key, 'meta_value' => $consumer_key,
) )
); );