WordPress.org

Ready to get started?Download WordPress

Forums

Hack the user's dashboard option (12 posts)

  1. bregutz
    Member
    Posted 7 years ago #

    I didn't find any plugin that would allow me to restric users/per level acces to the secction of the dashboard panel when they login.
    For example, for a specified category of users i want to disable the ability to acces the comments section of the panel when they are loged in, as they can see the IP and E-mail adress of all the coommenters. So what is the best solution to do that?

    Thanks in advance!

  2. davey579
    Member
    Posted 7 years ago #

  3. bregutz
    Member
    Posted 7 years ago #

    Thanks for the links but, they didn't help me much, the first one just hide the dashboard (wich can still be accesed by direct link)and is not what i want. The second one seems much more powerful but i don't know what codes to write for the desired results. What i want is to restrict users with Author level from accesing the Manage, Comments etc section when they are loged in.
    I want they only to be able to publish post, manage theyr post/profile and that's all. I don't want them, for exemple, do be able to acces the Comments section and be able to see the commenters IP's. And right now Authors (by default) are able to manage uploads as well, and they are able to browse all the uploads ( not only theyr's) and change files url's/dele them wich could resulte in the mess of the website.
    If anyone can help with some sugestions, i would be very greatful!

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    http://www.im-web-gefunden.de/wordpress-plugins/role-manager/

    WordPress has "Roles" and "Capabilities". This plugin will let you adjust them to define what you want each role to be capable of doing. When you do this, the appropriate options will be available to each user, depending on their capabilities.

  5. idahofallzcom
    Member
    Posted 7 years ago #

    This seems to be the million dollar question that nobody can or will answer. I've been searching for this solution for weeks now.

    Every time Role Manager is pointed to as the solution, however Role Manager lumps editing your own comments with other people's comments and thus you can see everyone's IP and email addressed, thus the purpose is defeated.

    I read in one spot that Role Manager can start trashing a 'data file'. I tried deactivating/deleting/reuploading/reactivating it but still no changes.

    I want to enable authors to edit their own comments, but if that cannot be separated from editing everyone's comments I would rather restrict them from edit-comments.php altogether.

    Unfortunately even Role Manger fails this because when you enable someone to publish their own posts they can also see the full edit-comments.php

    What am I and so many others doing wrong here?

  6. idahofallzcom
    Member
    Posted 7 years ago #

    here is proof, i double checked it now to prove to myself i'm not crazy (at least on this topic)

    for one thing, nobody has made it clear there are two versions of role manager. owen winkler wrote an older one that does not work with WP 2.0 versions. The German link above is the correct one.

    I uploaded the German coder's version, and created a new role with the only capability of reading. Logged into it, yep can only access dashboard and profile. Great.

    I added the capability "edit posts", note i did not add the capability "edit others posts". So I have "read" and "edit posts" as the only two capabilities. I double checked in both the role manager for this new role capabilities and in the specific test user/long for these two capabilities.

    Logged in under the test user, lo and behold I have access to write, manage, and COMMENTS!

    per http://codex.wordpress.org/Roles_and_Capabilities#edit_posts

    this capability is only supposed to allow ability to edit your own comments, not others.

    I quote:
    <i>
    Manage->Comments -- meaning: "show post"-link; "edit post"-, "edit comment"- and "delete comment"-links only on own posts since edit-comment.php (http://trac.wordpress.org/file/trunk/wp-admin/edit-comments.php) looks for "current_user_can('edit_post', $comment->comment_post_ID)"'
    </i>

    Perhaps the issue is this test user has no comments, and so it may not be able to show any and so errors by showing all? If so it's not working correctly, it should show a no comments, not everyone's.

    This test leads me to believe wordpress has an error in the core code that needs to be fixed in the next release.

    Please point out what I'm doing wrong and what an idiot I am, I beg you.

  7. Bory
    Member
    Posted 7 years ago #

    I'm having the same problem. I would like to add a couple of subscribers to my site, but do not want them to have access to the comments section of the admin panel. The problem seems to be that "edit_posts" bundles access to write and manage with comments in the admin panel.

    I have tried both role managers and neither one can break up the "edit_posts" capability. Surely there is a way to do this.

    And, from what I've read, edit_posts is supposed to only display the person's own comments. However this function seems broken and anyone with access to the comments can see everyone else's comments.

    Is there anyway short of having to edit code that I can resolve this problem? I'm losing a lot of traffic and a couple of valuable resources by having to hold back my contributors over this.

  8. le19555
    Member
    Posted 6 years ago #

    Dumb questions - why would anyone care if their email address and ip are visible? Stalkers? And...the comments are viewable as part of the site anyway. This seems to be a nit to me.

  9. cedmax
    Member
    Posted 6 years ago #

  10. Omegacool
    Member
    Posted 6 years ago #

    The plugin works well, it complies with its promises, you will not want to return to play the tab comments. The only bad thing is that it's ugly. Some changes must be made to self-worth not so ugly.

  11. shudubear
    Member
    Posted 6 years ago #

    To make it prettier you can change

    echo "<div class='wrap'><h2>Restricted area</h2></div>";
    include('admin-footer.php');
    die();

    to

    wp_die( __( 'Your level is not high enough to view comments.' ) );

    :)

  12. MrBrian
    Member
    Posted 6 years ago #

    From investigating, i can tell you theres no way at the moment to create a plugin to only show the comments of author posts and not allow them to see other comments, so i made some hacking instructions you can use (and i'm using on http://www.webunload.com). This hack will basically only show comments to a user that has permission to

      edit the post
    that the comment was made on. If you want to remove the IP address information, do it manually.

    This modifies a core file, so take note when upgrading.

    File to hack: wp-admin/edit-comments.php

    First part
    Search for this line:
    $class .= ('unapproved' == $comment_status) ? ' unapproved' : '';

    Put this on the next line:
    <?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?>

    Find this line:
    } // end foreach

    Put this on the next line:
    }

    For the second part..
    You actually don't need to edit another file. Instead of needing to edit template.php, you only need to edit the edit-comments.php further. Find this line:
    get_comment( $comment ); // Cache it

    And put the following on a new line after it:
    if ( current_user_can('edit_post', $comment->comment_post_ID) )

    There are two places you will need to put it.

Topic Closed

This topic has been closed to new replies.

About this Topic