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

Version Description

Download this release

Release Info

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

Code changes from version 110815 to 110912

Files changed (128) hide show
  1. includes/classes/admin-css-js-in.inc.php +24 -14
  2. includes/classes/admin-lockouts.inc.php +45 -57
  3. includes/classes/brute-force.inc.php +1 -1
  4. includes/classes/css-js-in.inc.php +49 -33
  5. includes/classes/css-js-themes.inc.php +8 -4
  6. includes/classes/custom-reg-fields.inc.php +70 -66
  7. includes/classes/email-configs.inc.php +5 -5
  8. includes/classes/files-in.inc.php +155 -164
  9. includes/classes/installation.inc.php +22 -28
  10. includes/classes/ip-restrictions.inc.php +8 -12
  11. includes/classes/labels.inc.php +3 -3
  12. includes/classes/login-customizations.inc.php +0 -3
  13. includes/classes/login-redirects.inc.php +12 -12
  14. includes/classes/menu-pages-rs.inc.php +8 -0
  15. includes/classes/menu-pages.inc.php +27 -27
  16. includes/classes/option-forces.inc.php +27 -28
  17. includes/classes/paypal-notify-in-subscr-modify-w-level.inc.php +9 -9
  18. includes/classes/paypal-notify-in-subscr-or-rp-eots-w-level.inc.php +7 -7
  19. includes/classes/paypal-notify-in-subscr-or-wa-w-level.inc.php +1 -1
  20. includes/classes/paypal-notify-in-wa-ccaps-wo-level.inc.php +1 -1
  21. includes/classes/paypal-notify-in.inc.php +12 -8
  22. includes/classes/paypal-return-in-no-tx-data.inc.php +7 -7
  23. includes/classes/paypal-return-in-proxy-ty-email.inc.php +2 -2
  24. includes/classes/paypal-return-in-proxy-x-preview.inc.php +2 -2
  25. includes/classes/paypal-return-in-subscr-modify-w-level.inc.php +15 -15
  26. includes/classes/paypal-return-in-subscr-or-wa-w-level.inc.php +28 -28
  27. includes/classes/paypal-return-in-wa-ccaps-wo-level.inc.php +17 -17
  28. includes/classes/paypal-return-in-web-accept-sp.inc.php +13 -13
  29. includes/classes/paypal-return-in.inc.php +6 -6
  30. includes/classes/paypal-utilities.inc.php +35 -31
  31. includes/classes/profile-in.inc.php +36 -34
  32. includes/classes/profile-mods-in.inc.php +13 -10
  33. includes/classes/querys.inc.php +197 -81
  34. includes/classes/readmes.inc.php +5 -5
  35. includes/classes/register-in.inc.php +9 -9
  36. includes/classes/registrations.inc.php +40 -40
  37. includes/classes/return-templates.inc.php +15 -13
  38. includes/classes/sc-keys-in.inc.php +64 -0
  39. includes/classes/sc-keys.inc.php +49 -0
  40. includes/classes/sc-paypal-button-e.inc.php +1 -1
  41. includes/classes/sc-paypal-button-in.inc.php +15 -15
  42. includes/classes/sc-profile-in.inc.php +39 -37
  43. includes/classes/sp-access.inc.php +5 -5
  44. includes/classes/ssl-in.inc.php +4 -5
  45. includes/classes/tracking-cookies-in.inc.php +13 -5
  46. includes/classes/translations.inc.php +65 -18
  47. includes/classes/user-new-in.inc.php +31 -31
  48. includes/classes/users-list-in.inc.php +51 -51
  49. includes/classes/utilities.inc.php +33 -2
  50. includes/classes/utils-captchas.inc.php +3 -2
  51. includes/classes/utils-dirs.inc.php +55 -3
  52. includes/classes/utils-gets.inc.php +48 -32
  53. includes/classes/utils-html.inc.php +8 -3
  54. includes/classes/utils-s2o.inc.php +116 -0
  55. includes/classes/utils-strings.inc.php +31 -10
  56. includes/classes/utils-time.inc.php +34 -30
  57. includes/classes/utils-urls.inc.php +2 -2
  58. includes/classes/utils-users.inc.php +29 -4
  59. includes/codes.inc.php +2 -1
  60. includes/dropins/mu-plugins/index.php +0 -0
  61. includes/dropins/mu-plugins/s2member-o.php +73 -0
  62. includes/functions/api-functions.inc.php +59 -3
  63. includes/hooks.inc.php +24 -24
  64. includes/jquery/index.php +0 -0
  65. includes/jquery/jquery.json-ps/index.php +0 -0
  66. includes/{menu-pages/jquery-json-ps-min.js → jquery/jquery.json-ps/jquery.json-ps-min.js} +0 -0
  67. includes/{menu-pages/jquery-json-ps.js → jquery/jquery.json-ps/jquery.json-ps.js} +4 -4
  68. includes/jquery/jquery.sprintf/index.php +0 -0
  69. includes/jquery/jquery.sprintf/jquery.sprintf-min.js +1 -0
  70. includes/jquery/jquery.sprintf/jquery.sprintf.js +210 -0
  71. includes/jquery/jquery.ui-effects/index.php +0 -0
  72. includes/jquery/jquery.ui-effects/jquery.ui-effects-min.js +81 -0
  73. includes/{menu-pages/jquery-ui-effects.js → jquery/jquery.ui-effects/jquery.ui-effects.js} +11 -3
  74. includes/menu-pages/down-ops.inc.php +45 -14
  75. includes/menu-pages/els-ops.inc.php +3 -12
  76. includes/menu-pages/gen-ops.inc.php +20 -1
  77. includes/menu-pages/integrations.inc.php +2 -2
  78. includes/menu-pages/js-c-warning.inc.php +40 -0
  79. includes/menu-pages/menu-pages-min.js +1 -1
  80. includes/menu-pages/menu-pages-s-min.js +1 -1
  81. includes/menu-pages/menu-pages-s.js +36 -17
  82. includes/menu-pages/menu-pages.css +13 -1
  83. includes/menu-pages/menu-pages.js +3 -1
  84. includes/menu-pages/mms-ops.inc.php +7 -5
  85. includes/menu-pages/paypal-buttons.inc.php +25 -25
  86. includes/menu-pages/paypal-ops.inc.php +5 -5
  87. includes/menu-pages/res-ops.inc.php +12 -12
  88. includes/menu-pages/scripting.inc.php +6 -6
  89. includes/s2member-min.js +1 -1
  90. includes/s2member.js +45 -45
  91. includes/syscon.inc.php +52 -27
  92. includes/templates/badges/{s-badge.html → s-badge.php} +6 -1
  93. includes/templates/buttons/paypal-cancellation-button.html +0 -3
  94. includes/templates/buttons/paypal-cancellation-button.php +8 -0
  95. includes/templates/buttons/paypal-ccaps-checkout-button.html +0 -30
  96. includes/templates/buttons/paypal-ccaps-checkout-button.php +35 -0
  97. includes/templates/buttons/paypal-checkout-button.html +0 -42
  98. includes/templates/buttons/paypal-checkout-button.php +47 -0
  99. includes/templates/buttons/paypal-sp-checkout-button.html +0 -30
  100. includes/templates/buttons/paypal-sp-checkout-button.php +35 -0
  101. includes/templates/cfg-files/index.php +0 -0
  102. includes/templates/cfg-files/s2member-files.php +46 -0
  103. includes/templates/cfg-files/s2member-logs.php +6 -0
  104. includes/templates/options/{paypal-currencies.html → paypal-currencies.php} +6 -1
  105. includes/templates/options/paypal-membership-ccap-terms.html +0 -3
  106. includes/templates/options/paypal-membership-ccap-terms.php +8 -0
  107. includes/templates/options/paypal-membership-regular-terms.html +0 -63
  108. includes/templates/options/paypal-membership-regular-terms.php +68 -0
  109. includes/templates/options/paypal-membership-trial-terms.html +0 -4
  110. includes/templates/options/paypal-membership-trial-terms.php +9 -0
  111. includes/templates/options/paypal-sp-hours.html +0 -46
  112. includes/templates/options/paypal-sp-hours.php +51 -0
  113. includes/templates/returns/{default-return.html → default-return.php} +5 -0
  114. includes/templates/shortcodes/paypal-cancellation-button-shortcode.html +0 -1
  115. includes/templates/shortcodes/paypal-cancellation-button-shortcode.php +6 -0
  116. includes/templates/shortcodes/paypal-ccaps-checkout-button-shortcode.html +0 -1
  117. includes/templates/shortcodes/paypal-ccaps-checkout-button-shortcode.php +6 -0
  118. includes/templates/shortcodes/paypal-checkout-button-shortcode.html +0 -1
  119. includes/templates/shortcodes/paypal-checkout-button-shortcode.php +6 -0
  120. includes/templates/shortcodes/paypal-sp-checkout-button-shortcode.html +0 -1
  121. includes/templates/shortcodes/paypal-sp-checkout-button-shortcode.php +6 -0
  122. includes/translations/index.php +0 -0
  123. includes/translations/s2member.pot +3984 -0
  124. includes/translations/translators.txt +13 -0
  125. ms.txt +1 -1
  126. readme.txt +59 -4
  127. s2member-o.php +51 -0
  128. s2member.php +14 -11
