Plugin Directory

Changeset 1020343

Timestamp:
11/05/2014 04:11:04 PM (10 years ago)
Author:
eoigal
Message:

Add an action to auto activate/connect akismet key using the jetpack connected wordpress.com account

File:
1 edited

Legend:

Unmodified
Added
Removed
  • akismet/trunk/class.akismet-admin.php

    r1019667 r1020343  
    3838        add_action( 'wp_ajax_comment_author_deurl', array( 'Akismet_Admin', 'remove_comment_author_url' ) );
    3939        add_action( 'wp_ajax_comment_author_reurl', array( 'Akismet_Admin', 'add_comment_author_url' ) );
     40
    4041
    4142        add_filter( 'plugin_action_links', array( 'Akismet_Admin', 'plugin_action_links' ), 10, 2 );
     
    654655    }
    655656   
    656     public static function verify_wpcom_key( $api_key, $user_id, $token = '' ) {
    657         $akismet_account = Akismet::http_post( Akismet::build_query( array(
     657    public static function verify_wpcom_key( $api_key, $user_id, $ ) {
     658        $akismet_account = Akismet::http_post( Akismet::build_query( array(
    658659            'user_id'          => $user_id,
    659660            'api_key'          => $api_key,
    660             'token'            => $token,
    661661            'get_account_type' => 'true'
    662         ) ), 'verify-wpcom-key' );
     662        ) ), 'verify-wpcom-key' );
    663663
    664664        if ( ! empty( $akismet_account[1] ) )
     
    668668       
    669669        return $akismet_account;
     670
     671
     672
     673
     674
     675
     676
     677
     678
     679
     680
     681
     682
     683
     684
     685
    670686    }
    671687
     
    724740       
    725741        if ( isset( $_GET['token'] ) && preg_match('/^(\d+)-[0-9a-f]{20}$/', $_GET['token'] ) )
    726             $akismet_user = self::verify_wpcom_key( '', '', $_GET['token'] );
     742            $akismet_user = self::verify_wpcom_key( '', '', );
    727743        elseif ( $jetpack_user = self::get_jetpack_user() )
    728744            $akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'] );
Note: See TracChangeset for help on using the changeset viewer.