Community Support Forums — WordPress® ( Users Helping Users ) — 2011-05-18T01:29:38-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=6451 2011-05-18T01:29:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6451&p=15255#p15255 <![CDATA[Re: Allow membership and ccaps by email domain]]> Thanks for a great suggestion.

I'm not sure if we'll be able to address that specific need as a formal feature ( but we'll try ). We DO have plans to improve Custom Capabilities ( work is in progress now, could be another release or two away though ).

In the mean time, you could do something like this.
Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code:
<?php
add_action 
("init", "custom_capabilities_by_domain", 1);
function custom_capabilities_by_domain ()
    {
        if (is_user_logged_in () && current_user_can ("access_s2member_level1") && ($user = wp_get_current_user ()))
            {
                if (stripos ($user->user_email, "@company-a.com") !== false)
                    $user->add_cap ("access_s2member_ccap_company_a");
            }
    }
?>
* This code is untested, but should work fine.

Statistics: Posted by Jason Caldwell — May 18th, 2011, 1:29 am


]]>
2011-05-16T13:09:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6451&p=15106#p15106 <![CDATA[Re: Allow membership and ccaps by email domain]]>
I'll forward your suggestion to Jason (the Lead Developer of s2Member) to consider it, and maybe suggest how it could be done in the current s2Member. :)

Statistics: Posted by Cristián Lávaque — May 16th, 2011, 1:09 pm


]]>
2011-05-16T12:56:08-05:00 http://www.primothemes.com/forums/viewtopic.php?t=6451&p=15103#p15103 <![CDATA[Allow membership and ccaps by email domain]]>
So for example: We sell levels of membership to companies and universities - and give their employees individual access to the custom capabilities that they've paid for. So, we often receive emails about new employees or ones who don't yet have access to the site, and we have to go in and tweak all their settings. But they all have the same email address (firstname.lastname@company.com) - so it would save a lot of steps if s2member could recognize @company.com and just grant the appropriate access.

Any ideas? Thanks.

Liz

Statistics: Posted by earthliz — May 16th, 2011, 12:56 pm


]]>