s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) - Version 3.1

Version Description

  • Upgrade recommended. Fixes a redirection loop on some configurations. Also adds several new features; listed below.
Download this release

Release Info

Developer PriMoThemes
Plugin Icon 128x128 s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members)
Version 3.1
Comparing to
See all releases

Code changes from version 3.0.9 to 3.1

includes/dropins/bridges/_s2member-bbpress-bridge.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Version: 1.0
4
+ Stable tag: 1.0
5
+ Framework: WS-BB-DIP-1.0
6
+
7
+ Tested up to: 1.0.2
8
+ Requires at least: 1.0.2
9
+ Requires: s2Member 3.1+, bbPress® 1.0.2+
10
+
11
+ Copyright: © 2009 WebSharks, Inc.
12
+ License: GNU General Public License
13
+ Contributors: WebSharks, PriMoThemes
14
+ Author URI: http://www.primothemes.com/
15
+ Author: PriMoThemes.com / WebSharks, Inc.
16
+ Donate link: http://www.primothemes.com/donate/
17
+
18
+ Plugin Name: s2Member Bridge
19
+ Pro Module / Licensing: http://www.s2member.com/
20
+ Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
21
+ Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
22
+ Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
23
+ Description: Blocks all non-Member access to bbPress® forums. Only the login-page is available. Forum registration is redirected to your Membership Options Page for s2Member ( on your main WordPress® installation ). This way, a visitor can signup on your site, and gain Membership Access to your forums. This plugin will NOT work, until you've successfully integrated WordPress® into bbPress®. See: `bbPress® -> Settings -> WordPress® Integration`.
24
+ Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, bbpress, bb press, forums, forum, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, multi widget support, includes extensive documentation, highly extensible
25
+ */
26
+ /*
27
+ Direct access denial.
28
+ */
29
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
30
+ exit("Do not access this file directly.");
31
+ /*
32
+ Filled by the s2Member installer. Or you can set this manually.
33
+ - If this is NOT set, it defaults to 0 = ( Free Subscribers ).
34
+ */
35
+ define ("WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_MIN_LEVEL", "%%min%%");
36
+ /*
37
+ Convert s2Member Roles into bbPress® "Members" on-the-fly.
38
+ - Only when no bbPress® Role has been assigned yet.
39
+ - This way a site owner can still modify Roles.
40
+ */
41
+ add_action ("bb_init", "ws_plugin__s2member_bridge_bbpress_roles");
42
+ /**/
43
+ function ws_plugin__s2member_bridge_bbpress_roles () /* On-the-fly. */
44
+ {
45
+ if (is_object ($user = bb_get_current_user ()) && $user->ID) /* Logged in? */
46
+ /**/
47
+ if (empty ($user->roles)) /* Only when no bbPress® Role has been assigned yet. */
48
+ /**/
49
+ foreach ($user->wp_capabilities as $wp_cap => $v) /* Check ^s2member_level[0-9]+ */
50
+ /**/
51
+ if (preg_match ("/^s2member_level[0-9]+$/", $wp_cap)) /* An s2Member Role? */
52
+ {
53
+ bb_give_user_default_role($user);
54
+ break; /* Now a Member! */
55
+ }
56
+ }
57
+ /*
58
+ Deny all access to the bbPress® registration page.
59
+ This will leave the bbPress® login page available, as it should be.
60
+ - Also deny all access to anyone that does NOT have permission to participate.
61
+ In other words, anyone who is NOT at least a bbPress® Member Role.
62
+ - Also deny access to s2Member Roles that are NOT at a high enough Level.
63
+ */
64
+ add_action ("bb_init", "ws_plugin__s2member_bridge_bbpress_access");
65
+ /**/
66
+ function ws_plugin__s2member_bridge_bbpress_access () /* Check Access. */
67
+ {
68
+ $min = (int)WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_MIN_LEVEL; /* Or 0. */
69
+ /**/
70
+ $location = bb_get_location (); /* The current navigation location. */
71
+ /**/
72
+ if (!in_array ($location, array ("login-page", "register-page")))
73
+ {
74
+ if (!bb_is_user_logged_in () || !bb_current_user_can ("participate"))
75
+ {
76
+ if ($url = bb_get_option ("wp_siteurl")) /* WordPress® is integrated? */
77
+ {
78
+ $bbPress = bb_get_option ("uri"); /* bbPress® location. */
79
+ /**/
80
+ if (preg_match ("/^" . preg_quote ($bbPress, "/") . "/", $_SERVER["HTTP_REFERER"]))
81
+ wp_redirect($url); /* Referred locally. Let's go back to the Front Page. */
82
+ /**/
83
+ else /* Otherwise, trigger the Membership Options Page + s2member_level_req = $min. */
84
+ wp_redirect($url . "/?s2member_membership_options_page=1&s2member_level_req=" . urlencode ($min));
85
+ /**/
86
+ exit ();
87
+ }
88
+ }
89
+ /**/
90
+ else if (is_object ($user = bb_get_current_user ()) && $user->ID) /* Logged in? / Got User object? */
91
+ /**/
92
+ foreach ($user->wp_capabilities as $wp_cap => $v) /* Looking for ^(subscriber|s2member_level[0-9]+)$. */
93
+ /**/
94
+ if (preg_match ("/^(subscriber|s2member_level[0-9]+)$/", $wp_cap)) /* Subscribers and/or s2Member Roles. */
95
+ /**/
96
+ if (($wp_cap === "subscriber" && $min > 0) || !strlen ($level = preg_replace ("/[^0-9]/", $wp_cap)) || $level < $min)
97
+ /**/
98
+ if ($url = bb_get_option ("wp_siteurl")) /* WordPress® is integrated? */
99
+ {
100
+ $bbPress = bb_get_option ("uri"); /* bbPress® location. */
101
+ /**/
102
+ if (preg_match ("/^" . preg_quote ($bbPress, "/") . "/", $_SERVER["HTTP_REFERER"]))
103
+ wp_redirect($url); /* Referred locally. Let's go back to the Front Page. */
104
+ /**/
105
+ else /* Otherwise, trigger the Membership Options Page + s2member_level_req = $min. */
106
+ wp_redirect($url . "/?s2member_membership_options_page=1&s2member_level_req=" . urlencode ($min));
107
+ /**/
108
+ exit ();
109
+ }
110
+ }
111
+ /**/
112
+ else if (in_array ($location, array ("register-page"))) /* Send registration requests through WP. */
113
+ {
114
+ if ($url = bb_get_option ("wp_siteurl")) /* The Front Page on the WordPress® installation. */
115
+ {
116
+ wp_redirect($url . "/?s2member_membership_options_page=1&s2member_level_req=" . urlencode ($min));
117
+ exit (); /* Membership Options Page + s2member_level_req = $min. */
118
+ }
119
+ }
120
+ }
121
+ ?>
includes/dropins/bridges/index.php ADDED
File without changes
includes/dropins/index.php ADDED
File without changes
includes/functions/catg-level-access.inc.php CHANGED
@@ -29,9 +29,9 @@ if (!function_exists ("ws_plugin__s2member_check_catg_level_access"))
29
  /**/
30
  if (!$excluded && ((is_category () && ($cat_ID = get_query_var ("cat"))) || (is_single () && !is_page () && is_object ($post) && ($post_ID = $post->ID))))
31
  {
32
- if (!ws_plugin__s2member_is_systematic_use_page ()) /* Never restrict systematic use pages. */
33
  {
34
- $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false;
35
  /**/
36
  if (is_category () && $cat_ID) /* We also check if this is a child category of a restricted category. */
37
  {
29
  /**/
30
  if (!$excluded && ((is_category () && ($cat_ID = get_query_var ("cat"))) || (is_single () && !is_page () && is_object ($post) && ($post_ID = $post->ID))))
31
  {
32
+ if (!ws_plugin__s2member_is_systematic_use_page () && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
33
  {
34
+ $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
35
  /**/
36
  if (is_category () && $cat_ID) /* We also check if this is a child category of a restricted category. */
37
  {
includes/functions/file-download-access.inc.php CHANGED
@@ -155,7 +155,7 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
155
  $_GET["s2member_file_download_key"] = (!$_GET["s2member_file_download_key"] && $_GET["s2member_free_file_download_key"]) ? $_GET["s2member_free_file_download_key"] : $_GET["s2member_file_download_key"];
156
  /**/
157
  /* The use of `md5(s2member_xencrypt("locaton of file"))` was deprecated in v3.0.5 in favor of `s2member_file_download_key()` - because it provides better security and greater flexibility. Also, $_GET["s2member_free_file_download_key"] is deprecated, in favor of $_GET["s2member_file_download_key"]. */
158
- if (!$excluded && (!$_GET["s2member_file_download_key"] || ($_GET["s2member_file_download_key"] && !($_GET["s2member_file_download_key"] === ws_plugin__s2member_file_download_key ($_GET["s2member_file_download"]) || $_GET["s2member_file_download_key"] === ws_plugin__s2member_file_download_key ($_GET["s2member_file_download"], "cache-compatible") || /* Deprecated « */ $_GET["s2member_file_download_key"] === md5 (ws_plugin__s2member_xencrypt ($_GET["s2member_file_download"])) /* » */))))
159
  {
160
  $_GET["s2member_file_download"] = trim ($_GET["s2member_file_download"], "/"); /* Now trim slashes after key comparison. */
161
  /**/
155
  $_GET["s2member_file_download_key"] = (!$_GET["s2member_file_download_key"] && $_GET["s2member_free_file_download_key"]) ? $_GET["s2member_free_file_download_key"] : $_GET["s2member_file_download_key"];
156
  /**/
157
  /* The use of `md5(s2member_xencrypt("locaton of file"))` was deprecated in v3.0.5 in favor of `s2member_file_download_key()` - because it provides better security and greater flexibility. Also, $_GET["s2member_free_file_download_key"] is deprecated, in favor of $_GET["s2member_file_download_key"]. */
158
+ if (!$excluded && (!$_GET["s2member_file_download_key"] || ($_GET["s2member_file_download_key"] && !($_GET["s2member_file_download_key"] === ws_plugin__s2member_file_download_key ($_GET["s2member_file_download"]) || $_GET["s2member_file_download_key"] === ws_plugin__s2member_file_download_key ($_GET["s2member_file_download"], "cache-compatible") || /* Deprecated « */ $_GET["s2member_file_download_key"] === md5 (ws_plugin__s2member_xencrypt ($_GET["s2member_file_download"])) /* » */))) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
159
  {
160
  $_GET["s2member_file_download"] = trim ($_GET["s2member_file_download"], "/"); /* Now trim slashes after key comparison. */
161
  /**/
includes/functions/is-systematic.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit("Do not access this file directly.");
16
  /*
17
  Function that determines whether we are on a systematic use page.
18
  */
@@ -50,6 +50,14 @@ if (!function_exists ("ws_plugin__s2member_is_systematic_use_page"))
50
  {
51
  return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
52
  }
 
 
 
 
 
 
 
 
53
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && is_page ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]))
54
  {
55
  return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
  /*
17
  Function that determines whether we are on a systematic use page.
18
  */
50
  {
51
  return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
52
  }
53
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] /* Special login redirection URLs are also systematic. */
54
+ && ($login_redirection_override = ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]))/**/
55
+ && ($login_redirect_path = @parse_url ($login_redirection_override, PHP_URL_PATH)) && ($login_redirect_query = @parse_url ($login_redirection_override, PHP_URL_QUERY)) !== "nill"/**/
56
+ && ($login_redirect_uri = (($login_redirect_query) ? $login_redirect_path . "?" . $login_redirect_query : $login_redirect_path))/**/
57
+ && preg_match ("/^" . preg_quote ($login_redirect_uri, "/") . "$/", $_SERVER["REQUEST_URI"]))
58
+ {
59
+ return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
60
+ }
61
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && is_page ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]))
62
  {
63
  return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
includes/functions/login-redirection.inc.php CHANGED
@@ -62,11 +62,13 @@ if (!function_exists ("ws_plugin__s2member_fill_login_redirect_rc_vars"))
62
  do_action ("ws_plugin__s2member_before_fill_login_redirect_rc_vars", get_defined_vars ());
63
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
64
  /**/
 
65
  $current_user_login = (is_object ($current_user)) ? strtolower ($current_user->user_login) : "";
66
  $current_user_ID = (is_object ($current_user)) ? (string)$current_user->ID : "";
67
  /**/
68
  $url = preg_replace ("/%%current_user_login%%/i", ws_plugin__s2member_esc_ds ($current_user_login), $url);
69
  $url = preg_replace ("/%%current_user_ID%%/i", ws_plugin__s2member_esc_ds ($current_user_ID), $url);
 
70
  /**/
71
  return apply_filters ("ws_plugin__s2member_fill_login_redirect_rc_vars", $url, get_defined_vars ());
72
  }
62
  do_action ("ws_plugin__s2member_before_fill_login_redirect_rc_vars", get_defined_vars ());
63
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
64
  /**/
65
+ $current_user = (is_object ($current_user)) ? $current_user : wp_get_current_user ();
66
  $current_user_login = (is_object ($current_user)) ? strtolower ($current_user->user_login) : "";
67
  $current_user_ID = (is_object ($current_user)) ? (string)$current_user->ID : "";
68
  /**/
69
  $url = preg_replace ("/%%current_user_login%%/i", ws_plugin__s2member_esc_ds ($current_user_login), $url);
70
  $url = preg_replace ("/%%current_user_ID%%/i", ws_plugin__s2member_esc_ds ($current_user_ID), $url);
71
+ $url = preg_replace ("/%%current_user_level%%/i", (string)ws_plugin__s2member_user_access_level (), $url);
72
  /**/
73
  return apply_filters ("ws_plugin__s2member_fill_login_redirect_rc_vars", $url, get_defined_vars ());
74
  }
includes/functions/membership-options.inc.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /*
17
+ This forces a redirection to the Membership Options Page for s2Member.
18
+ This can be used by 3rd party applications that are not aware of which
19
+ Page is currently set as the Membership Options Page.
20
+ Attach to: add_action("template_redirect");
21
+ */
22
+ if (!function_exists ("ws_plugin__s2member_membership_options_page"))
23
+ {
24
+ function ws_plugin__s2member_membership_options_page () /* Force a redirection. */
25
+ {
26
+ do_action ("ws_plugin__s2member_before_membership_options_page", get_defined_vars ());
27
+ /**/
28
+ if ($_GET["s2member_membership_options_page"] && !is_page ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))
29
+ {
30
+ $_GET["s2member_level_req"] = (strlen ($_GET["s2member_level_req"])) ? $_GET["s2member_level_req"] : "0";
31
+ wp_redirect (add_query_arg ("s2member_level_req", $_GET["s2member_level_req"], get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
32
+ exit ();
33
+ }
34
+ /**/
35
+ do_action ("ws_plugin__s2member_after_membership_options_page", get_defined_vars ());
36
+ }
37
+ }
38
+ ?>
includes/functions/menu-pages.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit ("Do not access this file directly.");
16
  /*
17
  Function for saving all options from any page.
18
  */
@@ -48,7 +48,7 @@ if (!function_exists ("ws_plugin__s2member_update_all_options"))
48
  /**/
49
  $options = ws_plugin__s2member_configure_options_and_their_defaults ($options); /* Also updates the global options array. */
50
  /**/
51
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
52
  do_action ("ws_plugin__s2member_during_update_all_options", get_defined_vars ());
53
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
54
  /**/
@@ -59,7 +59,10 @@ if (!function_exists ("ws_plugin__s2member_update_all_options"))
59
  else /* Otherwise, the Auto-EOT System via WP-Cron is disabled. */
60
  ws_plugin__s2member_delete_auto_eot_system ();
61
  /**/
62
- ws_plugin__s2member_display_admin_notice ('<strong>Options saved.</strong>');
 
 
 
63
  }
64
  /**/
65
  do_action ("ws_plugin__s2member_after_update_all_options", get_defined_vars ());
@@ -83,12 +86,7 @@ if (!function_exists ("ws_plugin__s2member_add_admin_options"))
83
  /**/
84
  if (apply_filters ("ws_plugin__s2member_during_add_admin_options_create_menu_items", true, get_defined_vars ()))
