[wp-trac] [WordPress Trac] #37836: Cannot disable 'Add existing user'

WordPress Trac noreply at wordpress.org
Fri Aug 26 09:28:58 UTC 2016


#37836: Cannot disable 'Add existing user'
-------------------------------------------+-----------------------------
 Reporter:  bseddon                        |      Owner:
     Type:  defect (bug)                   |     Status:  new
 Priority:  normal                         |  Milestone:  Awaiting Review
Component:  Users                          |    Version:  4.6
 Severity:  normal                         |   Keywords:
  Focuses:  ui, administration, multisite  |
-------------------------------------------+-----------------------------
 The 'Add existing user' form on the Add New User page should only show if
 the user has been granted the 'promote_users' capability.  At least I am
 inferring this is the intended purpose of the 'promote_users' capability
 because it's only used in wp-admin/users.php to restrict features relating
 to the addition of existing users.

 However, it doesn't work because of the misplaced use of the variable
 $do_both.

 $do_both is set to true if the installation is multi-site and the user has
 been granted both 'create_users' and 'promote_users' capabilities.

 This variable is used incorrectly on line 307.  Here it only prevents the
 display of the title of the form to add an existing user.  I believe the
 variable $do_both should be added to the test on line 306 so the whole
 form, not just the heading, is displayed only when the user has been
 granted the 'promote_users' capability.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37836>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list