Skip to:
Content

BuddyPress.org

Changeset 7564


Ignore:
Timestamp:
11/12/2013 04:10:24 PM (11 years ago)
Author:
boonebgorges
Message:

Prevent admin fiddling with Fullname field with properly narrow conditions.

BP prevents admins from editing the visibility and field type settings of the
Fullname field, because BP needs it to be public and a textarea. However, BP
was enforcing this edit block by checking the can_delete flag of the
BP_XProfile_Field object. In practice, it's usually the case that only field 1
will have the value of can_delete = 0. However - especially due to changes in
[7419] - other fields can have can_delete = 0 as well. The edit block should
therefore be more specific, based on the ID of the field rather than on the
value of can_delete.

Fixes #5237

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r7563 r7564  
    884884                            </div>
    885885
     886                            <?php /* Field 1 is the fullname field, which cannot have custom visibility */ ?>
    886887                            <?php if ( 1 != $this->id ) : ?>
    887888
     
    925926                        <div id="postbox-container-2" class="postbox-container">
    926927
    927                             <?php if ( '0' != $this->can_delete ) : ?>
     928                            <?php /* Field 1 is the fullname field, which cannot be altered */ ?>
     929                            <?php if ( 1 != $this->id ) : ?>
    928930
    929931                                <div class="postbox">
Note: See TracChangeset for help on using the changeset viewer.