85
  {
86
- $position = (!$position && !$menu[71]) ? 71 : $position; /* Ideal position if available. */
87
- $position = (!$position && !$menu[72]) ? 72 : $position; /* Else position here if available. */
88
- $position = (!$position && !$menu[73]) ? 73 : $position; /* Else position here if available. */
89
- $position = (!$position && !$menu[74]) ? 74 : $position; /* Else position here if available. */
90
- /**/
91
- add_menu_page ("s2Member Options", "s2Member", "edit_plugins", "ws-plugin--s2member-options", "ws_plugin__s2member_options_page", "", $position);
92
  add_submenu_page ("ws-plugin--s2member-options", "s2Member General Options", "General Options", "edit_plugins", "ws-plugin--s2member-options", "ws_plugin__s2member_options_page");
93
  /**/
94
  if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_paypal_ops_page", true, get_defined_vars ()))
@@ -112,6 +110,9 @@ if (!function_exists ("ws_plugin__s2member_add_admin_options"))
112
  if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_scripting_page", true, get_defined_vars ()))
113
  add_submenu_page ("ws-plugin--s2member-options", "s2Member API / Scripting", "API / Scripting", "edit_plugins", "ws-plugin--s2member-scripting", "ws_plugin__s2member_scripting_page");
114
  /**/
 
 
 
115
  if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_info_page", true, get_defined_vars ()))
116
  add_submenu_page ("ws-plugin--s2member-options", "s2Member Information", "s2Member Info", "edit_plugins", "ws-plugin--s2member-info", "ws_plugin__s2member_info_page");
117
  /**/
@@ -131,7 +132,7 @@ if (!function_exists ("_ws_plugin__s2member_add_settings_link"))
131
  {
132
  function _ws_plugin__s2member_add_settings_link ($links = array (), $file = "")
133
  {
134
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
135
  do_action ("_ws_plugin__s2member_before_add_settings_link", get_defined_vars ());
136
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
137
  /**/
@@ -140,7 +141,7 @@ if (!function_exists ("_ws_plugin__s2member_add_settings_link"))
140
  $settings = '<a href="admin.php?page=ws-plugin--s2member-options">Settings</a>';
141
  array_unshift ($links, apply_filters ("ws_plugin__s2member_add_settings_link", $settings, get_defined_vars ()));
142
  /**/
143
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
144
  do_action ("_ws_plugin__s2member_during_add_settings_link", get_defined_vars ());
145
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
146
  }
@@ -160,9 +161,9 @@ if (!function_exists ("ws_plugin__s2member_add_admin_scripts"))
160
  /**/
161
  if ($_GET["page"] && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
162
  {
163
- wp_enqueue_script ("jquery");
164
- wp_enqueue_script ("thickbox");
165
- wp_enqueue_script ("media-upload");
166
  wp_enqueue_script ("ws-plugin--s2member-menu-pages", get_bloginfo ("url") . "/?ws_plugin__s2member_menu_pages_js=1", array ("jquery", "thickbox", "media-upload"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);
167
  /**/
168
  do_action ("ws_plugin__s2member_during_add_admin_scripts", get_defined_vars ());
@@ -185,7 +186,7 @@ if (!function_exists ("ws_plugin__s2member_add_admin_styles"))
185
  /**/
186
  if ($_GET["page"] && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
187
  {
188
- wp_enqueue_style ("thickbox");
189
  wp_enqueue_style ("ws-plugin--s2member-menu-pages", get_bloginfo ("url") . "/?ws_plugin__s2member_menu_pages_css=1", array ("thickbox"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"], "all");
190
  /**/
191
  do_action ("ws_plugin__s2member_during_add_admin_styles", get_defined_vars ());
@@ -208,11 +209,11 @@ if (!function_exists ("ws_plugin__s2member_menu_pages_js"))
208
  /**/
209
  if ($_GET["ws_plugin__s2member_menu_pages_js"] && is_user_logged_in () && current_user_can ("edit_plugins"))
210
  {
211
- header ("Content-Type: text/javascript; charset=utf-8");
212
- header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
213
- header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
214
- header ("Cache-Control: no-cache, must-revalidate, max-age=0");
215
- header ("Pragma: no-cache");
216
  /**/
217
  $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
218
  $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
@@ -240,11 +241,11 @@ if (!function_exists ("ws_plugin__s2member_menu_pages_css"))
240
  /**/
241
  if ($_GET["ws_plugin__s2member_menu_pages_css"] && is_user_logged_in () && current_user_can ("edit_plugins"))
242
  {
243
- header ("Content-Type: text/css; charset=utf-8");
244
- header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
245
- header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
246
- header ("Cache-Control: no-cache, must-revalidate, max-age=0");
247
- header ("Pragma: no-cache");
248
  /**/
249
  $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
250
  $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
@@ -448,6 +449,68 @@ if (!function_exists ("ws_plugin__s2member_scripting_page"))
448
  }
449
  }
450
  /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
  Function for building the s2Member Info page.
452
  */
453
  if (!function_exists ("ws_plugin__s2member_info_page"))
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit("Do not access this file directly.");
16
  /*
17
  Function for saving all options from any page.
18
  */
48
  /**/
49
  $options = ws_plugin__s2member_configure_options_and_their_defaults ($options); /* Also updates the global options array. */
50
  /**/
51
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
52
  do_action ("ws_plugin__s2member_during_update_all_options", get_defined_vars ());
53
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
54
  /**/
59
  else /* Otherwise, the Auto-EOT System via WP-Cron is disabled. */
60
  ws_plugin__s2member_delete_auto_eot_system ();
61
  /**/
62
+ ws_plugin__s2member_display_admin_notice('<strong>Options saved.</strong>');
63
+ /**/
64
+ if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
65
+ ws_plugin__s2member_display_admin_notice ('<strong>NOTE:</strong> s2Member security restrictions will NOT be enforced until you\'ve configured a Membership Options Page. See: <code>s2Member -> General Options -> Membership Options Page</code>.', true);
66
  }
67
  /**/
68
  do_action ("ws_plugin__s2member_after_update_all_options", get_defined_vars ());
86
  /**/
87
  if (apply_filters ("ws_plugin__s2member_during_add_admin_options_create_menu_items", true, get_defined_vars ()))
88
  {
89
+ add_menu_page ("s2Member Options", "s2Member", "edit_plugins", "ws-plugin--s2member-options", "ws_plugin__s2member_options_page");
 
 
 
 
 
90
  add_submenu_page ("ws-plugin--s2member-options", "s2Member General Options", "General Options", "edit_plugins", "ws-plugin--s2member-options", "ws_plugin__s2member_options_page");
91
  /**/
92
  if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_paypal_ops_page", true, get_defined_vars ()))
110
  if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_scripting_page", true, get_defined_vars ()))
111
  add_submenu_page ("ws-plugin--s2member-options", "s2Member API / Scripting", "API / Scripting", "edit_plugins", "ws-plugin--s2member-scripting", "ws_plugin__s2member_scripting_page");
112
  /**/
113
+ if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_bridges_page", true, get_defined_vars ()))
114
+ add_submenu_page ("ws-plugin--s2member-options", "s2Member Bridge Integrations", "API / Bridges", "edit_plugins", "ws-plugin--s2member-bridges", "ws_plugin__s2member_bridges_page");
115
+ /**/
116
  if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_info_page", true, get_defined_vars ()))
117
  add_submenu_page ("ws-plugin--s2member-options", "s2Member Information", "s2Member Info", "edit_plugins", "ws-plugin--s2member-info", "ws_plugin__s2member_info_page");
118
  /**/
132
  {
133
  function _ws_plugin__s2member_add_settings_link ($links = array (), $file = "")
134
  {
135
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
136
  do_action ("_ws_plugin__s2member_before_add_settings_link", get_defined_vars ());
137
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
138
  /**/
141
  $settings = '<a href="admin.php?page=ws-plugin--s2member-options">Settings</a>';
142
  array_unshift ($links, apply_filters ("ws_plugin__s2member_add_settings_link", $settings, get_defined_vars ()));
143
  /**/
144
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
145
  do_action ("_ws_plugin__s2member_during_add_settings_link", get_defined_vars ());
146
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
147
  }
161
  /**/
162
  if ($_GET["page"] && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
163
  {
164
+ wp_enqueue_script("jquery");
165
+ wp_enqueue_script("thickbox");
166
+ wp_enqueue_script("media-upload");
167
  wp_enqueue_script ("ws-plugin--s2member-menu-pages", get_bloginfo ("url") . "/?ws_plugin__s2member_menu_pages_js=1", array ("jquery", "thickbox", "media-upload"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);
168
  /**/
169
  do_action ("ws_plugin__s2member_during_add_admin_scripts", get_defined_vars ());
186
  /**/
187
  if ($_GET["page"] && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
188
  {
189
+ wp_enqueue_style("thickbox");
190
  wp_enqueue_style ("ws-plugin--s2member-menu-pages", get_bloginfo ("url") . "/?ws_plugin__s2member_menu_pages_css=1", array ("thickbox"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"], "all");
191
  /**/
192
  do_action ("ws_plugin__s2member_during_add_admin_styles", get_defined_vars ());
209
  /**/
210
  if ($_GET["ws_plugin__s2member_menu_pages_js"] && is_user_logged_in () && current_user_can ("edit_plugins"))
211
  {
212
+ header("Content-Type: text/javascript; charset=utf-8");
213
+ header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
214
+ header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
215
+ header("Cache-Control: no-cache, must-revalidate, max-age=0");
216
+ header("Pragma: no-cache");
217
  /**/
218
  $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
219
  $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
241
  /**/
242
  if ($_GET["ws_plugin__s2member_menu_pages_css"] && is_user_logged_in () && current_user_can ("edit_plugins"))
243
  {
244
+ header("Content-Type: text/css; charset=utf-8");
245
+ header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
246
+ header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
247
+ header("Cache-Control: no-cache, must-revalidate, max-age=0");
248
+ header("Pragma: no-cache");
249
  /**/
250
  $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
251
  $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
449
  }
450
  }
451
  /*
452
+ Function for building the Bridge Integrations page.
453
+ */
454
+ if (!function_exists ("ws_plugin__s2member_bridges_page"))
455
+ {
456
+ function ws_plugin__s2member_bridges_page ()
457
+ {
458
+ do_action ("ws_plugin__s2member_before_bridges_page", get_defined_vars ());
459
+ /**/
460
+ if (($nonce = $_POST["ws_plugin__s2member_bridge_bbpress"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-bridge-bbpress"))
461
+ {
462
+ if (($plugins_dir = trim (rtrim (stripslashes ($_POST["ws_plugin__s2member_bridge_bbpress_plugins_dir"]), "/"))) && is_dir ($plugins_dir))
463
+ {
464
+ if (is_writable ($plugins_dir)) /* This directory MUST be writable. Otherwise, file_put_contents() will fail. */
465
+ {
466
+ if (preg_match ("/^Install/i", $_POST["ws_plugin__s2member_bridge_bbpress_action"]))
467
+ {
468
+ $min = (string)$_POST["ws_plugin__s2member_bridge_bbpress_min_level"];
469
+ /**/
470
+ if (($file = file_get_contents (dirname (dirname (__FILE__)) . "/dropins/bridges/_s2member-bbpress-bridge.php")) && ($file = preg_replace ("/%%min%%/i", ws_plugin__s2member_esc_dq ($min), $file)) && file_put_contents ($plugins_dir . "/_s2member-bbpress-bridge.php", $file))
471
+ ws_plugin__s2member_display_admin_notice("The bbPress® Bridge/plugin has been <strong>installed successfully</strong>.");
472
+ /**/
473
+ else /* Otherwise, something unexpected. The site owner will need to install the bbPress® plugin manually. */
474
+ ws_plugin__s2member_display_admin_notice ("Unknown error. Please try again, or install manually.", true);
475
+ }
476
+ /**/
477
+ else if (preg_match ("/^Un-Install/i", $_POST["ws_plugin__s2member_bridge_bbpress_action"]))
478
+ {
479
+ if (file_exists ($plugins_dir . "/_s2member-bbpress-bridge.php"))
480
+ {
481
+ if (!unlink ($plugins_dir . "/_s2member-bbpress-bridge.php")) /* Test return value of unlink. */
482
+ ws_plugin__s2member_display_admin_notice ("Unknown error. Please try again, or un-install manually.", true);
483
+ /**/
484
+ else /* Otherwise, everything looks good. The plugin file has been removed successfully. */
485
+ ws_plugin__s2member_display_admin_notice("The bbPress® Bridge/plugin has been successfully <strong>un-installed</strong>.");
486
+ }
487
+ else
488
+ ws_plugin__s2member_display_admin_notice ("The bbPress® Bridge/plugin is already un-installed.", true);
489
+ }
490
+ }
491
+ else
492
+ ws_plugin__s2member_display_admin_notice ("The directory you specified is NOT writable. Please try again, or install manually.", true);
493
+ }
494
+ else
495
+ ws_plugin__s2member_display_admin_notice ("The directory you specified does NOT exist. Please try again, or install manually.", true);
496
+ }
497
+ /**/
498
+ if (!is_dir ($plugins_dir_guess = $_SERVER["DOCUMENT_ROOT"] . "/bbpress/my-plugins"))
499
+ if (!is_dir ($plugins_dir_guess = $_SERVER["DOCUMENT_ROOT"] . "/forums/my-plugins"))
500
+ if (!is_dir ($plugins_dir_guess = $_SERVER["DOCUMENT_ROOT"] . "/bbpress/bb-plugins"))
501
+ if (!is_dir ($plugins_dir_guess = $_SERVER["DOCUMENT_ROOT"] . "/forums/bb-plugins"))
502
+ $plugins_dir_guess = ($plugins_dir) ? $plugins_dir : $plugins_dir_guess;
503
+ /**/
504
+ $_bridge_bbpress_plugins_dir_guess = ($plugins_dir) ? $plugins_dir : $plugins_dir_guess;
505
+ /**/
506
+ include_once dirname (dirname (__FILE__)) . "/menu-pages/bridges.inc.php";
507
+ /**/
508
+ do_action ("ws_plugin__s2member_after_bridges_page", get_defined_vars ());
509
+ /**/
510
+ return;
511
+ }
512
+ }
513
+ /*
514
  Function for building the s2Member Info page.
515
  */
516
  if (!function_exists ("ws_plugin__s2member_info_page"))
includes/functions/page-level-access.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit("Do not access this file directly.");
16
  /*
17
  Function for handling Page Level Access permissions.
18
  Attach to: add_action("template_redirect");
@@ -27,48 +27,58 @@ if (!function_exists ("ws_plugin__s2member_check_page_level_access"))
27
  /**/
28
  $excluded = apply_filters ("ws_plugin__s2member_check_page_level_access_excluded", false, get_defined_vars ());
29
  /**/
30
- if (!$excluded && is_page () && is_object ($post) && ($page_ID = $post->ID))
31
  {
32
- $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false;
33
  /**/
34
- if ($page_ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
35
  exit ();
36
  /**/
37
- else if ($page_ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
 
 
 
 
38
  exit ();
39
  /**/
40
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
41
  exit ();
42
  /**/
43
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
44
- exit ();
45
- /**/
46
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "1", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
47
- exit ();
48
- /**/
49
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "1", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
50
- exit ();
51
- /**/
52
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "2", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
53
- exit ();
54
- /**/
55
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "2", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
56
- exit ();
57
- /**/
58
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "3", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
59
- exit ();
60
- /**/
61
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "3", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
62
- exit ();
63
- /**/
64
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "4", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
65
- exit ();
66
- /**/
67
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_level_req", "4", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
68
- exit ();
69
- /**/
70
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($page_ID) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (add_query_arg ("s2member_sp_req", $page_ID, get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
71
- exit ();
 
 
 
 
 
 
72
  /**/
73
  do_action ("ws_plugin__s2member_during_check_page_level_access", get_defined_vars ());
74
  }
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
  /*
17
  Function for handling Page Level Access permissions.
18
  Attach to: add_action("template_redirect");
27
  /**/
28
  $excluded = apply_filters ("ws_plugin__s2member_check_page_level_access_excluded", false, get_defined_vars ());
29
  /**/
30
+ if (!$excluded && is_page () && is_object ($post) && ($page_ID = $post->ID) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
31
  {
32
+ $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
33
  /**/
34
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $page_ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
35
  exit ();
36
  /**/
37
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] /* This is also protected. */
38
+ && ($login_redirection_override = ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]))/**/
39
+ && ($login_redirect_path = @parse_url ($login_redirection_override, PHP_URL_PATH)) && ($login_redirect_query = @parse_url ($login_redirection_override, PHP_URL_QUERY)) !== "nill"/**/
40
+ && ($login_redirect_uri = (($login_redirect_query) ? $login_redirect_path . "?" . $login_redirect_query : $login_redirect_path))/**/
41
+ && preg_match ("/^" . preg_quote ($login_redirect_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
42
  exit ();
43
  /**/
44
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && $page_ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
45
  exit ();
46
  /**/
47
+ else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Never restrict systematic use pages. Except for the two pages above ^. They MUST be protected at all times. */
48
+ {
49
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
50
+ exit ();
51
+ /**/
52
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
53
+ exit ();
54
+ /**/
55
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (add_query_arg ("s2member_level_req", "1", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
56
+ exit ();
57
+ /**/
58
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (add_query_arg ("s2member_level_req", "1", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
59
+ exit ();
60
+ /**/
61
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (add_query_arg ("s2member_level_req", "2", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
62
+ exit ();
63
+ /**/
64
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (add_query_arg ("s2member_level_req", "2", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
65
+ exit ();
66
+ /**/
67
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (add_query_arg ("s2member_level_req", "3", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
68
+ exit ();
69
+ /**/
70
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (add_query_arg ("s2member_level_req", "3", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
71
+ exit ();
72
+ /**/
73
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (add_query_arg ("s2member_level_req", "4", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
74
+ exit ();
75
+ /**/
76
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (add_query_arg ("s2member_level_req", "4", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
77
+ exit ();
78
+ /**/
79
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($page_ID) && wp_redirect (add_query_arg ("s2member_sp_req", $page_ID, get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
80
+ exit ();
81
+ }
82
  /**/
83
  do_action ("ws_plugin__s2member_during_check_page_level_access", get_defined_vars ());
84
  }
includes/functions/paypal-notify.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit ("Do not access this file directly.");
16
  /*
17
  Handles PayPal® IPN URL processing.
18
  These same routines also handle s2Member Pro/PayPal® Pro operations;
@@ -54,7 +54,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
54
  /*
55
  Custom conditionals can be applied by filters.
56
  */
57
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
58
  if (!apply_filters ("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars ()))
59
  {
60
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
@@ -67,7 +67,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
67
  if (/**/preg_match ("/^express_checkout$/i", $paypal["txn_type"])/**/
68
  && $paypal["item_number"] && $paypal["payer_email"] && $paypal["txn_id"]/**/)
69
  {
70
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
71
  do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
72
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
73
  /**/
@@ -78,11 +78,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
78
  $paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
79
  $paypal["s2member_log"][] = "s2Member Pro handles Express Checkout events on-site, with an IPN proxy.";
80
  /**/
81
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
82
  do_action ("ws_plugin__s2member_during_paypal_notify_during_express_checkout", get_defined_vars ());
83
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
84
  /**/
85
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
86
  do_action ("ws_plugin__s2member_during_paypal_notify_after_express_checkout", get_defined_vars ());
87
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
88
  }
@@ -95,7 +95,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
95
  else if (/**/preg_match ("/^cart$/i", $paypal["txn_type"])/**/
96
  && $paypal["item_number1"] && $paypal["payer_email"] && $paypal["txn_id"]/**/)
97
  {
98
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
99
  do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
100
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
101
  /**/
@@ -106,11 +106,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
106
  $paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
107
  $paypal["s2member_log"][] = "s2Member Pro handles Cart events on-site, with an IPN proxy.";
108
  /**/
109
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
110
  do_action ("ws_plugin__s2member_during_paypal_notify_during_cart", get_defined_vars ());
111
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
112
  /**/
113
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
114
  do_action ("ws_plugin__s2member_during_paypal_notify_after_cart", get_defined_vars ());
115
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
116
  }
@@ -121,7 +121,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
121
  && preg_match ("/^sp\:[0-9,]+\:[0-9]+$/", $paypal["item_number"])/**/
122
  && $paypal["payer_email"] && $paypal["txn_id"]/**/)
123
  {
124
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
125
  do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_access", get_defined_vars ());
126
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
127
  /**/
@@ -139,26 +139,39 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
139
  $msg = preg_replace ("/%%sp_access_url%%/i", ws_plugin__s2member_esc_ds ($sp_access_url), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"][(($_GET["s2member_paypal_proxy"] === "s2member-pro-module") ? "pro_" : "") . "sp_email_message"]);
140
  $msg = preg_replace ("/%%sp_access_exp%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_approx_time_difference (time (), strtotime ("+" . $paypal["hours"] . " hours"))), $msg);
141
  /**/
142
- if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)) && ($sbj = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds ($paypal["txn_id"]), $sbj)))
143
- if (($sbj = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_gross"]), $sbj))) /* Full amount of the payment, before fee is subtracted. */
144
- if (($sbj = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $sbj)) && ($sbj = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $sbj)))
145
- if (($sbj = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $sbj)) && ($sbj = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $sbj)))
146
- if (($sbj = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $sbj)))
147
- if (($sbj = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $sbj)))
148
- /**/
149
- if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds ($paypal["txn_id"]), $msg)))
150
- if (($msg = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_gross"]), $msg))) /* Full amount of the payment, before fee is subtracted. */
151
- if (($msg = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $msg)) && ($msg = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $msg)))
152
- if (($msg = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $msg)) && ($msg = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $msg)))
153
- if (($msg = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $msg)))
154
- if (($msg = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $msg)))
155
- /**/
156
- if (($sbj = trim ($sbj)) && ($msg = trim ($msg))) /* Make sure they are not empty. */
157
- {
158
- mail ($paypal["payer_email"], $sbj, $msg, "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8");
159
- /**/
160
- $paypal["s2member_log"][] = "Specific Post/Page Confirmation Email sent to Customer.";
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  /**/
163
  if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_notification_urls"])
164
  {
@@ -173,7 +186,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
173
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
174
  /**/
175
  if (($url = trim ($url))) /* Empty? */
176
- ws_plugin__s2member_remote ($url);
177
  /**/
178
  $paypal["s2member_log"][] = "Specific Post/Page Access Notification URLs have been processed.";
179
  }
@@ -209,7 +222,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
209
  }
210
  }
211
  /**/
212
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
213
  do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_access", get_defined_vars ());
214
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
215
  }
@@ -218,7 +231,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
218
  $paypal["s2member_log"][] = "Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?";
219
  }
220
  /**/
221
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
222
  do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_access", get_defined_vars ());
223
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
224
  }
@@ -232,7 +245,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
232
  && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/
233
  && $paypal["payer_email"]/**/)
234
  {
235
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
236
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup", get_defined_vars ());
237
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
238
  /**/
@@ -258,7 +271,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
258
  /* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified. PayPal will not allow the
259
  modify=1|2 parameter to be used in those scenarios, because technically there is nothing to update. The only thing that actually needs to be updated is the account. */
260
  {
261
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
262
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_w_update_vars", get_defined_vars ());
263
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
264
  /**/
@@ -299,7 +312,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
299
  /**/
300
  $paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
301
  /**/
302
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
303
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars", get_defined_vars ());
304
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
305
  }
@@ -313,7 +326,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
313
  $paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB. Please check the on0 and os0 variables in your Button Code.";
314
  }
315
  /**/
316
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
317
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_w_update_vars", get_defined_vars ());
318
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
319
  }
@@ -322,7 +335,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
322
  */
323
  else /* Else this is a normal Subscription signup, we are not updating anything. */
324
  {
325
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
326
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_wo_update_vars", get_defined_vars ());
327
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
328
  /**/
@@ -334,33 +347,47 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
334
  /**/
335
  $sbj = preg_replace ("/%%registration_url%%/i", ws_plugin__s2member_esc_ds ($registration_url), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"][(($_GET["s2member_paypal_proxy"] === "s2member-pro-module") ? "pro_" : "") . "signup_email_subject"]);
336
  $msg = preg_replace ("/%%registration_url%%/i", ws_plugin__s2member_esc_ds ($registration_url), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"][(($_GET["s2member_paypal_proxy"] === "s2member-pro-module") ? "pro_" : "") . "signup_email_message"]);
 
337
  /**/
338
- if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)) && ($sbj = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $sbj)))
339
- if (($sbj = preg_replace ("/%%initial%%/i", ws_plugin__s2member_esc_ds ($paypal["initial"]), $sbj)) && ($sbj = preg_replace ("/%%regular%%/i", ws_plugin__s2member_esc_ds ($paypal["regular"]), $sbj)))
340
- if (($sbj = preg_replace ("/%%initial_term%%/i", ws_plugin__s2member_esc_ds ($paypal["initial_term"]), $sbj)) && ($sbj = preg_replace ("/%%regular_term%%/i", ws_plugin__s2member_esc_ds ($paypal["regular_term"]), $sbj)))
341
- if (($sbj = preg_replace ("/%%initial_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["initial_term"])), $sbj)) && ($sbj = preg_replace ("/%%regular_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"])), $sbj)))
342
- if (($sbj = preg_replace ("/%%recurring%%/i", ws_plugin__s2member_esc_ds ($paypal["recurring"]), $sbj)) && ($sbj = preg_replace ("/%%recurring\/regular_cycle%%/i", ws_plugin__s2member_esc_ds ((($paypal["recurring"]) ? $paypal["recurring"] . " / " . ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"]) : "0 / non-recurring")), $sbj)))
343
- if (($sbj = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $sbj)) && ($sbj = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $sbj)))
344
- if (($sbj = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $sbj)) && ($sbj = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $sbj)))
345
- if (($sbj = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $sbj)))
346
- if (($sbj = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $sbj)))
347
- /**/
348
- if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $msg)))
349
- if (($msg = preg_replace ("/%%initial%%/i", ws_plugin__s2member_esc_ds ($paypal["initial"]), $msg)) && ($msg = preg_replace ("/%%regular%%/i", ws_plugin__s2member_esc_ds ($paypal["regular"]), $msg)))
350
- if (($msg = preg_replace ("/%%initial_term%%/i", ws_plugin__s2member_esc_ds ($paypal["initial_term"]), $msg)) && ($msg = preg_replace ("/%%regular_term%%/i", ws_plugin__s2member_esc_ds ($paypal["regular_term"]), $msg)))
351
- if (($msg = preg_replace ("/%%initial_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["initial_term"])), $msg)) && ($msg = preg_replace ("/%%regular_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"])), $msg)))
352
- if (($msg = preg_replace ("/%%recurring%%/i", ws_plugin__s2member_esc_ds ($paypal["recurring"]), $msg)) && ($msg = preg_replace ("/%%recurring\/regular_cycle%%/i", ws_plugin__s2member_esc_ds ((($paypal["recurring"]) ? $paypal["recurring"] . " / " . ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"]) : "0 / non-recurring")), $msg)))
353
- if (($msg = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $msg)) && ($msg = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $msg)))
354
- if (($msg = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $msg)) && ($msg = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $msg)))
355
- if (($msg = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $msg)))
356
- if (($msg = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $msg)))
357
- /**/
358
- if (($sbj = trim ($sbj)) && ($msg = trim ($msg))) /* Make sure they are not empty. */
359
- {
360
- mail ($paypal["payer_email"], $sbj, $msg, "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8");
361
- /**/
362
- $paypal["s2member_log"][] = "Signup Confirmation Email sent to Customer.";
363
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
364
  /**/
365
  if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_notification_urls"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
366
  {
@@ -375,7 +402,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
375
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
376
  /**/
377
  if (($url = trim ($url))) /* Empty? */
378
- ws_plugin__s2member_remote ($url);
379
  /**/
380
  $paypal["s2member_log"][] = "Signup Notification URLs have been processed.";
381
  }
@@ -397,7 +424,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
397
  }
398
  }
399
  /**/
400
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
401
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars", get_defined_vars ());
402
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
403
  }
@@ -406,7 +433,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
406
  $paypal["s2member_log"][] = "Unable to generate Registration URL for Membership Access. Possible data corruption within the IPN response.";
407
  }
408
  /**/
409
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
410
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_wo_update_vars", get_defined_vars ());
411
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
412
  }
@@ -440,12 +467,12 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
440
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
441
  /**/
442
  if (($url = trim ($url))) /* Empty? */
443
- ws_plugin__s2member_remote ($url);
444
  /**/
445
  $paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
446
  }
447
  /**/
448
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
449
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
450
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
451
  }
@@ -462,7 +489,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
462
  && ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/)
463
  /* The "payer_email" is not passed in: recurring_payment_profile_created ?? */
464
  {
465
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
466
  do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
467
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
468
  /**/
@@ -473,11 +500,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
473
  $paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
474
  $paypal["s2member_log"][] = "s2Member Pro handles this event on-site, with an IPN proxy.";
475
  /**/
476
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
477
  do_action ("ws_plugin__s2member_during_paypal_notify_during_recurring_payment_profile_created", get_defined_vars ());
478
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
479
  /**/
480
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
481
  do_action ("ws_plugin__s2member_during_paypal_notify_after_recurring_payment_profile_created", get_defined_vars ());
482
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
483
  }
@@ -488,7 +515,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
488
  && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/
489
  && $paypal["subscr_id"] && $paypal["payer_email"]/**/)
490
  {
491
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
492
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_modify", get_defined_vars ());
493
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
494
  /**/
@@ -526,7 +553,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
526
  /**/
527
  $paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
528
  /**/
529
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
530
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_modify", get_defined_vars ());
531
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
532
  }
@@ -540,7 +567,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
540
  $paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
541
  }
542
  /**/
543
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
544
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_modify", get_defined_vars ());
545
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
546
  }
@@ -555,14 +582,14 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
555
  && ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
556
  && $paypal["payer_email"] && $paypal["txn_id"] && $paypal["mc_gross"]/**/)
557
  {
558
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
559
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_payment", get_defined_vars ());
560
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
561
  /**/
562
  $paypal["s2member_log"][] = "s2Member txn_type identified as subscr_payment|recurring_payment.";
563
  $paypal["s2member_log"][] = "Sleeping for 2 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
564
- sleep (2); /* Sleep here for a moment. PayPal® sometimes sends a subscr_payment before the subscr_signup, subscr_modify.
565
- It is NOT a big deal if they do. However, s2Member goes to sleep here, just to help keep the log files in a logical order. */
566
  $paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as subscr_payment|recurring_payment.";
567
  /**/
568
  list ($paypal["level"], $paypal["ccaps"]) = preg_split ("/\:/", $paypal["item_number"], 2);
@@ -587,12 +614,12 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
587
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
588
  /**/
589
  if (($url = trim ($url))) /* Empty? */
590
- ws_plugin__s2member_remote ($url);
591
  /**/
592
  $paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
593
  }
594
  /**/
595
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
596
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
597
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
598
  }
@@ -603,7 +630,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
603
  set_transient (md5 ("s2member_transient_ipn_subscr_payment_" . $paypal["subscr_id"]), $_POST, 43200);
604
  }
605
  /**/
606
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
607
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_payment", get_defined_vars ());
608
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
609
  }
@@ -620,7 +647,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
620
  && ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
621
  && $paypal["payer_email"]/**/)
622
  {
623
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
624
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_failed", get_defined_vars ());
625
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
626
  /**/
@@ -632,11 +659,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
632
  $paypal["s2member_log"][] = "s2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.";
633
  $paypal["s2member_log"][] = "When multiple consecutive payments fail, a special IPN response will be triggered.";
634
  /**/
635
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
636
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_failed", get_defined_vars ());
637
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
638
  /**/
639
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
640
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_failed", get_defined_vars ());
641
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
642
  }
@@ -655,7 +682,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
655
  && ($paypal["period3"] || ($paypal["period3"] = ws_plugin__s2member_paypal_pro_period3 ($paypal)))/**/
656
  && $paypal["payer_email"]/**/)
657
  {
658
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
659
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_cancel", get_defined_vars ());
660
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
661
  /**/
@@ -675,7 +702,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
675
  /**/
676
  $paypal["s2member_log"][] = "Auto-EOT Time for this account: " . date ("D M j, Y g:i a T", $auto_eot_time);
677
  /**/
678
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
679
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_cancel", get_defined_vars ());
680
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
681
  }
@@ -689,7 +716,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
689
  $paypal["s2member_log"][] = "Unable to handle Cancellation. Could not get the existing User ID from the DB.";
690
  }
691
  /**/
692
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
693
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_cancel", get_defined_vars ());
694
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
695
  }
@@ -705,7 +732,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
705
  && ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
706
  && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/)
707
  {
708
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
709
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
710
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
711
  /**/
@@ -752,12 +779,12 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
752
  if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
753
  /**/
754
  if (($url = trim ($url))) /* Empty? */
755
- ws_plugin__s2member_remote ($url);
756
  /**/
757
  $paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
758
  }
759
  /**/
760
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
761
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
762
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
763
  }
@@ -765,19 +792,19 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
765
  {
766
  $processing = $during = true; /* Yes, we ARE processing this. */
767
  /**/
768
- wp_delete_user ($user_id); /* Triggers: `ws_plugin__s2member_handle_user_deletions()` */
769
  /* `ws_plugin__s2member_handle_user_deletions()` triggers `eot_del_notification_urls` */
770
  /**/
771
  $paypal["s2member_log"][] = "The Member's account has been deleted completely.";
772
  /**/
773
  $paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
774
  /**/
775
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
776
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delete", get_defined_vars ());
777
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
778
  }
779
  /**/
780
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
781
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot", get_defined_vars ());
782
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
783
  }
@@ -791,7 +818,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
791
  $paypal["s2member_log"][] = "Auto-EOT is currently disabled. Skipping immediate EOT (demote|delete), for now.";
792
  $paypal["s2member_log"][] = "Recording the Auto-EOT Time for this Member's account: " . date ("D M j, Y g:i a T", $auto_eot_time);
793
  /**/
794
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
795
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_disabled", get_defined_vars ());
796
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
797
  }
@@ -830,17 +857,17 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
830
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
831
  /**/
832
  if (($url = trim ($url))) /* Empty? */
833
- ws_plugin__s2member_remote ($url);
834
  /**/
835
  $paypal["s2member_log"][] = "Refund/Reversal Notification URLs have been processed.";
836
  }
837
  /**/
838
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
839
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
840
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
841
  }
842
  /**/
843
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
844
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_eot", get_defined_vars ());
845
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
846
  }
@@ -897,14 +924,14 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
897
  if (is_writable ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
898
  file_put_contents ($logs_dir . "/paypal-ipn.log", var_export ($paypal, true) . "\n\n", FILE_APPEND);
899
  /**/
900
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
901
  do_action ("ws_plugin__s2member_during_paypal_notify", get_defined_vars ());
902
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
903
  /**/
904
- exit ($paypal["proxy_return_url"]); /* Return, if/when applicable. */
905
  }
906
  /**/
907
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
908
  do_action ("ws_plugin__s2member_after_paypal_notify", get_defined_vars ());
909
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
910
  }
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit("Do not access this file directly.");
16
  /*
17
  Handles PayPal® IPN URL processing.
18
  These same routines also handle s2Member Pro/PayPal® Pro operations;
54
  /*
55
  Custom conditionals can be applied by filters.
56
  */
