Plugin Directory

Changeset 708933


Ignore:
Timestamp:
05/06/2013 11:20:56 PM (13 years ago)
Author:
Yuttadhammo
Message:

fix add access

File:
1 edited

Legend:

Unmodified
Added
Removed
  • buddypress-xml-rpc-receiver/trunk/admin/bp-xmlrpc-admin.php

    r708932 r708933  
    117117        $tab = 'main';
    118118
     119    // if adding access
     120   
     121    if ( isset ( $_GET['add_access'] ) && check_admin_referer( 'bp_xmlrpc_admin' ) ) {
     122        update_option( 'allowed_users', get_option('allowed_users').'\n'.$_GET['add_access'] );
     123        $added = true;
     124    }
     125
     126
    119127    /* If the form has been submitted and the admin referrer checks out, save the settings */
    120128    if ( isset( $_POST['submit'] ) && check_admin_referer( 'bp_xmlrpc_admin' ) ) {
     
    139147                break;
    140148            case 'access' :
    141            
    142                 // check for access addition
    143                
    144                 if ( isset ( $_GET['add_access'] ) ) {
    145                     update_option( 'allowed_users', get_option('allowed_users').'\n'.$_GET['add_access'] );
    146                     $added = true;
    147                 }
    148149           
    149150                //check for valid cap and update - if not keep old.
     
    239240            <table class="form-table">
    240241                <tr>
    241                     <th><label for="allowed_users">Add allowed usernames, one per line</label></th>
    242242                    <td>
     243                        Add allowed usernames, one per line<br/>
    243244                        <textarea id="allowed_users" name="allowed_users" cols="40" rows="20" ><?php echo esc_html( stripslashes( get_option( 'allowed_users' ) ) ); ?></textarea>
    244245                    </td>
Note: See TracChangeset for help on using the changeset viewer.