Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-20T09:49:41-05:00 http://www.primothemes.com/forums/feed.php?f=40&t=13032 2011-12-20T09:49:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=57742#p57742 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: December 20, 2011, 9:49 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 20th, 2011, 9:49 am


]]>
2011-12-07T01:02:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=55424#p55424 <![CDATA[s2Member v111206 / Source Code: s2member\i...]]>
s2Member v111206
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: December 7, 2011, 1:02 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 7th, 2011, 1:02 am


]]>
2011-11-05T19:25:49-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=51798#p51798 <![CDATA[s2Member v111105 / Source Code: s2member\i...]]>
s2Member v111105
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: November 5, 2011, 8:25 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — November 5th, 2011, 7:25 pm


]]>
2011-10-29T20:34:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=49893#p49893 <![CDATA[s2Member v111029 / Source Code: s2member\i...]]>
s2Member v111029
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: October 29, 2011, 9:34 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 29th, 2011, 8:34 pm


]]>
2011-10-17T15:38:47-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=47687#p47687 <![CDATA[s2Member v111017 / Source Code: s2member\i...]]>
s2Member v111017
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: October 17, 2011, 1:38 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 17th, 2011, 3:38 pm


]]>
2011-10-11T14:34:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=46087#p46087 <![CDATA[s2Member v111011 / Source Code: s2member\i...]]>
s2Member v111011
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: October 11, 2011, 12:34 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 11th, 2011, 2:34 pm


]]>
2011-10-03T15:47:04-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=44218#p44218 <![CDATA[s2Member v111003 / Source Code: s2member\i...]]>
s2Member v111003
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: October 3, 2011, 1:47 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:47 pm


]]>
2011-10-03T03:40:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=42925#p42925 <![CDATA[s2Member v111002 / Source Code: s2member\i...]]>
s2Member v111002
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: October 3, 2011, 1:40 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:40 am


]]>
2011-09-27T05:25:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=41171#p41171 <![CDATA[s2Member v110927 / Source Code: s2member\i...]]>
s2Member v110927
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: September 27, 2011, 3:25 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 27th, 2011, 5:25 am


]]>
2011-09-26T21:02:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=39927#p39927 <![CDATA[s2Member v110926 / Source Code: s2member\i...]]>
s2Member v110926
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: September 26, 2011, 7:03 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 26th, 2011, 9:02 pm


]]>
2011-09-17T16:19:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=38071#p38071 <![CDATA[s2Member v110915 / Source Code: s2member\i...]]>
s2Member v110915
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: September 17, 2011, 2:19 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 17th, 2011, 4:19 pm


]]>
2011-09-14T01:27:29-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=36652#p36652 <![CDATA[s2Member v110913 / Source Code: s2member\i...]]>
s2Member v110913
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: September 13, 2011, 11:27 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 14th, 2011, 1:27 am


]]>
2011-09-13T12:02:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=35380#p35380 <![CDATA[s2Member v110912 / Source Code: s2member\i...]]>
s2Member v110912
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: September 13, 2011, 10:02 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 13th, 2011, 12:02 pm


]]>
2011-08-15T14:12:13-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=31487#p31487 <![CDATA[s2Member v110815 / Source Code: s2member\i...]]>
s2Member v110815
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: August 15, 2011, 3:12 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member\includes\classes\option-forces.inc.php ?php /** * Forces WordPress® options. * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * Released under the terms of the GNU General Public License. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * @package s2Member\Option_Forces * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_option_forces" ) ) { /** * Forces WordPress® options. * * @package s2Member\Option_Forces * @since 3.5 */ class c_ws_plugin__s2member_option_forces { /** * Forces a default Role for new registrations, NOT tied to an incoming payment. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_option_default_role");`` * * @param str $default_role Expects a default Role to be passed by the Filter. * @return str Default Role, as configured by s2Member. */ public static function force_default_role ( $default_role = FALSE ) { do_action ( "ws_plugin__s2member_before_force_default_role" , get_defined_vars ( ) ) ; /**/ return apply_filters ( "ws_plugin__s2member_force_default_role" , ( $default_role = "subscriber" ) , get_defined_vars ( ) ) ; } /** * Forces a default Role for new Multisite registrations ( on the Main Site ) NOT tied to an incoming payment. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_site_option_default_user_role");`` * * @param str $default_role Expects a default Role to be passed by the Filter. * @return str Default Role, as configured by s2Member. */ public static function force_mms_default_role ( $default_role = FALSE ) { do_action ( "ws_plugin__s2member_before_force_mms_default_role" , get_defined_vars ( ) ) ; /**/ return apply_filters ( "ws_plugin__s2member_force_mms_default_role" , ( $default_role = "subscriber" ) , get_defined_vars ( ) ) ; } /** * Forces a specific Role to demote to, whenever a Member is demoted in one way or another. * * Use by the PayPal® IPN routines, and also by the Auto-EOT system. * * @package s2Member\Option_Forces * @since 3.5 * * @param str $demotion_role Expects a demotion Role to be passed by the caller. * @return str Demotion Role, as configured by s2Member. */ public static function force_demotion_role ( $demotion_role = FALSE ) { do_action ( "ws_plugin__s2member_before_force_demotion_role" , get_defined_vars ( ) ) ; /**/ return apply_filters ( "ws_plugin__s2member_force_demotion_role" , ( $demotion_role = "subscriber" ) , get_defined_vars ( ) ) ; } /** * Allows new Users to be created on a Multisite Network. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_site_option_add_new_users");`` * * @param int|str $allow Numeric string (`1`) or (`0`), expected by the Filter. * @return str Numeric (`1`) or (`0`) indicating true or false. Forces to (`1`) true. */ public static function mms_allow_new_users ( $allow = FALSE ) { do_action ( "ws_plugin__s2member_before_mms_allow_new_users" , get_defined_vars ( ) ) ; /**/ return apply_filters ( "ws_plugin__s2member_mms_allow_new_users" , ( $allow = "1" ) , get_defined_vars ( ) ) ; } /** * Forces a Multisite Dashboard Blog to be the Main Site. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_site_option_dashboard_blog");`` * * @param int|str $dashboard_blog Numeric Dashboard Blog ID passed through by the Filter. * @return int|str Numeric Dashboard Blog ID, as configured by s2Member. Forces to the Main Site. */ public static function mms_dashboard_blog ( $dashboard_blog = FALSE ) { global $current_site , $current_blog ; /* For Multisite support. */ /**/ do_action ( "ws_plugin__s2member_before_mms_dashboard_blog" , get_defined_vars ( ) ) ; /**/ $main_site = ( ( is_multisite ( ) ) ? $current_site - blog_id : "1" ) ; /* Forces the Main Site. */ /**/ return apply_filters ( "ws_plugin__s2member_mms_dashboard_blog" , ( $dashboard_blog = $main_site ) , get_defined_vars ( ) ) ; } /** * Allows access to the Registration Form. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_option_users_can_register");`` * * @param int|str $users_can_register Numeric (`1`) or (`0`), indicating true or false; passed through by the Filter. * @return str Numeric value of (`1`) or (`0`), indicating true or false; depending on several factors. */ public static function check_register_access ( $users_can_register = FALSE ) { global $wpdb ; /* Global database object reference */ /**/ eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_check_register_access" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $by_default = $users_can_register = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "allow_subscribers_in" ] ; /**/ if ( is_multisite ( ) && c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) && is_main_site ( ) ) return apply_filters ( "ws_plugin__s2member_check_register_access" , ( $users_can_register = "0" ) , get_defined_vars ( ) ) ; /**/ else if ( ! is_admin ( ) && ! $users_can_register ) /* Do NOT run these security checks on option pages; it's confusing to a site owner. */ if ( ! is_multisite ( ) || !c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) || ! is_main_site ( ) || is_super_admin ( ) || current_user_can ( "create_users" ) ) { if ( ( is_multisite ( ) && is_super_admin ( ) ) || current_user_can ( "create_users" ) || c_ws_plugin__s2member_register_access:: reg_cookies_ok ( ) ) { return apply_filters ( "ws_plugin__s2member_check_register_access" , ( $users_can_register = "1" ) , get_defined_vars ( ) ) ; } } /**/ return apply_filters ( "ws_plugin__s2member_check_register_access" , $users_can_register , get_defined_vars ( ) ) ; } /** * Allows access to the main Multisite Registration Form. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_site_option_registration");`` * * @param str $users_can_register Expects *( `none`, `all`, or `user` )*, passed through by the Filter. * @return str One of `none|all|user`; depending on several factors. */ public static function check_mms_register_access ( $users_can_register = FALSE ) { global $wpdb ; /* Global database object reference */ global $current_site , $current_blog ; /* For Multisite support. */ /**/ eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_check_register_access" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $by_default = $users_can_register = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_registration_grants" ] ; /**/ if (c_ws_plugin__s2member_utils_conds:: bp_is_installed ( ) && is_multisite ( ) && /* BP Multisite / but NOT offering Blogs? */ !c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) ) return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = ( (c_ws_plugin__s2member_option_forces:: check_register_access ( ) ) ? "user" : "none" ) ) , get_defined_vars ( ) ) ; /**/ else if ( ! is_multisite ( ) || !c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) || ! is_main_site ( ) ) /* Blog Farm? */ return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "none" ) , get_defined_vars ( ) ) ; /**/ else if ( ! is_admin ( ) && $users_can_register !== "all" ) /* Do NOT run these checks on option pages; it's confusing to a site owner. */ { if ( is_super_admin ( ) || current_user_can ( "create_users" ) || ( ( $reg_cookies = c_ws_plugin__s2member_register_access:: reg_cookies_ok ( ) ) && extract ( $reg_cookies ) ) ) { if ( is_super_admin ( ) || current_user_can ( "create_users" ) ) /* Either a Super Administrator, or an Administrator that can create. */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "all" ) , get_defined_vars ( ) ) ; } else if ( ! empty ( $reg_cookies ) && preg_match ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "c" ] [ "membership_item_number_w_level_regex" ] , $item_number , $m ) && ! empty ( $m [ 1 ] ) && is_numeric ( $level = $m [ 1 ] ) ) { if ( ! empty ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_registration_blogs_level" . $level ] ) ) /* Blog(s)? */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "all" ) , get_defined_vars ( ) ) ; } else /* Otherwise, we MUST allow them to at least create an account; they paid for it! Defaults to `user`. */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "user" ) , get_defined_vars ( ) ) ; } } } /* -------------------- $users_can_register !== "all", so exclude Level #0. */ else if ( is_user_logged_in ( ) && current_user_can ( "access_s2member_level1" ) && is_object ( $user = wp_get_current_user ( ) ) && $user - ID ) { $blogs_allowed = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_registration_blogs_level" . c_ws_plugin__s2member_user_access:: user_access_level ( $user ) ] ; $user_blogs = ( is_array ( $blogs = get_blogs_of_user ( $user - ID ) ) ) ? count ( $blogs ) - 1 : 0 ; /**/ $user_blogs = ( $user_blogs = 0 ) ? $user_blogs : 0 ; /* NOT less than zero. */ $blogs_allowed = ( $blogs_allowed = 0 ) ? $blogs_allowed : 0 ; /**/ if ( $user_blogs $blogs_allowed ) /* Are they within their limit? */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "all" ) , get_defined_vars ( ) ) ; } } } /**/ else if ( ! is_admin ( ) && $users_can_register === "all" ) /* Do NOT run these security checks on option pages; it's confusing to a site owner. */ { if ( is_user_logged_in ( ) && is_object ( $user = wp_get_current_user ( ) ) && $user - ID ) { $blogs_allowed = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_registration_blogs_level" . c_ws_plugin__s2member_user_access:: user_access_level ( ) ] ; $user_blogs = ( is_array ( $blogs = get_blogs_of_user ( $user - ID ) ) ) ? count ( $blogs ) - 1 : 0 ; /**/ $user_blogs = ( $user_blogs = 0 ) ? $user_blogs : 0 ; /* NOT less than zero. */ $blogs_allowed = ( $blogs_allowed = 0 ) ? $blogs_allowed : 0 ; /**/ if ( $user_blogs = $blogs_allowed ) /* Are they at their limit? */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "none" ) , get_defined_vars ( ) ) ; } } } /**/ return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , $users_can_register , get_defined_vars ( ) ) ; } /** * Register access in BuddyPress, for Multisite compatibility. * * BuddyPress bypasses the default Filter `pre_site_option_registration`, and instead uses: ``bp_core_get_site_options()``. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("bp_core_get_site_options");`` * * @param array $site_options Expects array of BuddyPress site options. * @return array Site options array, after having been Filtered by this routine. */ public static function check_bp_mms_register_access ( $site_options = FALSE ) { if ( is_multisite ( ) ) /* Only if Multisite Networking is enabled. Pointless otherwise. */ $site_options [ "registration" ] = c_ws_plugin__s2member_option_forces:: check_mms_register_access ( $site_options [ "registration" ] ) ; /**/ return apply_filters ( "ws_plugin__s2member_check_bp_mms_register_access" , $site_options , get_defined_vars ( ) ) ; } } } ? [ full view ]s2member\includes\classes\option-forces.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — August 15th, 2011, 2:12 pm


]]>
2011-07-11T17:28:43-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=27695#p27695 <![CDATA[s2Member v110710 / Source Code: s2member\i...]]>
s2Member v110710
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: July 11, 2011, 6:28 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member\includes\classes\option-forces.inc.php ?php /** * Forces WordPress® options. * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * Released under the terms of the GNU General Public License. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * @package s2Member\Option_Forces * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_option_forces" ) ) { /** * Forces WordPress® options. * * @package s2Member\Option_Forces * @since 3.5 */ class c_ws_plugin__s2member_option_forces { /** * Forces a default Role for new registrations, NOT tied to an incoming payment. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_option_default_role");`` * * @param str $default_role Expects a default Role to be passed by the Filter. * @return str Default Role, as configured by s2Member. */ public static function force_default_role ( $default_role = FALSE ) { do_action ( "ws_plugin__s2member_before_force_default_role" , get_defined_vars ( ) ) ; /**/ return apply_filters ( "ws_plugin__s2member_force_default_role" , ( $default_role = "subscriber" ) , get_defined_vars ( ) ) ; } /** * Forces a default Role for new Multisite registrations ( on the Main Site ) NOT tied to an incoming payment. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_site_option_default_user_role");`` * * @param str $default_role Expects a default Role to be passed by the Filter. * @return str Default Role, as configured by s2Member. */ public static function force_mms_default_role ( $default_role = FALSE ) { do_action ( "ws_plugin__s2member_before_force_mms_default_role" , get_defined_vars ( ) ) ; /**/ return apply_filters ( "ws_plugin__s2member_force_mms_default_role" , ( $default_role = "subscriber" ) , get_defined_vars ( ) ) ; } /** * Forces a specific Role to demote to, whenever a Member is demoted in one way or another. * * Use by the PayPal® IPN routines, and also by the Auto-EOT system. * * @package s2Member\Option_Forces * @since 3.5 * * @param str $demotion_role Expects a demotion Role to be passed by the caller. * @return str Demotion Role, as configured by s2Member. */ public static function force_demotion_role ( $demotion_role = FALSE ) { do_action ( "ws_plugin__s2member_before_force_demotion_role" , get_defined_vars ( ) ) ; /**/ return apply_filters ( "ws_plugin__s2member_force_demotion_role" , ( $demotion_role = "subscriber" ) , get_defined_vars ( ) ) ; } /** * Allows new Users to be created on a Multisite Network. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_site_option_add_new_users");`` * * @param int|str $allow Numeric string (`1`) or (`0`), expected by the Filter. * @return str Numeric (`1`) or (`0`) indicating true or false. Forces to (`1`) true. */ public static function mms_allow_new_users ( $allow = FALSE ) { do_action ( "ws_plugin__s2member_before_mms_allow_new_users" , get_defined_vars ( ) ) ; /**/ return apply_filters ( "ws_plugin__s2member_mms_allow_new_users" , ( $allow = "1" ) , get_defined_vars ( ) ) ; } /** * Forces a Multisite Dashboard Blog to be the Main Site. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_site_option_dashboard_blog");`` * * @param int|str $dashboard_blog Numeric Dashboard Blog ID passed through by the Filter. * @return int|str Numeric Dashboard Blog ID, as configured by s2Member. Forces to the Main Site. */ public static function mms_dashboard_blog ( $dashboard_blog = FALSE ) { global $current_site , $current_blog ; /* For Multisite support. */ /**/ do_action ( "ws_plugin__s2member_before_mms_dashboard_blog" , get_defined_vars ( ) ) ; /**/ $main_site = ( ( is_multisite ( ) ) ? $current_site - blog_id : "1" ) ; /* Forces the Main Site. */ /**/ return apply_filters ( "ws_plugin__s2member_mms_dashboard_blog" , ( $dashboard_blog = $main_site ) , get_defined_vars ( ) ) ; } /** * Allows access to the Registration Form. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_option_users_can_register");`` * * @param int|str $users_can_register Numeric (`1`) or (`0`), indicating true or false; passed through by the Filter. * @return str Numeric value of (`1`) or (`0`), indicating true or false; depending on several factors. */ public static function check_register_access ( $users_can_register = FALSE ) { global $wpdb ; /* Global database object reference */ /**/ eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_check_register_access" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $by_default = $users_can_register = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "allow_subscribers_in" ] ; /**/ if ( is_multisite ( ) && c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) && is_main_site ( ) ) return apply_filters ( "ws_plugin__s2member_check_register_access" , ( $users_can_register = "0" ) , get_defined_vars ( ) ) ; /**/ else if ( ! is_admin ( ) && ! $users_can_register ) /* Do NOT run these security checks on option pages; it's confusing to a site owner. */ if ( ! is_multisite ( ) || !c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) || ! is_main_site ( ) || is_super_admin ( ) || current_user_can ( "create_users" ) ) { if ( ( is_multisite ( ) && is_super_admin ( ) ) || current_user_can ( "create_users" ) || c_ws_plugin__s2member_register_access:: reg_cookies_ok ( ) ) { return apply_filters ( "ws_plugin__s2member_check_register_access" , ( $users_can_register = "1" ) , get_defined_vars ( ) ) ; } } /**/ return apply_filters ( "ws_plugin__s2member_check_register_access" , $users_can_register , get_defined_vars ( ) ) ; } /** * Allows access to the main Multisite Registration Form. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("pre_site_option_registration");`` * * @param str $users_can_register Expects *( `none`, `all`, or `user` )*, passed through by the Filter. * @return str One of `none|all|user`; depending on several factors. */ public static function check_mms_register_access ( $users_can_register = FALSE ) { global $wpdb ; /* Global database object reference */ global $current_site , $current_blog ; /* For Multisite support. */ /**/ eval ( 'foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;' ) ; do_action ( "ws_plugin__s2member_before_check_register_access" , get_defined_vars ( ) ) ; unset ( $__refs , $__v ) ; /* Unset defined __refs, __v. */ /**/ $by_default = $users_can_register = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_registration_grants" ] ; /**/ if ( defined ( "BP_VERSION" ) && is_multisite ( ) && /* BP Multisite / but NOT offering Blogs? */ !c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) ) return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = ( (c_ws_plugin__s2member_option_forces:: check_register_access ( ) ) ? "user" : "none" ) ) , get_defined_vars ( ) ) ; /**/ else if ( ! is_multisite ( ) || !c_ws_plugin__s2member_utils_conds:: is_multisite_farm ( ) || ! is_main_site ( ) ) /* Blog Farm? */ return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "none" ) , get_defined_vars ( ) ) ; /**/ else if ( ! is_admin ( ) && $users_can_register !== "all" ) /* Do NOT run these checks on option pages; it's confusing to a site owner. */ { if ( is_super_admin ( ) || current_user_can ( "create_users" ) || ( ( $reg_cookies = c_ws_plugin__s2member_register_access:: reg_cookies_ok ( ) ) && extract ( $reg_cookies ) ) ) { if ( is_super_admin ( ) || current_user_can ( "create_users" ) ) /* Either a Super Administrator, or an Administrator that can create. */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "all" ) , get_defined_vars ( ) ) ; } else if ( ! empty ( $reg_cookies ) && preg_match ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "c" ] [ "membership_item_number_regex" ] , $item_number , $m ) && ! empty ( $m [ 1 ] ) && is_numeric ( $level = $m [ 1 ] ) ) { if ( ! empty ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_registration_blogs_level" . $level ] ) ) /* Blog(s)? */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "all" ) , get_defined_vars ( ) ) ; } else /* Otherwise, we MUST allow them to at least create an account; they paid for it! Defaults to `user`. */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "user" ) , get_defined_vars ( ) ) ; } } } /* -------------------- $users_can_register !== "all", so exclude Level #0. */ else if ( is_user_logged_in ( ) && current_user_can ( "access_s2member_level1" ) && is_object ( $user = wp_get_current_user ( ) ) && $user - ID ) { $blogs_allowed = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_registration_blogs_level" . c_ws_plugin__s2member_user_access:: user_access_level ( $user ) ] ; $user_blogs = ( is_array ( $blogs = get_blogs_of_user ( $user - ID ) ) ) ? count ( $blogs ) - 1 : 0 ; /**/ $user_blogs = ( $user_blogs = 0 ) ? $user_blogs : 0 ; /* NOT less than zero. */ $blogs_allowed = ( $blogs_allowed = 0 ) ? $blogs_allowed : 0 ; /**/ if ( $user_blogs $blogs_allowed ) /* Are they within their limit? */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "all" ) , get_defined_vars ( ) ) ; } } } /**/ else if ( ! is_admin ( ) && $users_can_register === "all" ) /* Do NOT run these security checks on option pages; it's confusing to a site owner. */ { if ( is_user_logged_in ( ) && is_object ( $user = wp_get_current_user ( ) ) && $user - ID ) { $blogs_allowed = $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "mms_registration_blogs_level" . c_ws_plugin__s2member_user_access:: user_access_level ( ) ] ; $user_blogs = ( is_array ( $blogs = get_blogs_of_user ( $user - ID ) ) ) ? count ( $blogs ) - 1 : 0 ; /**/ $user_blogs = ( $user_blogs = 0 ) ? $user_blogs : 0 ; /* NOT less than zero. */ $blogs_allowed = ( $blogs_allowed = 0 ) ? $blogs_allowed : 0 ; /**/ if ( $user_blogs = $blogs_allowed ) /* Are they at their limit? */ { return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , ( $users_can_register = "none" ) , get_defined_vars ( ) ) ; } } } /**/ return apply_filters ( "ws_plugin__s2member_check_mms_register_access" , $users_can_register , get_defined_vars ( ) ) ; } /** * Register access in BuddyPress, for Multisite compatibility. * * BuddyPress bypasses the default Filter `pre_site_option_registration`, and instead uses: ``bp_core_get_site_options()``. * * @package s2Member\Option_Forces * @since 3.5 * * @attaches-to: ``add_filter("bp_core_get_site_options");`` * * @param array $site_options Expects array of BuddyPress site options. * @return array Site options array, after having been Filtered by this routine. */ public static function check_bp_mms_register_access ( $site_options = FALSE ) { if ( is_multisite ( ) ) /* Only if Multisite Networking is enabled. Pointless otherwise. */ $site_options [ "registration" ] = c_ws_plugin__s2member_option_forces:: check_mms_register_access ( $site_options [ "registration" ] ) ; /**/ return apply_filters ( "ws_plugin__s2member_check_bp_mms_register_access" , $site_options , get_defined_vars ( ) ) ; } } } ? [ full view ]s2member\includes\classes\option-forces.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — July 11th, 2011, 5:28 pm


]]>
2011-07-09T06:08:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13032&p=25327#p25327 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\option-forces.inc.php
Docs updated: December 20, 2011, 9:49 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — July 9th, 2011, 6:08 am


]]>