57
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
58
  if (!apply_filters ("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars ()))
59
  {
60
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
67
  if (/**/preg_match ("/^express_checkout$/i", $paypal["txn_type"])/**/
68
  && $paypal["item_number"] && $paypal["payer_email"] && $paypal["txn_id"]/**/)
69
  {
70
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
71
  do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
72
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
73
  /**/
78
  $paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
79
  $paypal["s2member_log"][] = "s2Member Pro handles Express Checkout events on-site, with an IPN proxy.";
80
  /**/
81
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
82
  do_action ("ws_plugin__s2member_during_paypal_notify_during_express_checkout", get_defined_vars ());
83
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
84
  /**/
85
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
86
  do_action ("ws_plugin__s2member_during_paypal_notify_after_express_checkout", get_defined_vars ());
87
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
88
  }
95
  else if (/**/preg_match ("/^cart$/i", $paypal["txn_type"])/**/
96
  && $paypal["item_number1"] && $paypal["payer_email"] && $paypal["txn_id"]/**/)
97
  {
98
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
99
  do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
100
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
101
  /**/
106
  $paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
107
  $paypal["s2member_log"][] = "s2Member Pro handles Cart events on-site, with an IPN proxy.";
108
  /**/
109
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
110
  do_action ("ws_plugin__s2member_during_paypal_notify_during_cart", get_defined_vars ());
111
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
112
  /**/
113
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
114
  do_action ("ws_plugin__s2member_during_paypal_notify_after_cart", get_defined_vars ());
115
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
116
  }
121
  && preg_match ("/^sp\:[0-9,]+\:[0-9]+$/", $paypal["item_number"])/**/
122
  && $paypal["payer_email"] && $paypal["txn_id"]/**/)
123
  {
124
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
125
  do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_access", get_defined_vars ());
126
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
127
  /**/
139
  $msg = preg_replace ("/%%sp_access_url%%/i", ws_plugin__s2member_esc_ds ($sp_access_url), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"][(($_GET["s2member_paypal_proxy"] === "s2member-pro-module") ? "pro_" : "") . "sp_email_message"]);
140
  $msg = preg_replace ("/%%sp_access_exp%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_approx_time_difference (time (), strtotime ("+" . $paypal["hours"] . " hours"))), $msg);
141
  /**/
142
+ $rec = preg_replace ("/%%sp_access_url%%/i", ws_plugin__s2member_esc_ds ($sp_access_url), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"][(($_GET["s2member_paypal_proxy"] === "s2member-pro-module") ? "pro_" : "") . "sp_email_recipients"]);
143
+ $rec = preg_replace ("/%%sp_access_exp%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_approx_time_difference (time (), strtotime ("+" . $paypal["hours"] . " hours"))), $rec);
144
+ /**/
145
+ if (($rec = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $rec)) && ($rec = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds ($paypal["txn_id"]), $rec)))
146
+ if (($rec = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_gross"]), $rec))) /* Full amount of the payment, before fee is subtracted. */
147
+ if (($rec = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $rec)) && ($rec = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $rec)))
148
+ if (($rec = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_dq (ws_plugin__s2member_esc_ds ($paypal["first_name"])), $rec)) && ($rec = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_dq (ws_plugin__s2member_esc_ds ($paypal["last_name"])), $rec)))
149
+ if (($rec = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_dq (ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"]))), $rec))) /* **NOTE** ws_plugin__s2member_esc_dq() is applied here. ( ex. "N\"ame" <email> ). */
150
+ if (($rec = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $rec)))
151
+ if (($recipients = preg_split ("/;+/", $rec))) /* Here we break the recipients into an array. */
152
+ /**/
153
+ if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)) && ($sbj = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds ($paypal["txn_id"]), $sbj)))
154
+ if (($sbj = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_gross"]), $sbj))) /* Full amount of the payment, before fee is subtracted. */
155
+ if (($sbj = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $sbj)) && ($sbj = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $sbj)))
156
+ if (($sbj = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $sbj)) && ($sbj = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $sbj)))
157
+ if (($sbj = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $sbj)))
158
+ if (($sbj = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $sbj)))
159
+ /**/
160
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds ($paypal["txn_id"]), $msg)))
161
+ if (($msg = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_gross"]), $msg))) /* Full amount of the payment, before fee is subtracted. */
162
+ if (($msg = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $msg)) && ($msg = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $msg)))
163
+ if (($msg = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $msg)) && ($msg = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $msg)))
164
+ if (($msg = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $msg)))
165
+ if (($msg = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $msg)))
166
+ /**/
167
+ if (($sbj = trim ($sbj)) && ($msg = trim ($msg))) /* Make sure they are not empty. */
168
+ {
169
+ foreach (ws_plugin__s2member_trim_deep ($recipients) as $recipient) /* Go through the full list of recipients. */
170
+ /**/
171
+ ($recipient) ? mail ($recipient, $sbj, $msg, "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
172
+ /**/
173
+ $paypal["s2member_log"][] = "Specific Post/Page Confirmation Email sent to: " . implode ("; ", $recipients) . ".";
174
+ }
175
  /**/
176
  if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_notification_urls"])
177
  {
186
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
187
  /**/
188
  if (($url = trim ($url))) /* Empty? */
189
+ ws_plugin__s2member_remote($url);
190
  /**/
191
  $paypal["s2member_log"][] = "Specific Post/Page Access Notification URLs have been processed.";
192
  }
222
  }
