本文整理汇总了PHP中c_ws_plugin__s2member_utils_conds::bp_is_installed方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utils_conds::bp_is_installed方法的具体用法?PHP c_ws_plugin__s2member_utils_conds::bp_is_installed怎么用?PHP c_ws_plugin__s2member_utils_conds::bp_is_installed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类c_ws_plugin__s2member_utils_conds
的用法示例。
在下文中一共展示了c_ws_plugin__s2member_utils_conds::bp_is_installed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_register_url
/**
* Builds a BuddyPress registration URL to `/register`.
*
* @package s2Member\Utilities
* @since 111009
*
* @return str|bool Full URL to `/register`, if BuddyPress is installed; else false.
*/
public static function bp_register_url()
{
if (c_ws_plugin__s2member_utils_conds::bp_is_installed()) {
return home_url(function_exists('bp_get_signup_slug') ? bp_get_signup_slug() . '/' : BP_REGISTER_SLUG . '/');
}
return false;
}
示例2: bp_register_url
/**
* Builds a BuddyPress registration URL to `/register`.
*
* @package s2Member\Utilities
* @since 111009
*
* @return str|bool Full URL to `/register`, if BuddyPress is installed; else false.
*/
public static function bp_register_url()
{
if (c_ws_plugin__s2member_utils_conds::bp_is_installed()) {
return site_url(function_exists("bp_get_signup_slug") ? bp_get_signup_slug() . "/" : BP_REGISTER_SLUG . "/");
}
return false;
}
示例3: __construct
public function __construct()
{
echo '<div class="ws-menu-page-group" title="One-Time-Offers ( Upon Login )">' . "\n";
/**/
echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-one-time-offers-section">' . "\n";
echo '<h3>Optional One-Time-Offers ( Upon Login )</h3>' . "\n";
echo '<p>This is enabled by s2Member Pro. One-Time-Offers allow you to override your default Login Welcome Page, based on the number of times a User/Member has logged in previously. s2Member Pro gives you the ability to write your own configuration file for One-Time-Offers. Please follow the instructions below. It is also possible for advanced site owners to use these <a href="#" onclick="alert(\'Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s Username, lowercase.\\n%%current_user_id%% = The current User\\\'s ID.\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n%%current_user_role%% = The current User\\\'s WordPress® Role.' . (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '\\n%%current_user_ccaps%% = The current User\\\'s Custom Capabilities.' : '') . '\\n%%current_user_logins%% = Number of times the current User has logged in.\\n\\nFor example, if you\\\'re using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would use: ' . site_url("/members/%%current_user_login%%/profile/") . '\\n\\nOr, using %%current_user_level%%, you could have a separate One-Time-Offer page for each Membership Level that you plan to offer.\'); return false;">Replacement Codes</a> in their One-Time-Offer URLs.</p>' . "\n";
echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> s2Member integrates with BuddyPress. This configuration affects BuddyPress too.</em></p>' . "\n" : '';
/**/
echo '<table class="form-table">' . "\n";
echo '<tbody>' . "\n";
echo '<tr>' . "\n";
/**/
echo '<th>' . "\n";
echo '<label for="ws-plugin--s2member-pro-login-welcome-page-otos">' . "\n";
echo 'One-Time-Offer Configuration File:' . "\n";
echo '</label>' . "\n";
echo '</th>' . "\n";
/**/
echo '</tr>' . "\n";
echo '<tr>' . "\n";
/**/
echo '<td>' . "\n";
echo '<textarea name="ws_plugin__s2member_pro_login_welcome_page_otos" id="ws-plugin--s2member-pro-login-welcome-page-otos" rows="8" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_login_welcome_page_otos"]) . '</textarea><br />' . "\n";
echo 'This is a line-delimited list of URLs <em>( in a special format, as seen below )</em>.<br /><br />' . "\n";
echo 'Special format ( explained ):<br />' . "\n";
echo '<code>[Logins]</code>:<code>[Access Level]</code>:<code>[One-Time-Offer URL]</code><br /><br />' . "\n";
echo '<em><code>[Logins]</code> ( this triggers your One-Time-Offer page, upon X number of logins )</em><br />' . "\n";
echo '<em><code>[Access Level]</code> ( optional, this triggers your One-Time-Offer, based on Level# as well )</em><br />' . "\n";
echo '<em><code>[One-Time-Offer URL]</code> ( where User is redirected, upon login )</em><br /><br />' . "\n";
echo '<strong>Example Configuration File:</strong><br />' . "\n";
echo '<code>1:http://example.com/your-first-login/</code> <em>( displayed on 1st login, to all Users/Members )</em><br />' . "\n";
echo '<code>25:http://example.com/customer-loyalty-reward/</code> <em>( displayed on 25th login, to all Users/Members )</em><br />' . "\n";
echo '<code>3:1:http://example.com/upgrade-to-level-2/</code> <em>( displayed on 3rd login, to Level #1 Members only )</em><br />' . "\n";
echo '<code>1:0:http://example.com/upgrade-to-level-1/</code> <em>( displayed on 1st login, to Free Subscribers only )</em>' . "\n";
echo '</td>' . "\n";
/**/
echo '</tr>' . "\n";
echo '</tbody>' . "\n";
echo '</table>' . "\n";
echo '</div>' . "\n";
/**/
echo '</div>' . "\n";
}
示例4: lazy_load_css_js
/**
* Lazy load CSS/JS files?
*
* @package s2Member\CSS_JS
* @since 131028
*
* @return boolean TRUE if we should load; else FALSE.
*/
public static function lazy_load_css_js()
{
static $load;
// Static cache var.
if (isset($load)) {
return $load;
}
$null = NULL;
// Needed below in earlier versions of WP.
if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['lazy_load_css_js']) {
$load = TRUE;
} else {
if (c_ws_plugin__s2member_systematics::is_s2_systematic_use_page()) {
$load = TRUE;
} else {
if (!empty($_GET[apply_filters('ws_plugin__s2member_check_force_ssl_get_var_name', 's2-ssl', array())])) {
$load = TRUE;
} else {
if (c_ws_plugin__s2member_utils_conds::bp_is_installed() && (bp_is_register_page() || bp_is_activation_page() || bp_is_user_profile())) {
$load = TRUE;
} else {
if (is_singular() && ($post = get_post($null)) && (stripos($post->post_content, 's2member') !== FALSE || stripos($post->post_content, '[s2') !== FALSE)) {
$load = TRUE;
} else {
if (preg_match('/\\/wp\\-signup\\.php|\\/wp\\-login\\.php|\\/wp\\-admin\\/(?:user\\/)?profile\\.php|[?&]s2member/', $_SERVER['REQUEST_URI'])) {
$load = TRUE;
}
}
}
}
}
}
if (!isset($load)) {
$load = FALSE;
}
// Make sure it's set; always.
return $load = apply_filters('ws_plugin__s2member_lazy_load_css_js', $load);
}
示例5: lazy_load_css_js
/**
* Lazy load CSS/JS files?
*
* @package s2Member\CSS_JS
* @since 131028
*
* @return boolean TRUE if we should load; else FALSE.
*/
public static function lazy_load_css_js()
{
static $load;
// Static cache var.
if (isset($load)) {
return $load;
}
if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["lazy_load_css_js"]) {
$load = TRUE;
} else {
if (c_ws_plugin__s2member_systematics::is_s2_systematic_use_page()) {
$load = TRUE;
} else {
if (!empty($_GET[apply_filters("ws_plugin__s2member_check_force_ssl_get_var_name", "s2-ssl", array())])) {
$load = TRUE;
} else {
if (c_ws_plugin__s2member_utils_conds::bp_is_installed() && (bp_is_register_page() || bp_is_activation_page() || bp_is_user_profile())) {
$load = TRUE;
} else {
if (is_singular() && ($post = get_post(NULL)) && (stripos($post->post_content, "s2member") !== FALSE || stripos($post->post_content, "[s2") !== FALSE)) {
$load = TRUE;
} else {
if (preg_match("/\\/wp\\-signup\\.php" . "|\\/wp\\-login\\.php" . "|\\/wp\\-admin\\/(?:user\\/)?profile\\.php" . "|[?&]s2member/", $_SERVER["REQUEST_URI"])) {
$load = TRUE;
}
}
}
}
}
}
if (!isset($load)) {
$load = FALSE;
}
// Make sure it's set; always.
return $load = apply_filters("ws_plugin__s2member_lazy_load_css_js", $load);
}
示例6: __construct
public function __construct()
{
echo '<div class="wrap ws-menu-page">' . "\n";
echo '<div class="ws-menu-page-toolbox">' . "\n";
c_ws_plugin__s2member_menu_pages_tb::display();
echo '</div>' . "\n";
echo '<h2>Quick-Start Guide</h2>' . "\n";
echo '<table class="ws-menu-page-table">' . "\n";
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
echo '<tr class="ws-menu-page-table-tr">' . "\n";
echo '<td class="ws-menu-page-table-l">' . "\n";
do_action("ws_plugin__s2member_during_start_page_before_left_sections", get_defined_vars());
if (apply_filters("ws_plugin__s2member_during_start_page_during_left_sections_display_video_tutorials", true, get_defined_vars())) {
do_action("ws_plugin__s2member_during_start_page_during_left_sections_before_video_tutorials", get_defined_vars());
echo '<div class="ws-menu-page-group" title="Video Tutorials" style="padding-top:5px;">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-process-section">' . "\n";
echo '<p><iframe src="//www.youtube.com/embed/videoseries?list=PL8gPolqFnYqtBVz0nVeN2sJgRVednq0jw" width="100%" height="550" frameborder="0" allowfullscreen></iframe></p>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_during_video_tutorials", get_defined_vars());
echo '</div>' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-process-section">' . "\n";
echo '<p><iframe src="//www.youtube.com/embed/videoseries?list=PLA40AFC154461862E" width="100%" height="550" frameborder="0" allowfullscreen></iframe></p>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_during_video_tutorials", get_defined_vars());
echo '</div>' . "\n";
echo '</div>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_after_video_tutorials", get_defined_vars());
}
if (apply_filters("ws_plugin__s2member_during_start_page_during_left_sections_display_registration_process", true, get_defined_vars())) {
do_action("ws_plugin__s2member_during_start_page_during_left_sections_before_registration_process", get_defined_vars());
echo '<div class="ws-menu-page-group" title="The Registration Process">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-process-section">' . "\n";
echo '<h3>The Subscription Signup/Registration Process</h3>' . "\n";
echo '<p>1. Internet Users will go to your Membership Options Page <em>(which you\'ll need to configure on the s2Member General Options panel)</em>. On this Membership Options Page (that you create in WordPress), you\'ll insert the PayPal Subscription Buttons that were generated for you by s2Member.</p>' . "\n";
echo '<p>2. An Internet User will click on a PayPal Subscription Button from your Membership Options Page. They will be transferred over to PayPal in order to agree to your Membership terms and pricing. You can customize the Checkout Page Style, Pricing, Payment Periods, and more - whenever you generate your PayPal Buttons through s2Member.</p>' . "\n";
echo '<p>3. Once a User has completed the Subscription Signup Process at PayPal, they\'ll be returned to your site, where they\'ll be activated by s2Member instantly, and given the opportunity to register a Username & Password for their Membership. <em>(Note: they\'ll be allowed to register a Username & Password, even if you\'ve set \'Anyone Can Register\' to `Off` in your General WordPress options; because s2Member identifies the User as having paid for Membership access through PayPal)</em>.</p>' . "\n";
echo '<p>s2Member will also send the User an email with instructions on how to register their Username & Password, just in case they missed the instructions after checkout. That email will be sent to their PayPal email address. Much of this is handled through the PayPal IPN service behind-the-scene, where PayPal and s2Member communicate with each other.</p>' . "\n";
echo '<p>4. Once a User has completed checkout and registered a Username & Password, they\'ll be able to log in. The first page they\'ll see after logging in, will be your Login Welcome Page <em>(which you\'ll need to configure on the s2Member General Options panel)</em>. Your Login Welcome Page can contain whatever you like. You\'ll need to design this Page in WordPress.</p>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_during_registration_process", get_defined_vars());
echo '</div>' . "\n";
echo '</div>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_after_registration_process", get_defined_vars());
}
if (apply_filters("ws_plugin__s2member_during_start_page_during_left_sections_display_log_reg_form", true, get_defined_vars())) {
do_action("ws_plugin__s2member_during_start_page_during_left_sections_before_log_reg_form", get_defined_vars());
echo '<div class="ws-menu-page-group" title="Your Login/Registration Form">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-login-reg-form-section">' . "\n";
echo '<h3>Your Login/Registration Form (already built-in)</h3>' . "\n";
echo '<p>s2Member uses the existing WordPress Login/Registration system. This is the same Login/Registration Form that you use to access your WP Dashboard. However, with s2Member installed, your Login/Registration Forms can be customized <em>(i.e. re-branded)</em>. <em>See: <code>s2Member -› General Options -› Login/Registration Design</code>.</em> You can make the default Login/Registration Forms match your WordPress theme design; by changing the background color/image, your logo image, add Custom Fields, and more<em>!</em></p>' . "\n";
echo '<p>Since s2Member uses the default Login/Registration system for WordPress, s2Member is also compatible with themes and other plugins <em>(such as BuddyPress)</em>. If your theme has a login form built-in already, chances are, it\'s perfectly compatible with s2Member. There are also many plugins available that are designed to place login forms into your Sidebar; and many of those are also compatible with s2Member\'s integration. If you have any trouble, please check the <a href="' . esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Forum URI")) . '" target="_blank" rel="external">s2Member Forums</a> for assistance.</p>' . "\n";
echo is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() || c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<div class="ws-menu-page-hr"></div>' . "\n" : '';
echo is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() ? '<p><em>The Main Site of a Multisite Blog Farm uses a different Registration Form. See: <code>s2Member -› General Options -› Registration/Profile Fields</code>.</em></p>' . "\n" : '';
echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> BuddyPress will use its own Registration Form. See: <code>s2Member -› General Options -› Registration/Profile Fields</code>.</em></p>' . "\n" : '';
do_action("ws_plugin__s2member_during_start_page_during_left_sections_during_log_reg_form", get_defined_vars());
echo '</div>' . "\n";
echo '</div>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_after_log_reg_form", get_defined_vars());
}
if (apply_filters("ws_plugin__s2member_during_start_page_during_left_sections_display_login_welcome_page", true, get_defined_vars())) {
do_action("ws_plugin__s2member_during_start_page_during_left_sections_before_login_welcome_page", get_defined_vars());
echo '<div class="ws-menu-page-group" title="Your Login Welcome Page">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-login-welcome-page-section">' . "\n";
echo '<h3>Your Login Welcome Page (you create this in WordPress)</h3>' . "\n";
echo '<p>You create this special Page in WordPress. This is a "Page" not a Post. This is the first page Members will see after logging into your site.</p>' . "\n";
echo '<p>You should go ahead and create an empty Page now, before you start configuring everything. Title it: <code>My Login Welcome Page</code>, and click Publish.</p>' . "\n";
echo '<p>Once you have all of your <code>s2Member -› General Options</code> configured, and once you have a basic understanding of how s2Member works, go back and customize the title and content for this Page. You\'ll want to be creative with your Login Welcome Page. However, you should configure your <code>s2Member -› General Options</code> first, and test things out. That way you\'ll understand why this Page is important.</p>' . "\n";
echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/customizing-your-lwp/" target="_blank" rel="external">Customizing Your Login Welcome Page</a>.</p>' . "\n" : '';
do_action("ws_plugin__s2member_during_start_page_during_left_sections_during_login_welcome_page", get_defined_vars());
echo '</div>' . "\n";
echo '</div>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_after_login_welcome_page", get_defined_vars());
}
if (apply_filters("ws_plugin__s2member_during_start_page_during_left_sections_display_membership_options_page", true, get_defined_vars())) {
do_action("ws_plugin__s2member_during_start_page_during_left_sections_before_membership_options_page", get_defined_vars());
echo '<div class="ws-menu-page-group" title="Your Membership Options Page">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-membership-options-page-section">' . "\n";
echo '<h3>Your Membership Options Page (you create this in WordPress)</h3>' . "\n";
echo '<p>You create this special Page in WordPress. This is a "Page" not a Post. s2Member comes with a PayPal Button Generator. You will generate PayPal Buttons with s2Member, for each Membership Level that you plan to offer. Those buttons will be inserted into your Membership Options Page. If a User in the general public attempts to access an area of your site that is being protected by s2Member <em>(based on your configuration)</em>, s2Member will redirect the User to your Membership Options Page, where they can signup through PayPal and become a Member.</p>' . "\n";
echo '<p>You should go ahead and create an empty Page now, before you start configuring everything. Title it: <code>My Membership Options Page</code>, and click Publish.</p>' . "\n";
echo '<p>Once you have all of your <code>s2Member -› General Options</code> configured, and once you have a basic understanding of how s2Member works, go back and customize the title and content for this Page. You\'ll want to be creative with your Membership Options Page. However, you should configure your <code>s2Member -› General Options</code> first, and test things out. That way you\'ll understand why this Page is important.</p>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_during_membership_options_page", get_defined_vars());
echo '</div>' . "\n";
echo '</div>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_after_membership_options_page", get_defined_vars());
}
if (apply_filters("ws_plugin__s2member_during_start_page_during_left_sections_display_general_options", true, get_defined_vars())) {
do_action("ws_plugin__s2member_during_start_page_during_left_sections_before_general_options", get_defined_vars());
echo '<div class="ws-menu-page-group" title="Your s2Member -› General Options">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-general-options-section">' . "\n";
echo '<h3>Your s2Member -› General Options (Basic Configuration)</h3>' . "\n";
echo '<p>Once you have a Login Welcome Page, and a Membership Options Page. Go to: <code>s2Member -› General Options</code>.</p>' . "\n";
echo '<p>From your s2Member General Options Panel you can setup the basics of your Membership offering. Including the design of your Login/Registration Form, any Custom Registration/Profile Fields you\'d like to create, Labels for each Membership Level, Open Registration (on/off), a Profile Editing Panel for Members, and more.</p>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_during_general_options", get_defined_vars());
echo '</div>' . "\n";
echo '</div>' . "\n";
do_action("ws_plugin__s2member_during_start_page_during_left_sections_after_general_options", get_defined_vars());
}
if (apply_filters("ws_plugin__s2member_during_start_page_during_left_sections_display_restriction_options", true, get_defined_vars())) {
do_action("ws_plugin__s2member_during_start_page_during_left_sections_before_restriction_options", get_defined_vars());
echo '<div class="ws-menu-page-group" title="Your s2Member -› Restriction Options">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-restriction-options-section">' . "\n";
echo '<h3>Your s2Member -› Restriction Options (Basic Configuration)</h3>' . "\n";
//.........这里部分代码省略.........
示例7: check_mms_register_access
/**
* Allows access to the main Multisite Registration Form.
*
* @package s2Member\Option_Forces
* @since 3.5
*
* @attaches-to ``add_filter("pre_site_option_registration");``
*
* @param string $users_can_register Expects *( `none`, `all`, `blog`, `user` )*, passed through by the Filter.
* @return string 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;
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);
$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() && !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()) {
// Blog Farm?
return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "none", get_defined_vars());
} else {
if (!is_network_admin() && $users_can_register !== "all") {
if (is_main_site() && current_user_can("create_users") || is_super_admin()) {
return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "all", get_defined_vars());
} else {
if (is_user_logged_in() && is_object($user = wp_get_current_user()) && $user->ID && is_object($user = new WP_User($user->ID, $current_site->blog_id)) && $user->ID && $user->has_cap("access_s2member_level1")) {
$mms_options = c_ws_plugin__s2member_utilities::mms_options();
$blogs_allowed = (int) @$mms_options["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) {
return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "all", get_defined_vars());
}
} else {
if (!is_user_logged_in() && is_main_site() && ($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
if (preg_match($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_w_level_regex"], $item_number, $m) && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . $m[1]])) {
return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "all", get_defined_vars());
} else {
return apply_filters("ws_plugin__s2member_check_mms_register_access", $users_can_register = "user", get_defined_vars());
}
}
}
}
} else {
if (!is_network_admin() && $users_can_register === "all") {
if (is_user_logged_in() && !(is_main_site() && current_user_can("create_users")) && !is_super_admin() && is_object($user = wp_get_current_user()) && $user->ID && is_object($user = new WP_User($user->ID, $current_site->blog_id)) && $user->ID) {
$mms_options = c_ws_plugin__s2member_utilities::mms_options();
$blogs_allowed = (int) @$mms_options["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) {
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());
}
示例8: is_systematic_use_page
/**
* Determines if the current page is Systematic in any way.
*
* @package s2Member\Systematics
* @since 3.5
*
* @return bool True if Systematic, else false.
*
* @note The results of this function are cached staticially.
* Do NOT call upon this until the `wp` Hook is fired.
*/
public static function is_systematic_use_page()
{
static $is_systematic;
/* For optimization. */
/**/
if (isset($is_systematic)) {
return $is_systematic;
/* Filters will have already been applied here. */
} else {
if (c_ws_plugin__s2member_systematics::is_s2_systematic_use_page()) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars());
} else {
if (c_ws_plugin__s2member_systematics::is_wp_systematic_use_page()) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars());
} else {
if (c_ws_plugin__s2member_utils_conds::bp_is_installed() && (bp_is_register_page() || bp_is_activation_page())) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars());
} else {
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && is_page($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"])) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars());
} else {
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && is_page($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars());
} else {
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && is_page($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars());
} else {
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($_lro = c_ws_plugin__s2member_login_redirects::login_redirection_uri(false, "root-returns-false")) && preg_match("/^" . preg_quote($_lro, "/") . "\$/", $_SERVER["REQUEST_URI"])) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars());
} else {
/* Otherwise, we return false ( it's NOT a Systematic Use Page in any way ). */
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_page", false, get_defined_vars());
}
}
}
}
}
}
}
}
}
示例9: __construct
//.........这里部分代码省略.........
echo '</tr>' . "\n";
echo '<tr>' . "\n";
echo '<td>' . "\n";
echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_reg_email_support_link" id="ws-plugin--s2member-reg-email-support-link" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_support_link"]) . '" /><br />' . "\n";
echo 'Ex: <code>mailto:support@your-domain.com</code> (<em>mailto link</em>).<br />' . "\n";
echo 'Or: <code>' . esc_html(site_url("/contact-us/")) . '</code>.' . "\n";
echo '</td>' . "\n";
echo '</tr>' . "\n";
echo '</tbody>' . "\n";
echo '</table>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<h3 style="margin:0;">New User Email Configuration</h3>' . "\n";
echo '<input type="hidden" id="ws-plugin--s2member-pluggables-wp-new-user-notification" value="' . esc_attr(empty($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["pluggables"]["wp_new_user_notification"]) ? '0' : '1') . '" />' . "\n";
echo empty($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["pluggables"]["wp_new_user_notification"]) ? '<p class="ws-menu-page-error" style="margin:0;"><em><strong>Conflict warning:</strong> You have another theme or plugin installed that is preventing s2Member from controlling this aspect of your installation. When the pluggable function <code><a href="http://codex.wordpress.org/Function_Reference/wp_new_user_notification" target="_blank" rel="external">wp_new_user_notification()</a></code> is handled by another plugin, it\'s not possible for s2Member to allow customization of New User Emails. This is NOT a major issue. In fact, in some cases, it might be desirable. That being said, if you DO want to use s2Member\'s customization of New User Emails, you will need to deactivate one plugin at a time until this conflict warning goes away.</em></p>' . "\n" : '';
do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_new_user_emails", get_defined_vars());
echo '<table class="form-table">' . "\n";
echo '<tbody>' . "\n";
echo '<tr>' . "\n";
echo '<td>' . "\n";
echo '<select name="ws_plugin__s2member_new_user_emails_enabled" id="ws-plugin--s2member-new-user-emails-enabled">' . "\n";
echo '<option value="0"' . (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_emails_enabled"] ? ' selected="selected"' : '') . '>No (default, use WordPress defaults)</option>' . "\n";
echo '<option value="1"' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_emails_enabled"] ? ' selected="selected"' : '') . '>Yes (customize New User Emails with s2Member)</option>' . "\n";
echo '</select>' . "\n";
echo '</td>' . "\n";
echo '</tr>' . "\n";
echo '</tbody>' . "\n";
echo '</table>' . "\n";
echo '<div id="ws-plugin--s2member-new-user-emails">' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<h3 style="margin:0;">New User Email Message (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-new-user-email-details\').toggle(); return false;" class="ws-dotted-link">click to customize</a>)</h3>' . "\n";
echo '<p style="margin:0;">This email is sent to all new Users/Members. It should always contain their Username/Password. In addition to this email, s2Member will also send new paying Customers a Signup Confirmation Email, which you can customize from your Dashboard, under: <code>s2Member -› PayPal Options</code>. You may wish to customize these emails further, by providing details that are specifically geared to your site.</p>' . "\n";
do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_new_user_email", get_defined_vars());
echo '<div id="ws-plugin--s2member-new-user-email-details" style="display:none;">' . "\n";
echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> please note that BuddyPress does NOT send this email to Users that register through the BuddyPress registration system. This is because BuddyPress sends each User an activation link; eliminating the need for this email all together. However, you CAN still customize s2Member\'s separate email to paying Members. See: <code>s2Member -› PayPal Options -› Signup Confirmation Email</code>.</em></p>' . "\n" : '';
echo '<table class="form-table">' . "\n";
echo '<tbody>' . "\n";
echo '<tr>' . "\n";
echo '<th>' . "\n";
echo '<label for="ws-plugin--s2member-new-user-email-subject">' . "\n";
echo 'New User Email Subject:' . "\n";
echo '</label>' . "\n";
echo '</th>' . "\n";
echo '</tr>' . "\n";
echo '<tr>' . "\n";
echo '<td>' . "\n";
echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_new_user_email_subject" id="ws-plugin--s2member-new-user-email-subject" value="' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_subject"]) . '" /><br />' . "\n";
echo 'Subject Line used in the email sent to new Users/Members.' . "\n";
echo '</td>' . "\n";
echo '</tr>' . "\n";
echo '<tr>' . "\n";
echo '<th>' . "\n";
echo '<label for="ws-plugin--s2member-new-user-email-message">' . "\n";
echo 'New User Email Message:' . "\n";
echo '</label>' . "\n";
echo '</th>' . "\n";
echo '</tr>' . "\n";
echo '<tr>' . "\n";
echo '<td>' . "\n";
echo '<textarea name="ws_plugin__s2member_new_user_email_message" id="ws-plugin--s2member-new-user-email-message" rows="10">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]) . '</textarea><br />' . "\n";
echo 'Message Body used in the email sent to new Users/Members.<br /><br />' . "\n";
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
echo '<ul>' . "\n";
echo '<li><code>%%role%%</code> = The Role ID <code>(subscriber, s2member_level[0-9]+, administrator, editor, author, contributor)</code>.</li>' . "\n";
echo '<li><code>%%label%%</code> = The Role ID Label <code>(Subscriber, s2Member Level 1, s2Member Level 2; or your own custom Labels — if configured)</code>.</li>' . "\n";
echo '<li><code>%%level%%</code> = The Level number <code>(0, 1, 2, 3, 4)</code>. (<em>deprecated, no longer recommended; use <code>%%role%%</code></em>)</li>' . "\n";
echo '<li><code>%%ccaps%%</code> = Custom Capabilities. Ex: <code>music,videos,free_gift</code> (<em>in comma-delimited format</em>).</li>' . "\n";
示例10: translation_mangler
/**
* Handles internal translations via `gettext` Filter.
*
* Important note. Because this routine also uses translation functionality by WordPress,
* anything translated by this routine MUST be different, otherwise it will result in a recursive loop,
* because the ``__()`` family of functions would be called upon recursively by this routine.
*
* If you're translating s2Member into a different language, your MO file for s2Member will automagically deal with
* everything you see below. No worries. Just build your translation file for s2Member, and you're all set.
*
* @package s2Member\Translations
* @since 3.5
*
* @attaches-to ``add_filter("gettext");``
*
* @param string $translated Expects already-translated string passed in by Filter.
* @param string $original Expects original text string passed in by Filter.
* @param string $domain Expects translation domain passed in by Filter.
*
* @return string Translated string, possibly modified by this routine.
*/
public static function translation_mangler($translated = '', $original = '', $domain = '')
{
global $current_site, $current_blog;
// In support of Multisite Networking.
static $s = array();
// This static array optimizes all of these routines.
if (isset($s["is_wp_login"]) && $s["is_wp_login"] || !isset($s["is_wp_login"]) && ($s["is_wp_login"] = strpos($_SERVER["REQUEST_URI"], "/wp-login.php") !== FALSE && empty($_REQUEST["action"]) && empty($_REQUEST["checkemail"]) ? TRUE : FALSE)) {
if ($original === "Username") {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x("Username:", "s2member-front", "s2member"), get_defined_vars());
} else {
if ($original === "Password") {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x("My Password:", "s2member-front", "s2member"), get_defined_vars());
}
}
} else {
if (isset($s["is_wp_login_register"]) && $s["is_wp_login_register"] || !isset($s["is_wp_login_register"]) && ($s["is_wp_login_register"] = strpos($_SERVER["REQUEST_URI"], "/wp-login.php") !== FALSE && !empty($_REQUEST["action"]) && $_REQUEST["action"] === "register" ? TRUE : FALSE)) {
if ($original === "Username") {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x("Username *", "s2member-front", "s2member"), get_defined_vars());
} else {
if ($original === "Password") {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x("Password *", "s2member-front", "s2member"), get_defined_vars());
} else {
if ($original === "E-mail") {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x("Email Address *", "s2member-front", "s2member"), get_defined_vars());
}
}
}
} else {
if (isset($s["is_wp_login_checkemail"]) && $s["is_wp_login_checkemail"] || !isset($s["is_wp_login_checkemail"]) && ($s["is_wp_login_checkemail"] = strpos($_SERVER["REQUEST_URI"], "/wp-login.php") !== FALSE && empty($_REQUEST["action"]) && !empty($_REQUEST["checkemail"]) && $_REQUEST["checkemail"] === "registered" ? TRUE : FALSE)) {
if ($original === "Registration complete. Please check your e-mail." && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"]) {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x("Registration complete. Please log in.", "s2member-front", "s2member"), get_defined_vars());
}
} else {
if (isset($s["is_user_new"]) && $s["is_user_new"] || !isset($s["is_user_new"]) && ($s["is_user_new"] = strpos($_SERVER["REQUEST_URI"], "/wp-admin/user-new.php") !== FALSE ? TRUE : FALSE)) {
if ($original === "Hi,\n\nYou have been invited to join '%s' at\n%s as a %s.\nPlease click the following link to confirm the invite:\n%s\n" && !empty($_REQUEST["role"]) && preg_match("/^(subscriber|s2member_level[0-9]+)\$/", $_REQUEST["role"])) {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x("You have been invited to join `%1\$s` at\n%2\$s as a Member.\nPlease click the following link to confirm the invite:\n%4\$s\n", "s2member-front", "s2member"), get_defined_vars());
}
} else {
if (isset($s["is_wp_activate"]) && $s["is_wp_activate"] || !isset($s["is_wp_activate"]) && ($s["is_wp_activate"] = strpos($_SERVER["REQUEST_URI"], "/wp-activate.php") !== FALSE ? TRUE : FALSE)) {
if ($original === 'Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>') {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x('Your account is now active. <a href="%1$s">Visit site</a> or <a href="%2$s">Log in</a>.', "s2member-front", "s2member"), get_defined_vars());
}
} else {
if (isset($s["is_wp_signup"]) && $s["is_wp_signup"] || !isset($s["is_wp_signup"]) && ($s["is_wp_signup"] = strpos($_SERVER["REQUEST_URI"], "/wp-signup.php") !== FALSE ? TRUE : FALSE)) {
if ($original === "If you’re not going to use a great site domain, leave it for a new user. Now have at it!") {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", "", get_defined_vars());
} else {
if ($original === "Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart’s content, but write responsibly!") {
if (is_user_logged_in() && !(is_main_site() && current_user_can("create_users")) && !is_super_admin() && is_object($user = wp_get_current_user()) && $user->ID && is_object($user = new WP_User($user->ID, $current_site->blog_id)) && $user->ID) {
$mms_options = c_ws_plugin__s2member_utilities::mms_options();
$blogs_allowed = (int) @$mms_options["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;
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x('By filling out the form below, you can <strong>add a site to your account</strong>.', "s2member-front", "s2member") . ($blogs_allowed > 1 ? '<br />' . sprintf(_nx('You may create <strong>%s</strong> site.', 'You may create up to <strong>%s</strong> sites.', $blogs_allowed, "s2member-front", "s2member"), $blogs_allowed) : ''), get_defined_vars());
}
}
}
} else {
if (isset($s["is_bp_blog_creation"]) && $s["is_bp_blog_creation"] || !isset($s["is_bp_blog_creation"]) && ($s["is_bp_blog_creation"] = c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_create_blog() ? TRUE : FALSE)) {
if ($original === "If you’re not going to use a great domain, leave it for a new user. Now have at it!") {
$translated = apply_filters("ws_plugin__s2member_translation_mangler", "", get_defined_vars());
} else {
if ($original === "By filling out the form below, you can <strong>add a site to your account</strong>. There is no limit to the number of sites that you can have, so create to your heart's content, but blog responsibly!") {
if (is_user_logged_in() && !(is_main_site() && current_user_can("create_users")) && !is_super_admin() && is_object($user = wp_get_current_user()) && $user->ID && is_object($user = new WP_User($user->ID, $current_site->blog_id)) && $user->ID) {
$mms_options = c_ws_plugin__s2member_utilities::mms_options();
$blogs_allowed = (int) @$mms_options["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;
$translated = apply_filters("ws_plugin__s2member_translation_mangler", _x('By filling out the form below, you can <strong>add a site to your account</strong>.', "s2member-front", "s2member") . ($blogs_allowed > 1 ? '<br />' . sprintf(_nx('You may create up to <strong>%s</strong> site.', 'You may create up to <strong>%s</strong> sites.', $blogs_allowed, "s2member-front", "s2member"), $blogs_allowed) : ''), get_defined_vars());
}
}
}
}
}
}
//.........这里部分代码省略.........
示例11: configure_user_registration
/**
* Configures all new Users.
*
* The Hook `user_register` is also fired by calling:
* ``c_ws_plugin__s2member_registrations::ms_create_existing_user()`` and/or ``wpmu_create_user()``.
*
* This function also receives hand-offs from s2Member's handlers for these two Hooks:
* `wpmu_activate_user` and `wpmu_activate_blog`.
*
* @package s2Member\Registrations
* @since 3.5
*
* @attaches-to ``add_action("user_register");``
*
* @param int|str $user_id A numeric WordPress User ID.
* @param str $password Optional in most cases. A User's plain text Password. If unspecified, attempts are made to collect the plain text Password from other sources.
* @param array $meta Optional in most cases. Defaults to false. An array of meta data for a User/Member.
* @return null No return value. Returns `null` in possible every scenario.
*
* @todo Impossible to delete cookies when fired inside: `/wp-activate.php`?
*/
public static function configure_user_registration($user_id = FALSE, $password = FALSE, $meta = FALSE)
{
global $wpdb;
global $pagenow;
// We need this to detect the current administration page.
global $current_site, $current_blog;
// Adds support for Multisite Networking.
static $email_config, $processed;
// Static vars prevent duplicate processing.
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_configure_user_registration", get_defined_vars());
unset($__refs, $__v);
// With Multisite Networking, we need this to run on `user_register` ahead of `wpmu_activate_[user|blog]`.
if (!isset($email_config) && ($email_config = true)) {
// Anytime this routine is fired; we configure email.
c_ws_plugin__s2member_email_configs::email_config();
}
// Configures `From:` email header.
$_p = isset($_POST) ? $_POST : null;
$rvs = isset($GLOBALS["ws_plugin__s2member_registration_vars"]) ? $GLOBALS["ws_plugin__s2member_registration_vars"] : null;
if (!$processed) {
if (is_array($_p) || is_array($meta) || is_array($rvs)) {
if (!(is_multisite() && is_blog_admin() && $pagenow === "user-new.php" && isset($_p["noconfirmation"]) && is_super_admin() && !is_array($meta))) {
if (!(preg_match("/\\/wp-activate\\.php/", $_SERVER["REQUEST_URI"]) && !is_array($meta))) {
if (!(c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_activation_page() && !is_array($meta))) {
if (!(c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op("create_user") && !is_array($rvs))) {
if ($user_id && is_object($user = new WP_User($user_id)) && !empty($user->ID) && ($user_id = $user->ID) && ($processed = true)) {
settype($_p, "array") . settype($meta, "array") . settype($rvs, "array");
$_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_p));
$meta = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($meta));
$rvs = c_ws_plugin__s2member_utils_strings::trim_deep($rvs);
foreach ($_p as $_key => $_value) {
// Scan ``$_p`` vars; adding `custom_reg_field` keys.
if (preg_match("/^ws_plugin__s2member_user_new_/", $_key)) {
// Look for keys.
if ($_key = str_replace("_user_new_", "_custom_reg_field_", $_key)) {
$_p[$_key] = $_value;
}
}
}
// Add each of these key conversions.
unset($_key, $_value);
if (!is_admin() && (isset($_p["ws_plugin__s2member_custom_reg_field_s2member_subscr_gateway"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_subscr_id"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_custom"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_ccaps"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time"]) || isset($_p["ws_plugin__s2member_custom_reg_field_s2member_notes"]))) {
exit(_x("s2Member security violation. You attempted to POST administrative variables that will NOT be trusted in a NON-administrative zone!", "s2member-front", "s2member"));
}
$_pmr = array_merge($_p, $meta, $rvs);
// Merge all of these arrays together now, in this specific order.
unset($_p, $meta, $rvs);
// These variables can all be unset now; we have them all in the ``$_pmr`` array.
$custom_reg_display_name = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"];
// Can be configured by the site owner.
if (!is_admin() && (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !c_ws_plugin__s2member_pro_remote_ops::is_remote_op("create_user")) && ($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
/* This routine could be processed through `/wp-login.php?action=register`, `/wp-activate.php`, or `/activate` via BuddyPress`.
This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
If processed through `/wp-activate.php`, it could've originated inside the admin — via `/user-new.php`. */
$processed = "yes";
// Mark this as yes.
$current_role = c_ws_plugin__s2member_user_access::user_access_role($user);
@(list($level, $ccaps, $eotper) = preg_split("/\\:/", $item_number, 3));
$role = "s2member_level" . $level;
// Membership Level.
$email = $user->user_email;
$login = $user->user_login;
$ip = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_registration_ip"];
$ip = !$ip ? $_SERVER["REMOTE_ADDR"] : $ip;
// Else use environment variable.
$cv = preg_split("/\\|/", $custom);
if (!($auto_eot_time = "") && $eotper) {
// If a specific EOT Period is included.
$auto_eot_time = c_ws_plugin__s2member_utils_time::auto_eot_time("", "", "", $eotper);
}
$notes = (string) @$_pmr["ws_plugin__s2member_custom_reg_field_s2member_notes"];
$opt_in = !$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] ? true : false;
$opt_in = !$opt_in && !empty($_pmr["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : $opt_in;
if (!($fname = $user->first_name)) {
if (!empty($_pmr["ws_plugin__s2member_custom_reg_field_first_name"])) {
$fname = (string) $_pmr["ws_plugin__s2member_custom_reg_field_first_name"];
//.........这里部分代码省略.........
示例12: configure_user_registration
/**
* Configures all new Users.
*
* The Hook `user_register` is also fired by calling:
* ``c_ws_plugin__s2member_registrations::ms_create_existing_user()`` and/or ``wpmu_create_user()``.
*
* This function also receives hand-offs from s2Member's handlers for these two Hooks:
* `wpmu_activate_user` and `wpmu_activate_blog`.
*
* @package s2Member\Registrations
* @since 3.5
*
* @attaches-to ``add_action('user_register');``
*
* @param int|string $user_id A numeric WordPress User ID.
* @param string $password Optional in most cases. A User's plain text Password. If unspecified, attempts are made to collect the plain text Password from other sources.
* @param array $meta Optional in most cases. Defaults to false. An array of meta data for a User/Member.
*
* @TODO Impossible to delete cookies when fired inside: `/wp-activate.php`?
*/
public static function configure_user_registration($user_id = '', $password = '', $meta = array())
{
global $wpdb;
// Global database object reference.
global $pagenow;
// We need this to detect the current administration page.
global $current_site, $current_blog;
// Adds support for Multisite Networking.
static $email_config, $processed;
// Static vars prevent duplicate processing.
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_before_configure_user_registration', get_defined_vars());
unset($__refs, $__v);
// Housekeeping.
// With Multisite Networking, we need this to run on `user_register` ahead of `wpmu_activate_[user|blog]`.
if (!isset($email_config) && ($email_config = TRUE)) {
// Anytime this routine is fired; we configure email.
c_ws_plugin__s2member_email_configs::email_config();
}
// Configures `From:` email header.
$_p = isset($_POST) ? $_POST : NULL;
// Grab global ``$_POST`` array here, if it's possible to do so.
$rvs = isset($GLOBALS['ws_plugin__s2member_registration_vars']) ? $GLOBALS['ws_plugin__s2member_registration_vars'] : NULL;
if (!$processed) {
if (is_array($_p) || is_array($meta) || is_array($rvs)) {
if (!(is_multisite() && is_blog_admin() && $pagenow === 'user-new.php' && isset($_p['noconfirmation']) && is_super_admin() && !is_array($meta))) {
if (!(preg_match('/\\/wp-activate\\.php/', $_SERVER['REQUEST_URI']) && !is_array($meta))) {
if (!(c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_activation_page() && !is_array($meta))) {
if (!(c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op('create_user') && !is_array($rvs))) {
if ($user_id && is_object($user = new WP_User($user_id)) && !empty($user->ID) && ($user_id = $user->ID) && ($processed = TRUE)) {
settype($_p, 'array') . settype($meta, 'array') . settype($rvs, 'array');
// Force arrays here.
$_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_p));
$meta = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($meta));
$rvs = c_ws_plugin__s2member_utils_strings::trim_deep($rvs);
foreach ($_p as $_key => $_value) {
// Scan ``$_p`` vars; adding `custom_reg_field` keys.
if (preg_match('/^ws_plugin__s2member_user_new_/', $_key)) {
// Look for keys.
if ($_key = str_replace('_user_new_', '_custom_reg_field_', $_key)) {
$_p[$_key] = $_value;
}
}
}
// Add each of these key conversions.
unset($_key, $_value);
if (!is_admin() && (isset($_p['ws_plugin__s2member_custom_reg_field_s2member_subscr_gateway']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_subscr_id']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_subscr_baid']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_subscr_cid']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_custom']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_ccaps']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time']) || isset($_p['ws_plugin__s2member_custom_reg_field_s2member_notes']))) {
exit(_x('s2Member security violation. You attempted to POST administrative variables that will NOT be trusted in a NON-administrative zone!', 's2member-front', 's2member'));
}
$_pmr = array_merge($_p, $meta, $rvs);
// Merge all of these arrays together now, in this specific order.
unset($_p, $meta, $rvs);
// These variables can all be unset now; we have them all in the ``$_pmr`` array.
$custom_reg_display_name = $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_display_name'];
// Can be configured by the site owner.
if (!is_admin() && (!c_ws_plugin__s2member_utils_conds::pro_is_installed() || !c_ws_plugin__s2member_pro_remote_ops::is_remote_op('create_user')) && ($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
/* This routine could be processed through `/wp-login.php?action=register`, `/wp-activate.php`, or `/activate` via BuddyPress`.
This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
If processed through `/wp-activate.php`, it could've originated inside the admin—via `/user-new.php`. */
/**
* @var $subscr_gateway string Reference for IDEs.
* @var $subscr_id string Reference for IDEs.
* @var $custom string Reference for IDEs.
* @var $item_number string Reference for IDEs.
*/
$processed = 'yes';
// Mark this as yes.
$current_role = c_ws_plugin__s2member_user_access::user_access_role($user);
@(list($level, $ccaps, $eotper) = preg_split('/\\:/', $item_number, 3));
$role = 's2member_level' . $level;
// Membership Level.
$email = $user->user_email;
$login = $user->user_login;
$ip = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_registration_ip'];
$ip = !$ip ? $_SERVER['REMOTE_ADDR'] : $ip;
// Else use environment variable.
$subscr_baid = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_baid'];
$subscr_cid = (string) @$_pmr['ws_plugin__s2member_custom_reg_field_s2member_subscr_cid'];
//.........这里部分代码省略.........
示例13: is_systematic_use_specific_page
/**
* Determines if a specific Post/Page ID, or URI, is Systematic in any way.
*
* @package s2Member\Systematics
* @since 3.5
*
* @param int|string $singular_id Optional. A numeric Post/Page ID in WordPress.
* @param string $uri Optional. A request URI to test against.
*
* @return bool True if Systematic, else false.
*
* @todo Test URIs against formulated links for Systematic Pages like the Membership Options Page?
* Don't think this is required though; as it's already handled in other areas, correct?
*/
public static function is_systematic_use_specific_page($singular_id = '', $uri = '')
{
global $bp;
// If BuddyPress is installed, we'll need this global reference.
$ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
$singular_id = $singular_id && is_numeric($singular_id) ? (int) $singular_id : FALSE;
// Force types.
$uri = $uri && is_string($uri) && ($uri = c_ws_plugin__s2member_utils_urls::parse_uri($uri)) ? $uri : FALSE;
if (c_ws_plugin__s2member_systematics_sp::is_s2_systematic_use_specific_page($singular_id, $uri)) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
}
if (c_ws_plugin__s2member_systematics_sp::is_wp_systematic_use_specific_page($singular_id, $uri)) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
}
if ($uri && c_ws_plugin__s2member_utils_conds::bp_is_installed() && preg_match('/\\/(?:' . preg_quote(trim(function_exists('bp_get_signup_slug') ? bp_get_signup_slug() : BP_REGISTER_SLUG, '/'), '/') . '|' . preg_quote(trim(function_exists('bp_get_activate_slug') ? bp_get_activate_slug() : BP_ACTIVATION_SLUG, '/'), '/') . ')(?:\\/|\\?|$)/' . $ci, $uri)) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
}
if ($singular_id && c_ws_plugin__s2member_utils_conds::bp_is_installed() && (!empty($bp->pages->register->id) && $singular_id === (int) $bp->pages->register->id || !empty($bp->pages->activate->id) && $singular_id === (int) $bp->pages->activate->id)) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
}
if ($singular_id && $GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page'] && $singular_id === (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page']) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
}
if ($singular_id && $GLOBALS['WS_PLUGIN__']['s2member']['o']['membership_options_page'] && $singular_id === (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['membership_options_page']) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
}
if ($singular_id && $GLOBALS['WS_PLUGIN__']['s2member']['o']['file_download_limit_exceeded_page'] && $singular_id === (int) $GLOBALS['WS_PLUGIN__']['s2member']['o']['file_download_limit_exceeded_page']) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
}
if ($uri && $GLOBALS['WS_PLUGIN__']['s2member']['o']['login_redirection_override'] && ($_lro = c_ws_plugin__s2member_login_redirects::login_redirection_uri(NULL, 'root-returns-false')) && preg_match('/^' . preg_quote($_lro, '/') . '$/' . $ci, $uri)) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', TRUE, get_defined_vars());
}
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_specific_page', FALSE, get_defined_vars());
}
示例14: is_systematic_use_page
/**
* Determines if the current page is Systematic in any way.
*
* @package s2Member\Systematics
* @since 3.5
*
* @return bool True if Systematic, else false.
*
* @note The results of this function are cached staticially.
* Do NOT call upon this until the `wp` Hook is fired.
*/
public static function is_systematic_use_page()
{
static $is_systematic;
// For optimization.
if (isset($is_systematic)) {
// Already cached statically? Saves time.
return $is_systematic;
}
// Filters will have already been applied here.
$ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
if (c_ws_plugin__s2member_systematics::is_s2_systematic_use_page()) {
// An s2Member Systematic Use Page?
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', TRUE, get_defined_vars());
}
if (c_ws_plugin__s2member_systematics::is_wp_systematic_use_page()) {
//* A WordPress Systematic Use Page?
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', TRUE, get_defined_vars());
}
if (c_ws_plugin__s2member_utils_conds::bp_is_installed() && (bp_is_register_page() || bp_is_activation_page())) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', TRUE, get_defined_vars());
}
if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page'] && is_page($GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page'])) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', TRUE, get_defined_vars());
}
if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['membership_options_page'] && is_page($GLOBALS['WS_PLUGIN__']['s2member']['o']['membership_options_page'])) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', TRUE, get_defined_vars());
}
if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['file_download_limit_exceeded_page'] && is_page($GLOBALS['WS_PLUGIN__']['s2member']['o']['file_download_limit_exceeded_page'])) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', TRUE, get_defined_vars());
}
if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['login_redirection_override'] && ($_lro = c_ws_plugin__s2member_login_redirects::login_redirection_uri(NULL, 'root-returns-false')) && preg_match('/^' . preg_quote($_lro, '/') . '$/' . $ci, $_SERVER['REQUEST_URI'])) {
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', TRUE, get_defined_vars());
}
return $is_systematic = apply_filters('ws_plugin__s2member_is_systematic_use_page', FALSE, get_defined_vars());
}
示例15: is_systematic_use_specific_page
/**
* Determines if a specific Post/Page ID, or URI, is Systematic in any way.
*
* @package s2Member\Systematics
* @since 3.5
*
* @param int|string $singular_id Optional. A numeric Post/Page ID in WordPress.
* @param string $uri Optional. A request URI to test against.
* @return bool True if Systematic, else false.
*
* @todo Test URIs against formulated links for Systematic Pages like the Membership Options Page?
* Don't think this is required though; as it's already handled in other areas, correct?
*/
public static function is_systematic_use_specific_page($singular_id = FALSE, $uri = FALSE)
{
global $bp;
// If BuddyPress is installed, we'll need this global reference.
$singular_id = $singular_id && is_numeric($singular_id) ? (int) $singular_id : false;
// Force types.
$uri = $uri && is_string($uri) && ($uri = c_ws_plugin__s2member_utils_urls::parse_uri($uri)) ? $uri : false;
if (c_ws_plugin__s2member_systematics_sp::is_s2_systematic_use_specific_page($singular_id, $uri)) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
} else {
if (c_ws_plugin__s2member_systematics_sp::is_wp_systematic_use_specific_page($singular_id, $uri)) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
} else {
if ($uri && c_ws_plugin__s2member_utils_conds::bp_is_installed() && preg_match("/\\/(?:" . preg_quote(trim(function_exists("bp_get_signup_slug") ? bp_get_signup_slug() : BP_REGISTER_SLUG, "/"), "/") . "|" . preg_quote(trim(function_exists("bp_get_activate_slug") ? bp_get_activate_slug() : BP_ACTIVATION_SLUG, "/"), "/") . ")(?:\\/|\\?|\$)/", $uri)) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
} else {
if ($singular_id && c_ws_plugin__s2member_utils_conds::bp_is_installed() && (!empty($bp->pages->register->id) && $singular_id === (int) $bp->pages->register->id || !empty($bp->pages->activate->id) && $singular_id === (int) $bp->pages->activate->id)) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
} else {
if ($singular_id && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $singular_id === (int) $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
} else {
if ($singular_id && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && $singular_id === (int) $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
} else {
if ($singular_id && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && $singular_id === (int) $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
} else {
if ($uri && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($_lro = c_ws_plugin__s2member_login_redirects::login_redirection_uri(false, "root-returns-false")) && preg_match("/^" . preg_quote($_lro, "/") . "\$/", $uri)) {
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", true, get_defined_vars());
} else {
// Otherwise, we return false (i.e. it's NOT a Systematic Use Page in any way).
return $is_systematic = apply_filters("ws_plugin__s2member_is_systematic_use_specific_page", false, get_defined_vars());
}
}
}
}
}
}
}
}
}