Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/28/2020 03:38:54 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Signups: Ensure that the dynamic role exists before setting it.

This commit introduces several new helper functions for validating Forum roles before saving & assigning them to new user accounts.

It also adds relevant capability checks to prevent unauthorized users from performing role assignments.

In trunk, for 2.7.0.

See #3157.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/actions.php

    r7072 r7086  
    408408add_action( 'clean_post_cache', 'bbp_clean_post_cache', 10, 2 );
    409409
    410 // User Creation
     410// User Registration
     411add_action( 'added_existing_user', 'bbp_user_add_role_on_register', 10, 1 );
     412add_action( 'bbp_user_register',   'bbp_user_add_role_on_register', 10, 1 );
     413
     414// Invite a New User
    411415add_action( 'invite_user',         'bbp_user_add_role_on_invite',   10, 3 );
     416
     417// Multisite Activation (does not work in wp-activate.php)
    412418add_action( 'wpmu_activate_user',  'bbp_user_add_role_on_activate', 10, 3 );
    413 add_action( 'bbp_user_register',   'bbp_user_add_role_on_register', 10, 1 );
    414 add_action( 'added_existing_user', 'bbp_user_add_role_on_register', 10, 1 );
    415 add_action( 'register_new_user',   'bbp_user_add_role_on_register', 10, 1 );
    416419
    417420/**
Note: See TracChangeset for help on using the changeset viewer.