223
  }
224
  /**/
225
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
226
  do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_access", get_defined_vars ());
227
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
228
  }
231
  $paypal["s2member_log"][] = "Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?";
232
  }
233
  /**/
234
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
235
  do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_access", get_defined_vars ());
236
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
237
  }
245
  && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/
246
  && $paypal["payer_email"]/**/)
247
  {
248
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
249
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup", get_defined_vars ());
250
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
251
  /**/
271
  /* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified. PayPal will not allow the
272
  modify=1|2 parameter to be used in those scenarios, because technically there is nothing to update. The only thing that actually needs to be updated is the account. */
273
  {
274
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
275
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_w_update_vars", get_defined_vars ());
276
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
277
  /**/
312
  /**/
313
  $paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
314
  /**/
315
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
316
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars", get_defined_vars ());
317
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
318
  }
326
  $paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB. Please check the on0 and os0 variables in your Button Code.";
327
  }
328
  /**/
329
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
330
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_w_update_vars", get_defined_vars ());
331
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
332
  }
335
  */
336
  else /* Else this is a normal Subscription signup, we are not updating anything. */
337
  {
338
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
339
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_wo_update_vars", get_defined_vars ());
340
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
341
  /**/
347
  /**/
348
  $sbj = preg_replace ("/%%registration_url%%/i", ws_plugin__s2member_esc_ds ($registration_url), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"][(($_GET["s2member_paypal_proxy"] === "s2member-pro-module") ? "pro_" : "") . "signup_email_subject"]);
349
  $msg = preg_replace ("/%%registration_url%%/i", ws_plugin__s2member_esc_ds ($registration_url), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"][(($_GET["s2member_paypal_proxy"] === "s2member-pro-module") ? "pro_" : "") . "signup_email_message"]);
350
+ $rec = preg_replace ("/%%registration_url%%/i", ws_plugin__s2member_esc_ds ($registration_url), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"][(($_GET["s2member_paypal_proxy"] === "s2member-pro-module") ? "pro_" : "") . "signup_email_recipients"]);
351
  /**/
352
+ if (($rec = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $rec)) && ($rec = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $rec)))
353
+ if (($rec = preg_replace ("/%%initial%%/i", ws_plugin__s2member_esc_ds ($paypal["initial"]), $rec)) && ($rec = preg_replace ("/%%regular%%/i", ws_plugin__s2member_esc_ds ($paypal["regular"]), $rec)))
354
+ if (($rec = preg_replace ("/%%initial_term%%/i", ws_plugin__s2member_esc_ds ($paypal["initial_term"]), $rec)) && ($rec = preg_replace ("/%%regular_term%%/i", ws_plugin__s2member_esc_ds ($paypal["regular_term"]), $rec)))
355
+ if (($rec = preg_replace ("/%%initial_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["initial_term"])), $rec)) && ($rec = preg_replace ("/%%regular_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"])), $rec)))
356
+ if (($rec = preg_replace ("/%%recurring%%/i", ws_plugin__s2member_esc_ds ($paypal["recurring"]), $rec)) && ($rec = preg_replace ("/%%recurring\/regular_cycle%%/i", ws_plugin__s2member_esc_ds ((($paypal["recurring"]) ? $paypal["recurring"] . " / " . ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"]) : "0 / non-recurring")), $rec)))
357
+ if (($rec = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $rec)) && ($rec = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $rec)))
358
+ if (($rec = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_dq (ws_plugin__s2member_esc_ds ($paypal["first_name"])), $rec)) && ($rec = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_dq (ws_plugin__s2member_esc_ds ($paypal["last_name"])), $rec)))
359
+ if (($rec = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_dq (ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"]))), $rec))) /* **NOTE** ws_plugin__s2member_esc_dq() is applied here. ( ex. "N\"ame" <email> ). */
360
+ if (($rec = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $rec)))
361
+ if (($recipients = preg_split ("/;+/", $rec))) /* Here we break the recipients into an array. */
362
+ /**/
363
+ if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)) && ($sbj = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $sbj)))
364
+ if (($sbj = preg_replace ("/%%initial%%/i", ws_plugin__s2member_esc_ds ($paypal["initial"]), $sbj)) && ($sbj = preg_replace ("/%%regular%%/i", ws_plugin__s2member_esc_ds ($paypal["regular"]), $sbj)))
365
+ if (($sbj = preg_replace ("/%%initial_term%%/i", ws_plugin__s2member_esc_ds ($paypal["initial_term"]), $sbj)) && ($sbj = preg_replace ("/%%regular_term%%/i", ws_plugin__s2member_esc_ds ($paypal["regular_term"]), $sbj)))
366
+ if (($sbj = preg_replace ("/%%initial_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["initial_term"])), $sbj)) && ($sbj = preg_replace ("/%%regular_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"])), $sbj)))
367
+ if (($sbj = preg_replace ("/%%recurring%%/i", ws_plugin__s2member_esc_ds ($paypal["recurring"]), $sbj)) && ($sbj = preg_replace ("/%%recurring\/regular_cycle%%/i", ws_plugin__s2member_esc_ds ((($paypal["recurring"]) ? $paypal["recurring"] . " / " . ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"]) : "0 / non-recurring")), $sbj)))
368
+ if (($sbj = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $sbj)) && ($sbj = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $sbj)))
369
+ if (($sbj = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $sbj)) && ($sbj = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $sbj)))
370
+ if (($sbj = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $sbj)))
371
+ if (($sbj = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $sbj)))
372
+ /**/
373
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $msg)))
374
+ if (($msg = preg_replace ("/%%initial%%/i", ws_plugin__s2member_esc_ds ($paypal["initial"]), $msg)) && ($msg = preg_replace ("/%%regular%%/i", ws_plugin__s2member_esc_ds ($paypal["regular"]), $msg)))
375
+ if (($msg = preg_replace ("/%%initial_term%%/i", ws_plugin__s2member_esc_ds ($paypal["initial_term"]), $msg)) && ($msg = preg_replace ("/%%regular_term%%/i", ws_plugin__s2member_esc_ds ($paypal["regular_term"]), $msg)))
376
+ if (($msg = preg_replace ("/%%initial_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["initial_term"])), $msg)) && ($msg = preg_replace ("/%%regular_cycle%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"])), $msg)))
377
+ if (($msg = preg_replace ("/%%recurring%%/i", ws_plugin__s2member_esc_ds ($paypal["recurring"]), $msg)) && ($msg = preg_replace ("/%%recurring\/regular_cycle%%/i", ws_plugin__s2member_esc_ds ((($paypal["recurring"]) ? $paypal["recurring"] . " / " . ws_plugin__s2member_paypal_term_cycle ($paypal["regular_term"]) : "0 / non-recurring")), $msg)))
378
+ if (($msg = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $msg)) && ($msg = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $msg)))
379
+ if (($msg = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $msg)) && ($msg = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $msg)))
380
+ if (($msg = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $msg)))
381
+ if (($msg = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $msg)))
382
+ /**/
383
+ if (($sbj = trim ($sbj)) && ($msg = trim ($msg))) /* Make sure they are not empty. */
384
+ {
385
+ foreach (ws_plugin__s2member_trim_deep ($recipients) as $recipient) /* Go through the full list of recipients. */
386
+ /**/
387
+ ($recipient) ? mail ($recipient, $sbj, $msg, "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
388
+ /**/
389
+ $paypal["s2member_log"][] = "Signup Confirmation Email sent to: " . implode ("; ", $recipients) . ".";
390
+ }
391
  /**/
392
  if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_notification_urls"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
393
  {
402
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
403
  /**/
404
  if (($url = trim ($url))) /* Empty? */
405
+ ws_plugin__s2member_remote($url);
406
  /**/
407
  $paypal["s2member_log"][] = "Signup Notification URLs have been processed.";
408
  }
424
  }
425
  }
426
  /**/
427
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
428
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars", get_defined_vars ());
429
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
430
  }
433
  $paypal["s2member_log"][] = "Unable to generate Registration URL for Membership Access. Possible data corruption within the IPN response.";
434
  }
435
  /**/
436
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
437
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_wo_update_vars", get_defined_vars ());
438
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
439
  }
467
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
468
  /**/
469
  if (($url = trim ($url))) /* Empty? */
470
+ ws_plugin__s2member_remote($url);
471
  /**/
472
  $paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
473
  }
474
  /**/
475
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
476
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
477
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
478
  }
489
  && ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/)
490
  /* The "payer_email" is not passed in: recurring_payment_profile_created ?? */
491
  {
492
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
493
  do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
494
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
495
  /**/
500
  $paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
501
  $paypal["s2member_log"][] = "s2Member Pro handles this event on-site, with an IPN proxy.";
502
  /**/
503
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
504
  do_action ("ws_plugin__s2member_during_paypal_notify_during_recurring_payment_profile_created", get_defined_vars ());
505
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
506
  /**/
507
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
508
  do_action ("ws_plugin__s2member_during_paypal_notify_after_recurring_payment_profile_created", get_defined_vars ());
509
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
510
  }
515
  && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/
516
  && $paypal["subscr_id"] && $paypal["payer_email"]/**/)
517
  {
518
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
519
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_modify", get_defined_vars ());
520
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
521
  /**/
553
  /**/
554
  $paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
555
  /**/
556
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
557
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_modify", get_defined_vars ());
558
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
559
  }
567
  $paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
568
  }
569
  /**/
570
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
571
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_modify", get_defined_vars ());
572
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
573
  }
582
  && ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
583
  && $paypal["payer_email"] && $paypal["txn_id"] && $paypal["mc_gross"]/**/)
584
  {
585
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
586
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_payment", get_defined_vars ());
587
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
588
  /**/
589
  $paypal["s2member_log"][] = "s2Member txn_type identified as subscr_payment|recurring_payment.";
590
  $paypal["s2member_log"][] = "Sleeping for 2 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
591
+ sleep(2); /* Sleep here for a moment. PayPal® sometimes sends a subscr_payment before the subscr_signup, subscr_modify.
592
+ It is NOT a big deal if they do. However, s2Member goes to sleep here, just to help keep the log files in a logical order. */
593
  $paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as subscr_payment|recurring_payment.";
594
  /**/
595
  list ($paypal["level"], $paypal["ccaps"]) = preg_split ("/\:/", $paypal["item_number"], 2);
614
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
615
  /**/
616
  if (($url = trim ($url))) /* Empty? */
617
+ ws_plugin__s2member_remote($url);
618
  /**/
619
  $paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
620
  }
621
  /**/
622
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
623
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
624
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
625
  }
630
  set_transient (md5 ("s2member_transient_ipn_subscr_payment_" . $paypal["subscr_id"]), $_POST, 43200);
631
  }
632
  /**/
633
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
634
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_payment", get_defined_vars ());
635
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
636
  }
647
  && ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
648
  && $paypal["payer_email"]/**/)
649
  {
650
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
651
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_failed", get_defined_vars ());
652
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
653
  /**/
659
  $paypal["s2member_log"][] = "s2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.";
660
  $paypal["s2member_log"][] = "When multiple consecutive payments fail, a special IPN response will be triggered.";
661
  /**/
662
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
663
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_failed", get_defined_vars ());
664
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
665
  /**/
666
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
667
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_failed", get_defined_vars ());
668
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
669
  }
682
  && ($paypal["period3"] || ($paypal["period3"] = ws_plugin__s2member_paypal_pro_period3 ($paypal)))/**/
683
  && $paypal["payer_email"]/**/)
684
  {
685
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
686
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_cancel", get_defined_vars ());
687
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
688
  /**/
702
  /**/
703
  $paypal["s2member_log"][] = "Auto-EOT Time for this account: " . date ("D M j, Y g:i a T", $auto_eot_time);
704
  /**/
705
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
706
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_cancel", get_defined_vars ());
707
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
708
  }
716
  $paypal["s2member_log"][] = "Unable to handle Cancellation. Could not get the existing User ID from the DB.";
717
  }
718
  /**/
719
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
720
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_cancel", get_defined_vars ());
721
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
722
  }
732
  && ($paypal["item_number"] || ($paypal["item_number"] = ws_plugin__s2member_paypal_pro_item_number ($paypal)))/**/
733
  && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/)
734
  {
735
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
736
  do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
737
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
738
  /**/
779
  if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
780
  /**/
781
  if (($url = trim ($url))) /* Empty? */
782
+ ws_plugin__s2member_remote($url);
783
  /**/
784
  $paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
785
  }
786
  /**/
787
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
788
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
789
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
790
  }
792
  {
793
  $processing = $during = true; /* Yes, we ARE processing this. */
794
  /**/
795
+ wp_delete_user($user_id); /* Triggers: `ws_plugin__s2member_handle_user_deletions()` */
796
  /* `ws_plugin__s2member_handle_user_deletions()` triggers `eot_del_notification_urls` */
797
  /**/
798
  $paypal["s2member_log"][] = "The Member's account has been deleted completely.";
799
  /**/
800
  $paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
801
  /**/
802
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
803
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delete", get_defined_vars ());
804
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
805
  }
806
  /**/
807
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
808
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot", get_defined_vars ());
809
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
810
  }
818
  $paypal["s2member_log"][] = "Auto-EOT is currently disabled. Skipping immediate EOT (demote|delete), for now.";
819
  $paypal["s2member_log"][] = "Recording the Auto-EOT Time for this Member's account: " . date ("D M j, Y g:i a T", $auto_eot_time);
820
  /**/
821
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
822
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_disabled", get_defined_vars ());
823
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
824
  }
857
  if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
858
  /**/
859
  if (($url = trim ($url))) /* Empty? */
860
+ ws_plugin__s2member_remote($url);
861
  /**/
862
  $paypal["s2member_log"][] = "Refund/Reversal Notification URLs have been processed.";
863
  }
864
  /**/
865
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
866
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
867
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
868
  }
869
  /**/
870
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
871
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_eot", get_defined_vars ());
872
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
873
  }
924
  if (is_writable ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
925
  file_put_contents ($logs_dir . "/paypal-ipn.log", var_export ($paypal, true) . "\n\n", FILE_APPEND);
926
  /**/
927
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
928
  do_action ("ws_plugin__s2member_during_paypal_notify", get_defined_vars ());
929
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
930
  /**/
931
+ exit($paypal["proxy_return_url"]); /* Return, if/when applicable. */
932
  }
933
  /**/
934
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
935
  do_action ("ws_plugin__s2member_after_paypal_notify", get_defined_vars ());
936
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
937
  }
includes/functions/paypal-utilities.inc.php CHANGED
@@ -71,6 +71,10 @@ if (!function_exists ("ws_plugin__s2member_paypal_postvars"))
71
  {
72
  return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
73
  }
 
 
 
 
74
  else if (strtolower (trim (ws_plugin__s2member_remote ("https://" . $endpoint . "/cgi-bin/webscr", $postback))) === "verified")
