Community Support Forums — WordPress® ( Users Helping Users ) — 2011-08-29T22:21:51-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14650 2011-08-29T22:21:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14650&p=33318#p33318 <![CDATA[Re: Create User capability gives rights to all s2Member opti]]>
Thanks

Statistics: Posted by highfive — August 29th, 2011, 10:21 pm


]]>
2011-08-27T14:52:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14650&p=33100#p33100 <![CDATA[Re: Create User capability gives rights to all s2Member opti]]>
Code:
    <?php
    add_action 
("init", "disable_s2_menu", 1);
    function disable_s2_menu ()
       {
          if (current_user_is ("contributor"))
             add_filter ("ws_plugin__s2member_during_add_admin_options_create_menu_items", "__return_false");
       }
    ?>

Statistics: Posted by Jason Caldwell — August 27th, 2011, 2:52 pm


]]>
2011-08-24T17:18:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14650&p=32807#p32807 <![CDATA[Re: Create User capability gives rights to all s2Member opti]]>
EDIT: nevermind.

EDIT2: nevermind again. It doesn't work. Once my role is defined to have create_users, the code in s2-hacks.php doesn't seem to do anything.

Statistics: Posted by highfive — August 24th, 2011, 5:18 pm


]]>
2011-08-23T21:44:14-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14650&p=32732#p32732 <![CDATA[Re: Create User capability gives rights to all s2Member opti]]>
If I were the one administering the site, it would be fine to just ignore the s2member fields during signup. This doesn't work so great for the end user admin for whom I have to keep everything as simple as possible and hide every and anything that they don't need to know about. The admin in charge of the blog doesn't know anything about s2member etc. Anyway, I'll see what I can do. I've just been going in after the fact and changing things they don't like with jQuery on the client side rather than mess with the source code.

Statistics: Posted by highfive — August 23rd, 2011, 9:44 pm


]]>
2011-08-23T20:08:04-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14650&p=32721#p32721 <![CDATA[Re: Create User capability gives rights to all s2Member opti]]> Thanks for the excellent questions.
highfive wrote:
I am creating a few custom roles for my blogs. I need someone who can add new users (Editors $ Contributors), but not have rights to mess with plugins, themes etc. It is basically and Editor+ user with a few extra capabilities.

As soon as I give this role the built in wordpress create_users capability, they suddenly have access to all of the s2member options. Ack! Certainly creating users is going to be tied somewhat to s2member, but that's a little over kill.

Also, another issue this is exposing is that I need to add users who aren't 's2Member' users. Just regular old Author's, etc. However, s2Member has hijacked the add user functionality and assumes every user I want to add is going to be an s2Member user.

Your first question about the create_users Capability. Yes, s2Member's administrative menu is designed to run based on this Capability that is normally associated with Administrators of the site. However, s2Member does make it possible to fine tune this behavior if you like. You can do this through the application of Filters for WordPress. For instance, if you don't want to show the s2Member menu panels to certain Roles, you might do something like this:

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code:
<?php
add_action ("init", "disable_s2_menu", 1);
function disable_s2_menu ()
   {
      if (current_user_is ("contributor"))
         add_filter ("ws_plugin__s2member_during_add_admin_options_create_menu_items", "__return_false");
   }
?>
* If you run a search against s2Member's source code for: ws_plugin__s2member_during_add_admin_options_create_menu_items, you will find that you can also Filter out only certain aspects of s2Member menu as well, using a similar approach ( i.e. there are other Filter Hooks available in the source code ).




Also, another issue this is exposing is that I need to add users who aren't 's2Member' users. Just regular old Author's, etc. However, s2Member has hijacked the add user functionality and assumes every user I want to add is going to be an s2Member user.
Hmm. Not sure what you mean by this. s2Member does add a section to the New User section of your Dashboard, but you can still choose whichever Role you prefer, including those that are part of the WordPress core. If they aren't going to be a Member, just leave all of the s2Member fields empty :-)

Statistics: Posted by Jason Caldwell — August 23rd, 2011, 8:08 pm


]]>
2011-08-22T23:52:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14650&p=32658#p32658 <![CDATA[Create User capability gives rights to all s2Member options]]>
As soon as I give this role the built in wordpress create_users capability, they suddenly have access to all of the s2member options. Ack! Certainly creating users is going to be tied somewhat to s2member, but that's a little over kill.

Also, another issue this is exposing is that I need to add users who aren't 's2Member' users. Just regular old Author's, etc. However, s2Member has hijacked the add user functionality and assumes every user I want to add is going to be an s2Member user.

Statistics: Posted by highfive — August 22nd, 2011, 11:52 pm


]]>