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

Version Description

  • Tested against WordPress 3.0.3. Everything looks good.
  • (s2Member) Bug fix. s2Member was ignoring ?redirect_to=value upon login, in favor of the Login Welcome Page configured for s2Member. s2Member v3.3.2 has been updated to allow the use of redirect_to; and to simply default to the Login Welcome Page when no redirect_to argument is passed in. This is the intended behavior. As of s2Member v3.3.2 this now works fully as expected.
  • (s2Member/s2Member Pro) Bug fix. s2Member was incorrectly calculating delayed EOT Times under certain circumstances. This was related to non-recurring Subscriptions processed on PayPal accounts opened after October 15th, 2009. Under the right scenario, PayPal's IPN responses were fooling s2Member, by immediately expiring payments; and sending a recurring_payment_expired IPN before the recurring_payment IPN. So s2Member was incorrectly calculating the EOT Time ( i.e. last_payment_time was not properly considered ). The logic behind s2Member's IPN handling routines has been corrected in v3.3.2 to resolve this issue.
  • (s2Member/s2Member Pro) SEO / Search Engine Optimization. s2Member now sends 301 redirect headers instead of the default WordPress 302. This prevents duplicate content warnings from search engines such as Google. In other words, when s2Member redirects visitors ( and/or search engine spiders ) to your Membership Options Page, in response to an attempt to access a secured area of your site; the wp_redirect() call will send a 301 redirect header instead of a 302. This prevents duplicate content warnings associated with your Membership Options Page. In addition, a universal Filter ( i.e. ws_plugin__s2member_content_redirect_status ) has been added to s2Member's source code, giving developers the ability to modify this behavior dynamically; if they need to.
  • (s2Member Pro) Bug fix. s2Member Pro's AliPay integration was incorrectly handling Return URLs on success. This release fixes the invalid syntax inside /functions/separates/alipay-return.inc.php.
  • (s2Member Pro) Compatibility. s2Member Pro Forms are now compatible with jQuery v1.4.4. jQuery v1.4.4 introduced the need for double-quotations around all attribute/value selectors.
  • (s2Member Pro) New Pro Form attribute. s2Member Pro Forms now accept a new Attribute ( i.e. template="" ). This allows developers to integrate Pro Forms with custom template files, on a per-Form basis. For further details on this topic, please check your Dashboard under: s2Member -> PayPal Pro Forms -> Shortcode Attributes (explained).
  • (s2Member) Bug fix. A bug that was first introduced in v3.3 was causing AWeber integrations to fail with email addresses being picked up as the administrative address instead of the Customer's address. This was related to a previous change in v3.3 where all mail() commands were converted to wp_mail() for improved compatibility. With this release ( s2Member v3.3.2 ), the bug with AWeber integration has been resolved. Thanks to everyone for reporting this important issue.
Download this release

Release Info

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

Code changes from version 3.3.1 to 3.3.2

includes/dropins/bridges/_s2member-bbpress-bridge.php CHANGED
@@ -76,10 +76,10 @@ function ws_plugin__s2member_bridge_bbpress_access () /* Check Access. */
76
  $bbPress = bb_get_option ("uri"); /* bbPress® location. */
77
  /**/
78
  if (preg_match ("/^" . preg_quote ($bbPress, "/") . "/", $_SERVER["HTTP_REFERER"]))
79
- wp_redirect($url); /* Referred locally. Let's go back to the Front Page. */
80
  /**/
81
  else /* Otherwise, trigger the Membership Options Page + s2member_level_req = $min. */
82
- wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min));
83
  /**/
84
  exit ();
85
  }
@@ -98,10 +98,10 @@ function ws_plugin__s2member_bridge_bbpress_access () /* Check Access. */
98
  $bbPress = bb_get_option ("uri"); /* bbPress® location. */
99
  /**/
100
  if (preg_match ("/^" . preg_quote ($bbPress, "/") . "/", $_SERVER["HTTP_REFERER"]))
101
- wp_redirect($url); /* Referred locally. Let's go back to the Front Page. */
102
  /**/
103
  else /* Otherwise, trigger the Membership Options Page + s2member_level_req = $min. */
104
- wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min));
105
  /**/
106
  exit ();
107
  }
@@ -111,7 +111,7 @@ function ws_plugin__s2member_bridge_bbpress_access () /* Check Access. */
111
  {
112
  if ($url = bb_get_option ("wp_siteurl")) /* The Front Page on the WordPress® installation. */
113
  {
114
- wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min));
115
  exit (); /* Membership Options Page + s2member_level_req = $min. */
116
  }
117
  }
76
  $bbPress = bb_get_option ("uri"); /* bbPress® location. */
77
  /**/
78
  if (preg_match ("/^" . preg_quote ($bbPress, "/") . "/", $_SERVER["HTTP_REFERER"]))
79
+ wp_redirect ($url, apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
80
  /**/
81
  else /* Otherwise, trigger the Membership Options Page + s2member_level_req = $min. */
82
+ wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
83
  /**/
84
  exit ();
85
  }
98
  $bbPress = bb_get_option ("uri"); /* bbPress® location. */
99
  /**/
100
  if (preg_match ("/^" . preg_quote ($bbPress, "/") . "/", $_SERVER["HTTP_REFERER"]))
101
+ wp_redirect ($url, apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
102
  /**/
103
  else /* Otherwise, trigger the Membership Options Page + s2member_level_req = $min. */
104
+ wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
105
  /**/
106
  exit ();
107
  }
111
  {
112
  if ($url = bb_get_option ("wp_siteurl")) /* The Front Page on the WordPress® installation. */
113
  {
114
+ wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
115
  exit (); /* Membership Options Page + s2member_level_req = $min. */
116
  }
117
  }
includes/functions/admin-lockout.inc.php CHANGED
@@ -19,20 +19,25 @@ Attach to: add_action("admin_init");
19
  */
20
  if (!function_exists ("ws_plugin__s2member_admin_lockout"))
21
  {
22
- function ws_plugin__s2member_admin_lockout ()
23
  {
24
  do_action ("ws_plugin__s2member_before_admin_lockouts", get_defined_vars ());
25
  /**/
26
- if (!DOING_AJAX /* Do NOT protect Ajax requests. */
27
- && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"]/**/
28
- && !current_user_can ("edit_posts") /* In other words: Subscribers and Members. */
29
- && apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ()) && /* Filter. */
30
- wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"])) !== "nill")
31
- exit ();
 
 
 
 
 
32
  /**/
33
  do_action ("ws_plugin__s2member_after_admin_lockouts", get_defined_vars ());
34
  /**/
35
- return;
36
  }
37
  }
38
  ?>
19
  */
20
  if (!function_exists ("ws_plugin__s2member_admin_lockout"))
21
  {
22
+ function ws_plugin__s2member_admin_lockout () /* Prevents admin access. */
23
  {
24
  do_action ("ws_plugin__s2member_before_admin_lockouts", get_defined_vars ());
25
  /**/
26
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] && (!defined ("DOING_AJAX") || !DOING_AJAX) && !current_user_can ("edit_posts"))
27
+ if (apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ())) /* Give Filters a chance. */
28
+ {
29
+ if ($special_redirection_url = ws_plugin__s2member_login_redirection_url ())
30
+ wp_redirect($special_redirection_url); /* Special Redirection. */
31
+ /**/
32
+ else /* Else we use the Login Welcome Page configured for s2Member. */
33
+ wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
34
+ /**/
35
+ exit (); /* Clean exit. */
36
+ }
37
  /**/
38
  do_action ("ws_plugin__s2member_after_admin_lockouts", get_defined_vars ());
39
  /**/
40
+ return; /* Return for uniformity. */
41
  }
42
  }
43
  ?>
includes/functions/auto-eots.inc.php CHANGED
@@ -99,6 +99,8 @@ if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
99
  /**/
100
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $custom)))
101
  {
 
 
102
  $msg = $sbj = "( s2Member / API Notification Email ) - EOT/Deletion";
103
  $msg .= "\n\n"; /* Spacing in the message body. */
104
  /**/
99
  /**/
100
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $custom)))
101
  {
102
+ ws_plugin__s2member_email_config_release (); /* Release all Filters applied to wp_mail() From: headers. */
103
+ /**/
104
  $msg = $sbj = "( s2Member / API Notification Email ) - EOT/Deletion";
105
  $msg .= "\n\n"; /* Spacing in the message body. */
106
  /**/
includes/functions/catg-level-access.inc.php CHANGED
@@ -45,7 +45,7 @@ if (!function_exists ("ws_plugin__s2member_check_catg_level_access"))
45
  /**/
46
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")))
47
  {
48
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
49
  exit ();
50
  }
51
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
@@ -54,13 +54,13 @@ if (!function_exists ("ws_plugin__s2member_check_catg_level_access"))
54
  {
55
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
56
  {
57
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
58
  exit ();
59
  }
60
  /**/
61
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] && in_array ($cat_id, ($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]))) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
62
  {
63
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
64
  exit ();
65
  }
66
  /**/
@@ -68,7 +68,7 @@ if (!function_exists ("ws_plugin__s2member_check_catg_level_access"))
68
  foreach (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]) as $catg)
69
  if ($catg && cat_is_ancestor_of ($catg, $cat_id) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
70
  {
71
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
72
  exit ();
73
  }
74
  }
@@ -79,7 +79,7 @@ if (!function_exists ("ws_plugin__s2member_check_catg_level_access"))
79
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
80
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
81
  {
82
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
83
  exit ();
84
  }
85
  }
45
  /**/
46
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")))
47
  {
48
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
49
  exit ();
50
  }
51
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
54
  {
55
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
56
  {
57
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
58
  exit ();
59
  }
60
  /**/
61
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] && in_array ($cat_id, ($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]))) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
62
  {
63
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
64
  exit ();
65
  }
66
  /**/
68
  foreach (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"]) as $catg)
69
  if ($catg && cat_is_ancestor_of ($catg, $cat_id) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
70
  {
71
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
72
  exit ();
73
  }
74
  }
79
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
80
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
81
  {
82
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
83
  exit ();
84
  }
85
  }
includes/functions/config-user-registration.inc.php CHANGED
@@ -108,7 +108,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_on_ms_user_activation"
108
  /**/
109
  do_action ("ws_plugin__s2member_after_configure_user_on_ms_user_activation", get_defined_vars ());
110
  /**/
111
- return;
112
  }
113
  }
114
  /*
@@ -139,7 +139,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_on_ms_blog_activation"
139
  /**/
140
  do_action ("ws_plugin__s2member_after_configure_user_on_ms_blog_activation", get_defined_vars ());
141
  /**/
142
- return;
143
  }
144
  }
145
  /*
@@ -213,8 +213,8 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
213
  $ip = $_SERVER["REMOTE_ADDR"];
214
  $cv = preg_split ("/\|/", $custom);
215
  /**/
216
- if ($eotper) /* If a specific EOT Period has been attached; we need to calculate that now. */
217
- $auto_eot_time = ws_plugin__s2member_paypal_auto_eot_time (0, 0, 0, $eotper);
218
  /**/
219
  $notes = $_pm["ws_plugin__s2member_custom_reg_field_s2member_notes"];
220
  /**/
@@ -294,7 +294,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
294
  {
295
  $proxy = array ("s2member_paypal_notify" => "1", "s2member_paypal_proxy" => "s2member_transient_ipn_subscr_payment", "s2member_paypal_proxy_verification" => ws_plugin__s2member_paypal_proxy_key_gen ());
296
  ws_plugin__s2member_remote (add_query_arg (urlencode_deep ($proxy), get_bloginfo ("wpurl")), stripslashes_deep ($subscr_payment), array ("timeout" => 20));
297
- delete_transient ($transient);
298
  }
299
  /**/
300
  setcookie ("s2member_signup_tracking", ws_plugin__s2member_encrypt ($subscr_id), time () + 31556926, "/");
@@ -554,7 +554,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
554
  break;
555
  /**/
556
  if (($url = trim (preg_replace ("/%%(.+?)%%/i", "", $url))))
557
- ws_plugin__s2member_remote ($url);
558
  }
559
  /**/
560
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_recipients"])
@@ -648,7 +648,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
648
  do_action ("ws_plugin__s2member_after_configure_user_registration", get_defined_vars ());
649
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
650
  /**/
651
- return;
652
  }
653
  }
654
  ?>
108
  /**/
109
  do_action ("ws_plugin__s2member_after_configure_user_on_ms_user_activation", get_defined_vars ());
110
  /**/
111
+ return; /* Return for uniformity. */
112
  }
113
  }
114
  /*
139
  /**/
140
  do_action ("ws_plugin__s2member_after_configure_user_on_ms_blog_activation", get_defined_vars ());
141
  /**/
142
+ return; /* Return for uniformity. */
143
  }
144
  }
145
  /*
213
  $ip = $_SERVER["REMOTE_ADDR"];
214
  $cv = preg_split ("/\|/", $custom);
215
  /**/
216
+ if ($eotper) /* If a specific EOT Period has been attached; calculate that now. */
217
+ $auto_eot_time = ws_plugin__s2member_paypal_auto_eot_time ("", "", "", $eotper);
218
  /**/
219
  $notes = $_pm["ws_plugin__s2member_custom_reg_field_s2member_notes"];
220
  /**/
294
  {
295
  $proxy = array ("s2member_paypal_notify" => "1", "s2member_paypal_proxy" => "s2member_transient_ipn_subscr_payment", "s2member_paypal_proxy_verification" => ws_plugin__s2member_paypal_proxy_key_gen ());
296
  ws_plugin__s2member_remote (add_query_arg (urlencode_deep ($proxy), get_bloginfo ("wpurl")), stripslashes_deep ($subscr_payment), array ("timeout" => 20));
297
+ delete_transient($transient);
298
  }
299
  /**/
300
  setcookie ("s2member_signup_tracking", ws_plugin__s2member_encrypt ($subscr_id), time () + 31556926, "/");
554
  break;
555
  /**/
556
  if (($url = trim (preg_replace ("/%%(.+?)%%/i", "", $url))))
557
+ ws_plugin__s2member_remote($url);
558
  }
559
  /**/
560
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_recipients"])
648
  do_action ("ws_plugin__s2member_after_configure_user_registration", get_defined_vars ());
649
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
650
  /**/
651
+ return; /* Return for uniformity. */
652
  }
653
  }
654
  ?>
includes/functions/email-configs.inc.php CHANGED
@@ -14,7 +14,8 @@ Direct access denial.
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit ("Do not access this file directly.");
16
  /*
17
- Functions that modify the email From: name/address.
 
18
  */
19
  if (!function_exists ("ws_plugin__s2member_email_config"))
20
  {
@@ -22,15 +23,19 @@ if (!function_exists ("ws_plugin__s2member_email_config"))
22
  {
23
  do_action ("ws_plugin__s2member_before_email_config", get_defined_vars ());
24
  /**/
 
 
25
  add_filter ("wp_mail_from", "_ws_plugin__s2member_email_config_email");
26
  add_filter ("wp_mail_from_name", "_ws_plugin__s2member_email_config_name");
27
  /**/
28
  do_action ("ws_plugin__s2member_after_email_config", get_defined_vars ());
29
  /**/
30
- return;
31
  }
32
  }
33
- /**/
 
 
34
  if (!function_exists ("_ws_plugin__s2member_email_config_email"))
35
  {
36
  function _ws_plugin__s2member_email_config_email ($email = FALSE)
@@ -40,7 +45,9 @@ if (!function_exists ("_ws_plugin__s2member_email_config_email"))
40
  return apply_filters ("_ws_plugin__s2member_email_config_email", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"], get_defined_vars ());
41
  }
42
  }
43
- /**/
 
 
44
  if (!function_exists ("_ws_plugin__s2member_email_config_name"))
45
  {
46
  function _ws_plugin__s2member_email_config_name ($name = FALSE)
@@ -51,6 +58,44 @@ if (!function_exists ("_ws_plugin__s2member_email_config_name"))
51
  }
52
  }
53
  /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  Convert primitive Role names in emails sent by WordPress®.
55
  Attach to: add_filter("wpmu_signup_user_notification_email");
56
  ~ Only necessary with this particular email.
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit ("Do not access this file directly.");
16
  /*
17
+ Function that modifies the email From: "Name" <address>.
18
+ ( these filters are only needed during registration )
19
  */
20
  if (!function_exists ("ws_plugin__s2member_email_config"))
21
  {
23
  {
24
  do_action ("ws_plugin__s2member_before_email_config", get_defined_vars ());
25
  /**/
26
+ ws_plugin__s2member_email_config_release (); /* Release all Filters. */
27
+ /**/
28
  add_filter ("wp_mail_from", "_ws_plugin__s2member_email_config_email");
29
  add_filter ("wp_mail_from_name", "_ws_plugin__s2member_email_config_name");
30
  /**/
31
  do_action ("ws_plugin__s2member_after_email_config", get_defined_vars ());
32
  /**/
33
+ return; /* Return for uniformity. */
34
  }
35
  }
36
+ /*
37
+ A sort of callback function that applies the email filter.
38
+ */
39
  if (!function_exists ("_ws_plugin__s2member_email_config_email"))
40
  {
41
  function _ws_plugin__s2member_email_config_email ($email = FALSE)
45
  return apply_filters ("_ws_plugin__s2member_email_config_email", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"], get_defined_vars ());
46
  }
47
  }
48
+ /*
49
+ A sort of callback function that applies the name filter.
50
+ */
51
  if (!function_exists ("_ws_plugin__s2member_email_config_name"))
52
  {
53
  function _ws_plugin__s2member_email_config_name ($name = FALSE)
58
  }
59
  }
60
  /*
61
+ Checks the status of filters on the email From: "Name" <address>.
62
+ */
63
+ if (!function_exists ("ws_plugin__s2member_email_config_status"))
64
+ {
65
+ function ws_plugin__s2member_email_config_status ($any = TRUE)
66
+ {
67
+ do_action ("ws_plugin__s2member_before_email_config_status", get_defined_vars ());
68
+ /**/
69
+ if (has_filter ("wp_mail_from", "_ws_plugin__s2member_email_config_email") || has_filter ("wp_mail_from_name", "_ws_plugin__s2member_email_config_name"))
70
+ return apply_filters ("ws_plugin__s2member_email_config_status", true, get_defined_vars ());
71
+ /**/
72
+ else if ($any && (has_filter ("wp_mail_from") || has_filter ("wp_mail_from_name")))
73
+ return apply_filters ("ws_plugin__s2member_email_config_status", true, get_defined_vars ());
74
+ /**/
75
+ return apply_filters ("ws_plugin__s2member_email_config_status", false, get_defined_vars ());
76
+ }
77
+ }
78
+ /*
79
+ Release functions that modify the email From: "Name" <address>.
80
+ */
81
+ if (!function_exists ("ws_plugin__s2member_email_config_release"))
82
+ {
83
+ function ws_plugin__s2member_email_config_release ($all = TRUE)
84
+ {
85
+ do_action ("ws_plugin__s2member_before_email_config_release", get_defined_vars ());
86
+ /**/
87
+ remove_filter ("wp_mail_from", "_ws_plugin__s2member_email_config_email");
88
+ remove_filter ("wp_mail_from_name", "_ws_plugin__s2member_email_config_name");
89
+ /**/
90
+ if ($all) /* If $all is true, then we remove all attached WordPress® Filters. */
91
+ remove_all_filters ("wp_mail_from") . remove_all_filters ("wp_mail_from_name");
92
+ /**/
93
+ do_action ("ws_plugin__s2member_after_email_config_release", get_defined_vars ());
94
+ /**/
95
+ return; /* Return for uniformity. */
96
+ }
97
+ }
98
+ /*
99
  Convert primitive Role names in emails sent by WordPress®.
100
  Attach to: add_filter("wpmu_signup_user_notification_email");
101
  ~ Only necessary with this particular email.
includes/functions/file-download-access.inc.php CHANGED
@@ -164,18 +164,18 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
164
  }
165
  /**/