75
  {
76
  return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
71
  {
72
  return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
73
  }
74
+ else if ($_GET["s2member_paypal_proxy"] && $_GET["s2member_paypal_proxy_verification"] === md5 (ws_plugin__s2member_xencrypt ($_SERVER["HTTP_HOST"])))
75
+ {
76
+ return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
77
+ }
78
  else if (strtolower (trim (ws_plugin__s2member_remote ("https://" . $endpoint . "/cgi-bin/webscr", $postback))) === "verified")
79
  {
80
  return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
includes/functions/post-level-access.inc.php CHANGED
@@ -29,9 +29,9 @@ if (!function_exists ("ws_plugin__s2member_check_post_level_access"))
29
  /**/
30
  if (!$excluded && is_single () && !is_page () && is_object ($post) && ($post_ID = $post->ID))
31
  {
32
- if (!ws_plugin__s2member_is_systematic_use_page ()) /* Never restrict systematic use pages. */
33
  {
34
- $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false;
35
  /**/
36
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_posts"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
37
  exit ();
29
  /**/
30
  if (!$excluded && is_single () && !is_page () && is_object ($post) && ($post_ID = $post->ID))
31
  {
32
+ if (!ws_plugin__s2member_is_systematic_use_page () && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
33
  {
34
+ $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
35
  /**/
36
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_posts"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && wp_redirect (add_query_arg ("s2member_level_req", "0", get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
37
  exit ();
includes/functions/ptag-level-access.inc.php CHANGED
@@ -29,9 +29,9 @@ if (!function_exists ("ws_plugin__s2member_check_ptag_level_access"))
29
  /**/
30
  if (!$excluded && ((is_tag () && ($tag_ID = get_query_var ("tag"))) || (is_single () && has_tag () && is_object ($post) && ($post_ID = $post->ID))))
31
  {
32
- if (!ws_plugin__s2member_is_systematic_use_page ()) /* Never restrict systematic use pages. */
33
  {
34
- $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false;
35
  /**/
36
  if (is_tag () && $tag_ID) /* We also check if this is a post or page with tags, having a restricted tag. */
37
  {
29
  /**/
30
  if (!$excluded && ((is_tag () && ($tag_ID = get_query_var ("tag"))) || (is_single () && has_tag () && is_object ($post) && ($post_ID = $post->ID))))
31
  {
32
+ if (!ws_plugin__s2member_is_systematic_use_page () && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
33
  {
34
+ $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
35
  /**/
36
  if (is_tag () && $tag_ID) /* We also check if this is a post or page with tags, having a restricted tag. */
37
  {
includes/functions/register-access.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit("Do not access this file directly.");
16
  /*
17
  Forces a default Role for new registrations not tied to an incoming payment.
18
  Attach to: add_filter("pre_option_default_role");
@@ -34,25 +34,23 @@ if (!function_exists ("ws_plugin__s2member_check_register_access"))
34
  {
35
  function ws_plugin__s2member_check_register_access ($users_can_register = FALSE)
36
  {
37
- global $pagenow; /* Check if we are on the General Options page. */
38
  /**/
 
39
  do_action ("ws_plugin__s2member_before_check_register_access", get_defined_vars ());
 
40
  /**/
41
- if (current_user_can ("create_users") || $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"])
42
- {
43
- return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "1"), get_defined_vars ());
44
- }
45
- else if ($pagenow !== "options-general.php" && ($subscr_id = ws_plugin__s2member_decrypt ($_COOKIE["s2member_subscr_id"])) && ($custom = ws_plugin__s2member_decrypt ($_COOKIE["s2member_custom"])) && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", ($level = ws_plugin__s2member_decrypt ($_COOKIE["s2member_level"]))))
46
  {
47
- global $wpdb; /* Global database object reference. */
48
- /**/
49
- if (!$usermeta = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 's2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))
50
  {
51
  return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "1"), get_defined_vars ());
52
  }
53
  }
54
  /**/
55
- return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "0"), get_defined_vars ());
56
  }
57
  }
58
  /*
@@ -95,13 +93,13 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
95
  /**/
96
  $tabindex = 20; /* Incremented tabindex starting with 20. */
97
  /**/
98
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
99
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before", get_defined_vars ());
100
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
101
  /**/
102
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"] && function_exists ("ws_plugin__s2member_generate_password"))
103
  {
104
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
105
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_user_pass", get_defined_vars ());
106
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
107
  /**/
@@ -112,12 +110,12 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
112
  echo '</label>' . "\n";
113
  echo '</p>';
114
  /**/
115
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
116
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_user_pass", get_defined_vars ());
117
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
118
  }
119
  /**/
120
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
121
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_first_name", get_defined_vars ());
122
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
123
  /**/
@@ -128,11 +126,11 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
128
  echo '</label>' . "\n";
129
  echo '</p>';
130
  /**/
131
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
132
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_first_name", get_defined_vars ());
133
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
134
  /**/
135
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
136
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_last_name", get_defined_vars ());
137
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
138
  /**/
@@ -143,7 +141,7 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
143
  echo '</label>' . "\n";
144
  echo '</p>';
145
  /**/
146
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
147
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_last_name", get_defined_vars ());
148
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
149
  /**/
@@ -154,7 +152,7 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
154
  /**/
155
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
156
  {
157
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
158
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_custom_fields", get_defined_vars ());
159
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
160
  /**/
@@ -168,7 +166,7 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
168
  echo '</label>' . "\n";
169
  echo '</p>';
170
  /**/
171
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
172
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_custom_fields", get_defined_vars ());
173
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
174
  }
@@ -176,7 +174,7 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
176
  /**/
177
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && ws_plugin__s2member_list_servers_integrated ())
178
  {
179
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
180
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_opt_in", get_defined_vars ());
181
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
182
  /**/
@@ -187,16 +185,16 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
187
  echo '</label>' . "\n";
188
  echo '</p>';
189
  /**/
190
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
191
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_opt_in", get_defined_vars ());
192
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
193
  }
194
  /**/
195
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
196
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after", get_defined_vars ());
197
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
198
  /**/
199
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
200
  do_action ("ws_plugin__s2member_after_custom_registration_fields", get_defined_vars ());
201
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
202
  /**/
@@ -243,7 +241,7 @@ if (!function_exists ("ws_plugin__s2member_register_link_gen"))
243
  {
244
  function ws_plugin__s2member_register_link_gen ($subscr_id = FALSE, $custom = FALSE, $item_number = FALSE, $shrink = TRUE)
245
  {
246
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
247
  do_action ("ws_plugin__s2member_before_register_link_gen", get_defined_vars ());
248
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
249
  /**/
@@ -311,7 +309,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
311
  global $wpdb; /* Global database object may be required for this routine. */
312
  static $processed; /* Prevents duplicate processing. */
313
  /**/
314
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
315
  do_action ("ws_plugin__s2member_before_configure_user_registration", get_defined_vars ());
316
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
317
  /**/
@@ -364,12 +362,12 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
364
  {
365
  $proxy = array ("s2member_paypal_notify" => "1", "s2member_paypal_proxy" => "s2member_transient_ipn_subscr_payment");
366
  ws_plugin__s2member_remote (add_query_arg ($proxy, get_bloginfo ("url")), stripslashes_deep ($subscr_payment));
367
- delete_transient($transient);
368
  }
369
  /**/
370
  setcookie ("s2member_signup_tracking", ws_plugin__s2member_encrypt ($subscr_id), time () + 31556926, "/");
371
  /**/
372
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
373
  do_action ("ws_plugin__s2member_during_configure_user_registration_front_side", get_defined_vars ());
374
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
375
  }
@@ -399,7 +397,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
399
  /**/
400
  $opt_in = (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] || $_POST["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : false;
401
  /**/
402
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
403
  do_action ("ws_plugin__s2member_during_configure_user_registration_front_side", get_defined_vars ());
404
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
405
  }
@@ -429,7 +427,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
429
  /**/
430
  $opt_in = (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] || $_POST["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : false;
431
  /**/
432
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
433
  do_action ("ws_plugin__s2member_during_configure_user_registration_admin_side", get_defined_vars ());
434
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
435
  }
@@ -470,7 +468,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
470
  if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
471
  if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
472
  if (($url = trim ($url))) /* Empty? */
473
- ws_plugin__s2member_remote($url);
474
  /**/
475
  if ($url = $GLOBALS["ws_plugin__s2member_registration_return_url"])
476
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
@@ -488,13 +486,13 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
488
  setcookie ("s2member_custom", "", time () + 31556926, "/");
489
  setcookie ("s2member_level", "", time () + 31556926, "/");
490
  /**/
491
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
492
  do_action ("ws_plugin__s2member_during_configure_user_registration", get_defined_vars ());
493
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
494
  }
495
  }
496
  /**/
497
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
498
  do_action ("ws_plugin__s2member_after_configure_user_registration", get_defined_vars ());
499
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
500
  /**/
@@ -518,7 +516,7 @@ if (!function_exists ("wp_generate_password"))
518
  {
519
  $password = ws_plugin__s2member_random_str_gen ($length, $special_chars);
520
  /**/
521
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
522
  do_action ("ws_plugin__s2member_before_generate_password", get_defined_vars ());
523
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
524
  /**/
@@ -554,7 +552,7 @@ if (!function_exists ("ws_plugin__s2member_demo_hide_password_fields"))
554
  {
555
  function ws_plugin__s2member_demo_hide_password_fields ($show = TRUE, $profileuser = FALSE)
556
  {
557
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
558
  do_action ("ws_plugin__s2member_before_demo_hide_password_fields", get_defined_vars ());
559
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
560
  /**/
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
  /*
17
  Forces a default Role for new registrations not tied to an incoming payment.
18
  Attach to: add_filter("pre_option_default_role");
34
  {
35
  function ws_plugin__s2member_check_register_access ($users_can_register = FALSE)
36
  {
37
+ global $wpdb, $pagenow; /* So we can see if we're on the options page. */
38
  /**/
39
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
40
  do_action ("ws_plugin__s2member_before_check_register_access", get_defined_vars ());
41
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
42
  /**/
43
+ $users_can_register = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"];
44
+ /**/
45
+ if ($pagenow !== "options-general.php") /* Do NOT run these particular security checks on the options page; it becomes confusing to a site owner. */
 
 
46
  {
47
+ if ($users_can_register || current_user_can ("create_users") || (($subscr_id = ws_plugin__s2member_decrypt ($_COOKIE["s2member_subscr_id"])) && ($custom = ws_plugin__s2member_decrypt ($_COOKIE["s2member_custom"])) && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", ($level = ws_plugin__s2member_decrypt ($_COOKIE["s2member_level"]))) && !($exists = $wpdb->get_var ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 's2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))))
 
 
48
  {
49
  return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "1"), get_defined_vars ());
50
  }
51
  }
52
  /**/
53
+ return apply_filters ("ws_plugin__s2member_check_register_access", $users_can_register, get_defined_vars ());
54
  }
55
  }
56
  /*
93
  /**/
94
  $tabindex = 20; /* Incremented tabindex starting with 20. */
95
  /**/
96
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
97
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before", get_defined_vars ());
98
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
99
  /**/
100
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"] && function_exists ("ws_plugin__s2member_generate_password"))
101
  {
102
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
103
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_user_pass", get_defined_vars ());
104
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
105
  /**/
110
  echo '</label>' . "\n";
111
  echo '</p>';
112
  /**/
113
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
114
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_user_pass", get_defined_vars ());
115
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
116
  }
117
  /**/
118
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
119
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_first_name", get_defined_vars ());
120
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
121
  /**/
126
  echo '</label>' . "\n";
127
  echo '</p>';
128
  /**/
129
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
130
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_first_name", get_defined_vars ());
131
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
132
  /**/
133
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
134
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_last_name", get_defined_vars ());
135
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
136
  /**/
141
  echo '</label>' . "\n";
142
  echo '</p>';
143
  /**/
144
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
145
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_last_name", get_defined_vars ());
146
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
147
  /**/
152
  /**/
153
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
154
  {
155
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
156
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_custom_fields", get_defined_vars ());
157
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
158
  /**/
166
  echo '</label>' . "\n";
167
  echo '</p>';
168
  /**/
169
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
170
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_custom_fields", get_defined_vars ());
171
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
172
  }
174
  /**/
175
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && ws_plugin__s2member_list_servers_integrated ())
176
  {
177
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
178
  do_action ("ws_plugin__s2member_during_custom_registration_fields_before_opt_in", get_defined_vars ());
179
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
180
  /**/
185
  echo '</label>' . "\n";
186
  echo '</p>';
187
  /**/
188
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
189
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after_opt_in", get_defined_vars ());
190
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
191
  }
192
  /**/
193
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
194
  do_action ("ws_plugin__s2member_during_custom_registration_fields_after", get_defined_vars ());
195
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
196
  /**/
197
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
198
  do_action ("ws_plugin__s2member_after_custom_registration_fields", get_defined_vars ());
199
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
200
  /**/
241
  {
242
  function ws_plugin__s2member_register_link_gen ($subscr_id = FALSE, $custom = FALSE, $item_number = FALSE, $shrink = TRUE)
243
  {
244
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
245
  do_action ("ws_plugin__s2member_before_register_link_gen", get_defined_vars ());
246
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
247
  /**/
309
  global $wpdb; /* Global database object may be required for this routine. */
310
  static $processed; /* Prevents duplicate processing. */
311
  /**/
312
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
313
  do_action ("ws_plugin__s2member_before_configure_user_registration", get_defined_vars ());
314
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
315
  /**/
362
  {
363
  $proxy = array ("s2member_paypal_notify" => "1", "s2member_paypal_proxy" => "s2member_transient_ipn_subscr_payment");
364
  ws_plugin__s2member_remote (add_query_arg ($proxy, get_bloginfo ("url")), stripslashes_deep ($subscr_payment));
365
+ delete_transient ($transient);
366
  }
367
  /**/
368
  setcookie ("s2member_signup_tracking", ws_plugin__s2member_encrypt ($subscr_id), time () + 31556926, "/");
369
  /**/
370
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
371
  do_action ("ws_plugin__s2member_during_configure_user_registration_front_side", get_defined_vars ());
372
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
373
  }
397
  /**/
398
  $opt_in = (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] || $_POST["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : false;
399
  /**/
400
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
401
  do_action ("ws_plugin__s2member_during_configure_user_registration_front_side", get_defined_vars ());
402
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
403
  }
427
  /**/
428
  $opt_in = (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] || $_POST["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : false;
429
  /**/
430
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
431
  do_action ("ws_plugin__s2member_during_configure_user_registration_admin_side", get_defined_vars ());
432
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
433
  }
468
  if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
469
  if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
470
  if (($url = trim ($url))) /* Empty? */
471
+ ws_plugin__s2member_remote ($url);
472
  /**/
473
  if ($url = $GLOBALS["ws_plugin__s2member_registration_return_url"])
474
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
486
  setcookie ("s2member_custom", "", time () + 31556926, "/");
487
  setcookie ("s2member_level", "", time () + 31556926, "/");
488
  /**/
489
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
490
  do_action ("ws_plugin__s2member_during_configure_user_registration", get_defined_vars ());
491
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
492
  }
493
  }
494
  /**/
495
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
496
  do_action ("ws_plugin__s2member_after_configure_user_registration", get_defined_vars ());
497
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
498
  /**/
516
  {
517
  $password = ws_plugin__s2member_random_str_gen ($length, $special_chars);
518
  /**/
519
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
520
  do_action ("ws_plugin__s2member_before_generate_password", get_defined_vars ());
521
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
522
  /**/
552
  {
553
  function ws_plugin__s2member_demo_hide_password_fields ($show = TRUE, $profileuser = FALSE)
554
  {
555
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
556
  do_action ("ws_plugin__s2member_before_demo_hide_password_fields", get_defined_vars ());
557
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
558
  /**/
includes/functions/ruri-level-access.inc.php CHANGED
@@ -25,9 +25,9 @@ if (!function_exists ("ws_plugin__s2member_check_ruri_level_access"))
25
  /**/
26
  $excluded = apply_filters ("ws_plugin__s2member_check_ruri_level_access_excluded", false, get_defined_vars ());
27
  /**/
28
- if (!$excluded && !ws_plugin__s2member_is_systematic_use_page ()) /* Never restrict systematic use pages. */
29
  {
30
- $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Is a user logged in? */
31
  /**/
32
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_ruris"])
33
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_ruris"], $current_user)) as $str)
@@ -73,11 +73,13 @@ if (!function_exists ("ws_plugin__s2member_fill_ruri_level_access_rc_vars"))
73
  do_action ("ws_plugin__s2member_before_fill_ruri_level_access_rc_vars", get_defined_vars ());
74
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
75
  /**/
 
76
  $current_user_login = (is_object ($current_user)) ? strtolower ($current_user->user_login) : "";
77
  $current_user_ID = (is_object ($current_user)) ? (string)$current_user->ID : "";
78
  /**/
79
  $uris = preg_replace ("/%%current_user_login%%/i", ws_plugin__s2member_esc_ds ($current_user_login), $uris);
80
  $uris = preg_replace ("/%%current_user_ID%%/i", ws_plugin__s2member_esc_ds ($current_user_ID), $uris);
 
81
  /**/
82
  return apply_filters ("ws_plugin__s2member_fill_ruri_level_access_rc_vars", $uris, get_defined_vars ());
83
  }
25
  /**/
26
  $excluded = apply_filters ("ws_plugin__s2member_check_ruri_level_access_excluded", false, get_defined_vars ());
27
  /**/
28
+ if (!$excluded && !ws_plugin__s2member_is_systematic_use_page () && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
29
  {
30
+ $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
31
  /**/
32
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_ruris"])
33
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_ruris"], $current_user)) as $str)
73
  do_action ("ws_plugin__s2member_before_fill_ruri_level_access_rc_vars", get_defined_vars ());
74
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
75
  /**/
76
+ $current_user = (is_object ($current_user)) ? $current_user : wp_get_current_user ();
77
  $current_user_login = (is_object ($current_user)) ? strtolower ($current_user->user_login) : "";
78
  $current_user_ID = (is_object ($current_user)) ? (string)$current_user->ID : "";
79
  /**/
80
  $uris = preg_replace ("/%%current_user_login%%/i", ws_plugin__s2member_esc_ds ($current_user_login), $uris);
81
  $uris = preg_replace ("/%%current_user_ID%%/i", ws_plugin__s2member_esc_ds ($current_user_ID), $uris);
82
+ $uris = preg_replace ("/%%current_user_level%%/i", (string)ws_plugin__s2member_user_access_level (), $uris);
83
  /**/
84
  return apply_filters ("ws_plugin__s2member_fill_ruri_level_access_rc_vars", $uris, get_defined_vars ());
85
  }
includes/hooks.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit ("Do not access this file directly.");
16
  /*
17
  Add the plugin actions/filters here.
18
  */
@@ -32,7 +32,9 @@ add_action ("init", "ws_plugin__s2member_delete_sp_tracking_cookie");
32
  add_action ("init", "ws_plugin__s2member_auto_eot_system_via_cron");
33
  /**/
34
  add_action ("template_redirect", "ws_plugin__s2member_profile");
 
35
  add_action ("template_redirect", "ws_plugin__s2member_check_force_ssl");
 
36
  add_action ("template_redirect", "ws_plugin__s2member_check_ruri_level_access", 1);
37
  add_action ("template_redirect", "ws_plugin__s2member_check_catg_level_access", 1);
38
  add_action ("template_redirect", "ws_plugin__s2member_check_ptag_level_access", 1);
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit("Do not access this file directly.");
16
  /*
17
  Add the plugin actions/filters here.
18
  */
32
  add_action ("init", "ws_plugin__s2member_auto_eot_system_via_cron");
33
  /**/
34
  add_action ("template_redirect", "ws_plugin__s2member_profile");
35
+ add_action ("template_redirect", "ws_plugin__s2member_membership_options_page");
36
  add_action ("template_redirect", "ws_plugin__s2member_check_force_ssl");
37
+ /**/
38
  add_action ("template_redirect", "ws_plugin__s2member_check_ruri_level_access", 1);
39
  add_action ("template_redirect", "ws_plugin__s2member_check_catg_level_access", 1);
40
  add_action ("template_redirect", "ws_plugin__s2member_check_ptag_level_access", 1);
includes/menu-pages/bridges.inc.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
+ /*
17
+ API Scripting page.
18
+ */
19
+ echo '<div class="wrap ws-menu-page">' . "\n";
20
+ /**/
21
+ echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
22
+ echo '<h2><div>Developed by <a href="' . ws_plugin__s2member_parse_readme_value ("Plugin URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-light.png" alt="." /></a></div>s2Member Bridge Integrations</h2>' . "\n";
23
+ /**/
24
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
25
+ /**/
26
+ echo '<table class="ws-menu-page-table">' . "\n";
27
+ echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
28
+ echo '<tr class="ws-menu-page-table-tr">' . "\n";
29
+ echo '<td class="ws-menu-page-table-l">' . "\n";
30
+ /**/
31
+ do_action ("ws_plugin__s2member_during_bridges_page_before_left_sections", get_defined_vars ());
32
+ /**/
33
+ if (apply_filters ("ws_plugin__s2member_during_bridges_page_during_left_sections_display_bbpress", true, get_defined_vars ()))
34
+ {
35
+ do_action ("ws_plugin__s2member_during_bridges_page_during_left_sections_before_bbpress", get_defined_vars ());
36
+ /**/
37
+ echo '<div class="ws-menu-page-group" title="bbPress® Bridge Integration">' . "\n";
38
+ /**/
39
+ echo '<div class="ws-menu-page-section ws-plugin--s2member-bbpress-section">' . "\n";
40
+ echo '<h3>bbPress® Bridge Integration ( install/uninstall )</h3>' . "\n";
41
+ echo '<p>If you\'re running <a href="http://bbpress.org/" target="_blank" rel="external">bbPress® forums</a>, you can protect them with the s2Member plugin. BUT, you will need to install this Bridge/plugin first. This bbPress® Bridge/plugin will block all non-Member access to your forums. Only the bbPress® login-page will be available. Forum registration will be redirected to your Membership Options Page for s2Member ( on your main WordPress® installation ). This way, a visitor can signup on your site, and gain Membership Access to your forums.</p>' . "\n";
42
+ echo '<p><em>* This Bridge/plugin will NOT work, until you\'ve successfully integrated WordPress® into bbPress®. For more information, log into your bbPress® Dashboard, and go to: <code>bbPress® -> Settings -> WordPress® Integration</code>. Once you have WordPress® integrated, come back here, and install the s2Member Bridge/plugin. * This Bridge Integration can also be installed manually. You\'ll find the bbPress® Bridge/plugin inside <code>/s2member/includes/dropins/bridges/_s2member-bbpress-bridge.php</code>. Pop that file into the `my-plugins/` directory for bbPress®.</em></p>' . "\n";
43
+ do_action ("ws_plugin__s2member_during_bridges_page_during_left_sections_during_api_easy_way", get_defined_vars ());
44
+ /**/
45
+ echo '<table class="form-table">' . "\n";
46
+ echo '<tbody>' . "\n";
47
+ echo '<tr>' . "\n";
48
+ /**/
49
+ echo '<th>' . "\n";
50
+ echo '<label for="ws_plugin--s2member-bridge-bbpress-plugins-dir">' . "\n";
51
+ echo 'Server path to your bbPress® plugins directory:' . "\n";
52
+ echo '</label>' . "\n";
53
+ echo '</th>' . "\n";
54
+ /**/
55
+ echo '</tr>' . "\n";
56
+ echo '<tr>' . "\n";
57
+ /**/
58
+ echo '<td>' . "\n";
59
+ echo '<form method="post" name="ws_plugin__s2member_bridge_bbpress_form" id="ws-plugin--s2member-bridge-bbpress-form">' . "\n";
60
+ echo '<input type="hidden" name="ws_plugin__s2member_bridge_bbpress" id="ws-plugin--s2member-bridge-bbpress" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-bridge-bbpress")) . '" />' . "\n";
61
+ /**/
62
+ echo '<input type="text" name="ws_plugin__s2member_bridge_bbpress_plugins_dir" id="ws_plugin--s2member-bridge-bbpress-plugins-dir" value="' . format_to_edit (trim (stripslashes ($_POST["ws_plugin__s2member_bridge_bbpress_plugins_dir"]))) . '" style="width:99%;" /><br />' . "\n";
63
+ echo 'Best guess: <code>' . esc_html ($_bridge_bbpress_plugins_dir_guess) . '</code><br /><br />' . "\n";
64
+ /**/
65
+ echo 'Minimum Level required for access to your bbPress® forums.<br />' . "\n";
66
+ echo '<select name="ws_plugin__s2member_bridge_bbpress_min_level" id="ws-plugin--s2member-bbpress-min-level" style="width:99%;">' . "\n";
67
+ echo '<option value=""' . ((!strlen ($_POST["ws_plugin__s2member_bridge_bbpress_min_level"])) ? ' selected="selected"' : '') . '></option>' . "\n";
68
+ echo '<option value="0"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "0") ? ' selected="selected"' : '') . '>s2Member Level 0</option>' . "\n";
69
+ echo '<option value="1"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "1") ? ' selected="selected"' : '') . '>s2Member Level 1</option>' . "\n";
70
+ echo '<option value="2"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "2") ? ' selected="selected"' : '') . '>s2Member Level 2</option>' . "\n";
71
+ echo '<option value="3"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "3") ? ' selected="selected"' : '') . '>s2Member Level 3</option>' . "\n";
72
+ echo '<option value="4"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "4") ? ' selected="selected"' : '') . '>s2Member Level 4</option>' . "\n";
73
+ echo '</select><br /><br />' . "\n";
74
+ /**/
75
+ echo '<p class="submit"><input type="submit" name="ws_plugin__s2member_bridge_bbpress_action" class="button-primary" value="Install / Re-Install" /> &nbsp;&nbsp; <input type="submit" name="ws_plugin__s2member_bridge_bbpress_action" class="button-primary" value="Un-Install" /></p>' . "\n";
76
+ echo '</form>' . "\n";
77
+ echo '</td>' . "\n";
78
+ /**/
79
+ echo '</tr>' . "\n";
80
+ echo '</tbody>' . "\n";
81
+ echo '</table>' . "\n";
82
+ echo '</div>' . "\n";
83
+ /**/
84
+ echo '</div>' . "\n";
85
+ /**/
86
+ do_action ("ws_plugin__s2member_during_bridges_page_during_left_sections_after_bbpress", get_defined_vars ());
87
+ }
88
+ /**/
89
+ do_action ("ws_plugin__s2member_during_bridges_page_after_left_sections", get_defined_vars ());
90
+ /**/
91
+ echo '</td>' . "\n";
92
+ /**/
93
+ echo '<td class="ws-menu-page-table-r">' . "\n";
94
+ /**/
95
+ do_action ("ws_plugin__s2member_during_bridges_page_before_right_sections", get_defined_vars ());
96
+ do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
97
+ /**/
98
+ echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Licensing") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
99
+ echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
100
+ echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
101
+ echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
102
+ echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["donations"]) ? '<div class="ws-menu-page-donations"><a href="' . ws_plugin__s2member_parse_readme_value ("Donate link") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-donations.jpg" alt="." /></a></div>' . "\n" : '';
103
+ /**/
104
+ do_action ("ws_plugin__s2member_during_menu_pages_after_right_sections", get_defined_vars ());
105
+ do_action ("ws_plugin__s2member_during_bridges_page_after_right_sections", get_defined_vars ());
106
+ /**/
107
+ echo '</td>' . "\n";
108
+ /**/
109
+ echo '</tr>' . "\n";
110
+ echo '</tbody>' . "\n";
111
+ echo '</table>' . "\n";
112
+ /**/
113
+ echo '</div>' . "\n";
114
+ ?>
includes/menu-pages/down-ops.inc.php CHANGED
@@ -235,7 +235,7 @@ if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_section
235
  echo '<div class="ws-menu-page-section ws-plugin--s2member-inline-extensions-section">' . "\n";
236
  echo '<h3>Inline File Extensions ( optional, for content-disposition )</h3>' . "\n";
237
  echo '<p>There are two ways to serve files. Inline, or as an Attachment. By default, s2Member will serve all of your protected Files, as downloadable attachments. Meaning, visitors will be given a File Download Prompt. Otherwise known as <code>Content-Disposition: attachment</code>. In some cases though, you may wish to serve files Inline. For example, PDF files and images should usually be served Inline. When you serve a file Inline, it is displayed in your browser immediately, rather than your browser prompting you to download the file as an attachment.</p>' . "\n";
238
- echo '<p>Using the field below, you can list all of the extensions that you want s2Member to serve Inline ( ex: <code>pdf,jpg,jpeg,jpe,gif,png</code> ). Please understand, some files just cannot be displayed inline. For instance, there is no way to display an <code>exe</code> file inline. So only specify extensions that can, and should be displayed inline by a web browser.</p>' . "\n";
239
  do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_inline_extensions", get_defined_vars ());
240
  /**/
241
  echo '<table class="form-table">' . "\n";
@@ -253,7 +253,7 @@ if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_section
253
  /**/
254
  echo '<td>' . "\n";
255
  echo '<input type="text" name="ws_plugin__s2member_file_download_inline_extensions" id="ws-plugin--s2member-file-download-inline-extensions" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]) . '" /><br />' . "\n";
256
- echo 'Inline extensions in comma delimited format. Example: <code>pdf,jpg,jpeg,jpe,gif,png</code>.' . "\n";
257
  echo '</td>' . "\n";
258
  /**/
259
  echo '</tr>' . "\n";
235
  echo '<div class="ws-menu-page-section ws-plugin--s2member-inline-extensions-section">' . "\n";
236
  echo '<h3>Inline File Extensions ( optional, for content-disposition )</h3>' . "\n";
237
  echo '<p>There are two ways to serve files. Inline, or as an Attachment. By default, s2Member will serve all of your protected Files, as downloadable attachments. Meaning, visitors will be given a File Download Prompt. Otherwise known as <code>Content-Disposition: attachment</code>. In some cases though, you may wish to serve files Inline. For example, PDF files and images should usually be served Inline. When you serve a file Inline, it is displayed in your browser immediately, rather than your browser prompting you to download the file as an attachment.</p>' . "\n";
238
+ echo '<p>Using the field below, you can list all of the extensions that you want s2Member to serve Inline ( ex: <code>htm,html,pdf,jpg,jpeg,jpe,gif,png</code> ). Please understand, some files just cannot be displayed inline. For instance, there is no way to display an <code>exe</code> file inline. So only specify extensions that can, and should be displayed inline by a web browser.</p>' . "\n";
239
  do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_inline_extensions", get_defined_vars ());
240
  /**/
241
  echo '<table class="form-table">' . "\n";
253
  /**/
254
  echo '<td>' . "\n";
255
  echo '<input type="text" name="ws_plugin__s2member_file_download_inline_extensions" id="ws-plugin--s2member-file-download-inline-extensions" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]) . '" /><br />' . "\n";
256
+ echo 'Inline extensions in comma delimited format. Example: <code>htm,html,pdf,jpg,jpeg,jpe,gif,png</code>.' . "\n";
257
  echo '</td>' . "\n";
258
  /**/
259
  echo '</tr>' . "\n";
includes/menu-pages/options.inc.php CHANGED
@@ -443,7 +443,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
443
  echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && $ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) ? ' selected="selected"' : '') . '>' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
444
  echo '</select><br />' . "\n";
445
  echo 'Please choose a Page to be used as the first page Members will see after logging in. This Page can contain anything you like. We recommend the following title: <code>Welcome To Our Members Area</code>.<br /><br />' . "\n";
446
- echo '&darr; Or, you may configure a Special Redirection URL, if you prefer. You\'ll need to type in the full URL, starting with: <code>http://</code>. <em>A couple of <a href="#" onclick="alert(\'Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n\\nFor example, if you\\\'re using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: ' . get_bloginfo ("url") . '/members/%%current_user_login%%/profile/\\n\\nAdditional Replacement Codes can be added through custom programming. Use: add_filter(\\\'s2member_fill_login_redirect_rc_vars\\\', \\\'my_filter\\\');\'); return false;">Replacement Codes</a> are also supported here.</em>' . "\n";
447
  echo '<input type="text" name="ws_plugin__s2member_login_redirection_override" id="ws-plugin--s2member-login-redirection-override" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) . '" /><br />' . "\n";
448
  echo '</td>' . "\n";
449
  /**/
@@ -659,6 +659,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
659
  echo '<div class="ws-menu-page-section ws-plugin--s2member-post-level-access-section">' . "\n";
660
  echo '<h3>Post Level Access Restrictions ( optional )</h3>' . "\n";
661
  echo '<p>Here you can specify Posts that are restricted to certain Membership Access Levels. These fields also support Custom Post Types, which were first introduced in WordPress® 3.0. If you have a theme/plugin installed that has enabled Custom Post Types ( i.e. Music/Videos/etc ), you can put the IDs for those Posts here.</p>' . "\n";
 
662
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_post_level_access", get_defined_vars ());
663
  /**/
664
  echo '<table class="form-table">' . "\n";
@@ -766,6 +767,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
766
  echo '<div class="ws-menu-page-section ws-plugin--s2member-page-level-access-section">' . "\n";
767
  echo '<h3>Page Level Access Restrictions ( optional )</h3>' . "\n";
768
  echo '<p>Here you can specify Pages that are restricted to certain Membership Access Levels.</p>' . "\n";
 
769
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_page_level_access", get_defined_vars ());
770
  /**/
771
  echo '<table class="form-table">' . "\n";
@@ -980,6 +982,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
980
  echo '<div class="ws-menu-page-section ws-plugin--s2member-category-level-access-section">' . "\n";
981
  echo '<h3>Category Level Access Restrictions ( optional )</h3>' . "\n";
982
  echo '<p>Here you can specify Categories that are restricted to certain Membership Access Levels. Category restrictions are a bit more complex. When you restrict access to a Category, it also restricts access to any child Categories it may have ( aka: sub-Categories ). In other words, restricting a Category protects that Category Archive, all of its child Category Archives, and any Posts contained within the Category, or its child Categories.</p>' . "\n";
 
983
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_category_level_access", get_defined_vars ());
984
  /**/
985
  echo '<table class="form-table">' . "\n";
@@ -1087,7 +1090,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
1087
  echo '<div class="ws-menu-page-section ws-plugin--s2member-uri-level-access-section">' . "\n";
1088
  echo '<h3>URI Level Access Restrictions ( optional )</h3>' . "\n";
1089
  echo '<p>Here you can specify URIs ( or word fragments found in URIs ) that are restricted to certain Membership Access Levels. Control over URIs is a little more complex. This section is intended for advanced webmasters only. That being said, here are the basics... A REQUEST_URI, is the portion of the URL that comes after the domain. This is a URL <code>http://www.example.com/path/to/file.php</code>, and this is the URI: <code>/path/to/file.php</code>.</p>' . "\n";
1090
- echo '<p>In the fields below, you can provide a list ( one per line ) of URIs on your site that should be off-limits based on Membership Level. You can also use word fragments instead of a full URI. If a word fragment is found anywhere in the URI, it will be protected. Wildcards and other regex patterns are not supported here, and therefore you don\'t need to escape special characters or anything. Please note, these ARE caSe sensitive. You must be specific with respect to case sensitivity. The word fragment <code>some-path/</code> would NOT match a URI that contains <code>some-Path/</code>. <em>A couple of <a href="#" onclick="alert(\'URI Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n\\nFor example, if you\\\'re using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: /members/%%current_user_login%%/groups/\\n\\nAdditional Replacement Codes can be added through custom programming. Use: add_filter(\\\'s2member_fill_ruri_level_access_rc_vars\\\', \\\'my_filter\\\');\'); return false;">Replacement Codes</a> are also supported here.</em></p>' . "\n";
1091
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_uri_level_access", get_defined_vars ());
1092
  /**/
1093
  echo '<table class="form-table">' . "\n";
@@ -1198,6 +1201,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
1198
  echo '<p>In other words, Customers will NOT need to login, just to receive access to the Specific Post/Page they purchased access to. s2Member will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link ( see: <code>s2Member -> PayPal® Options -> Specific Post/Page Email</code> ). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n";
1199
  echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress®. A Specific Post/Page that is protected by s2Member, might contain a download link for your eBook, access to file &amp; music downloads, access to additional support services, and the list goes on and on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress® Post/Page that you\'ve created.</p>' . "\n";
1200
  echo '<p>Very simple. All you do is protect the Specific Post/Page IDs that are being sold on your site. Then, you can go to <code>s2Member -> PayPal® Buttons -> Specific Post/Page</code> to generate "Buy Now" Buttons that you can insert into your WordPress® Editor, and make available on your site. The Button Generator for s2Member, will even let you Package Additional Posts/Pages together into one transaction.</p>' . "\n";
 
1201
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_sp_access", get_defined_vars ());
1202
  /**/
1203
  echo '<table class="form-table">' . "\n";
443
  echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && $ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) ? ' selected="selected"' : '') . '>' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
444
  echo '</select><br />' . "\n";
445
  echo 'Please choose a Page to be used as the first page Members will see after logging in. This Page can contain anything you like. We recommend the following title: <code>Welcome To Our Members Area</code>.<br /><br />' . "\n";
446
+ echo '&darr; Or, you may configure a Special Redirection URL, if you prefer. You\'ll need to type in the full URL, starting with: <code>http://</code>. <em>A few <a href="#" onclick="alert(\'Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n\\nFor example, if you\\\'re using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: ' . get_bloginfo ("url") . '/members/%%current_user_login%%/profile/\\n\\nOr ... using %%current_user_level%%, you could have a separate Login Welcome Page for each Membership Level that you plan to offer. BuddyPress not required.\\n\\nAdditional Replacement Codes can be added through custom programming. Use: add_filter(\\\'s2member_fill_login_redirect_rc_vars\\\', \\\'my_filter\\\');\'); return false;">Replacement Codes</a> are also supported here.</em>' . "\n";
447
  echo '<input type="text" name="ws_plugin__s2member_login_redirection_override" id="ws-plugin--s2member-login-redirection-override" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) . '" /><br />' . "\n";
448
  echo '</td>' . "\n";
449
  /**/
659
  echo '<div class="ws-menu-page-section ws-plugin--s2member-post-level-access-section">' . "\n";
660
  echo '<h3>Post Level Access Restrictions ( optional )</h3>' . "\n";
661
  echo '<p>Here you can specify Posts that are restricted to certain Membership Access Levels. These fields also support Custom Post Types, which were first introduced in WordPress® 3.0. If you have a theme/plugin installed that has enabled Custom Post Types ( i.e. Music/Videos/etc ), you can put the IDs for those Posts here.</p>' . "\n";
662
+ echo (!$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Post IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
663
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_post_level_access", get_defined_vars ());
664
  /**/
665
  echo '<table class="form-table">' . "\n";
767
  echo '<div class="ws-menu-page-section ws-plugin--s2member-page-level-access-section">' . "\n";
768
  echo '<h3>Page Level Access Restrictions ( optional )</h3>' . "\n";
769
  echo '<p>Here you can specify Pages that are restricted to certain Membership Access Levels.</p>' . "\n";
770
+ echo (!$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Page IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
771
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_page_level_access", get_defined_vars ());
772
  /**/
773
  echo '<table class="form-table">' . "\n";
982
  echo '<div class="ws-menu-page-section ws-plugin--s2member-category-level-access-section">' . "\n";
983
  echo '<h3>Category Level Access Restrictions ( optional )</h3>' . "\n";
984
  echo '<p>Here you can specify Categories that are restricted to certain Membership Access Levels. Category restrictions are a bit more complex. When you restrict access to a Category, it also restricts access to any child Categories it may have ( aka: sub-Categories ). In other words, restricting a Category protects that Category Archive, all of its child Category Archives, and any Posts contained within the Category, or its child Categories.</p>' . "\n";
985
+ echo (!$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Category IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
986
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_category_level_access", get_defined_vars ());
987
  /**/
988
  echo '<table class="form-table">' . "\n";
1090
  echo '<div class="ws-menu-page-section ws-plugin--s2member-uri-level-access-section">' . "\n";
1091
  echo '<h3>URI Level Access Restrictions ( optional )</h3>' . "\n";
1092
  echo '<p>Here you can specify URIs ( or word fragments found in URIs ) that are restricted to certain Membership Access Levels. Control over URIs is a little more complex. This section is intended for advanced webmasters only. That being said, here are the basics... A REQUEST_URI, is the portion of the URL that comes after the domain. This is a URL <code>http://www.example.com/path/to/file.php</code>, and this is the URI: <code>/path/to/file.php</code>.</p>' . "\n";
1093
+ echo '<p>In the fields below, you can provide a list ( one per line ) of URIs on your site that should be off-limits based on Membership Level. You can also use word fragments instead of a full URI. If a word fragment is found anywhere in the URI, it will be protected. Wildcards and other regex patterns are not supported here, and therefore you don\'t need to escape special characters or anything. Please note, these ARE caSe sensitive. You must be specific with respect to case sensitivity. The word fragment <code>some-path/</code> would NOT match a URI that contains <code>some-Path/</code>. <em>A few <a href="#" onclick="alert(\'URI Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n\\nFor example, if you\\\'re using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: /members/%%current_user_login%%/groups/\\n\\nAdditional Replacement Codes can be added through custom programming. Use: add_filter(\\\'s2member_fill_ruri_level_access_rc_vars\\\', \\\'my_filter\\\');\'); return false;">Replacement Codes</a> are also supported here.</em></p>' . "\n";
1094
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_uri_level_access", get_defined_vars ());
1095
  /**/
1096
  echo '<table class="form-table">' . "\n";
1201
  echo '<p>In other words, Customers will NOT need to login, just to receive access to the Specific Post/Page they purchased access to. s2Member will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link ( see: <code>s2Member -> PayPal® Options -> Specific Post/Page Email</code> ). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n";
1202
  echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress®. A Specific Post/Page that is protected by s2Member, might contain a download link for your eBook, access to file &amp; music downloads, access to additional support services, and the list goes on and on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress® Post/Page that you\'ve created.</p>' . "\n";
1203
  echo '<p>Very simple. All you do is protect the Specific Post/Page IDs that are being sold on your site. Then, you can go to <code>s2Member -> PayPal® Buttons -> Specific Post/Page</code> to generate "Buy Now" Buttons that you can insert into your WordPress® Editor, and make available on your site. The Button Generator for s2Member, will even let you Package Additional Posts/Pages together into one transaction.</p>' . "\n";
1204
+ echo (!$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Post/Page IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
1205
  do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_sp_access", get_defined_vars ());
1206
  /**/
1207
  echo '<table class="form-table">' . "\n";
includes/menu-pages/paypal-ops.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit ("Do not access this file directly.");
16
  /*
17
  PayPal® Options page.
18
  */
@@ -97,8 +97,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
97
  echo '<tr>' . "\n";
98
  /**/
99
  echo '<td>' . "\n";
100
- echo '<input type="radio" name="ws_plugin__s2member_paypal_debug" id="ws-plugin--s2member-paypal-debug-0" value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-debug-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__s2member_paypal_debug" id="ws-plugin--s2member-paypal-debug-1" value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-debug-1">Yes, enable debugging, with IPN &amp; Return Page logging.</label><br />' . "\n";
101
- echo '<em>This enables IPN and Return Page logging. The log files are stored here:<br /><code>' . preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]) . '</code></em>' . "\n";
102
  echo '</td>' . "\n";
103
  /**/
104
  echo '</tr>' . "\n";
@@ -118,7 +118,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
118
  {
119
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_paypal_ipn", get_defined_vars ());
120
  /**/
121
- echo '<div class="ws-menu-page-group" title="PayPal® IPN->s2Member Integration">' . "\n";
122
  /**/
123
  echo '<div class="ws-menu-page-section ws-plugin--s2member-paypal-ipn-section">' . "\n";
124
  echo '<h3>PayPal® IPN / Instant Payment Notifications ( required, please enable )</h3>' . "\n";
@@ -129,6 +129,13 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
129
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_quick_tip", get_defined_vars ());
130
  echo '<p><em><strong>*More Information*</strong> You\'ll be happy to know that s2Member handles cancellations, expirations, failed payments, terminations ( e.g. refunds &amp; chargebacks ) for you automatically. If you log into your PayPal® account and cancel a Member\'s Subscription, or, if the Member logs into their PayPal® account and cancels their own Subscription, s2Member will be notified of these important changes and react accordingly through the PayPal® IPN service that runs silently behind-the-scene. The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</em></p>' . "\n";
131
  echo '<p><em><strong>*2010 PayPal® Accounts*</strong> s2Member has been updated to support newer PayPal® accounts ( those opened after Oct 15th, 2009 ). Newer PayPal® accounts do NOT send a <strong>IPN</strong>/<code>subscr_eot</code> in all cases. s2Member deals with this gracefully, by keeping a record of payments/periods/changes, and monitoring other signals sent by PayPal® over an extended period. This allows s2Member to take control of the situation at the appropriate time. The communication from PayPal® -> s2Member is seamless; even in PayPal® accounts created after October 15th, 2009. You can learn more about <code>subscr_eot</code> changes <a href="https://www.x.com/search.jspa?q=subscr+eot" target="_blank" rel="external">here</a>.</em></p>' . "\n";
 
 
 
 
 
 
 
132
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn", get_defined_vars ());
133
  echo '</div>' . "\n";
134
  /**/
@@ -197,6 +204,24 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
197
  echo '<tr>' . "\n";
198
  /**/
199
  echo '<th>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  echo '<label for="ws-plugin--s2member-signup-email-subject">' . "\n";
201
  echo 'Signup Confirmation Email Subject:' . "\n";
202
  echo '</label>' . "\n";
@@ -280,6 +305,24 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
280
  echo '<tr>' . "\n";
281
  /**/
282
  echo '<th>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  echo '<label for="ws-plugin--s2member-sp-email-subject">' . "\n";
284
  echo 'Specific Post/Page Confirmation Email Subject:' . "\n";
285
  echo '</label>' . "\n";
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit("Do not access this file directly.");
16
  /*
17
  PayPal® Options page.
18
  */
97
  echo '<tr>' . "\n";
98
  /**/
99
  echo '<td>' . "\n";
100
+ echo '<input type="radio" name="ws_plugin__s2member_paypal_debug" id="ws-plugin--s2member-paypal-debug-0" value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-debug-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__s2member_paypal_debug" id="ws-plugin--s2member-paypal-debug-1" value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-debug-1">Yes, enable debugging, with API, IPN &amp; Return Page logging.</label><br />' . "\n";
101
+ echo '<em>This enables API, IPN and Return Page logging. The log files are stored here:<br /><code>' . preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]) . '</code></em>' . "\n";
102
  echo '</td>' . "\n";
103
  /**/
104
  echo '</tr>' . "\n";
118
  {
119
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_before_paypal_ipn", get_defined_vars ());
120
  /**/
121
+ echo '<div class="ws-menu-page-group" title="PayPal® IPN Integration">' . "\n";
122
  /**/
123
  echo '<div class="ws-menu-page-section ws-plugin--s2member-paypal-ipn-section">' . "\n";
124
  echo '<h3>PayPal® IPN / Instant Payment Notifications ( required, please enable )</h3>' . "\n";
129
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_quick_tip", get_defined_vars ());
130
  echo '<p><em><strong>*More Information*</strong> You\'ll be happy to know that s2Member handles cancellations, expirations, failed payments, terminations ( e.g. refunds &amp; chargebacks ) for you automatically. If you log into your PayPal® account and cancel a Member\'s Subscription, or, if the Member logs into their PayPal® account and cancels their own Subscription, s2Member will be notified of these important changes and react accordingly through the PayPal® IPN service that runs silently behind-the-scene. The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</em></p>' . "\n";
131
  echo '<p><em><strong>*2010 PayPal® Accounts*</strong> s2Member has been updated to support newer PayPal® accounts ( those opened after Oct 15th, 2009 ). Newer PayPal® accounts do NOT send a <strong>IPN</strong>/<code>subscr_eot</code> in all cases. s2Member deals with this gracefully, by keeping a record of payments/periods/changes, and monitoring other signals sent by PayPal® over an extended period. This allows s2Member to take control of the situation at the appropriate time. The communication from PayPal® -> s2Member is seamless; even in PayPal® accounts created after October 15th, 2009. You can learn more about <code>subscr_eot</code> changes <a href="https://www.x.com/search.jspa?q=subscr+eot" target="_blank" rel="external">here</a>.</em></p>' . "\n";
132
+ /**/
133
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
134
+ /**/
135
+ echo '<h3>IPN w/ Proxy Key ( optional, for 3rd-party integrations )</h3>' . "\n";
136
+ echo '<p>If you\'re using a 3rd-party application that needs to POST simulated IPN transactions to your s2Member installation, you can use this alternate IPN URL, which includes a Proxy Key. This encrypted Proxy Key verifies incoming data being received by s2Member\'s IPN processor. You can change <em>[proxy-reference]</em> to whatever you like. The <em>[proxy-reference]</em> value is required, but it will only be reflected in s2Member\'s IPN log.</p>' . "\n";
137
+ echo '<input type="text" value="' . format_to_edit (get_bloginfo ("url") . "/?s2member_paypal_notify=1&s2member_paypal_proxy=[proxy-reference]&s2member_paypal_proxy_verification=" . urlencode (md5 (ws_plugin__s2member_xencrypt ($_SERVER["HTTP_HOST"])))) . '" style="width:99%;" />' . "\n";
138
+ echo '<p><em>Any 3rd-party application that is sending IPN transactions to your s2Member installation, must ALWAYS include the <code>custom</code> POST variable, and that variable must always start with ( <code>' . esc_html ($_SERVER["HTTP_HOST"]) . '</code> ). In addition, the <code>item_number</code> variable, must always match a format that s2Member looks for. Generally speaking, the <code>item_number</code> should = <code>1, 2, 3, or 4</code>. However, s2Member also uses some advanced formats in this field. Just to be sure, we suggest creating a PayPal® Button with the s2Member Button Generator, and then taking a look at the Full Button Code to see how s2Member expects <code>item_number</code> to be formatted.</em></p>' . "\n";
139
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn", get_defined_vars ());
140
  echo '</div>' . "\n";
141
  /**/
204
  echo '<tr>' . "\n";
205
  /**/
206
  echo '<th>' . "\n";
207
+ echo '<label for="ws-plugin--s2member-signup-email-recipients">' . "\n";
208
+ echo 'Signup Confirmation Recipients:' . "\n";
209
+ echo '</label>' . "\n";
210
+ echo '</th>' . "\n";
211
+ /**/
212
+ echo '</tr>' . "\n";
213
+ echo '<tr>' . "\n";
214
+ /**/
215
+ echo '<td>' . "\n";
216
+ echo '<input type="text" name="ws_plugin__s2member_signup_email_recipients" id="ws-plugin--s2member-signup-email-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_email_recipients"]) . '" /><br />' . "\n";
217
+ echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
218
+ echo '<code>"%%full_name%%" <%%payer_email%%>; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
219
+ echo '</td>' . "\n";
220
+ /**/
221
+ echo '</tr>' . "\n";
222
+ echo '<tr>' . "\n";
223
+ /**/
224
+ echo '<th>' . "\n";
225
  echo '<label for="ws-plugin--s2member-signup-email-subject">' . "\n";
226
  echo 'Signup Confirmation Email Subject:' . "\n";
227
  echo '</label>' . "\n";
305
  echo '<tr>' . "\n";
306
  /**/
307
  echo '<th>' . "\n";
308
+ echo '<label for="ws-plugin--s2member-sp-email-recipients">' . "\n";
309
+ echo 'Specific Post/Page Confirmation Recipients:' . "\n";
310
+ echo '</label>' . "\n";
311
+ echo '</th>' . "\n";
312
+ /**/
313
+ echo '</tr>' . "\n";
314
+ echo '<tr>' . "\n";
315
+ /**/
316
+ echo '<td>' . "\n";
317
+ echo '<input type="text" name="ws_plugin__s2member_sp_email_recipients" id="ws-plugin--s2member-sp-email-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_email_recipients"]) . '" /><br />' . "\n";
318
+ echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
319
+ echo '<code>"%%full_name%%" <%%payer_email%%>; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
320
+ echo '</td>' . "\n";
321
+ /**/
322
+ echo '</tr>' . "\n";
323
+ echo '<tr>' . "\n";
324
+ /**/
325
+ echo '<th>' . "\n";
326
  echo '<label for="ws-plugin--s2member-sp-email-subject">' . "\n";
327
  echo 'Specific Post/Page Confirmation Email Subject:' . "\n";
328
  echo '</label>' . "\n";
includes/menu-pages/trk-ops.inc.php CHANGED
@@ -43,7 +43,7 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
43
  echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-tracking-section">' . "\n";
44
  echo '<h3>Membership Signup Tracking Codes ( optional )</h3>' . "\n";
45
  echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["is_multisite_farm"]) ? ' and/or PHP' : '') . ' code that you enter below, will be loaded up in a web browser, after a Customer returns from a successful Signup through PayPal®. Tracking Codes are only displayed/processed one time for each Customer. s2Member will display your Tracking Codes in one of three possible locations... <strong>1.</strong> If possible, on the Registration Form, after returning from PayPal®. <strong>2.</strong> Otherwise, if possible, on the Login Form after Registration is completed. <strong>3.</strong> Otherwise, in the footer of your WordPress® theme, after the Customer\'s very first Login.</p>' . "\n";
46
- echo '<p>Signup Tracking Codes are displayed for all types of Membership Level Access. Including: Recurring Subscriptions ( with or without a free trial period ), Non-Recurring Subscriptions ( with or without a free trial period ), Lifetime Subscriptions, and even Fixed-Term Subscriptions. All of these are supported by s2Member\'s Button Generator, and all of these are supported here.</p>' . "\n";
47
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_signup_tracking", get_defined_vars ());
48
  /**/
49
  echo '<table class="form-table">' . "\n";
43
  echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-tracking-section">' . "\n";
44
  echo '<h3>Membership Signup Tracking Codes ( optional )</h3>' . "\n";
45
  echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["is_multisite_farm"]) ? ' and/or PHP' : '') . ' code that you enter below, will be loaded up in a web browser, after a Customer returns from a successful Signup through PayPal®. Tracking Codes are only displayed/processed one time for each Customer. s2Member will display your Tracking Codes in one of three possible locations... <strong>1.</strong> If possible, on the Registration Form, after returning from PayPal®. <strong>2.</strong> Otherwise, if possible, on the Login Form after Registration is completed. <strong>3.</strong> Otherwise, in the footer of your WordPress® theme, after the Customer\'s very first Login.</p>' . "\n";
46
+ echo '<p>Signup Tracking Codes are displayed for all types of Membership Level Access. Including: Recurring Subscriptions ( with or without a free trial period ), Non-Recurring Subscriptions ( with or without a free trial period ), Lifetime Subscriptions, and even Fixed-Term Subscriptions. All of these are supported by s2Member\'s Button/Form Generators, and all of these are supported here.</p>' . "\n";
47
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_signup_tracking", get_defined_vars ());
48
  /**/
49
  echo '<table class="form-table">' . "\n";
includes/syscon.inc.php CHANGED
@@ -20,14 +20,12 @@ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
20
  /*
21
  Detect if this is WordPress® with Multisite/Networking.
22
  */
23
- if (($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["is_multisite"] = ((function_exists ("is_multisite") && is_multisite ()) || function_exists ("wpmu_current_site")))/**/
24
- && ((defined ("MULTISITE_FARM") && MULTISITE_FARM) || file_exists (dirname (dirname (__FILE__)) . "/multisite.farm"))) /* For Multisite Blog Farms. */
25
  $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["is_multisite_farm"] = true;
26
  /*
27
  Determine the full url to the directory this plugin resides in.
28
  */
29
- $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] = WP_CONTENT_URL . /* URL to the plugin directory. */
30
- preg_replace ("/^(.*?)(\/" . preg_quote (basename (WP_CONTENT_DIR), "/") . ")/", "", dirname (dirname (__FILE__)));
31
  /*
32
  Check if the plugin has been configured *should be set after the first config via options panel*.
33
  */
@@ -106,10 +104,12 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
106
  "paypal_identity_token" => "", /* Paypal payment data transfer identity token. */
107
  /**/
108
  "signup_tracking_codes" => "", /* Signup Tracking Codes. */
 
109
  "signup_email_subject" => "Congratulations! ( your membership has been approved )",/**/
110
  "signup_email_message" => "Thanks %%first_name%%! Your membership has been approved.\n\nIf you haven't already done so, the next step is to Register a Username.\n\nComplete your registration here:\n%%registration_url%%\n\nIf you have any trouble, please feel free to contact us.\n\nBest Regards,\n" . get_bloginfo ("name"),/**/
111
  /**/
112
  "sp_tracking_codes" => "", /* Specific Post/Page Tracking. */
 
113
  "sp_email_subject" => "Thank You! ( instructions for access )",/**/
114
  "sp_email_message" => "Thanks %%first_name%%!\n\n%%item_name%%\n\nYour order can be retrieved here:\n%%sp_access_url%%\n( link expires in %%sp_access_exp%% )\n\nIf you have any trouble, please feel free to contact us.\n\nBest Regards,\n" . get_bloginfo ("name"),/**/
115
  /**/
@@ -189,20 +189,10 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
189
  "membership_eot_behavior" => "demote", /* Demote or delete Members? */
190
  "auto_eot_system_enabled" => "1")); /* 0|1|2. 1 = WP-Cron, 2 = Cron tab. */
191
  /*
192
- Here they are merged. user options will overwrite some or all default values.
193
  */
194
  $GLOBALS["WS_PLUGIN__"]["s2member"]["o"] = array_merge ($default_options, (($options !== false) ? (array)$options : (array)get_option ("ws_plugin__s2member_options")));
195
  /*
196
- Backward compatibility for `signup_pixel_tracking_codes`, which was renamed to `signup_tracking_codes` in v2.8.6.
197
- */
198
- if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_pixel_tracking_codes"])
199
- $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_pixel_tracking_codes"];
200
- /*
201
- Backward compatibility for `login_reg_logo_src`, which was resized to 500px wide in v2.8.6.
202
- */
203
- if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src"] === $default_options["login_reg_logo_src"])
204
- $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_width"] = $default_options["login_reg_logo_src_width"];
205
- /*
206
  Backward compatibility for `single_page_email_subject`, which was renamed to `sp_email_subject` in v3.0.
207
  */
208
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["single_page_email_subject"])
@@ -319,6 +309,9 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
319
  else if ($key === "signup_tracking_codes" && (!is_string ($value) || !strlen ($value)))
320
  $value = $default_options[$key];
321
  /**/
 
 
 
322
  else if ($key === "signup_email_subject" && (!is_string ($value) || !strlen ($value)))
323
  $value = $default_options[$key];
324
  /**/
@@ -328,6 +321,9 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
328
  else if ($key === "sp_tracking_codes" && (!is_string ($value) || !strlen ($value)))
329
  $value = $default_options[$key];
330
  /**/
 
 
 
331
  else if ($key === "sp_email_subject" && (!is_string ($value) || !strlen ($value)))
332
  $value = $default_options[$key];
333
  /**/
20
  /*
21
  Detect if this is WordPress® with Multisite/Networking.
22
  */
23
+ if (($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["is_multisite"] = ((function_exists ("is_multisite") && is_multisite ()) || function_exists ("wpmu_current_site"))) && ((defined ("MULTISITE_FARM") && MULTISITE_FARM) || file_exists (dirname (dirname (__FILE__)) . "/multisite.farm")))
 
24
  $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["is_multisite_farm"] = true;
25
  /*
26
  Determine the full url to the directory this plugin resides in.
27
  */
28
+ $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] = WP_CONTENT_URL . preg_replace ("/^(.*?)(\/" . preg_quote (basename (WP_CONTENT_DIR), "/") . ")/", "", dirname (dirname (__FILE__)));
 
