WordPress.org

Make WordPress Core

Ticket #4627: wp2-linkmanager.patch

File wp2-linkmanager.patch, 2.8 KB (added by snakefoot, 11 years ago)

WP2 Link Manager Patch

  • wp-admin/link-manager.php

     
    1212                       'description', 'visible', 'target', 'category', 'link_id',
    1313                       'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',
    1414                       'notes', 'linkcheck[]');
     15                                           
     16if ( ! current_user_can('manage_links') )
     17     wp_die( __('You do not have sufficient permissions to edit the links for this blog.') );
    1518
    1619for ($i=0; $i<count($wpvarstoreset); $i += 1) {
    1720    $wpvar = $wpvarstoreset[$i];
     
    4144  {
    4245        check_admin_referer('bulk-bookmarks');
    4346
    44     // check the current user's level first.
    45     if ( !current_user_can('manage_links') )
    46       die (__("Cheatin' uh ?"));
    47 
    4847    //for each link id (in $linkcheck[]): if the current user level >= the
    4948    //userlevel of the owner of the link then we can proceed.
    5049
     
    7069  {
    7170        check_admin_referer('bulk-bookmarks');
    7271
    73     // check the current user's level first.
    74     if ( !current_user_can('manage_links') )
    75       die (__("Cheatin' uh ?"));
    76 
    7772    //for each link id (in $linkcheck[]): toggle the visibility
    7873    if (count($linkcheck) == 0) {
    7974        wp_redirect($this_file);
     
    108103  {
    109104        check_admin_referer('bulk-bookmarks');
    110105
    111     // check the current user's level first.
    112     if ( !current_user_can('manage_links') )
    113       die (__("Cheatin' uh ?"));
    114 
    115106    //for each link id (in $linkcheck[]) change category to selected value
    116107    if (count($linkcheck) == 0) {
    117108        wp_redirect($this_file);
     
    164155        $link_id = (int) $_GET['link_id'];
    165156        check_admin_referer('delete-bookmark_' . $link_id);
    166157
    167     if ( !current_user_can('manage_links') )
    168       die (__("Cheatin' uh ?"));
    169 
    170158        wp_delete_link($link_id);
    171159       
    172160    if (isset($links_show_cat_id) && ($links_show_cat_id != ''))
     
    185173
    186174  case 'linkedit': {
    187175        $xfn_js = true;
    188         include_once ('admin-header.php');
    189         if ( !current_user_can('manage_links') )
    190                 die(__('You do not have sufficient permissions to edit the links for this blog.'));
    191176       
    192177        $link_id = (int) $_GET['link_id'];
    193178       
    194179        if ( !$link = get_link_to_edit($link_id) )
    195180                die( __('Link not found.') );
    196        
     181
     182        include_once ('admin-header.php');             
    197183        include('edit-link-form.php');
    198184        break;
    199185  } // end linkedit
     
    237223    setcookie('links_show_cat_id_' . COOKIEHASH, $links_show_cat_id, time()+600);
    238224    setcookie('links_show_order_' . COOKIEHASH, $links_show_order, time()+600);
    239225    include_once ("./admin-header.php");
    240     if ( !current_user_can('manage_links') )
    241       die(__("You do not have sufficient permissions to edit the links for this blog."));
    242 
     226 
    243227    switch ($order_by)
    244228    {
    245229        case 'order_id':     $sqlorderby = 'id';          break;