166
  else if (! ($current_user = (is_user_logged_in ()) ? wp_get_current_user () : false) /* NOT logged in? */
167
- && 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"]))) !== "nill")
168
  exit ();
169
  /**/
170
  else if ((!is_array ($file_downloads = ws_plugin__s2member_user_downloads ()) || !$file_downloads["allowed"] || !$file_downloads["allowed_days"])/**/
171
- && 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"]))) !== "nill")
172
  exit ();
173
  /**/
174
  else if (preg_match ("/^access[_\-]s2member[_\-]level([0-4])\//", $_GET["s2member_file_download"], $m))
175
  {
176
  $level_req = $m[1]; /* Which Level does this require? */
177
  if (!$current_user->has_cap ("access_s2member_level" . $level_req) /* Does the User have access to this Level? */
178
- && 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"]))) !== "nill")
179
  exit ();
180
  }
181
  /**/
@@ -183,7 +183,7 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
183
  {
184
  $ccap_req = preg_replace ("/-/", "_", $m[1]); /* Which Capability does this require? */
185
  if (!$current_user->has_cap ("access_s2member_ccap_" . $ccap_req) /* Does the User have access to this Custom Capability? */
186
- && 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"]))) !== "nill")
187
  exit ();
188
  }
189
  /**/
@@ -209,7 +209,7 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
209
  }
210
  /**/
211
  if (!$already_downloaded && $previous_file_downloads >= $file_downloads["allowed"] /* They have NOT already downloaded this file, and they're over their limit. */
212
- && 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"]))) !== "nill")
213
  exit ();
214
  /**/
215
  if (!$already_downloaded) /* Only add this file to the log if they have not already downloaded it. */
164
  }
165
  /**/
166
  else if (! ($current_user = (is_user_logged_in ()) ? wp_get_current_user () : false) /* NOT logged in? */
167
+ && 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")
168
  exit ();
169
  /**/
170
  else if ((!is_array ($file_downloads = ws_plugin__s2member_user_downloads ()) || !$file_downloads["allowed"] || !$file_downloads["allowed_days"])/**/
171
+ && 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")
172
  exit ();
173
  /**/
174
  else if (preg_match ("/^access[_\-]s2member[_\-]level([0-4])\//", $_GET["s2member_file_download"], $m))
175
  {
176
  $level_req = $m[1]; /* Which Level does this require? */
177
  if (!$current_user->has_cap ("access_s2member_level" . $level_req) /* Does the User have access to this Level? */
178
+ && 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")
179
  exit ();
180
  }
181
  /**/
183
  {
184
  $ccap_req = preg_replace ("/-/", "_", $m[1]); /* Which Capability does this require? */
185
  if (!$current_user->has_cap ("access_s2member_ccap_" . $ccap_req) /* Does the User have access to this Custom Capability? */
186
+ && 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")
187
  exit ();
188
  }
189
  /**/
209
  }
210
  /**/
211
  if (!$already_downloaded && $previous_file_downloads >= $file_downloads["allowed"] /* They have NOT already downloaded this file, and they're over their limit. */
212
+ && 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")
213
  exit ();
214
  /**/
215
  if (!$already_downloaded) /* Only add this file to the log if they have not already downloaded it. */
includes/functions/force-ssl.inc.php CHANGED
@@ -33,11 +33,13 @@ if (!function_exists ("ws_plugin__s2member_check_force_ssl"))
33
  /**/
34
  do_action ("ws_plugin__s2member_before_check_force_ssl", get_defined_vars ());
35
  /**/
36
- if (is_singular () && is_object ($post) && ($__id = $post->ID)) /* Singular? */
 
 
37
  /**/
38
- if (($force_ssl = get_post_meta ($__id, "s2member_force_ssl", true))) /* Forcing? */
39
  {
40
- if (!is_ssl ()) /* SSL must be enabled here. Redirect to https:// scheme. */
41
  {
42
  $ssl_host = preg_replace ("/\:[0-9]+$/", "", $_SERVER["HTTP_HOST"]);
43
  $ssl_port = (is_numeric ($force_ssl) && $force_ssl > 1) ? $force_ssl : 0;
@@ -48,6 +50,8 @@ if (!function_exists ("ws_plugin__s2member_check_force_ssl"))
48
  }
49
  else /* Otherwise, we buffer all output, and switch all content over to https. */
50
  {
 
 
51
  $ssl_host = preg_replace ("/\:[0-9]+$/", "", $_SERVER["HTTP_HOST"]);
52
  $ssl_port = (is_numeric ($force_ssl) && $force_ssl > 1) ? $force_ssl : 0;
53
  $ssl_host_port = $ssl_host . (($ssl_port) ? ":" . $ssl_port : "");
33
  /**/
34
  do_action ("ws_plugin__s2member_before_check_force_ssl", get_defined_vars ());
35
  /**/
36
+ $force_ssl = apply_filters ("ws_plugin__s2member_check_force_ssl", false, get_defined_vars ());
37
+ /**/
38
+ if (($force_ssl || (is_singular () && is_object ($post) && ($__id = $post->ID))) && strtolower ($force_ssl) !== "no")
39
  /**/
40
+ if (($force_ssl || ($force_ssl = get_post_meta ($__id, "s2member_force_ssl", true))) && strtolower ($force_ssl) !== "no")
41
  {
42
+ if (!is_ssl ()) /* SSL must be enabled here. Redirect to the equivalent https:// scheme. */
43
  {
44
  $ssl_host = preg_replace ("/\:[0-9]+$/", "", $_SERVER["HTTP_HOST"]);
45
  $ssl_port = (is_numeric ($force_ssl) && $force_ssl > 1) ? $force_ssl : 0;
50
  }
51
  else /* Otherwise, we buffer all output, and switch all content over to https. */
52
  {
53
+ add_filter("redirect_canonical", "__return_false");
54
+ /**/
55
  $ssl_host = preg_replace ("/\:[0-9]+$/", "", $_SERVER["HTTP_HOST"]);
56
  $ssl_port = (is_numeric ($force_ssl) && $force_ssl > 1) ? $force_ssl : 0;
57
  $ssl_host_port = $ssl_host . (($ssl_port) ? ":" . $ssl_port : "");
includes/functions/list-servers.inc.php CHANGED
@@ -41,8 +41,11 @@ if (!function_exists ("ws_plugin__s2member_process_list_servers"))
41
  do_action ("ws_plugin__s2member_before_process_list_servers", get_defined_vars ());
42
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
43
  /**/
44
- if (strlen ($level) && is_email ($email) && $opt_in) /* Must have a Level, a valid email, and opt-in permission. */
45
  {
 
 
 
46
  if (($mailchimp_api_key = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"]))
47
  if (($mailchimp_list_ids = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_mailchimp_list_ids"]))
48
  {
@@ -61,6 +64,9 @@ if (!function_exists ("ws_plugin__s2member_process_list_servers"))
61
  wp_mail ($aweber_list_id . "@aweber.com", apply_filters ("ws_plugin__s2member_aweber_sbj", "s2Member Subscription Request", get_defined_vars ()), apply_filters ("ws_plugin__s2member_aweber_msg", "s2Member Subscription Request\ns2Member w/ PayPal Email ID\nEMail Address: " . $email . "\nBuyer: " . $fname . " " . $lname . "\nFull Name: " . $fname . " " . $lname . "\nFirst Name: " . $fname . "\nLast Name: " . $lname . "\nIP Address: " . $ip . "\nUser ID: " . $user_id . "\nRole: " . $role . "\nLevel: " . $level . "\n - end.", get_defined_vars ()), "From: \"" . preg_replace ("/\"/", "", $fname . " " . $lname) . "\" <" . $email . ">\r\nContent-Type: text/plain; charset=utf-8");
62
  }
63
  /**/
 
 
 
64
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
65
  do_action ("ws_plugin__s2member_during_process_list_servers", get_defined_vars ());
66
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
41
  do_action ("ws_plugin__s2member_before_process_list_servers", get_defined_vars ());
42
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
43
  /**/
44
+ if (strlen ($level) && is_email ($email) && $opt_in) /* Must have these. */
45
  {
46
+ $email_configs_were_on = ws_plugin__s2member_email_config_status (0);
47
+ ws_plugin__s2member_email_config_release (); /* Release Filters. */
48
+ /**/
49
  if (($mailchimp_api_key = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"]))
50
  if (($mailchimp_list_ids = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_mailchimp_list_ids"]))
51
  {
64
  wp_mail ($aweber_list_id . "@aweber.com", apply_filters ("ws_plugin__s2member_aweber_sbj", "s2Member Subscription Request", get_defined_vars ()), apply_filters ("ws_plugin__s2member_aweber_msg", "s2Member Subscription Request\ns2Member w/ PayPal Email ID\nEMail Address: " . $email . "\nBuyer: " . $fname . " " . $lname . "\nFull Name: " . $fname . " " . $lname . "\nFirst Name: " . $fname . "\nLast Name: " . $lname . "\nIP Address: " . $ip . "\nUser ID: " . $user_id . "\nRole: " . $role . "\nLevel: " . $level . "\n - end.", get_defined_vars ()), "From: \"" . preg_replace ("/\"/", "", $fname . " " . $lname) . "\" <" . $email . ">\r\nContent-Type: text/plain; charset=utf-8");
65
  }
66
  /**/
67
+ if ($email_configs_were_on) /* Back on? */
68
+ ws_plugin__s2member_email_config ();
69
+ /**/
70
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
71
  do_action ("ws_plugin__s2member_during_process_list_servers", get_defined_vars ());
72
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
includes/functions/login-redirection.inc.php CHANGED
@@ -14,67 +14,40 @@ Direct access denial.
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit ("Do not access this file directly.");
16
  /*
17
- Function for handling login redirections.
18
- Attach to: add_action("wp_login");
19
  */
20
- if (!function_exists ("ws_plugin__s2member_login_redirect"))
21
  {
22
- function ws_plugin__s2member_login_redirect ($username = FALSE)
23
  {
24
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
25
- do_action ("ws_plugin__s2member_before_login_redirect", get_defined_vars ());
26
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
27
  /**/
28
- $username = (!$username && is_object ($current_user = wp_get_current_user ())) ? $current_user->user_login : $username;
29
- /* This additional check was added in case wp_signon() fires this event with empty $_POST credentials.
30
- In this rare case, we can check to see if WordPress® is remembering a previously logged in User. */
31
- /**/
32
- if (!is_object ($user = new WP_User ($username)) || ! ($user_id = $user->ID) || !$user->has_cap ("edit_posts")/**/
33
- /* Now give Filters a chance also. */ || apply_filters ("ws_plugin__s2member_login_redirect", false, get_defined_vars ()))
34
- {
35
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
36
- do_action ("ws_plugin__s2member_during_login_redirect", get_defined_vars ());
37
- unset ($__refs, $__v); /* Unset defined __refs, __v. */
38
- /**/
39
- if ($username && $user && $user_id && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"] && function_exists ("ws_plugin__s2member_generate_password"))
40
- {
41
- delete_user_setting ("default_password_nag"); /* setcookie() */
42
- update_user_option ($user_id, "default_password_nag", false, true);
43
- }
44
- /**/
45
- if (!$username || !$user || !$user_id || strtolower ($username) === "demo" || ws_plugin__s2member_ip_restrictions_ok ($_SERVER["REMOTE_ADDR"], strtolower ($username)))
46
- {
47
- if ($special_redirection_url = ws_plugin__s2member_login_redirection_url ($user))
48
- wp_redirect($special_redirection_url);
49
- /**/
50
- else
51
- wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
52
- }
53
- /**/
54
- exit ();
55
- }
56
- /**/
57
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
58
- do_action ("ws_plugin__s2member_after_login_redirect", get_defined_vars ());
59
- unset ($__refs, $__v); /* Unset defined __refs, __v. */
60
  /**/
61
- return;
62
  }
63
  }
64
  /*
65
- This function formulates a possible ( Special ) Login Redirection URL.
66
  */
67
- if (!function_exists ("ws_plugin__s2member_login_redirection_url"))
68
  {
69
- function ws_plugin__s2member_login_redirection_url ($user = FALSE)
70
  {
71
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
72
- do_action ("ws_plugin__s2member_before_login_redirection_url", get_defined_vars ());
73
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
74
  /**/
75
- $url = ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"], $user);
 
 
 
 
 
76
  /**/
77
- return apply_filters ("ws_plugin__s2member_login_redirection_url", $url, get_defined_vars ());
78
  }
79
  }
80
  /*
@@ -103,24 +76,49 @@ if (!function_exists ("ws_plugin__s2member_fill_login_redirect_rc_vars"))
103
  }
104
  }
105
  /*
106
- Parses the URI out of a possible ( Special ) Login Redirection URL.
 
107
  */
108
- if (!function_exists ("ws_plugin__s2member_login_redirection_uri"))
109
  {
110
- function ws_plugin__s2member_login_redirection_uri ($user = FALSE)
111
  {
112
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
113
- do_action ("ws_plugin__s2member_before_login_redirection_uri", get_defined_vars ());
114
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
115
  /**/
116
- if ($url = ws_plugin__s2member_login_redirection_url ($user))
117
- {
118
- $path = parse_url ($url, PHP_URL_PATH);
119
- $query = parse_url ($url, PHP_URL_QUERY);
120
- $uri = ($query) ? $path . "?" . $query : $path;
121
- }
122
  /**/
123
- return apply_filters ("ws_plugin__s2member_login_redirection_uri", $uri, get_defined_vars ());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  }
125
  }
126
  ?>
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit ("Do not access this file directly.");
16
  /*
17
+ This function formulates a possible ( Special ) Login Redirection URL.
 
18
  */
19
+ if (!function_exists ("ws_plugin__s2member_login_redirection_url"))
20
  {
21
+ function ws_plugin__s2member_login_redirection_url ($user = FALSE)
22
  {
23
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
24
+ do_action ("ws_plugin__s2member_before_login_redirection_url", get_defined_vars ());
25
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
26
  /**/
27
+ $url = ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"], $user);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  /**/
29
+ return apply_filters ("ws_plugin__s2member_login_redirection_url", $url, get_defined_vars ());
30
  }
31
  }
32
  /*
33
+ Parses the URI out of a possible ( Special ) Login Redirection URL.
34
  */
35
+ if (!function_exists ("ws_plugin__s2member_login_redirection_uri"))
36
  {
37
+ function ws_plugin__s2member_login_redirection_uri ($user = FALSE)
38
  {
39
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
40
+ do_action ("ws_plugin__s2member_before_login_redirection_uri", get_defined_vars ());
41
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
42
  /**/
43
+ if ($url = ws_plugin__s2member_login_redirection_url ($user))
44
+ {
45
+ $path = parse_url ($url, PHP_URL_PATH);
46
+ $query = parse_url ($url, PHP_URL_QUERY);
47
+ $uri = ($query) ? $path . "?" . $query : $path;
48
+ }
49
  /**/
50
+ return apply_filters ("ws_plugin__s2member_login_redirection_uri", $uri, get_defined_vars ());
51
  }
52
  }
53
  /*
76
  }
77
  }
78
  /*
79
+ Function for handling login redirections.
80
+ Attach to: add_action("wp_login");
81
  */
82
+ if (!function_exists ("ws_plugin__s2member_login_redirect"))
83
  {
84
+ function ws_plugin__s2member_login_redirect ($username = FALSE)
85
  {
86
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
87
+ do_action ("ws_plugin__s2member_before_login_redirect", get_defined_vars ());
88
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
89
  /**/
90
+ $username = (!$username && is_object ($current_user = wp_get_current_user ())) ? $current_user->user_login : $username;
 
 
 
 
 
91
  /**/
92
+ if ($username && is_object ($user = new WP_User ($username)) && ($user_id = $user->ID) && (!$user->has_cap ("edit_posts") || apply_filters ("ws_plugin__s2member_login_redirect", false, get_defined_vars ())))
93
+ /**/
94
+ if ($user->has_cap ("edit_posts") || strtolower ($username) === "demo" || ws_plugin__s2member_ip_restrictions_ok ($_SERVER["REMOTE_ADDR"], strtolower ($username)))
95
+ /**/
96
+ if (empty ($_REQUEST["redirect_to"]) || $_REQUEST["redirect_to"] === "wp-admin/" || $_REQUEST["redirect_to"] === admin_url ()) /* ?redirect_to=[value]. */
97
+ {
98
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
99
+ do_action ("ws_plugin__s2member_during_login_redirect", get_defined_vars ());
100
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
101
+ /**/
102
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"] && function_exists ("ws_plugin__s2member_generate_password"))
103
+ {
104
+ delete_user_setting ("default_password_nag"); /* This calls upon setcookie(). */
105
+ update_user_option ($user_id, "default_password_nag", false, true);
106
+ }
107
+ /**/
108
+ if ($special_redirection_url = ws_plugin__s2member_login_redirection_url ($user))
109
+ wp_redirect ($special_redirection_url); /* Special Redirection. */
110
+ /**/
111
+ else /* Else we use the Login Welcome Page configured for s2Member. */
112
+ wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
113
+ /**/
114
+ exit (); /* Clean exit. */
115
+ }
116
+ /**/
117
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
118
+ do_action ("ws_plugin__s2member_after_login_redirect", get_defined_vars ());
119
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
120
+ /**/
121
+ return; /* Return for uniformity. */
122
  }
123
  }
124
  ?>
includes/functions/membership-options.inc.php CHANGED
@@ -36,7 +36,7 @@ if (!function_exists ("ws_plugin__s2member_membership_options_page"))
36
  if (preg_match ("/^s2member_/", $var) && $var !== "s2member_membership_options_page")
37
  $query_args[$var] = $val;
38
  /**/
39
- wp_redirect (add_query_arg (urlencode_deep ($query_args), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
40
  exit ();
41
  }
42
  /**/
36
  if (preg_match ("/^s2member_/", $var) && $var !== "s2member_membership_options_page")
37
  $query_args[$var] = $val;
38
  /**/
39
+ wp_redirect (add_query_arg (urlencode_deep ($query_args), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), 301);
40
  exit ();
41
  }
42
  /**/
includes/functions/page-level-access.inc.php CHANGED
@@ -44,17 +44,17 @@ if (!function_exists ("ws_plugin__s2member_check_page_level_access"))
44
  /**/
45
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_id != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
46
  {
47
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
48
  exit ();
49
  }
50
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_id != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
51
  {
52
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
53
  exit ();
54
  }
55
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && $page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_id != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
56
  {
57
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
58
  exit ();
59
  }
60
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Never restrict Systematic Use Pages. However, there are 3 exceptions above ^. */
@@ -63,13 +63,13 @@ if (!function_exists ("ws_plugin__s2member_check_page_level_access"))
63
  {
64
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
65
  {
66
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
67
  exit ();
68
  }
69
  /**/
70
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_pages"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
71
  {
72
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
73
  exit ();
74
  }
75
  }
@@ -80,13 +80,13 @@ if (!function_exists ("ws_plugin__s2member_check_page_level_access"))
80
  {
81
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
82
  {
83
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
84
  exit ();
85
  }
86
  /**/
87
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] && has_tag (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
88
  {
89
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
90
  exit ();
91
  }
92
  }
@@ -98,7 +98,7 @@ if (!function_exists ("ws_plugin__s2member_check_page_level_access"))
98
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
99
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
100
  {
101
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
102
  exit ();
103
  }
104
  }
@@ -107,13 +107,13 @@ if (!function_exists ("ws_plugin__s2member_check_page_level_access"))
107
  foreach ($ccaps_req as $ccap) /* The $current_user MUST satisfy ALL Custom Capability requirements. Stored as a serialized array. */
108
  if (strlen ($ccap) && (!$current_user || !$current_user->has_cap ("access_s2member_ccap_" . $ccap)))
109
  {
110
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_ccap_req" => $ccap)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
111
  exit ();
112
  }
113
  /**/
114
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($page_id))
115
  {
116
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_sp_req" => $page_id)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
117
  exit ();
118
  }
119
  }
44
  /**/
45
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_id != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
46
  {
47
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
48
  exit ();
49
  }
50
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_id != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
51
  {
52
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
53
  exit ();
54
  }
55
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && $page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")) && $page_id != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
56
  {
57
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
58
  exit ();
59
  }
60
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Never restrict Systematic Use Pages. However, there are 3 exceptions above ^. */
63
  {
64
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_pages"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
65
  {
66
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
67
  exit ();
68
  }
69
  /**/
70
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_pages"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_pages"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
71
  {
72
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
73
  exit ();
74
  }
75
  }
80
  {
81
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
82
  {
83
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
84
  exit ();
85
  }
86
  /**/
87
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] && has_tag (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
88
  {
89
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
90
  exit ();
91
  }
92
  }
98
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
99
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
100
  {
101
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
102
  exit ();
103
  }
104
  }
107
  foreach ($ccaps_req as $ccap) /* The $current_user MUST satisfy ALL Custom Capability requirements. Stored as a serialized array. */
108
  if (strlen ($ccap) && (!$current_user || !$current_user->has_cap ("access_s2member_ccap_" . $ccap)))
109
  {
110
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_ccap_req" => $ccap)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
111
  exit ();
112
  }
113
  /**/
114
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($page_id))
115
  {
116
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_sp_req" => $page_id)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
117
  exit ();
118
  }
119
  }
includes/functions/paypal-utilities.inc.php CHANGED
@@ -204,11 +204,12 @@ if (!function_exists ("ws_plugin__s2member_paypal_email"))
204
  }
205
  /*
206
  Calculate Auto-EOT Time, based on last_payment_time, period1, and period3.
207
- This is used by s2Member's built-in Auto-EOT System, and by its IPN routines.
 
208
  */
209
  if (!function_exists ("ws_plugin__s2member_paypal_auto_eot_time"))
210
  {
211
- function ws_plugin__s2member_paypal_auto_eot_time ($user_id = FALSE, $period1 = FALSE, $period3 = FALSE, $eotper = FALSE)
212
  {
213
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
214
  do_action ("ws_plugin__s2member_before_paypal_auto_eot_time", get_defined_vars ());
@@ -218,6 +219,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_auto_eot_time"))
218
  {
219
  $registration_time = strtotime ($user->user_registered);
220
  $last_payment_time = (int)get_user_option ("s2member_last_payment_time", $user_id);
 
221
  /**/
222
  if (! ($p1_time = 0) && ($period1 = trim (strtoupper ($period1))))
223
  {
204
  }
205
  /*
206
  Calculate Auto-EOT Time, based on last_payment_time, period1, and period3.
207
+ Used by s2Member's built-in Auto-EOT System, and also by its IPN routines.
208
+ last_payment_time can be forced w/ $lpt ( i.e. for delayed eots )
209
  */
210
  if (!function_exists ("ws_plugin__s2member_paypal_auto_eot_time"))
211
  {
212
+ function ws_plugin__s2member_paypal_auto_eot_time ($user_id = FALSE, $period1 = FALSE, $period3 = FALSE, $eotper = FALSE, $lpt = FALSE)
213
  {
214
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
215
  do_action ("ws_plugin__s2member_before_paypal_auto_eot_time", get_defined_vars ());
219
  {
220
  $registration_time = strtotime ($user->user_registered);
221
  $last_payment_time = (int)get_user_option ("s2member_last_payment_time", $user_id);
222
+ $last_payment_time = ((int)$lpt) ? (int)$lpt : (int)$last_payment_time;
223
  /**/
224
  if (! ($p1_time = 0) && ($period1 = trim (strtoupper ($period1))))
225
  {
includes/functions/post-level-access.inc.php CHANGED
@@ -44,7 +44,7 @@ if (!function_exists ("ws_plugin__s2member_check_post_level_access"))
44
  /**/
45
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")))
46
  {
47
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
48
  exit ();
49
  }
50
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
@@ -53,13 +53,13 @@ if (!function_exists ("ws_plugin__s2member_check_post_level_access"))
53
  {
54
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_posts"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
55
  {
56
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
57
  exit ();
58
  }
59
  /**/
60
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_posts"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_posts"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
61
  {
62
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
63
  exit ();
64
  }
65
  }
@@ -68,13 +68,13 @@ if (!function_exists ("ws_plugin__s2member_check_post_level_access"))
68
  {
69
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
70
  {
71
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
72
  exit ();
73
  }
74
  /**/
75
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] && (in_category (($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"])), $post_id) || ws_plugin__s2member_in_descendant_category ($catgs, $post_id)) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
76
  {
77
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
78
  exit ();
79
  }
80
  }
@@ -85,13 +85,13 @@ if (!function_exists ("ws_plugin__s2member_check_post_level_access"))
85
  {
86
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
87
  {
88
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
89
  exit ();
90
  }
91
  /**/
92
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] && has_tag (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
93
  {
94
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
95
  exit ();
96
  }
97
  }
@@ -103,7 +103,7 @@ if (!function_exists ("ws_plugin__s2member_check_post_level_access"))
103
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
104
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
105
  {
106
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
107
  exit ();
108
  }
109
  }
@@ -112,13 +112,13 @@ if (!function_exists ("ws_plugin__s2member_check_post_level_access"))
112
  foreach ($ccaps_req as $ccap) /* The $current_user MUST satisfy ALL Custom Capability requirements. Stored as a serialized array. */
113
  if (strlen ($ccap) && (!$current_user || !$current_user->has_cap ("access_s2member_ccap_" . $ccap)))
114
  {
115
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_ccap_req" => $ccap)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
116
  exit ();
117
  }
118
  /**/
119
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($post_id))
120
  {
121
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_sp_req" => $post_id)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
122
  exit ();
123
  }
124
  }
44
  /**/
45
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")))
46
  {
47
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
48
  exit ();
49
  }
50
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
53
  {
54
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_posts"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
55
  {
56
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
57
  exit ();
58
  }
59
  /**/
60
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_posts"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_posts"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
61
  {
62
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
63
  exit ();
64
  }
65
  }
68
  {
69
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
70
  {
71
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
72
  exit ();
73
  }
74
  /**/
75
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"] && (in_category (($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_catgs"])), $post_id) || ws_plugin__s2member_in_descendant_category ($catgs, $post_id)) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
76
  {
77
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
78
  exit ();
79
  }
80
  }
85
  {
86
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
87
  {
88
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
89
  exit ();
90
  }
91
  /**/
92
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] && has_tag (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
93
  {
94
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
95
  exit ();
96
  }
97
  }
103
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
104
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
105
  {
106
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
107
  exit ();
108
  }
109
  }
112
  foreach ($ccaps_req as $ccap) /* The $current_user MUST satisfy ALL Custom Capability requirements. Stored as a serialized array. */
113
  if (strlen ($ccap) && (!$current_user || !$current_user->has_cap ("access_s2member_ccap_" . $ccap)))
114
  {
115
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_ccap_req" => $ccap)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
116
  exit ();
117
  }
118
  /**/
119
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($post_id))
120
  {
121
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_sp_req" => $post_id)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
122
  exit ();
123
  }
124
  }
includes/functions/ptag-level-access.inc.php CHANGED
@@ -44,7 +44,7 @@ if (!function_exists ("ws_plugin__s2member_check_ptag_level_access"))
44
  /**/
45
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")))
46
  {
47
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
48
  exit ();
49
  }
50
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
@@ -53,13 +53,13 @@ if (!function_exists ("ws_plugin__s2member_check_ptag_level_access"))
53
  {
54
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
55
  {
56
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
57
  exit ();
58
  }
59
  /**/
60
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] && (is_tag ($tags = preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"])) || in_array ($tag_id, $tags)) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
61
  {
62
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
63
  exit ();
64
  }
65
  }
@@ -70,7 +70,7 @@ if (!function_exists ("ws_plugin__s2member_check_ptag_level_access"))
70
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
71
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
72
  {
73
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
74
  exit ();
75
  }
76
  }
44
  /**/
45
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")))
46
  {
47
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
48
  exit ();
49
  }
50
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
53
  {
54
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] === "all" && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
55
  {
56
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
57
  exit ();
58
  }
59
  /**/
60
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"] && (is_tag ($tags = preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ptags"])) || in_array ($tag_id, $tags)) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
61
  {
62
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
63
  exit ();
64
  }
65
  }
70
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
71
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
72
  {
73
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
74
  exit ();
75
  }
76
  }
includes/functions/ruri-level-access.inc.php CHANGED
@@ -42,7 +42,7 @@ if (!function_exists ("ws_plugin__s2member_check_ruri_level_access"))
42
  /**/
43
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")))
44
  {
45
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ruri-" . base64_encode ($_SERVER["REQUEST_URI"]), "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
46
  exit ();
47
  }
48
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
@@ -53,7 +53,7 @@ if (!function_exists ("ws_plugin__s2member_check_ruri_level_access"))
53
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
54
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
55
  {
56
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ruri-" . base64_encode ($_SERVER["REQUEST_URI"]), "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
57
  exit ();
58
  }
59
  }
42
  /**/
43
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = ws_plugin__s2member_login_redirection_uri ($current_user)) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level0")))
44
  {
45
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ruri-" . base64_encode ($_SERVER["REQUEST_URI"]), "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
46
  exit ();
47
  }
48
  else if (!ws_plugin__s2member_is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
53
  foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $i . "_ruris"], $current_user)) as $str)
54
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants (true) !== "nill" && (!$current_user || !current_user_can ("access_s2member_level" . $i)))
55
  {
56
+ wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ruri-" . base64_encode ($_SERVER["REQUEST_URI"]), "s2member_level_req" => $i)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
57
  exit ();
58
  }
59
  }
