#33631 closed enhancement (fixed)
Add filter to prevent user creation during site creation
Reported by: | mackensen | Owned by: | rachelbaker |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Networks and Sites | Keywords: | has-patch commit |
Focuses: | multisite | Cc: |
Description
We administer a multisite environment with external (LDAP) authentication configured. We do not allow local accounts. Our procedure when creating a new site is to add the soon-to-be-administrator from external authentication to the top-level site (if they did not already exist) before creating the site. If someone misses that first step, we wind up with an unwanted local account which then has to be fixed. What would be cool is a filter/hook in wp-admin/network/site-new.php that attaches to email_exists and lets you stop the site creation process if the user doesn't exist.
Attachments (4)
Change History (14)
#2
@
9 years ago
Working on this at WCUS Contributor Day. I've added a new action network_site_new_created_user_pending which fires immediately before user creation, so you could hook into it with a simple wp_die or whatever else you might want to do. I could see external auth attempting to auto provision the account.
#3
@
9 years ago
@mackensen Looks like you have wrong parameter type in the inline docs for the filter. Can you check it?
#6
@
9 years ago
- Owner set to rachelbaker
- Resolution set to fixed
- Status changed from new to closed
In 35786:
#7
@
9 years ago
- Milestone changed from Awaiting Review to 4.5
- Resolution fixed deleted
- Status changed from closed to reopened
We can probably tighten up the naming on this a bit to be more clear. Nothing is pending yet, as we still need to go through some other user checks to see if the email is valid before continuing. Using pre_
seems to make sense. I've added 33631.2.diff with this change.
Thoughts?
A workaround: