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

Version Description

Download this release

Release Info

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

Code changes from version 110620 to 110708

Files changed (63) hide show
  1. includes/classes/check-activation.inc.php +7 -3
  2. includes/classes/constants.inc.php +10 -8
  3. includes/classes/custom-reg-fields.inc.php +34 -34
  4. includes/classes/email-configs.inc.php +164 -1
  5. includes/classes/installation.inc.php +5 -2
  6. includes/classes/labels.inc.php +3 -3
  7. includes/classes/login-customizations.inc.php +3 -1
  8. includes/classes/meta-box-saves.inc.php +16 -34
  9. includes/classes/meta-box-security.inc.php +40 -38
  10. includes/classes/option-forces.inc.php +4 -6
  11. includes/classes/paypal-notify-in.inc.php +79 -79
  12. includes/classes/paypal-return-in.inc.php +31 -31
  13. includes/classes/paypal-utilities.inc.php +10 -10
  14. includes/classes/profile-in.inc.php +4 -1
  15. includes/classes/register-access.inc.php +19 -0
  16. includes/classes/register-in.inc.php +35 -21
  17. includes/classes/registrations.inc.php +49 -22
  18. includes/classes/roles-caps.inc.php +5 -5
  19. includes/classes/tracking-codes.inc.php +7 -7
  20. includes/classes/utils-users.inc.php +4 -4
  21. includes/functions/class-autoloader.inc.php +1 -3
  22. includes/hooks.inc.php +4 -1
  23. includes/menu-pages/api-ops.inc.php +3 -5
  24. includes/menu-pages/code-samples/api-mop-vars.php +1 -59
  25. includes/menu-pages/code-samples/current-user-fields.php +16 -13
  26. includes/menu-pages/code-samples/current-user-profile-modification-page-url-1.php +1 -5
  27. includes/menu-pages/code-samples/current-user-value-for-pp-on0-os0.php +0 -9
  28. includes/menu-pages/code-samples/level0-file-downloads-allowed-days.php +0 -7
  29. includes/menu-pages/code-samples/level0-file-downloads-allowed.php +0 -7
  30. includes/menu-pages/code-samples/level0-label.php +0 -7
  31. includes/menu-pages/code-samples/level1-file-downloads-allowed-days.php +0 -7
  32. includes/menu-pages/code-samples/level1-file-downloads-allowed.php +0 -7
  33. includes/menu-pages/code-samples/level1-label.php +0 -7
  34. includes/menu-pages/code-samples/level2-file-downloads-allowed-days.php +0 -7
  35. includes/menu-pages/code-samples/level2-file-downloads-allowed.php +0 -7
  36. includes/menu-pages/code-samples/level2-label.php +0 -7
  37. includes/menu-pages/code-samples/level3-file-downloads-allowed-days.php +0 -7
  38. includes/menu-pages/code-samples/level3-file-downloads-allowed.php +0 -7
  39. includes/menu-pages/code-samples/level3-label.php +0 -7
  40. includes/menu-pages/code-samples/level4-file-downloads-allowed-days.php +0 -7
  41. includes/menu-pages/code-samples/level4-file-downloads-allowed.php +0 -7
  42. includes/menu-pages/code-samples/level4-label.php +0 -7
  43. includes/menu-pages/code-samples/query-conditional-examples.php +0 -33
  44. includes/menu-pages/code-samples/version.php +5 -1
  45. includes/menu-pages/down-ops.inc.php +23 -86
  46. includes/menu-pages/els-ops.inc.php +45 -176
  47. includes/menu-pages/gen-ops.inc.php +137 -106
  48. includes/menu-pages/info.inc.php +1 -3
  49. includes/menu-pages/integrations.inc.php +1 -3
  50. includes/menu-pages/menu-pages-s-min.js +1 -1
  51. includes/menu-pages/menu-pages-s.js +12 -7
  52. includes/menu-pages/menu-pages.css +2 -17
  53. includes/menu-pages/mms-ops.inc.php +24 -72
  54. includes/menu-pages/paypal-buttons.inc.php +147 -358
  55. includes/menu-pages/paypal-ops.inc.php +1 -3
  56. includes/menu-pages/res-ops.inc.php +104 -419
  57. includes/menu-pages/scripting.inc.php +154 -197
  58. includes/menu-pages/start.inc.php +2 -4
  59. includes/menu-pages/trk-ops.inc.php +1 -3
  60. includes/syscon.inc.php +199 -197
  61. includes/templates/options/paypal-membership-modification-levels.html +0 -24
  62. readme.txt +21 -24
  63. s2member.php +9 -7