29
  /*
30
  Check if the plugin has been configured *should be set after the first config via options panel*.
31
  */
104
  "paypal_identity_token" => "", /* Paypal payment data transfer identity token. */
105
  /**/
106
  "signup_tracking_codes" => "", /* Signup Tracking Codes. */
107
+ "signup_email_recipients" => '"%%full_name%%" <%%payer_email%%>',/**/
108
  "signup_email_subject" => "Congratulations! ( your membership has been approved )",/**/
109
  "signup_email_message" => "Thanks %%first_name%%! Your membership has been approved.\n\nIf you haven't already done so, the next step is to Register a Username.\n\nComplete your registration here:\n%%registration_url%%\n\nIf you have any trouble, please feel free to contact us.\n\nBest Regards,\n" . get_bloginfo ("name"),/**/
110
  /**/
111
  "sp_tracking_codes" => "", /* Specific Post/Page Tracking. */
112
+ "sp_email_recipients" => '"%%full_name%%" <%%payer_email%%>',/**/
113
  "sp_email_subject" => "Thank You! ( instructions for access )",/**/
114
  "sp_email_message" => "Thanks %%first_name%%!\n\n%%item_name%%\n\nYour order can be retrieved here:\n%%sp_access_url%%\n( link expires in %%sp_access_exp%% )\n\nIf you have any trouble, please feel free to contact us.\n\nBest Regards,\n" . get_bloginfo ("name"),/**/