includes/classes/admin-css-js-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_admin_css_js_in"))
21
{
@@ -43,16 +43,21 @@ if (!class_exists ("c_ws_plugin__s2member_admin_css_js_in"))
43
/**/
44
if (!empty ($_GET["ws_plugin__s2member_menu_pages_css"]) && is_user_logged_in () && current_user_can ("create_users"))
45
{
46
- header("Content-Type: text/css; charset=utf-8");
47
- header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
48
- header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
49
- header("Cache-Control: no-cache, must-revalidate, max-age=0");
50
- header("Pragma: no-cache");
51
/**/
52
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
53
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
54
/**/
55
- ob_start("c_ws_plugin__s2member_utils_css::compress_css"); /* Compress. */
56
/**/
57
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages.css";
58
/**/
@@ -83,18 +88,23 @@ if (!class_exists ("c_ws_plugin__s2member_admin_css_js_in"))
83
/**/
84
if (!empty ($_GET["ws_plugin__s2member_menu_pages_js"]) && is_user_logged_in () && current_user_can ("create_users"))
85
{
86
- header("Content-Type: text/javascript; charset=utf-8");
87
- header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
88
- header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
89
- header("Cache-Control: no-cache, must-revalidate, max-age=0");
90
- header("Pragma: no-cache");
91
/**/
92
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
93
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
94
/**/
95
for ($n = 0, $labels = ""; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
96
- $labels .= "labels['level" . $n . "'] = '" . ((!empty ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])) ? c_ws_plugin__s2member_utils_strings::esc_sq (preg_replace ('/"/', "", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])) : "") . "';";
97
- unset($n);
98
/**/
99
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-min.js";
100
/**/
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_admin_css_js_in"))
21
{
43
/**/
44
if (!empty ($_GET["ws_plugin__s2member_menu_pages_css"]) && is_user_logged_in () && current_user_can ("create_users"))
45
{
46
+ @ini_set ("zlib.output_compression", 0);
47
+ /**/
48
+ status_header (200); /* 200 OK status header. */
49
+ header ("Content-Type: text/css; charset=utf-8");
50
+ header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
51
+ header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
52
+ header ("Cache-Control: no-cache, must-revalidate, max-age=0");
53
+ header ("Pragma: no-cache");
54
+ /**/
55
+ eval ('while (@ob_end_clean ());'); /* Clean buffers. */
56
/**/
57
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
58
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
59
/**/
60
+ ob_start ("c_ws_plugin__s2member_utils_css::compress_css");
61
/**/
62
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages.css";
63
/**/
88
/**/
89
if (!empty ($_GET["ws_plugin__s2member_menu_pages_js"]) && is_user_logged_in () && current_user_can ("create_users"))
90
{
91
+ @ini_set ("zlib.output_compression", 0);
92
+ /**/
93
+ status_header (200); /* 200 OK status header. */
94
+ header ("Content-Type: text/javascript; charset=utf-8");
95
+ header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
96
+ header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
97
+ header ("Cache-Control: no-cache, must-revalidate, max-age=0");
98
+ header ("Pragma: no-cache");
99
+ /**/
100
+ eval ('while (@ob_end_clean ());'); /* Clean buffers. */
101
/**/
102
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
103
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
104
/**/
105
for ($n = 0, $labels = ""; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
106
+ $labels .= "labels['level" . $n . "'] = '" . ((!empty ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])) ? str_replace ('"', "", c_ws_plugin__s2member_utils_strings::esc_js_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"], 3)) : "") . "';";
107
+ unset ($n);
108
/**/
109
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-min.js";
110
/**/
includes/classes/admin-lockouts.inc.php CHANGED
@@ -41,19 +41,16 @@ if (!class_exists ("c_ws_plugin__s2member_admin_lockouts"))
41
{
42
do_action ("ws_plugin__s2member_before_admin_lockouts", get_defined_vars ());
43
/**/
44
- if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] /* Now check for these WordPress® functionality Constants too. */
45
- && (!defined ("XMLRPC_REQUEST") || !XMLRPC_REQUEST) && (!defined ("APP_REQUEST") || !APP_REQUEST) && (!defined ("DOING_AJAX") || !DOING_AJAX)/**/
46
- && !current_user_can ("edit_posts")) /* And only if the current User is unable to edit Posts; otherwise we allow them in. */
47
- if (apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ())) /* Give Filters a chance too. */
48
- {
49
- if ($special_redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ())
50
- wp_redirect($special_redirection_url); /* Special Redirection. */
51
- /**/
52
- else /* Else we use the Login Welcome Page configured for s2Member. */
53
- wp_redirect(get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
54
- /**/
55
- exit (); /* Clean exit. */
56
- }
57
/**/
58
do_action ("ws_plugin__s2member_after_admin_lockouts", get_defined_vars ());
59
/**/
@@ -72,52 +69,43 @@ if (!class_exists ("c_ws_plugin__s2member_admin_lockouts"))
72
*/
73
public static function filter_admin_menu_bar (&$wp_admin_bar = FALSE)
74
{
75
do_action ("ws_plugin__s2member_before_filter_admin_menu_bar", get_defined_vars ());
76
/**/
77
- if (is_object ($wp_admin_bar) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] /* Now check functionality Constants too. */
78
- && (!defined ("XMLRPC_REQUEST") || !XMLRPC_REQUEST) && (!defined ("APP_REQUEST") || !APP_REQUEST) && (!defined ("DOING_AJAX") || !DOING_AJAX)/**/
79
- && !current_user_can ("edit_posts")) /* And only if the current User is unable to edit Posts; otherwise we allow them in. */
80
- if (apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ())) /* Give Filters a chance too. */
81
- {
82
- if ($special_redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ())
83
- $lwp = $special_redirection_url;
84
- /**/
85
- else /* Else we use the Login Welcome Page configured for s2Member. */
86
- $lwp = get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]);
87
- /**/
88
- if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"})) /* Profile. */
89
- {
90
- if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"}["href"]))
91
- $wp_admin_bar->menu->{"my-account-with-avatar"}["href"] = $lwp;
92
- /**/
93
- if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"]))
94
- $wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"] = $lwp;
95
- /*
96
- Backward compatibility ( {"edit-my-profile"} ), prior to WordPress® 3.2. */
97
- if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-my-profile"}["href"]))
98
- $wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-my-profile"}["href"] = $lwp;
99
- /*
100
- Backward compatibility ( ["children"]->{"dashboard"} ), prior to WordPress® 3.2. */
101
- if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"dashboard"}))
102
- unset($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"dashboard"});
103
- }
104
- /**/
105
- if (isset ($wp_admin_bar->menu->{"dashboard"})) /* Dashboard menu, we don't need this. */
106
- unset($wp_admin_bar->menu->{"dashboard"}); /* Removes this entire menu from the bar. */
107
- /**/
108
- if (isset ($wp_admin_bar->menu->{"my-blogs"}["href"])) /* Deals with multiple Blog drop-down. */
109
- {
110
- $wp_admin_bar->menu->{"my-blogs"}["href"] = "#"; /* Void this link out by converting to `#`. */
111
- /**/
112
- if (isset ($wp_admin_bar->menu->{"my-blogs"}["children"]) && is_object ($wp_admin_bar->menu->{"my-blogs"}["children"]))
113
- foreach ($wp_admin_bar->menu->{"my-blogs"}["children"] as &$blog) /* Modify other Blog links in drop-down. */
114
- if (is_array ($blog) && isset ($blog["href"], $blog["children"]) && is_object ($blog["children"]))
115
- {
116
- $blog["href"] = preg_replace ("/\/wp-admin/", "", $blog["href"]);
117
- unset($blog["children"]); /* Cause all we need is the link. */
118
- }
119
- }
120
- }
121
/**/
122
do_action ("ws_plugin__s2member_after_filter_admin_menu_bar", get_defined_vars ());
123
/**/
41
{
42
do_action ("ws_plugin__s2member_before_admin_lockouts", get_defined_vars ());
43
/**/
44
+ if (!current_user_can ("edit_posts") && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] && apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ()))
45
+ {
46
+ if ($redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ())
47
+ wp_redirect($redirection_url); /* Special Redirection. */
48
+ /**/
49
+ else /* Else we use the Login Welcome Page configured for s2Member. */
50
+ wp_redirect(get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
51
+ /**/
52
+ exit (); /* Clean exit. */
53
+ }
54
/**/
55
do_action ("ws_plugin__s2member_after_admin_lockouts", get_defined_vars ());
56
/**/
69
*/
70
public static function filter_admin_menu_bar (&$wp_admin_bar = FALSE)
71
{
72
+ global $current_site, $current_blog; /* In support of Multisite Networking. */
73
+ /**/
74
do_action ("ws_plugin__s2member_before_filter_admin_menu_bar", get_defined_vars ());
75
/**/
76
+ if (is_object ($wp_admin_bar) && !current_user_can ("edit_posts"))
77
+ {
78
+ if (isset ($wp_admin_bar->menu->{"dashboard"})) /* We don't need this. */
79
+ unset($wp_admin_bar->menu->{"dashboard"}); /* Remove this entire menu. */
80
+ /**/
81
+ if (is_multisite () && !c_ws_plugin__s2member_utils_conds::is_multisite_farm () && isset ($wp_admin_bar->menu->{"my-blogs"}))
82
+ {
83
+ $wp_admin_bar->menu->{"my-blogs"}["href"] = "#"; /* Void this link out by converting to `#`. */
84
+ /**/
85
+ if (isset ($wp_admin_bar->menu->{"my-blogs"}["children"]) && is_object ($wp_admin_bar->menu->{"my-blogs"}["children"]))
86
+ foreach ($wp_admin_bar->menu->{"my-blogs"}["children"] as &$blog) /* Modify other Blog links in drop-down. */
87
+ if (is_array ($blog) && isset ($blog["href"], $blog["children"]) && is_object ($blog["children"]))
88
+ {
89
+ $blog["href"] = preg_replace ("/\/wp-admin/", "", $blog["href"]);
90
+ unset($blog["children"]); /* Cause all we need is the link. */
91
+ }
92
+ }
93
+ /**/
94
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] && apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ()))
95
+ {
96
+ $lwp = c_ws_plugin__s2member_login_redirects::login_redirection_url ($user);
97
+ $lwp = (!$lwp) ? get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) : $lwp;
98
+ /**/
99
+ if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"})) /* Profile. */
100
+ {
101
+ if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"}["href"]))
102
+ $wp_admin_bar->menu->{"my-account-with-avatar"}["href"] = $lwp;
103
+ /**/
104
+ if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"]))
105
+ $wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"] = $lwp;
106
+ }
107
+ }
108
+ }
109
/**/
110
do_action ("ws_plugin__s2member_after_filter_admin_menu_bar", get_defined_vars ());
111
/**/
includes/classes/brute-force.inc.php CHANGED
@@ -90,7 +90,7 @@ if (!class_exists ("c_ws_plugin__s2member_brute_force"))
90
/**/
91
if ((int)get_transient ("s2m_ipr_" . md5 ("s2member_transient_failed_login_attempts_" . $_SERVER["REMOTE_ADDR"])) > $max)
92
{
93
- $errors = new WP_Error ("incorrect_password", "Max failed logins. Please wait " . $about . " and try again.");
94
/**/
95
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
96
do_action ("ws_plugin__s2member_during_stop_brute_force_logins", get_defined_vars ());
90
/**/
91
if ((int)get_transient ("s2m_ipr_" . md5 ("s2member_transient_failed_login_attempts_" . $_SERVER["REMOTE_ADDR"])) > $max)
92
{
93
+ $errors = new WP_Error ("incorrect_password", sprintf (_x ("Max failed logins. Please wait %s and try again.", "s2member-front", "s2member"), $about));
94
/**/
95
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
96
do_action ("ws_plugin__s2member_during_stop_brute_force_logins", get_defined_vars ());
includes/classes/css-js-in.inc.php CHANGED
@@ -43,12 +43,17 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_in"))
43
/**/
44
if (!empty ($_GET["ws_plugin__s2member_css"]))
45
{
46
header("Content-Type: text/css; charset=utf-8");
47
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
48
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
49
header("Cache-Control: max-age=604800");
50
header("Pragma: public");
51
/**/
52
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
53
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
54
/**/
@@ -81,13 +86,22 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_in"))
81
/**/
82
if (!empty ($_GET["ws_plugin__s2member_js_w_globals"]))
83
{
84
header("Content-Type: text/javascript; charset=utf-8");
85
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
86
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
87
header("Cache-Control: max-age=604800");
88
header("Pragma: public");
89
/**/
90
- echo "var S2MEMBER_VERSION = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_VERSION) . "',";
91
/**/
92
echo "S2MEMBER_CURRENT_USER_LOGIN_COUNTER = " . S2MEMBER_CURRENT_USER_LOGIN_COUNTER . ",";
93
/**/
@@ -95,12 +109,12 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_in"))
95
echo "S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER = " . ((S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER) ? "true" : "false") . ",";
96
/**/
97
echo "S2MEMBER_CURRENT_USER_ACCESS_LEVEL = " . S2MEMBER_CURRENT_USER_ACCESS_LEVEL . ",";
98
- echo "S2MEMBER_CURRENT_USER_ACCESS_LABEL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_ACCESS_LABEL) . "',";
99
/**/
100
- echo "S2MEMBER_CURRENT_USER_SUBSCR_ID = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_SUBSCR_ID) . "',";
101
- echo "S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID) . "',";
102
- echo "S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY) . "',";
103
- echo "S2MEMBER_CURRENT_USER_CUSTOM = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_CUSTOM) . "',";
104
/**/
105
echo "S2MEMBER_CURRENT_USER_REGISTRATION_TIME = " . S2MEMBER_CURRENT_USER_REGISTRATION_TIME . ",";
106
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME = " . S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME . ",";
@@ -108,14 +122,14 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_in"))
108
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS = " . S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS . ",";
109
echo "S2MEMBER_CURRENT_USER_REGISTRATION_DAYS = " . S2MEMBER_CURRENT_USER_REGISTRATION_DAYS . ",";
110
/**/
111
- echo "S2MEMBER_CURRENT_USER_DISPLAY_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_DISPLAY_NAME) . "',";
112
- echo "S2MEMBER_CURRENT_USER_FIRST_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_FIRST_NAME) . "',";
113
- echo "S2MEMBER_CURRENT_USER_LAST_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_LAST_NAME) . "',";
114
/**/
115
- echo "S2MEMBER_CURRENT_USER_LOGIN = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_LOGIN) . "',";
116
- echo "S2MEMBER_CURRENT_USER_EMAIL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_EMAIL) . "',";
117
- echo "S2MEMBER_CURRENT_USER_IP = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_IP) . "',";
118
- echo "S2MEMBER_CURRENT_USER_REGISTRATION_IP = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_REGISTRATION_IP) . "',";
119
/**/
120
echo "S2MEMBER_CURRENT_USER_ID = " . S2MEMBER_CURRENT_USER_ID . ",";
121
echo "S2MEMBER_CURRENT_USER_FIELDS = " . S2MEMBER_CURRENT_USER_FIELDS . ",";
@@ -129,17 +143,17 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_in"))
129
echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID = " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID . ",";
130
echo "S2MEMBER_LOGIN_WELCOME_PAGE_ID = " . S2MEMBER_LOGIN_WELCOME_PAGE_ID . ",";
131
/**/
132
- echo "S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL) . "',";
133
- echo "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL) . "',";
134
- echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL) . "',";
135
- echo "S2MEMBER_LOGIN_WELCOME_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LOGIN_WELCOME_PAGE_URL) . "',";
136
- echo "S2MEMBER_LOGOUT_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LOGOUT_PAGE_URL) . "',";
137
- echo "S2MEMBER_LOGIN_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LOGIN_PAGE_URL) . "',";
138
/**/
139
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
140
{
141
if (defined (($S2MEMBER_LEVELn_LABEL = "S2MEMBER_LEVEL" . $n . "_LABEL")))
142
- echo $S2MEMBER_LEVELn_LABEL . " = '" . c_ws_plugin__s2member_utils_strings::esc_sq (constant ($S2MEMBER_LEVELn_LABEL)) . "',";
143
}
144
/**/
145
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
@@ -154,30 +168,32 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_in"))
154
echo $S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS . " = " . constant ($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS) . ",";
155
}
156
/**/
157
- echo "S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS) . "',";
158
/**/
159
- echo "S2MEMBER_REG_EMAIL_FROM_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_REG_EMAIL_FROM_NAME) . "',";
160
- echo "S2MEMBER_REG_EMAIL_FROM_EMAIL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_REG_EMAIL_FROM_EMAIL) . "',";
161
/**/
162
- echo "S2MEMBER_PAYPAL_NOTIFY_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_NOTIFY_URL) . "',";
163
- echo "S2MEMBER_PAYPAL_RETURN_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_RETURN_URL) . "',";
164
/**/
165
- echo "S2MEMBER_PAYPAL_BUSINESS = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_BUSINESS) . "',";
166
- echo "S2MEMBER_PAYPAL_ENDPOINT = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_ENDPOINT) . "',";
167
- echo "S2MEMBER_PAYPAL_API_ENDPOINT = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_API_ENDPOINT) . "',";
168
/**/
169
- echo "S2MEMBER_VALUE_FOR_PP_INV = Math.round (new Date ().getTime ()) + '~" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_IP) . "',";
170
echo "S2MEMBER_VALUE_FOR_PP_INV_GEN = function(){ var invoice = '', formatSeed = function(seed, reqWidth) { seed = parseInt(seed, 10).toString (16); if (reqWidth < seed.length) return seed.slice (seed.length - reqWidth); else if (reqWidth > seed.length) return Array(1 + (reqWidth - seed.length)).join ('0') + seed; return seed; }; if (typeof S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED === 'undefined') S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED = Math.floor (Math.random () * 0x75bcd15); S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED++; invoice = formatSeed(parseInt(new Date ().getTime () / 1000, 10), 8); invoice += formatSeed(S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED, 5); invoice += '~' + S2MEMBER_CURRENT_USER_IP; return invoice; },";
171
/**/
172
- echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) . "',";
173
- echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0) . "',";
174
/**/
175
- echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1) . "',";
176
- echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1) . "';";
177
/**/
178
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
179
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
180
/**/
181
include_once dirname (dirname (__FILE__)) . "/s2member-min.js";
182
/**/
183
do_action ("ws_plugin__s2member_during_js_w_globals", get_defined_vars ());
43
/**/
44
if (!empty ($_GET["ws_plugin__s2member_css"]))
45
{
46
+ @ini_set ("zlib.output_compression", 0);
47
+ /**/
48
+ status_header(200); /* 200 OK status header. */
49
header("Content-Type: text/css; charset=utf-8");
50
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
51
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
52
header("Cache-Control: max-age=604800");
53
header("Pragma: public");
54
/**/
55
+ eval('while (@ob_end_clean ());'); /* Clean buffers. */
56
+ /**/
57
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
58
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
59
/**/
86
/**/
87
if (!empty ($_GET["ws_plugin__s2member_js_w_globals"]))
88
{
89
+ @ini_set ("zlib.output_compression", 0);
90
+ /**/
91
+ status_header(200); /* 200 OK status header. */
92
header("Content-Type: text/javascript; charset=utf-8");
93
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
94
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
95
header("Cache-Control: max-age=604800");
96
header("Pragma: public");
97
/**/
98
+ eval('while (@ob_end_clean ());'); /* Clean buffers. */
99
+ /**/
100
+ include_once dirname (dirname (__FILE__)) . "/jquery/jquery.sprintf/jquery.sprintf-min.js";
101
+ /**/
102
+ echo "\n"; /* Add a line break before writing JavaScript Globals to file. */
103
+ /**/
104
+ echo "var S2MEMBER_VERSION = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_VERSION) . "',";
105
/**/
106
echo "S2MEMBER_CURRENT_USER_LOGIN_COUNTER = " . S2MEMBER_CURRENT_USER_LOGIN_COUNTER . ",";
107
/**/
109
echo "S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER = " . ((S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER) ? "true" : "false") . ",";
110
/**/
111
echo "S2MEMBER_CURRENT_USER_ACCESS_LEVEL = " . S2MEMBER_CURRENT_USER_ACCESS_LEVEL . ",";
112
+ echo "S2MEMBER_CURRENT_USER_ACCESS_LABEL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_ACCESS_LABEL) . "',";
113
/**/
114
+ echo "S2MEMBER_CURRENT_USER_SUBSCR_ID = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_SUBSCR_ID) . "',";
115
+ echo "S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID) . "',";
116
+ echo "S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY) . "',";
117
+ echo "S2MEMBER_CURRENT_USER_CUSTOM = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_CUSTOM) . "',";
118
/**/
119
echo "S2MEMBER_CURRENT_USER_REGISTRATION_TIME = " . S2MEMBER_CURRENT_USER_REGISTRATION_TIME . ",";
120
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME = " . S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME . ",";
122
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS = " . S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS . ",";
123
echo "S2MEMBER_CURRENT_USER_REGISTRATION_DAYS = " . S2MEMBER_CURRENT_USER_REGISTRATION_DAYS . ",";
124
/**/
125
+ echo "S2MEMBER_CURRENT_USER_DISPLAY_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_DISPLAY_NAME) . "',";
126
+ echo "S2MEMBER_CURRENT_USER_FIRST_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_FIRST_NAME) . "',";
127
+ echo "S2MEMBER_CURRENT_USER_LAST_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_LAST_NAME) . "',";
128
/**/
129
+ echo "S2MEMBER_CURRENT_USER_LOGIN = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_LOGIN) . "',";
130
+ echo "S2MEMBER_CURRENT_USER_EMAIL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_EMAIL) . "',";
131
+ echo "S2MEMBER_CURRENT_USER_IP = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_IP) . "',";
132
+ echo "S2MEMBER_CURRENT_USER_REGISTRATION_IP = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_REGISTRATION_IP) . "',";
133
/**/
134
echo "S2MEMBER_CURRENT_USER_ID = " . S2MEMBER_CURRENT_USER_ID . ",";
135
echo "S2MEMBER_CURRENT_USER_FIELDS = " . S2MEMBER_CURRENT_USER_FIELDS . ",";
143
echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID = " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID . ",";
144
echo "S2MEMBER_LOGIN_WELCOME_PAGE_ID = " . S2MEMBER_LOGIN_WELCOME_PAGE_ID . ",";
145
/**/
146
+ echo "S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL) . "',";
147
+ echo "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL) . "',";
148
+ echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL) . "',";
149
+ echo "S2MEMBER_LOGIN_WELCOME_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_LOGIN_WELCOME_PAGE_URL) . "',";
150
+ echo "S2MEMBER_LOGOUT_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_LOGOUT_PAGE_URL) . "',";
151
+ echo "S2MEMBER_LOGIN_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_LOGIN_PAGE_URL) . "',";
152
/**/
153
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
154
{
155
if (defined (($S2MEMBER_LEVELn_LABEL = "S2MEMBER_LEVEL" . $n . "_LABEL")))
156
+ echo $S2MEMBER_LEVELn_LABEL . " = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (constant ($S2MEMBER_LEVELn_LABEL)) . "',";
157
}
158
/**/
159
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
168
echo $S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS . " = " . constant ($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS) . ",";
169
}
170
/**/
171
+ echo "S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS) . "',";
172
/**/
173
+ echo "S2MEMBER_REG_EMAIL_FROM_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_REG_EMAIL_FROM_NAME) . "',";
174
+ echo "S2MEMBER_REG_EMAIL_FROM_EMAIL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_REG_EMAIL_FROM_EMAIL) . "',";
175
/**/
176
+ echo "S2MEMBER_PAYPAL_NOTIFY_URL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_PAYPAL_NOTIFY_URL) . "',";
177
+ echo "S2MEMBER_PAYPAL_RETURN_URL = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_PAYPAL_RETURN_URL) . "',";
178
/**/
179
+ echo "S2MEMBER_PAYPAL_BUSINESS = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_PAYPAL_BUSINESS) . "',";
180
+ echo "S2MEMBER_PAYPAL_ENDPOINT = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_PAYPAL_ENDPOINT) . "',";
181
+ echo "S2MEMBER_PAYPAL_API_ENDPOINT = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_PAYPAL_API_ENDPOINT) . "',";
182
/**/
183
+ echo "S2MEMBER_VALUE_FOR_PP_INV = Math.round (new Date ().getTime ()) + '~" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_IP) . "',";
184
echo "S2MEMBER_VALUE_FOR_PP_INV_GEN = function(){ var invoice = '', formatSeed = function(seed, reqWidth) { seed = parseInt(seed, 10).toString (16); if (reqWidth < seed.length) return seed.slice (seed.length - reqWidth); else if (reqWidth > seed.length) return Array(1 + (reqWidth - seed.length)).join ('0') + seed; return seed; }; if (typeof S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED === 'undefined') S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED = Math.floor (Math.random () * 0x75bcd15); S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED++; invoice = formatSeed(parseInt(new Date ().getTime () / 1000, 10), 8); invoice += formatSeed(S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED, 5); invoice += '~' + S2MEMBER_CURRENT_USER_IP; return invoice; },";
185
/**/
186
+ echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0 = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) . "',";
187
+ echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0) . "',";
188
/**/
189
+ echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1 = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1) . "',";
190
+ echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1 = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1) . "';";
191
/**/
192
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
193
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
194
/**/
195
+ echo "\n"; /* Add a line break before inclusion. */
196
+ /**/
197
include_once dirname (dirname (__FILE__)) . "/s2member-min.js";
198
/**/
199
do_action ("ws_plugin__s2member_during_js_w_globals", get_defined_vars ());
includes/classes/css-js-themes.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_css_js_themes"))
21
{
@@ -43,7 +43,9 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_themes"))
43
/**/
44
if (!is_admin ()) /* Not in the admin. */
45
{
46
- wp_enqueue_style ("ws-plugin--s2member", site_url ("/?ws_plugin__s2member_css=1&qcABC=1"), array (), c_ws_plugin__s2member_utilities::ver_checksum (), "all");
47
/**/
48
do_action ("ws_plugin__s2member_during_add_css", get_defined_vars ());
49
}
@@ -72,16 +74,18 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_themes"))
72
/**/
73
if (!is_admin () || (is_user_admin () && $pagenow === "profile.php" && !current_user_can ("edit_users")))
74
{
75
if (is_user_logged_in ()) /* Separate version for logged-in Users/Members. */
76
{
77
$md5 = WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5; /* An MD5 hash based on global key => values. */
78
/* The MD5 hash allows the script to be cached in the browser until the globals happen to change. */
79
/* For instance, the global variables may change when a User who is logged-in changes their Profile. */
80
- wp_enqueue_script ("ws-plugin--s2member", site_url ("/?ws_plugin__s2member_js_w_globals=" . urlencode ($md5) . "&qcABC=1"), array ("jquery", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum ());
81
}
82
else /* Else if they are not logged in, we distinguish the JavaScript file by NOT including $md5. */
83
{ /* This essentially creates 2 versions of the script. One while logged in & another when not. */
84
- wp_enqueue_script ("ws-plugin--s2member", site_url ("/?ws_plugin__s2member_js_w_globals=1&qcABC=1"), array ("jquery", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum ());
85
}
86
/**/
87
do_action ("ws_plugin__s2member_during_add_js_w_globals", 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_css_js_themes"))
21
{
43
/**/
44
if (!is_admin ()) /* Not in the admin. */
45
{
46
+ $s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"]; /* Loads s2Member only. */
47
+ /**/
48
+ wp_enqueue_style ("ws-plugin--s2member", $s2o . "/?ws_plugin__s2member_css=1&qcABC=1", array (), c_ws_plugin__s2member_utilities::ver_checksum (), "all");
49
/**/
50
do_action ("ws_plugin__s2member_during_add_css", get_defined_vars ());
51
}
74
/**/
75
if (!is_admin () || (is_user_admin () && $pagenow === "profile.php" && !current_user_can ("edit_users")))
76
{
77
+ $s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"]; /* Loads s2Member only. */
78
+ /**/
79
if (is_user_logged_in ()) /* Separate version for logged-in Users/Members. */
80
{
81
$md5 = WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5; /* An MD5 hash based on global key => values. */
82
/* The MD5 hash allows the script to be cached in the browser until the globals happen to change. */
83
/* For instance, the global variables may change when a User who is logged-in changes their Profile. */
84
+ wp_enqueue_script ("ws-plugin--s2member", $s2o . "/?ws_plugin__s2member_js_w_globals=" . urlencode ($md5) . "&qcABC=1", array ("jquery", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum ());
85
}
86
else /* Else if they are not logged in, we distinguish the JavaScript file by NOT including $md5. */
87
{ /* This essentially creates 2 versions of the script. One while logged in & another when not. */
88
+ wp_enqueue_script ("ws-plugin--s2member", $s2o . "/?ws_plugin__s2member_js_w_globals=1&qcABC=1", array ("jquery", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum ());
89
}
90
/**/
91
do_action ("ws_plugin__s2member_during_add_js_w_globals", get_defined_vars ());
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,7 +278,7 @@ 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
/**/
@@ -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,27 +330,27 @@ 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
/**/
337
- echo '<label for="ws-plugin--s2member-custom-reg-field-first-name">First Name *</label>' . "\n";
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="' . esc_attr ($_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
/**/
349
- echo '<label for="ws-plugin--s2member-custom-reg-field-last-name">Last Name *</label>' . "\n";
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="' . esc_attr ($_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,32 +436,32 @@ 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
/**/
449
echo '<p>' . "\n";
450
/**/
451
- echo '<label for="ws-plugin--s2member-custom-reg-field-user-pass1" title="Please type your Password twice to confirm.">' . "\n";
452
- echo '<span>Password ( please type it twice ) *</span><br />' . "\n";
453
echo '<input aria-required="true" type="password" maxlength="100" autocomplete="off" name="ws_plugin__s2member_custom_reg_field_user_pass1" id="ws-plugin--s2member-custom-reg-field-user-pass1" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_user_pass1"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
454
echo '</label>' . "\n";
455
/**/
456
- echo '<label for="ws-plugin--s2member-custom-reg-field-user-pass2" title="Please type your Password twice to confirm.">' . "\n";
457
echo '<input type="password" maxlength="100" autocomplete="off" name="ws_plugin__s2member_custom_reg_field_user_pass2" id="ws-plugin--s2member-custom-reg-field-user-pass2" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_user_pass2"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
458
echo '</label>' . "\n";
459
/**/
460
- echo '<div id="ws-plugin--s2member-custom-reg-field-user-pass-strength" class="ws-plugin--s2member-password-strength"><em>password strength indicator</em></div>' . "\n";
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,73 +470,77 @@ 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
/**/
477
echo '<p>' . "\n";
478
echo '<label for="ws-plugin--s2member-custom-reg-field-first-name">' . "\n";
479
- echo '<span>First Name *</span><br />' . "\n";
480
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="' . esc_attr ($_p["ws_plugin__s2member_custom_reg_field_first_name"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
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
/**/
492
echo '<p>' . "\n";
493
echo '<label for="ws-plugin--s2member-custom-reg-field-last-name">' . "\n";
494
- echo '<span>Last Name *</span><br />' . "\n";
495
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="' . esc_attr ($_p["ws_plugin__s2member_custom_reg_field_last_name"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
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
}
503
/**/
504
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["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
- /**/
512
- if (in_array ($field["id"], $fields_applicable)) /* Field applicable? */
513
- {
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? */
521
- echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section' . ((!empty ($field["sectitle"])) ? '-title' : '') . '">' . ((!empty ($field["sectitle"])) ? $field["sectitle"] : '') . '</div>';
522
- /**/
523
- echo '<p>' . "\n";
524
- echo '<label for="ws-plugin--s2member-custom-reg-field-' . esc_attr ($field_id_class) . '">' . "\n";
525
- echo '<span' . ((preg_match ("/^(checkbox|pre_checkbox)#x2F;", $field["type"])) ? ' style="display:none;"' : '') . '>' . $field["label"] . (($field["required"] === "yes") ? ' *' : '') . '</span></label>' . ((preg_match ("/^(checkbox|pre_checkbox)#x2F;", $field["type"])) ? '' : '<br />') . "\n";
526
- echo c_ws_plugin__s2member_custom_reg_fields::custom_field_gen (__FUNCTION__, $field, "ws_plugin__s2member_custom_reg_field_", "ws-plugin--s2member-custom-reg-field-", "ws-plugin--s2member-custom-reg-field", "", ($tabindex = $tabindex + 10), "", $_p, $_p["ws_plugin__s2member_custom_reg_field_" . $field_var], "registration");
527
- echo '</p>' . "\n";
528
- }
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 +551,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
/**/
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
/**/
337
+ echo '<label for="ws-plugin--s2member-custom-reg-field-first-name">' . _x ("First Name", "s2member-front", "s2member") . ' *</label>' . "\n";
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="' . esc_attr ($_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
/**/
349
+ echo '<label for="ws-plugin--s2member-custom-reg-field-last-name">' . _x ("Last Name", "s2member-front", "s2member") . ' *</label>' . "\n";
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="' . esc_attr ($_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
/**/
449
echo '<p>' . "\n";
450
/**/
451
+ echo '<label for="ws-plugin--s2member-custom-reg-field-user-pass1" title="' . esc_attr (_x ("Please type your Password twice to confirm.", "s2member-front", "s2member")) . '">' . "\n";
452
+ echo '<span>' . _x ("Password ( please type it twice )", "s2member-front", "s2member") . ' *</span><br />' . "\n";
453
echo '<input aria-required="true" type="password" maxlength="100" autocomplete="off" name="ws_plugin__s2member_custom_reg_field_user_pass1" id="ws-plugin--s2member-custom-reg-field-user-pass1" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_user_pass1"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
454
echo '</label>' . "\n";
455
/**/
456
+ echo '<label for="ws-plugin--s2member-custom-reg-field-user-pass2" title="' . esc_attr (_x ("Please type your Password twice to confirm.", "s2member-front", "s2member")) . '">' . "\n";
457
echo '<input type="password" maxlength="100" autocomplete="off" name="ws_plugin__s2member_custom_reg_field_user_pass2" id="ws-plugin--s2member-custom-reg-field-user-pass2" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_user_pass2"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
458
echo '</label>' . "\n";
459
/**/
460
+ echo '<div id="ws-plugin--s2member-custom-reg-field-user-pass-strength" class="ws-plugin--s2member-password-strength"><em>' . _x ("password strength indicator", "s2member-front", "s2member") . '</em></div>' . "\n";
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
/**/
477
echo '<p>' . "\n";
478
echo '<label for="ws-plugin--s2member-custom-reg-field-first-name">' . "\n";
479
+ echo '<span>' . _x ("First Name", "s2member-front", "s2member") . ' *</span><br />' . "\n";
480
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="' . esc_attr ($_p["ws_plugin__s2member_custom_reg_field_first_name"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
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
/**/
492
echo '<p>' . "\n";
493
echo '<label for="ws-plugin--s2member-custom-reg-field-last-name">' . "\n";
494
+ echo '<span>' . _x ("Last Name", "s2member-front", "s2member") . ' *</span><br />' . "\n";
495
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="' . esc_attr ($_p["ws_plugin__s2member_custom_reg_field_last_name"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
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
}
503
/**/
504
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"])
505
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level ("auto-detection", "registration"))
506
+ {
507
+ $tabindex = $tabindex + 9; /* Start tabindex at +9 ( +1 below ). */
508
+ /**/
509
+ foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
510
+ {
511
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
512
+ do_action ("ws_plugin__s2member_during_custom_registration_fields_before_custom_fields", get_defined_vars ());
513
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
514
+ /**/
515
+ if (in_array ($field["id"], $fields_applicable)) /* Field applicable? */
516
+ {
517
+ $field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field["id"]));
518
+ $field_id_class = preg_replace ("/_/", "-", $field_var);
519
+ /**/
520
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
521
+ if (apply_filters ("ws_plugin__s2member_during_custom_registration_fields_during_custom_fields_display", true, get_defined_vars ()))
522
+ {
523
+ if (!empty ($field["section"]) && $field["section"] === "yes") /* Starts a new section? */
524
+ echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section' . ((!empty ($field["sectitle"])) ? '-title' : '') . '">' . ((!empty ($field["sectitle"])) ? $field["sectitle"] : '') . '</div>';
525
+ /**/
526
+ echo '<p>' . "\n";
527
+ echo '<label for="ws-plugin--s2member-custom-reg-field-' . esc_attr ($field_id_class) . '">' . "\n";
528
+ echo '<span' . ((preg_match ("/^(checkbox|pre_checkbox)#x2F;", $field["type"])) ? ' style="display:none;"' : '') . '>' . $field["label"] . (($field["required"] === "yes") ? ' *' : '') . '</span></label>' . ((preg_match ("/^(checkbox|pre_checkbox)#x2F;", $field["type"])) ? '' : '<br />') . "\n";
529
+ echo c_ws_plugin__s2member_custom_reg_fields::custom_field_gen (__FUNCTION__, $field, "ws_plugin__s2member_custom_reg_field_", "ws-plugin--s2member-custom-reg-field-", "ws-plugin--s2member-custom-reg-field", "", ($tabindex = $tabindex + 1), "", $_p, $_p["ws_plugin__s2member_custom_reg_field_" . $field_var], "registration");
530
+ echo '</p>' . "\n";
531
+ }
532
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
533
+ }
534
+ /**/
535
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
536
+ do_action ("ws_plugin__s2member_during_custom_registration_fields_after_custom_fields", get_defined_vars ());
537
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
538
+ }
539
+ }
540
/**/
541
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && c_ws_plugin__s2member_list_servers::list_servers_integrated ())
542
{
543
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
544
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_opt_in", get_defined_vars ());
545
unset ($__refs, $__v); /* Unset defined __refs, __v. */
546
/**/
551
echo '</label>' . "\n";
552
echo '</p>' . "\n";
553
/**/
554
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
555
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_opt_in", get_defined_vars ());
556
unset ($__refs, $__v); /* Unset defined __refs, __v. */
557
}
558
/**/
559
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
560
do_action ("ws_plugin__s2member_during_custom_registration_fields_after", get_defined_vars ());
561
unset ($__refs, $__v); /* Unset defined __refs, __v. */
562
/**/
563
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
564
do_action ("ws_plugin__s2member_after_custom_registration_fields", get_defined_vars ());
565
unset ($__refs, $__v); /* Unset defined __refs, __v. */
566
/**/
includes/classes/email-configs.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_email_configs"))
21
{
@@ -143,7 +143,7 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
143
remove_filter ("wp_mail_from_name", "c_ws_plugin__s2member_email_configs::_email_config_name");
144
/**/
145
if ($all) /* If $all is true, then we remove all attached WordPress® Filters. */
146
- remove_all_filters ("wp_mail_from") . remove_all_filters ("wp_mail_from_name");
147
/**/
148
do_action ("ws_plugin__s2member_after_email_config_release", get_defined_vars ());
149
/**/
@@ -164,11 +164,11 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
164
*/
165
public static function ms_nice_email_roles ($message = FALSE)
166
{
167
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
168
do_action ("ws_plugin__s2member_before_ms_nice_email_roles", get_defined_vars ());
169
unset ($__refs, $__v); /* Unset defined __refs, __v. */
170
/**/
171
- $message = preg_replace ("/ as a (subscriber|s2member_level[0-9]+)/i", " as a Member", $message);
172
/**/
173
return apply_filters ("ws_plugin__s2member_ms_nice_email_roles", $message, get_defined_vars ());
174
}
@@ -186,7 +186,7 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
186
*/
187
public static 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
/**/
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_email_configs"))
21
{
143
remove_filter ("wp_mail_from_name", "c_ws_plugin__s2member_email_configs::_email_config_name");
144
/**/
145
if ($all) /* If $all is true, then we remove all attached WordPress® Filters. */
146
+ remove_all_filters("wp_mail_from") . remove_all_filters ("wp_mail_from_name");
147
/**/
148
do_action ("ws_plugin__s2member_after_email_config_release", get_defined_vars ());
149
/**/
164
*/
165
public static function ms_nice_email_roles ($message = FALSE)
166
{
167
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
168
do_action ("ws_plugin__s2member_before_ms_nice_email_roles", get_defined_vars ());
169
unset ($__refs, $__v); /* Unset defined __refs, __v. */
170
/**/
171
+ $message = preg_replace ("/ as a (subscriber|s2member_level[0-9]+)/i", " " . _x ("as a Member", "s2member-front", "s2member"), $message);
172
/**/
173
return apply_filters ("ws_plugin__s2member_ms_nice_email_roles", $message, get_defined_vars ());
174
}
186
*/
187
public static 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
/**/
includes/classes/files-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_files_in"))
21
{
@@ -41,205 +41,196 @@ if (!class_exists ("c_ws_plugin__s2member_files_in"))
41
{
42
do_action ("ws_plugin__s2member_before_file_download_access", get_defined_vars ());
43
/**/
44
- if (!empty ($_GET["s2member_file_download"]) && strpos ($_GET["s2member_file_download"], "..") === false)
45
- {
46
- $excluded = apply_filters ("ws_plugin__s2member_check_file_download_access_excluded", false, get_defined_vars ());
47
- /**/
48
- if (!($using_amazon_s3_storage = 0) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_access_key"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_secret_key"])
49
- $using_amazon_s3_storage = true; /* Amazon® S3 storage has been configured! */
50
- /**/
51
- if (!$excluded && (empty ($_GET["s2member_file_download_key"]) || (!empty ($_GET["s2member_file_download_key"]) && !($file_download_key_is_valid = ($_GET["s2member_file_download_key"] === c_ws_plugin__s2member_files::file_download_key ($_GET["s2member_file_download"]) || $_GET["s2member_file_download_key"] === c_ws_plugin__s2member_files::file_download_key ($_GET["s2member_file_download"], "ip-forever") || $_GET["s2member_file_download_key"] === c_ws_plugin__s2member_files::file_download_key ($_GET["s2member_file_download"], "universal"))))))
52
{
53
- $_GET["s2member_file_download"] = trim ($_GET["s2member_file_download"], "/"); /* Trim slashes after Key comparison. */
54
/**/
55
- if (!$using_amazon_s3_storage && !file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
56
- {
57
- header ("HTTP/1.0 404 Not Found"); /* The file does NOT even exist. */
58
- exit ("404: Sorry, file not found. Please contact Support for assistance.");
59
- }
60
/**/
61
- else if (!empty ($_GET["s2member_file_download_key"]) && !$file_download_key_is_valid) /* Invalid Key? */
62
- {
63
- header ("HTTP/1.0 503 Service Temporarily Unavailable"); /* Invalid Download Keys are handled separately. */
64
- exit ("503 ( Invalid Key ): Sorry, your access to this file has expired. Please contact Support for assistance.");
65
- }
66
/**/
67
- else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]) /* Is a Membership Options Page configured? */
68
- /* This file will be processed WITHOUT a Download Key, using Membership Level Access ( w/ possible Custom Capabilities ). */
69
{
70
- if (!has_filter ("ws_plugin__s2member_check_file_download_access_user", "c_ws_plugin__s2member_files_in::_file_remote_authorization"))
71
- add_filter ("ws_plugin__s2member_check_file_download_access_user", "c_ws_plugin__s2member_files_in::_file_remote_authorization", 10, 2);
72
/**/
73
- if (($file_download_access_is_allowed = $min_level_4_downloads = c_ws_plugin__s2member_files::min_level_4_downloads ()) === false)
74
{
75
- header ("HTTP/1.0 503 Service Temporarily Unavailable"); /* File downloads are NOT yet configured? */
76
- exit ("503: Sorry, File Downloads are NOT enabled yet. Please contact Support for assistance. If you are the site owner, please configure: `s2Member -> Download Options -> Basic Download Restrictions`.");
77
}
78
/**/
79
- else if (!is_object ($user = apply_filters ("ws_plugin__s2member_check_file_download_access_user", ((is_user_logged_in ()) ? wp_get_current_user () : false), get_defined_vars ())) || !($user_id = $user->ID))
80
{
81
- if (preg_match ("/^access[_\-]s2member[_\-]level([0-9]+)\//", $_GET["s2member_file_download"], $m))
82
{
83
$level_req = $m[1]; /* Which Level does this require? */
84
- if (wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_level_req" => $level_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
85
exit ();
86
}
87
else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $_GET["s2member_file_download"], $m))
88
{
89
$ccap_req = preg_replace ("/-/", "_", $m[1]); /* Which Capability does this require? */
90
- if (wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_ccap_req" => $ccap_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
91
exit ();
92
}
93
- else if (wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_level_req" => (string)$min_level_4_downloads)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
94
- exit ();
95
- }
96
- /**/
97
- else if ((!is_array ($file_downloads = c_ws_plugin__s2member_files::user_downloads ($user)) || !$file_downloads["allowed"] || !$file_downloads["allowed_days"])/**/
98
- && wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"])), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
99
- exit ();
100
- /**/
101
- else if (preg_match ("/^access[_\-]s2member[_\-]level([0-9]+)\//", $_GET["s2member_file_download"], $m))
102
- {
103
- $level_req = $m[1]; /* Which Level does this require? */
104
- if (!$user->has_cap ("access_s2member_level" . $level_req) /* Does the User have access to this Level? */
105
- && wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_level_req" => $level_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
106
- exit ();
107
- }
108
- /**/
109
- else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $_GET["s2member_file_download"], $m))
110
- {
111
- $ccap_req = preg_replace ("/-/", "_", $m[1]); /* Which Capability does this require? */
112
- if (!$user->has_cap ("access_s2member_ccap_" . $ccap_req) /* Does the User have access to this Custom Capability? */
113
- && wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_ccap_req" => $ccap_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
114
- exit ();
115
- }
116
- /**/
117
- $already_downloaded = false; /* Initialize this to a false value. */
118
- $previous_file_downloads = 0; /* Here we're going to count how many downloads they've performed. */
119
- $max_days_logged = c_ws_plugin__s2member_files::max_download_period (); /* Longest period/days. */
120
- $file_download_access_log = (array)get_user_option ("s2member_file_download_access_log", $user_id);
121
- $file_download_access_arc = (array)get_user_option ("s2member_file_download_access_arc", $user_id);
122
- /**/
123
- foreach ($file_download_access_log as $file_download_access_log_entry_key => $file_download_access_log_entry)
124
- {
125
- if (strtotime ($file_download_access_log_entry["date"]) < strtotime ("-" . $max_days_logged . " days"))
126
- {
127
- unset ($file_download_access_log[$file_download_access_log_entry_key]);
128
- $file_download_access_arc[] = $file_download_access_log_entry;
129
- }
130
- else if (strtotime ($file_download_access_log_entry["date"]) >= strtotime ("-" . $file_downloads["allowed_days"] . " days"))
131
{
132
- $previous_file_downloads++;
133
- if ($file_download_access_log_entry["file"] === $_GET["s2member_file_download"])
134
- $already_downloaded = true;
135
}
136
}
137
- /**/
138
- if (!$already_downloaded && $previous_file_downloads >= $file_downloads["allowed"] /* They have NOT already downloaded this file, and they're over their limit. */
139
- && wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"])), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
140
- exit ();
141
- /**/
142
- if (!$already_downloaded) /* Only add this file to the log if they have not already downloaded it. */
143
- $file_download_access_log[] = array ("date" => date ("Y-m-d"), "file" => $_GET["s2member_file_download"]);
144
- /**/
145
- update_user_option ($user_id, "s2member_file_download_access_arc", c_ws_plugin__s2member_utils_arrays::array_unique ($file_download_access_arc));
146
- update_user_option ($user_id, "s2member_file_download_access_log", c_ws_plugin__s2member_utils_arrays::array_unique ($file_download_access_log));
147
}
148
- }
149
- else /* Otherwise... it's either $excluded; or permission was granted with a valid Download Key. */
150
- {
151
- $_GET["s2member_file_download"] = trim ($_GET["s2member_file_download"], "/");
152
- /**/
153
- if (!$using_amazon_s3_storage && !file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
154
{
155
- header ("HTTP/1.0 404 Not Found"); /* The file does NOT even exist. */
156
- exit ("404: Sorry, file not found. Please contact Support for assistance.");
157
}
158
- }
159
- /*
160
- Here we are going to put together all of the File Download information.
161
- */
162
- $extension = strtolower (substr ($_GET["s2member_file_download"], strrpos ($_GET["s2member_file_download"], ".") + 1)); /* To lowercase. */
163
- /**/
164
- $mimetypes = parse_ini_file (dirname (dirname (dirname (__FILE__))) . "/includes/mime-types.ini"); /* Types provided by: `mime-types.ini`. */
165
- $mimetype = ($mimetypes[$extension]) ? $mimetypes[$extension] : "application/octet-stream"; /* Lookup the MIME type for this file extension. */
166
- /**/
167
- $inline = (!empty ($_GET["s2member_file_inline"]) || in_array ($extension, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]))) ? true : false;
168
- /**/
169
- $basename = basename ($_GET["s2member_file_download"]); /* The actual name of this File Download ( i.e. the basename ); including its file extension too. */
170
- /**/
171
- $pathinfo = (!$using_amazon_s3_storage) ? pathinfo (($file = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"])) : array ();
172
- $length = (!$using_amazon_s3_storage && $file) ? filesize ($file) : -1; /* The overall file size, in bytes. */
173
- /**/
174
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
175
- do_action ("ws_plugin__s2member_during_file_download_access", get_defined_vars ());
176
- unset ($__refs, $__v); /* Unset defined __refs, __v. */
177
- /**/
178
- if ($using_amazon_s3_storage) /* Using Amazon® S3 storage? In this case, we use an authenticated redirection to S3 storage. */
179
- {
180
- $amazon_s3_file_expires = strtotime ("+" . apply_filters ("ws_plugin__s2member_amazon_s3_file_expires_time", "30 seconds", get_defined_vars ()));
181
- /**/
182
- $amazon_s3_file = "/" . $_GET["s2member_file_download"] . "?response-cache-control=" . urlencode (($amazon_s3_cache_control = "no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0")) . "&response-content-disposition=" . urlencode (($amazon_s3_content_disposition = (($inline) ? "inline" : "attachment") . '; filename="' . $basename . '"')) . "&response-content-type=" . urlencode (($amazon_s3_content_type = $mimetype)) . "&response-expires=" . urlencode (($amazon_s3_expires = gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT"));
183
- $amazon_s3_raw_file = "/" . $_GET["s2member_file_download"] . "?response-cache-control=" . $amazon_s3_cache_control . "&response-content-disposition=" . $amazon_s3_content_disposition . "&response-content-type=" . $amazon_s3_content_type . "&response-expires=" . $amazon_s3_expires;
184
- $amazon_s3_signature = base64_encode (c_ws_plugin__s2member_files_in::amazon_s3_sign ("GET\n\n\n" . $amazon_s3_file_expires . "\n" . "/" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"] . $amazon_s3_raw_file));
185
/**/
186
- $amazon_s3_redirection_url = "http://" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"] . ".s3.amazonaws.com" . $amazon_s3_file;
187
- if (strtolower ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"]) !== $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"])
188
- $amazon_s3_redirection_url = "http://s3.amazonaws.com/" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"] . $amazon_s3_file;
189
/**/
190
- $amazon_s3_redirection_url .= "&AWSAccessKeyId=" . urlencode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_access_key"]);
191
- $amazon_s3_redirection_url .= "&Expires=" . urlencode ($amazon_s3_file_expires);
192
- $amazon_s3_redirection_url .= "&Signature=" . urlencode ($amazon_s3_signature);
193
/**/
194
- wp_redirect ($amazon_s3_redirection_url); /* 302 redirection. */
195
- /**/
196
- exit (); /* Clean exit. */
197
- }
198
- /**/
199
- else /* Else, using localized storage ( default ). */
200
- {
201
- @set_time_limit (0); /* Unlimited. */
202
- @ini_set ("zlib.output_compression", 0);
203
/**/
204
- header ("Accept-Ranges: none");
205
- header ("Content-Encoding: none");
206
- header ("Content-Type: " . $mimetype);
207
- header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
208
- header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
209
- header ("Cache-Control: no-cache, must-revalidate, max-age=0");
210
- header ("Cache-Control: post-check=0, pre-check=0", false);
211
- header ("Pragma: no-cache");
212
/**/
213
- header ('Content-Disposition: ' . (($inline) ? "inline" : "attachment") . '; filename="' . $basename . '"');
214
/**/
215
- if ($length && apply_filters ("ws_plugin__s2member_stream_file_downloads", true, get_defined_vars ()) && ($stream = fopen ($file, "rb")))
216
{
217
- $_stream_w_content_length = (preg_match ("/^win/i", PHP_OS)) ? false : true; /* Windows® IIS does not jive here. */
218
- /* Windows® IIS doesn't seem to like it when both `Content-Length` and `Transfer-Encoding: chunked` are sent together. */
219
- if (apply_filters ("ws_plugin__s2member_stream_file_downloads_w_content_length", $_stream_w_content_length, get_defined_vars ()))
220
- header ("Content-Length: " . $length);
221
/**/
222
- header ("Transfer-Encoding: chunked"); /* Uses `Transfer-Encoding: chunked` for simulated streaming. */
223
/**/
224
- eval ('while (@ob_end_clean ());'); /* End/clean all output buffers that may or may not exist. */
225
/**/
226
- while (!feof ($stream) && ($chunk_size = strlen ($data = fread ($stream, 2097152))))
227
- eval ('echo dechex ($chunk_size) . "\r\n". $data . "\r\n"; @flush ();');
228
/**/
229
- fclose ($stream);
230
- /**/
231
- exit ("0\r\n\r\n");
232
}
233
- else if ($length) /* Else `file_get_contents()`. */
234
{
235
- header ("Content-Length: " . $length);
236
/**/
237
- exit (file_get_contents ($file));
238
}
239
- else
240
- exit (); /* Empty file. */
241
}
242
- }
243
/**/
244
do_action ("ws_plugin__s2member_after_file_download_access", get_defined_vars ());
245
}
@@ -271,19 +262,19 @@ if (!class_exists ("c_ws_plugin__s2member_files_in"))
271
*/
272
public static function _file_remote_authorization ($user = FALSE)
273
{
274
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
275
do_action ("_ws_plugin__s2member_before_file_remote_authorization", get_defined_vars ());
276
unset ($__refs, $__v); /* Unset defined __refs, __v. */
277
/**/
278
- if (!is_object ($user) && !empty ($_GET["s2member_file_remote"])) /* Use Header Authorization? */
279
{
280
do_action ("_ws_plugin__s2member_during_file_remote_authorization_before", get_defined_vars ());
281
/**/
282
if (empty ($_SERVER["PHP_AUTH_USER"]) || empty ($_SERVER["PHP_AUTH_PW"]) || !user_pass_ok ($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"]))
283
{
284
- header ('WWW-Authenticate: Basic realm="Members Only"');
285
- header ("HTTP/1.0 401 Unauthorized");
286
- exit ("Access Denied");
287
}
288
else if (is_object ($_user = new WP_User ($_SERVER["PHP_AUTH_USER"])) && $_user->ID)
289
{
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_files_in"))
21
{
41
{
42
do_action ("ws_plugin__s2member_before_file_download_access", get_defined_vars ());
43
/**/
44
+ if (!empty ($_GET["s2member_file_download"])) /* Ignore `..`, and `^.` files like `.htaccess`. */
45
+ if (strpos ($_GET["s2member_file_download"], "..") === false) /* Ignore `..` if it appears anywhere. */
46
+ if (strpos (basename ($_GET["s2member_file_download"]), ".") !== 0) /* Ignore any/all hidden files. */
47
{
48
+ @set_time_limit(0) . @ini_set ("zlib.output_compression", 0) . eval ('while (@ob_end_clean ());');
49
/**/
50
+ $excluded = apply_filters ("ws_plugin__s2member_check_file_download_access_excluded", false, get_defined_vars ());
51
/**/
52
+ if (!($using_amazon_s3_storage = 0) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_access_key"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_secret_key"])
53
+ $using_amazon_s3_storage = true; /* Amazon® S3 storage has been configured! */
54
/**/
55
+ if (!$excluded && (empty ($_GET["s2member_file_download_key"]) || (!empty ($_GET["s2member_file_download_key"]) && !($file_download_key_is_valid = ($_GET["s2member_file_download_key"] === c_ws_plugin__s2member_files::file_download_key ($_GET["s2member_file_download"]) || $_GET["s2member_file_download_key"] === c_ws_plugin__s2member_files::file_download_key ($_GET["s2member_file_download"], "ip-forever") || $_GET["s2member_file_download_key"] === c_ws_plugin__s2member_files::file_download_key ($_GET["s2member_file_download"], "universal"))))))
56
{
57
+ $_GET["s2member_file_download"] = trim ($_GET["s2member_file_download"], "/"); /* Trim slashes after Key comparison. */
58
/**/
59
+ if (!$using_amazon_s3_storage && !file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
60
{
61
+ status_header(404) . exit (_x ("404: Sorry, file not found. Please contact Support for assistance.", "s2member-front", "s2member"));
62
}
63
/**/
64
+ else if (!empty ($_GET["s2member_file_download_key"]) && !$file_download_key_is_valid)
65
{
66
+ status_header(503) . exit (_x ("503 ( Invalid Key ): Sorry, your access to this file has expired. Please contact Support for assistance.", "s2member-front", "s2member"));
67
+ }
68
+ /**/
69
+ else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] || ($file_download_access_is_allowed = $min_level_4_downloads = c_ws_plugin__s2member_files::min_level_4_downloads ()) === false)
70
+ {
71
+ if (!has_filter ("ws_plugin__s2member_check_file_download_access_user", "c_ws_plugin__s2member_files_in::_file_remote_authorization"))
72
+ add_filter ("ws_plugin__s2member_check_file_download_access_user", "c_ws_plugin__s2member_files_in::_file_remote_authorization", 10, 2);
73
+ /**/
74
+ if ((isset ($file_download_access_is_allowed, $min_level_4_downloads) && $file_download_access_is_allowed === false) || ($file_download_access_is_allowed = $min_level_4_downloads = c_ws_plugin__s2member_files::min_level_4_downloads ()) === false)
75
+ {
76
+ status_header(503) . exit (_x ("503: Sorry, File Downloads are NOT enabled yet. Please contact Support for assistance. If you are the site owner, please configure: `s2Member -> Download Options -> Basic Download Restrictions`.", "s2member-front", "s2member"));
77
+ }
78
+ /**/
79
+ else if (!is_object ($user = apply_filters ("ws_plugin__s2member_check_file_download_access_user", ((is_user_logged_in ()) ? wp_get_current_user () : false), get_defined_vars ())) || !($user_id = $user->ID))
80
+ {
81
+ if (preg_match ("/^access[_\-]s2member[_\-]level([0-9]+)\//", $_GET["s2member_file_download"], $m))
82
+ {
83
+ $level_req = $m[1]; /* Which Level does this require? */
84
+ if (wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_level_req" => $level_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
85
+ exit ();
86
+ }
87
+ else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $_GET["s2member_file_download"], $m))
88
+ {
89
+ $ccap_req = preg_replace ("/-/", "_", $m[1]); /* Which Capability does this require? */
90
+ if (wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_ccap_req" => $ccap_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
91
+ exit ();
92
+ }
93
+ else if (wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_level_req" => (string)$min_level_4_downloads)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
94
+ exit ();
95
+ }
96
+ /**/
97
+ else if ((!is_array ($file_downloads = c_ws_plugin__s2member_files::user_downloads ($user)) || !$file_downloads["allowed"] || !$file_downloads["allowed_days"])/**/
98
+ && wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"])), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
99
+ exit ();
100
+ /**/
101
+ else if (preg_match ("/^access[_\-]s2member[_\-]level([0-9]+)\//", $_GET["s2member_file_download"], $m))
102
{
103
$level_req = $m[1]; /* Which Level does this require? */
104
+ if (!$user->has_cap ("access_s2member_level" . $level_req) /* Does the User have access to this Level? */
105
+ && wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_level_req" => $level_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
106
exit ();
107
}
108
+ /**/
109
else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $_GET["s2member_file_download"], $m))
110
{
111
$ccap_req = preg_replace ("/-/", "_", $m[1]); /* Which Capability does this require? */
112
+ if (!$user->has_cap ("access_s2member_ccap_" . $ccap_req) /* Does the User have access to this Custom Capability? */
113
+ && wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"], "s2member_ccap_req" => $ccap_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
114
exit ();
115
}
116
+ /**/
117
+ $already_downloaded = false; /* Initialize this to a false value. */
118
+ $previous_file_downloads = 0; /* Here we're going to count how many downloads they've performed. */
119
+ $max_days_logged = c_ws_plugin__s2member_files::max_download_period (); /* Longest period/days. */
120
+ $file_download_access_log = (array)get_user_option ("s2member_file_download_access_log", $user_id);
121
+ $file_download_access_arc = (array)get_user_option ("s2member_file_download_access_arc", $user_id);
122
+ /**/
123
+ foreach ($file_download_access_log as $file_download_access_log_entry_key => $file_download_access_log_entry)
124
{
125
+ if (strtotime ($file_download_access_log_entry["date"]) < strtotime ("-" . $max_days_logged . " days"))
126
+ {
127
+ unset($file_download_access_log[$file_download_access_log_entry_key]);
128
+ $file_download_access_arc[] = $file_download_access_log_entry;
129
+ }
130
+ else if (strtotime ($file_download_access_log_entry["date"]) >= strtotime ("-" . $file_downloads["allowed_days"] . " days"))
131
+ {
132
+ $previous_file_downloads++;
133
+ if ($file_download_access_log_entry["file"] === $_GET["s2member_file_download"])
134
+ $already_downloaded = true;
135
+ }
136
}
137
+ /**/
138
+ if (!$already_downloaded && $previous_file_downloads >= $file_downloads["allowed"] /* They have NOT already downloaded this file, and they're over their limit. */
139
+ && wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $_GET["s2member_file_download"])), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) !== "nill")
140
+ exit ();
141
+ /**/
142
+ if (!$already_downloaded) /* Only add this file to the log if they have not already downloaded it. */
143
+ $file_download_access_log[] = array ("date" => date ("Y-m-d"), "file" => $_GET["s2member_file_download"]);
144
+ /**/
145
+ update_user_option ($user_id, "s2member_file_download_access_arc", c_ws_plugin__s2member_utils_arrays::array_unique ($file_download_access_arc));
146
+ update_user_option ($user_id, "s2member_file_download_access_log", c_ws_plugin__s2member_utils_arrays::array_unique ($file_download_access_log));
147
}
148
}
149
+ else /* Otherwise... it's either $excluded; or permission was granted with a valid Download Key. */
150
{
151
+ $_GET["s2member_file_download"] = trim ($_GET["s2member_file_download"], "/");
152
+ /**/
153
+ if (!$using_amazon_s3_storage && !file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
154
+ {
155
+ status_header(404) . exit (_x ("404: Sorry, file not found. Please contact Support for assistance.", "s2member-front", "s2member"));
156
+ }
157
}
158
+ /*
159
+ Here we are going to put together all of the File Download information.
160
+ */
161
+ $extension = strtolower (substr ($_GET["s2member_file_download"], strrpos ($_GET["s2member_file_download"], ".") + 1)); /* To lowercase. */
162
/**/
163
+ $mimetypes = parse_ini_file (dirname (dirname (dirname (__FILE__))) . "/includes/mime-types.ini"); /* Types provided by: `mime-types.ini`. */
164
+ $mimetype = ($mimetypes[$extension]) ? $mimetypes[$extension] : "application/octet-stream"; /* Lookup the MIME type for this file extension. */
165
/**/
166
+ $inline = (isset ($_GET["s2member_file_inline"])) ? filter_var ($_GET["s2member_file_inline"], FILTER_VALIDATE_BOOLEAN) : ((in_array ($extension, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]))) ? true : false);
167
/**/
168
+ $basename = basename ($_GET["s2member_file_download"]); /* The actual name of this File Download ( i.e. the basename ); including its file extension too. */
169
/**/
170
+ $pathinfo = (!$using_amazon_s3_storage) ? pathinfo (($file = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"])) : array ();
171
+ $length = (!$using_amazon_s3_storage && $file) ? filesize ($file) : -1; /* The overall file size, in bytes. */
172
/**/
173
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
174
+ do_action ("ws_plugin__s2member_during_file_download_access", get_defined_vars ());
175
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
176
/**/
177
+ if ($using_amazon_s3_storage) /* Using Amazon® S3 storage? In this case, we use an authenticated redirection to S3 storage. */
178
{
179
+ $amazon_s3_file_expires = strtotime ("+" . apply_filters ("ws_plugin__s2member_amazon_s3_file_expires_time", "30 seconds", get_defined_vars ()));
180
/**/
181
+ $amazon_s3_file = "/" . $_GET["s2member_file_download"] . "?response-cache-control=" . urlencode (($amazon_s3_cache_control = "no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0")) . "&response-content-disposition=" . urlencode (($amazon_s3_content_disposition = (($inline) ? "inline" : "attachment") . '; filename="' . $basename . '"')) . "&response-content-type=" . urlencode (($amazon_s3_content_type = $mimetype)) . "&response-expires=" . urlencode (($amazon_s3_expires = gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT"));
182
+ $amazon_s3_raw_file = "/" . $_GET["s2member_file_download"] . "?response-cache-control=" . $amazon_s3_cache_control . "&response-content-disposition=" . $amazon_s3_content_disposition . "&response-content-type=" . $amazon_s3_content_type . "&response-expires=" . $amazon_s3_expires;
183
+ $amazon_s3_signature = base64_encode (c_ws_plugin__s2member_files_in::amazon_s3_sign ("GET\n\n\n" . $amazon_s3_file_expires . "\n" . "/" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"] . $amazon_s3_raw_file));
184
/**/
185
+ $amazon_s3_redirection_url = "http://" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"] . ".s3.amazonaws.com" . $amazon_s3_file;
186
+ if (strtolower ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"]) !== $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"])
187
+ $amazon_s3_redirection_url = "http://s3.amazonaws.com/" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"] . $amazon_s3_file;
188
/**/
189
+ $amazon_s3_redirection_url .= "&AWSAccessKeyId=" . urlencode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_access_key"]);
190
+ $amazon_s3_redirection_url .= "&Expires=" . urlencode ($amazon_s3_file_expires);
191
+ $amazon_s3_redirection_url .= "&Signature=" . urlencode ($amazon_s3_signature);
192
/**/
193
+ wp_redirect($amazon_s3_redirection_url) . exit ();
194
}
195
+ /**/
196
+ else /* Else, using localized storage ( default ). */
197
{
198
+ status_header(200);
199
+ header("Accept-Ranges: none");
200
+ header("Content-Encoding: none");
201
+ header("Content-Type: " . $mimetype);
202
+ header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
203
+ header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
204
+ header("Cache-Control: no-cache, must-revalidate, max-age=0");
205
+ header ("Cache-Control: post-check=0, pre-check=0", false);
206
+ header("Pragma: no-cache");
207
/**/
208
+ header('Content-Disposition: ' . (($inline) ? "inline" : "attachment") . '; filename="' . $basename . '"');
209
+ /**/
210
+ if ($length && apply_filters ("ws_plugin__s2member_stream_file_downloads", true, get_defined_vars ()) && ($stream = fopen ($file, "rb")))
211
+ {
212
+ $_stream_w_content_length = (stripos (PHP_OS, "win") === 0 && (!function_exists ("apache_get_version") || apache_get_version () === false)) ? false : true;
213
+ /* Windows® IIS doesn't seem to like it when both `Content-Length` and `Transfer-Encoding: chunked` are sent together. */
214
+ if (apply_filters ("ws_plugin__s2member_stream_file_downloads_w_content_length", $_stream_w_content_length, get_defined_vars ()))
215
+ header("Content-Length: " . $length);
216
+ /**/
217
+ header("Transfer-Encoding: chunked"); /* Uses `Transfer-Encoding: chunked` for simulated streaming. */
218
+ /**/
219
+ while (!feof ($stream) && ($chunk_size = strlen ($data = fread ($stream, 2097152))))
220
+ eval('echo dechex ($chunk_size) . "\r\n". $data . "\r\n"; @flush ();');
221
+ /**/
222
+ fclose($stream) . exit ("0\r\n\r\n");
223
+ }
224
+ else if ($length) /* Else `file_get_contents()`. */
225
+ {
226
+ header("Content-Length: " . $length) . exit (file_get_contents ($file));
227
+ }
228
+ else /* Else, we have an empty file. */
229
+ {
230
+ header("Content-Length: 0") . exit (); /* Empty file. */
231
+ }
232
}
233
}
234
/**/
235
do_action ("ws_plugin__s2member_after_file_download_access", get_defined_vars ());
236
}
262
*/
263
public static function _file_remote_authorization ($user = FALSE)
264
{
265
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
266
do_action ("_ws_plugin__s2member_before_file_remote_authorization", get_defined_vars ());
267
unset ($__refs, $__v); /* Unset defined __refs, __v. */
268
/**/
269
+ if (!is_object ($user) && isset ($_GET["s2member_file_remote"]) && filter_var ($_GET["s2member_file_remote"], FILTER_VALIDATE_BOOLEAN))
270
{
271
do_action ("_ws_plugin__s2member_during_file_remote_authorization_before", get_defined_vars ());
272
/**/
273
if (empty ($_SERVER["PHP_AUTH_USER"]) || empty ($_SERVER["PHP_AUTH_PW"]) || !user_pass_ok ($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"]))
274
{
275
+ header('WWW-Authenticate: Basic realm="' . _x ("Members Only", "s2member-front", "s2member") . '"');
276
+ status_header(401); /* Unauthorized status header. */
277
+ exit(_x ("Access Denied", "s2member-front", "s2member"));
278
}
279
else if (is_object ($_user = new WP_User ($_SERVER["PHP_AUTH_USER"])) && $_user->ID)
280
{
includes/classes/installation.inc.php CHANGED
@@ -43,7 +43,6 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
43
do_action ("ws_plugin__s2member_before_activation", get_defined_vars ());
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"]))
@@ -51,25 +50,25 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
51
mkdir ($files_dir, 0777, true);
52
/**/
53
if (is_dir ($files_dir) && is_writable ($files_dir))
54
- if (!file_exists ($htaccess = $files_dir . "/.htaccess"))
55
- file_put_contents ($htaccess, "deny from all");
56
/**/
57
if (!is_dir ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
58
if (is_writable (dirname (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($logs_dir))))
59
mkdir ($logs_dir, 0777, true);
60
/**/
61
if (is_dir ($logs_dir) && is_writable ($logs_dir))
62
- if (!file_exists ($htaccess = $logs_dir . "/.htaccess"))
63
- file_put_contents ($htaccess, "deny from all");
64
/**/
65
(!is_array (get_option ("ws_plugin__s2member_cache"))) ? update_option ("ws_plugin__s2member_cache", array ()) : null;
66
(!is_array (get_option ("ws_plugin__s2member_notices"))) ? update_option ("ws_plugin__s2member_notices", array ()) : null;
67
(!is_array (get_option ("ws_plugin__s2member_options"))) ? update_option ("ws_plugin__s2member_options", array ()) : null;
68
(!is_numeric (get_option ("ws_plugin__s2member_configured"))) ? update_option ("ws_plugin__s2member_configured", "0") : null;
69
/**/
70
- if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["configured"]) /* If already configured, we are re-activating. */
71
{
72
- $v = get_option ("ws_plugin__s2member_activated_version");
73
/**/
74
if (!$v || !version_compare ($v, "3.2", ">=")) /* Needs to be upgraded? */
75
/* Version 3.2 is where `meta_key` names were changed. They're prefixed now. */
@@ -90,28 +89,22 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
90
$wpdb->query ("DELETE FROM `" . $wpdb->postmeta . "` WHERE `meta_key` = 's2member_ccaps_req' AND `meta_value` IN('','a:0:{}','a:1:{i:0;s:0:\"\";}')");
91
}
92
/**/
93
- if (!$v || !version_compare ($v, "3.5", ">=")) /* Needs to be notified about Screen Options? */
94
- /* Version 3.5 introduced a dismissal message regarding Screen Options in the list of Users/Members. */
95
{
96
- $notice = '<strong>Note:</strong> s2Member adds some new data columns to your list of Users/Members. If your list gets overcrowded, please use the <strong>Screen Options</strong> tab <em>( upper right-hand corner )</em>. With WordPress® Screen Options, you can add/remove specific data columns; thereby making the most important data easier to read. For example, if you create Custom Registration Fields with s2Member, those Custom Fields will result in new data columns; which can cause your list of Users/Members to become nearly unreadable. So just use the Screen Options tab to clean things up.';
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. */
104
$notice .= '<br />Have fun, <a href="' . esc_attr (admin_url ("/admin.php?page=ws-plugin--s2member-info#rm-changelog")) . '">read the Changelog</a>, and make some money! :-)';
105
/**/
106
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, array ("blog|network:plugins.php", "blog|network:ws-plugin--s2member-start", "blog|network:ws-plugin--s2member-mms-ops", "blog|network:ws-plugin--s2member-gen-ops", "blog|network:ws-plugin--s2member-res-ops"));
107
- /**/
108
- if (preg_match ("/^win/i", PHP_OS) && is_dir (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($files_dir)) && count (scandir (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($files_dir))) > 4)
109
- {
110
- $notice = '<strong>Windows® Server ( NOTICE ):</strong> Your protected files MUST be moved to the <code>/app_data</code> sub-directory. For further details, see: <code>s2Member -> Download Options -> Basic</code>.';
111
- c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, array ("blog|network:plugins.php", "blog|network:ws-plugin--s2member-start", "blog|network:ws-plugin--s2member-mms-ops", "blog|network:ws-plugin--s2member-gen-ops", "blog|network:ws-plugin--s2member-res-ops"), true);
112
- }
113
}
114
- else /* Otherwise, (initial activation); we'll help the Site Owner out by giving them a link to the Quick Start Guide. */
115
{
116
$notice = '<strong>Note:</strong> s2Member adds some new data columns to your list of Users/Members. If your list gets overcrowded, please use the <strong>Screen Options</strong> tab <em>( upper right-hand corner )</em>. With WordPress® Screen Options, you can add/remove specific data columns; thereby making the most important data easier to read. For example, if you create Custom Registration Fields with s2Member, those Custom Fields will result in new data columns; which can cause your list of Users/Members to become nearly unreadable. So just use the Screen Options tab to clean things up.';
117
/**/
@@ -123,17 +116,11 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
123
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, array ("blog|network:plugins.php", "blog|network:ws-plugin--s2member-start", "blog|network:ws-plugin--s2member-mms-ops", "blog|network:ws-plugin--s2member-gen-ops", "blog|network:ws-plugin--s2member-res-ops"));
124
}
125
/**/
126
- update_option ("ws_plugin__s2member_activated_version", WS_PLUGIN__S2MEMBER_VERSION); /* Mark version. */
127
- /**/
128
- if (is_multisite () && is_main_site ()) /* Network activation routines. A few quick adjustments. */
129
{
130
foreach ((array)($users = $wpdb->get_results ("SELECT `ID` FROM `" . $wpdb->users . "`")) as $user)
131
- {
132
- /* Here we convert everyone already in the system; without a point of origin.
133
- This will set their point of origin to the Main Site. */
134
- if (!($originating_blog = get_user_meta ($user->ID, "s2member_originating_blog", true)))
135
- update_user_meta ($user->ID, "s2member_originating_blog", $current_site->blog_id);
136
- }
137
/**/
138
$notice = '<strong>Multisite Network</strong> updated automatically by <strong>s2Member</strong> v' . esc_html (WS_PLUGIN__S2MEMBER_VERSION) . '.<br />';
139
$notice .= 'You\'ll want to configure s2Member\'s Multisite options now.<br />';
@@ -142,9 +129,13 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
142
/**/
143
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, array ("blog|network:plugins.php", "blog|network:ws-plugin--s2member-start", "blog|network:ws-plugin--s2member-mms-ops", "blog|network:ws-plugin--s2member-gen-ops", "blog|network:ws-plugin--s2member-res-ops"));
144
/**/
145
update_option ("ws_plugin__s2member_activated_mms_version", WS_PLUGIN__S2MEMBER_VERSION);
146
}
147
/**/
148
do_action ("ws_plugin__s2member_after_activation", get_defined_vars ());
149
/**/
150
return; /* Return for uniformity. */
@@ -195,6 +186,9 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
195
delete_option("ws_plugin__s2member_activated_version");
196
delete_option("ws_plugin__s2member_activated_mms_version");
197
/**/
198
$wpdb->query ("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '%" . esc_sql (like_escape ("s2member_")) . "%'");
199
$wpdb->query ("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '" . esc_sql (like_escape ("_transient_s2m_")) . "%'");
200
$wpdb->query ("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '" . esc_sql (like_escape ("_transient_timeout_s2m_")) . "%'");
43
do_action ("ws_plugin__s2member_before_activation", get_defined_vars ());
44
/**/
45
c_ws_plugin__s2member_roles_caps::config_roles (); /* Config Roles/Caps. */
46
update_option ("ws_plugin__s2member_activated_levels", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]);
47
/**/
48
if (!is_dir ($files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]))
50
mkdir ($files_dir, 0777, true);
51
/**/
52
if (is_dir ($files_dir) && is_writable ($files_dir))
53
+ if (!file_exists ($htaccess = $files_dir . "/.htaccess") || !apply_filters ("ws_plugin__s2member_preserve_files_dir_htaccess", false, get_defined_vars ()))
54
+ file_put_contents ($htaccess, trim (c_ws_plugin__s2member_utilities::evl (file_get_contents ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir_htaccess"]))));
55
/**/
56
if (!is_dir ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
57
if (is_writable (dirname (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($logs_dir))))
58
mkdir ($logs_dir, 0777, true);
59
/**/
60
if (is_dir ($logs_dir) && is_writable ($logs_dir))
61
+ if (!file_exists ($htaccess = $logs_dir . "/.htaccess") || !apply_filters ("ws_plugin__s2member_preserve_logs_dir_htaccess", false, get_defined_vars ()))
62
+ file_put_contents ($htaccess, trim (c_ws_plugin__s2member_utilities::evl (file_get_contents ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir_htaccess"]))));
63
/**/
64
(!is_array (get_option ("ws_plugin__s2member_cache"))) ? update_option ("ws_plugin__s2member_cache", array ()) : null;
65
(!is_array (get_option ("ws_plugin__s2member_notices"))) ? update_option ("ws_plugin__s2member_notices", array ()) : null;
66
(!is_array (get_option ("ws_plugin__s2member_options"))) ? update_option ("ws_plugin__s2member_options", array ()) : null;
67
(!is_numeric (get_option ("ws_plugin__s2member_configured"))) ? update_option ("ws_plugin__s2member_configured", "0") : null;
68
/**/
69
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["configured"]) /* If we are re-activating. */
70
{
71
+ $v = get_option ("ws_plugin__s2member_activated_version"); /* Currently. */
72
/**/
73
if (!$v || !version_compare ($v, "3.2", ">=")) /* Needs to be upgraded? */
74
/* Version 3.2 is where `meta_key` names were changed. They're prefixed now. */
89
$wpdb->query ("DELETE FROM `" . $wpdb->postmeta . "` WHERE `meta_key` = 's2member_ccaps_req' AND `meta_value` IN('','a:0:{}','a:1:{i:0;s:0:\"\";}')");
90
}
91
/**/
92
+ if (!$v || !version_compare ($v, "110912", ">=") && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["filter_wp_query"] === array ("all"))
93
+ /* s2Member v110912 changed the way the "all" option for Alternative Views was handled. */
94
{
95
+ $notice = '<strong>IMPORTANT:</strong> This version of s2Member® changes the way your <code>Alternative View Protections</code> work. Please review your options under: <code>s2Member -> Restriction Options -> Alternative View Protections</code>.<br />';
96
+ c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, array ("blog|network:plugins.php", "blog|network:ws-plugin--s2member-start", "blog|network:ws-plugin--s2member-mms-ops", "blog|network:ws-plugin--s2member-gen-ops", "blog|network:ws-plugin--s2member-res-ops"));
97
}
98
/**/
99
$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 />';
100
$notice .= 'You now have version ' . esc_html (WS_PLUGIN__S2MEMBER_VERSION) . '. Your existing configuration remains.';
101
/**/
102
+ if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) /* No Changelog on a Multisite Blog Farm. */
103
$notice .= '<br />Have fun, <a href="' . esc_attr (admin_url ("/admin.php?page=ws-plugin--s2member-info#rm-changelog")) . '">read the Changelog</a>, and make some money! :-)';
104
/**/
105
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, array ("blog|network:plugins.php", "blog|network:ws-plugin--s2member-start", "blog|network:ws-plugin--s2member-mms-ops", "blog|network:ws-plugin--s2member-gen-ops", "blog|network:ws-plugin--s2member-res-ops"));
106
}
107
+ else /* Otherwise (initial activation); we'll help the Site Owner out by giving them a link to the Quick Start Guide. */
108
{
109
$notice = '<strong>Note:</strong> s2Member adds some new data columns to your list of Users/Members. If your list gets overcrowded, please use the <strong>Screen Options</strong> tab <em>( upper right-hand corner )</em>. With WordPress® Screen Options, you can add/remove specific data columns; thereby making the most important data easier to read. For example, if you create Custom Registration Fields with s2Member, those Custom Fields will result in new data columns; which can cause your list of Users/Members to become nearly unreadable. So just use the Screen Options tab to clean things up.';
110
/**/
116
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, array ("blog|network:plugins.php", "blog|network:ws-plugin--s2member-start", "blog|network:ws-plugin--s2member-mms-ops", "blog|network:ws-plugin--s2member-gen-ops", "blog|network:ws-plugin--s2member-res-ops"));
117
}
118
/**/
119
+ if (is_multisite () && is_main_site ()) /* Network activation routines. */
120
{
121
foreach ((array)($users = $wpdb->get_results ("SELECT `ID` FROM `" . $wpdb->users . "`")) as $user)
122
+ if (!($originating_blog = get_user_meta ($user->ID, "s2member_originating_blog", true)))
123
+ update_user_meta ($user->ID, "s2member_originating_blog", $current_site->blog_id);
124
/**/
125
$notice = '<strong>Multisite Network</strong> updated automatically by <strong>s2Member</strong> v' . esc_html (WS_PLUGIN__S2MEMBER_VERSION) . '.<br />';
126
$notice .= 'You\'ll want to configure s2Member\'s Multisite options now.<br />';
129
/**/
130
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, array ("blog|network:plugins.php", "blog|network:ws-plugin--s2member-start", "blog|network:ws-plugin--s2member-mms-ops", "blog|network:ws-plugin--s2member-gen-ops", "blog|network:ws-plugin--s2member-res-ops"));
131
/**/
132
+ update_site_option ("ws_plugin__s2member_options", (array)get_option ("ws_plugin__s2member_options"));
133
+ /**/
134
update_option ("ws_plugin__s2member_activated_mms_version", WS_PLUGIN__S2MEMBER_VERSION);
135
}
136
/**/
137
+ update_option ("ws_plugin__s2member_activated_version", WS_PLUGIN__S2MEMBER_VERSION);
138
+ /**/
139
do_action ("ws_plugin__s2member_after_activation", get_defined_vars ());
140
/**/
141
return; /* Return for uniformity. */
186
delete_option("ws_plugin__s2member_activated_version");
187
delete_option("ws_plugin__s2member_activated_mms_version");
188
/**/
189
+ if (is_multisite () && is_main_site ()) /* Site options? */
190
+ delete_site_option("ws_plugin__s2member_options");
191
+ /**/
192
$wpdb->query ("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '%" . esc_sql (like_escape ("s2member_")) . "%'");
193
$wpdb->query ("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '" . esc_sql (like_escape ("_transient_s2m_")) . "%'");
194
$wpdb->query ("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '" . esc_sql (like_escape ("_transient_timeout_s2m_")) . "%'");
includes/classes/ip-restrictions.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_ip_restrictions"))
21
{
@@ -41,7 +41,7 @@ if (!class_exists ("c_ws_plugin__s2member_ip_restrictions"))
41
*/
42
public static function ip_restrictions_ok ($ip = FALSE, $restriction = FALSE)
43
{
44
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
45
do_action ("ws_plugin__s2member_before_ip_restrictions_ok", get_defined_vars ());
46
unset ($__refs, $__v); /* Unset defined __refs, __v. */
47
/**/
@@ -59,7 +59,7 @@ if (!class_exists ("c_ws_plugin__s2member_ip_restrictions"))
59
/**/
60
foreach ($entries as $_entry => $_time) /* Auto-expire entries. */
61
if ($_time < strtotime ("-" . $concurrency))
62
- unset($entries[$_entry]);
63
/**/
64
$ip = ($ip) ? $ip : "empty"; /* Allow empty IPs. */
65
$entries[$ip] = strtotime ("now"); /* Log this entry. */
@@ -71,11 +71,9 @@ if (!class_exists ("c_ws_plugin__s2member_ip_restrictions"))
71
/**/
72
do_action ("ws_plugin__s2member_during_ip_restrictions_ok_no", get_defined_vars ());
73
/**/
74
- header("HTTP/1.0 503 Service Temporarily Unavailable"); /* Sends a status header. */
75
/**/
76
- echo '<strong>503: Service Temporarily Unavailable</strong><br />' . "\n";
77
- echo 'Too many IP addresses accessing one secure area<em>!</em><br />' . "\n";
78
- echo 'Please contact Support if you require assistance.';
79
/**/
80
exit (); /* Clean exit. */
81
}
@@ -87,17 +85,15 @@ if (!class_exists ("c_ws_plugin__s2member_ip_restrictions"))
87
/**/
88
do_action ("ws_plugin__s2member_during_ip_restrictions_ok_no", get_defined_vars ());
89
/**/
90
- header("HTTP/1.0 503 Service Temporarily Unavailable"); /* Sends a status header. */
91
/**/
92
- echo '<strong>503: Service Temporarily Unavailable</strong><br />' . "\n";
93
- echo 'Too many IP addresses accessing one secure area<em>!</em><br />' . "\n";
94
- echo 'Please contact Support if you require assistance.';
95
/**/
96
exit (); /* Clean exit. */
97
}
98
else /* OK, this looks legitimate. Apply Filters here and return true. */
99
{
100
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
101
do_action ("ws_plugin__s2member_during_ip_restrictions_ok_yes", get_defined_vars ());
102
unset ($__refs, $__v); /* Unset defined __refs, __v. */
103
/**/
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_ip_restrictions"))
21
{
41
*/
42
public static function ip_restrictions_ok ($ip = FALSE, $restriction = FALSE)
43
{
44
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
45
do_action ("ws_plugin__s2member_before_ip_restrictions_ok", get_defined_vars ());
46
unset ($__refs, $__v); /* Unset defined __refs, __v. */
47
/**/
59
/**/
60
foreach ($entries as $_entry => $_time) /* Auto-expire entries. */
61
if ($_time < strtotime ("-" . $concurrency))
62
+ unset ($entries[$_entry]);
63
/**/
64
$ip = ($ip) ? $ip : "empty"; /* Allow empty IPs. */
65
$entries[$ip] = strtotime ("now"); /* Log this entry. */
71
/**/
72
do_action ("ws_plugin__s2member_during_ip_restrictions_ok_no", get_defined_vars ());
73
/**/
74
+ status_header (503); /* Sends a status header; temporarily unavailable. */
75
/**/
76
+ echo _x ('<strong>503: Service Temporarily Unavailable</strong><br />Too many IP addresses accessing one secure area<em>!</em><br />Please contact Support if you need assistance.', "s2member-front", "s2member");
77
/**/
78
exit (); /* Clean exit. */
79
}
85
/**/
86
do_action ("ws_plugin__s2member_during_ip_restrictions_ok_no", get_defined_vars ());
87
/**/
88
+ status_header (503); /* Sends a status header; temporarily unavailable. */
89
/**/
90
+ echo _x ('<strong>503: Service Temporarily Unavailable</strong><br />Too many IP addresses accessing one secure area<em>!</em><br />Please contact Support if you need assistance.', "s2member-front", "s2member");
91
/**/
92
exit (); /* Clean exit. */
93
}
94
else /* OK, this looks legitimate. Apply Filters here and return true. */
95
{
96
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
97
do_action ("ws_plugin__s2member_during_ip_restrictions_ok_yes", get_defined_vars ());
98
unset ($__refs, $__v); /* Unset defined __refs, __v. */
99
/**/
includes/classes/labels.inc.php CHANGED
@@ -57,13 +57,13 @@ if (!class_exists ("c_ws_plugin__s2member_labels"))
57
* @attaches-to: ``add_filter("gettext_with_context");``
58
*
59
* @param str $translation Expects a string; already translated.
60
- * @param str $text The original text, passed in by the calling Filter.
61
* @param str $context Contextual specification for this translation.
62
* @return str The ``$translation``, after translations applied by this routine.
63
*/
64
- public static function _label_translations ($translation = FALSE, $text = FALSE, $context = FALSE)
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"];
57
* @attaches-to: ``add_filter("gettext_with_context");``
58
*
59
* @param str $translation Expects a string; already translated.
60
+ * @param str $original The original text, passed in by the Filter.
61
* @param str $context Contextual specification for this translation.
62
* @return str The ``$translation``, after translations applied by this routine.
63
*/
64
+ public static function _label_translations ($translation = FALSE, $original = FALSE, $context = FALSE)
65
{
66
+ if ($original && $context && stripos ($context, "User role") === 0 && ($role = $original))
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"];
includes/classes/login-customizations.inc.php CHANGED
@@ -96,9 +96,6 @@ 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
- 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 . '; }';
104
$a[] = 'div#login h1 a { display:block' . $i . '; width:100%' . $i . '; height:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_height"] . 'px' . $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
$a[] = 'div#login { width:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_width"] . 'px' . $i . '; }';
100
$a[] = 'div#login h1 a { background:url(' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src"] . ') no-repeat top center' . $i . '; }';
101
$a[] = 'div#login h1 a { display:block' . $i . '; width:100%' . $i . '; height:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_height"] . 'px' . $i . '; }';
includes/classes/login-redirects.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_login_redirects"))
21
{
@@ -40,7 +40,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
40
*/
41
public static function login_redirect ($username = FALSE)
42
{
43
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
44
do_action ("ws_plugin__s2member_before_login_redirect", get_defined_vars ());
45
unset ($__refs, $__v); /* Unset defined __refs, __v. */
46
/**/
@@ -55,7 +55,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
55
update_user_option ($user_id, "s2member_login_counter", $logins);
56
/**/
57
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"]) /* Nag em? */
58
- delete_user_setting ("default_password_nag") . update_user_option ($user_id, "default_password_nag", false, true);
59
/**/
60
$disable_login_ip_restrictions = apply_filters ("ws_plugin__s2member_disable_login_ip_restrictions", false, get_defined_vars ());
61
/**/
@@ -68,25 +68,25 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
68
/**/
69
if (!$obey_redirect_to || empty ($_REQUEST["redirect_to"]) || $_REQUEST["redirect_to"] === "wp-admin/" || $_REQUEST["redirect_to"] === admin_url ())
70
{
71
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
72
do_action ("ws_plugin__s2member_during_login_redirect", get_defined_vars ());
73
unset ($__refs, $__v); /* Unset defined __refs, __v. */
74
/**/
75
if ($redirect && is_string ($redirect)) /* Is this a string? */
76
- wp_redirect ($redirect); /* Dynamic URL introduced by a Filter. */
77
/**/
78
- else if ($special_redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ($user))
79
- wp_redirect ($special_redirection_url); /* Special Redirection URL configured with s2Member. */
80
/**/
81
else /* Else we use the Login Welcome Page configured for s2Member. */
82
- wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
83
/**/
84
exit (); /* Clean exit. */
85
}
86
}
87
}
88
/**/
89
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
90
do_action ("ws_plugin__s2member_after_login_redirect", get_defined_vars ());
91
unset ($__refs, $__v); /* Unset defined __refs, __v. */
92
/**/
@@ -104,7 +104,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
104
*/
105
public static function login_redirection_url ($user = FALSE, $root_returns_false = FALSE)
106
{
107
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
108
do_action ("ws_plugin__s2member_before_login_redirection_url", get_defined_vars ());
109
unset ($__refs, $__v); /* Unset defined __refs, __v. */
110
/**/
@@ -125,7 +125,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
125
*/
126
public static function login_redirection_uri ($user = FALSE, $root_returns_false = FALSE)
127
{
128
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
129
do_action ("ws_plugin__s2member_before_login_redirection_uri", get_defined_vars ());
130
unset ($__refs, $__v); /* Unset defined __refs, __v. */
131
/**/
@@ -147,7 +147,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
147
*/
148
public static function fill_login_redirect_rc_vars ($url = FALSE, $user = FALSE, $root_returns_false = FALSE)
149
{
150
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
151
do_action ("ws_plugin__s2member_before_fill_login_redirect_rc_vars", get_defined_vars ());
152
unset ($__refs, $__v); /* Unset defined __refs, __v. */
153
/**/
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_login_redirects"))
21
{
40
*/
41
public static function login_redirect ($username = FALSE)
42
{
43
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
44
do_action ("ws_plugin__s2member_before_login_redirect", get_defined_vars ());
45
unset ($__refs, $__v); /* Unset defined __refs, __v. */
46
/**/
55
update_user_option ($user_id, "s2member_login_counter", $logins);
56
/**/
57
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"]) /* Nag em? */
58
+ delete_user_setting("default_password_nag") . update_user_option ($user_id, "default_password_nag", false, true);
59
/**/
60
$disable_login_ip_restrictions = apply_filters ("ws_plugin__s2member_disable_login_ip_restrictions", false, get_defined_vars ());
61
/**/
68
/**/
69
if (!$obey_redirect_to || empty ($_REQUEST["redirect_to"]) || $_REQUEST["redirect_to"] === "wp-admin/" || $_REQUEST["redirect_to"] === admin_url ())
70
{
71
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
72
do_action ("ws_plugin__s2member_during_login_redirect", get_defined_vars ());
73
unset ($__refs, $__v); /* Unset defined __refs, __v. */
74
/**/
75
if ($redirect && is_string ($redirect)) /* Is this a string? */
76
+ wp_redirect($redirect); /* Dynamic URL introduced by a Filter. */
77
/**/
78
+ else if ($redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ($user))
79
+ wp_redirect($redirection_url); /* Special Redirection URL configured with s2Member. */
80
/**/
81
else /* Else we use the Login Welcome Page configured for s2Member. */
82
+ wp_redirect(get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
83
/**/
84
exit (); /* Clean exit. */
85
}
86
}
87
}
88
/**/
89
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
90
do_action ("ws_plugin__s2member_after_login_redirect", get_defined_vars ());
91
unset ($__refs, $__v); /* Unset defined __refs, __v. */
92
/**/
104
*/
105
public static function login_redirection_url ($user = FALSE, $root_returns_false = FALSE)
106
{
107
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
108
do_action ("ws_plugin__s2member_before_login_redirection_url", get_defined_vars ());
109
unset ($__refs, $__v); /* Unset defined __refs, __v. */
110
/**/
125
*/
126
public static function login_redirection_uri ($user = FALSE, $root_returns_false = FALSE)
127
{
128
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
129
do_action ("ws_plugin__s2member_before_login_redirection_uri", get_defined_vars ());
130
unset ($__refs, $__v); /* Unset defined __refs, __v. */
131
/**/
147
*/
148
public static function fill_login_redirect_rc_vars ($url = FALSE, $user = FALSE, $root_returns_false = FALSE)
149
{
150
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;');
151
do_action ("ws_plugin__s2member_before_fill_login_redirect_rc_vars", get_defined_vars ());
152
unset ($__refs, $__v); /* Unset defined __refs, __v. */
153
/**/
includes/classes/menu-pages-rs.inc.php CHANGED
@@ -39,6 +39,14 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages_rs"))
39
{
40
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
41
/**/
42
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["mlist"])
43
{
44
echo '<div class="ws-menu-page-mlist">' . "\n";
39
{
40
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
41
/**/
42
+ echo '<div id="ws-menu-page-js-c-w" class="ws-menu-page-js-c-w">' . "\n";
43
+ include_once dirname (dirname (__FILE__)) . "/menu-pages/js-c-warning.inc.php";
44
+ echo '</div>' . "\n";
45
+ /**/
46
+ echo '<script type="text/javascript">' . "\n";
47
+ echo "jQuery('div#ws-menu-page-js-c-w').hide();" . "\n"; /* Hide! */
48
+ echo '</script>' . "\n";
49
+ /**/
50
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["mlist"])
51
{
52
echo '<div class="ws-menu-page-mlist">' . "\n";
includes/classes/menu-pages.inc.php CHANGED
@@ -75,7 +75,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
75
do_action ("ws_plugin__s2member_during_update_all_options", get_defined_vars ());
76
unset ($__refs, $__v); /* Unset defined __refs, __v. */
77
/**/
78
- update_option ("ws_plugin__s2member_options", $options) . update_option ("ws_plugin__s2member_cache", array ());
79
/**/
80
if ($update_other === true || in_array ("auto_eot_system", (array)$update_other)) /* Handle the Auto-EOT System now ( enable/disable ). */
81
($options["auto_eot_system_enabled"] == 1) ? c_ws_plugin__s2member_auto_eots::add_auto_eot_system () : c_ws_plugin__s2member_auto_eots::delete_auto_eot_system ();
@@ -263,7 +263,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
263
do_action ("_ws_plugin__s2member_before_add_settings_link", get_defined_vars ());
264
unset ($__refs, $__v); /* Unset defined __refs, __v. */
265
/**/
266
- if (preg_match ("/" . preg_quote ($file, "/") . "#x2F;", $GLOBALS["WS_PLUGIN__"]["s2member"]["l"]) && is_array ($links))
267
{
268
$settings = '<a href="' . esc_attr (admin_url ("/admin.php?page=ws-plugin--s2member-gen-ops")) . '">Settings</a>';
269
array_unshift ($links, apply_filters ("ws_plugin__s2member_add_settings_link", $settings, get_defined_vars ()));
@@ -295,9 +295,10 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
295
wp_enqueue_script ("thickbox");
296
wp_enqueue_script ("media-upload");
297
wp_enqueue_script ("jquery-ui-core");
298
- wp_enqueue_script ("jquery-json-ps", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/menu-pages/jquery-json-ps-min.js", array ("jquery"), c_ws_plugin__s2member_utilities::ver_checksum ());
299
- wp_enqueue_script ("jquery-ui-effects", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/menu-pages/jquery-ui-effects.js", array ("jquery", "jquery-ui-core"), c_ws_plugin__s2member_utilities::ver_checksum ());
300
- wp_enqueue_script ("ws-plugin--s2member-menu-pages", site_url ("/?ws_plugin__s2member_menu_pages_js=" . urlencode (mt_rand ())), array ("jquery", "thickbox", "media-upload", "jquery-json-ps", "jquery-ui-core", "jquery-ui-effects", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum ());
301
/**/
302
do_action ("ws_plugin__s2member_during_add_admin_scripts", get_defined_vars ());
303
}
@@ -431,23 +432,24 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
431
mkdir ($logs_dir, 0777, true) . clearstatcache ();
432
/**/
433
$htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"] . "/.htaccess";
434
/**/
435
if (is_dir ($logs_dir) && is_writable ($logs_dir) && !file_exists ($htaccess))
436
- file_put_contents ($htaccess, "deny from all") . clearstatcache ();
437
/**/
438
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) /* Logging enabled? */
439
{
440
if (!is_dir ($logs_dir)) /* If the security-enabled logs directory does not exist yet. */
441
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("The security-enabled logs directory ( <code>" . esc_html (preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $logs_dir)) . "</code> ) does not exist. Please create this directory manually &amp; make it writable ( chmod 777 ).", true);
442
/**/
443
else if (!is_writable ($logs_dir)) /* If the logs directory is not writable yet. */
444
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("Permissions error. The security-enabled logs directory ( <code>" . esc_html (preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $logs_dir)) . "</code> ) is not writable. Please make this directory writable ( chmod 777 ).", true);
445
/**/
446
if (!file_exists ($htaccess)) /* If the .htaccess file has not been created yet. */
447
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("The .htaccess protection file ( <code>" . esc_html (preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $htaccess)) . "</code> ) does not exist. Please create this file manually. Inside your .htaccess file, add this one line: <code>deny from all</code>.", true);
448
/**/
449
else if (!preg_match ("/deny from all/i", file_get_contents ($htaccess))) /* Else if the .htaccess file does not offer the required protection. */
450
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("Unprotected. The .htaccess protection file ( <code>" . esc_html (preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $htaccess)) . "</code> ) does not contain <code>deny from all</code>. Inside your .htaccess file, add this one line: <code>deny from all</code>.", true);
451
}
452
/**/
453
include_once dirname (dirname (__FILE__)) . "/menu-pages/paypal-ops.inc.php";
@@ -470,27 +472,25 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
470
/**/
471
c_ws_plugin__s2member_menu_pages::update_all_options ();
472
/**/
473
- if (!($using_amazon_s3_storage = 0) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_bucket"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_access_key"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_s3_files_secret_key"])
474
- $using_amazon_s3_storage = true; /* Amazon® S3 storage has been configured! */
475
- /**/
476
$files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"];
477
/**/
478
if (!is_dir ($files_dir) && is_writable (dirname (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($files_dir))))
479
mkdir ($files_dir, 0777, true) . clearstatcache ();
480
/**/
481
$htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/.htaccess";
482
/**/
483
if (is_dir ($files_dir) && is_writable ($files_dir) && !file_exists ($htaccess))
484
- file_put_contents ($htaccess, "deny from all") . clearstatcache ();
485
/**/
486
- if (!$using_amazon_s3_storage && !is_dir ($files_dir)) /* If the security-enabled files directory does not exist yet. */
487
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("The security-enabled files directory ( <code>" . esc_html (preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $files_dir)) . "</code> ) does not exist. Please create this directory manually.", true);
488
/**/
489
- if (!$using_amazon_s3_storage && !file_exists ($htaccess)) /* If the .htaccess file has not been created yet. */
490
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("The .htaccess protection file ( <code>" . esc_html (preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $htaccess)) . "</code> ) does not exist. Please create this file manually. Inside your .htaccess file, add this one line: <code>deny from all</code>.", true);
491
/**/
492
- else if (!$using_amazon_s3_storage && !preg_match ("/deny from all/i", file_get_contents ($htaccess))) /* Else if the .htaccess file does not offer the required protection. */
493
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("Unprotected. The .htaccess protection file ( <code>" . esc_html (preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $htaccess)) . "</code> ) does not contain <code>deny from all</code>. Inside your .htaccess file, add this one line: <code>deny from all</code>.", true);
494
/**/
495
include_once dirname (dirname (__FILE__)) . "/menu-pages/down-ops.inc.php";
496
/**/
@@ -621,10 +621,10 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
621
$ovg = (string)$_p["ws_plugin__s2member_bridge_bbpress_ovg"];
622
/**/
623
if (($file = file_get_contents (dirname (dirname (__FILE__)) . "/dropins/bridges/_s2member-bbpress-bridge.php")) && ($file = preg_replace ("/%%min%%/i", c_ws_plugin__s2member_utils_strings::esc_dq ($min), preg_replace ("/%%ovg%%/i", c_ws_plugin__s2member_utils_strings::esc_dq ($ovg), $file))) && file_put_contents ($plugins_dir . "/_s2member-bbpress-bridge.php", $file))
624
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("The bbPress® Bridge/plugin has been <strong>installed successfully</strong>.");
625
/**/
626
else /* Otherwise, something unexpected. The site owner will need to install the bbPress® plugin manually. */
627
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("Unknown error. Please try again, or install manually.", true);
628
}
629
/**/
630
else if (preg_match ("/^Un-Install/i", $_p["ws_plugin__s2member_bridge_bbpress_action"]))
@@ -632,20 +632,20 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
632
if (file_exists ($plugins_dir . "/_s2member-bbpress-bridge.php"))
633
{
634
if (!unlink ($plugins_dir . "/_s2member-bbpress-bridge.php")) /* Test return value of unlink. */
635
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("Unknown error. Please try again, or un-install manually.", true);
636
/**/
637
else /* Otherwise, everything looks good. The plugin file has been removed successfully. */
638
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("The bbPress® Bridge/plugin has been successfully <strong>uninstalled</strong>.");
639
}
640
else
641
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("The bbPress® Bridge/plugin is already un-installed.", true);
642
}
643
}
644
else
645
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("The directory you specified is NOT writable. Please try again, or install manually.", true);
646
}
647
else
648
- c_ws_plugin__s2member_admin_notices::display_admin_notice ("The directory you specified does NOT exist. Please try again, or install manually.", true);
649
}
650
/**/
651
include_once dirname (dirname (__FILE__)) . "/menu-pages/integrations.inc.php";