includes/classes/check-activation.inc.php CHANGED
@@ -15,7 +15,7 @@
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_check_activation"))
21
{
@@ -41,11 +41,15 @@ if (!class_exists ("c_ws_plugin__s2member_check_activation"))
41
{
42
if (!($v = get_option ("ws_plugin__s2member_activated_version")) || !version_compare ($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
43
{
44
- c_ws_plugin__s2member_installation::activate ();
45
}
46
else if (is_multisite () && is_main_site () && (!($mms_v = get_option ("ws_plugin__s2member_activated_mms_version")) || !version_compare ($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">=")))
47
{
48
- c_ws_plugin__s2member_installation::activate ();
49
}
50
/**/
51
return; /* Return for uniformity. */
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_check_activation"))
21
{
41
{
42
if (!($v = get_option ("ws_plugin__s2member_activated_version")) || !version_compare ($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
43
{
44
+ c_ws_plugin__s2member_installation::activate ("version");
45
}
46
else if (is_multisite () && is_main_site () && (!($mms_v = get_option ("ws_plugin__s2member_activated_mms_version")) || !version_compare ($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">=")))
47
{
48
+ c_ws_plugin__s2member_installation::activate ("mms_version");
49
+ }
50
+ else if (!($l = (int)get_option ("ws_plugin__s2member_activated_levels")) || $l !== $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])
51
+ {
52
+ c_ws_plugin__s2member_installation::activate ("levels");
53
}
54
/**/
55
return; /* Return for uniformity. */
includes/classes/constants.inc.php CHANGED
@@ -15,7 +15,7 @@
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_constants"))
21
{
@@ -62,7 +62,7 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
62
$custom_fields = ($user) ? get_user_option ("s2member_custom_fields", $user->ID) : array ();
63
$paid_registration_times = ($user) ? get_user_option ("s2member_paid_registration_times", $user->ID) : array ();
64
/**/
65
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
66
do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
67
unset ($__refs, $__v); /* Unset defined __refs, __v. */
68
/**
@@ -923,6 +923,7 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
923
*
924
* o `id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID}
925
* o `ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP}
926
* o `email` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL}
927
* o `login` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN}
928
* o `first_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME}
@@ -948,8 +949,9 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
948
* ```
949
* [s2Get user_field="id" /]
950
* [s2Get user_field="ip" /]
951
- * [s2Get user_field="user_email" /]
952
- * [s2Get user_field="user_login" /]
953
* [s2Get user_field="first_name" /]
954
* [s2Get user_field="last_name" /]
955
* [s2Get user_field="display_name" /]
@@ -957,11 +959,11 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
957
* [s2Get user_field="s2member_subscr_wp_id" /]
958
* [s2Get user_field="s2member_subscr_gateway" /]
959
* [s2Get user_field="s2member_custom" /]
960
- * [s2Get user_field="my_field_id" /]
961
*
962
* <script type="text/javascript">
963
- * var obj = jQuery.parseJSON(S2MEMBER_CURRENT_USER_FIELDS);
964
- * document.write(obj.display_name);
965
* </script>
966
* ```
967
*
@@ -975,7 +977,7 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
975
* @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
976
*/
977
if (!defined ("S2MEMBER_CURRENT_USER_FIELDS"))
978
- define ("S2MEMBER_CURRENT_USER_FIELDS", ($c[] = (($user) ? json_encode (array_merge (array ("id" => S2MEMBER_CURRENT_USER_ID, "ip" => S2MEMBER_CURRENT_USER_IP, "email" => S2MEMBER_CURRENT_USER_EMAIL, "login" => S2MEMBER_CURRENT_USER_LOGIN, "first_name" => S2MEMBER_CURRENT_USER_FIRST_NAME, "last_name" => S2MEMBER_CURRENT_USER_LAST_NAME, "display_name" => S2MEMBER_CURRENT_USER_DISPLAY_NAME, "subscr_id" => S2MEMBER_CURRENT_USER_SUBSCR_ID, "subscr_or_wp_id" => S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID, "subscr_gateway" => S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY, "custom" => S2MEMBER_CURRENT_USER_CUSTOM), (array)$custom_fields)) : json_encode (array ()))));
979
/**
980
* Indicates the number of unique Files the current User is allowed to download every X days.
981
*
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_constants"))
21
{
62
$custom_fields = ($user) ? get_user_option ("s2member_custom_fields", $user->ID) : array ();
63
$paid_registration_times = ($user) ? get_user_option ("s2member_paid_registration_times", $user->ID) : array ();
64
/**/
65
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
66
do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
67
unset ($__refs, $__v); /* Unset defined __refs, __v. */
68
/**
923
*
924
* o `id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID}
925
* o `ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP}
926
+ * o `reg_ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP}
927
* o `email` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL}
928
* o `login` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN}
929
* o `first_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME}
949
* ```
950
* [s2Get user_field="id" /]
951
* [s2Get user_field="ip" /]
952
+ * [s2Get user_field="reg_ip" /]
953
+ * [s2Get user_field="email" /]
954
+ * [s2Get user_field="login" /]
955
* [s2Get user_field="first_name" /]
956
* [s2Get user_field="last_name" /]
957
* [s2Get user_field="display_name" /]
959
* [s2Get user_field="s2member_subscr_wp_id" /]
960
* [s2Get user_field="s2member_subscr_gateway" /]
961
* [s2Get user_field="s2member_custom" /]
962
+ * [s2Get user_field="my_custom_field_id" /]
963
*
964
* <script type="text/javascript">
965
+ * document.write(S2MEMBER_CURRENT_USER_FIELDS.id);
966
+ * document.write(S2MEMBER_CURRENT_USER_FIELDS.display_name);
967
* </script>
968
* ```
969
*
977
* @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
978
*/
979
if (!defined ("S2MEMBER_CURRENT_USER_FIELDS"))
980
+ define ("S2MEMBER_CURRENT_USER_FIELDS", ($c[] = (($user) ? json_encode (array_merge (array ("id" => S2MEMBER_CURRENT_USER_ID, "ip" => S2MEMBER_CURRENT_USER_IP, "reg_ip" => S2MEMBER_CURRENT_USER_REGISTRATION_IP, "email" => S2MEMBER_CURRENT_USER_EMAIL, "login" => S2MEMBER_CURRENT_USER_LOGIN, "first_name" => S2MEMBER_CURRENT_USER_FIRST_NAME, "last_name" => S2MEMBER_CURRENT_USER_LAST_NAME, "display_name" => S2MEMBER_CURRENT_USER_DISPLAY_NAME, "subscr_id" => S2MEMBER_CURRENT_USER_SUBSCR_ID, "subscr_or_wp_id" => S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID, "subscr_gateway" => S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY, "custom" => S2MEMBER_CURRENT_USER_CUSTOM), (array)$custom_fields)) : json_encode (array ()))));
981
/**
982
* Indicates the number of unique Files the current User is allowed to download every X days.
983
*
includes/classes/custom-reg-fields.inc.php CHANGED
@@ -15,7 +15,7 @@
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
21
{
@@ -48,13 +48,13 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
48
*/
49
public static function custom_field_gen ($_function = FALSE, $_field = FALSE, $_name_prefix = FALSE, $_id_prefix = FALSE, $_classes = FALSE, $_styles = FALSE, $_tabindex = FALSE, $_attrs = FALSE, $_submission = FALSE, $_value = FALSE, $_editable_context = FALSE)
50
{
51
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
52
do_action ("ws_plugin__s2member_before_custom_field_gen", get_defined_vars ());
53
unset ($__refs, $__v); /* Unset defined __refs, __v. */
54
/**/
55
if (!($gen = "") && $_function && is_array ($field = $_field) && !empty ($field["type"]) && !empty ($field["id"]) && $_name_prefix && $_id_prefix)
56
{
57
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
58
do_action ("ws_plugin__s2member_during_custom_field_gen_before", get_defined_vars ());
59
unset ($__refs, $__v); /* Unset defined __refs, __v. */
60
/**/
@@ -258,7 +258,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
258
}
259
}
260
/**/
261
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
262
do_action ("ws_plugin__s2member_during_custom_field_gen_after", get_defined_vars ());
263
unset ($__refs, $__v); /* Unset defined __refs, __v. */
264
}
@@ -278,15 +278,15 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
278
*/
279
public static function custom_fields_configured_at_level ($_level = "auto-detection", $_editable_context = FALSE)
280
{
281
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
282
do_action ("ws_plugin__s2member_before_custom_fields_configured_at_level", get_defined_vars ());
283
unset ($__refs, $__v); /* Unset defined __refs, __v. */
284
/**/
285
$level = ($_level === "auto-detection") ? c_ws_plugin__s2member_user_access::user_access_level () : $_level;
286
- if ($_level === "auto-detection" && $level < 0 && preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", ($cookie = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_level"]))))
287
- list ($level) = preg_split ("/\:/", $cookie, 3);
288
/**/
289
- $level = ($level !== "any" && (!is_numeric ($level) || $level < 0)) ? 0 : $level; /* Default zero. */
290
/**/
291
if (($level === "any" || (is_numeric ($level) && $level >= 0)) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"])
292
{
@@ -322,7 +322,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
322
/**/
323
echo '<input type="hidden" name="ws_plugin__s2member_registration" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-registration")) . '" />' . "\n";
324
/**/
325
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
326
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before", get_defined_vars ());
327
unset ($__refs, $__v); /* Unset defined __refs, __v. */
328
/**/
@@ -330,7 +330,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
330
{
331
echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section"></div>' . "\n";
332
/**/
333
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
334
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_first_name", get_defined_vars ());
335
unset ($__refs, $__v); /* Unset defined __refs, __v. */
336
/**/
@@ -338,11 +338,11 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
338
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_first_name" id="ws-plugin--s2member-custom-reg-field-first-name" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_first_name"]) . '" />' . "\n";
339
echo '<br />' . "\n";
340
/**/
341
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
342
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_first_name", get_defined_vars ());
343
unset ($__refs, $__v); /* Unset defined __refs, __v. */
344
/**/
345
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
346
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_last_name", get_defined_vars ());
347
unset ($__refs, $__v); /* Unset defined __refs, __v. */
348
/**/
@@ -350,7 +350,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
350
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_last_name" id="ws-plugin--s2member-custom-reg-field-last-name" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_last_name"]) . '" />' . "\n";
351
echo '<br />' . "\n";
352
/**/
353
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
354
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_last_name", get_defined_vars ());
355
unset ($__refs, $__v); /* Unset defined __refs, __v. */
356
}
@@ -359,7 +359,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
359
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level ("auto-detection", "registration"))
360
foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
361
{
362
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
363
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_custom_fields", get_defined_vars ());
364
unset ($__refs, $__v); /* Unset defined __refs, __v. */
365
/**/
@@ -368,7 +368,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
368
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field["id"]));
369
$field_id_class = preg_replace ("/_/", "-", $field_var);
370
/**/
371
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
372
if (apply_filters ("ws_plugin__s2member_during_ms_custom_registration_fields_during_custom_fields_display", true, get_defined_vars ()))
373
{
374
if (!empty ($field["section"]) && $field["section"] === "yes") /* Starts a new section? */
@@ -381,14 +381,14 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
381
unset ($__refs, $__v); /* Unset defined __refs, __v. */
382
}
383
/**/
384
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
385
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_custom_fields", get_defined_vars ());
386
unset ($__refs, $__v); /* Unset defined __refs, __v. */
387
}
388
/**/
389
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && c_ws_plugin__s2member_list_servers::list_servers_integrated ())
390
{
391
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
392
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_opt_in", get_defined_vars ());
393
unset ($__refs, $__v); /* Unset defined __refs, __v. */
394
/**/
@@ -398,17 +398,17 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
398
echo '</label>' . "\n";
399
echo '<br />' . "\n";
400
/**/
401
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
402
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_opt_in", get_defined_vars ());
403
unset ($__refs, $__v); /* Unset defined __refs, __v. */
404
}
405
/**/
406
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
407
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after", get_defined_vars ());
408
unset ($__refs, $__v); /* Unset defined __refs, __v. */
409
}
410
/**/
411
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
412
do_action ("ws_plugin__s2member_after_ms_custom_registration_fields", get_defined_vars ());
413
unset ($__refs, $__v); /* Unset defined __refs, __v. */
414
/**/
@@ -436,13 +436,13 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
436
/**/
437
$tabindex = 20; /* Incremented tabindex starting with 20. */
438
/**/
439
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
440
do_action ("ws_plugin__s2member_during_custom_registration_fields_before", get_defined_vars ());
441
unset ($__refs, $__v); /* Unset defined __refs, __v. */
442
/**/
443
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
444
{
445
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
446
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_user_pass", get_defined_vars ());
447
unset ($__refs, $__v); /* Unset defined __refs, __v. */
448
/**/
@@ -461,7 +461,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
461
/**/
462
echo '</p>' . "\n";
463
/**/
464
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
465
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_user_pass", get_defined_vars ());
466
unset ($__refs, $__v); /* Unset defined __refs, __v. */
467
}
@@ -470,7 +470,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
470
{
471
echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section"></div>' . "\n";
472
/**/
473
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
474
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_first_name", get_defined_vars ());
475
unset ($__refs, $__v); /* Unset defined __refs, __v. */
476
/**/
@@ -481,11 +481,11 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
481
echo '</label>' . "\n";
482
echo '</p>' . "\n";
483
/**/
484
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
485
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_first_name", get_defined_vars ());
486
unset ($__refs, $__v); /* Unset defined __refs, __v. */
487
/**/
488
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
489
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_last_name", get_defined_vars ());
490
unset ($__refs, $__v); /* Unset defined __refs, __v. */
491
/**/
@@ -496,7 +496,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
496
echo '</label>' . "\n";
497
echo '</p>' . "\n";
498
/**/
499
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
500
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_last_name", get_defined_vars ());
501
unset ($__refs, $__v); /* Unset defined __refs, __v. */
502
}
@@ -505,7 +505,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
505
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level ("auto-detection", "registration"))
506
foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
507
{
508
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
509
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_custom_fields", get_defined_vars ());
510
unset ($__refs, $__v); /* Unset defined __refs, __v. */
511
/**/
@@ -514,7 +514,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
514
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field["id"]));
515
$field_id_class = preg_replace ("/_/", "-", $field_var);
516
/**/
517
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
518
if (apply_filters ("ws_plugin__s2member_during_custom_registration_fields_during_custom_fields_display", true, get_defined_vars ()))
519
{
520
if (!empty ($field["section"]) && $field["section"] === "yes") /* Starts a new section? */
@@ -529,14 +529,14 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
529
unset ($__refs, $__v); /* Unset defined __refs, __v. */
530
}
531
/**/
532
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
533
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_custom_fields", get_defined_vars ());
534
unset ($__refs, $__v); /* Unset defined __refs, __v. */
535
}
536
/**/
537
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && c_ws_plugin__s2member_list_servers::list_servers_integrated ())
538
{
539
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
540
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_opt_in", get_defined_vars ());
541
unset ($__refs, $__v); /* Unset defined __refs, __v. */
542
/**/
@@ -547,16 +547,16 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
547
echo '</label>' . "\n";
548
echo '</p>' . "\n";
549
/**/
550
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
551
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_opt_in", get_defined_vars ());
552
unset ($__refs, $__v); /* Unset defined __refs, __v. */
553
}
554
/**/
555
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
556
do_action ("ws_plugin__s2member_during_custom_registration_fields_after", get_defined_vars ());
557
unset ($__refs, $__v); /* Unset defined __refs, __v. */
558
/**/
559
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
560
do_action ("ws_plugin__s2member_after_custom_registration_fields", get_defined_vars ());
561
unset ($__refs, $__v); /* Unset defined __refs, __v. */
562
/**/
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
21
{
48
*/
49
public static function custom_field_gen ($_function = FALSE, $_field = FALSE, $_name_prefix = FALSE, $_id_prefix = FALSE, $_classes = FALSE, $_styles = FALSE, $_tabindex = FALSE, $_attrs = FALSE, $_submission = FALSE, $_value = FALSE, $_editable_context = FALSE)
50
{
51
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
52
do_action ("ws_plugin__s2member_before_custom_field_gen", get_defined_vars ());
53
unset ($__refs, $__v); /* Unset defined __refs, __v. */
54
/**/
55
if (!($gen = "") && $_function && is_array ($field = $_field) && !empty ($field["type"]) && !empty ($field["id"]) && $_name_prefix && $_id_prefix)
56
{
57
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
58
do_action ("ws_plugin__s2member_during_custom_field_gen_before", get_defined_vars ());
59
unset ($__refs, $__v); /* Unset defined __refs, __v. */
60
/**/
258
}
259
}
260
/**/
261
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
262
do_action ("ws_plugin__s2member_during_custom_field_gen_after", get_defined_vars ());
263
unset ($__refs, $__v); /* Unset defined __refs, __v. */
264
}
278
*/
279
public static function custom_fields_configured_at_level ($_level = "auto-detection", $_editable_context = FALSE)
280
{
281
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
282
do_action ("ws_plugin__s2member_before_custom_fields_configured_at_level", get_defined_vars ());
283
unset ($__refs, $__v); /* Unset defined __refs, __v. */
284
/**/
285
$level = ($_level === "auto-detection") ? c_ws_plugin__s2member_user_access::user_access_level () : $_level;
286
+ if ($_level === "auto-detection" && $level < 0 && ($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok ()) && extract ($reg_cookies) && preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $item_number, $m) && !empty ($m[1]) && is_numeric ($m[1]))
287
+ $level = $m[1]; /* A numeric Membership Level # . */
288
/**/
289
+ $level = ($level !== "any" && (!is_numeric ($level) || $level < 0)) ? 0 : $level; /* Default. */
290
/**/
291
if (($level === "any" || (is_numeric ($level) && $level >= 0)) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"])
292
{
322
/**/
323
echo '<input type="hidden" name="ws_plugin__s2member_registration" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-registration")) . '" />' . "\n";
324
/**/
325
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
326
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before", get_defined_vars ());
327
unset ($__refs, $__v); /* Unset defined __refs, __v. */
328
/**/
330
{
331
echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section"></div>' . "\n";
332
/**/
333
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
334
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_first_name", get_defined_vars ());
335
unset ($__refs, $__v); /* Unset defined __refs, __v. */
336
/**/
338
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_first_name" id="ws-plugin--s2member-custom-reg-field-first-name" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_first_name"]) . '" />' . "\n";
339
echo '<br />' . "\n";
340
/**/
341
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
342
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_first_name", get_defined_vars ());
343
unset ($__refs, $__v); /* Unset defined __refs, __v. */
344
/**/
345
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
346
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_last_name", get_defined_vars ());
347
unset ($__refs, $__v); /* Unset defined __refs, __v. */
348
/**/
350
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_last_name" id="ws-plugin--s2member-custom-reg-field-last-name" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_last_name"]) . '" />' . "\n";
351
echo '<br />' . "\n";
352
/**/
353
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
354
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_last_name", get_defined_vars ());
355
unset ($__refs, $__v); /* Unset defined __refs, __v. */
356
}
359
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level ("auto-detection", "registration"))
360
foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
361
{
362
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
363
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_custom_fields", get_defined_vars ());
364
unset ($__refs, $__v); /* Unset defined __refs, __v. */
365
/**/
368
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field["id"]));
369
$field_id_class = preg_replace ("/_/", "-", $field_var);
370
/**/
371
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
372
if (apply_filters ("ws_plugin__s2member_during_ms_custom_registration_fields_during_custom_fields_display", true, get_defined_vars ()))
373
{
374
if (!empty ($field["section"]) && $field["section"] === "yes") /* Starts a new section? */
381
unset ($__refs, $__v); /* Unset defined __refs, __v. */
382
}
383
/**/
384
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
385
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_custom_fields", get_defined_vars ());
386
unset ($__refs, $__v); /* Unset defined __refs, __v. */
387
}
388
/**/
389
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && c_ws_plugin__s2member_list_servers::list_servers_integrated ())
390
{
391
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
392
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_opt_in", get_defined_vars ());
393
unset ($__refs, $__v); /* Unset defined __refs, __v. */
394
/**/
398
echo '</label>' . "\n";
399
echo '<br />' . "\n";
400
/**/
401
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
402
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_opt_in", get_defined_vars ());
403
unset ($__refs, $__v); /* Unset defined __refs, __v. */
404
}
405
/**/
406
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
407
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after", get_defined_vars ());
408
unset ($__refs, $__v); /* Unset defined __refs, __v. */
409
}
410
/**/
411
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
412
do_action ("ws_plugin__s2member_after_ms_custom_registration_fields", get_defined_vars ());
413
unset ($__refs, $__v); /* Unset defined __refs, __v. */
414
/**/
436
/**/
437
$tabindex = 20; /* Incremented tabindex starting with 20. */
438
/**/
439
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
440
do_action ("ws_plugin__s2member_during_custom_registration_fields_before", get_defined_vars ());
441
unset ($__refs, $__v); /* Unset defined __refs, __v. */
442
/**/
443
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
444
{
445
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
446
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_user_pass", get_defined_vars ());
447
unset ($__refs, $__v); /* Unset defined __refs, __v. */
448
/**/
461
/**/
462
echo '</p>' . "\n";
463
/**/
464
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
465
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_user_pass", get_defined_vars ());
466
unset ($__refs, $__v); /* Unset defined __refs, __v. */
467
}
470
{
471
echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section"></div>' . "\n";
472
/**/
473
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
474
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_first_name", get_defined_vars ());
475
unset ($__refs, $__v); /* Unset defined __refs, __v. */
476
/**/
481
echo '</label>' . "\n";
482
echo '</p>' . "\n";
483
/**/
484
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
485
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_first_name", get_defined_vars ());
486
unset ($__refs, $__v); /* Unset defined __refs, __v. */
487
/**/
488
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
489
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_last_name", get_defined_vars ());
490
unset ($__refs, $__v); /* Unset defined __refs, __v. */
491
/**/
496
echo '</label>' . "\n";
497
echo '</p>' . "\n";
498
/**/
499
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
500
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_last_name", get_defined_vars ());
501
unset ($__refs, $__v); /* Unset defined __refs, __v. */
502
}
505
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level ("auto-detection", "registration"))
506
foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
507
{
508
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
509
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_custom_fields", get_defined_vars ());
510
unset ($__refs, $__v); /* Unset defined __refs, __v. */
511
/**/
514
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field["id"]));
515
$field_id_class = preg_replace ("/_/", "-", $field_var);
516
/**/
517
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
518
if (apply_filters ("ws_plugin__s2member_during_custom_registration_fields_during_custom_fields_display", true, get_defined_vars ()))
519
{
520
if (!empty ($field["section"]) && $field["section"] === "yes") /* Starts a new section? */
529
unset ($__refs, $__v); /* Unset defined __refs, __v. */
530
}
531
/**/
532
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
533
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_custom_fields", get_defined_vars ());
534
unset ($__refs, $__v); /* Unset defined __refs, __v. */
535
}
536
/**/
537
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && c_ws_plugin__s2member_list_servers::list_servers_integrated ())
538
{
539
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
540
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_opt_in", get_defined_vars ());
541
unset ($__refs, $__v); /* Unset defined __refs, __v. */
542
/**/
547
echo '</label>' . "\n";
548
echo '</p>' . "\n";
549
/**/
550
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
551
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_opt_in", get_defined_vars ());
552
unset ($__refs, $__v); /* Unset defined __refs, __v. */
553
}
554
/**/
555
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
556
do_action ("ws_plugin__s2member_during_custom_registration_fields_after", get_defined_vars ());
557
unset ($__refs, $__v); /* Unset defined __refs, __v. */
558
/**/
559
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
560
do_action ("ws_plugin__s2member_after_custom_registration_fields", get_defined_vars ());
561
unset ($__refs, $__v); /* Unset defined __refs, __v. */
562
/**/
includes/classes/email-configs.inc.php CHANGED
@@ -28,6 +28,27 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
28
class c_ws_plugin__s2member_email_configs
29
{
30
/**
31
* Modifies email From: "Name" <address>.
32
*
33
* These Filters are only needed during registration.
@@ -41,7 +62,7 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
41
{
42
do_action ("ws_plugin__s2member_before_email_config", get_defined_vars ());
43
/**/
44
- c_ws_plugin__s2member_email_configs::email_config_release (); /* Release all Filters. */
45
/**/
46
add_filter ("wp_mail_from", "c_ws_plugin__s2member_email_configs::_email_config_email");
47
add_filter ("wp_mail_from_name", "c_ws_plugin__s2member_email_configs::_email_config_name");
@@ -151,6 +172,148 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
151
/**/
152
return apply_filters ("ws_plugin__s2member_ms_nice_email_roles", $message, get_defined_vars ());
153
}
154
}
155
}
156
?>
28
class c_ws_plugin__s2member_email_configs
29
{
30
/**
31
+ * Filters email addresses passed to ``wp_mail()``.
32
+ *
33
+ * @package s2Member\Email_Configs
34
+ * @since 3.5
35
+ *
36
+ * @attaches-to ``add_filter("wp_mail");``
37
+ *
38
+ * @param array $array Expects an array passed through by the Filter.
39
+ * @return array Returns the array passed through by the Filter.
40
+ */
41
+ public static function email_filter ($array = FALSE)
42
+ {
43
+ if (!empty ($array["to"]) && is_string ($array["to"]))
44
+ $array["to"] = str_replace (array ('\"', '"'), "", $array["to"]);
45
+ /**/
46
+ if (!empty ($array["to"]) && is_string ($array["to"]) && strpos ($array["to"], ";") !== false)
47
+ $array["to"] = c_ws_plugin__s2member_utils_strings::trim_deep (preg_split ("/;+/", $array["to"]));
48
+ /**/
49
+ return apply_filters ("ws_plugin__s2member_after_email_filter", $array, get_defined_vars ());
50
+ }
51
+ /**
52
* Modifies email From: "Name" <address>.
53
*
54
* These Filters are only needed during registration.
62
{
63
do_action ("ws_plugin__s2member_before_email_config", get_defined_vars ());
64
/**/
65
+ c_ws_plugin__s2member_email_configs::email_config_release (); /* Release all. */
66
/**/
67
add_filter ("wp_mail_from", "c_ws_plugin__s2member_email_configs::_email_config_email");
68
add_filter ("wp_mail_from_name", "c_ws_plugin__s2member_email_configs::_email_config_name");
172
/**/
173
return apply_filters ("ws_plugin__s2member_ms_nice_email_roles", $message, get_defined_vars ());
174
}
175
+ /**
176
+ * Handles new User notifications.
177
+ *
178
+ * @package s2Member\Email_Configs
179
+ * @since 110707
180
+ *
181
+ * @param str|int $user_id A numeric WordPress® User ID.
182
+ * @param str $user_pass Optional. A plain text version of the User's password.
183
+ * If omitted, only the administrative notification will be sent.
184
+ * @param array $notify An array of directives. Must be non-empty, with at least one of these values `user,admin`.
185
+ * @return bool True if all required parameters are supplied, else false.
186
+ */
187
+ function new_user_notification ($user_id = FALSE, $user_pass = FALSE, $notify = array ("user", "admin"))
188
+ {
189
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
190
+ do_action ("ws_plugin__s2member_before_new_user_notification", get_defined_vars ());
191
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
192
+ /**/
193
+ if ($user_id && ($user = new WP_User ($user_id)) && ($user_id = $user->ID) && is_array ($notify) && !empty ($notify))
194
+ {
195
+ if (in_array ("user", $notify) && !empty ($user_pass)) /* Send User a notification? */
196
+ {
197
+ $fields = get_user_option ("s2member_custom_fields", $user_id);
198
+ $cv = preg_split ("/\|/", get_user_option ("s2member_custom", $user_id));
199
+ $user_full_name = trim ($user->first_name . " " . $user->last_name);
200
+ $user_ip = $_SERVER["REMOTE_ADDR"];
201
+ /**/
202
+ if (($sbj = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_subject"]))
203
+ if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)))
204
+ if (($sbj = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $sbj)))
205
+ if (($sbj = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name), $sbj)))
206
+ if (($sbj = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name), $sbj)))
207
+ if (($sbj = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name), $sbj)))
208
+ if (($sbj = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $sbj)))
209
+ if (($sbj = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $sbj)))
210
+ if (($sbj = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $sbj)))
211
+ if (($sbj = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $sbj)))
212
+ if (($sbj = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $sbj)))
213
+ {
214
+ if (is_array ($fields) && !empty ($fields))
215
+ foreach ($fields as $var => $val) /* Custom Registration Fields. */
216
+ if (!($sbj = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $sbj)))
217
+ break;
218
+ /**/
219
+ if (($msg = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]))
220
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)))
221
+ if (($msg = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $msg)))
222
+ if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name), $msg)))
223
+ if (($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name), $msg)))
224
+ if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name), $msg)))
225
+ if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $msg)))
226
+ if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $msg)))
227
+ if (($msg = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $msg)))
228
+ if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $msg)))
229
+ if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $msg)))
230
+ {
231
+ if (is_array ($fields) && !empty ($fields))
232
+ foreach ($fields as $var => $val) /* Custom Registration Fields. */
233
+ if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $msg)))
234
+ break;
235
+ /**/
236
+ if (($sbj = trim (preg_replace ("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg))))
237
+ {
238
+ wp_mail ('"' . c_ws_plugin__s2member_utils_strings::esc_dq ($user_full_name) . '" <' . $user->user_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");
239
+ }
240
+ }
241
+ }
242
+ }
243
+ /**/
244
+ if (in_array ("admin", $notify) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_recipients"])
245
+ {
246
+ $fields = get_user_option ("s2member_custom_fields", $user_id);
247
+ $cv = preg_split ("/\|/", get_user_option ("s2member_custom", $user_id));
248
+ $user_full_name = trim ($user->first_name . " " . $user->last_name);
249
+ $user_ip = $_SERVER["REMOTE_ADDR"];
250
+ /**/
251
+ if (($rec = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_recipients"]))
252
+ if (($rec = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $rec)))
253
+ if (($rec = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $rec)))
254
+ if (($rec = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name)), $rec)))
255
+ if (($rec = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name)), $rec)))
256
+ if (($rec = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name)), $rec)))
257
+ if (($rec = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $rec)))
258
+ if (($rec = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $rec)))
259
+ if (($rec = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $rec)))
260
+ if (($rec = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $rec)))
261
+ if (($rec = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $rec)))
262
+ {
263
+ if (is_array ($fields) && !empty ($fields))
264
+ foreach ($fields as $var => $val) /* Custom Registration Fields. */
265
+ if (!($rec = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $rec)))
266
+ break;
267
+ /**/
268
+ if (($sbj = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_subject"]))
269
+ if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)))
270
+ if (($sbj = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $sbj)))
271
+ if (($sbj = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name), $sbj)))
272
+ if (($sbj = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name), $sbj)))
273
+ if (($sbj = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name), $sbj)))
274
+ if (($sbj = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $sbj)))
275
+ if (($sbj = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $sbj)))
276
+ if (($sbj = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $sbj)))
277
+ if (($sbj = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $sbj)))
278
+ if (($sbj = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $sbj)))
279
+ {
280
+ if (is_array ($fields) && !empty ($fields))
281
+ foreach ($fields as $var => $val) /* Custom Registration Fields. */
282
+ if (!($sbj = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $sbj)))
283
+ break;
284
+ /**/
285
+ if (($msg = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_message"]))
286
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)))
287
+ if (($msg = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $msg)))
288
+ if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name), $msg)))
289
+ if (($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name), $msg)))
290
+ if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name), $msg)))
291
+ if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $msg)))
292
+ if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $msg)))
293
+ if (($msg = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $msg)))
294
+ if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $msg)))
295
+ if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $msg)))
296
+ {
297
+ if (is_array ($fields) && !empty ($fields))
298
+ foreach ($fields as $var => $val) /* Custom Registration Fields. */
299
+ if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $msg)))
300
+ break;
301
+ /**/
302
+ if (($recipients = preg_split ("/;+/", preg_replace ("/%%(.+?)%%/i", "", $rec))) && ($sbj = trim (preg_replace ("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg))))
303
+ {
304
+ foreach (c_ws_plugin__s2member_utils_strings::trim_deep ($recipients) as $recipient)
305
+ ($recipient) ? wp_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;
306
+ }
307
+ }
308
+ }
309
+ }
310
+ }
311
+ /**/
312
+ return apply_filters ("ws_plugin__s2member_new_user_notification", true, get_defined_vars ());
313
+ }
314
+ else
315
+ return apply_filters ("ws_plugin__s2member_new_user_notification", false, get_defined_vars ());
316
+ }
317
}
318
}
319
?>
includes/classes/installation.inc.php CHANGED
@@ -35,7 +35,7 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
35
*
36
* @return null
37
*/
38
- public static function activate ()
39
{
40
global $wpdb; /* Global database object reference. */
41
global $current_site, $current_blog; /* Multisite. */
@@ -44,6 +44,8 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
44
/**/
45
c_ws_plugin__s2member_roles_caps::config_roles (); /* Config Roles/Caps. */
46
/**/
47
if (!is_dir ($files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]))
48
if (is_writable (dirname (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($files_dir))))
49
mkdir ($files_dir, 0777, true);
@@ -95,7 +97,7 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
95
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "blog:users.php", false, false, true);
96
}
97
/**/
98
- $notice = '<strong>s2Member</strong> has been <strong>re-activated</strong>, with the latest version.<br />';
99
$notice .= 'You now have version ' . esc_html (WS_PLUGIN__S2MEMBER_VERSION) . '. Your existing configuration remains.';
100
/**/
101
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) /* No Changelog on a Multisite Farm. */
@@ -189,6 +191,7 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
189
delete_option("ws_plugin__s2member_notices");
190
delete_option("ws_plugin__s2member_options");
191
delete_option("ws_plugin__s2member_configured");
192
delete_option("ws_plugin__s2member_activated_version");
193
delete_option("ws_plugin__s2member_activated_mms_version");
194
/**/
35
*
36
* @return null
37
*/
38
+ public static function activate ($reactivation_reason = FALSE)
39
{
40
global $wpdb; /* Global database object reference. */
41
global $current_site, $current_blog; /* Multisite. */
44
/**/
45
c_ws_plugin__s2member_roles_caps::config_roles (); /* Config Roles/Caps. */
46
/**/
47
+ update_option ("ws_plugin__s2member_activated_levels", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]);
48
+ /**/
49
if (!is_dir ($files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]))
50
if (is_writable (dirname (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($files_dir))))
51
mkdir ($files_dir, 0777, true);
97
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "blog:users.php", false, false, true);
98
}
99
/**/
100
+ $notice = '<strong>s2Member</strong> has been <strong>reactivated</strong>, with ' . (($reactivation_reason === "levels") ? '<code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) . '</code> Membership Levels' : 'the latest version') . '.<br />';
101
$notice .= 'You now have version ' . esc_html (WS_PLUGIN__S2MEMBER_VERSION) . '. Your existing configuration remains.';
102
/**/
103
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) /* No Changelog on a Multisite Farm. */
191
delete_option("ws_plugin__s2member_notices");
192
delete_option("ws_plugin__s2member_options");
193
delete_option("ws_plugin__s2member_configured");
194
+ delete_option("ws_plugin__s2member_activated_levels");
195
delete_option("ws_plugin__s2member_activated_version");
196
delete_option("ws_plugin__s2member_activated_mms_version");
197
/**/
includes/classes/labels.inc.php CHANGED
@@ -15,7 +15,7 @@
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_labels"))
21
{
@@ -65,10 +65,10 @@ if (!class_exists ("c_ws_plugin__s2member_labels"))
65
{
66
if ($text && $context && stripos ($context, "User role") === 0 && ($role = $text))
67
{
68
- if (preg_match ("/^(Free )?Subscriber#x2F;i", $role) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"])
69
$translation = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"];
70
/**/
71
- else if (preg_match ("/^s2Member Level ([0-9]+)#x2F;i", $role, $m) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $m[1] . "_label"])
72
$translation = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $m[1] . "_label"];
73
/**/
74
$translation = apply_filters ("_ws_plugin__s2member_label_translations", $translation, get_defined_vars ());
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_labels"))
21
{
65
{
66
if ($text && $context && stripos ($context, "User role") === 0 && ($role = $text))
67
{
68
+ if (preg_match ("/^(Free )?Subscriber#x2F;i", $role) && !empty ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]))
69
$translation = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"];
70
/**/
71
+ else if (preg_match ("/^s2Member Level ([0-9]+)#x2F;i", $role, $m) && !empty ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $m[1] . "_label"]))
72
$translation = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $m[1] . "_label"];
73
/**/
74
$translation = apply_filters ("_ws_plugin__s2member_label_translations", $translation, get_defined_vars ());
includes/classes/login-customizations.inc.php CHANGED
@@ -96,7 +96,8 @@ if (!class_exists ("c_ws_plugin__s2member_login_customizations"))
96
$a[] = 'body, body * { font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_size"] . $i . '; }';
97
$a[] = 'body, body * { font-family:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_family"] . $i . '; }';
98
/**/
99
- $a[] = 'p#backtoblog a, p#backtoblog a:hover, p#backtoblog a:active, p#backtoblog a:focus { color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow:1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; top:15px' . $i . '; left:15px' . $i . '; padding:10px' . $i . '; border:1px solid #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; background-color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"] . $i . '; -moz-border-radius:3px' . $i . '; -webkit-border-radius:3px' . $i . '; border-radius:3px' . $i . '; }';
100
/**/
101
$a[] = 'div#login { width:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_width"] . 'px' . $i . '; }';
102
$a[] = 'div#login h1 a { background:url(' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src"] . ') no-repeat top center' . $i . '; }';
@@ -105,6 +106,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_customizations"))
105
$a[] = 'div#login form { -moz-box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; -webkit-box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; }';
106
/**/
107
$a[] = 'div#login p#nav, div#login p#nav a, div#login p#nav a:hover, div#login p#nav a:active, div#login p#nav a:focus { color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow:1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; }';
108
/**/
109
$a[] = 'div#login form p { margin:2px 0 16px 0' . $i . '; }'; /* Handles paragraph margins inside the form. */
110
$a[] = 'div#login form input[type="text"], div#login form input[type="password"], div#login form textarea, div#login form select { font-weight:normal' . $i . '; color:#333333' . $i . '; background:none repeat scroll 0 0 #FBFBFB' . $i . '; border:1px solid #E5E5E5' . $i . '; font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_field_size"] . $i . '; margin:0' . $i . '; padding:3px' . $i . '; -moz-border-radius:3px' . $i . '; -webkit-border-radius:3px' . $i . '; border-radius:3px' . $i . '; width:100%' . $i . '; width:98%' . $i . ' !ie<8; margin-right:2%' . $i . ' !ie<8; box-sizing:border-box' . $i . '; -ms-box-sizing:border-box' . $i . '; -moz-box-sizing:border-box' . $i . '; -webkit-box-sizing:border-box' . $i . '; }';
96
$a[] = 'body, body * { font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_size"] . $i . '; }';
97
$a[] = 'body, body * { font-family:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_family"] . $i . '; }';
98
/**/
99
+ if (!version_compare (get_bloginfo ("version"), "3.2-RC4", ">=")) /* Backward compatibility. */
100
+ $a[] = 'p#backtoblog a, p#backtoblog a:hover, p#backtoblog a:active, p#backtoblog a:focus { color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow:1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; top:15px' . $i . '; left:15px' . $i . '; padding:10px' . $i . '; border:1px solid #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; background-color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"] . $i . '; -moz-border-radius:3px' . $i . '; -webkit-border-radius:3px' . $i . '; border-radius:3px' . $i . '; }';
101
/**/
102
$a[] = 'div#login { width:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_width"] . 'px' . $i . '; }';
103
$a[] = 'div#login h1 a { background:url(' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src"] . ') no-repeat top center' . $i . '; }';
106
$a[] = 'div#login form { -moz-box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; -webkit-box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; }';
107
/**/
108
$a[] = 'div#login p#nav, div#login p#nav a, div#login p#nav a:hover, div#login p#nav a:active, div#login p#nav a:focus { color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow:1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; }';
109
+ $a[] = 'div#login p#backtoblog, div#login p#backtoblog a, div#login p#backtoblog a:hover, div#login p#backtoblog a:active, div#login p#backtoblog a:focus { color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow:1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; }';
110
/**/
111
$a[] = 'div#login form p { margin:2px 0 16px 0' . $i . '; }'; /* Handles paragraph margins inside the form. */
112
$a[] = 'div#login form input[type="text"], div#login form input[type="password"], div#login form textarea, div#login form select { font-weight:normal' . $i . '; color:#333333' . $i . '; background:none repeat scroll 0 0 #FBFBFB' . $i . '; border:1px solid #E5E5E5' . $i . '; font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_field_size"] . $i . '; margin:0' . $i . '; padding:3px' . $i . '; -moz-border-radius:3px' . $i . '; -webkit-border-radius:3px' . $i . '; border-radius:3px' . $i . '; width:100%' . $i . '; width:98%' . $i . ' !ie<8; margin-right:2%' . $i . ' !ie<8; box-sizing:border-box' . $i . '; -ms-box-sizing:border-box' . $i . '; -moz-box-sizing:border-box' . $i . '; -webkit-box-sizing:border-box' . $i . '; }';
includes/classes/meta-box-saves.inc.php CHANGED
@@ -56,28 +56,19 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
56
{
57
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
58
{
59
- $pages["0"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"]));
60
- $pages["1"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"]));
61
- $pages["2"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"]));
62
- $pages["3"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"]));
63
- $pages["4"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"]));
64
/**/
65
- if (($i = array_search ($page_id, $pages["0"])) !== false) /* Remove $page_id. */
66
- unset ($pages["0"][$i]);
67
- else if (($i = array_search ($page_id, $pages["1"])) !== false)
68
- unset ($pages["1"][$i]);
69
- else if (($i = array_search ($page_id, $pages["2"])) !== false)
70
- unset ($pages["2"][$i]);
71
- else if (($i = array_search ($page_id, $pages["3"])) !== false)
72
- unset ($pages["3"][$i]);
73
- else if (($i = array_search ($page_id, $pages["4"])) !== false)
74
- unset ($pages["4"][$i]);
75
/**/
76
- if (strlen ($_p["ws_plugin__s2member_security_meta_box_level"]) && is_array ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]))
77
if ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
78
array_push ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]], $page_id);
79
/**/
80
- $new_options = array_merge ((array)$new_options, array ("ws_plugin__s2member_level0_pages" => implode (",", $pages["0"]), "ws_plugin__s2member_level1_pages" => implode (",", $pages["1"]), "ws_plugin__s2member_level2_pages" => implode (",", $pages["2"]), "ws_plugin__s2member_level3_pages" => implode (",", $pages["3"]), "ws_plugin__s2member_level4_pages" => implode (",", $pages["4"])));
81
/**/
82
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
83
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
@@ -91,28 +82,19 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
91
{
92
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
93
{
94
- $posts["0"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_posts"]));
95
- $posts["1"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"]));
96
- $posts["2"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"]));
97
- $posts["3"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"]));
98
- $posts["4"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"]));
99
/**/
100
- if (($i = array_search ($post_id, $posts["0"])) !== false) /* Remove $post_id. */
101
- unset ($posts["0"][$i]);
102
- else if (($i = array_search ($post_id, $posts["1"])) !== false)
103
- unset ($posts["1"][$i]);
104
- else if (($i = array_search ($post_id, $posts["2"])) !== false)
105
- unset ($posts["2"][$i]);
106
- else if (($i = array_search ($post_id, $posts["3"])) !== false)
107
- unset ($posts["3"][$i]);
108
- else if (($i = array_search ($post_id, $posts["4"])) !== false)
109
- unset ($posts["4"][$i]);
110
/**/
111
- if (strlen ($_p["ws_plugin__s2member_security_meta_box_level"]) && is_array ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]))
112
if ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
113
array_push ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]], $post_id);
114
/**/
115
- $new_options = array_merge ((array)$new_options, array ("ws_plugin__s2member_level0_posts" => implode (",", $posts["0"]), "ws_plugin__s2member_level1_posts" => implode (",", $posts["1"]), "ws_plugin__s2member_level2_posts" => implode (",", $posts["2"]), "ws_plugin__s2member_level3_posts" => implode (",", $posts["3"]), "ws_plugin__s2member_level4_posts" => implode (",", $posts["4"])));
116
/**/
117
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
118
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
56
{
57
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
58
{
59
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
60
+ $pages[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
61
/**/
62
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
63
+ if (($i = array_search ($page_id, $pages[$n])) !== false)
64
+ unset ($pages[$n][$i]);
65
/**/
66
+ if (isset ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]) && is_array ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]))
67
if ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
68
array_push ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]], $page_id);
69
/**/
70
+ for ($n = 0, $new_options = array (); $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
71
+ $new_options = array_merge ($new_options, array ("ws_plugin__s2member_level" . $n . "_pages" => trim (implode (",", $pages[$n]))));
72
/**/
73
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
74
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
82
{
83
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
84
{
85
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
86
+ $posts[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
87
/**/
88
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
89
+ if (($i = array_search ($post_id, $posts[$n])) !== false)
90
+ unset ($posts[$n][$i]);
91
/**/
92
+ if (isset ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]) && is_array ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]))
93
if ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
94
array_push ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]], $post_id);
95
/**/
96
+ for ($n = 0, $new_options = array (); $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
97
+ $new_options = array_merge ($new_options, array ("ws_plugin__s2member_level" . $n . "_posts" => trim (implode (",", $posts[$n]))));
98
/**/
99
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
100
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
includes/classes/meta-box-security.inc.php CHANGED
@@ -46,26 +46,22 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
46
{
47
if ($post->post_type === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
48
{
49
- if (!in_array ($page_id, array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])))
50
{
51
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save" id="ws-plugin--s2member-security-meta-box-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-security-meta-box-save")) . '" />' . "\n";
52
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save_id" id="ws-plugin--s2member-security-meta-box-save-id" value="' . esc_attr ($page_id) . '" />' . "\n";
53
/**/
54
- $pages["0"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"]);
55
- $pages["1"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"]);
56
- $pages["2"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"]);
57
- $pages["3"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"]);
58
- $pages["4"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"]);
59
/**/
60
echo '<p style="margin-left:2px;"><strong>Page Level Restriction?</strong></p>' . "\n";
61
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
62
echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
63
echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
64
- echo ($pages["0"] !== array ("all")) ? '<option value="0"' . ((in_array ($page_id, $pages["0"])) ? ' selected="selected"' : '') . '>Require Level# 0 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #0 ( already protects "all" Pages )</option>';
65
- echo ($pages["1"] !== array ("all")) ? '<option value="1"' . ((in_array ($page_id, $pages["1"])) ? ' selected="selected"' : '') . '>Require Level# 1 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #1 ( already protects "all" Pages )</option>';
66
- echo ($pages["2"] !== array ("all")) ? '<option value="2"' . ((in_array ($page_id, $pages["2"])) ? ' selected="selected"' : '') . '>Require Level# 2 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #2 ( already protects "all" Pages )</option>';
67
- echo ($pages["3"] !== array ("all")) ? '<option value="3"' . ((in_array ($page_id, $pages["3"])) ? ' selected="selected"' : '') . '>Require Level# 3 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #3 ( already protects "all" Pages )</option>';
68
- echo ($pages["4"] !== array ("all")) ? '<option value="4"' . ((in_array ($page_id, $pages["4"])) ? ' selected="selected"' : '') . '>Require Level# 4 ( highest level )</option>' . "\n" : '<option value="" disabled="disabled">Level #4 ( already protects "all" Pages )</option>';
69
echo '</select><br /><small>* see: <code>General Options -> Page Level Access</code></small>' . "\n";
70
/**/
71
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
@@ -73,10 +69,11 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
73
{
74
echo '<p style="margin-top:15px; margin-left:2px;"><strong>Require Custom Capabilities?</strong></p>' . "\n";
75
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-ccaps">Custom Capabilities?</label>' . "\n";
76
- echo '<input type="text" name="ws_plugin__s2member_security_meta_box_ccaps" id="ws-plugin--s2member-security-meta-box-ccaps" value="' . format_to_edit (implode (",", (array)get_post_meta ($page_id, "s2member_ccaps_req", true))) . '" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" style="width:99%;" />' . "\n";
77
echo '<br /><small>* see: <code>API Scripting -> Custom Capabilities</code></small>' . "\n";
78
}
79
}
80
else if ($page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
81
echo 'This Page is your:<br /><strong>Membership Options Page</strong><br />( always publicly available )';
82
/**/
@@ -85,37 +82,42 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
85
/**/
86
else if ($page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
87
echo 'This Page is your:<br /><strong>Download Limit Exceeded Page</strong><br />( automatically guarded by s2Member )';
88
}
89
else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
90
{
91
- echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save" id="ws-plugin--s2member-security-meta-box-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-security-meta-box-save")) . '" />' . "\n";
92
- echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save_id" id="ws-plugin--s2member-security-meta-box-save-id" value="' . esc_attr ($post_id) . '" />' . "\n";
93
- /**/
94
- $posts["0"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_posts"]);
95
- $posts["1"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"]);
96
- $posts["2"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"]);
97
- $posts["3"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"]);
98
- $posts["4"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"]);
99
- /**/
100
- echo '<p style="margin-left:2px;"><strong>Post Level Restriction?</strong></p>' . "\n"; /* This allows a site owner to automatically add a Page/Post into their s2Member options. */
101
- echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
102
- echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
103
- echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
104
- echo ($posts["0"] !== array ("all")) ? '<option value="0"' . ((in_array ($post_id, $posts["0"])) ? ' selected="selected"' : '') . '>Require Level# 0 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #0 ( already protects "all" Posts )</option>';
105
- echo ($posts["1"] !== array ("all")) ? '<option value="1"' . ((in_array ($post_id, $posts["1"])) ? ' selected="selected"' : '') . '>Require Level# 1 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #1 ( already protects "all" Posts )</option>';
106
- echo ($posts["2"] !== array ("all")) ? '<option value="2"' . ((in_array ($post_id, $posts["2"])) ? ' selected="selected"' : '') . '>Require Level# 2 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #2 ( already protects "all" Posts )</option>';
107
- echo ($posts["3"] !== array ("all")) ? '<option value="3"' . ((in_array ($post_id, $posts["3"])) ? ' selected="selected"' : '') . '>Require Level# 3 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #3 ( already protects "all" Posts )</option>';
108
- echo ($posts["4"] !== array ("all")) ? '<option value="4"' . ((in_array ($post_id, $posts["4"])) ? ' selected="selected"' : '') . '>Require Level# 4 ( highest level )</option>' . "\n" : '<option value="" disabled="disabled">Level #4 ( already protects "all" Posts )</option>';
109
- echo '</select><br /><small>* see: <code>General Options -> Post Level Access</code></small>' . "\n";
110
- /**/
111
- if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
112
- /* ^ Will change once Custom Capabilities are compatible with a Blog Farm. */
113
{
114
- echo '<p style="margin-top:15px; margin-left:2px;"><strong>Require Custom Capabilities?</strong></p>' . "\n";
115
- echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-ccaps">Custom Capabilities?</label>' . "\n";
116
- echo '<input type="text" name="ws_plugin__s2member_security_meta_box_ccaps" id="ws-plugin--s2member-security-meta-box-ccaps" value="' . format_to_edit (implode (",", (array)get_post_meta ($post_id, "s2member_ccaps_req", true))) . '" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" style="width:99%;" />' . "\n";
117
- echo '<br /><small>* see: <code>API Scripting -> Custom Capabilities</code></small>' . "\n";
118
}
119
}
120
}
121
/**/
46
{
47
if ($post->post_type === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
48
{
49
+ if (!in_array ($page_id, array_merge (array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]), preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]))))
50
{
51
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save" id="ws-plugin--s2member-security-meta-box-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-security-meta-box-save")) . '" />' . "\n";
52
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save_id" id="ws-plugin--s2member-security-meta-box-save-id" value="' . esc_attr ($page_id) . '" />' . "\n";
53
/**/
54
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
55
+ $pages[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
56
/**/
57
echo '<p style="margin-left:2px;"><strong>Page Level Restriction?</strong></p>' . "\n";
58
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
59
echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
60
echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
61
+ /**/
62
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
63
+ echo ($pages[$n] !== array ("all")) ? '<option value="' . $n . '"' . ((in_array ($page_id, $pages[$n])) ? ' selected="selected"' : '') . '>' . (($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Require Highest Level #' . $n : 'Require Level #' . $n . ' ( or higher )') . '</option>' . "\n" : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Pages )</option>' . "\n";
64
+ /**/
65
echo '</select><br /><small>* see: <code>General Options -> Page Level Access</code></small>' . "\n";
66
/**/
67
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
69
{
70
echo '<p style="margin-top:15px; margin-left:2px;"><strong>Require Custom Capabilities?</strong></p>' . "\n";
71
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-ccaps">Custom Capabilities?</label>' . "\n";
72
+ echo '<input type="text" name="ws_plugin__s2member_security_meta_box_ccaps" id="ws-plugin--s2member-security-meta-box-ccaps" value="' . format_to_edit (trim (implode (",", (array)get_post_meta ($page_id, "s2member_ccaps_req", true)))) . '" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" style="width:99%;" />' . "\n";
73
echo '<br /><small>* see: <code>API Scripting -> Custom Capabilities</code></small>' . "\n";
74
}
75
}
76
+ /**/
77
else if ($page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
78
echo 'This Page is your:<br /><strong>Membership Options Page</strong><br />( always publicly available )';
79
/**/
82
/**/
83
else if ($page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
84
echo 'This Page is your:<br /><strong>Download Limit Exceeded Page</strong><br />( automatically guarded by s2Member )';
85
+ /**/
86
+ else if (in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])))
87
+ echo 'This Page is a:<br /><strong>Specific Post/Page for sale</strong><br />( already guarded by s2Member )';
88
}
89
else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
90
{
91
+ if (!in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])))
92
{
93
+ echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save" id="ws-plugin--s2member-security-meta-box-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-security-meta-box-save")) . '" />' . "\n";
94
+ echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save_id" id="ws-plugin--s2member-security-meta-box-save-id" value="' . esc_attr ($post_id) . '" />' . "\n";
95
+ /**/
96
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
97
+ $posts[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
98
+ /**/
99
+ echo '<p style="margin-left:2px;"><strong>Post Level Restriction?</strong></p>' . "\n";
100
+ echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
101
+ echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
102
+ echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
103
+ /**/
104
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
105
+ echo ($posts[$n] !== array ("all")) ? '<option value="' . $n . '"' . ((in_array ($post_id, $posts[$n])) ? ' selected="selected"' : '') . '>' . (($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Require Highest Level #' . $n : 'Require Level #' . $n . ' ( or higher )') . '</option>' . "\n" : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Posts )</option>' . "\n";
106
+ /**/
107
+ echo '</select><br /><small>* see: <code>General Options -> Post Level Access</code></small>' . "\n";
108
+ /**/
109
+ if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
110
+ /* ^ Will change once Custom Capabilities are compatible with a Blog Farm. */
111
+ {
112
+ echo '<p style="margin-top:15px; margin-left:2px;"><strong>Require Custom Capabilities?</strong></p>' . "\n";
113
+ echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-ccaps">Custom Capabilities?</label>' . "\n";
114
+ echo '<input type="text" name="ws_plugin__s2member_security_meta_box_ccaps" id="ws-plugin--s2member-security-meta-box-ccaps" value="' . format_to_edit (trim (implode (",", (array)get_post_meta ($post_id, "s2member_ccaps_req", true)))) . '" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" style="width:99%;" />' . "\n";
115
+ echo '<br /><small>* see: <code>API Scripting -> Custom Capabilities</code></small>' . "\n";
116
+ }
117
}
118
+ /**/
119
+ else if (in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])))
120
+ echo 'This Post is a:<br /><strong>Specific Post/Page for sale</strong><br />( already guarded by s2Member )';
121
}
122
}
123
/**/
includes/classes/option-forces.inc.php CHANGED
@@ -143,7 +143,7 @@ if (!class_exists ("c_ws_plugin__s2member_option_forces"))
143
else if (!is_admin () && !$users_can_register) /* Do NOT run these security checks on option pages; it's confusing to a site owner. */
144
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || !is_main_site () || is_super_admin () || current_user_can ("create_users"))
145
{
146
- if ((is_multisite () && is_super_admin ()) || current_user_can ("create_users") || (($subscr_gateway = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_subscr_gateway"])) && ($subscr_id = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_subscr_id"])) && preg_match ("/^" . preg_quote (preg_replace ("/\:([0-9]+)#x2F;", "", $_SERVER["HTTP_HOST"]), "/") . "/i", ($custom = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_custom"]))) && preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", ($level = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_level"]))) && !($exists = $wpdb->get_var ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))))
147
{
148
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "1"), get_defined_vars ());
149
}
@@ -181,17 +181,15 @@ if (!class_exists ("c_ws_plugin__s2member_option_forces"))
181
/**/
182
else if (!is_admin () && $users_can_register !== "all") /* Do NOT run these checks on option pages; it's confusing to a site owner. */
183
{
184
- if (is_super_admin () || current_user_can ("create_users") || (($subscr_gateway = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_subscr_gateway"])) && ($subscr_id = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_subscr_id"])) && preg_match ("/^" . preg_quote (preg_replace ("/\:([0-9]+)#x2F;", "", $_SERVER["HTTP_HOST"]), "/") . "/i", ($custom = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_custom"]))) && preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", ($level = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_level"]))) && !($exists = $wpdb->get_var ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))))
185
{
186
if (is_super_admin () || current_user_can ("create_users")) /* Either a Super Administrator, or an Administrator that can create. */
187
{
188
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
189
}
190
- else if ($subscr_gateway && $subscr_id && $custom && $level) /* A paying Customer? Cookies already authenticated above. */
191
{
192
- list ($level) = preg_split ("/\:/", $level, 1); /* Parse out the Membership Level now. We'll need this below. */
193
- /**/
194
- if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . $level]) /* Blog(s) allowed? */
195
{
196
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
197
}
143
else if (!is_admin () && !$users_can_register) /* Do NOT run these security checks on option pages; it's confusing to a site owner. */
144
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || !is_main_site () || is_super_admin () || current_user_can ("create_users"))
145
{
146
+ if ((is_multisite () && is_super_admin ()) || current_user_can ("create_users") || c_ws_plugin__s2member_register_access::reg_cookies_ok ())
147
{
148
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "1"), get_defined_vars ());
149
}
181
/**/
182
else if (!is_admin () && $users_can_register !== "all") /* Do NOT run these checks on option pages; it's confusing to a site owner. */
183
{
184
+ if (is_super_admin () || current_user_can ("create_users") || (($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok ()) && extract ($reg_cookies)))
185
{
186
if (is_super_admin () || current_user_can ("create_users")) /* Either a Super Administrator, or an Administrator that can create. */
187
{
188
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
189
}
190
+ else if (!empty ($reg_cookies) && preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $item_number, $m) && !empty ($m[1]) && is_numeric ($level = $m[1]))
191
{
192
+ if (!empty ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . $level])) /* Blog(s)? */
193
{
194
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
195
}
includes/classes/paypal-notify-in.inc.php CHANGED
@@ -15,7 +15,7 @@
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit ("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
21
{
@@ -58,7 +58,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
58
/**/
59
if (!empty ($_GET["s2member_paypal_notify"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || $_GET["s2member_paypal_proxy"]))
60
{
61
- @ignore_user_abort (true); /* Important. Continue processing even if/when the connection is broken by the sending party. */
62
/**/
63
include_once ABSPATH . "wp-admin/includes/admin.php"; /* Get administrative functions. Needed for `wp_delete_user()`. */
64
/**/
@@ -85,7 +85,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
85
/*
86
Custom conditionals can be applied by Filters.
87
*/
88
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
89
if (!apply_filters ("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars ()))
90
{
91
unset ($__refs, $__v); /* Unset defined __refs, __v. */
@@ -99,7 +99,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
99
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
100
&& ($paypal["txn_id"])/**/)
101
{
102
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
103
do_action ("ws_plugin__s2member_during_paypal_notify_before_virtual_terminal", get_defined_vars ());
104
unset ($__refs, $__v); /* Unset defined __refs, __v. */
105
/**/
@@ -109,11 +109,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
109
/**/
110
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
111
/**/
112
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
113
do_action ("ws_plugin__s2member_during_paypal_notify_during_virtual_terminal", get_defined_vars ());
114
unset ($__refs, $__v); /* Unset defined __refs, __v. */
115
/**/
116
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
117
do_action ("ws_plugin__s2member_during_paypal_notify_after_virtual_terminal", get_defined_vars ());
118
unset ($__refs, $__v); /* Unset defined __refs, __v. */
119
}
@@ -127,7 +127,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
127
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
128
&& ($paypal["txn_id"])/**/)
129
{
130
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
131
do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
132
unset ($__refs, $__v); /* Unset defined __refs, __v. */
133
/**/
@@ -138,11 +138,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
138
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
139
$paypal["s2member_log"][] = "s2Member Pro handles Express Checkout events on-site, with an IPN proxy.";
140
/**/
141
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
142
do_action ("ws_plugin__s2member_during_paypal_notify_during_express_checkout", get_defined_vars ());
143
unset ($__refs, $__v); /* Unset defined __refs, __v. */
144
/**/
145
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
146
do_action ("ws_plugin__s2member_during_paypal_notify_after_express_checkout", get_defined_vars ());
147
unset ($__refs, $__v); /* Unset defined __refs, __v. */
148
}
@@ -156,7 +156,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
156
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
157
&& ($paypal["txn_id"])/**/)
158
{
159
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
160
do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
161
unset ($__refs, $__v); /* Unset defined __refs, __v. */
162
/**/
@@ -167,11 +167,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
167
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
168
$paypal["s2member_log"][] = "s2Member Pro handles Cart events on-site, with an IPN proxy.";
169
/**/
170
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
171
do_action ("ws_plugin__s2member_during_paypal_notify_during_cart", get_defined_vars ());
172
unset ($__refs, $__v); /* Unset defined __refs, __v. */
173
/**/
174
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
175
do_action ("ws_plugin__s2member_during_paypal_notify_after_cart", get_defined_vars ());
176
unset ($__refs, $__v); /* Unset defined __refs, __v. */
177
}
@@ -185,7 +185,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
185
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
186
&& ($paypal["txn_id"])/**/)
187
{
188
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
189
do_action ("ws_plugin__s2member_during_paypal_notify_before_send_money", get_defined_vars ());
190
unset ($__refs, $__v); /* Unset defined __refs, __v. */
191
/**/
@@ -195,11 +195,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
195
/**/
196
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
197
/**/
198
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
199
do_action ("ws_plugin__s2member_during_paypal_notify_during_send_money", get_defined_vars ());
200
unset ($__refs, $__v); /* Unset defined __refs, __v. */
201
/**/
202
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
203
do_action ("ws_plugin__s2member_during_paypal_notify_after_send_money", get_defined_vars ());
204
unset ($__refs, $__v); /* Unset defined __refs, __v. */
205
}
@@ -207,11 +207,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
207
Specific Post/Page Access ~ Sales.
208
*/
209
else if (/**/(preg_match ("/^web_accept#x2F;i", $paypal["txn_type"]))/**/
210
- && (preg_match ("/^sp\:[0-9,]+\:[0-9]+#x2F;", $paypal["item_number"]))/**/
211
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
212
&& ($paypal["payer_email"] && $paypal["txn_id"])/**/)
213
{
214
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
215
do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_access", get_defined_vars ());
216
unset ($__refs, $__v); /* Unset defined __refs, __v. */
217
/**/
@@ -375,14 +375,14 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
375
}
376
}
377
/**/
378
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
379
do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_access", get_defined_vars ());
380
unset ($__refs, $__v); /* Unset defined __refs, __v. */
381
}
382
else
383
$paypal["s2member_log"][] = "Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?";
384
/**/
385
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
386
do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_access", get_defined_vars ());
387
unset ($__refs, $__v); /* Unset defined __refs, __v. */
388
}
@@ -392,12 +392,12 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
392
( option_name1, option_selection1 ); which allow account modifications.
393
*/
394
else if (/**/(preg_match ("/^(web_accept|subscr_signup)#x2F;i", $paypal["txn_type"]))/**/
395
- && (preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"]))/**/
396
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
397
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
398
&& ($paypal["payer_email"])/**/)
399
{
400
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
401
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup", get_defined_vars ());
402
unset ($__refs, $__v); /* Unset defined __refs, __v. */
403
/**/
@@ -423,7 +423,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
423
$paypal["regular_term"] = $paypal["period3"]; /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
424
$paypal["recurring"] = ($paypal["recurring"]) ? $paypal["mc_amount3"] : "0"; /* If non-recurring, this should be zero, otherwise Regular. */
425
/**/
426
- eval ('$ipn_signup_vars = $paypal; unset($ipn_signup_vars["s2member_log"]);'); /* Create array of IPN signup vars w/o s2member_log. */
427
/*
428
New Subscription with advanced update vars ( option_name1, option_selection1 )? These variables are used in Subscr. Modifications.
429
*/
@@ -431,7 +431,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
431
/* 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.
432
PayPal® will not allow the `modify=1|2` parameter to be used in those scenarios, because technically there is no billing to update; only the account. */
433
{
434
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
435
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_w_update_vars", get_defined_vars ());
436
unset ($__refs, $__v); /* Unset defined __refs, __v. */
437
/**/
@@ -444,7 +444,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
444
{
445
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
446
/**/
447
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
448
do_action ("ws_plugin__s2member_during_paypal_notify_during_before_subscr_signup_w_update_vars", get_defined_vars ());
449
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), "ipn-upgrade-downgrade", "modification", "s2member_level" . $paypal["level"]);
450
unset ($__refs, $__v); /* Unset defined __refs, __v. */
@@ -455,7 +455,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
455
/**/
456
if (is_multisite () && !is_user_member_of_blog ($user_id))
457
{
458
- add_existing_user_to_blog (array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
459
$user = new WP_User ($user_id);
460
}
461
/**/
@@ -607,7 +607,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
607
$paypal["s2member_log"][] = "Modification Notification Emails have been processed.";
608
}
609
/**/
610
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
611
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars", get_defined_vars ());
612
unset ($__refs, $__v); /* Unset defined __refs, __v. */
613
}
@@ -617,7 +617,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
617
else
618
$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.";
619
/**/
620
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
621
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_w_update_vars", get_defined_vars ());
622
unset ($__refs, $__v); /* Unset defined __refs, __v. */
623
}
@@ -626,7 +626,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
626
*/
627
else /* Else this is a normal Subscription signup, we are not updating anything. */
628
{
629
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
630
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_wo_update_vars", get_defined_vars ());
631
unset ($__refs, $__v); /* Unset defined __refs, __v. */
632
/**/
@@ -764,14 +764,14 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
764
}
765
}
766
/**/
767
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
768
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars", get_defined_vars ());
769
unset ($__refs, $__v); /* Unset defined __refs, __v. */
770
}
771
else
772
$paypal["s2member_log"][] = "Unable to generate Registration URL for Membership Access. Possible data corruption within the IPN response.";
773
/**/
774
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
775
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_wo_update_vars", get_defined_vars ());
776
unset ($__refs, $__v); /* Unset defined __refs, __v. */
777
}
@@ -960,7 +960,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
960
set_transient ("s2m_" . md5 ("s2member_transient_ipn_signup_vars_" . $paypal["subscr_id"]), $ipn_signup_vars, 43200);
961
}
962
/**/
963
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
964
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
965
unset ($__refs, $__v); /* Unset defined __refs, __v. */
966
}
@@ -972,12 +972,12 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
972
*/
973
else if (/**/(preg_match ("/^recurring_payment_profile_created#x2F;i", $paypal["txn_type"]))/**/
974
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
975
- && (preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])) /* This must match a Subscription. */
976
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
977
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
978
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
979
{
980
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
981
do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
982
unset ($__refs, $__v); /* Unset defined __refs, __v. */
983
/**/
@@ -988,11 +988,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
988
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
989
$paypal["s2member_log"][] = "s2Member Pro handles this event on-site, with an IPN proxy.";
990
/**/
991
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
992
do_action ("ws_plugin__s2member_during_paypal_notify_during_recurring_payment_profile_created", get_defined_vars ());
993
unset ($__refs, $__v); /* Unset defined __refs, __v. */
994
/**/
995
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
996
do_action ("ws_plugin__s2member_during_paypal_notify_after_recurring_payment_profile_created", get_defined_vars ());
997
unset ($__refs, $__v); /* Unset defined __refs, __v. */
998
}
@@ -1000,10 +1000,10 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1000
Subscription modifications.
1001
*/
1002
else if (/**/(preg_match ("/^subscr_modify#x2F;i", $paypal["txn_type"]))/**/
1003
- && (preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"]))/**/
1004
&& ($paypal["subscr_id"] && $paypal["payer_email"])/**/)
1005
{
1006
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1007
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_modify", get_defined_vars ());
1008
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1009
/**/
@@ -1023,7 +1023,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1023
$paypal["regular_term"] = $paypal["period3"]; /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
1024
$paypal["recurring"] = ($paypal["recurring"]) ? $paypal["mc_amount3"] : "0"; /* If non-recurring, this should be zero, otherwise Regular. */
1025
/**/
1026
- eval ('$ipn_signup_vars = $paypal; unset($ipn_signup_vars["s2member_log"]);'); /* Create array of IPN signup vars w/o s2member_log. */
1027
/**/
1028
if (($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
1029
{
@@ -1031,7 +1031,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1031
{
1032
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
1033
/**/
1034
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1035
do_action ("ws_plugin__s2member_during_paypal_notify_during_before_subscr_modify", get_defined_vars ());
1036
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), "ipn-upgrade-downgrade", "modification", "s2member_level" . $paypal["level"]);
1037
unset ($__refs, $__v); /* Unset defined __refs, __v. */
@@ -1042,7 +1042,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1042
/**/
1043
if (is_multisite () && !is_user_member_of_blog ($user_id))
1044
{
1045
- add_existing_user_to_blog (array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
1046
$user = new WP_User ($user_id);
1047
}
1048
/**/
@@ -1187,7 +1187,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1187
$paypal["s2member_log"][] = "Modification Notification Emails have been processed.";
1188
}
1189
/**/
1190
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1191
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_modify", get_defined_vars ());
1192
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1193
}
@@ -1197,7 +1197,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1197
else
1198
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
1199
/**/
1200
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1201
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_modify", get_defined_vars ());
1202
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1203
}
@@ -1207,20 +1207,20 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1207
*/
1208
else if (/**/(preg_match ("/^(subscr_payment|recurring_payment)#x2F;i", $paypal["txn_type"]))/**/
1209
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
1210
- && (preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])) /* This must match a Subscription. */
1211
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
1212
&& (!preg_match ($payment_status_issues, $paypal["payment_status"])) /* Status OK? This goes thru a list of known status issues. */
1213
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
1214
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/
1215
&& ($paypal["txn_id"] && $paypal["mc_gross"])/**/)
1216
{
1217
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1218
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_payment", get_defined_vars ());
1219
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1220
/**/
1221
$paypal["s2member_log"][] = "s2Member txn_type identified as " . ($identified_as = "subscr_payment|recurring_payment") . ".";
1222
$paypal["s2member_log"][] = "Sleeping for 5 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
1223
- sleep (5); /* Sleep here for a moment. PayPal® sometimes sends a subscr_payment before the subscr_signup, subscr_modify. */
1224
/* 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. */
1225
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as " . $identified_as . ".";
1226
/**/
@@ -1346,7 +1346,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1346
$paypal["s2member_log"][] = "Payment Notification Emails have been processed.";
1347
}
1348
/**/
1349
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1350
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
1351
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1352
}
@@ -1365,7 +1365,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1365
set_transient ("s2m_" . md5 ("s2member_transient_ipn_subscr_payment_" . $paypal["subscr_id"]), $ipn, 43200);
1366
}
1367
/**/
1368
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1369
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_payment", get_defined_vars ());
1370
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1371
}
@@ -1377,12 +1377,12 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1377
*/
1378
else if (/**/(preg_match ("/^(subscr_failed|recurring_payment_failed|recurring_payment_skipped)#x2F;i", $paypal["txn_type"]))/**/
1379
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
1380
- && (preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])) /* Must match a Subscription. */
1381
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
1382
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
1383
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
1384
{
1385
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1386
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_failed", get_defined_vars ());
1387
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1388
/**/
@@ -1394,11 +1394,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1394
$paypal["s2member_log"][] = "s2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.";
1395
$paypal["s2member_log"][] = "When multiple consecutive payments fail, a special IPN response will be triggered.";
1396
/**/
1397
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1398
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_failed", get_defined_vars ());
1399
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1400
/**/
1401
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1402
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_failed", get_defined_vars ());
1403
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1404
}
@@ -1412,14 +1412,14 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1412
&& !(preg_match ("/^recurring_payment_profile_cancel#x2F;i", $paypal["txn_type"]) && preg_match ("/^failed#x2F;i", $paypal["initial_payment_status"]))
1413
/* ^^ Bypass this case ( for now ) "recurring_payment_profile_cancel" with an initial failed payment warrants an EOT instead of a cancellation. */
1414
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* item_number? */
1415
- && (preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])) /* This item_number must validate as Membership Access. */
1416
&& ($paypal["period1"] || ($paypal["period1"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period1 ($paypal)) || ($paypal["period1"] = "0 D"))/**/
1417
&& ($paypal["period3"] || ($paypal["period3"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period3 ($paypal))) /* Must have a period3 value. */
1418
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal))) /* Must have this. */
1419
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal))) /* Must have this. */
1420
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
1421
{
1422
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1423
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_cancel", get_defined_vars ());
1424
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1425
/**/
@@ -1448,7 +1448,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1448
/**/
1449
$paypal["s2member_log"][] = "Auto-EOT Time for this account: " . date ("D M j, Y g:i a T", $auto_eot_time);
1450
/**/
1451
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1452
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_cancel", get_defined_vars ());
1453
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1454
}
@@ -1539,7 +1539,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1539
else
1540
$paypal["s2member_log"][] = "Unable to handle Cancellation. Could not get the existing User ID from the DB.";
1541
/**/
1542
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1543
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_cancel", get_defined_vars ());
1544
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1545
}
@@ -1569,13 +1569,13 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1569
&& ($paypal["period1"] || ($paypal["period1"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period1 ($paypal)) || !$recurring || ($paypal["period1"] = "0 D"))/**/
1570
&& ($paypal["period3"] || ($paypal["period3"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period3 ($paypal)) || !$recurring) /* Was it even recurring? */
1571
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* Do we have a valid item_number? */
1572
- && (preg_match ("/^[1-4](\:|$)([\+a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?#x2F;", $paypal["item_number"])) /* Only for "Membership Level Access". This is NOT for Specific Posts/Pages. */
1573
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)) || ($paypal["subscr_id"] = $paypal["parent_txn_id"]))/**/
1574
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"]))/**/
1575
/* The item_name can default to HTTP_HOST because we've seen payment_status=reversed come through WITHOUT a product_name or item_name given. */
1576
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
1577
{
1578
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1579
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
1580
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1581
/**/
@@ -1591,7 +1591,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1591
$paypal["s2member_log"][] = "s2Member txn_type identified as " . ($identified_as = "(subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment) - or - recurring_payment_profile_cancel w/ initial_payment_status (failed)") . ".";
1592
/**/
1593
$paypal["s2member_log"][] = "Sleeping for 5 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
1594
- sleep (5); /* Sleep here for a moment. PayPal® sometimes sends a subscr_eot before the subscr_signup, subscr_modify. */
1595
/* 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. */
1596
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as " . $identified_as . ".";
1597
/**/
@@ -1624,7 +1624,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1624
$demotion_role = c_ws_plugin__s2member_option_forces::force_demotion_role ("subscriber");
1625
$existing_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
1626
/**/
1627
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1628
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_demote", get_defined_vars ());
1629
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), $eot_del_type, "modification", $demotion_role);
1630
do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), $eot_del_type, "modification");
@@ -1733,7 +1733,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1733
$paypal["s2member_log"][] = "EOT/Deletion Notification Emails have been processed.";
1734
}
1735
/**/
1736
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1737
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
1738
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1739
}
@@ -1745,7 +1745,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1745
$eot_del_type = $GLOBALS["ws_plugin__s2member_eot_del_type"] = /* Configure EOT/Del type. */
1746
($is_refund_or_reversal) ? "ipn-refund-reversal-deletion" : "ipn-cancellation-expiration-deletion";
1747
/**/
1748
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1749
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_delete", get_defined_vars ());
1750
do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), $eot_del_type, "removal-deletion");
1751
unset ($__refs, $__v); /* Unset defined __refs, __v. */
@@ -1759,18 +1759,18 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1759
/**/
1760
else /* Otherwise, we can actually delete them. */
1761
/* This will automatically trigger `eot_del_notification_urls` as well. */
1762
- wp_delete_user ($user_id); /* `c_ws_plugin__s2member_user_deletions::handle_user_deletions()` */
1763
/**/
1764
$paypal["s2member_log"][] = "This Member's account has been " . ((is_multisite ()) ? "removed" : "deleted") . ".";
1765
/**/
1766
$paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
1767
/**/
1768
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1769
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delete", get_defined_vars ());
1770
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1771
}
1772
/**/
1773
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1774
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot", get_defined_vars ());
1775
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1776
}
@@ -1784,7 +1784,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1784
$paypal["s2member_log"][] = "Auto-EOT is currently disabled. Skipping immediate EOT (demote|delete), for now.";
1785
$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);
1786
/**/
1787
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1788
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_disabled", get_defined_vars ());
1789
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1790
}
@@ -1806,7 +1806,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1806
/**/
1807
$paypal["s2member_log"][] = "Auto-EOT Time for this account ( delayed ), set to: " . date ("D M j, Y g:i a T", $auto_eot_time);
1808
/**/
1809
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1810
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delayed", get_defined_vars ());
1811
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1812
}
@@ -1932,12 +1932,12 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1932
$paypal["s2member_log"][] = "Refund/Reversal Notification Emails have been processed.";
1933
}
1934
/**/
1935
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1936
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
1937
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1938
}
1939
/**/
1940
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1941
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_eot", get_defined_vars ());
1942
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1943
}
@@ -1955,14 +1955,14 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
1955
practice, it never seems to happen. It's best to check the negative mc_gross amount instead.
1956
*/
1957
else if (/**/(/**/(preg_match ("/^new_case#x2F;i", $paypal["txn_type"]) && preg_match ("/^chargeback#x2F;i", $paypal["case_type"])) /* Future compatibility. */
1958
- || (preg_match ("/^(refunded|reversed|reversal)#x2F;i", $paypal["payment_status"])) /* The "txn_type" is irrelevant in all of these special cases. */)/**/
1959
- && ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* Item number required. */
1960
- && (preg_match ("/^sp\:[0-9,]+\:[0-9]+#x2F;", $paypal["item_number"])) /* Only for "Specific Post/Page Access" here. NOT for Membership ( i.e. sp:IDs:expiration hours ). */
1961
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"]))/**/
1962
/* The item_name can default to HTTP_HOST because we've seen payment_status=reversed come through WITHOUT a product_name or item_name given. */
1963
&& ($paypal["payer_email"]) && ($paypal["parent_txn_id"])/**/)
1964
{
1965
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1966
do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_refund_reversal", get_defined_vars ());
1967
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1968
/**/
@@ -2038,11 +2038,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
2038
$paypal["s2member_log"][] = "Specific Post/Page ~ Refund/Reversal Notification Emails have been processed.";
2039
}
2040
/**/
2041
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
2042
do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_refund_reversal", get_defined_vars ());
2043
unset ($__refs, $__v); /* Unset defined __refs, __v. */
2044
/**/
2045
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
2046
do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_refund_reversal", get_defined_vars ());
2047
unset ($__refs, $__v); /* Unset defined __refs, __v. */
2048
}
@@ -2106,16 +2106,16 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
2106
if (is_writable ($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files ())
2107
file_put_contents ($logs_dir . "/" . $log2, $logv . "\n" . $log4 . "\n" . var_export ($paypal, true) . "\n\n", FILE_APPEND);
2108
/**/
2109
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
2110
do_action ("ws_plugin__s2member_during_paypal_notify", get_defined_vars ());
2111
unset ($__refs, $__v); /* Unset defined __refs, __v. */
2112
/**/
2113
- header ("HTTP/1.0 200 OK"); /* Send a 200 OK status header. */
2114
- header ("Content-Type: text/plain; charset=utf-8"); /* With text/plain. */
2115
- exit ($paypal["s2member_paypal_proxy_return_url"]); /* Possible return value. */
2116
}
2117
/**/
2118
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
2119
do_action ("ws_plugin__s2member_after_paypal_notify", get_defined_vars ());
2120
unset ($__refs, $__v); /* Unset defined __refs, __v. */
2121
}
15
* @since 3.5
16
*/
17
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit("Do not access this file directly.");
19
/**/
20
if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
21
{
58
/**/
59
if (!empty ($_GET["s2member_paypal_notify"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || $_GET["s2member_paypal_proxy"]))
60
{
61
+ @ignore_user_abort(true); /* Important. Continue processing even if/when the connection is broken by the sending party. */
62
/**/
63
include_once ABSPATH . "wp-admin/includes/admin.php"; /* Get administrative functions. Needed for `wp_delete_user()`. */
64
/**/
85
/*
86
Custom conditionals can be applied by Filters.
87
*/
88
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
89
if (!apply_filters ("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars ()))
90
{
91
unset ($__refs, $__v); /* Unset defined __refs, __v. */
99
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
100
&& ($paypal["txn_id"])/**/)
101
{
102
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
103
do_action ("ws_plugin__s2member_during_paypal_notify_before_virtual_terminal", get_defined_vars ());
104
unset ($__refs, $__v); /* Unset defined __refs, __v. */
105
/**/
109
/**/
110
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
111
/**/
112
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
113
do_action ("ws_plugin__s2member_during_paypal_notify_during_virtual_terminal", get_defined_vars ());
114
unset ($__refs, $__v); /* Unset defined __refs, __v. */
115
/**/
116
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
117
do_action ("ws_plugin__s2member_during_paypal_notify_after_virtual_terminal", get_defined_vars ());
118
unset ($__refs, $__v); /* Unset defined __refs, __v. */
119
}
127
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
128
&& ($paypal["txn_id"])/**/)
129
{
130
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
131
do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
132
unset ($__refs, $__v); /* Unset defined __refs, __v. */
133
/**/
138
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
139
$paypal["s2member_log"][] = "s2Member Pro handles Express Checkout events on-site, with an IPN proxy.";
140
/**/
141
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
142
do_action ("ws_plugin__s2member_during_paypal_notify_during_express_checkout", get_defined_vars ());
143
unset ($__refs, $__v); /* Unset defined __refs, __v. */
144
/**/
145
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
146
do_action ("ws_plugin__s2member_during_paypal_notify_after_express_checkout", get_defined_vars ());
147
unset ($__refs, $__v); /* Unset defined __refs, __v. */
148
}
156
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
157
&& ($paypal["txn_id"])/**/)
158
{
159
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
160
do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
161
unset ($__refs, $__v); /* Unset defined __refs, __v. */
162
/**/
167
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
168
$paypal["s2member_log"][] = "s2Member Pro handles Cart events on-site, with an IPN proxy.";
169
/**/
170
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
171
do_action ("ws_plugin__s2member_during_paypal_notify_during_cart", get_defined_vars ());
172
unset ($__refs, $__v); /* Unset defined __refs, __v. */
173
/**/
174
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
175
do_action ("ws_plugin__s2member_during_paypal_notify_after_cart", get_defined_vars ());
176
unset ($__refs, $__v); /* Unset defined __refs, __v. */
177
}
185
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
186
&& ($paypal["txn_id"])/**/)
187
{
188
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
189
do_action ("ws_plugin__s2member_during_paypal_notify_before_send_money", get_defined_vars ());
190
unset ($__refs, $__v); /* Unset defined __refs, __v. */
191
/**/
195
/**/
196
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
197
/**/
198
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
199
do_action ("ws_plugin__s2member_during_paypal_notify_during_send_money", get_defined_vars ());
200
unset ($__refs, $__v); /* Unset defined __refs, __v. */
201
/**/
202
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
203
do_action ("ws_plugin__s2member_during_paypal_notify_after_send_money", get_defined_vars ());
204
unset ($__refs, $__v); /* Unset defined __refs, __v. */
205
}
207
Specific Post/Page Access ~ Sales.
208
*/
209
else if (/**/(preg_match ("/^web_accept#x2F;i", $paypal["txn_type"]))/**/
210
+ && (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["sp_access_item_number_regex"], $paypal["item_number"]))/**/
211
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
212
&& ($paypal["payer_email"] && $paypal["txn_id"])/**/)
213
{
214
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
215
do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_access", get_defined_vars ());
216
unset ($__refs, $__v); /* Unset defined __refs, __v. */
217
/**/
375
}
376
}
377
/**/
378
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
379
do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_access", get_defined_vars ());
380
unset ($__refs, $__v); /* Unset defined __refs, __v. */
381
}
382
else
383
$paypal["s2member_log"][] = "Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?";
384
/**/
385
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
386
do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_access", get_defined_vars ());
387
unset ($__refs, $__v); /* Unset defined __refs, __v. */
388
}
392
( option_name1, option_selection1 ); which allow account modifications.
393
*/
394
else if (/**/(preg_match ("/^(web_accept|subscr_signup)#x2F;i", $paypal["txn_type"]))/**/
395
+ && (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"]))/**/
396
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
397
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
398
&& ($paypal["payer_email"])/**/)
399
{
400
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
401
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup", get_defined_vars ());
402
unset ($__refs, $__v); /* Unset defined __refs, __v. */
403
/**/
423
$paypal["regular_term"] = $paypal["period3"]; /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
424
$paypal["recurring"] = ($paypal["recurring"]) ? $paypal["mc_amount3"] : "0"; /* If non-recurring, this should be zero, otherwise Regular. */
425
/**/
426
+ eval('$ipn_signup_vars = $paypal; unset($ipn_signup_vars["s2member_log"]);'); /* Create array of IPN signup vars w/o s2member_log. */
427
/*
428
New Subscription with advanced update vars ( option_name1, option_selection1 )? These variables are used in Subscr. Modifications.
429
*/
431
/* 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.
432
PayPal® will not allow the `modify=1|2` parameter to be used in those scenarios, because technically there is no billing to update; only the account. */
433
{
434
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
435
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_w_update_vars", get_defined_vars ());
436
unset ($__refs, $__v); /* Unset defined __refs, __v. */
437
/**/
444
{
445
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
446
/**/
447
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
448
do_action ("ws_plugin__s2member_during_paypal_notify_during_before_subscr_signup_w_update_vars", get_defined_vars ());
449
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), "ipn-upgrade-downgrade", "modification", "s2member_level" . $paypal["level"]);
450
unset ($__refs, $__v); /* Unset defined __refs, __v. */
455
/**/
456
if (is_multisite () && !is_user_member_of_blog ($user_id))
457
{
458
+ add_existing_user_to_blog(array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
459
$user = new WP_User ($user_id);
460
}
461
/**/
607
$paypal["s2member_log"][] = "Modification Notification Emails have been processed.";
608
}
609
/**/
610
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
611
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars", get_defined_vars ());
612
unset ($__refs, $__v); /* Unset defined __refs, __v. */
613
}
617
else
618
$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.";
619
/**/
620
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
621
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_w_update_vars", get_defined_vars ());
622
unset ($__refs, $__v); /* Unset defined __refs, __v. */
623
}
626
*/
627
else /* Else this is a normal Subscription signup, we are not updating anything. */
628
{
629
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
630
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_wo_update_vars", get_defined_vars ());
631
unset ($__refs, $__v); /* Unset defined __refs, __v. */
632
/**/
764
}
765
}
766
/**/
767
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
768
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars", get_defined_vars ());
769
unset ($__refs, $__v); /* Unset defined __refs, __v. */
770
}
771
else
772
$paypal["s2member_log"][] = "Unable to generate Registration URL for Membership Access. Possible data corruption within the IPN response.";
773
/**/
774
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
775
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_wo_update_vars", get_defined_vars ());
776
unset ($__refs, $__v); /* Unset defined __refs, __v. */
777
}
960
set_transient ("s2m_" . md5 ("s2member_transient_ipn_signup_vars_" . $paypal["subscr_id"]), $ipn_signup_vars, 43200);
961
}
962
/**/
963
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
964
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
965
unset ($__refs, $__v); /* Unset defined __refs, __v. */
966
}
972
*/
973
else if (/**/(preg_match ("/^recurring_payment_profile_created#x2F;i", $paypal["txn_type"]))/**/
974
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
975
+ && (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Membership. */
976
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
977
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
978
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
979
{
980
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
981
do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
982
unset ($__refs, $__v); /* Unset defined __refs, __v. */
983
/**/
988
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
989
$paypal["s2member_log"][] = "s2Member Pro handles this event on-site, with an IPN proxy.";
990
/**/
991
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
992
do_action ("ws_plugin__s2member_during_paypal_notify_during_recurring_payment_profile_created", get_defined_vars ());
993
unset ($__refs, $__v); /* Unset defined __refs, __v. */
994
/**/
995
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
996
do_action ("ws_plugin__s2member_during_paypal_notify_after_recurring_payment_profile_created", get_defined_vars ());
997
unset ($__refs, $__v); /* Unset defined __refs, __v. */
998
}
1000
Subscription modifications.
1001
*/
1002
else if (/**/(preg_match ("/^subscr_modify#x2F;i", $paypal["txn_type"]))/**/
1003
+ && (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"]))/**/
1004
&& ($paypal["subscr_id"] && $paypal["payer_email"])/**/)
1005
{
1006
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1007
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_modify", get_defined_vars ());
1008
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1009
/**/
1023
$paypal["regular_term"] = $paypal["period3"]; /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
1024
$paypal["recurring"] = ($paypal["recurring"]) ? $paypal["mc_amount3"] : "0"; /* If non-recurring, this should be zero, otherwise Regular. */
1025
/**/
1026
+ eval('$ipn_signup_vars = $paypal; unset($ipn_signup_vars["s2member_log"]);'); /* Create array of IPN signup vars w/o s2member_log. */
1027
/**/
1028
if (($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
1029
{
1031
{
1032
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
1033
/**/
1034
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1035
do_action ("ws_plugin__s2member_during_paypal_notify_during_before_subscr_modify", get_defined_vars ());
1036
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), "ipn-upgrade-downgrade", "modification", "s2member_level" . $paypal["level"]);
1037
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1042
/**/
1043
if (is_multisite () && !is_user_member_of_blog ($user_id))
1044
{
1045
+ add_existing_user_to_blog(array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
1046
$user = new WP_User ($user_id);
1047
}
1048
/**/
1187
$paypal["s2member_log"][] = "Modification Notification Emails have been processed.";
1188
}
1189
/**/
1190
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1191
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_modify", get_defined_vars ());
1192
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1193
}
1197
else
1198
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
1199
/**/
1200
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1201
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_modify", get_defined_vars ());
1202
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1203
}
1207
*/
1208
else if (/**/(preg_match ("/^(subscr_payment|recurring_payment)#x2F;i", $paypal["txn_type"]))/**/
1209
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
1210
+ && (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Membership. */
1211
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
1212
&& (!preg_match ($payment_status_issues, $paypal["payment_status"])) /* Status OK? This goes thru a list of known status issues. */
1213
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
1214
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/
1215
&& ($paypal["txn_id"] && $paypal["mc_gross"])/**/)
1216
{
1217
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1218
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_payment", get_defined_vars ());
1219
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1220
/**/
1221
$paypal["s2member_log"][] = "s2Member txn_type identified as " . ($identified_as = "subscr_payment|recurring_payment") . ".";
1222
$paypal["s2member_log"][] = "Sleeping for 5 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
1223
+ sleep(5); /* Sleep here for a moment. PayPal® sometimes sends a subscr_payment before the subscr_signup, subscr_modify. */
1224
/* 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. */
1225
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as " . $identified_as . ".";
1226
/**/
1346
$paypal["s2member_log"][] = "Payment Notification Emails have been processed.";
1347
}
1348
/**/
1349
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1350
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
1351
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1352
}
1365
set_transient ("s2m_" . md5 ("s2member_transient_ipn_subscr_payment_" . $paypal["subscr_id"]), $ipn, 43200);
1366
}
1367
/**/
1368
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1369
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_payment", get_defined_vars ());
1370
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1371
}
1377
*/
1378
else if (/**/(preg_match ("/^(subscr_failed|recurring_payment_failed|recurring_payment_skipped)#x2F;i", $paypal["txn_type"]))/**/
1379
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
1380
+ && (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Membership. */
1381
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
1382
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
1383
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
1384
{
1385
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1386
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_failed", get_defined_vars ());
1387
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1388
/**/
1394
$paypal["s2member_log"][] = "s2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.";
1395
$paypal["s2member_log"][] = "When multiple consecutive payments fail, a special IPN response will be triggered.";
1396
/**/
1397
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1398
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_failed", get_defined_vars ());
1399
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1400
/**/
1401
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1402
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_failed", get_defined_vars ());
1403
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1404
}
1412
&& !(preg_match ("/^recurring_payment_profile_cancel#x2F;i", $paypal["txn_type"]) && preg_match ("/^failed#x2F;i", $paypal["initial_payment_status"]))
1413
/* ^^ Bypass this case ( for now ) "recurring_payment_profile_cancel" with an initial failed payment warrants an EOT instead of a cancellation. */
1414
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* item_number? */
1415
+ && (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Must match Membership Access. */
1416
&& ($paypal["period1"] || ($paypal["period1"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period1 ($paypal)) || ($paypal["period1"] = "0 D"))/**/
1417
&& ($paypal["period3"] || ($paypal["period3"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period3 ($paypal))) /* Must have a period3 value. */
1418
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal))) /* Must have this. */
1419
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal))) /* Must have this. */
1420
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
1421
{
1422
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1423
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_cancel", get_defined_vars ());
1424
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1425
/**/
1448
/**/
1449
$paypal["s2member_log"][] = "Auto-EOT Time for this account: " . date ("D M j, Y g:i a T", $auto_eot_time);
1450
/**/
1451
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1452
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_cancel", get_defined_vars ());
1453
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1454
}
1539
else
1540
$paypal["s2member_log"][] = "Unable to handle Cancellation. Could not get the existing User ID from the DB.";
1541
/**/
1542
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1543
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_cancel", get_defined_vars ());
1544
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1545
}
1569
&& ($paypal["period1"] || ($paypal["period1"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period1 ($paypal)) || !$recurring || ($paypal["period1"] = "0 D"))/**/
1570
&& ($paypal["period3"] || ($paypal["period3"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period3 ($paypal)) || !$recurring) /* Was it even recurring? */
1571
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* Do we have a valid item_number? */
1572
+ && (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Only for "Membership", NOT for Specific Posts/Pages. */
1573
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)) || ($paypal["subscr_id"] = $paypal["parent_txn_id"]))/**/
1574
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"]))/**/
1575
/* The item_name can default to HTTP_HOST because we've seen payment_status=reversed come through WITHOUT a product_name or item_name given. */
1576
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
1577
{
1578
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1579
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
1580
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1581
/**/
1591
$paypal["s2member_log"][] = "s2Member txn_type identified as " . ($identified_as = "(subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment) - or - recurring_payment_profile_cancel w/ initial_payment_status (failed)") . ".";
1592
/**/
1593
$paypal["s2member_log"][] = "Sleeping for 5 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
1594
+ sleep(5); /* Sleep here for a moment. PayPal® sometimes sends a subscr_eot before the subscr_signup, subscr_modify. */
1595
/* 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. */
1596
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as " . $identified_as . ".";
1597
/**/
1624
$demotion_role = c_ws_plugin__s2member_option_forces::force_demotion_role ("subscriber");
1625
$existing_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
1626
/**/
1627
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1628
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_demote", get_defined_vars ());
1629
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), $eot_del_type, "modification", $demotion_role);
1630
do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), $eot_del_type, "modification");
1733
$paypal["s2member_log"][] = "EOT/Deletion Notification Emails have been processed.";
1734
}
1735
/**/
1736
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1737
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
1738
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1739
}
1745
$eot_del_type = $GLOBALS["ws_plugin__s2member_eot_del_type"] = /* Configure EOT/Del type. */
1746
($is_refund_or_reversal) ? "ipn-refund-reversal-deletion" : "ipn-cancellation-expiration-deletion";
1747
/**/
1748
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1749
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_delete", get_defined_vars ());
1750
do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), $eot_del_type, "removal-deletion");
1751
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1759
/**/
1760
else /* Otherwise, we can actually delete them. */
1761
/* This will automatically trigger `eot_del_notification_urls` as well. */
1762
+ wp_delete_user($user_id); /* `c_ws_plugin__s2member_user_deletions::handle_user_deletions()` */
1763
/**/
1764
$paypal["s2member_log"][] = "This Member's account has been " . ((is_multisite ()) ? "removed" : "deleted") . ".";
1765
/**/
1766
$paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
1767
/**/
1768
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1769
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delete", get_defined_vars ());
1770
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1771
}
1772
/**/
1773
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1774
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot", get_defined_vars ());
1775
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1776
}
1784
$paypal["s2member_log"][] = "Auto-EOT is currently disabled. Skipping immediate EOT (demote|delete), for now.";
1785
$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);
1786
/**/
1787
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1788
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_disabled", get_defined_vars ());
1789
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1790
}
1806
/**/
1807
$paypal["s2member_log"][] = "Auto-EOT Time for this account ( delayed ), set to: " . date ("D M j, Y g:i a T", $auto_eot_time);
1808
/**/
1809
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1810
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delayed", get_defined_vars ());
1811
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1812
}
1932
$paypal["s2member_log"][] = "Refund/Reversal Notification Emails have been processed.";
1933
}
1934
/**/
1935
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1936
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
1937
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1938
}
1939
/**/
1940
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
1941
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_eot", get_defined_vars ());
1942
unset ($__refs, $__v); /* Unset defined __refs, __v. */
1943
}
1955
practice, it never seems to happen. It's best to check the negative mc_gross amount instead.
1956
*/
1957
else if (/**/(/**/(preg_match ("/^new_case#x2F;i", $paypal["txn_type"]) && preg_match ("/^chargeback#x2F;i", $paypal["case_type"])) /* Future compatibility. */
1958
+ || (preg_match ("/^(refunded|reversed|reversal)#x2F;i", $paypal["payment_status"])) /* The "txn_type" is irrelevant in all these special situations. */)/**/
1959
+ && ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* Item number. */
1960
+ && (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["sp_access_item_number_regex"], $paypal["item_number"])) /* "Specific Post/Page Access". */
1961
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"]))/**/
1962
/* The item_name can default to HTTP_HOST because we've seen payment_status=reversed come through WITHOUT a product_name or item_name given. */
1963