Making WordPress.org


Ignore:
Timestamp:
02/27/2018 02:59:18 AM (7 years ago)
Author:
dd32
Message:

2FA: enable_two_factor() and disable_two_factor() shouldn't be static.

See #77.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-two-factor/wporg-two-factor.php

    r6785 r6786  
    353353     * NOTE: It's assumed that the Two Factor details have been setup correctly previously.
    354354     */
    355     public static function enable_two_factor( $user_id ) {
     355    public function enable_two_factor( $user_id ) {
    356356        $result = (
    357357            update_user_meta( $user_id, self::PROVIDER_USER_META_KEY,          'WPORG_Two_Factor_Primary' ) &&
     
    370370     * Simple handler to disable Two factor for a given user.
    371371     */
    372     public static function disable_two_factor( $user_id ) {
     372    public function disable_two_factor( $user_id ) {
    373373        delete_user_meta( $user_id, self::PROVIDER_USER_META_KEY );
    374374        delete_user_meta( $user_id, self::ENABLED_PROVIDERS_USER_META_KEY );
     
    565565            }
    566566
    567             if ( ! self::enable_two_factor( $user_id ) ) {
     567            if ( ! $this->enable_two_factor( $user_id ) ) {
    568568                wp_send_json_error( __( 'Unable to save Two Factor Authentication code. Please try again.', 'wporg' ) );
    569569            }
     
    586586        }
    587587
    588         if ( ! self::disable_two_factor( $user_id ) ) {
     588        if ( ! $this->disable_two_factor( $user_id ) ) {
    589589            wp_send_json_error( __( 'Unable to remove Two Factor Authentication code. Please try again.', 'wporg' ) );
    590590        }
Note: See TracChangeset for help on using the changeset viewer.