115
  /**/
189
  "membership_eot_behavior" => "demote", /* Demote or delete Members? */
190
  "auto_eot_system_enabled" => "1")); /* 0|1|2. 1 = WP-Cron, 2 = Cron tab. */
191
  /*
192
+ Here they are merged. User options will overwrite some or all default values.
193
  */
194
  $GLOBALS["WS_PLUGIN__"]["s2member"]["o"] = array_merge ($default_options, (($options !== false) ? (array)$options : (array)get_option ("ws_plugin__s2member_options")));
195
  /*
 
 
 
 
 
 
 
 
 
 
196
  Backward compatibility for `single_page_email_subject`, which was renamed to `sp_email_subject` in v3.0.
197
  */
198
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["single_page_email_subject"])
309
  else if ($key === "signup_tracking_codes" && (!is_string ($value) || !strlen ($value)))
310
  $value = $default_options[$key];
311
  /**/
312
+ else if ($key === "signup_email_recipients" && !is_string ($value)) /* Can be empty. */
313
+ $value = $default_options[$key];
314
+ /**/
315
  else if ($key === "signup_email_subject" && (!is_string ($value) || !strlen ($value)))
316
  $value = $default_options[$key];
317
  /**/
321
  else if ($key === "sp_tracking_codes" && (!is_string ($value) || !strlen ($value)))
322
  $value = $default_options[$key];
323
  /**/
324
+ else if ($key === "sp_email_recipients" && !is_string ($value)) /* Can be empty. */
325
+ $value = $default_options[$key];
326
+ /**/
327
  else if ($key === "sp_email_subject" && (!is_string ($value) || !strlen ($value)))
328
  $value = $default_options[$key];
329
  /**/
readme.txt CHANGED
@@ -1,10 +1,11 @@
1
  === s2Member ( Membership w/ PayPal® Integration ) also works w/ BuddyPress ===
2
 
3
- Version: 3.0.9
4
- Stable tag: 3.0.9
5
  Framework: WS-P-3.0
6
 
7
  SSL Compatible: yes
 
8
  WordPress Compatible: yes
9
  BuddyPress Compatible: yes
10
  WP Multisite Compatible: soon
@@ -27,7 +28,7 @@ Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
27
  Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
28
  Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
29
  Description: Empowers WordPress® with membership capabilities. Integrates seamlessly with PayPal®. Also compatible with the BuddyPress plugin for WP.
30
- Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, multi widget support, includes extensive documentation, highly extensible
31
 
32
  s2Member is an extremely powerful ( and free ) membership management system for WordPress®. It empowers WordPress® with membership capabilities, integrating seamlessly with PayPal®. s2Member is also compatible with BuddyPress.
33
 
@@ -144,6 +145,9 @@ Not yet. This is coming soon though. It will be included in a future release of
144
 
145
  == Upgrade Notice ==
146
 
 
 
 
147
  = 3.0.6 =
148
  * Upgrade highly recommended. Fixes a bug in v3.0.5.
149
 
@@ -152,6 +156,18 @@ Not yet. This is coming soon though. It will be included in a future release of
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  = 3.0.9 =
156
  * Bug fix. Inside `/includes/s2member.js`, there was an incorrect reference to `S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER`. This has been changed to `S2MEMBER_CURRENT_USER_IS_LOGGED_IN`, making s2Member's File Download prompts compatible with Free Subscriber permissions at Level #0.
157
  * Bug fix. In the new Download Keys feature, first introduced in v3.0.5, a bug was discovered. The function `s2member_encrypt()` was being used inside `s2member_file_download_key()`, instead of `s2member_xencrypt()`. Download Keys need `s2member_file_download_key()`, with xencryption, for proper hash comparison. This has been resolved in v3.0.9. Thanks to Drew Kissinger for reporting this. For further details/instructions, check your WP Dashboard, under: `s2Member -> Download Options -> Advanced`.
1
  === s2Member ( Membership w/ PayPal® Integration ) also works w/ BuddyPress ===
2
 
3
+ Version: 3.1
4
+ Stable tag: 3.1
5
  Framework: WS-P-3.0
6
 
7
  SSL Compatible: yes
8
+ bbPress Compatible: yes
9
  WordPress Compatible: yes
10
  BuddyPress Compatible: yes
11
  WP Multisite Compatible: soon
28
  Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
29
  Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
30
  Description: Empowers WordPress® with membership capabilities. Integrates seamlessly with PayPal®. Also compatible with the BuddyPress plugin for WP.
31
+ Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, includes extensive documentation, highly extensible
32
 
33
  s2Member is an extremely powerful ( and free ) membership management system for WordPress®. It empowers WordPress® with membership capabilities, integrating seamlessly with PayPal®. s2Member is also compatible with BuddyPress.
34
 
145
 
146
  == Upgrade Notice ==
147
 
148
+ = 3.1 =
149
+ * Upgrade recommended. Fixes a redirection loop on some configurations. Also adds several new features; listed below.
150
+
151
  = 3.0.6 =
152
  * Upgrade highly recommended. Fixes a bug in v3.0.5.
153
 
156
 
157
  == Changelog ==
158
 
159
+ = 3.1 =
160
+ * bbPress® compatiblity. There is a new internal Bridge that can be installed into bbPress® by s2Member. This new bbPress® (Bridge/plugin) makes it possible for s2Member Levels [0-4] to be converted into bbPress® "Members" on-the-fly, and it will guard your forums against unauthorized access; including forum registrations, which are redirected to your Membership Options Page for s2Member. To install this Bridge Integration, check your WordPress® Dashboard, under: `s2Member -> Bridge Integrations`.
161
+ * New plugin that is HIGHLY recommended for s2Member. Get [WP Show IDs](http://www.primothemes.com/post/wp-show-ids-plugin/). Simple, yet elegant. Shows IDs for Posts, Pages, Media, Links, Categories, Tags, and Users in the admin tables for easy access. Very lightweight. Also supports Custom Post Types / Taxonomies.
162
+ * New feature. There is a new Replacement Code available for the Login Welcome Page. You can now set a Special Redirection URL, which includes `%%current_user_level%%`, making it possible to have a separate Login Welcome Page for each Membership Level that you plan to offer. For further details, log into your WP Dashboard, and go to: `s2Member -> General Options -> Login Welcome Page`.
163
+ * New feature. s2Member now supports 3rd-party IPN integrations, where you can have another service, such as PayDotCom® send simulated IPN transactions to your s2Member installation. For further details, log into your WordPress® Dashboard, and go to: `s2Member -> PayPal Options -> IPN Integration` ( at the bottom of that sub-section, you'll find your Proxy IPN Key ). Full instructions for services like PayDotCom® &amp; eJunkie® will be provided in the next release. The framework is in place, but full documentation has not been written yet.
164
+ * New feature. s2Member now allows you to customize a list of Recipients for both the Signup Confirmation Email, and also the Specific Post/Page Confirmation Email. This makes it possible to prevent these emails from going out ( definitely NOT recommended though ). More importantly, it allows you to have copies of these messages sent to various departments, or even to a list server; such as AWeber/MailChimp. It should also be noted that your list of Recipients, your Subject Line, and your Messages; can all be modified easily, and ALL of these fields support the full list of Replacement Codes listed in those sections. For further details, see: `s2Member -> PayPal® Options`.
165
+ * Bug fix. A redirection loop was found within s2Member's security restrictions. A redirection loop was possible, whenever s2Member was running with an incomplete configuration ( i.e. no Membership Options Page was configured ). This has been corrected in v3.1. A new warning notice will be issued should you attempt to save your General Options without configuring a Membership Options Page. Also, s2Member will NOT enforce any of its security restrictions until this Page has been configured successfully. See: `s2Member -> General Options -> Membership Options Page`. If you see no warning notice after updating your options, you're good. ~ Not a huge issue, but this was catching a few newbies by surprise.
166
+ * Support for third-party integrations that need to determine the location of your Membership Options Page, without having direct access through a plugin. Third-party applications may now send a request to your site like this: `http://www.example.com/?s2member_membership_options_page=1`, and s2Member will automatically redirect that request to the real Membership Options Page that you've configured.
167
+ * Compatibility. Back in s2Member v3.0.5, the s2Member Menu panel was moved up to sit just beneath the Users menu in WordPress®. This has been reverted back down near the bottom, because other plugins tend to conflict with this approach. The application of a specific menu postition could be overridden by another plugin that loads up after s2Member is initialized; causing the s2Member menu to dissapear. This has been resolved in v3.1.
168
+ * Bug fix. s2Member was reporting `Anyone Can Register = 1` on the General Options page for WordPress®, no matter what. This was not hurting anything internally, but the display of this incorrect information in some circumstances ( depending on configuration ) was leading to confusion for site owners. This has been resolved in v3.1+.
169
+ * New feature. It is now possible to protect files that are NOT even a part of WordPress®. You can accomplish this by placing any set of files/folders inside the `/plugins/s2member-files/` directory. Then, you can configure Inline Extensions under, `s2Member -> Download Options -> Inline Extensions`. Using this technique, you can now protect ANY file, using Download Keys and Inline Extensions. For full details, see: `s2Member -> Download Options`. Note, don't be fooled by the word "Download", this feature is much more powerful than it seems at first glance. If you get confused, please write in on the forums for assistance from the community.
170
+
171
  = 3.0.9 =
172
  * Bug fix. Inside `/includes/s2member.js`, there was an incorrect reference to `S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER`. This has been changed to `S2MEMBER_CURRENT_USER_IS_LOGGED_IN`, making s2Member's File Download prompts compatible with Free Subscriber permissions at Level #0.
173
  * Bug fix. In the new Download Keys feature, first introduced in v3.0.5, a bug was discovered. The function `s2member_encrypt()` was being used inside `s2member_file_download_key()`, instead of `s2member_xencrypt()`. Download Keys need `s2member_file_download_key()`, with xencryption, for proper hash comparison. This has been resolved in v3.0.9. Thanks to Drew Kissinger for reporting this. For further details/instructions, check your WP Dashboard, under: `s2Member -> Download Options -> Advanced`.
s2member.php CHANGED
@@ -9,11 +9,12 @@ along with this software. In the main directory, see: /licensing/
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
- Version: 3.0.9
13
- Stable tag: 3.0.9
14
  Framework: WS-P-3.0
15
 
16
  SSL Compatible: yes
 
17
  WordPress Compatible: yes
18
  BuddyPress Compatible: yes
19
  WP Multisite Compatible: soon
@@ -42,14 +43,14 @@ Tags: membership, members, member, register, signup, paypal, pay pal, s2member,
42
  Direct access denial.
43
  */
44
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
45
- exit ("Do not access this file directly.");
46
  /*
47
  Define versions.
48
  */
49
- define ("WS_PLUGIN__S2MEMBER_VERSION", "3.0.9");
50
  define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
51
  define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "2.9.2");
52
- define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.0");
53
  /*
54
  Compatibility checks.
55
  */
@@ -59,7 +60,7 @@ if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") &&
59
  /*
60
  Hook before loaded.
61
  */
62
- do_action ("ws_plugin__s2member_before_loaded");
63
  /*
64
  System configuraton.
65
  */
@@ -71,7 +72,7 @@ if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") &&
71
  /*
72
  Hook after system config & hooks are loaded.
73
  */
74
- do_action ("ws_plugin__s2member_config_hooks_loaded");
75
  /*
76
  Load a possible Pro module, if/when available.
77
  */
@@ -87,7 +88,7 @@ if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") &&
87
  /*
88
  Hook after loaded.
89
  */
90
- do_action ("ws_plugin__s2member_after_loaded");
91
  }
92
  else if (is_admin ()) /* Admin compatibility errors. */
93
  {
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
+ Version: 3.1
13
+ Stable tag: 3.1
14
  Framework: WS-P-3.0
15
 
16
  SSL Compatible: yes
17
+ bbPress Compatible: yes
18
  WordPress Compatible: yes
19
  BuddyPress Compatible: yes
20
  WP Multisite Compatible: soon
43
  Direct access denial.
44
  */
45
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
46
+ exit("Do not access this file directly.");
47
  /*
48
  Define versions.
49
  */
50
+ define ("WS_PLUGIN__S2MEMBER_VERSION", "3.1");
51
  define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
52
  define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "2.9.2");
53
+ define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.0.5");
54
  /*
55
  Compatibility checks.
56
  */
60
  /*
61
  Hook before loaded.
62
  */
63
+ do_action("ws_plugin__s2member_before_loaded");
64
  /*
65
  System configuraton.
66
  */
72
  /*
73
  Hook after system config & hooks are loaded.
74
  */
75
+ do_action("ws_plugin__s2member_config_hooks_loaded");
76
  /*
77
  Load a possible Pro module, if/when available.
78
  */
88
  /*
89
  Hook after loaded.
90
  */
91
+ do_action("ws_plugin__s2member_after_loaded");
92
  }
93
  else if (is_admin ()) /* Admin compatibility errors. */
94
  {