includes/functions/separates/paypal-notify.inc.php CHANGED
@@ -39,6 +39,8 @@ if (!function_exists ("s__ws_plugin__s2member_paypal_notify"))
39
  {
40
  include_once ABSPATH . "wp-admin/includes/admin.php"; /* Get administrative functions. */
41
  /**/
 
 
42
  if (is_array ($paypal = ws_plugin__s2member_paypal_postvars ()) && ($_paypal = $paypal)) /* Verify POST vars. */
43
  {
44
  $paypal["s2member_log"][] = "IPN received on: " . date ("D M j, Y g:i:s a T");
@@ -408,8 +410,8 @@ if (!function_exists ("s__ws_plugin__s2member_paypal_notify"))
408
  delete_user_option ($user_id, "s2member_file_download_access_log");
409
  /**/
410
  if (preg_match ("/^web_accept$/i", $paypal["txn_type"]) && $paypal["eotper"])
411
- update_user_option ($user_id, "s2member_auto_eot_time", ws_plugin__s2member_paypal_auto_eot_time (0, 0, 0, $paypal["eotper"]));
412
- else /* Otherwise, we need to clear the eot time. */
413
  delete_user_option ($user_id, "s2member_auto_eot_time");
414
  /**/
415
  $pr_times = get_user_option ("s2member_paid_registration_times", $user_id);
@@ -1387,8 +1389,9 @@ if (!function_exists ("s__ws_plugin__s2member_paypal_notify"))
1387
  {
1388
  $processing = $during = true; /* Yes, we ARE processing this. */
1389
  /**/
1390
- $auto_eot_time = ws_plugin__s2member_paypal_auto_eot_time ($user_id, $paypal["period1"], $paypal["period3"]);
1391
- /**/
 
1392
  update_user_option ($user_id, "s2member_auto_eot_time", $auto_eot_time); /* s2Member will follow-up on this later. */
1393
  /**/
1394
  $paypal["s2member_log"][] = "Auto-EOT Time for this account ( delayed ), set to: " . date ("D M j, Y g:i a T", $auto_eot_time);
39
  {
40
  include_once ABSPATH . "wp-admin/includes/admin.php"; /* Get administrative functions. */
41
  /**/
42
+ ws_plugin__s2member_email_config_release (); /* Release all Filters applied to wp_mail() From: headers. */
43
+ /**/
44
  if (is_array ($paypal = ws_plugin__s2member_paypal_postvars ()) && ($_paypal = $paypal)) /* Verify POST vars. */
45
  {
46
  $paypal["s2member_log"][] = "IPN received on: " . date ("D M j, Y g:i:s a T");
410
  delete_user_option ($user_id, "s2member_file_download_access_log");
411
  /**/
412
  if (preg_match ("/^web_accept$/i", $paypal["txn_type"]) && $paypal["eotper"])
413
+ update_user_option ($user_id, "s2member_auto_eot_time", ws_plugin__s2member_paypal_auto_eot_time ("", "", "", $paypal["eotper"]));
414
+ else /* Otherwise, we need to clear the Auto-EOT Time. */
415
  delete_user_option ($user_id, "s2member_auto_eot_time");
416
  /**/
417
  $pr_times = get_user_option ("s2member_paid_registration_times", $user_id);
1389
  {
1390
  $processing = $during = true; /* Yes, we ARE processing this. */
1391
  /**/
1392
+ $auto_eot_time = ws_plugin__s2member_paypal_auto_eot_time ($user_id, $paypal["period1"], $paypal["period3"], "", time ());
1393
+ /* We assume the last payment was today, because this is how newer PayPal® accounts function with respect to EOT handling.
1394
+ Newer PayPal® accounts ( i.e. Subscription IDs starting with `I-`, will have their EOT triggered upon the last payment. */
1395
  update_user_option ($user_id, "s2member_auto_eot_time", $auto_eot_time); /* s2Member will follow-up on this later. */
1396
  /**/
1397
  $paypal["s2member_log"][] = "Auto-EOT Time for this account ( delayed ), set to: " . date ("D M j, Y g:i a T", $auto_eot_time);
includes/functions/separates/paypal-return.inc.php CHANGED
@@ -166,8 +166,8 @@ if (!function_exists ("s__ws_plugin__s2member_paypal_return"))
166
  delete_user_option ($user_id, "s2member_file_download_access_log");
167
  /**/
168
  if (preg_match ("/^web_accept$/i", $paypal["txn_type"]) && $paypal["eotper"])
169
- update_user_option ($user_id, "s2member_auto_eot_time", ws_plugin__s2member_paypal_auto_eot_time (0, 0, 0, $paypal["eotper"]));
170
- else /* Otherwise, we need to clear the eot time. */
171
  delete_user_option ($user_id, "s2member_auto_eot_time");
172
  /**/
173
  $pr_times = get_user_option ("s2member_paid_registration_times", $user_id);
166
  delete_user_option ($user_id, "s2member_file_download_access_log");
167
  /**/
168
  if (preg_match ("/^web_accept$/i", $paypal["txn_type"]) && $paypal["eotper"])
169
+ update_user_option ($user_id, "s2member_auto_eot_time", ws_plugin__s2member_paypal_auto_eot_time ("", "", "", $paypal["eotper"]));
170
+ else /* Otherwise, we need to clear the Auto-EOT Time. */
171
  delete_user_option ($user_id, "s2member_auto_eot_time");
172
  /**/
173
  $pr_times = get_user_option ("s2member_paid_registration_times", $user_id);
includes/functions/user-deletions.inc.php CHANGED
@@ -110,6 +110,8 @@ if (!function_exists ("ws_plugin__s2member_handle_user_deletions"))
110
  /**/
111
  if (is_object ($user = new WP_User ($user_id)) && $user->ID && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $custom)))
112
  {
 
 
113
  $msg = $sbj = "( s2Member / API Notification Email ) - EOT/Deletion";
114
  $msg .= "\n\n"; /* Spacing in the message body. */
115
  /**/
110
  /**/
111
  if (is_object ($user = new WP_User ($user_id)) && $user->ID && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $custom)))
112
  {
113
+ ws_plugin__s2member_email_config_release (); /* Release all Filters applied to wp_mail() From: headers. */
114
+ /**/
115
  $msg = $sbj = "( s2Member / API Notification Email ) - EOT/Deletion";
116
  $msg .= "\n\n"; /* Spacing in the message body. */
117
  /**/
includes/functions/utilities.inc.php CHANGED
@@ -633,7 +633,8 @@ if (!function_exists ("ws_plugin__s2member_form_whips_2_url"))
633
  {
634
  if (($url = trim ($form_action_m[7]))) /* Set URL value dynamically. Now we add values. */
635
  {
636
- if (preg_match_all ("/\<input(.+?)\>/is", $form, $input_attr_ms, PREG_SET_ORDER))
 
637
  {
638
  foreach ($input_attr_ms as $input_attr_m) /* Go through each input variable. */
639
  {
633
  {
634
  if (($url = trim ($form_action_m[7]))) /* Set URL value dynamically. Now we add values. */
635
  {
636
+ if (preg_match_all ("/(?<!\<\!--)\<input(.+?)\>/is", $form, $input_attr_ms, PREG_SET_ORDER))
637
+ /* Negative look-behind prevents inclusion of commented fields in PayPal® Button Codes. */
638
  {
639
  foreach ($input_attr_ms as $input_attr_m) /* Go through each input variable. */
640
  {
includes/menu-pages/api-ops.inc.php CHANGED
@@ -337,7 +337,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
337
  echo '<h3>Cancellation Notification URLs ( optional )</h3>' . "\n";
338
  echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions are cancelled through your Payment Gateway, you\'ll want to read this section. This is marked `Cancellation`, because the URLs that you list below, will be notified each time a Subscription is cancelled. A Cancellation is triggered when you cancel a Customer\'s Subscription through your Payment Gateway, or when a Customer cancels their own Subscription. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN ( and other service integrations ) are already built into s2Member. They remain active at all times. These Cancellation Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
339
  echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT ( End Of Term ). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion or deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n";
340
- echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through your Payment Gateway... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
341
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_cancellation_notifications", get_defined_vars ());
342
  /**/
343
  echo '<table class="form-table">' . "\n";
@@ -437,7 +437,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
437
  echo '<h3>EOT/Deletion Notification URLs ( optional )</h3>' . "\n";
438
  echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have ended ( and a Member is demoted to a Free Subscriber ), or when an account is deleted from the system, you\'ll want to read this section. This is marked `EOT/Deletion`, because the URLs that you list below, will be notified in both cases. EOT = End Of Term. An EOT is triggered <em>immediately</em> when you refund a Customer, when a Customer forces a chargeback to occur, or when a paid Subscription ends naturally ( i.e. expires ), and your Payment Gateway sends s2Member an EOT ( End Of Term ) response. Delayed EOTs occur after a Cancellation, either as a result of you cancelling a Customer\'s Subscription, or a Customer cancelling their own Subscription. A Cancellation usually results in a delayed EOT, because a Cancellation does NOT always warrant an immediate action; there could still be time left on their Subscription.</p>' . "\n";
439
  echo '<p>Manual Deletions will trigger an immediate Notification. If you delete an account manually from within your WordPress® Dashboard, your URLs can be notified automatically through this system. So the two events are an EOT and/or a Manual Deletion. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN ( and other service integrations ) are already built into s2Member. They remain active at all times. These EOT/Deletion Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
440
- echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through your Payment Gateway... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
441
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_eot_deletion_notifications", get_defined_vars ());
442
  /**/
443
  echo '<table class="form-table">' . "\n";
337
  echo '<h3>Cancellation Notification URLs ( optional )</h3>' . "\n";
338
  echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions are cancelled through your Payment Gateway, you\'ll want to read this section. This is marked `Cancellation`, because the URLs that you list below, will be notified each time a Subscription is cancelled. A Cancellation is triggered when you cancel a Customer\'s Subscription through your Payment Gateway, or when a Customer cancels their own Subscription. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN ( and other service integrations ) are already built into s2Member. They remain active at all times. These Cancellation Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
339
  echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT ( End Of Term ). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion or deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n";
340
+ echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through your Payment Gateway... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
341
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_cancellation_notifications", get_defined_vars ());
342
  /**/
343
  echo '<table class="form-table">' . "\n";
437
  echo '<h3>EOT/Deletion Notification URLs ( optional )</h3>' . "\n";
438
  echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have ended ( and a Member is demoted to a Free Subscriber ), or when an account is deleted from the system, you\'ll want to read this section. This is marked `EOT/Deletion`, because the URLs that you list below, will be notified in both cases. EOT = End Of Term. An EOT is triggered <em>immediately</em> when you refund a Customer, when a Customer forces a chargeback to occur, or when a paid Subscription ends naturally ( i.e. expires ), and your Payment Gateway sends s2Member an EOT ( End Of Term ) response. Delayed EOTs occur after a Cancellation, either as a result of you cancelling a Customer\'s Subscription, or a Customer cancelling their own Subscription. A Cancellation usually results in a delayed EOT, because a Cancellation does NOT always warrant an immediate action; there could still be time left on their Subscription.</p>' . "\n";
439
  echo '<p>Manual Deletions will trigger an immediate Notification. If you delete an account manually from within your WordPress® Dashboard, your URLs can be notified automatically through this system. So the two events are an EOT and/or a Manual Deletion. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN ( and other service integrations ) are already built into s2Member. They remain active at all times. These EOT/Deletion Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
440
+ echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through your Payment Gateway... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
441
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_eot_deletion_notifications", get_defined_vars ());
442
  /**/
443
  echo '<table class="form-table">' . "\n";
includes/menu-pages/menu-pages-s-min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(b){var a=esc_html=function(c){return String(c).replace(/"/g,"&quot;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;")};if(location.href.match(/page\=ws-plugin--s2member-mms-options/)){b("select#ws-plugin--s2member-mms-registration-file").change(function(){if(b(this).val()==="wp-signup"){b("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").show(),b("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").hide(),b("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").show()}else{if(b(this).val()==="wp-login"){b("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").hide(),b("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").show(),b("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").hide()}}b("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0")[((b("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"show":"hide")](),b("input#ws-plugin--s2member-mms-registration-blogs-level0").val(((b("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"1":"0"))}).trigger("change");b("select#ws-plugin--s2member-mms-registration-grants").change(function(){b("select#ws-plugin--s2member-mms-registration-file").trigger("change")})}else{if(location.href.match(/page\=ws-plugin--s2member-options/)){ws_plugin__s2member_generateSecurityKey=function(){var f=function(h,g){h=(arguments.length<1)?0:h;g=(arguments.length<2)?2147483647:g;return Math.floor(Math.random()*(g-h+1))+h};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";for(var d=0,c="";d<56;d++){c+=e.substr(f(0,e.length-1),1)}b("input#ws-plugin--s2member-sec-encryption-key").val(c);return false};ws_plugin__s2member_enableSecurityKey=function(){if(confirm("Edit Key? Are you sure?\nThis could break your installation!\n\n*Note* If you've been testing s2Member, feel free to change this Key before you go live. Just don't go live, and then change it. You'll have some very unhappy Customers. Data corruption WILL occur!\n\nFor your safety, s2Member keeps a history of the last 10 Keys that you've used. If you get yourself into a real situation, s2Member will let you revert back to a previous Key.")){b("input#ws-plugin--s2member-sec-encryption-key").attr("disabled",false)}return false};ws_plugin__s2member_securityKeyHistory=function(){b("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false};if(b("input#ws-plugin--s2member-custom-reg-fields").length&&b("div#ws-plugin--s2member-custom-reg-field-configuration").length){(function(){var c=b("input#ws-plugin--s2member-custom-reg-fields");var f=b("div#ws-plugin--s2member-custom-reg-field-configuration");var l=(c.val())?b.JSON.parse(c.val()):[];l=(l instanceof Array)?l:[];var k='<div id="ws-plugin--s2member-custom-reg-field-configuration-tools"></div>';var r='<table id="ws-plugin--s2member-custom-reg-field-configuration-table"></table>';f.html(k+r);var i=b("div#ws-plugin--s2member-custom-reg-field-configuration-tools");var o=b("table#ws-plugin--s2member-custom-reg-field-configuration-table");ws_plugin__s2member_customRegFieldTypeChange=function(t){var s,v,u=b(t).val();s="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-options";v="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected";if(u.match(/^(text|textarea|checkbox|pre_checkbox)$/)){b(s).css("display","none"),b(s).prev("tr").css("display","none")}else{b(s).css("display",""),b(s).prev("tr").css("display","")}if(u.match(/^(select|selects|checkboxes|radios)$/)){b(v).css("display","none"),b(v).prev("tr").css("display","none")}else{b(v).css("display",""),b(v).prev("tr").css("display","")}};ws_plugin__s2member_customRegFieldDelete=function(t){var s=new Array();for(var u=0;u<l.length;u++){if(u!==t){s.push(l[u])}}l=s,q(),p()};ws_plugin__s2member_customRegFieldMoveUp=function(u){if(typeof l[u]==="object"&&typeof l[u-1]==="object"){var t=l[u-1],s=l[u];l[u-1]=s,l[u]=t;q(),p()}};ws_plugin__s2member_customRegFieldMoveDown=function(u){if(typeof l[u]==="object"&&typeof l[u+1]==="object"){var s=l[u+1],t=l[u];l[u+1]=t,l[u]=s;q(),p()}};ws_plugin__s2member_customRegFieldCreate=function(){var s=b("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),t={};b(':input[property!=""]',s).each(function(){var v=b(this),u=v.attr("property"),w=b.trim(v.val());t[u]=w});if((t=d(t))){l.push(t),q(),j(),p(),n();setTimeout(function(){var u="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+(l.length-1);alert('Field created successfully.\n* Remember to "Save Changes".');b(u).effect("highlight",1000)},500)}};ws_plugin__s2member_customRegFieldUpdate=function(t){var s=b("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),u={};b(':input[property!=""]',s).each(function(){var x=b(this),w=x.attr("property"),y=b.trim(x.val());u[w]=y});if((u=d(u,t))){l[t]=u,q(),j(),p(),n();var v="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+t;b(v).effect("highlight",1000)}};ws_plugin__s2member_customRegFieldAdd=function(){j(true)};ws_plugin__s2member_customRegFieldEdit=function(s){j(false,s),n()};ws_plugin__s2member_customRegFieldCancel=function(){j(),n()};var d=function(w,u){var s=(typeof u==="number"&&typeof l[u]==="object")?true:false,x=[],t,v;if(typeof w!=="object"){x.push("Invalid field object. Please try again.")}else{if(!w.id){x.push("Unique Field ID:\nThis is required. Please try again.")}else{if(h(w.id)&&(!s||w.id!==l[u].id)){x.push("Unique Field ID:\nThat Field ID already exists. Please try again.")}}if(!w.label){x.push("Field Label/Description:\nThis is required. Please try again.")}if(w.type.match(/^(select|selects|checkboxes|radios)$/)){w.expected="";if(!w.options){x.push("Option Configuration File:\nThis is required. Please try again.")}else{t=w.options.split(/[\r\n]+/);for(v=0;v<t.length;v++){t[v]=b.trim(t[v]);if(!t[v].match(/^([^\|]*)(\|)([^\|]*)(\|default)?$/)){x.push("Option Configuration File:\nInvalid configuration at line #"+(v+1)+".");break}}w.options=b.trim(t.join("\n"))}}else{w.options=""}if(!(w.levels=w.levels.replace(/ /g,""))){x.push("Applicable Levels:\nThis is required. Please try again.")}else{if(!w.levels.match(/^(all|[0-9,]+)$/)){x.push("Applicable Levels:\nShould be comma delimited Levels, or just type: all.\n( examples: 0,1,2,3,4 or type the word: all )")}}if(w.classes&&w.classes.match(/[^a-z 0-9 _ \-]/i)){x.push("CSS Classes:\nContains invalid characters. Please try again.\n( only: alphanumerics, underscores, hyphens, spaces )")}if(w.styles&&w.styles.match(/["\=\>\<]/)){x.push('CSS Styles:\nContains invalid characters. Please try again.\n( do NOT use these characters: = " < > )')}if(w.attrs&&w.attrs.match(/[\>\<]/)){x.push("Other Attributes:\nContains invalid characters. Please try again.\n( do NOT use these characters: < > )")}}if(x.length>0){alert(x.join("\n\n"));return false}else{return w}};var q=function(){c.val(((l.length>0)?b.JSON.stringify(l):""))};var m=function(s){return(typeof s==="string")?b.trim(s).toLowerCase().replace(/[^a-z0-9]/g,"_"):""};var g=function(t){var s={text:"Text ( single line )",textarea:"Textarea ( multi-line )",select:"Select Menu ( drop-down )",selects:"Select Menu ( multi-option )",checkbox:"Checkbox ( single )",pre_checkbox:"Checkbox ( pre-checked )",checkboxes:"Checkboxes ( multi-option )",radios:"Radio Buttons ( multi-option )"};if(typeof s[t]==="string"){return s[t]}return""};var h=function(s){for(var t=0;t<l.length;t++){if(l[t].id===s){return true}}};var n=function(){scrollTo(0,b("div.ws-plugin--s2member-custom-reg-fields-section").offset()["top"]-100)};var j=function(s,A){var x=0,z="",t="",D=0,y=0,v={id:"",label:"",type:"text",options:"",expected:"",required:"yes",levels:"all",editable:"yes",classes:"",styles:"",attrs:""};var u=(typeof A==="number"&&typeof l[A]==="object")?true:false,C=(s||u)?true:false,B=(u)?l[A]:v;z+='<a href="#" onclick="ws_plugin__s2member_customRegFieldAdd(); return false;">Add New Field</a>';tb_remove(),b("div#ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form").remove();if(C){t+='<div id="ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form">';t+='<table id="ws-plugin--s2member-custom-reg-field-configuration-tools-form">';t+="<tbody>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">Form Field Type: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';t+='<td colspan="2">';t+='<select property="type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';t+='<option value="text"'+((B.type==="text")?' selected="selected"':"")+'">'+esc_html(g("text"))+"</option>";t+='<option value="textarea"'+((B.type==="textarea")?' selected="selected"':"")+'">'+esc_html(g("textarea"))+"</option>";t+='<option value="select"'+((B.type==="select")?' selected="selected"':"")+'">'+esc_html(g("select"))+"</option>";t+='<option value="selects"'+((B.type==="selects")?' selected="selected"':"")+'">'+esc_html(g("selects"))+"</option>";t+='<option value="checkbox"'+((B.type==="checkbox")?' selected="selected"':"")+'">'+esc_html(g("checkbox"))+"</option>";t+='<option value="pre_checkbox"'+((B.type==="pre_checkbox")?' selected="selected"':"")+'">'+esc_html(g("pre_checkbox"))+"</option>";t+='<option value="checkboxes"'+((B.type==="checkboxes")?' selected="selected"':"")+'">'+esc_html(g("checkboxes"))+"</option>";t+='<option value="radios"'+((B.type==="radios")?' selected="selected"':"")+'">'+esc_html(g("radios"))+"</option>";t+="</select>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">Field Label/Desc: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';t+='<td colspan="2">';t+='<input type="text" property="label" value="'+a(B.label)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label" /><br />';t+="<small>Examples: <code>Choose Country</code>, <code>Street Address</code></small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">Unique Field ID: *</label></label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';t+='<td colspan="2">';t+='<input type="text" property="id" value="'+a(B.id)+'" maxlength="25" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id" /><br />';t+="<small>Examples: <code>country_code</code>, <code>street_address</code></small><br />";t+='<small>e.g. <code>&lt;?php echo get_user_field("country_code"); ?&gt;</code></small>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">Field Required: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';t+='<td colspan="2">';t+='<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';t+='<option value="yes"'+((B.required==="yes")?' selected="selected"':"")+'">Yes ( required )</option>';t+='<option value="no"'+((B.required==="no")?' selected="selected"':"")+'">No ( optional )</option>';t+="</select><br />";t+='<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />';t+="<small>* Administrators are exempt from this requirement.</small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"'+((B.type.match(/^(text|textarea|checkbox|pre_checkbox)$/))?' style="display:none;"':"")+'><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((B.type.match(/^(text|textarea|checkbox|pre_checkbox)$/))?' style="display:none;"':"")+">";t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * ( one option per line )</label><br />';t+="<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((B.type.match(/^(text|textarea|checkbox|pre_checkbox)$/))?' style="display:none;"':"")+">";t+='<td colspan="2">';t+='<textarea property="options" rows="3" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">'+esc_html(B.options)+"</textarea><br />";t+="Here is a quick example:<br />";t+="<small>You can also specify a <em>default</em> option:</small><br />";t+="<code>US|United States|default</code><br />";t+="<code>CA|Canada</code><br />";t+="<code>VI|Virgin Islands (U.S.)</code>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"'+((B.type.match(/^(select|selects|checkboxes|radios)$/))?' style="display:none;"':"")+'><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((B.type.match(/^(select|selects|checkboxes|radios)$/))?' style="display:none;"':"")+">";t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((B.type.match(/^(select|selects|checkboxes|radios)$/))?' style="display:none;"':"")+">";t+='<td colspan="2">';t+='<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">';t+='<option value=""'+((B.expected==="")?' selected="selected"':"")+'">Anything Goes</option>';t+='<option disabled="disabled"></option>';t+='<optgroup label="Specific Input Types">';t+='<option value="numeric-wp-commas"'+((B.expected==="numeric-wp-commas")?' selected="selected"':"")+'">Numeric ( with or without decimals, commas allowed )</option>';t+='<option value="numeric"'+((B.expected==="numeric")?' selected="selected"':"")+'">Numeric ( with or without decimals, no commas )</option>';t+='<option value="integer"'+((B.expected==="integer")?' selected="selected"':"")+'">Integer ( whole number, without any decimals )</option>';t+='<option value="integer-gt-0"'+((B.expected==="integer-gt-0")?' selected="selected"':"")+'">Integer > 0 ( whole number, no decimals, greater than 0 )</option>';t+='<option value="float"'+((B.expected==="float")?' selected="selected"':"")+'">Float ( floating point number, decimals required )</option>';t+='<option value="float-gt-0"'+((B.expected==="float-gt-0")?' selected="selected"':"")+'">Float > 0 ( floating point number, decimals required, greater than 0 )</option>';t+='<option value="date"'+((B.expected==="date")?' selected="selected"':"")+'">Date ( required date format: dd/mm/yyyy )</option>';t+='<option value="email"'+((B.expected==="email")?' selected="selected"':"")+'">Email ( require valid email )</option>';t+='<option value="url"'+((B.expected==="url")?' selected="selected"':"")+'">Full URL ( starting with http or https )</option>';t+='<option value="domain"'+((B.expected==="domain")?' selected="selected"':"")+'">Domain Name ( domain name only, without http )</option>';t+='<option value="phone"'+((B.expected==="phone")?' selected="selected"':"")+'">Phone # ( 10 digits w/possible hyphens,spaces,brackets )</option>';t+='<option value="uszip"'+((B.expected==="uszip")?' selected="selected"':"")+'">US Zipcode ( 5-9 digits w/possible hyphen )</option>';t+='<option value="cazip"'+((B.expected==="cazip")?' selected="selected"':"")+'">Canadian Zipcode ( 6 alpha-numerics w/possible space )</option>';t+='<option value="uczip"'+((B.expected==="uczip")?' selected="selected"':"")+'">US/Canadian Zipcode ( either a US or Canadian zipcode )</option>';t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Any Character Combination">';for(x=1;x<=25;x++){t+='<option value="any-'+x+'"'+((B.expected==="any-"+x)?' selected="selected"':"")+'">Any Character Combination ( '+x+" character minimum )</option>";t+='<option value="any-'+x+'-e"'+((B.expected==="any-"+x+"-e")?' selected="selected"':"")+'">Any Character Combination ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphanumerics, Spaces &amp; Punctuation Only">';for(x=1;x<=25;x++){t+='<option value="alphanumerics-spaces-punctuation-'+x+'"'+((B.expected==="alphanumerics-spaces-punctuation-"+x)?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation ( '+x+" character minimum )</option>";t+='<option value="alphanumerics-spaces-punctuation-'+x+'-e"'+((B.expected==="alphanumerics-spaces-punctuation-"+x+"-e")?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphanumerics &amp; Spaces Only">';for(x=1;x<=25;x++){t+='<option value="alphanumerics-spaces-'+x+'"'+((B.expected==="alphanumerics-spaces-"+x)?' selected="selected"':"")+'">Alphanumerics &amp; Spaces ( '+x+" character minimum )</option>";t+='<option value="alphanumerics-spaces-'+x+'-e"'+((B.expected==="alphanumerics-spaces-"+x+"-e")?' selected="selected"':"")+'">Alphanumerics &amp; Spaces ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphanumerics &amp; Punctuation Only">';for(x=1;x<=25;x++){t+='<option value="alphanumerics-punctuation-'+x+'"'+((B.expected==="alphanumerics-punctuation-"+x)?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation ( '+x+" character minimum )</option>";t+='<option value="alphanumerics-punctuation-'+x+'-e"'+((B.expected==="alphanumerics-punctuation-"+x+"-e")?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphanumerics Only">';for(x=1;x<=25;x++){t+='<option value="alphanumerics-'+x+'"'+((B.expected==="alphanumerics-"+x)?' selected="selected"':"")+'">Alphanumerics ( '+x+" character minimum )</option>";t+='<option value="alphanumerics-'+x+'-e"'+((B.expected==="alphanumerics-"+x+"-e")?' selected="selected"':"")+'">Alphanumerics ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphabetics Only">';for(x=1;x<=25;x++){t+='<option value="alphabetics-'+x+'"'+((B.expected==="alphabetics-"+x)?' selected="selected"':"")+'">Alphabetics ( '+x+" character minimum )</option>";t+='<option value="alphabetics-'+x+'-e"'+((B.expected==="alphabetics-"+x+"-e")?' selected="selected"':"")+'">Alphabetics ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Numeric Digits Only">';for(x=1;x<=25;x++){t+='<option value="numerics-'+x+'"'+((B.expected==="numerics-"+x)?' selected="selected"':"")+'">Numeric Digits ( '+x+" digit minimum )</option>";t+='<option value="numerics-'+x+'-e"'+((B.expected==="numerics-"+x+"-e")?' selected="selected"':"")+'">Numeric Digits ( exactly '+x+" digit"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+="</select><br />";t+="<small>Only Users/Members will be required to meet this criteria.</small><br />";t+="<small>* Administrators are exempt from this.</small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">Applicable Membership Levels: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';t+='<td colspan="2">';t+='<input type="text" property="levels" value="'+a(B.levels)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels" /><br />';t+="<small>Please use comma-delimited Level #'s: <code>0,1,2,3,4</code> or type: <code>all</code>.</small><br />";t+="<small>This allows you to enable this field - only at specific Membership Levels.</small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">Allow Profile Edits: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';t+='<td colspan="2">';t+='<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';t+='<option value="yes"'+((B.editable==="yes")?' selected="selected"':"")+'">Yes ( editable )</option>';t+='<option value="no"'+((B.editable==="no")?' selected="selected"':"")+'">No ( uneditable after registration )</option>';t+='<option value="no-invisible"'+((B.editable==="no-invisible")?' selected="selected"':"")+'">No ( uneditable &amp; totally invisible )</option>';t+="</select><br />";t+="<small>If <code>No</code>, this field will be un-editable after registration.</small><br />";t+="<small>* Administrators are exempt from this.</small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">CSS Classes: ( optional )</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';t+='<td colspan="2">';t+='<input type="text" property="classes" value="'+a(B.classes)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes" /><br />';t+="<small>Example: <code>my-style-1 my-style-2</code></small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">CSS Styles: ( optional )</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';t+='<td colspan="2">';t+='<input type="text" property="styles" value="'+a(B.styles)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles" /><br />';t+="<small>Example: <code>color:#000000; background:#FFFFFF;</code></small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">Other Attributes: ( optional )</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';t+='<td colspan="2">';t+='<input type="text" property="attrs" value="'+a(B.attrs)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs" /><br />';t+='<small>Example: <code>onkeyup="" onblur=""</code></small>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons">';t+='<td align="left">';t+='<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />';t+="</td>";t+='<td align="right">';t+='<input type="button" value="'+((u)?"Update This Field":"Create Registration Field")+'" onclick="'+((u)?"ws_plugin__s2member_customRegFieldUpdate("+A+");":"ws_plugin__s2member_customRegFieldCreate();")+'" />';t+="</td>";t+="</tr>";t+="</tbody>";t+="</table>";t+="<div>";b("body").append(t);tb_show(((u)?"Editing Registration Field":"New Custom Registration Field"),"#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form");b(window).trigger("resize"),b("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form").show()}i.html(z)};var e=function(){b(window).resize(function(){var s,t;s=b(window).width(),t=b(window).height(),s=(s>720)?720:s;b("#TB_ajaxContent").css({width:s-50,height:t-75,margin:0,padding:0})})};var p=function(){var s=l.length,v=0,w,u="",t="o";u+="<tbody>";u+="<tr>";u+="<th>Order</th>";u+="<th>Field Type</th>";u+="<th>Unique ID</th>";u+="<th>Required</th>";u+="<th>Levels</th>";u+="<th>- Tools -</th>";u+="</tr>";if(l.length>0){for(v=0;v<l.length;v++){t=(t==="o")?"e":"o";w=l[v];u+='<tr class="'+a(t)+" ws-plugin--s2member-custom-reg-field-configuration-table-row-"+v+'">';u+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-move-up" href="#" onclick="ws_plugin__s2member_customRegFieldMoveUp('+v+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-move-down" href="#" onclick="ws_plugin__s2member_customRegFieldMoveDown('+v+'); return false;"></a></td>';u+='<td nowrap="nowrap">'+esc_html(g(w.type))+"</td>";u+='<td nowrap="nowrap">'+esc_html(w.id)+"</td>";u+='<td nowrap="nowrap">'+esc_html(w.required)+"</td>";u+='<td nowrap="nowrap">'+esc_html(w.levels)+"</td>";u+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-edit" href="#" onclick="ws_plugin__s2member_customRegFieldEdit('+v+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-delete" href="#" onclick="ws_plugin__s2member_customRegFieldDelete('+v+'); return false;"></a></td>';u+="</tr>"}}else{u+="<tr>";u+='<td colspan="6">No Custom Fields are configured.</td>';u+="</tr>"}u+="</tbody>";o.html(u)};j(),e(),p()})()}b("input#ws-plugin--s2member-ip-restrictions-reset-button").click(function(){var c=b(this);c.val("one moment please ...");b.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(d){alert("s2Member's IP Restriction Logs have all been reset."),c.val("Reset IP Restriction Logs")});return false})}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){b("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var d=b(this),e=d.val();var c=b("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(e==2){c.show()}else{c.hide()}})}else{if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){b("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var e=b(this),f=e.val();var d=b("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var c=b("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(f<=0){d.css("display","none"),c.attr("src",c.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}else{if(f==1){d.css("display",""),c.attr("src",c.attr("src").replace(/\/unchecked\.png$/,"/checked.png"))}else{if(f==2){d.css("display",""),c.attr("src",c.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}}}})}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){b("select#ws-plugin--s2member-level1-term, select#ws-plugin--s2member-level2-term, select#ws-plugin--s2member-level3-term, select#ws-plugin--s2member-level4-term, select#ws-plugin--s2member-modification-term").change(function(){var d=this.id.replace(/^ws-plugin--s2member-(.+?)-term$/g,"$1");var c=(b(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;b("p#ws-plugin--s2member-"+d+"-trial-line").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-trial-then").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-20p-rule").css("display",(c?"none":""));(c)?b("input#ws-plugin--s2member-"+form+"-trial-period").val(0):null;(c)?b("input#ws-plugin--s2member-"+form+"-trial-amount").val("0.00"):null});b("input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps").keyup(function(){if(this.value.match(/[^a-z_0-9,]/)){this.value=b.trim(b.trim(this.value).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase())}});ws_plugin__s2member_paypalButtonGenerate=function(f){var c='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',r="",v={};v.level0='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]); ?>';v.level1='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]); ?>';v.level2='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]); ?>';v.level3='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]); ?>';v.level4='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]); ?>';var o=b("input#ws-plugin--s2member-"+f+"-shortcode");var g=b("textarea#ws-plugin--s2member-"+f+"-button");var k=b("select#ws-plugin--s2member-modification-level");var h=(f==="modification")?k.val().split(":",2)[1]:f.replace(/^level/,"");var l=v["level"+h].replace(/"/g,"");var s=b.trim(b("input#ws-plugin--s2member-"+f+"-desc").val().replace(/"/g,""));var p=b("input#ws-plugin--s2member-"+f+"-trial-amount").val().replace(/[^0-9\.]/g,"");var e=b("input#ws-plugin--s2member-"+f+"-trial-period").val().replace(/[^0-9]/g,"");var j=b("select#ws-plugin--s2member-"+f+"-trial-term").val().replace(/[^A-Z]/g,"");var m=b("input#ws-plugin--s2member-"+f+"-amount").val().replace(/[^0-9\.]/g,"");var u=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var w=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var t=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var d=b.trim(b("input#ws-plugin--s2member-"+f+"-page-style").val().replace(/"/g,""));var i=b("select#ws-plugin--s2member-"+f+"-currency").val().replace(/[^A-Z]/g,"");var n=b.trim(b.trim(b("input#ws-plugin--s2member-"+f+"-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase());e=(t==="BN")?"0":e;p=(!p||isNaN(p)||p<0.01||e<=0)?"0":p;var q=(t==="BN"&&w!=="L")?h+":"+n+":"+u+" "+w:h+":"+n;q=q.replace(/\:+$/g,"");if(p&&(isNaN(p)||p<0)){alert("Oops, a slight problem:\n\nWhen provided, Trial Amount must be >= 0.00");return false}else{if(p&&p>10000){alert("Oops, a slight problem:\n\nMaximum Trial Amount is: 10000.00");return false}else{if(j==="D"&&e>7){alert("Oops, a slight problem:\n\nMaximum Free Days is: 7.\nIf you want to offer more than 7 days free, please choose Weeks or Months from the drop-down.");return false}else{if(j==="W"&&e>52){alert("Oops, a slight problem:\n\nMaximum Free Weeks is: 52.\nIf you want to offer more than 52 weeks free, please choose Months from the drop-down.");return false}else{if(j==="M"&&e>12){alert("Oops, a slight problem:\n\nMaximum Free Months is: 12.\nIf you want to offer more than 12 months free, please choose Years from the drop-down.");return false}else{if(j==="Y"&&e>1){alert("Oops, a slight problem:\n\nMax Trial Period Years is: 1.");return false}else{if(!m||isNaN(m)||m<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(m>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}else{if(!s){alert("Oops, a slight problem:\n\nPlease type a Description for this Button.");return false}}}}}}}}}g.html(g.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(e)<=0)?g.html(g.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(t==="BN")?g.html(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(t==="BN")?g.html(g.val().replace(/ (\<input type\="hidden" name\="(src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(t!=="BN")?g.html(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(t!=="BN")?g.html(g.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;r+='level="'+a(h)+'" ccaps="'+a(n)+'" desc="'+a(s)+'" ps="'+a(d)+'" cc="'+a(i)+'" ns="1" custom="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';r+=' ta="'+a(p)+'" tp="'+a(e)+'" tt="'+a(j)+'" ra="'+a(m)+'" rp="'+a(u)+'" rt="'+a(w)+'" rr="'+a(t)+'"';r+=(f==="modification")?' modify="1"':"";o.val(c.replace(/%%attrs%%/,r));g.html(g.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(s)+'"'));g.html(g.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(q)+'"'));g.html(g.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(d)+'"'));g.html(g.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(i)+'"'));g.html(g.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));g.html(g.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((f==="modification")?"1":"0")+'"'));g.html(g.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(m)+'"'));g.html(g.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+a(t)+'"'));g.html(g.val().replace(/ name\="a1" value\="(.*?)"/,' name="a1" value="'+a(p)+'"'));g.html(g.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+a(e)+'"'));g.html(g.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+a(j)+'"'));g.html(g.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+a(m)+'"'));g.html(g.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+a(u)+'"'));g.html(g.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+a(w)+'"'));b("div#ws-plugin--s2member-"+f+"-button-prev").html(g.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0); \?\>/g,""));(f==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");o.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var q='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',p="";var n=b("input#ws-plugin--s2member-sp-shortcode");var e=b("textarea#ws-plugin--s2member-sp-button");var f=b("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-additional-ids").val()||[];var o=b("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var k=b("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var j=b.trim(b("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var m=b.trim(b("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var d=b("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!f){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}else{if(!k||isNaN(k)||k<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(k>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}else{if(!j){alert("Oops, a slight problem:\n\nPlease type a Description for this Button.");return false}}}}for(var g=0,c=f;g<h.length;g++){if(h[g]&&h[g]!==f){c+=","+h[g]}}var l="sp:"+c+":"+o;p+='ids="'+a(c)+'" exp="'+a(o)+'" desc="'+a(j)+'" ps="'+a(m)+'" cc="'+a(d)+'" ns="1"';p+=' custom="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+a(k)+'" sp="1"';n.val(q.replace(/%%attrs%%/,p));e.html(e.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(j)+'"'));e.html(e.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(l)+'"'));e.html(e.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(m)+'"'));e.html(e.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(d)+'"'));e.html(e.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));e.html(e.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(k)+'"'));b("div#ws-plugin--s2member-sp-button-prev").html(e.val().replace(/\<form/,'<form target="_blank"'));alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");n.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var j=b("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var c=b("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var d=b("p#ws-plugin--s2member-sp-link"),g=b("img#ws-plugin--s2member-sp-link-loading");if(!j){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}for(var e=0,f=j;e<h.length;e++){if(h[e]&&h[e]!==j){f+=","+h[e]}}d.hide(),g.show(),b.post(ajaxurl,{action:"ws_plugin__s2member_sp_access_link_via_ajax",ws_plugin__s2member_sp_access_link_via_ajax:'<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link-via-ajax")); ?>',s2member_sp_access_link_ids:f,s2member_sp_access_link_hours:c},function(i){d.show().html('<a href="'+a(i)+'" target="_blank" rel="external">'+esc_html(i)+"</a>"),g.hide()});return false}}}}}}});
1
+ jQuery(document).ready(function(b){var a=esc_html=function(c){return String(c).replace(/"/g,"&quot;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;")};if(location.href.match(/page\=ws-plugin--s2member-mms-options/)){b("select#ws-plugin--s2member-mms-registration-file").change(function(){if(b(this).val()==="wp-signup"){b("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").show(),b("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").hide(),b("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").show()}else{if(b(this).val()==="wp-login"){b("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").hide(),b("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").show(),b("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").hide()}}b("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0")[((b("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"show":"hide")](),b("input#ws-plugin--s2member-mms-registration-blogs-level0").val(((b("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"1":"0"))}).trigger("change");b("select#ws-plugin--s2member-mms-registration-grants").change(function(){b("select#ws-plugin--s2member-mms-registration-file").trigger("change")})}else{if(location.href.match(/page\=ws-plugin--s2member-options/)){ws_plugin__s2member_generateSecurityKey=function(){var f=function(h,g){h=(arguments.length<1)?0:h;g=(arguments.length<2)?2147483647:g;return Math.floor(Math.random()*(g-h+1))+h};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";for(var d=0,c="";d<56;d++){c+=e.substr(f(0,e.length-1),1)}b("input#ws-plugin--s2member-sec-encryption-key").val(c);return false};ws_plugin__s2member_enableSecurityKey=function(){if(confirm("Edit Key? Are you sure?\nThis could break your installation!\n\n*Note* If you've been testing s2Member, feel free to change this Key before you go live. Just don't go live, and then change it. You'll have some very unhappy Customers. Data corruption WILL occur!\n\nFor your safety, s2Member keeps a history of the last 10 Keys that you've used. If you get yourself into a real situation, s2Member will let you revert back to a previous Key.")){b("input#ws-plugin--s2member-sec-encryption-key").attr("disabled",false)}return false};ws_plugin__s2member_securityKeyHistory=function(){b("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false};if(b("input#ws-plugin--s2member-custom-reg-fields").length&&b("div#ws-plugin--s2member-custom-reg-field-configuration").length){(function(){var c=b("input#ws-plugin--s2member-custom-reg-fields");var f=b("div#ws-plugin--s2member-custom-reg-field-configuration");var l=(c.val())?b.JSON.parse(c.val()):[];l=(l instanceof Array)?l:[];var k='<div id="ws-plugin--s2member-custom-reg-field-configuration-tools"></div>';var r='<table id="ws-plugin--s2member-custom-reg-field-configuration-table"></table>';f.html(k+r);var i=b("div#ws-plugin--s2member-custom-reg-field-configuration-tools");var o=b("table#ws-plugin--s2member-custom-reg-field-configuration-table");ws_plugin__s2member_customRegFieldTypeChange=function(t){var s,v,u=b(t).val();s="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-options";v="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected";if(u.match(/^(text|textarea|checkbox|pre_checkbox)$/)){b(s).css("display","none"),b(s).prev("tr").css("display","none")}else{b(s).css("display",""),b(s).prev("tr").css("display","")}if(u.match(/^(select|selects|checkboxes|radios)$/)){b(v).css("display","none"),b(v).prev("tr").css("display","none")}else{b(v).css("display",""),b(v).prev("tr").css("display","")}};ws_plugin__s2member_customRegFieldDelete=function(t){var s=new Array();for(var u=0;u<l.length;u++){if(u!==t){s.push(l[u])}}l=s,q(),p()};ws_plugin__s2member_customRegFieldMoveUp=function(u){if(typeof l[u]==="object"&&typeof l[u-1]==="object"){var t=l[u-1],s=l[u];l[u-1]=s,l[u]=t;q(),p()}};ws_plugin__s2member_customRegFieldMoveDown=function(u){if(typeof l[u]==="object"&&typeof l[u+1]==="object"){var s=l[u+1],t=l[u];l[u+1]=t,l[u]=s;q(),p()}};ws_plugin__s2member_customRegFieldCreate=function(){var s=b("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),t={};b(":input[property]",s).each(function(){var v=b(this),u=v.attr("property"),w=b.trim(v.val());t[u]=w});if((t=d(t))){l.push(t),q(),j(),p(),n();setTimeout(function(){var u="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+(l.length-1);alert('Field created successfully.\n* Remember to "Save Changes".');b(u).effect("highlight",1000)},500)}};ws_plugin__s2member_customRegFieldUpdate=function(t){var s=b("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),u={};b(":input[property]",s).each(function(){var x=b(this),w=x.attr("property"),y=b.trim(x.val());u[w]=y});if((u=d(u,t))){l[t]=u,q(),j(),p(),n();var v="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+t;b(v).effect("highlight",1000)}};ws_plugin__s2member_customRegFieldAdd=function(){j(true)};ws_plugin__s2member_customRegFieldEdit=function(s){j(false,s),n()};ws_plugin__s2member_customRegFieldCancel=function(){j(),n()};var d=function(w,u){var s=(typeof u==="number"&&typeof l[u]==="object")?true:false,x=[],t,v;if(typeof w!=="object"){x.push("Invalid field object. Please try again.")}else{if(!w.id){x.push("Unique Field ID:\nThis is required. Please try again.")}else{if(h(w.id)&&(!s||w.id!==l[u].id)){x.push("Unique Field ID:\nThat Field ID already exists. Please try again.")}}if(!w.label){x.push("Field Label/Description:\nThis is required. Please try again.")}if(w.type.match(/^(select|selects|checkboxes|radios)$/)){w.expected="";if(!w.options){x.push("Option Configuration File:\nThis is required. Please try again.")}else{t=w.options.split(/[\r\n]+/);for(v=0;v<t.length;v++){t[v]=b.trim(t[v]);if(!t[v].match(/^([^\|]*)(\|)([^\|]*)(\|default)?$/)){x.push("Option Configuration File:\nInvalid configuration at line #"+(v+1)+".");break}}w.options=b.trim(t.join("\n"))}}else{w.options=""}if(!(w.levels=w.levels.replace(/ /g,""))){x.push("Applicable Levels:\nThis is required. Please try again.")}else{if(!w.levels.match(/^(all|[0-9,]+)$/)){x.push("Applicable Levels:\nShould be comma delimited Levels, or just type: all.\n( examples: 0,1,2,3,4 or type the word: all )")}}if(w.classes&&w.classes.match(/[^a-z 0-9 _ \-]/i)){x.push("CSS Classes:\nContains invalid characters. Please try again.\n( only: alphanumerics, underscores, hyphens, spaces )")}if(w.styles&&w.styles.match(/["\=\>\<]/)){x.push('CSS Styles:\nContains invalid characters. Please try again.\n( do NOT use these characters: = " < > )')}if(w.attrs&&w.attrs.match(/[\>\<]/)){x.push("Other Attributes:\nContains invalid characters. Please try again.\n( do NOT use these characters: < > )")}}if(x.length>0){alert(x.join("\n\n"));return false}else{return w}};var q=function(){c.val(((l.length>0)?b.JSON.stringify(l):""))};var m=function(s){return(typeof s==="string")?b.trim(s).toLowerCase().replace(/[^a-z0-9]/g,"_"):""};var g=function(t){var s={text:"Text ( single line )",textarea:"Textarea ( multi-line )",select:"Select Menu ( drop-down )",selects:"Select Menu ( multi-option )",checkbox:"Checkbox ( single )",pre_checkbox:"Checkbox ( pre-checked )",checkboxes:"Checkboxes ( multi-option )",radios:"Radio Buttons ( multi-option )"};if(typeof s[t]==="string"){return s[t]}return""};var h=function(s){for(var t=0;t<l.length;t++){if(l[t].id===s){return true}}};var n=function(){scrollTo(0,b("div.ws-plugin--s2member-custom-reg-fields-section").offset()["top"]-100)};var j=function(s,A){var x=0,z="",t="",D=0,y=0,v={id:"",label:"",type:"text",options:"",expected:"",required:"yes",levels:"all",editable:"yes",classes:"",styles:"",attrs:""};var u=(typeof A==="number"&&typeof l[A]==="object")?true:false,C=(s||u)?true:false,B=(u)?l[A]:v;z+='<a href="#" onclick="ws_plugin__s2member_customRegFieldAdd(); return false;">Add New Field</a>';tb_remove(),b("div#ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form").remove();if(C){t+='<div id="ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form">';t+='<table id="ws-plugin--s2member-custom-reg-field-configuration-tools-form">';t+="<tbody>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">Form Field Type: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';t+='<td colspan="2">';t+='<select property="type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';t+='<option value="text"'+((B.type==="text")?' selected="selected"':"")+'">'+esc_html(g("text"))+"</option>";t+='<option value="textarea"'+((B.type==="textarea")?' selected="selected"':"")+'">'+esc_html(g("textarea"))+"</option>";t+='<option value="select"'+((B.type==="select")?' selected="selected"':"")+'">'+esc_html(g("select"))+"</option>";t+='<option value="selects"'+((B.type==="selects")?' selected="selected"':"")+'">'+esc_html(g("selects"))+"</option>";t+='<option value="checkbox"'+((B.type==="checkbox")?' selected="selected"':"")+'">'+esc_html(g("checkbox"))+"</option>";t+='<option value="pre_checkbox"'+((B.type==="pre_checkbox")?' selected="selected"':"")+'">'+esc_html(g("pre_checkbox"))+"</option>";t+='<option value="checkboxes"'+((B.type==="checkboxes")?' selected="selected"':"")+'">'+esc_html(g("checkboxes"))+"</option>";t+='<option value="radios"'+((B.type==="radios")?' selected="selected"':"")+'">'+esc_html(g("radios"))+"</option>";t+="</select>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">Field Label/Desc: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';t+='<td colspan="2">';t+='<input type="text" property="label" value="'+a(B.label)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label" /><br />';t+="<small>Examples: <code>Choose Country</code>, <code>Street Address</code></small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">Unique Field ID: *</label></label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';t+='<td colspan="2">';t+='<input type="text" property="id" value="'+a(B.id)+'" maxlength="25" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id" /><br />';t+="<small>Examples: <code>country_code</code>, <code>street_address</code></small><br />";t+='<small>e.g. <code>&lt;?php echo get_user_field("country_code"); ?&gt;</code></small>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">Field Required: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';t+='<td colspan="2">';t+='<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';t+='<option value="yes"'+((B.required==="yes")?' selected="selected"':"")+'">Yes ( required )</option>';t+='<option value="no"'+((B.required==="no")?' selected="selected"':"")+'">No ( optional )</option>';t+="</select><br />";t+='<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />';t+="<small>* Administrators are exempt from this requirement.</small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"'+((B.type.match(/^(text|textarea|checkbox|pre_checkbox)$/))?' style="display:none;"':"")+'><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((B.type.match(/^(text|textarea|checkbox|pre_checkbox)$/))?' style="display:none;"':"")+">";t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * ( one option per line )</label><br />';t+="<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((B.type.match(/^(text|textarea|checkbox|pre_checkbox)$/))?' style="display:none;"':"")+">";t+='<td colspan="2">';t+='<textarea property="options" rows="3" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">'+esc_html(B.options)+"</textarea><br />";t+="Here is a quick example:<br />";t+="<small>You can also specify a <em>default</em> option:</small><br />";t+="<code>US|United States|default</code><br />";t+="<code>CA|Canada</code><br />";t+="<code>VI|Virgin Islands (U.S.)</code>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"'+((B.type.match(/^(select|selects|checkboxes|radios)$/))?' style="display:none;"':"")+'><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((B.type.match(/^(select|selects|checkboxes|radios)$/))?' style="display:none;"':"")+">";t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((B.type.match(/^(select|selects|checkboxes|radios)$/))?' style="display:none;"':"")+">";t+='<td colspan="2">';t+='<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">';t+='<option value=""'+((B.expected==="")?' selected="selected"':"")+'">Anything Goes</option>';t+='<option disabled="disabled"></option>';t+='<optgroup label="Specific Input Types">';t+='<option value="numeric-wp-commas"'+((B.expected==="numeric-wp-commas")?' selected="selected"':"")+'">Numeric ( with or without decimals, commas allowed )</option>';t+='<option value="numeric"'+((B.expected==="numeric")?' selected="selected"':"")+'">Numeric ( with or without decimals, no commas )</option>';t+='<option value="integer"'+((B.expected==="integer")?' selected="selected"':"")+'">Integer ( whole number, without any decimals )</option>';t+='<option value="integer-gt-0"'+((B.expected==="integer-gt-0")?' selected="selected"':"")+'">Integer > 0 ( whole number, no decimals, greater than 0 )</option>';t+='<option value="float"'+((B.expected==="float")?' selected="selected"':"")+'">Float ( floating point number, decimals required )</option>';t+='<option value="float-gt-0"'+((B.expected==="float-gt-0")?' selected="selected"':"")+'">Float > 0 ( floating point number, decimals required, greater than 0 )</option>';t+='<option value="date"'+((B.expected==="date")?' selected="selected"':"")+'">Date ( required date format: dd/mm/yyyy )</option>';t+='<option value="email"'+((B.expected==="email")?' selected="selected"':"")+'">Email ( require valid email )</option>';t+='<option value="url"'+((B.expected==="url")?' selected="selected"':"")+'">Full URL ( starting with http or https )</option>';t+='<option value="domain"'+((B.expected==="domain")?' selected="selected"':"")+'">Domain Name ( domain name only, without http )</option>';t+='<option value="phone"'+((B.expected==="phone")?' selected="selected"':"")+'">Phone # ( 10 digits w/possible hyphens,spaces,brackets )</option>';t+='<option value="uszip"'+((B.expected==="uszip")?' selected="selected"':"")+'">US Zipcode ( 5-9 digits w/possible hyphen )</option>';t+='<option value="cazip"'+((B.expected==="cazip")?' selected="selected"':"")+'">Canadian Zipcode ( 6 alpha-numerics w/possible space )</option>';t+='<option value="uczip"'+((B.expected==="uczip")?' selected="selected"':"")+'">US/Canadian Zipcode ( either a US or Canadian zipcode )</option>';t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Any Character Combination">';for(x=1;x<=25;x++){t+='<option value="any-'+x+'"'+((B.expected==="any-"+x)?' selected="selected"':"")+'">Any Character Combination ( '+x+" character minimum )</option>";t+='<option value="any-'+x+'-e"'+((B.expected==="any-"+x+"-e")?' selected="selected"':"")+'">Any Character Combination ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphanumerics, Spaces &amp; Punctuation Only">';for(x=1;x<=25;x++){t+='<option value="alphanumerics-spaces-punctuation-'+x+'"'+((B.expected==="alphanumerics-spaces-punctuation-"+x)?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation ( '+x+" character minimum )</option>";t+='<option value="alphanumerics-spaces-punctuation-'+x+'-e"'+((B.expected==="alphanumerics-spaces-punctuation-"+x+"-e")?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphanumerics &amp; Spaces Only">';for(x=1;x<=25;x++){t+='<option value="alphanumerics-spaces-'+x+'"'+((B.expected==="alphanumerics-spaces-"+x)?' selected="selected"':"")+'">Alphanumerics &amp; Spaces ( '+x+" character minimum )</option>";t+='<option value="alphanumerics-spaces-'+x+'-e"'+((B.expected==="alphanumerics-spaces-"+x+"-e")?' selected="selected"':"")+'">Alphanumerics &amp; Spaces ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphanumerics &amp; Punctuation Only">';for(x=1;x<=25;x++){t+='<option value="alphanumerics-punctuation-'+x+'"'+((B.expected==="alphanumerics-punctuation-"+x)?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation ( '+x+" character minimum )</option>";t+='<option value="alphanumerics-punctuation-'+x+'-e"'+((B.expected==="alphanumerics-punctuation-"+x+"-e")?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphanumerics Only">';for(x=1;x<=25;x++){t+='<option value="alphanumerics-'+x+'"'+((B.expected==="alphanumerics-"+x)?' selected="selected"':"")+'">Alphanumerics ( '+x+" character minimum )</option>";t+='<option value="alphanumerics-'+x+'-e"'+((B.expected==="alphanumerics-"+x+"-e")?' selected="selected"':"")+'">Alphanumerics ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Alphabetics Only">';for(x=1;x<=25;x++){t+='<option value="alphabetics-'+x+'"'+((B.expected==="alphabetics-"+x)?' selected="selected"':"")+'">Alphabetics ( '+x+" character minimum )</option>";t+='<option value="alphabetics-'+x+'-e"'+((B.expected==="alphabetics-"+x+"-e")?' selected="selected"':"")+'">Alphabetics ( exactly '+x+" character"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+='<option disabled="disabled"></option>';t+='<optgroup label="Numeric Digits Only">';for(x=1;x<=25;x++){t+='<option value="numerics-'+x+'"'+((B.expected==="numerics-"+x)?' selected="selected"':"")+'">Numeric Digits ( '+x+" digit minimum )</option>";t+='<option value="numerics-'+x+'-e"'+((B.expected==="numerics-"+x+"-e")?' selected="selected"':"")+'">Numeric Digits ( exactly '+x+" digit"+((x>1)?"s":"")+" )</option>"}t+="</optgroup>";t+="</select><br />";t+="<small>Only Users/Members will be required to meet this criteria.</small><br />";t+="<small>* Administrators are exempt from this.</small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">Applicable Membership Levels: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';t+='<td colspan="2">';t+='<input type="text" property="levels" value="'+a(B.levels)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels" /><br />';t+="<small>Please use comma-delimited Level #'s: <code>0,1,2,3,4</code> or type: <code>all</code>.</small><br />";t+="<small>This allows you to enable this field - only at specific Membership Levels.</small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">Allow Profile Edits: *</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';t+='<td colspan="2">';t+='<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';t+='<option value="yes"'+((B.editable==="yes")?' selected="selected"':"")+'">Yes ( editable )</option>';t+='<option value="no"'+((B.editable==="no")?' selected="selected"':"")+'">No ( uneditable after registration )</option>';t+='<option value="no-invisible"'+((B.editable==="no-invisible")?' selected="selected"':"")+'">No ( uneditable &amp; totally invisible )</option>';t+="</select><br />";t+="<small>If <code>No</code>, this field will be un-editable after registration.</small><br />";t+="<small>* Administrators are exempt from this.</small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">CSS Classes: ( optional )</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';t+='<td colspan="2">';t+='<input type="text" property="classes" value="'+a(B.classes)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes" /><br />';t+="<small>Example: <code>my-style-1 my-style-2</code></small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">CSS Styles: ( optional )</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';t+='<td colspan="2">';t+='<input type="text" property="styles" value="'+a(B.styles)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles" /><br />';t+="<small>Example: <code>color:#000000; background:#FFFFFF;</code></small>";t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';t+='<td colspan="2">';t+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">Other Attributes: ( optional )</label>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';t+='<td colspan="2">';t+='<input type="text" property="attrs" value="'+a(B.attrs)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs" /><br />';t+='<small>Example: <code>onkeyup="" onblur=""</code></small>';t+="</td>";t+="</tr>";t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"><td colspan="2">&nbsp;</td></tr>';t+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons">';t+='<td align="left">';t+='<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />';t+="</td>";t+='<td align="right">';t+='<input type="button" value="'+((u)?"Update This Field":"Create Registration Field")+'" onclick="'+((u)?"ws_plugin__s2member_customRegFieldUpdate("+A+");":"ws_plugin__s2member_customRegFieldCreate();")+'" />';t+="</td>";t+="</tr>";t+="</tbody>";t+="</table>";t+="<div>";b("body").append(t);tb_show(((u)?"Editing Registration Field":"New Custom Registration Field"),"#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form");b(window).trigger("resize"),b("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form").show()}i.html(z)};var e=function(){b(window).resize(function(){var s,t;s=b(window).width(),t=b(window).height(),s=(s>720)?720:s;b("#TB_ajaxContent").css({width:s-50,height:t-75,margin:0,padding:0})})};var p=function(){var s=l.length,v=0,w,u="",t="o";u+="<tbody>";u+="<tr>";u+="<th>Order</th>";u+="<th>Field Type</th>";u+="<th>Unique ID</th>";u+="<th>Required</th>";u+="<th>Levels</th>";u+="<th>- Tools -</th>";u+="</tr>";if(l.length>0){for(v=0;v<l.length;v++){t=(t==="o")?"e":"o";w=l[v];u+='<tr class="'+a(t)+" ws-plugin--s2member-custom-reg-field-configuration-table-row-"+v+'">';u+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-move-up" href="#" onclick="ws_plugin__s2member_customRegFieldMoveUp('+v+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-move-down" href="#" onclick="ws_plugin__s2member_customRegFieldMoveDown('+v+'); return false;"></a></td>';u+='<td nowrap="nowrap">'+esc_html(g(w.type))+"</td>";u+='<td nowrap="nowrap">'+esc_html(w.id)+"</td>";u+='<td nowrap="nowrap">'+esc_html(w.required)+"</td>";u+='<td nowrap="nowrap">'+esc_html(w.levels)+"</td>";u+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-edit" href="#" onclick="ws_plugin__s2member_customRegFieldEdit('+v+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-delete" href="#" onclick="ws_plugin__s2member_customRegFieldDelete('+v+'); return false;"></a></td>';u+="</tr>"}}else{u+="<tr>";u+='<td colspan="6">No Custom Fields are configured.</td>';u+="</tr>"}u+="</tbody>";o.html(u)};j(),e(),p()})()}b("input#ws-plugin--s2member-ip-restrictions-reset-button").click(function(){var c=b(this);c.val("one moment please ...");b.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(d){alert("s2Member's IP Restriction Logs have all been reset."),c.val("Reset IP Restriction Logs")});return false})}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){b("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var d=b(this),e=d.val();var c=b("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(e==2){c.show()}else{c.hide()}})}else{if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){b("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var e=b(this),f=e.val();var d=b("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var c=b("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(f<=0){d.css("display","none"),c.attr("src",c.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}else{if(f==1){d.css("display",""),c.attr("src",c.attr("src").replace(/\/unchecked\.png$/,"/checked.png"))}else{if(f==2){d.css("display",""),c.attr("src",c.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}}}})}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){b("select#ws-plugin--s2member-level1-term, select#ws-plugin--s2member-level2-term, select#ws-plugin--s2member-level3-term, select#ws-plugin--s2member-level4-term, select#ws-plugin--s2member-modification-term").change(function(){var d=this.id.replace(/^ws-plugin--s2member-(.+?)-term$/g,"$1");var c=(b(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;b("p#ws-plugin--s2member-"+d+"-trial-line").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-trial-then").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-20p-rule").css("display",(c?"none":""));(c)?b("input#ws-plugin--s2member-"+form+"-trial-period").val(0):null;(c)?b("input#ws-plugin--s2member-"+form+"-trial-amount").val("0.00"):null});b("input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps").keyup(function(){if(this.value.match(/[^a-z_0-9,]/)){this.value=b.trim(b.trim(this.value).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase())}});ws_plugin__s2member_paypalButtonGenerate=function(f){var c='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',r="",v={};v.level0='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]); ?>';v.level1='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]); ?>';v.level2='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]); ?>';v.level3='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]); ?>';v.level4='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]); ?>';var o=b("input#ws-plugin--s2member-"+f+"-shortcode");var g=b("textarea#ws-plugin--s2member-"+f+"-button");var k=b("select#ws-plugin--s2member-modification-level");var h=(f==="modification")?k.val().split(":",2)[1]:f.replace(/^level/,"");var l=v["level"+h].replace(/"/g,"");var s=b.trim(b("input#ws-plugin--s2member-"+f+"-desc").val().replace(/"/g,""));var p=b("input#ws-plugin--s2member-"+f+"-trial-amount").val().replace(/[^0-9\.]/g,"");var e=b("input#ws-plugin--s2member-"+f+"-trial-period").val().replace(/[^0-9]/g,"");var j=b("select#ws-plugin--s2member-"+f+"-trial-term").val().replace(/[^A-Z]/g,"");var m=b("input#ws-plugin--s2member-"+f+"-amount").val().replace(/[^0-9\.]/g,"");var u=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var w=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var t=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var d=b.trim(b("input#ws-plugin--s2member-"+f+"-page-style").val().replace(/"/g,""));var i=b("select#ws-plugin--s2member-"+f+"-currency").val().replace(/[^A-Z]/g,"");var n=b.trim(b.trim(b("input#ws-plugin--s2member-"+f+"-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase());e=(t==="BN")?"0":e;p=(!p||isNaN(p)||p<0.01||e<=0)?"0":p;var q=(t==="BN"&&w!=="L")?h+":"+n+":"+u+" "+w:h+":"+n;q=q.replace(/\:+$/g,"");if(p&&(isNaN(p)||p<0)){alert("Oops, a slight problem:\n\nWhen provided, Trial Amount must be >= 0.00");return false}else{if(p&&p>10000){alert("Oops, a slight problem:\n\nMaximum Trial Amount is: 10000.00");return false}else{if(j==="D"&&e>7){alert("Oops, a slight problem:\n\nMaximum Free Days is: 7.\nIf you want to offer more than 7 days free, please choose Weeks or Months from the drop-down.");return false}else{if(j==="W"&&e>52){alert("Oops, a slight problem:\n\nMaximum Free Weeks is: 52.\nIf you want to offer more than 52 weeks free, please choose Months from the drop-down.");return false}else{if(j==="M"&&e>12){alert("Oops, a slight problem:\n\nMaximum Free Months is: 12.\nIf you want to offer more than 12 months free, please choose Years from the drop-down.");return false}else{if(j==="Y"&&e>1){alert("Oops, a slight problem:\n\nMax Trial Period Years is: 1.");return false}else{if(!m||isNaN(m)||m<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(m>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}else{if(!s){alert("Oops, a slight problem:\n\nPlease type a Description for this Button.");return false}}}}}}}}}g.html(g.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(e)<=0)?g.html(g.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(t==="BN")?g.html(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(t==="BN")?g.html(g.val().replace(/ (\<input type\="hidden" name\="(src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(t!=="BN")?g.html(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(t!=="BN")?g.html(g.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;r+='level="'+a(h)+'" ccaps="'+a(n)+'" desc="'+a(s)+'" ps="'+a(d)+'" cc="'+a(i)+'" ns="1" custom="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';r+=' ta="'+a(p)+'" tp="'+a(e)+'" tt="'+a(j)+'" ra="'+a(m)+'" rp="'+a(u)+'" rt="'+a(w)+'" rr="'+a(t)+'"';r+=(f==="modification")?' modify="1"':"";o.val(c.replace(/%%attrs%%/,r));g.html(g.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(s)+'"'));g.html(g.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(q)+'"'));g.html(g.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(d)+'"'));g.html(g.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(i)+'"'));g.html(g.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));g.html(g.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((f==="modification")?"1":"0")+'"'));g.html(g.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(m)+'"'));g.html(g.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+a(t)+'"'));g.html(g.val().replace(/ name\="a1" value\="(.*?)"/,' name="a1" value="'+a(p)+'"'));g.html(g.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+a(e)+'"'));g.html(g.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+a(j)+'"'));g.html(g.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+a(m)+'"'));g.html(g.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+a(u)+'"'));g.html(g.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+a(w)+'"'));b("div#ws-plugin--s2member-"+f+"-button-prev").html(g.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0); \?\>/g,""));(f==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");o.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var q='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',p="";var n=b("input#ws-plugin--s2member-sp-shortcode");var e=b("textarea#ws-plugin--s2member-sp-button");var f=b("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-additional-ids").val()||[];var o=b("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var k=b("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var j=b.trim(b("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var m=b.trim(b("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var d=b("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!f){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}else{if(!k||isNaN(k)||k<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(k>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}else{if(!j){alert("Oops, a slight problem:\n\nPlease type a Description for this Button.");return false}}}}for(var g=0,c=f;g<h.length;g++){if(h[g]&&h[g]!==f){c+=","+h[g]}}var l="sp:"+c+":"+o;p+='ids="'+a(c)+'" exp="'+a(o)+'" desc="'+a(j)+'" ps="'+a(m)+'" cc="'+a(d)+'" ns="1"';p+=' custom="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+a(k)+'" sp="1"';n.val(q.replace(/%%attrs%%/,p));e.html(e.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(j)+'"'));e.html(e.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(l)+'"'));e.html(e.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(m)+'"'));e.html(e.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(d)+'"'));e.html(e.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));e.html(e.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(k)+'"'));b("div#ws-plugin--s2member-sp-button-prev").html(e.val().replace(/\<form/,'<form target="_blank"'));alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");n.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var j=b("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var c=b("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var d=b("p#ws-plugin--s2member-sp-link"),g=b("img#ws-plugin--s2member-sp-link-loading");if(!j){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}for(var e=0,f=j;e<h.length;e++){if(h[e]&&h[e]!==j){f+=","+h[e]}}d.hide(),g.show(),b.post(ajaxurl,{action:"ws_plugin__s2member_sp_access_link_via_ajax",ws_plugin__s2member_sp_access_link_via_ajax:'<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link-via-ajax")); ?>',s2member_sp_access_link_ids:f,s2member_sp_access_link_hours:c},function(i){d.show().html('<a href="'+a(i)+'" target="_blank" rel="external">'+esc_html(i)+"</a>"),g.hide()});return false}}}}}}});
includes/menu-pages/menu-pages-s.js CHANGED
@@ -10,7 +10,7 @@ If not, see: <http://www.gnu.org/licenses/>.
10
  /*
11
  These routines are all specific to this software.
12
  */
13
- jQuery(document).ready (function($)
14
  {
15
  var esc_attr = esc_html = function(str) /* Convert special characters. */
16
  {
@@ -19,24 +19,24 @@ jQuery(document).ready (function($)
19
  /**/
20
  if (location.href.match (/page\=ws-plugin--s2member-mms-options/))
21
  {
22
- $('select#ws-plugin--s2member-mms-registration-file').change (function()
23
  {
24
  if ($ (this).val () === 'wp-signup') /* Expand/collapse relevant options; based on file selection. */
25
  {
26
- $('div#ws-plugin--s2member-mms-registration-support-package-details-wrapper').show (), $ ('div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login').hide (), $ ('div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup').show ();
27
  }
28
  else if ($ (this).val () === 'wp-login') /* Expand/collapse relevant options. */
29
  {
30
- $('div#ws-plugin--s2member-mms-registration-support-package-details-wrapper').hide (), $ ('div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login').show (), $ ('div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup').hide ();
31
  }
32
  /**/
33
- $('div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0')[(($ ('select#ws-plugin--s2member-mms-registration-grants').val () === 'all') ? 'show' : 'hide')] (), $ ('input#ws-plugin--s2member-mms-registration-blogs-level0').val ((($ ('select#ws-plugin--s2member-mms-registration-grants').val () === 'all') ? '1' : '0'));
34
  /**/
35
  }).trigger ('change'); /* Fire on ready too. */
36
  /**/
37
- $('select#ws-plugin--s2member-mms-registration-grants').change (function()
38
  {
39
- $('select#ws-plugin--s2member-mms-registration-file').trigger ('change');
40
  });
41
  }
42
  /**/
@@ -55,7 +55,7 @@ jQuery(document).ready (function($)
55
  var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()';
56
  for (var i = 0, key = ''; i < 56; i++) key += chars.substr (mt_rand (0, chars.length - 1), 1);
57
  /**/
58
- $('input#ws-plugin--s2member-sec-encryption-key').val (key);
59
  /**/
60
  return false;
61
  };
@@ -63,14 +63,14 @@ jQuery(document).ready (function($)
63
  ws_plugin__s2member_enableSecurityKey = function() /* Allow Security Key editing?? */
64
  {
65
  if (confirm ('Edit Key? Are you sure?\nThis could break your installation!\n\n*Note* If you\'ve been testing s2Member, feel free to change this Key before you go live. Just don\'t go live, and then change it. You\'ll have some very unhappy Customers. Data corruption WILL occur!\n\nFor your safety, s2Member keeps a history of the last 10 Keys that you\'ve used. If you get yourself into a real situation, s2Member will let you revert back to a previous Key.'))
66
- $('input#ws-plugin--s2member-sec-encryption-key').attr ('disabled', false);
67
  /**/
68
  return false;
69
  };
70
  /**/
71
  ws_plugin__s2member_securityKeyHistory = function() /* Displays history of Keys. */
72
  {
73
- $('div#ws-plugin--s2member-sec-encryption-key-history').toggle ();
74
  /**/
75
  return false;
76
  };
@@ -100,15 +100,15 @@ jQuery(document).ready (function($)
100
  tr2 = 'tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected';
101
  /**/
102
  if (type.match (/^(text|textarea|checkbox|pre_checkbox)$/))
103
- $(tr1).css ('display', 'none'), $ (tr1).prev ('tr').css ('display', 'none');
104
  else /* Otherwise we display the table row by removing the display property. */
105
- $(tr1).css ('display', ''), $ (tr1).prev ('tr').css ('display', '');
106
  /**/
107
  /**/
108
  if (type.match (/^(select|selects|checkboxes|radios)$/))
109
- $(tr2).css ('display', 'none'), $ (tr2).prev ('tr').css ('display', 'none');
110
  else /* Otherwise we display the table row by removing the display property. */
111
- $(tr2).css ('display', ''), $ (tr2).prev ('tr').css ('display', '');
112
  };
113
  /**/
114
  ws_plugin__s2member_customRegFieldDelete = function(index)
@@ -150,7 +150,7 @@ jQuery(document).ready (function($)
150
  {
151
  var $table = $ ('table#ws-plugin--s2member-custom-reg-field-configuration-tools-form'), field = {};
152
  /**/
153
- $ (':input[property!=""]', $table).each (function() /* Go through each property value. */
154
  {
155
  var $this = $ (this), property = $this.attr ('property'), val = $.trim ($this.val ());
156
  /**/
@@ -164,8 +164,8 @@ jQuery(document).ready (function($)
164
  setTimeout (function() /* A momentary delay here for usability. */
165
  {
166
  var row = 'tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-' + (fields.length - 1);
167
- alert('Field created successfully.\n* Remember to "Save Changes".');
168
- $(row).effect ('highlight', 1000);
169
  }, 500);
170
  }
171
  };
@@ -174,7 +174,7 @@ jQuery(document).ready (function($)
174
  {
175
  var $table = $ ('table#ws-plugin--s2member-custom-reg-field-configuration-tools-form'), field = {};
176
  /**/
177
- $ (':input[property!=""]', $table).each (function() /* Go through each property value. */
178
  {
179
  var $this = $ (this), property = $this.attr ('property'), val = $.trim ($this.val ());
180
  /**/
@@ -186,13 +186,13 @@ jQuery(document).ready (function($)
186
  fields[index] = field, updateFields (), buildTools (), buildTable (), scrollReset ();
187
  /**/
188
  var row = 'tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-' + index;
189
- $(row).effect ('highlight', 1000);
190
  }
191
  };
192
  /**/
193
  ws_plugin__s2member_customRegFieldAdd = function() /* Add new field links. */
194
  {
195
- buildTools(true); /* No need to reset scroll position. */
196
  };
197
  /**/
198
  ws_plugin__s2member_customRegFieldEdit = function(index) /* Edit links. */
@@ -260,7 +260,7 @@ jQuery(document).ready (function($)
260
  field.options = ''; /* Force empty options. */
261
  }
262
  /**/
263
- if (!(field.levels = field.levels.replace (/ /g, '')))
264
  {
265
  errors.push ('Applicable Levels:\nThis is required. Please try again.');
266
  }
@@ -287,7 +287,7 @@ jQuery(document).ready (function($)
287
  /**/
288
  if (errors.length > 0) /* Errors? */
289
  {
290
- alert(errors.join ('\n\n'));
291
  return false;
292
  }
293
  else /* Return. */
@@ -296,7 +296,7 @@ jQuery(document).ready (function($)
296
  /**/
297
  var updateFields = function() /* Update hidden input value. */
298
  {
299
- $fields.val (((fields.length > 0) ? $.JSON.stringify (fields) : ''));
300
  };
301
  /**/
302
  var fieldId2Var = function(fieldId) /* Convert ids to variables. */
@@ -352,14 +352,14 @@ jQuery(document).ready (function($)
352
  form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';
353
  form += '<td colspan="2">';
354
  form += '<select property="type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';
355
- form += '<option value="text"' + ((field.type === 'text') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('text')) + '</option>';
356
- form += '<option value="textarea"' + ((field.type === 'textarea') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('textarea')) + '</option>';
357
- form += '<option value="select"' + ((field.type === 'select') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('select')) + '</option>';
358
- form += '<option value="selects"' + ((field.type === 'selects') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('selects')) + '</option>';
359
- form += '<option value="checkbox"' + ((field.type === 'checkbox') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('checkbox')) + '</option>';
360
- form += '<option value="pre_checkbox"' + ((field.type === 'pre_checkbox') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('pre_checkbox')) + '</option>';
361
- form += '<option value="checkboxes"' + ((field.type === 'checkboxes') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('checkboxes')) + '</option>';
362
- form += '<option value="radios"' + ((field.type === 'radios') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('radios')) + '</option>';
363
  form += '</select>';
364
  form += '</td>';
365
  form += '</tr>';
@@ -406,24 +406,24 @@ jQuery(document).ready (function($)
406
  form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';
407
  form += '<td colspan="2">';
408
  form += '<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';
409
- form += '<option value="yes"' + ((field.required === 'yes') ? ' selected="selected"' : '') + '">Yes ( required )</option>';
410
- form += '<option value="no"' + ((field.required === 'no') ? ' selected="selected"' : '') + '">No ( optional )</option>';
411
  form += '</select><br />';
412
  form += '<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />';
413
  form += '<small>* Administrators are exempt from this requirement.</small>';
414
  form += '</td>';
415
  form += '</tr>';
416
  /**/
417
- form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"' + ((field.type.match (/^(text|textarea|checkbox|pre_checkbox)$/)) ? ' style="display:none;"' : '') + '><td colspan="2">&nbsp;</td></tr>';
418
  /**/
419
- form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"' + ((field.type.match (/^(text|textarea|checkbox|pre_checkbox)$/)) ? ' style="display:none;"' : '') + '>';
420
  form += '<td colspan="2">';
421
  form += '<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * ( one option per line )</label><br />';
422
  form += '<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>';
423
  form += '</td>';
424
  form += '</tr>';
425
  /**/
426
- form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"' + ((field.type.match (/^(text|textarea|checkbox|pre_checkbox)$/)) ? ' style="display:none;"' : '') + '>';
427
  form += '<td colspan="2">';
428
  form += '<textarea property="options" rows="3" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">' + esc_html (field.options) + '</textarea><br />';
429
  form += 'Here is a quick example:<br />';
@@ -434,36 +434,36 @@ jQuery(document).ready (function($)
434
  form += '</td>';
435
  form += '</tr>';
436
  /**/
437
- form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"' + ((field.type.match (/^(select|selects|checkboxes|radios)$/)) ? ' style="display:none;"' : '') + '><td colspan="2">&nbsp;</td></tr>';
438
  /**/
439
- form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"' + ((field.type.match (/^(select|selects|checkboxes|radios)$/)) ? ' style="display:none;"' : '') + '>';
440
  form += '<td colspan="2">';
441
  form += '<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>';
442
  form += '</td>';
443
  form += '</tr>';
444
  /**/
445
- form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"' + ((field.type.match (/^(select|selects|checkboxes|radios)$/)) ? ' style="display:none;"' : '') + '>';
446
  form += '<td colspan="2">';
447
  form += '<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">';
448
  /**/
449
- form += '<option value=""' + ((field.expected === '') ? ' selected="selected"' : '') + '">Anything Goes</option>';
450
  form += '<option disabled="disabled"></option>';
451
  /**/
452
  form += '<optgroup label="Specific Input Types">';
453
- form += '<option value="numeric-wp-commas"' + ((field.expected === 'numeric-wp-commas') ? ' selected="selected"' : '') + '">Numeric ( with or without decimals, commas allowed )</option>';
454
- form += '<option value="numeric"' + ((field.expected === 'numeric') ? ' selected="selected"' : '') + '">Numeric ( with or without decimals, no commas )</option>';
455
- form += '<option value="integer"' + ((field.expected === 'integer') ? ' selected="selected"' : '') + '">Integer ( whole number, without any decimals )</option>';
456
- form += '<option value="integer-gt-0"' + ((field.expected === 'integer-gt-0') ? ' selected="selected"' : '') + '">Integer > 0 ( whole number, no decimals, greater than 0 )</option>';
457
- form += '<option value="float"' + ((field.expected === 'float') ? ' selected="selected"' : '') + '">Float ( floating point number, decimals required )</option>';
458
- form += '<option value="float-gt-0"' + ((field.expected === 'float-gt-0') ? ' selected="selected"' : '') + '">Float > 0 ( floating point number, decimals required, greater than 0 )</option>';
459
- form += '<option value="date"' + ((field.expected === 'date') ? ' selected="selected"' : '') + '">Date ( required date format: dd/mm/yyyy )</option>';
460
- form += '<option value="email"' + ((field.expected === 'email') ? ' selected="selected"' : '') + '">Email ( require valid email )</option>';
461
- form += '<option value="url"' + ((field.expected === 'url') ? ' selected="selected"' : '') + '">Full URL ( starting with http or https )</option>';
462
- form += '<option value="domain"' + ((field.expected === 'domain') ? ' selected="selected"' : '') + '">Domain Name ( domain name only, without http )</option>';
463
- form += '<option value="phone"' + ((field.expected === 'phone') ? ' selected="selected"' : '') + '">Phone # ( 10 digits w/possible hyphens,spaces,brackets )</option>';
464
- form += '<option value="uszip"' + ((field.expected === 'uszip') ? ' selected="selected"' : '') + '">US Zipcode ( 5-9 digits w/possible hyphen )</option>';
465
- form += '<option value="cazip"' + ((field.expected === 'cazip') ? ' selected="selected"' : '') + '">Canadian Zipcode ( 6 alpha-numerics w/possible space )</option>';
466
- form += '<option value="uczip"' + ((field.expected === 'uczip') ? ' selected="selected"' : '') + '">US/Canadian Zipcode ( either a US or Canadian zipcode )</option>';
467
  form += '</optgroup>';
468
  /**/
469
  form += '<option disabled="disabled"></option>';
@@ -471,8 +471,8 @@ jQuery(document).ready (function($)
471
  form += '<optgroup label="Any Character Combination">';
472
  for (i = 1; i <= 25; i++)
473
  {
474
- form += '<option value="any-' + i + '"' + ((field.expected === 'any-' + i) ? ' selected="selected"' : '') + '">Any Character Combination ( ' + i + ' character minimum )</option>';
475
- form += '<option value="any-' + i + '-e"' + ((field.expected === 'any-' + i + '-e') ? ' selected="selected"' : '') + '">Any Character Combination ( exactly ' + i + ' character' + ((i > 1) ? 's' : '') + ' )</option>';
476
  }
477
  form += '</optgroup>';
478
  /**/
@@ -481,8 +481,8 @@ jQuery(document).ready (function($)
481
  form += '<optgroup label="Alphanumerics, Spaces &amp; Punctuation Only">';
482
  for (i = 1; i <= 25; i++)
483
  {
484
- form += '<option value="alphanumerics-spaces-punctuation-' + i + '"' + ((field.expected === 'alphanumerics-spaces-punctuation-' + i) ? ' selected="selected"' : '') + '">Alphanumerics, Spaces &amp; Punctuation ( ' + i + ' character minimum )</option>';
485
- form += '<option value="alphanumerics-spaces-punctuation-' + i + '-e"' + ((field.expected === 'alphanumerics-spaces-punctuation-' + i + '-e') ? ' selected="selected"' : '') + '">Alphanumerics, Spaces &amp; Punctuation ( exactly ' + i + ' character' + ((i > 1) ? 's' : '') + ' )</option>';
486
  }
487
  form += '</optgroup>';
488
  /**/
@@ -491,8 +491,8 @@ jQuery(document).ready (function($)
491
  form += '<optgroup label="Alphanumerics &amp; Spaces Only">';
492
  for (i = 1; i <= 25; i++)
493
  {
494
- form += '<option value="alphanumerics-spaces-' + i + '"' + ((field.expected === 'alphanumerics-spaces-' + i) ? ' selected="selected"' : '') + '">Alphanumerics &amp; Spaces ( ' + i + ' character minimum )</option>';
495
- form += '<option value="alphanumerics-spaces-' + i + '-e"' + ((field.expected === 'alphanumerics-spaces-' + i + '-e') ? ' selected="selected"' : '') + '">Alphanumerics &amp; Spaces ( exactly ' + i + ' character' + ((i > 1) ? 's' : '') + ' )</option>';
496
  }
497
  form += '</optgroup>';
498
  /**/
@@ -501,8 +501,8 @@ jQuery(document).ready (function($)
501
  form += '<optgroup label="Alphanumerics &amp; Punctuation Only">';
502
  for (i = 1; i <= 25; i++)
503
  {
504
- form += '<option value="alphanumerics-punctuation-' + i + '"' + ((field.expected === 'alphanumerics-punctuation-' + i) ? ' selected="selected"' : '') + '">Alphanumerics &amp; Punctuation ( ' + i + ' character minimum )</option>';
505
- form += '<option value="alphanumerics-punctuation-' + i + '-e"' + ((field.expected === 'alphanumerics-punctuation-' + i + '-e') ? ' selected="selected"' : '') + '">Alphanumerics &amp; Punctuation ( exactly ' + i + ' character' + ((i > 1) ? 's' : '') + ' )</option>';
506
  }
507
  form += '</optgroup>';
508
  /**/
@@ -511,8 +511,8 @@ jQuery(document).ready (function($)
511
  form += '<optgroup label="Alphanumerics Only">';
512
  for (i = 1; i <= 25; i++)
513
  {
514
- form += '<option value="alphanumerics-' + i + '"' + ((field.expected === 'alphanumerics-' + i) ? ' selected="selected"' : '') + '">Alphanumerics ( ' + i + ' character minimum )</option>';
515
- form += '<option value="alphanumerics-' + i + '-e"' + ((field.expected === 'alphanumerics-' + i + '-e') ? ' selected="selected"' : '') + '">Alphanumerics ( exactly ' + i + ' character' + ((i > 1) ? 's' : '') + ' )</option>';
516
  }
517
  form += '</optgroup>';
518
  /**/
@@ -521,8 +521,8 @@ jQuery(document).ready (function($)
521
  form += '<optgroup label="Alphabetics Only">';
522
  for (i = 1; i <= 25; i++)
523
  {
524
- form += '<option value="alphabetics-' + i + '"' + ((field.expected === 'alphabetics-' + i) ? ' selected="selected"' : '') + '">Alphabetics ( ' + i + ' character minimum )</option>';
525
- form += '<option value="alphabetics-' + i + '-e"' + ((field.expected === 'alphabetics-' + i + '-e') ? ' selected="selected"' : '') + '">Alphabetics ( exactly ' + i + ' character' + ((i > 1) ? 's' : '') + ' )</option>';
526
  }
527
  form += '</optgroup>';
528
  /**/
@@ -531,8 +531,8 @@ jQuery(document).ready (function($)
531
  form += '<optgroup label="Numeric Digits Only">';
532
  for (i = 1; i <= 25; i++)
533
  {
534
- form += '<option value="numerics-' + i + '"' + ((field.expected === 'numerics-' + i) ? ' selected="selected"' : '') + '">Numeric Digits ( ' + i + ' digit minimum )</option>';
535
- form += '<option value="numerics-' + i + '-e"' + ((field.expected === 'numerics-' + i + '-e') ? ' selected="selected"' : '') + '">Numeric Digits ( exactly ' + i + ' digit' + ((i > 1) ? 's' : '') + ' )</option>';
536
  }
537
  form += '</optgroup>';
538
  /**/
@@ -569,9 +569,9 @@ jQuery(document).ready (function($)
569
  form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';
570
  form += '<td colspan="2">';
571
  form += '<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';
572
- form += '<option value="yes"' + ((field.editable === 'yes') ? ' selected="selected"' : '') + '">Yes ( editable )</option>';
573
- form += '<option value="no"' + ((field.editable === 'no') ? ' selected="selected"' : '') + '">No ( uneditable after registration )</option>';
574
- form += '<option value="no-invisible"' + ((field.editable === 'no-invisible') ? ' selected="selected"' : '') + '">No ( uneditable &amp; totally invisible )</option>';
575
  form += '</select><br />';
576
  form += '<small>If <code>No</code>, this field will be un-editable after registration.</small><br />';
577
  form += '<small>* Administrators are exempt from this.</small>';
@@ -630,7 +630,7 @@ jQuery(document).ready (function($)
630
  form += '<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />';
631
  form += '</td>';
632
  form += '<td align="right">';
633
- form += '<input type="button" value="' + ((editing) ? 'Update This Field' : 'Create Registration Field') + '" onclick="' + ((editing) ? 'ws_plugin__s2member_customRegFieldUpdate(' + index + ');' : 'ws_plugin__s2member_customRegFieldCreate();') + '" />';
634
  form += '</td>';
635
  form += '</tr>';
636
  /**/
@@ -639,9 +639,9 @@ jQuery(document).ready (function($)
639
  /**/
640
  form += '<div>';
641
  /**/
642
- $('body').append (form);
643
- tb_show (((editing) ? 'Editing Registration Field' : 'New Custom Registration Field'), '#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form');
644
- $(window).trigger ('resize'), $ ('table#ws-plugin--s2member-custom-reg-field-configuration-tools-form').show ();
645
  }
646
  /**/
647
  $tools.html (html);
@@ -649,11 +649,11 @@ jQuery(document).ready (function($)
649
  /**/
650
  var attachTBResizer = function() /* Resize inline #TB_ajaxContent. */
651
  {
652
- $(window).resize (function()
653
  {
654
  var w, h; /* Initialize width/height vars. */
655
  w = $ (window).width (), h = $ (window).height (), w = (w > 720) ? 720 : w;
656
- $('#TB_ajaxContent').css ({'width': w - 50, 'height': h - 75, 'margin': 0, 'padding': 0});
657
  });
658
  };
659
  /**/
@@ -706,14 +706,14 @@ jQuery(document).ready (function($)
706
  }) ();
707
  }
708
  /**/
709
- $('input#ws-plugin--s2member-ip-restrictions-reset-button').click (function()
710
  {
711
  var $this = $ (this); /* Save $(this) into $this. */
712
  $this.val ('one moment please ...'); /* Indicate loading status ( please wait ). */
713
  /**/
714
  $.post (ajaxurl, {action: 'ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax', ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax: '<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'}, function(response)
715
  {
716
- alert('s2Member\'s IP Restriction Logs have all been reset.'), $this.val ('Reset IP Restriction Logs');
717
  });
718
  /**/
719
  return false;
@@ -722,7 +722,7 @@ jQuery(document).ready (function($)
722
  /**/
723
  else if (location.href.match (/page\=ws-plugin--s2member-paypal-ops/))
724
  {
725
- $('select#ws-plugin--s2member-auto-eot-system-enabled').change (function()
726
  {
727
  var $this = $ (this), val = $this.val ();
728
  var $viaCron = $ ('p#ws-plugin--s2member-auto-eot-system-enabled-via-cron');
@@ -736,7 +736,7 @@ jQuery(document).ready (function($)
736
  /**/
737
  else if (location.href.match (/page\=ws-plugin--s2member-els-ops/))
738
  {
739
- $('select#ws-plugin--s2member-custom-reg-opt-in').change (function()
740
  {
741
  var $this = $ (this), val = $this.val ();
742
  var $rows = $ ('tr.ws-plugin--s2member-custom-reg-opt-in-label-row');
@@ -755,21 +755,21 @@ jQuery(document).ready (function($)
755
  /**/
756
  else if (location.href.match (/page\=ws-plugin--s2member-paypal-buttons/))
757
  {
758
- $('select#ws-plugin--s2member-level1-term, select#ws-plugin--s2member-level2-term, select#ws-plugin--s2member-level3-term, select#ws-plugin--s2member-level4-term, select#ws-plugin--s2member-modification-term').change (function()
759
  {
760
  var button = this.id.replace (/^ws-plugin--s2member-(.+?)-term$/g, '$1');
761
  /**/
762
  var trialDisabled = ($ (this).val ().split ('-')[2].replace (/[^0-1BN]/g, '') === 'BN') ? 1 : 0;
763
  /**/
764
- $('p#ws-plugin--s2member-' + button + '-trial-line').css ('display', (trialDisabled ? 'none' : ''));
765
- $('span#ws-plugin--s2member-' + button + '-trial-then').css ('display', (trialDisabled ? 'none' : ''));
766
- $('span#ws-plugin--s2member-' + button + '-20p-rule').css ('display', (trialDisabled ? 'none' : ''));
767
  /**/
768
  (trialDisabled) ? $ ('input#ws-plugin--s2member-' + form + '-trial-period').val (0) : null;
769
  (trialDisabled) ? $ ('input#ws-plugin--s2member-' + form + '-trial-amount').val ('0.00') : null;
770
  });
771
  /**/
772
- $('input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps').keyup (function()
773
  {
774
  if (this.value.match (/[^a-z_0-9,]/)) /* Only if there is a problem; because this causes interruption. */
775
  this.value = $.trim ($.trim (this.value).replace (/[ \-]/g, '_').replace (/[^A-Z_0-9,]/gi, '').toLowerCase ());
@@ -814,47 +814,47 @@ jQuery(document).ready (function($)
814
  /**/
815
  if (trialAmount && (isNaN (trialAmount) || trialAmount < 0.00))
816
  {
817
- alert('Oops, a slight problem:\n\nWhen provided, Trial Amount must be >= 0.00');
818
  return false;
819
  }
820
  else if (trialAmount && trialAmount > 10000.00) /* $10,000.00 maximum. */
821
  {
822
- alert('Oops, a slight problem:\n\nMaximum Trial Amount is: 10000.00');
823
  return false;
824
  }
825
  else if (trialTerm === 'D' && trialPeriod > 7) /* Some validation on the Trial Period. Max days: 7. */
826
  {
827
- alert('Oops, a slight problem:\n\nMaximum Free Days is: 7.\nIf you want to offer more than 7 days free, please choose Weeks or Months from the drop-down.');
828
  return false;
829
  }
830
  else if (trialTerm === 'W' && trialPeriod > 52) /* Some validation on the Trial Period. 52 max. */
831
  {
832
- alert('Oops, a slight problem:\n\nMaximum Free Weeks is: 52.\nIf you want to offer more than 52 weeks free, please choose Months from the drop-down.');
833
  return false;
834
  }
835
  else if (trialTerm === 'M' && trialPeriod > 12) /* Some validation on the Trial Period. 12 max. */
836
  {
837
- alert('Oops, a slight problem:\n\nMaximum Free Months is: 12.\nIf you want to offer more than 12 months free, please choose Years from the drop-down.');
838
  return false;
839
  }
840
  else if (trialTerm === 'Y' && trialPeriod > 1) /* 1 year max. */
841
  {
842
- alert('Oops, a slight problem:\n\nMax Trial Period Years is: 1.');
843
  return false;
844
  }
845
  else if (!regAmount || isNaN (regAmount) || regAmount < 0.01)
846
  {
847
- alert('Oops, a slight problem:\n\nAmount must be >= 0.01');
848
  return false;
849
  }
850
  else if (regAmount > 10000.00) /* $10,000.00 maximum. */
851
  {
852
- alert('Oops, a slight problem:\n\nMaximum amount is: 10000.00');
853
  return false;
854
  }
855
  else if (!desc) /* Each Button should have a Description. */
856
  {
857
- alert('Oops, a slight problem:\n\nPlease type a Description for this Button.');
858
  return false;
859
  }
860
  /**/
@@ -875,7 +875,7 @@ jQuery(document).ready (function($)
875
  code.html (code.val ().replace (/ name\="page_style" value\="(.*?)"/, ' name="page_style" value="' + esc_attr (pageStyle) + '"'));
876
  code.html (code.val ().replace (/ name\="currency_code" value\="(.*?)"/, ' name="currency_code" value="' + esc_attr (currencyCode) + '"'));
877
  code.html (code.val ().replace (/ name\="custom" value\="(.*?)"/, ' name="custom" value="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));
878
- code.html (code.val ().replace (/ name\="modify" value\="(.*?)"/, ' name="modify" value="' + ((button === 'modification') ? '1' : '0') + '"'));
879
  code.html (code.val ().replace (/ name\="amount" value\="(.*?)"/, ' name="amount" value="' + esc_attr (regAmount) + '"'));
880
  code.html (code.val ().replace (/ name\="src" value\="(.*?)"/, ' name="src" value="' + esc_attr (regRecur) + '"'));
881
  code.html (code.val ().replace (/ name\="a1" value\="(.*?)"/, ' name="a1" value="' + esc_attr (trialAmount) + '"'));
@@ -885,7 +885,7 @@ jQuery(document).ready (function($)
885
  code.html (code.val ().replace (/ name\="p3" value\="(.*?)"/, ' name="p3" value="' + esc_attr (regPeriod) + '"'));
886
  code.html (code.val ().replace (/ name\="t3" value\="(.*?)"/, ' name="t3" value="' + esc_attr (regTerm) + '"'));
887
  /**/
888
- $('div#ws-plugin--s2member-' + button + '-button-prev').html (code.val ().replace (/\<form/, '<form target="_blank"').replace (/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0); \?\>/g, ''));
889
  /**/
890
  (button === 'modification') ? alert ('Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate.') : alert ('Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.');
891
  /**/
@@ -914,22 +914,22 @@ jQuery(document).ready (function($)
914
  /**/
915
  if (!leading) /* Must have a Leading Post/Page ID to work with. Otherwise, Link generation will fail. */
916
  {
917
- alert('Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it\'s because you\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.');
918
  return false;
919
  }
920
  else if (!regAmount || isNaN (regAmount) || regAmount < 0.01)
921
  {
922
- alert('Oops, a slight problem:\n\nAmount must be >= 0.01');
923
  return false;
924
  }
925
  else if (regAmount > 10000.00) /* $10,000.00 maximum. */
926
  {
927
- alert('Oops, a slight problem:\n\nMaximum amount is: 10000.00');
928
  return false;
929
  }
930
  else if (!desc) /* Each Button should have a Description. */
931
  {
932
- alert('Oops, a slight problem:\n\nPlease type a Description for this Button.');
933
  return false;
934
  }
935
  /**/
@@ -950,9 +950,9 @@ jQuery(document).ready (function($)
950
  code.html (code.val ().replace (/ name\="custom" value\="(.*?)"/, ' name="custom" value="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));
951
  code.html (code.val ().replace (/ name\="amount" value\="(.*?)"/, ' name="amount" value="' + esc_attr (regAmount) + '"'));
952
  /**/
953
- $('div#ws-plugin--s2member-sp-button-prev').html (code.val ().replace (/\<form/, '<form target="_blank"'));
954
  /**/
955
- alert('Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.');
956
  /**/
957
  shortCode.each (function() /* Focus and select the recommended Shortcode. */
958
  {
@@ -971,7 +971,7 @@ jQuery(document).ready (function($)
971
  /**/
972
  if (!leading) /* Must have a Leading Post/Page ID to work with. Otherwise, Link generation will fail. */
973
  {
974
- alert('Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it\'s because you\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.');
975
  return false;
976
  }
977
  /**/
10
  /*
11
  These routines are all specific to this software.
12
  */
13
+ jQuery (document).ready (function($)
14
  {
15
  var esc_attr = esc_html = function(str) /* Convert special characters. */
16
  {
19
  /**/
20
  if (location.href.match (/page\=ws-plugin--s2member-mms-options/))
21
  {
22
+ $ ('select#ws-plugin--s2member-mms-registration-file').change (function()
23
  {
24
  if ($ (this).val () === 'wp-signup') /* Expand/collapse relevant options; based on file selection. */
25
  {
26
+ $ ('div#ws-plugin--s2member-mms-registration-support-package-details-wrapper').show (), $ ('div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login').hide (), $ ('div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup').show ();
27
  }
28
  else if ($ (this).val () === 'wp-login') /* Expand/collapse relevant options. */
29
  {
30
+ $ ('div#ws-plugin--s2member-mms-registration-support-package-details-wrapper').hide (), $ ('div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login').show (), $ ('div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup').hide ();
31
  }
32
  /**/
33
+ $ ('div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0')[ ( ($ ('select#ws-plugin--s2member-mms-registration-grants').val () === 'all') ? 'show' : 'hide')] (), $ ('input#ws-plugin--s2member-mms-registration-blogs-level0').val ( ( ($ ('select#ws-plugin--s2member-mms-registration-grants').val () === 'all') ? '1' : '0'));
34
  /**/
35
  }).trigger ('change'); /* Fire on ready too. */
36
  /**/
37
+ $ ('select#ws-plugin--s2member-mms-registration-grants').change (function()
38
  {
39
+ $ ('select#ws-plugin--s2member-mms-registration-file').trigger ('change');
40
  });
41
  }
42
  /**/
55
  var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()';
56
  for (var i = 0, key = ''; i < 56; i++) key += chars.substr (mt_rand (0, chars.length - 1), 1);
57
  /**/
58
+ $ ('input#ws-plugin--s2member-sec-encryption-key').val (key);
59
  /**/
60
  return false;
61
  };
63
  ws_plugin__s2member_enableSecurityKey = function() /* Allow Security Key editing?? */
64
  {
65
  if (confirm ('Edit Key? Are you sure?\nThis could break your installation!\n\n*Note* If you\'ve been testing s2Member, feel free to change this Key before you go live. Just don\'t go live, and then change it. You\'ll have some very unhappy Customers. Data corruption WILL occur!\n\nFor your safety, s2Member keeps a history of the last 10 Keys that you\'ve used. If you get yourself into a real situation, s2Member will let you revert back to a previous Key.'))
66
+ $ ('input#ws-plugin--s2member-sec-encryption-key').attr ('disabled', false);
67
  /**/
68
  return false;
69
  };
70
  /**/
71
  ws_plugin__s2member_securityKeyHistory = function() /* Displays history of Keys. */
72
  {
73
+ $ ('div#ws-plugin--s2member-sec-encryption-key-history').toggle ();
74
  /**/
75
  return false;
76
  };
100
  tr2 = 'tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected';
101
  /**/
102
  if (type.match (/^(text|textarea|checkbox|pre_checkbox)$/))
103
+ $ (tr1).css ('display', 'none'), $ (tr1).prev ('tr').css ('display', 'none');
104
  else /* Otherwise we display the table row by removing the display property. */
105
+ $ (tr1).css ('display', ''), $ (tr1).prev ('tr').css ('display', '');
106
  /**/
107
  /**/
108
  if (type.match (/^(select|selects|checkboxes|radios)$/))
109
+ $ (tr2).css ('display', 'none'), $ (tr2).prev ('tr').css ('display', 'none');
110
  else /* Otherwise we display the table row by removing the display property. */
111
+ $ (tr2).css ('display', ''), $ (tr2).prev ('tr').css ('display', '');
112
  };
113
  /**/
114
  ws_plugin__s2member_customRegFieldDelete = function(index)
150
  {
151
  var $table = $ ('table#ws-plugin--s2member-custom-reg-field-configuration-tools-form'), field = {};
152
  /**/
153
+ $ (':input[property]', $table).each (function() /* Go through each property value. */
154
  {
155
  var $this = $ (this), property = $this.attr ('property'), val = $.trim ($this.val ());
156
  /**/
164
  setTimeout (function() /* A momentary delay here for usability. */
165
  {
166
  var row = 'tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-' + (fields.length - 1);
167
+ alert ('Field created successfully.\n* Remember to "Save Changes".');
168
+ $ (row).effect ('highlight', 1000);
169
  }, 500);
170
  }
171
  };
174
  {
175
  var $table = $ ('table#ws-plugin--s2member-custom-reg-field-configuration-tools-form'), field = {};
176
  /**/
177
+ $ (':input[property]', $table).each (function() /* Go through each property value. */
178
  {
179
  var $this = $ (this), property = $this.attr ('property'), val = $.trim ($this.val ());
180
  /**/
186
  fields[index] = field, updateFields (), buildTools (), buildTable (), scrollReset ();
187
  /**/
188
  var row = 'tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-' + index;
189
+ $ (row).effect ('highlight', 1000);
190
  }
191
  };
192
  /**/
193
  ws_plugin__s2member_customRegFieldAdd = function() /* Add new field links. */
194
  {
195
+ buildTools (true); /* No need to reset scroll position. */
196
  };
197
  /**/
198
  ws_plugin__s2member_customRegFieldEdit = function(index) /* Edit links. */
260
  field.options = ''; /* Force empty options. */
261
  }
262
  /**/
263
+ if (! (field.levels = field.levels.replace (/ /g, '')))
264
  {
265
  errors.push ('Applicable Levels:\nThis is required. Please try again.');
266
  }
287
  /**/
288
  if (errors.length > 0) /* Errors? */
289
  {
290
+ alert (errors.join ('\n\n'));
291
  return false;
292
  }
293
  else /* Return. */
296
  /**/
297
  var updateFields = function() /* Update hidden input value. */
298
  {
299
+ $fields.val ( ( (fields.length > 0) ? $.JSON.stringify (fields) : ''));
300
  };
301
  /**/
302
  var fieldId2Var = function(fieldId) /* Convert ids to variables. */
352
  form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';
353
  form += '<td colspan="2">';
354
  form += '<select property="type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';
355
+ form += '<option value="text"' + ( (field.type === 'text') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('text')) + '</option>';
356
+ form += '<option value="textarea"' + ( (field.type === 'textarea') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('textarea')) + '</option>';
357
+ form += '<option value="select"' + ( (field.type === 'select') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('select')) + '</option>';
358
+ form += '<option value="selects"' + ( (field.type === 'selects') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('selects')) + '</option>';
359
+ form += '<option value="checkbox"' + ( (field.type === 'checkbox') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('checkbox')) + '</option>';
360
+ form += '<option value="pre_checkbox"' + ( (field.type === 'pre_checkbox') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('pre_checkbox')) + '</option>';
361
+ form += '<option value="checkboxes"' + ( (field.type === 'checkboxes') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('checkboxes')) + '</option>';
362
+ form += '<option value="radios"' + ( (field.type === 'radios') ? ' selected="selected"' : '') + '">' + esc_html (fieldTypeDesc ('radios')) + '</option>';
363
  form += '</select>';
364
  form += '</td>';
365
  form += '</tr>';
406
  form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';
407
  form += '<td colspan="2">';
408
  form += '<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';
409
+ form += '<option value="yes"' + ( (field.required === 'yes') ? ' selected="selected"' : '') + '">Yes ( required )</option>';
410
+ form += '<option value="no"' + ( (field.required === 'no') ? ' selected="selected"' : '') + '">No ( optional )</option>';
411
  form += '</select><br />';
412
  form += '<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />';
413
  form += '<small>* Administrators are exempt from this requirement.</small>';
414
  form += '</td>';
415
  form += '</tr>';
416
  /**/
417
+ form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"' + ( (field.type.match (/^(text|textarea|checkbox|pre_checkbox)$/)) ? ' style="display:none;"' : '') + '><td colspan="2">&nbsp;</td></tr>';
418
  /**/
419
+ form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"' + ( (field.type.match (/^(text|textarea|checkbox|pre_checkbox)$/)) ? ' style="display:none;"' : '') + '>';
420
  form += '<td colspan="2">';
421
  form += '<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * ( one option per line )</label><br />';
422
  form += '<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>';
423
  form += '</td>';
424
  form += '</tr>';
425
  /**/
426
+ form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"' + ( (field.type.match (/^(text|textarea|checkbox|pre_checkbox)$/)) ? ' style="display:none;"' : '') + '>';
427
  form += '<td colspan="2">';
428
  form += '<textarea property="options" rows="3" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">' + esc_html (field.options) + '</textarea><br />';
429
  form += 'Here is a quick example:<br />';
434
  form += '</td>';
435
  form += '</tr>';
436
  /**/
437
+ form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer"' + ( (field.type.match (/^(select|selects|checkboxes|radios)$/)) ? ' style="display:none;"' : '') + '><td colspan="2">&nbsp;</td></tr>';
438
  /**/
439
+ form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"' + ( (field.type.match (/^(select|selects|checkboxes|radios)$/)) ? ' style="display:none;"' : '') + '>';
440
  form += '<td colspan="2">';
441
  form += '<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>';
442
  form += '</td>';
443
  form += '</tr>';
444
  /**/
445
+ form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"' + ( (field.type.match (/^(select|selects|checkboxes|radios)$/)) ? ' style="display:none;"' : '') + '>';
446
  form += '<td colspan="2">';
447
  form += '<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">';
448
  /**/
449
+ form += '<option value=""' + ( (field.expected === '') ? ' selected="selected"' : '') + '">Anything Goes</option>';
450
  form += '<option disabled="disabled"></option>';
451
  /**/
452
  form += '<optgroup label="Specific Input Types">';
453
+ form += '<option value="numeric-wp-commas"' + ( (field.expected === 'numeric-wp-commas') ? ' selected="selected"' : '') + '">Numeric ( with or without decimals, commas allowed )</option>';
454
+ form += '<option value="numeric"' + ( (field.expected === 'numeric') ? ' selected="selected"' : '') + '">Numeric ( with or without decimals, no commas )</option>';
455
+ form += '<option value="integer"' + ( (field.expected === 'integer') ? ' selected="selected"' : '') + '">Integer ( whole number, without any decimals )</option>';
456
+ form += '<option value="integer-gt-0"' + ( (field.expected === 'integer-gt-0') ? ' selected="selected"' : '') + '">Integer > 0 ( whole number, no decimals, greater than 0 )</option>';
457
+ form += '<option value="float"' + ( (field.expected === 'float') ? ' selected="selected"' : '') + '">Float ( floating point number, decimals required )</option>';
458
+ form += '<option value="float-gt-0"' + ( (field.expected === 'float-gt-0') ? ' selected="selected"' : '') + '">Float > 0 ( floating point number, decimals required, greater than 0 )</option>';
459
+ form += '<option value="date"' + ( (field.expected === 'date') ? ' selected="selected"' : '') + '">Date ( required date format: dd/mm/yyyy )</option>';
460
+ form += '<option value="email"' + ( (field.expected === 'email') ? ' selected="selected"' : '') + '">Email ( require valid email )</option>';
461
+ form += '<option value="url"' + ( (field.expected === 'url') ? ' selected="selected"' : '') + '">Full URL ( starting with http or https )</option>';
462
+ form += '<option value="domain"' + ( (field.expected === 'domain') ? ' selected="selected"' : '') + '">Domain Name ( domain name only, without http )</option>';
463
+ form += '<option value="phone"' + ( (field.expected === 'phone') ? ' selected="selected"' : '') + '">Phone # ( 10 digits w/possible hyphens,spaces,brackets )</option>';
464
+ form += '<option value="uszip"' + ( (field.expected === 'uszip') ? ' selected="selected"' : '') + '">US Zipcode ( 5-9 digits w/possible hyphen )</option>';
465
+ form += '<option value="cazip"' + ( (field.expected === 'cazip') ? ' selected="selected"' : '') + '">Canadian Zipcode ( 6 alpha-numerics w/possible space )</option>';
466
+ form += '<option value="uczip"' + ( (field.expected === 'uczip') ? ' selected="selected"' : '') + '">US/Canadian Zipcode ( either a US or Canadian zipcode )</option>';
467
  form += '</optgroup>';
468
  /**/
469
  form += '<option disabled="disabled"></option>';
471
  form += '<optgroup label="Any Character Combination">';
472
  for (i = 1; i <= 25; i++)
473
  {
474
+ form += '<option value="any-' + i + '"' + ( (field.expected === 'any-' + i) ? ' selected="selected"' : '') + '">Any Character Combination ( ' + i + ' character minimum )</option>';
475
+ form += '<option value="any-' + i + '-e"' + ( (field.expected === 'any-' + i + '-e') ? ' selected="selected"' : '') + '">Any Character Combination ( exactly ' + i + ' character' + ( (i > 1) ? 's' : '') + ' )</option>';
476
  }
477
  form += '</optgroup>';
478
  /**/
481
  form += '<optgroup label="Alphanumerics, Spaces &amp; Punctuation Only">';
482
  for (i = 1; i <= 25; i++)
483
  {
484
+ form += '<option value="alphanumerics-spaces-punctuation-' + i + '"' + ( (field.expected === 'alphanumerics-spaces-punctuation-' + i) ? ' selected="selected"' : '') + '">Alphanumerics, Spaces &amp; Punctuation ( ' + i + ' character minimum )</option>';
485
+ form += '<option value="alphanumerics-spaces-punctuation-' + i + '-e"' + ( (field.expected === 'alphanumerics-spaces-punctuation-' + i + '-e') ? ' selected="selected"' : '') + '">Alphanumerics, Spaces &amp; Punctuation ( exactly ' + i + ' character' + ( (i > 1) ? 's' : '') + ' )</option>';
486
  }
487
  form += '</optgroup>';
488
  /**/
491
  form += '<optgroup label="Alphanumerics &amp; Spaces Only">';
492
  for (i = 1; i <= 25; i++)
493
  {
494
+ form += '<option value="alphanumerics-spaces-' + i + '"' + ( (field.expected === 'alphanumerics-spaces-' + i) ? ' selected="selected"' : '') + '">Alphanumerics &amp; Spaces ( ' + i + ' character minimum )</option>';
495
+ form += '<option value="alphanumerics-spaces-' + i + '-e"' + ( (field.expected === 'alphanumerics-spaces-' + i + '-e') ? ' selected="selected"' : '') + '">Alphanumerics &amp; Spaces ( exactly ' + i + ' character' + ( (i > 1) ? 's' : '') + ' )</option>';
496
  }
497
  form += '</optgroup>';
498
  /**/
501
  form += '<optgroup label="Alphanumerics &amp; Punctuation Only">';
502
  for (i = 1; i <= 25; i++)
503
  {
504
+ form += '<option value="alphanumerics-punctuation-' + i + '"' + ( (field.expected === 'alphanumerics-punctuation-' + i) ? ' selected="selected"' : '') + '">Alphanumerics &amp; Punctuation ( ' + i + ' character minimum )</option>';
505
+ form += '<option value="alphanumerics-punctuation-' + i + '-e"' + ( (field.expected === 'alphanumerics-punctuation-' + i + '-e') ? ' selected="selected"' : '') + '">Alphanumerics &amp; Punctuation ( exactly ' + i + ' character' + ( (i > 1) ? 's' : '') + ' )</option>';
506
  }
507
  form += '</optgroup>';
508
  /**/
511
  form += '<optgroup label="Alphanumerics Only">';
512
  for (i = 1; i <= 25; i++)
513
  {
514
+ form += '<option value="alphanumerics-' + i + '"' + ( (field.expected === 'alphanumerics-' + i) ? ' selected="selected"' : '') + '">Alphanumerics ( ' + i + ' character minimum )</option>';
515
+ form += '<option value="alphanumerics-' + i + '-e"' + ( (field.expected === 'alphanumerics-' + i + '-e') ? ' selected="selected"' : '') + '">Alphanumerics ( exactly ' + i + ' character' + ( (i > 1) ? 's' : '') + ' )</option>';
516
  }
517
  form += '</optgroup>';
518
  /**/
521
  form += '<optgroup label="Alphabetics Only">';
522
  for (i = 1; i <= 25; i++)
523
  {
524
+ form += '<option value="alphabetics-' + i + '"' + ( (field.expected === 'alphabetics-' + i) ? ' selected="selected"' : '') + '">Alphabetics ( ' + i + ' character minimum )</option>';
525
+ form += '<option value="alphabetics-' + i + '-e"' + ( (field.expected === 'alphabetics-' + i + '-e') ? ' selected="selected"' : '') + '">Alphabetics ( exactly ' + i + ' character' + ( (i > 1) ? 's' : '') + ' )</option>';
526
  }
527
  form += '</optgroup>';
528
  /**/
531
  form += '<optgroup label="Numeric Digits Only">';
532
  for (i = 1; i <= 25; i++)
533
  {
534
+ form += '<option value="numerics-' + i + '"' + ( (field.expected === 'numerics-' + i) ? ' selected="selected"' : '') + '">Numeric Digits ( ' + i + ' digit minimum )</option>';
535
+ form += '<option value="numerics-' + i + '-e"' + ( (field.expected === 'numerics-' + i + '-e') ? ' selected="selected"' : '') + '">Numeric Digits ( exactly ' + i + ' digit' + ( (i > 1) ? 's' : '') + ' )</option>';
536
  }
537
  form += '</optgroup>';
538
  /**/
569
  form += '<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';
570
  form += '<td colspan="2">';
571
  form += '<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';
572
+ form += '<option value="yes"' + ( (field.editable === 'yes') ? ' selected="selected"' : '') + '">Yes ( editable )</option>';
573
+ form += '<option value="no"' + ( (field.editable === 'no') ? ' selected="selected"' : '') + '">No ( uneditable after registration )</option>';
574
+ form += '<option value="no-invisible"' + ( (field.editable === 'no-invisible') ? ' selected="selected"' : '') + '">No ( uneditable &amp; totally invisible )</option>';
575
  form += '</select><br />';
576
  form += '<small>If <code>No</code>, this field will be un-editable after registration.</small><br />';
577
  form += '<small>* Administrators are exempt from this.</small>';
630
  form += '<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />';
631
  form += '</td>';
632
  form += '<td align="right">';
633
+ form += '<input type="button" value="' + ( (editing) ? 'Update This Field' : 'Create Registration Field') + '" onclick="' + ( (editing) ? 'ws_plugin__s2member_customRegFieldUpdate(' + index + ');' : 'ws_plugin__s2member_customRegFieldCreate();') + '" />';
634
  form += '</td>';
635
  form += '</tr>';
636
  /**/
639
  /**/
640
  form += '<div>';
641
  /**/
642
+ $ ('body').append (form);
643
+ tb_show ( ( (editing) ? 'Editing Registration Field' : 'New Custom Registration Field'), '#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form');
644
+ $ (window).trigger ('resize'), $ ('table#ws-plugin--s2member-custom-reg-field-configuration-tools-form').show ();
645
  }
646
  /**/
647
  $tools.html (html);
649
  /**/
650
  var attachTBResizer = function() /* Resize inline #TB_ajaxContent. */
651
  {
652
+ $ (window).resize (function()
653
  {
654
  var w, h; /* Initialize width/height vars. */
655
  w = $ (window).width (), h = $ (window).height (), w = (w > 720) ? 720 : w;
656
+ $ ('#TB_ajaxContent').css ({'width': w - 50, 'height': h - 75, 'margin': 0, 'padding': 0});
657
  });
658
  };
659
  /**/
706
  }) ();
707
  }
708
  /**/
709
+ $ ('input#ws-plugin--s2member-ip-restrictions-reset-button').click (function()
710
  {
711
  var $this = $ (this); /* Save $(this) into $this. */
712
  $this.val ('one moment please ...'); /* Indicate loading status ( please wait ). */
713
  /**/
714
  $.post (ajaxurl, {action: 'ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax', ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax: '<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'}, function(response)
715
  {
716
+ alert ('s2Member\'s IP Restriction Logs have all been reset.'), $this.val ('Reset IP Restriction Logs');
717
  });
718
  /**/
719
  return false;
722
  /**/
723
  else if (location.href.match (/page\=ws-plugin--s2member-paypal-ops/))
724
  {
725
+ $ ('select#ws-plugin--s2member-auto-eot-system-enabled').change (function()
726
  {
727
  var $this = $ (this), val = $this.val ();
728
  var $viaCron = $ ('p#ws-plugin--s2member-auto-eot-system-enabled-via-cron');
736
  /**/
737
  else if (location.href.match (/page\=ws-plugin--s2member-els-ops/))
738
  {
739
+ $ ('select#ws-plugin--s2member-custom-reg-opt-in').change (function()
740
  {
741
  var $this = $ (this), val = $this.val ();
742
  var $rows = $ ('tr.ws-plugin--s2member-custom-reg-opt-in-label-row');
755
  /**/
756
  else if (location.href.match (/page\=ws-plugin--s2member-paypal-buttons/))
757
  {
758
+ $ ('select#ws-plugin--s2member-level1-term, select#ws-plugin--s2member-level2-term, select#ws-plugin--s2member-level3-term, select#ws-plugin--s2member-level4-term, select#ws-plugin--s2member-modification-term').change (function()
759
  {
760
  var button = this.id.replace (/^ws-plugin--s2member-(.+?)-term$/g, '$1');
761
  /**/
762
  var trialDisabled = ($ (this).val ().split ('-')[2].replace (/[^0-1BN]/g, '') === 'BN') ? 1 : 0;
763
  /**/
764
+ $ ('p#ws-plugin--s2member-' + button + '-trial-line').css ('display', (trialDisabled ? 'none' : ''));
765
+ $ ('span#ws-plugin--s2member-' + button + '-trial-then').css ('display', (trialDisabled ? 'none' : ''));
766
+ $ ('span#ws-plugin--s2member-' + button + '-20p-rule').css ('display', (trialDisabled ? 'none' : ''));
767
  /**/
768
  (trialDisabled) ? $ ('input#ws-plugin--s2member-' + form + '-trial-period').val (0) : null;
769
  (trialDisabled) ? $ ('input#ws-plugin--s2member-' + form + '-trial-amount').val ('0.00') : null;
770
  });
771
  /**/
772
+ $ ('input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps').keyup (function()
773
  {
774
  if (this.value.match (/[^a-z_0-9,]/)) /* Only if there is a problem; because this causes interruption. */
775
  this.value = $.trim ($.trim (this.value).replace (/[ \-]/g, '_').replace (/[^A-Z_0-9,]/gi, '').toLowerCase ());
814
  /**/
815
  if (trialAmount && (isNaN (trialAmount) || trialAmount < 0.00))
816
  {
817
+ alert ('Oops, a slight problem:\n\nWhen provided, Trial Amount must be >= 0.00');
818
  return false;
819
  }
820
  else if (trialAmount && trialAmount > 10000.00) /* $10,000.00 maximum. */
821
  {
822
+ alert ('Oops, a slight problem:\n\nMaximum Trial Amount is: 10000.00');
823
  return false;
824
  }
825
  else if (trialTerm === 'D' && trialPeriod > 7) /* Some validation on the Trial Period. Max days: 7. */
826
  {
827
+ alert ('Oops, a slight problem:\n\nMaximum Free Days is: 7.\nIf you want to offer more than 7 days free, please choose Weeks or Months from the drop-down.');
828
  return false;
829
  }
830
  else if (trialTerm === 'W' && trialPeriod > 52) /* Some validation on the Trial Period. 52 max. */
831
  {
832
+ alert ('Oops, a slight problem:\n\nMaximum Free Weeks is: 52.\nIf you want to offer more than 52 weeks free, please choose Months from the drop-down.');
833
  return false;
834
  }
835
  else if (trialTerm === 'M' && trialPeriod > 12) /* Some validation on the Trial Period. 12 max. */
836
  {
837
+ alert ('Oops, a slight problem:\n\nMaximum Free Months is: 12.\nIf you want to offer more than 12 months free, please choose Years from the drop-down.');
838
  return false;
839
  }
840
  else if (trialTerm === 'Y' && trialPeriod > 1) /* 1 year max. */
841
  {
842
+ alert ('Oops, a slight problem:\n\nMax Trial Period Years is: 1.');
843
  return false;
844
  }
845
  else if (!regAmount || isNaN (regAmount) || regAmount < 0.01)
846
  {
847
+ alert ('Oops, a slight problem:\n\nAmount must be >= 0.01');
848
  return false;
849
  }
850
  else if (regAmount > 10000.00) /* $10,000.00 maximum. */
851
  {
852
+ alert ('Oops, a slight problem:\n\nMaximum amount is: 10000.00');
853
  return false;
854
  }
855
  else if (!desc) /* Each Button should have a Description. */
856
  {
857
+ alert ('Oops, a slight problem:\n\nPlease type a Description for this Button.');
858
  return false;
859
  }
860
  /**/
875
  code.html (code.val ().replace (/ name\="page_style" value\="(.*?)"/, ' name="page_style" value="' + esc_attr (pageStyle) + '"'));
876
  code.html (code.val ().replace (/ name\="currency_code" value\="(.*?)"/, ' name="currency_code" value="' + esc_attr (currencyCode) + '"'));
877
  code.html (code.val ().replace (/ name\="custom" value\="(.*?)"/, ' name="custom" value="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));
878
+ code.html (code.val ().replace (/ name\="modify" value\="(.*?)"/, ' name="modify" value="' + ( (button === 'modification') ? '1' : '0') + '"'));
879
  code.html (code.val ().replace (/ name\="amount" value\="(.*?)"/, ' name="amount" value="' + esc_attr (regAmount) + '"'));
880
  code.html (code.val ().replace (/ name\="src" value\="(.*?)"/, ' name="src" value="' + esc_attr (regRecur) + '"'));
881
  code.html (code.val ().replace (/ name\="a1" value\="(.*?)"/, ' name="a1" value="' + esc_attr (trialAmount) + '"'));
885
  code.html (code.val ().replace (/ name\="p3" value\="(.*?)"/, ' name="p3" value="' + esc_attr (regPeriod) + '"'));
886
  code.html (code.val ().replace (/ name\="t3" value\="(.*?)"/, ' name="t3" value="' + esc_attr (regTerm) + '"'));
887
  /**/
888
+ $ ('div#ws-plugin--s2member-' + button + '-button-prev').html (code.val ().replace (/\<form/, '<form target="_blank"').replace (/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0); \?\>/g, ''));
889
  /**/
890
  (button === 'modification') ? alert ('Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate.') : alert ('Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.');
891
  /**/
914
  /**/
915
  if (!leading) /* Must have a Leading Post/Page ID to work with. Otherwise, Link generation will fail. */
916
  {
917
+ alert ('Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it\'s because you\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.');
918
  return false;
919
  }
920
  else if (!regAmount || isNaN (regAmount) || regAmount < 0.01)
921
  {
922
+ alert ('Oops, a slight problem:\n\nAmount must be >= 0.01');
923
  return false;
924
  }
925
  else if (regAmount > 10000.00) /* $10,000.00 maximum. */
926
  {
927
+ alert ('Oops, a slight problem:\n\nMaximum amount is: 10000.00');
928
  return false;
929
  }
930
  else if (!desc) /* Each Button should have a Description. */
931
  {
932
+ alert ('Oops, a slight problem:\n\nPlease type a Description for this Button.');
933
  return false;
934
  }
935
  /**/
950
  code.html (code.val ().replace (/ name\="custom" value\="(.*?)"/, ' name="custom" value="<?php echo ws_plugin__s2member_esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));
951
  code.html (code.val ().replace (/ name\="amount" value\="(.*?)"/, ' name="amount" value="' + esc_attr (regAmount) + '"'));
952
  /**/
953
+ $ ('div#ws-plugin--s2member-sp-button-prev').html (code.val ().replace (/\<form/, '<form target="_blank"'));
954
  /**/
955
+ alert ('Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.');
956
  /**/
957
  shortCode.each (function() /* Focus and select the recommended Shortcode. */
958
  {
971
  /**/
972
  if (!leading) /* Must have a Leading Post/Page ID to work with. Otherwise, Link generation will fail. */
973
  {
974
+ alert ('Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it\'s because you\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.');
975
  return false;
976
  }
977
  /**/
includes/menu-pages/paypal-buttons.inc.php CHANGED
@@ -442,7 +442,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
442
  echo '<p>Since all recurring charges are associated with a PayPal® Subscription; and every PayPal® Subscription is associated with a PayPal® Account; your Members will always have a PayPal® Account of their own, which is tied to their Membership with you. So... a Member can simply log into their own PayPal® account and cancel their Subscription(s) with you at anytime, all on their own. However, some Customers do not realize this. So, if you would like to make it clearer ( easier ) for Members to cancel their own Subscription(s), you can provide this Cancellation Button for them on your Login Welcome Page, or somewhere in the support section of your website. Note... you don\'t have to use this Cancellation Button at all, if you don\'t want to. It\'s completely optional.</p>' . "\n";
443
  echo '<p><em><strong>*Cancellation Process*</strong> Very simple. A Member clicks the Cancellation Button. PayPal® asks them to log into their PayPal® account. Once they\'re logged in, PayPal® will display a list of all active Subscriptions they have with you. They choose which ones they want to cancel, and s2Member is notified silently behind-the-scene, through the PayPal® IPN service.</em></p>' . "\n";
444
  echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT ( End Of Term ). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion or deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n";
445
- echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
446
  do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_cancellation_buttons", get_defined_vars ());
447
  /**/
448
  echo '<table class="form-table">' . "\n";
442
  echo '<p>Since all recurring charges are associated with a PayPal® Subscription; and every PayPal® Subscription is associated with a PayPal® Account; your Members will always have a PayPal® Account of their own, which is tied to their Membership with you. So... a Member can simply log into their own PayPal® account and cancel their Subscription(s) with you at anytime, all on their own. However, some Customers do not realize this. So, if you would like to make it clearer ( easier ) for Members to cancel their own Subscription(s), you can provide this Cancellation Button for them on your Login Welcome Page, or somewhere in the support section of your website. Note... you don\'t have to use this Cancellation Button at all, if you don\'t want to. It\'s completely optional.</p>' . "\n";
443
  echo '<p><em><strong>*Cancellation Process*</strong> Very simple. A Member clicks the Cancellation Button. PayPal® asks them to log into their PayPal® account. Once they\'re logged in, PayPal® will display a list of all active Subscriptions they have with you. They choose which ones they want to cancel, and s2Member is notified silently behind-the-scene, through the PayPal® IPN service.</em></p>' . "\n";
444
  echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT ( End Of Term ). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion or deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n";
445
+ echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
446
  do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_cancellation_buttons", get_defined_vars ());
447
  /**/
448
  echo '<table class="form-table">' . "\n";
includes/menu-pages/paypal-ops.inc.php CHANGED
@@ -431,7 +431,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
431
  echo '<h3>PayPal® EOT Behavior ( required, please choose )</h3>' . "\n";
432
  echo '<p>EOT = End Of Term. By default, s2Member will demote a paid Member to a Free Subscriber whenever their Subscription term has ended ( i.e. expired ), been cancelled, refunded, charged back to you, etc. s2Member demotes them to a Free Subscriber, so they will no longer have Member Level Access to your site. However, in some cases, you may prefer to have Customer accounts deleted completely, instead of just being demoted. This is where you choose which method works best for your site. If you don\'t want s2Member to take ANY action at all, you can disable s2Member\'s EOT System temporarily, or even completely.</p>' . "\n";
433
  echo '<p>The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</p>' . "\n";
434
- echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
435
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_eot_behavior", get_defined_vars ());
436
  /**/
437
  echo '<p id="ws-plugin--s2member-auto-eot-system-enabled-via-cron"' . ( ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? '' : ' style="display:none;"') . '>If you\'d like to run s2Member\'s Auto-EOT System through a more traditional Cron Job; instead of through <code>WP-Cron</code>, you will need to configure a Cron Job through your server control panel; provided by your hosting company. Set the Cron Job to run <code>once about every 10 minutes to an hour</code>. You\'ll want to configure an HTTP Cron Job that loads this URL:<br /><code>' . esc_html (add_query_arg ("s2member_auto_eot_system_via_cron", urlencode ("1"), get_bloginfo ("wpurl") . "/")) . '</code></p>' . "\n";
431
  echo '<h3>PayPal® EOT Behavior ( required, please choose )</h3>' . "\n";
432
  echo '<p>EOT = End Of Term. By default, s2Member will demote a paid Member to a Free Subscriber whenever their Subscription term has ended ( i.e. expired ), been cancelled, refunded, charged back to you, etc. s2Member demotes them to a Free Subscriber, so they will no longer have Member Level Access to your site. However, in some cases, you may prefer to have Customer accounts deleted completely, instead of just being demoted. This is where you choose which method works best for your site. If you don\'t want s2Member to take ANY action at all, you can disable s2Member\'s EOT System temporarily, or even completely.</p>' . "\n";
433
  echo '<p>The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</p>' . "\n";
434
+ echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
435
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_eot_behavior", get_defined_vars ());
436
  /**/
437
  echo '<p id="ws-plugin--s2member-auto-eot-system-enabled-via-cron"' . ( ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? '' : ' style="display:none;"') . '>If you\'d like to run s2Member\'s Auto-EOT System through a more traditional Cron Job; instead of through <code>WP-Cron</code>, you will need to configure a Cron Job through your server control panel; provided by your hosting company. Set the Cron Job to run <code>once about every 10 minutes to an hour</code>. You\'ll want to configure an HTTP Cron Job that loads this URL:<br /><code>' . esc_html (add_query_arg ("s2member_auto_eot_system_via_cron", urlencode ("1"), get_bloginfo ("wpurl") . "/")) . '</code></p>' . "\n";
includes/menu-pages/scripting.inc.php CHANGED
@@ -55,7 +55,7 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
55
  /**/
56
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
57
  echo '<h3>Simple Conditionals ( via WordPress® Shortcodes )</h3>' . "\n";
58
- echo '<p>In an effort to give you even more control over access restrictions, s2Member makes Simple Conditionals available to you from within WordPress®, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress®. In this section, we\'ll demonstrate several functions that are possible using Shortcodes: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>, <strong><code>current_user_is_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_is_not_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_can_for_blog(blog_id,capability)</code></strong>, <strong><code>current_user_cannot_for_blog(blog_id,capability)</code></strong>. To make use of these functions, please follow our code samples below. Using Shortcodes, it\'s easy to build Simple Conditionals within your content; based on a Members\'s Level, or even based on Custom Capabilities. s2Member\'s Shortcodes can be used inside a Post/Page, and also inside Text Widgets.</p>' . "\n";
59
  echo '<p><em>There are <strong>two different Shortcodes</strong> being demonstrated here:<br /><strong>1. <code>s2If</code></strong> ( for testing simple conditional expressions ).<br /><strong>2. <code>s2Get</code></strong> ( to get an API Constant value, a Custom Field, or meta key ).</em></p>' . "\n";
60
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way", get_defined_vars ());
61
  /**/
@@ -122,7 +122,7 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
122
  /**/
123
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-way-section">' . "\n";
124
  echo '<h3>The Advanced Way ( some PHP scripting required )</h3>' . "\n";
125
- echo '<p>In an effort to give you even more control over access restrictions, s2Member makes some PHP functions, and also some PHP Constants, available to you from within WordPress®. In this section, we\'ll demonstrate several functions: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>current_user_is("role")</code></strong>, <strong><code>current_user_is_not("role")</code></strong>, <strong><code>current_user_can("capability")</code></strong>, <strong><code>current_user_cannot("capability")</code></strong>, <strong><code>current_user_is_for_blog($blog_id,"role")</code></strong>, <strong><code>current_user_is_not_for_blog($blog_id,"role")</code></strong>, <strong><code>current_user_can_for_blog($blog_id,"capability")</code></strong>, &amp; <strong><code>current_user_cannot_for_blog($blog_id,"capability")</code></strong>. To make use of these functions, please follow our PHP code samples below. Using PHP, is a very powerful way to build Advanced Conditionals within your content; based on a Members\'s Level, Custom Capabilities, and/or other factors. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/exec-php/" target="_blank" rel="external">Exec-PHP</a> ).</p>' . "\n";
126
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_way", get_defined_vars ());
127
  /**/
128
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
@@ -303,7 +303,7 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
303
  /**/
304
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-dripping-section">' . "\n";
305
  echo '<h3>Dripping Content ( some PHP scripting required )</h3>' . "\n";
306
- echo '<p>Content Dripping is the gradual, pre-scheduled release of premium website content to paying Members. This has become increasingly popular, because it allows older Members; those who have paid you more, due to recurring charges; to acquire access to more content progressively; based on their original paid registration time. It also gives you ( as the site owner ), the ability to launch multiple membership site portals, operating on autopilot, without any direct day-to-day involvement in a content release process. This requires some PHP scripting. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/exec-php/" target="_blank" rel="external">Exec-PHP</a> ).</p>' . "\n";
307
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_dripping", get_defined_vars ());
308
  /**/
309
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
@@ -343,7 +343,7 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
343
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
344
  /**/
345
  echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong> = URL to a Stand-Alone Profile Editing Panel.</p>' . "\n";
346
- echo '<p>Copy &amp; Paste one of the code snippets below, into your Login Welcome Page, so Members can click a link to Edit their Profile. This requires some PHP scripting. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/exec-php/" target="_blank" rel="external">Exec-PHP</a> ).</p>' . "\n";
347
  /**/
348
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
349
  /**/
@@ -376,7 +376,7 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
376
  /**/
377
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
378
  /**/
379
- echo '<p>Before you read any further, you should install this handy plugin: <a href="http://wordpress.org/extend/plugins/exec-php/" target="_blank" rel="external">Exec-PHP</a>.<br />' . "\n";
380
  echo 'You\'ll need to have this plugin installed to use PHP code in Posts/Pages.</p>' . "\n";
381
  /**/
382
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
55
  /**/
56
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
57
  echo '<h3>Simple Conditionals ( via WordPress® Shortcodes )</h3>' . "\n";
58
+ echo '<p>In an effort to give you even more control over access restrictions, s2Member makes Simple Conditionals available to you from within WordPress®, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress®. In this section, we\'ll demonstrate several functions that are possible using Shortcodes: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>, <strong><code>current_user_is_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_is_not_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_can_for_blog(blog_id,capability)</code></strong>, <strong><code>current_user_cannot_for_blog(blog_id,capability)</code></strong>. To make use of these functions, please follow our code samples below. Using Shortcodes, it\'s easy to build Simple Conditionals within your content; based on a Member\'s Level, or even based on Custom Capabilities. s2Member\'s Shortcodes can be used inside a Post/Page, and also inside Text Widgets.</p>' . "\n";
59
  echo '<p><em>There are <strong>two different Shortcodes</strong> being demonstrated here:<br /><strong>1. <code>s2If</code></strong> ( for testing simple conditional expressions ).<br /><strong>2. <code>s2Get</code></strong> ( to get an API Constant value, a Custom Field, or meta key ).</em></p>' . "\n";
60
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way", get_defined_vars ());
61
  /**/
122
  /**/
123
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-way-section">' . "\n";
124
  echo '<h3>The Advanced Way ( some PHP scripting required )</h3>' . "\n";
125
+ echo '<p>In an effort to give you even more control over access restrictions, s2Member makes some PHP functions, and also some PHP Constants, available to you from within WordPress®. In this section, we\'ll demonstrate several functions: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>current_user_is("role")</code></strong>, <strong><code>current_user_is_not("role")</code></strong>, <strong><code>current_user_can("capability")</code></strong>, <strong><code>current_user_cannot("capability")</code></strong>, <strong><code>current_user_is_for_blog($blog_id,"role")</code></strong>, <strong><code>current_user_is_not_for_blog($blog_id,"role")</code></strong>, <strong><code>current_user_can_for_blog($blog_id,"capability")</code></strong>, &amp; <strong><code>current_user_cannot_for_blog($blog_id,"capability")</code></strong>. To make use of these functions, please follow our PHP code samples below. Using PHP, is a very powerful way to build Advanced Conditionals within your content; based on a Member\'s Level, Custom Capabilities, and/or other factors. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a> ).</p>' . "\n";
126
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_way", get_defined_vars ());
127
  /**/
128
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
303
  /**/
304
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-dripping-section">' . "\n";
305
  echo '<h3>Dripping Content ( some PHP scripting required )</h3>' . "\n";
306
+ echo '<p>Content Dripping is the gradual, pre-scheduled release of premium website content to paying Members. This has become increasingly popular, because it allows older Members; those who have paid you more, due to recurring charges; to acquire access to more content progressively; based on their original paid registration time. It also gives you ( as the site owner ), the ability to launch multiple membership site portals, operating on autopilot, without any direct day-to-day involvement in a content release process. This requires some PHP scripting. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a> ).</p>' . "\n";
307
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_dripping", get_defined_vars ());
308
  /**/
309
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
343
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
344
  /**/
345
  echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong> = URL to a Stand-Alone Profile Editing Panel.</p>' . "\n";
346
+ echo '<p>Copy &amp; Paste one of the code snippets below, into your Login Welcome Page, so Members can click a link to Edit their Profile. This requires some PHP scripting. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a> ).</p>' . "\n";
347
  /**/
348
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
349
  /**/
376
  /**/
377
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
378
  /**/
379
+ echo '<p>Before you read any further, you should install this handy plugin: <a href="http://wordpress.org/extend/plugins/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a>.<br />' . "\n";
380
  echo 'You\'ll need to have this plugin installed to use PHP code in Posts/Pages.</p>' . "\n";
381
  /**/
382
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
includes/menu-pages/start.inc.php CHANGED
@@ -132,7 +132,7 @@ if (apply_filters ("ws_plugin__s2member_during_start_page_during_left_sections_d
132
  echo '<h3>Subscription Cancellations / Expirations / Terminations</h3>' . "\n";
133
  echo '<p>You\'ll be happy to know that s2Member handles cancellations, expirations, failed payments, terminations ( e.g. refunds &amp; chargebacks ) for you automatically. If you log into your PayPal® account and cancel a Member\'s Subscription, or, if the Member logs into their PayPal® account and cancels their own Subscription, s2Member will be notified of these important changes and react accordingly through the PayPal® IPN service that runs silently behind-the-scene.</p>' . "\n";
134
  echo '<p>The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</p>' . "\n";
135
- echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
136
  do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_automation_process", get_defined_vars ());
137
  echo '</div>' . "\n";
138
  /**/
@@ -150,7 +150,7 @@ if (apply_filters ("ws_plugin__s2member_during_start_page_during_left_sections_d
150
  echo '<div class="ws-menu-page-section ws-plugin--s2member-upgrading-downgrading-section">' . "\n";
151
  echo '<h3>Upgrading And/Or Downgrading User Accounts</h3>' . "\n";
152
  echo '<p>s2Member builds upon existing functionality offered through WordPress® Roles and Capabilities. From your WordPress® Dashboard, go to: <code>Users -> Authors &amp; Users</code>. You can use bulk actions to modify Member Access Levels all at once, or click on an individual Member account to modify only their specific Access Level. If you want to temporarily demote a Member so they cannot access membership privileges, set their Role to Subscriber. When you\'re ready to give them their membership privileges back, change their Role back to one of the s2Member Levels.</p>' . "\n";
153
- echo '<p>All financial details, such as pricing, trial periods, subscription lengths, refunds, and other Customer service issues; should be handled by YOU, through your PayPal® account, and NOT through WordPress®. Feel free to modify your Members\' Subscriptions via PayPal® as often as you like. s2Member will be notified through the PayPal® IPN service behind-the-scene automatically. For example... If you log into PayPal® and cancel a Members\'s paid Subscription, s2Member will be notified by PayPal® behind-the-scene, and s2Member will remove their membership privileges at the correct point in time.</p>' . "\n";
154
  echo '<p>That being said, if you log into your WordPress® Dashboard and delete a Member\'s account, you will still need to log into PayPal® and cancel billing for the account you deleted. In other words, s2Member can be notified automatically about actions you take inside PayPal\'s interface, but PayPal® CANNOT be notified of actions you take inside your WordPress® Dashboard. At least, not in an automated fashion, as that would create a security issue for PayPal®. So... automation works seamlessly from PayPal® -> to s2Member, but NOT the other way around.</p>' . "\n";
155
  do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_upgrading_downgrading", get_defined_vars ());
156
  echo '</div>' . "\n";
132
  echo '<h3>Subscription Cancellations / Expirations / Terminations</h3>' . "\n";
133
  echo '<p>You\'ll be happy to know that s2Member handles cancellations, expirations, failed payments, terminations ( e.g. refunds &amp; chargebacks ) for you automatically. If you log into your PayPal® account and cancel a Member\'s Subscription, or, if the Member logs into their PayPal® account and cancels their own Subscription, s2Member will be notified of these important changes and react accordingly through the PayPal® IPN service that runs silently behind-the-scene.</p>' . "\n";
134
  echo '<p>The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</p>' . "\n";
135
+ echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Member\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s membership privileges when an EOT ( End Of Term ) is processed, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
136
  do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_automation_process", get_defined_vars ());
137
  echo '</div>' . "\n";
138
  /**/
150
  echo '<div class="ws-menu-page-section ws-plugin--s2member-upgrading-downgrading-section">' . "\n";
151
  echo '<h3>Upgrading And/Or Downgrading User Accounts</h3>' . "\n";
152
  echo '<p>s2Member builds upon existing functionality offered through WordPress® Roles and Capabilities. From your WordPress® Dashboard, go to: <code>Users -> Authors &amp; Users</code>. You can use bulk actions to modify Member Access Levels all at once, or click on an individual Member account to modify only their specific Access Level. If you want to temporarily demote a Member so they cannot access membership privileges, set their Role to Subscriber. When you\'re ready to give them their membership privileges back, change their Role back to one of the s2Member Levels.</p>' . "\n";
153
+ echo '<p>All financial details, such as pricing, trial periods, subscription lengths, refunds, and other Customer service issues; should be handled by YOU, through your PayPal® account, and NOT through WordPress®. Feel free to modify your Members\' Subscriptions via PayPal® as often as you like. s2Member will be notified through the PayPal® IPN service behind-the-scene automatically. For example... If you log into PayPal® and cancel a Member\'s paid Subscription, s2Member will be notified by PayPal® behind-the-scene, and s2Member will remove their membership privileges at the correct point in time.</p>' . "\n";
154
  echo '<p>That being said, if you log into your WordPress® Dashboard and delete a Member\'s account, you will still need to log into PayPal® and cancel billing for the account you deleted. In other words, s2Member can be notified automatically about actions you take inside PayPal\'s interface, but PayPal® CANNOT be notified of actions you take inside your WordPress® Dashboard. At least, not in an automated fashion, as that would create a security issue for PayPal®. So... automation works seamlessly from PayPal® -> to s2Member, but NOT the other way around.</p>' . "\n";
155
  do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_upgrading_downgrading", get_defined_vars ());
156
  echo '</div>' . "\n";
includes/s2member-min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){ws_plugin__s2member_uniqueFilesDownloaded=[];if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN&&S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY<S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED){a("a[href*=s2member_file_download]").click(function(){if(!this.href.match(/s2member_file_download_key\=(.+)/i)){var b="** Please Confirm This File Download **\n\n";b+="You've downloaded "+S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY+" protected file"+((S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY<1||S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY>1)?"s":"")+" in the last "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" days.\n\n";b+="You're entitled to "+((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)?"UNLIMITED downloads though ( so, no worries ).":S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED+" unique downloads every "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" day period.");if(this.href.match(/s2member_skip_confirmation/i)||confirm(b)){if(a.inArray(this.href,ws_plugin__s2member_uniqueFilesDownloaded)===-1){ws_plugin__s2member_uniqueFilesDownloaded.push(this.href),S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY++}return true}else{return false}}else{return true}})}if(location.href.match(/\/wp-signup\.php/)){a("div#content > div.mu_register > form#setupform").submit(function(){var d=this,c="",b="",e="";a("input#user_name, input#user_email, input#blogname, input#blog_title",d).each(function(){if((c=a.trim(a(this).prev("label").text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d,true)){e+=b+"\n\n"}}else{if((c=a.trim(a(this).prev("span.prefix_address").prev("label").text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d,true)){e+=b+"\n\n"}}}});a(":input",d).each(function(){if((c=a.trim(a(this).prev("label").text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d)){e+=b+"\n\n"}}});if(e=a.trim(e)){alert("Oops, you missed something:\n\n"+e);return false}return true})}else{if(location.href.match(/\/wp-login\.php/)){a("div#login > form#registerform").submit(function(){var d=this,c="",b="",e="";a("input#user_login, input#user_email",d).each(function(){if((c=a.trim(a(this).parent("label").text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d,true)){e+=b+"\n\n"}}});a(":input",d).each(function(){if((c=a.trim(a(this).parent("label").children("span").slice(0,1).text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d)){e+=b+"\n\n"}}});if(e=a.trim(e)){alert("Oops, you missed something:\n\n"+e);return false}return true})}else{if(location.href.match(/\/\?s2member_profile\=1/)){a("form#ws-plugin--s2member-profile").submit(function(){var e=this,d="",c="",g="";var b=a("input#ws-plugin--s2member-profile-password");var f=a("input#ws-plugin--s2member-profile-password-confirmation");a(":input",e).each(function(){if((d=a.trim(a(this).parent("label").children("strong").slice(0,1).text().replace(/[\r\n\t]+/g," ")))){if(c=ws_plugin__s2member_validationErrors(d,this,e)){g+=c+"\n\n"}}});if(g=a.trim(g)){alert("Oops, you missed something:\n\n"+g);return false}else{if(a.trim(b.val())&&a.trim(b.val())!==a.trim(f.val())){alert("Oops, you missed something:\n\nPasswords do not match up. Please try again.");return false}}return true})}else{if(location.href.match(/\/wp-admin\/profile\.php/)){a("form#your-profile").submit(function(){var d=this,c="",b="",e="";a(':input[id^="ws-plugin--s2member-profile-"]',d).each(function(){if((c=a.trim(a(this).parent("td").prev("th").children("label").slice(0,1).text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d)){e+=b+"\n\n"}}});if(e=a.trim(e)){alert("Oops, you missed something:\n\n"+e);return false}return true})}}}}ws_plugin__s2member_validationErrors=function(l,k,c,g,f){if(typeof l==="string"&&l&&typeof k==="object"&&typeof c==="object"){if(typeof k.tagName==="string"&&k.tagName.match(/^(input|textarea|select)$/i)){var n=k.tagName.toLowerCase(),j=a(k),i=String(j.attr("type")).toLowerCase(),b=String(j.attr("name")),m=j.val();var g=(typeof g==="boolean")?g:(j.attr("aria-required")==="true"),f=(typeof f==="string")?f:j.attr("data-expected");if(n==="input"&&i==="checkbox"&&b.match(/\[\]$/)){if(typeof k.id==="string"&&k.id.match(/-0$/)){if(g&&!a('input[name="'+b.replace(/([\[\]])/g,"$1")+'"]:checked',c).length){return l+"\nPlease check at least one of the boxes."}}}else{if(n==="input"&&i==="checkbox"){if(g&&!k.checked){return l+"\nRequired. This box must be checked."}}else{if(n==="input"&&i==="radio"){if(typeof k.id==="string"&&k.id.match(/-0$/)){if(g&&!a('input[name="'+b.replace(/([\[\]])/g,"$1")+'"]:checked',c).length){return l+"\nPlease select one of the options."}}}else{if(n==="select"&&j.attr("multiple")){if(g&&(!(m instanceof Array)||!m.length)){return l+"\nPlease select at least one of the options."}}else{if(typeof m!=="string"||(g&&!(m=a.trim(m)).length)){return l+"\nThis is a required field, please try again."}else{if((m=a.trim(m)).length&&((n==="input"&&i.match(/^(text|password)$/i))||n==="textarea")&&typeof f==="string"&&f.length){if(f==="numeric-wp-commas"&&(!m.match(/^[0-9\.,]+$/)||isNaN(m.replace(/,/g,"")))){return l+"\nMust be numeric ( with or without decimals, commas allowed )."}else{if(f==="numeric"&&(!m.match(/^[0-9\.]+$/)||isNaN(m))){return l+"\nMust be numeric ( with or without decimals, no commas )."}else{if(f==="integer"&&(!m.match(/^[0-9]+$/)||isNaN(m))){return l+"\nMust be an integer ( a whole number, without any decimals )."}else{if(f==="integer-gt-0"&&(!m.match(/^[0-9]+$/)||isNaN(m)||m<=0)){return l+"\nMust be an integer > 0 ( whole number, no decimals, greater than 0 )."}else{if(f==="float"&&(!m.match(/^[0-9\.]+$/)||!m.match(/[0-9]/)||!m.match(/\./)||isNaN(m))){return l+"\nMust be a float ( floating point number, decimals required )."}else{if(f==="float-gt-0"&&(!m.match(/^[0-9\.]+$/)||!m.match(/[0-9]/)||!m.match(/\./)||isNaN(m)||m<=0)){return l+"\nMust be a float > 0 ( floating point number, decimals required, greater than 0 )."}else{if(f==="date"&&!m.match(/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/)){return l+"\nMust be a date ( required date format: dd/mm/yyyy )."}else{if(f==="email"&&!m.match(/^([a-z_~0-9\+\-]+)(((\.?)([a-z_~0-9\+\-]+))*)(@)([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})$/i)){return l+"\nMust be a valid email address."}else{if(f==="url"&&!m.match(/^http(s?)\:\/\/(.{5,})$/i)){return l+"\nMust be a full URL ( starting with http or https )."}else{if(f==="domain"&&!m.match(/^([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})$/i)){return l+"\nMust be a domain name ( domain name only, without http )."}else{if(f==="phone"&&(!m.match(/^[0-9 \(\)\-]+$/)||m.replace(/[^0-9]/g,"").length!==10)){return l+"\nMust be a phone # ( 10 digits w/possible hyphens,spaces,brackets )."}else{if(f==="uszip"&&!m.match(/^[0-9]{5}(-[0-9]{4})?$/)){return l+"\nMust be a US zipcode ( 5-9 digits w/possible hyphen )."}else{if(f==="cazip"&&!m.match(/^[0-9A-Z]{3}( ?)[0-9A-Z]{3}$/i)){return l+"\nMust be a Canadian zipcode ( 6 alpha-numerics w/possible space )."}else{if(f==="uczip"&&!m.match(/^[0-9]{5}(-[0-9]{4})?$/)&&!m.match(/^[0-9A-Z]{3}( ?)[0-9A-Z]{3}$/i)){return l+"\nMust be a zipcode ( either a US or Canadian zipcode )."}else{if(f.match(/^alphanumerics-spaces-punctuation-([0-9]+)(-e)?$/)&&!m.match(/^[a-z 0-9,\.\/\?\:;"'\{\}\[\]\|\\\+\=_\-\(\)\*&\^%\$#@\!`~]+$/i)){return l+"\nPlease use alphanumerics, spaces & punctuation only."}else{if(f.match(/^alphanumerics-spaces-([0-9]+)(-e)?$/)&&!m.match(/^[a-z 0-9]+$/i)){return l+"\nPlease use alphanumerics & spaces only."}else{if(f.match(/^alphanumerics-punctuation-([0-9]+)(-e)?$/)&&!m.match(/^[a-z0-9,\.\/\?\:;"'\{\}\[\]\|\\\+\=_\-\(\)\*&\^%\$#@\!`~]+$/i)){return l+"\nPlease use alphanumerics & punctuation only ( no spaces )."}else{if(f.match(/^alphanumerics-([0-9]+)(-e)?$/)&&!m.match(/^[a-z0-9]+$/i)){return l+"\nPlease use alphanumerics only ( no spaces/punctuation )."}else{if(f.match(/^alphabetics-([0-9]+)(-e)?$/)&&!m.match(/^[a-z]+$/i)){return l+"\nPlease use alphabetics only ( no digits/spaces/punctuation )."}else{if(f.match(/^numerics-([0-9]+)(-e)?$/)&&!m.match(/^[0-9]+$/i)){return l+"\nPlease use numeric digits only."}else{if(f.match(/^(any|alphanumerics-spaces-punctuation|alphanumerics-spaces|alphanumerics-punctuation|alphanumerics|alphabetics|numerics)-([0-9]+)(-e)?$/)){var h=f.split("-"),d=Number(h[1]),e=(h.length>2)?Number(h[2]):"";if(e&&m.length!==d){return l+"\nMust be exactly "+d+" "+((h[0]==="numerics")?"digit":"character")+((d>1)?"s":"")+"."}else{if(m.length<d){return l+"\nMust be at least "+d+" "+((h[0]==="numerics")?"digit":"character")+((d>1)?"s":"")+"."}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return""}});
1
+ jQuery(document).ready(function(a){ws_plugin__s2member_uniqueFilesDownloaded=[];if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN&&S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY<S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED){a('a[href*="s2member_file_download"]').click(function(){if(!this.href.match(/s2member_file_download_key\=(.+)/i)){var b="** Please Confirm This File Download **\n\n";b+="You've downloaded "+S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY+" protected file"+((S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY<1||S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY>1)?"s":"")+" in the last "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" days.\n\n";b+="You're entitled to "+((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)?"UNLIMITED downloads though ( so, no worries ).":S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED+" unique downloads every "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" day period.");if(this.href.match(/s2member_skip_confirmation/i)||confirm(b)){if(a.inArray(this.href,ws_plugin__s2member_uniqueFilesDownloaded)===-1){ws_plugin__s2member_uniqueFilesDownloaded.push(this.href),S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY++}return true}else{return false}}else{return true}})}if(location.href.match(/\/wp-signup\.php/)){a("div#content > div.mu_register > form#setupform").submit(function(){var d=this,c="",b="",e="";a("input#user_name, input#user_email, input#blogname, input#blog_title",d).each(function(){if((c=a.trim(a(this).prev("label").text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d,true)){e+=b+"\n\n"}}else{if((c=a.trim(a(this).prev("span.prefix_address").prev("label").text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d,true)){e+=b+"\n\n"}}}});a(":input",d).each(function(){if((c=a.trim(a(this).prev("label").text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d)){e+=b+"\n\n"}}});if(e=a.trim(e)){alert("Oops, you missed something:\n\n"+e);return false}return true})}else{if(location.href.match(/\/wp-login\.php/)){a("div#login > form#registerform").submit(function(){var d=this,c="",b="",e="";a("input#user_login, input#user_email",d).each(function(){if((c=a.trim(a(this).parent("label").text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d,true)){e+=b+"\n\n"}}});a(":input",d).each(function(){if((c=a.trim(a(this).parent("label").children("span").slice(0,1).text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d)){e+=b+"\n\n"}}});if(e=a.trim(e)){alert("Oops, you missed something:\n\n"+e);return false}return true})}else{if(location.href.match(/\/\?s2member_profile\=1/)){a("form#ws-plugin--s2member-profile").submit(function(){var e=this,d="",c="",g="";var b=a("input#ws-plugin--s2member-profile-password");var f=a("input#ws-plugin--s2member-profile-password-confirmation");a(":input",e).each(function(){if((d=a.trim(a(this).parent("label").children("strong").slice(0,1).text().replace(/[\r\n\t]+/g," ")))){if(c=ws_plugin__s2member_validationErrors(d,this,e)){g+=c+"\n\n"}}});if(g=a.trim(g)){alert("Oops, you missed something:\n\n"+g);return false}else{if(a.trim(b.val())&&a.trim(b.val())!==a.trim(f.val())){alert("Oops, you missed something:\n\nPasswords do not match up. Please try again.");return false}}return true})}else{if(location.href.match(/\/wp-admin\/profile\.php/)){a("form#your-profile").submit(function(){var d=this,c="",b="",e="";a(':input[id^="ws-plugin--s2member-profile-"]',d).each(function(){if((c=a.trim(a(this).parent("td").prev("th").children("label").slice(0,1).text().replace(/[\r\n\t]+/g," ")))){if(b=ws_plugin__s2member_validationErrors(c,this,d)){e+=b+"\n\n"}}});if(e=a.trim(e)){alert("Oops, you missed something:\n\n"+e);return false}return true})}}}}ws_plugin__s2member_validationErrors=function(l,k,c,g,f){if(typeof l==="string"&&l&&typeof k==="object"&&typeof c==="object"){if(typeof k.tagName==="string"&&k.tagName.match(/^(input|textarea|select)$/i)){var n=k.tagName.toLowerCase(),j=a(k),i=String(j.attr("type")).toLowerCase(),b=String(j.attr("name")),m=j.val();var g=(typeof g==="boolean")?g:(j.attr("aria-required")==="true"),f=(typeof f==="string")?f:j.attr("data-expected");if(n==="input"&&i==="checkbox"&&b.match(/\[\]$/)){if(typeof k.id==="string"&&k.id.match(/-0$/)){if(g&&!a('input[name="'+b.replace(/([\[\]])/g,"$1")+'"]:checked',c).length){return l+"\nPlease check at least one of the boxes."}}}else{if(n==="input"&&i==="checkbox"){if(g&&!k.checked){return l+"\nRequired. This box must be checked."}}else{if(n==="input"&&i==="radio"){if(typeof k.id==="string"&&k.id.match(/-0$/)){if(g&&!a('input[name="'+b.replace(/([\[\]])/g,"$1")+'"]:checked',c).length){return l+"\nPlease select one of the options."}}}else{if(n==="select"&&j.attr("multiple")){if(g&&(!(m instanceof Array)||!m.length)){return l+"\nPlease select at least one of the options."}}else{if(typeof m!=="string"||(g&&!(m=a.trim(m)).length)){return l+"\nThis is a required field, please try again."}else{if((m=a.trim(m)).length&&((n==="input"&&i.match(/^(text|password)$/i))||n==="textarea")&&typeof f==="string"&&f.length){if(f==="numeric-wp-commas"&&(!m.match(/^[0-9\.,]+$/)||isNaN(m.replace(/,/g,"")))){return l+"\nMust be numeric ( with or without decimals, commas allowed )."}else{if(f==="numeric"&&(!m.match(/^[0-9\.]+$/)||isNaN(m))){return l+"\nMust be numeric ( with or without decimals, no commas )."}else{if(f==="integer"&&(!m.match(/^[0-9]+$/)||isNaN(m))){return l+"\nMust be an integer ( a whole number, without any decimals )."}else{if(f==="integer-gt-0"&&(!m.match(/^[0-9]+$/)||isNaN(m)||m<=0)){return l+"\nMust be an integer > 0 ( whole number, no decimals, greater than 0 )."}else{if(f==="float"&&(!m.match(/^[0-9\.]+$/)||!m.match(/[0-9]/)||!m.match(/\./)||isNaN(m))){return l+"\nMust be a float ( floating point number, decimals required )."}else{if(f==="float-gt-0"&&(!m.match(/^[0-9\.]+$/)||!m.match(/[0-9]/)||!m.match(/\./)||isNaN(m)||m<=0)){return l+"\nMust be a float > 0 ( floating point number, decimals required, greater than 0 )."}else{if(f==="date"&&!m.match(/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/)){return l+"\nMust be a date ( required date format: dd/mm/yyyy )."}else{if(f==="email"&&!m.match(/^([a-z_~0-9\+\-]+)(((\.?)([a-z_~0-9\+\-]+))*)(@)([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})$/i)){return l+"\nMust be a valid email address."}else{if(f==="url"&&!m.match(/^http(s?)\:\/\/(.{5,})$/i)){return l+"\nMust be a full URL ( starting with http or https )."}else{if(f==="domain"&&!m.match(/^([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})$/i)){return l+"\nMust be a domain name ( domain name only, without http )."}else{if(f==="phone"&&(!m.match(/^[0-9 \(\)\-]+$/)||m.replace(/[^0-9]/g,"").length!==10)){return l+"\nMust be a phone # ( 10 digits w/possible hyphens,spaces,brackets )."}else{if(f==="uszip"&&!m.match(/^[0-9]{5}(-[0-9]{4})?$/)){return l+"\nMust be a US zipcode ( 5-9 digits w/possible hyphen )."}else{if(f==="cazip"&&!m.match(/^[0-9A-Z]{3}( ?)[0-9A-Z]{3}$/i)){return l+"\nMust be a Canadian zipcode ( 6 alpha-numerics w/possible space )."}else{if(f==="uczip"&&!m.match(/^[0-9]{5}(-[0-9]{4})?$/)&&!m.match(/^[0-9A-Z]{3}( ?)[0-9A-Z]{3}$/i)){return l+"\nMust be a zipcode ( either a US or Canadian zipcode )."}else{if(f.match(/^alphanumerics-spaces-punctuation-([0-9]+)(-e)?$/)&&!m.match(/^[a-z 0-9,\.\/\?\:;"'\{\}\[\]\|\\\+\=_\-\(\)\*&\^%\$#@\!`~]+$/i)){return l+"\nPlease use alphanumerics, spaces & punctuation only."}else{if(f.match(/^alphanumerics-spaces-([0-9]+)(-e)?$/)&&!m.match(/^[a-z 0-9]+$/i)){return l+"\nPlease use alphanumerics & spaces only."}else{if(f.match(/^alphanumerics-punctuation-([0-9]+)(-e)?$/)&&!m.match(/^[a-z0-9,\.\/\?\:;"'\{\}\[\]\|\\\+\=_\-\(\)\*&\^%\$#@\!`~]+$/i)){return l+"\nPlease use alphanumerics & punctuation only ( no spaces )."}else{if(f.match(/^alphanumerics-([0-9]+)(-e)?$/)&&!m.match(/^[a-z0-9]+$/i)){return l+"\nPlease use alphanumerics only ( no spaces/punctuation )."}else{if(f.match(/^alphabetics-([0-9]+)(-e)?$/)&&!m.match(/^[a-z]+$/i)){return l+"\nPlease use alphabetics only ( no digits/spaces/punctuation )."}else{if(f.match(/^numerics-([0-9]+)(-e)?$/)&&!m.match(/^[0-9]+$/i)){return l+"\nPlease use numeric digits only."}else{if(f.match(/^(any|alphanumerics-spaces-punctuation|alphanumerics-spaces|alphanumerics-punctuation|alphanumerics|alphabetics|numerics)-([0-9]+)(-e)?$/)){var h=f.split("-"),d=Number(h[1]),e=(h.length>2)?Number(h[2]):"";if(e&&m.length!==d){return l+"\nMust be exactly "+d+" "+((h[0]==="numerics")?"digit":"character")+((d>1)?"s":"")+"."}else{if(m.length<d){return l+"\nMust be at least "+d+" "+((h[0]==="numerics")?"digit":"character")+((d>1)?"s":"")+"."}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return""}});
includes/s2member.js CHANGED
@@ -17,13 +17,13 @@ jQuery (document).ready (function($)
17
  /**/
18
  if (S2MEMBER_CURRENT_USER_IS_LOGGED_IN && S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY < S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED)
19
  {
20
- $ ('a[href*=s2member_file_download]').click (function()
21
  {
22
  if (!this.href.match (/s2member_file_download_key\=(.+)/i))
23
  {
24
  var c = '** Please Confirm This File Download **\n\n';
25
- c += 'You\'ve downloaded ' + S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY + ' protected file' + ( (S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY < 1 || S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY > 1) ? 's' : '') + ' in the last ' + S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS + ' days.\n\n';
26
- c += 'You\'re entitled to ' + ( (S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED) ? 'UNLIMITED downloads though ( so, no worries ).' : S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED + ' unique downloads every ' + S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS + ' day period.');
27
  /**/
28
  if (this.href.match (/s2member_skip_confirmation/i) || confirm (c))
29
  {
@@ -195,15 +195,15 @@ jQuery (document).ready (function($)
195
  }
196
  else if (tag === 'select' && $field.attr ('multiple'))
197
  {
198
- if (required && (! (value instanceof Array) || !value.length))
199
  return label + '\nPlease select at least one of the options.';
200
  }
201
- else if (typeof value !== 'string' || (required && ! (value = $.trim (value)).length))
202
  /* If we get here, the value MUST be in string format, and we need to trim the string before validation. */
203
  {
204
  return label + '\nThis is a required field, please try again.'; /* Missing data. */
205
  }
206
- else if ((value = $.trim (value)).length && ( (tag === 'input' && type.match (/^(text|password)$/i)) || tag === 'textarea') && typeof expected === 'string' && expected.length)
207
  {
208
  if (expected === 'numeric-wp-commas' && (!value.match (/^[0-9\.,]+$/) || isNaN (value.replace (/,/g, ''))))
209
  {
@@ -290,10 +290,10 @@ jQuery (document).ready (function($)
290
  var split = expected.split ('-'), length = Number (split[1]), exactLength = (split.length > 2) ? Number (split[2]) : '';
291
  /**/
292
  if (exactLength && value.length !== length) /* An exact length is required? */
293
- return label + '\nMust be exactly ' + length + ' ' + ( (split[0] === 'numerics') ? 'digit' : 'character') + ( (length > 1) ? 's' : '') + '.';
294
  /**/
295
  else if (value.length < length) /* Otherwise, we interpret as the minimum length. */
296
- return label + '\nMust be at least ' + length + ' ' + ( (split[0] === 'numerics') ? 'digit' : 'character') + ( (length > 1) ? 's' : '') + '.';
297
  }
298
  }
299
  }
17
  /**/
18
  if (S2MEMBER_CURRENT_USER_IS_LOGGED_IN && S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY < S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED)
19
  {
20
+ $ ('a[href*="s2member_file_download"]').click (function()
21
  {
22
  if (!this.href.match (/s2member_file_download_key\=(.+)/i))
23
  {
24
  var c = '** Please Confirm This File Download **\n\n';
25
+ c += 'You\'ve downloaded ' + S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY + ' protected file' + ((S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY < 1 || S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY > 1) ? 's' : '') + ' in the last ' + S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS + ' days.\n\n';
26
+ c += 'You\'re entitled to ' + ((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED) ? 'UNLIMITED downloads though ( so, no worries ).' : S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED + ' unique downloads every ' + S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS + ' day period.');
27
  /**/
28
  if (this.href.match (/s2member_skip_confirmation/i) || confirm (c))
29
  {
195
  }
196
  else if (tag === 'select' && $field.attr ('multiple'))
197
  {
198
+ if (required && (!(value instanceof Array) || !value.length))
199
  return label + '\nPlease select at least one of the options.';
200
  }
201
+ else if (typeof value !== 'string' || (required && !(value = $.trim (value)).length))
202
  /* If we get here, the value MUST be in string format, and we need to trim the string before validation. */
203
  {
204
  return label + '\nThis is a required field, please try again.'; /* Missing data. */
205
  }
206
+ else if ((value = $.trim (value)).length && ((tag === 'input' && type.match (/^(text|password)$/i)) || tag === 'textarea') && typeof expected === 'string' && expected.length)
207
  {
208
  if (expected === 'numeric-wp-commas' && (!value.match (/^[0-9\.,]+$/) || isNaN (value.replace (/,/g, ''))))
209
  {
290
  var split = expected.split ('-'), length = Number (split[1]), exactLength = (split.length > 2) ? Number (split[2]) : '';
291
  /**/
292
  if (exactLength && value.length !== length) /* An exact length is required? */
293
+ return label + '\nMust be exactly ' + length + ' ' + ((split[0] === 'numerics') ? 'digit' : 'character') + ((length > 1) ? 's' : '') + '.';
294
  /**/
295
  else if (value.length < length) /* Otherwise, we interpret as the minimum length. */
296
+ return label + '\nMust be at least ' + length + ' ' + ((split[0] === 'numerics') ? 'digit' : 'character') + ((length > 1) ? 's' : '') + '.';
297
  }
298
  }
299
  }
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === s2Member ( Membership w/ PayPal® Integration ) ~ now Multisite compatible! ===
2
 
3
- Version: 3.3.1
4
- Stable tag: 3.3.1
5
  Framework: WS-P-3.1
6
 
7
  SSL Compatible: yes
@@ -17,7 +17,7 @@ Google® Checkout Compatible: w/ s2Member Pro
17
  ClickBank® Compatible: w/ s2Member Pro
18
  AliPay® Compatible: w/ s2Member Pro
19
 
20
- Tested up to: 3.0.2
21
  Requires at least: 3.0
22
  Requires: WordPress® 3.0+, PHP 5.2+
23
 
@@ -176,6 +176,16 @@ We get this type of question a lot. The answer is most definitely **yes**. The e
176
 
177
  == Changelog ==
178
 
 
 
 
 
 
 
 
 
 
 
179
  = 3.3.1 =
180
  * Tested against WordPress® 3.0.2. Everything looks good.
181
  * Updated Stable Tag to v3.3.1. s2Member is compatible with WordPress® 3.0+ ( including WP 3.0.2 ).
1
  === s2Member ( Membership w/ PayPal® Integration ) ~ now Multisite compatible! ===
2
 
3
+ Version: 3.3.2
4
+ Stable tag: 3.3.2
5
  Framework: WS-P-3.1
6
 
7
  SSL Compatible: yes
17
  ClickBank® Compatible: w/ s2Member Pro
18
  AliPay® Compatible: w/ s2Member Pro
19
 
20
+ Tested up to: 3.0.3
21
  Requires at least: 3.0
22
  Requires: WordPress® 3.0+, PHP 5.2+
23
 
176
 
177
  == Changelog ==
178
 
179
+ = 3.3.2 =
180
+ * Tested against WordPress® 3.0.3. Everything looks good.
181
+ * (s2Member) Bug fix. s2Member was ignoring `?redirect_to=value` upon login, in favor of the Login Welcome Page configured for s2Member. s2Member v3.3.2 has been updated to allow the use of `redirect_to`; and to simply default to the Login Welcome Page when no `redirect_to` argument is passed in. This is the intended behavior. As of s2Member v3.3.2 this now works fully as expected.
182
+ * (s2Member/s2Member Pro) Bug fix. s2Member was incorrectly calculating delayed EOT Times under certain circumstances. This was related to non-recurring Subscriptions processed on PayPal® accounts opened after October 15th, 2009. Under the right scenario, PayPal's IPN responses were fooling s2Member, by immediately expiring payments; and sending a `recurring_payment_expired` IPN before the `recurring_payment` IPN. So s2Member was incorrectly calculating the EOT Time ( i.e. `last_payment_time` was not properly considered ). The logic behind s2Member's IPN handling routines has been corrected in v3.3.2 to resolve this issue.
183
+ * (s2Member/s2Member Pro) SEO / Search Engine Optimization. s2Member now sends 301 redirect headers instead of the default WordPress® 302. This prevents duplicate content warnings from search engines such as Google®. In other words, when s2Member redirects visitors ( and/or search engine spiders ) to your Membership Options Page, in response to an attempt to access a secured area of your site; the `wp_redirect()` call will send a 301 redirect header instead of a 302. This prevents duplicate content warnings associated with your Membership Options Page. In addition, a universal Filter ( i.e. `ws_plugin__s2member_content_redirect_status` ) has been added to s2Member's source code, giving developers the ability to modify this behavior dynamically; if they need to.
184
+ * (s2Member Pro) Bug fix. s2Member Pro's AliPay® integration was incorrectly handling Return URLs on success. This release fixes the invalid syntax inside `/functions/separates/alipay-return.inc.php`.
185
+ * (s2Member Pro) Compatibility. s2Member Pro Forms are now compatible with jQuery v1.4.4. jQuery v1.4.4 introduced the need for double-quotations around all attribute/value selectors.
186
+ * (s2Member Pro) New Pro Form attribute. s2Member Pro Forms now accept a new Attribute ( i.e. `template=""` ). This allows developers to integrate Pro Forms with custom template files, on a per-Form basis. For further details on this topic, please check your Dashboard under: `s2Member -> PayPal® Pro Forms -> Shortcode Attributes (explained)`.
187
+ * (s2Member) Bug fix. A bug that was first introduced in v3.3 was causing AWeber integrations to fail with email addresses being picked up as the administrative address instead of the Customer's address. This was related to a previous change in v3.3 where all `mail()` commands were converted to `wp_mail()` for improved compatibility. With this release ( s2Member v3.3.2 ), the bug with AWeber integration has been resolved. Thanks to everyone for reporting this important issue.
188
+
189
  = 3.3.1 =
190
  * Tested against WordPress® 3.0.2. Everything looks good.
191
  * Updated Stable Tag to v3.3.1. s2Member is compatible with WordPress® 3.0+ ( including WP 3.0.2 ).
s2member.php CHANGED
@@ -9,8 +9,8 @@ along with this software. In the main directory, see: /licensing/
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
- Version: 3.3.1
13
- Stable tag: 3.3.1
14
  Framework: WS-P-3.1
15
 
16
  SSL Compatible: yes
@@ -26,7 +26,7 @@ Google® Checkout Compatible: w/ s2Member Pro
26
  ClickBank® Compatible: w/ s2Member Pro
27
  AliPay® Compatible: w/ s2Member Pro
28
 
29
- Tested up to: 3.0.2
30
  Requires at least: 3.0
31
  Requires: WordPress® 3.0+, PHP 5.2+
32
 
@@ -54,10 +54,10 @@ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
54
  /*
55
  Define versions.
56
  */
57
- define ("WS_PLUGIN__S2MEMBER_VERSION", "3.3.1");
58
  define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
59
  define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "3.0");
60
- define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.3");
61
  /*
62
  Compatibility checks.
63
  */
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
+ Version: 3.3.2
13
+ Stable tag: 3.3.2
14
  Framework: WS-P-3.1
15
 
16
  SSL Compatible: yes
26
  ClickBank® Compatible: w/ s2Member Pro
27
  AliPay® Compatible: w/ s2Member Pro
28
 
29
+ Tested up to: 3.0.3
30
  Requires at least: 3.0
31
  Requires: WordPress® 3.0+, PHP 5.2+
32
 
54
  /*
55
  Define versions.
56
  */
57
+ define ("WS_PLUGIN__S2MEMBER_VERSION", "3.3.2");
58
  define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
59
  define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "3.0");
60
+ define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.3.2");
61
  /*
62
  Compatibility checks.
63
  */