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

Version Description

= v150827 =

(Maintenance Release) Upgrade immediately.

Download this release

Release Info

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

Code changes from version 150722 to 150827

changelog.md CHANGED
@@ -1,3 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  = v150722 =
2
 
3
  - (s2Member/s2Member Pro) **New Shortcode:** This release introduces a powerful new shortcode which allows you to display a user's EOT (End of Term) or NPT (next payment time) in a WordPress Post or Page. For further details and some minor limitations, please see [`[s2Eot /]` Shortcode Documentation](http://s2member.com/kb-article/s2eot-shortcode-documentation/). Props to @raamdev and @patdumond for their strategic assistance, feedback, and ideas for this shortcode.
1
+ = v150827 =
2
+
3
+ - (s2Member/s2Member Pro) **WordPress v4.3 Compat./Bug Fix** This release of s2Member alters the way New User Notification Emails are sent, and in how they should be formatted in WordPress v4.3+.
4
+
5
+ The New User Notification Email is now sent (to a user) only if they did _not_ set a Custom Password during their registration; i.e., only if they need this email to set their password for the first time. In short, s2Member now follows the same approach used by WordPress v4.3+.
6
+
7
+ See: **Dashboard → s2Member → General Options → Email Configuration → New User Notification**
8
+
9
+ So the purpose of this particular email has changed just a bit; i.e., the New User Notification Email. Instead of it being sent to every new user, it is only sent to users who need it for the purpose of obtaining a password which grants them access to their account for the first time.
10
+
11
+ **Upgrading to WordPress v4.3 and the latest release of s2Member?**
12
+
13
+ Please review this section of your Dashboard carefully:
14
+ **s2Member → General Options → Email Configuration → New User Notification**
15
+
16
+ - If you are using s2Member to customize the New User Notification email, you should try to update this message so that it includes the new `%%wp_set_pass_url%%` Replacement Code.
17
+
18
+ See also: [this comment at GitHub about the recent changes, with screenshots](https://github.com/websharks/s2member/issues/689#issuecomment-134563230).
19
+
20
+ - (s2Member Pro) **`[s2Member-List /]` Bug Fix:** This release corrects a bug in the `[s2Member-List /]` shortcode that was causing `levels="0"` not to work, and in fact any use of a `0` in the `levels=""` attribute was broken. See [this GitHub issue](https://github.com/websharks/s2member/issues/663) if you'd like additional details. Props to @patdumond for reproducing, reporting and testing this issue.
21
+
22
+ - (s2Member/s2Member Pro) **Emoji Bug Fix:** This release corrects a bug in s2Member's SSL filters that can be applied with the Post/Page Custom Field `s2member_force_ssl` being set to `yes`. A symptom of this bug was to see an SSL warning in the latest release of WordPress related to the new Emoji library. See [this GitHub issue](https://github.com/websharks/s2member/issues/674) if you'd like additional details.
23
+
24
  = v150722 =
25
 
26
  - (s2Member/s2Member Pro) **New Shortcode:** This release introduces a powerful new shortcode which allows you to display a user's EOT (End of Term) or NPT (next payment time) in a WordPress Post or Page. For further details and some minor limitations, please see [`[s2Eot /]` Shortcode Documentation](http://s2member.com/kb-article/s2eot-shortcode-documentation/). Props to @raamdev and @patdumond for their strategic assistance, feedback, and ideas for this shortcode.
checksum.txt CHANGED
@@ -1 +1 @@
1
- ac6ab77717ca3649c60746d452238881
1
+ 405318c8d344857d3d8ae09168730a43
includes/classes/email-configs.inc.php CHANGED
@@ -15,9 +15,9 @@
15
  * @since 3.5
16
  */
17
  if(!defined('WPINC')) // MUST have WordPress.
18
- exit ("Do not access this file directly.");
19
 
20
- if (!class_exists ("c_ws_plugin__s2member_email_configs"))
21
  {
22
  /**
23
  * Email configurations for s2Member.
@@ -34,56 +34,55 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
34
  *
35
  * @package s2Member\Email_Configs
36
  * @since 3.5
37
- *
38
- * @return null
39
  */
40
  public static function email_config ()
41
  {
42
- do_action("ws_plugin__s2member_before_email_config", get_defined_vars ());
43
 
44
  c_ws_plugin__s2member_email_configs::email_config_release ();
45
 
46
- add_filter ("wp_mail_from", "c_ws_plugin__s2member_email_configs::_email_config_email");
47
- add_filter ("wp_mail_from_name", "c_ws_plugin__s2member_email_configs::_email_config_name");
48
-
49
- do_action("ws_plugin__s2member_after_email_config", get_defined_vars ());
50
 
51
- return /* Return for uniformity. */;
52
  }
 
53
  /**
54
  * A sort of callback function that applies the email Filter.
55
  *
56
  * @package s2Member\Email_Configs
57
  * @since 3.5
58
  *
59
- * @attaches-to ``add_filter("wp_mail_from");``
60
  *
61
  * @param string $email Expects the email address to be passed in by the Filter.
62
  * @return string s2Member-configured email address.
63
  */
64
- public static function _email_config_email ($email = FALSE)
65
  {
66
- do_action("_ws_plugin__s2member_before_email_config_email", get_defined_vars ());
67
 
68
- return apply_filters("_ws_plugin__s2member_email_config_email", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"], get_defined_vars ());
69
  }
 
70
  /**
71
  * A sort of callback function that applies the name Filter.
72
  *
73
  * @package s2Member\Email_Configs
74
  * @since 3.5
75
  *
76
- * @attaches-to ``add_filter("wp_mail_from_name");``
77
  *
78
  * @param string $name Expects the name to be passed in by the Filter.
79
  * @return string s2Member-configured name.
80
  */
81
- public static function _email_config_name ($name = FALSE)
82
  {
83
- do_action("_ws_plugin__s2member_before_email_config_name", get_defined_vars ());
84
 
85
- return apply_filters("_ws_plugin__s2member_email_config_name", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"], get_defined_vars ());
86
  }
 
87
  /**
88
  * Checks the status of Filters being applied to the email From: "Name" <address>.
89
  *
@@ -95,16 +94,17 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
95
  */
96
  public static function email_config_status ($any = FALSE)
97
  {
98
- do_action("ws_plugin__s2member_before_email_config_status", get_defined_vars ());
99
 
100
- if (has_filter ("wp_mail_from", "c_ws_plugin__s2member_email_configs::_email_config_email") || has_filter ("wp_mail_from_name", "c_ws_plugin__s2member_email_configs::_email_config_name"))
101
- return apply_filters("ws_plugin__s2member_email_config_status", true, get_defined_vars ());
102
 
103
- else if ($any && (has_filter ("wp_mail_from") || has_filter ("wp_mail_from_name")))
104
- return apply_filters("ws_plugin__s2member_email_config_status", true, get_defined_vars ());
105
 
106
- return apply_filters("ws_plugin__s2member_email_config_status", false, get_defined_vars ());
107
  }
 
108
  /**
109
  * Releases Filters that modify the email From: "Name" <address>.
110
  *
@@ -112,22 +112,20 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
112
  * @since 3.5
113
  *
114
  * @param bool $all Optional. Defaults to false. If true, remove ALL Filters, not just those applied by s2Member.
115
- * @return null
116
  */
117
  public static function email_config_release ($all = FALSE)
118
  {
119
- do_action("ws_plugin__s2member_before_email_config_release", get_defined_vars ());
120
-
121
- remove_filter ("wp_mail_from", "c_ws_plugin__s2member_email_configs::_email_config_email");
122
- remove_filter ("wp_mail_from_name", "c_ws_plugin__s2member_email_configs::_email_config_name");
123
 
124
- if /* If ``$all`` is true, remove ALL attached WordPress Filters. */ ($all)
125
- remove_all_filters ("wp_mail_from") . remove_all_filters ("wp_mail_from_name");
126
 
127
- do_action("ws_plugin__s2member_after_email_config_release", get_defined_vars ());
 
128
 
129
- return /* Return for uniformity. */;
130
  }
 
131
  /**
132
  * Converts primitive Role names in emails sent by WordPress.
133
  *
@@ -136,43 +134,45 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
136
  * @package s2Member\Email_Configs
137
  * @since 3.5
138
  *
139
- * @attaches-to ``add_filter("wpmu_signup_user_notification_email");``
140
  *
141
  * @param string $message Expects the message string to be passed in by the Filter.
142
  * @return string Message after having been Filtered by s2Member.
143
  */
144
- public static function ms_nice_email_roles ($message = FALSE)
145
  {
146
  foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
147
- do_action("ws_plugin__s2member_before_ms_nice_email_roles", get_defined_vars ());
148
- unset($__refs, $__v);
149
 
150
- $message = preg_replace ("/ as a (subscriber|s2member_level[0-9]+)/i", " " . _x ("as a Member", "s2member-front", "s2member"), $message);
151
 
152
- return apply_filters("ws_plugin__s2member_ms_nice_email_roles", $message, get_defined_vars ());
153
  }
 
154
  /**
155
  * Filters email addresses passed to ``wp_mail()``.
156
  *
157
  * @package s2Member\Email_Configs
158
  * @since 3.5
159
  *
160
- * @attaches-to ``add_filter("wp_mail");``
161
  * @uses {@link s2Member\Utilities\c_ws_plugin__s2member_utils_strings::parse_emails()}
162
  *
163
  * @param array $array Expects an array passed through by the Filter.
164
  * @return array Returns the array passed through by the Filter.
165
  */
166
- public static function email_filter ($array = FALSE)
167
  {
168
- if (isset ($array["to"]) && !empty($array["to"])) // Filter list of recipients?
169
  // Reduces `"Name" <email>`, to just an email address *(for best cross-platform compatibility across various MTAs)*.
170
  // Also works around bug in PHP versions prior to fix in 5.2.11. See bug report: <https://bugs.php.net/bug.php?id=28038>.
171
  // Also supplements WordPress. WordPress currently does NOT support semicolon `;` delimitation, s2Member does.
172
- $array["to"] = implode (",", c_ws_plugin__s2member_utils_strings::parse_emails ($array["to"]));
173
 
174
- return apply_filters("ws_plugin__s2member_after_email_filter", $array, get_defined_vars ());
175
  }
 
176
  /**
177
  * Resets a User/Member password and resends the New User Notification email message (to the User/Member only).
178
  *
@@ -187,22 +187,28 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
187
  * @param string $user_email Optional. This defaults to the user's currently configured email address.
188
  * @return bool True if all required parameters are supplied, else false.
189
  */
190
- public static function reset_pass_resend_new_user_notification ($user_id = FALSE, $user_pass = FALSE, $notify = array("user"), $user_email = FALSE)
191
  {
192
  foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
193
- do_action("ws_plugin__s2member_before_reset_pass_resend_new_user_notification", get_defined_vars ());
194
- unset($__refs, $__v);
195
 
196
- if ($user_id && ($user = new WP_User ($user_id)) && !empty($user->ID) && ($user_id = $user->ID) && is_array($notify) && !empty($notify))
197
- {
198
- $user_pass = (is_string($user_pass) && $user_pass) ? $user_pass : wp_generate_password();
 
199
 
 
 
 
 
200
  wp_set_password($user_pass, $user_id);
201
 
202
  $return = c_ws_plugin__s2member_email_configs::new_user_notification($user_id, $user_pass, $notify, $user_email);
203
  }
204
- return apply_filters("ws_plugin__s2member_reset_pass_resend_new_user_notification", ((!empty($return)) ? true : false), get_defined_vars ());
205
  }
 
206
  /**
207
  * Handles new User/Member notifications.
208
  *
@@ -216,185 +222,223 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
216
  * @param string $user_email Optional. This defaults to the user's currently configured email address.
217
  * @return bool True if all required parameters are supplied, else false.
218
  */
219
- public static function new_user_notification ($user_id = FALSE, $user_pass = FALSE, $notify = array("user", "admin"), $user_email = FALSE)
220
  {
221
  foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
222
- do_action("ws_plugin__s2member_before_new_user_notification", get_defined_vars ());
223
- unset($__refs, $__v);
224
 
225
- if ($user_id && ($user = new WP_User ($user_id)) && !empty($user->ID) && ($user_id = $user->ID) && is_array($notify) && !empty($notify))
 
 
 
 
 
226
  {
 
 
227
  $email_configs_were_on = c_ws_plugin__s2member_email_configs::email_config_status ();
228
  c_ws_plugin__s2member_email_configs::email_config_release ();
229
 
230
- if /* Send User a notification? */ (in_array("user", $notify) && $user_pass)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  {
232
- $fields = get_user_option ("s2member_custom_fields", $user_id);
233
- $cv = preg_split ("/\|/", get_user_option ("s2member_custom", $user_id));
234
 
235
  $role = c_ws_plugin__s2member_user_access::user_access_role($user);
236
  $label = c_ws_plugin__s2member_user_access::user_access_label($user);
237
  $level = c_ws_plugin__s2member_user_access::user_access_level($user);
238
- $ccaps = implode(",", c_ws_plugin__s2member_user_access::user_access_ccaps($user));
239
 
240
  $user->user_email = ($user_email) ? $user_email : $user->user_email;
241
- $user_full_name = trim ($user->first_name . " " . $user->last_name);
242
- $user_ip = $_SERVER["REMOTE_ADDR"];
243
-
244
- if (($sbj = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_subject"]))
245
- if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim(@$cv[$1])', $sbj)))
246
- if (($sbj = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $sbj)))
247
- if (($sbj = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($role), $sbj)))
248
- if (($sbj = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($label), $sbj)))
249
- if (($sbj = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($level), $sbj)))
250
- if (($sbj = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $sbj)))
251
- if (($sbj = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $sbj)))
252
- if (($sbj = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $sbj)))
253
- if (($sbj = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $sbj)))
254
- if (($sbj = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $sbj)))
255
- if (($sbj = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $sbj)))
256
- if (($sbj = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $sbj)))
257
- if (($sbj = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $sbj)))
258
- if (($sbj = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $sbj)))
259
  {
260
  if (is_array($fields) && !empty($fields))
261
- foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
262
- if (!($sbj = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $sbj)))
263
- break;
264
-
265
- if (($msg = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]))
266
- if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim(@$cv[$1])', $msg)))
267
- if (($msg = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $msg)))
268
- if (($msg = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($role), $msg)))
269
- if (($msg = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($label), $msg)))
270
- if (($msg = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($level), $msg)))
271
- if (($msg = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $msg)))
272
- if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $msg)))
273
- if (($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $msg)))
274
- if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $msg)))
275
- if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $msg)))
276
- if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $msg)))
277
- if (($msg = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $msg)))
278
- if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $msg)))
279
- if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $msg)))
280
  {
281
  if (is_array($fields) && !empty($fields))
282
- foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
283
- if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $msg)))
284
- break;
285
-
286
- if (($sbj = trim (preg_replace ("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg)))) // Still have a ``$sbj`` and a ``$msg``?
287
- {
288
- if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
289
- {
290
- $sbj = c_ws_plugin__s2member_utilities::evl($sbj, get_defined_vars());
291
- $msg = c_ws_plugin__s2member_utilities::evl($msg, get_defined_vars());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  }
293
- c_ws_plugin__s2member_email_configs::email_config () . wp_mail ($user->user_email, apply_filters("ws_plugin__s2member_welcome_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__s2member_welcome_email_msg", $msg, get_defined_vars()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=UTF-8") . c_ws_plugin__s2member_email_configs::email_config_release ();
294
- }
295
- }
296
- }
297
  }
 
 
298
 
299
- if /* Send Admin(s) a notification? */ (in_array("admin", $notify))
300
- if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_recipients"])
301
- {
302
- $fields = get_user_option ("s2member_custom_fields", $user_id);
303
- $cv = preg_split ("/\|/", get_user_option ("s2member_custom", $user_id));
304
-
305
- $role = c_ws_plugin__s2member_user_access::user_access_role($user);
306
- $label = c_ws_plugin__s2member_user_access::user_access_label($user);
307
- $level = c_ws_plugin__s2member_user_access::user_access_level($user);
308
- $ccaps = implode(",", c_ws_plugin__s2member_user_access::user_access_ccaps($user));
309
-
310
- $user->user_email = ($user_email) ? $user_email : $user->user_email;
311
- $user_full_name = trim ($user->first_name . " " . $user->last_name);
312
- $user_ip = $_SERVER["REMOTE_ADDR"];
313
-
314
- if (($rec = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_recipients"]))
315
- if (($rec = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim(@$cv[$1])', $rec)))
316
- if (($rec = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $rec)))
317
- if (($rec = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($role), $rec)))
318
- if (($rec = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($label), $rec)))
319
- if (($rec = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($level), $rec)))
320
- if (($rec = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $rec)))
321
- if (($rec = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name)), $rec)))
322
- if (($rec = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name)), $rec)))
323
- if (($rec = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name)), $rec)))
324
- if (($rec = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $rec)))
325
- if (($rec = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $rec)))
326
- if (($rec = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $rec)))
327
- if (($rec = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $rec)))
328
- if (($rec = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $rec)))
329
- {
330
- if (is_array($fields) && !empty($fields))
331
- foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
332
- if (!($rec = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $rec)))
333
- break;
334
-
335
- if (($sbj = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_subject"]))
336
- if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim(@$cv[$1])', $sbj)))
337
- if (($sbj = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $sbj)))
338
- if (($sbj = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($role), $sbj)))
339
- if (($sbj = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($label), $sbj)))
340
- if (($sbj = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($level), $sbj)))
341
- if (($sbj = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $sbj)))
342
- if (($sbj = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $sbj)))
343
- if (($sbj = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $sbj)))
344
- if (($sbj = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $sbj)))
345
- if (($sbj = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $sbj)))
346
- if (($sbj = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $sbj)))
347
- if (($sbj = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $sbj)))
348
- if (($sbj = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $sbj)))
349
- if (($sbj = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $sbj)))
350
- {
351
- if (is_array($fields) && !empty($fields))
352
- foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
353
- if (!($sbj = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $sbj)))
354
- break;
355
-
356
- if (($msg = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_message"]))
357
- if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim(@$cv[$1])', $msg)))
358
- if (($msg = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $msg)))
359
- if (($msg = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($role), $msg)))
360
- if (($msg = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($label), $msg)))
361
- if (($msg = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($level), $msg)))
362
- if (($msg = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $msg)))
363
- if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $msg)))
364
- if (($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $msg)))
365
- if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $msg)))
366
- if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $msg)))
367
- if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $msg)))
368
- if (($msg = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $msg)))
369
- if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $msg)))
370
- if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $msg)))
371
- {
372
- if (is_array($fields) && !empty($fields))
373
- foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
374
- if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $msg)))
375
- break;
376
-
377
- if (($rec = trim (preg_replace ("/%%(.+?)%%/i", "", $rec))) && ($sbj = trim (preg_replace ("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg))))
378
- {
379
- if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
380
- {
381
- $rec = c_ws_plugin__s2member_utilities::evl($rec, get_defined_vars());
382
- $sbj = c_ws_plugin__s2member_utilities::evl($sbj, get_defined_vars());
383
- $msg = c_ws_plugin__s2member_utilities::evl($msg, get_defined_vars());
384
- }
385
- foreach /* A possible list of recipients. */ (c_ws_plugin__s2member_utils_strings::parse_emails ($rec) as $recipient)
386
- wp_mail ($recipient, apply_filters("ws_plugin__s2member_admin_new_user_email_sbj", $sbj, get_defined_vars()), apply_filters("ws_plugin__s2member_admin_new_user_email_msg", $msg, get_defined_vars()), "Content-Type: text/plain; charset=UTF-8");
387
- }
388
- }
389
- }
390
- }
391
- }
392
- if /* Back on? */ ($email_configs_were_on)
393
- c_ws_plugin__s2member_email_configs::email_config ();
394
-
395
- return apply_filters("ws_plugin__s2member_new_user_notification", true, get_defined_vars ());
396
  }
397
- else return apply_filters("ws_plugin__s2member_new_user_notification", false, get_defined_vars ());
398
  }
399
  }
400
  }
15
  * @since 3.5
16
  */
17
  if(!defined('WPINC')) // MUST have WordPress.
18
+ exit ('Do not access this file directly.');
19
 
20
+ if (!class_exists ('c_ws_plugin__s2member_email_configs'))
21
  {
22
  /**
23
  * Email configurations for s2Member.
34
  *
35
  * @package s2Member\Email_Configs
36
  * @since 3.5
 
 
37
  */
38
  public static function email_config ()
39
  {
40
+ do_action('ws_plugin__s2member_before_email_config', get_defined_vars ());
41
 
42
  c_ws_plugin__s2member_email_configs::email_config_release ();
43
 
44
+ add_filter ('wp_mail_from', 'c_ws_plugin__s2member_email_configs::_email_config_email');
45
+ add_filter ('wp_mail_from_name', 'c_ws_plugin__s2member_email_configs::_email_config_name');
 
 
46
 
47
+ do_action('ws_plugin__s2member_after_email_config', get_defined_vars ());
48
  }
49
+
50
  /**
51
  * A sort of callback function that applies the email Filter.
52
  *
53
  * @package s2Member\Email_Configs
54
  * @since 3.5
55
  *
56
+ * @attaches-to ``add_filter('wp_mail_from');``
57
  *
58
  * @param string $email Expects the email address to be passed in by the Filter.
59
  * @return string s2Member-configured email address.
60
  */
61
+ public static function _email_config_email ($email = '')
62
  {
63
+ do_action('_ws_plugin__s2member_before_email_config_email', get_defined_vars ());
64
 
65
+ return apply_filters('_ws_plugin__s2member_email_config_email', $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_email'], get_defined_vars ());
66
  }
67
+
68
  /**
69
  * A sort of callback function that applies the name Filter.
70
  *
71
  * @package s2Member\Email_Configs
72
  * @since 3.5
73
  *
74
+ * @attaches-to ``add_filter('wp_mail_from_name');``
75
  *
76
  * @param string $name Expects the name to be passed in by the Filter.
77
  * @return string s2Member-configured name.
78
  */
79
+ public static function _email_config_name ($name = '')
80
  {
81
+ do_action('_ws_plugin__s2member_before_email_config_name', get_defined_vars ());
82
 
83
+ return apply_filters('_ws_plugin__s2member_email_config_name', $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_name'], get_defined_vars ());
84
  }
85
+
86
  /**
87
  * Checks the status of Filters being applied to the email From: "Name" <address>.
88
  *
94
  */
95
  public static function email_config_status ($any = FALSE)
96
  {
97
+ do_action('ws_plugin__s2member_before_email_config_status', get_defined_vars ());
98
 
99
+ if (has_filter ('wp_mail_from', 'c_ws_plugin__s2member_email_configs::_email_config_email') || has_filter ('wp_mail_from_name', 'c_ws_plugin__s2member_email_configs::_email_config_name'))
100
+ return apply_filters('ws_plugin__s2member_email_config_status', true, get_defined_vars ());
101
 
102
+ else if ($any && (has_filter ('wp_mail_from') || has_filter ('wp_mail_from_name')))
103
+ return apply_filters('ws_plugin__s2member_email_config_status', true, get_defined_vars ());
104
 
105
+ return apply_filters('ws_plugin__s2member_email_config_status', false, get_defined_vars ());
106
  }
107
+
108
  /**
109
  * Releases Filters that modify the email From: "Name" <address>.
110
  *
112
  * @since 3.5
113
  *
114
  * @param bool $all Optional. Defaults to false. If true, remove ALL Filters, not just those applied by s2Member.
 
115
  */
116
  public static function email_config_release ($all = FALSE)
117
  {
118
+ do_action('ws_plugin__s2member_before_email_config_release', get_defined_vars ());
 
 
 
119
 
120
+ remove_filter ('wp_mail_from', 'c_ws_plugin__s2member_email_configs::_email_config_email');
121
+ remove_filter ('wp_mail_from_name', 'c_ws_plugin__s2member_email_configs::_email_config_name');
122
 
123
+ if ($all) // If ``$all`` is true, remove ALL attached WordPress Filters.
124
+ remove_all_filters ('wp_mail_from') . remove_all_filters ('wp_mail_from_name');
125
 
126
+ do_action('ws_plugin__s2member_after_email_config_release', get_defined_vars ());
127
  }
128
+
129
  /**
130
  * Converts primitive Role names in emails sent by WordPress.
131
  *
134
  * @package s2Member\Email_Configs
135
  * @since 3.5
136
  *
137
+ * @attaches-to ``add_filter('wpmu_signup_user_notification_email');``
138
  *
139
  * @param string $message Expects the message string to be passed in by the Filter.
140
  * @return string Message after having been Filtered by s2Member.
141
  */
142
+ public static function ms_nice_email_roles ($message = '')
143
  {
144
  foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
145
+ do_action('ws_plugin__s2member_before_ms_nice_email_roles', get_defined_vars ());
146
+ unset($__refs, $__v); // Housekeeping.
147
 
148
+ $message = preg_replace ('/ as a (subscriber|s2member_level[0-9]+)/i', ' ' . _x ('as a Member', 's2member-front', 's2member'), $message);
149
 
150
+ return apply_filters('ws_plugin__s2member_ms_nice_email_roles', $message, get_defined_vars ());
151
  }
152
+
153
  /**
154
  * Filters email addresses passed to ``wp_mail()``.
155
  *
156
  * @package s2Member\Email_Configs
157
  * @since 3.5
158
  *
159
+ * @attaches-to ``add_filter('wp_mail');``
160
  * @uses {@link s2Member\Utilities\c_ws_plugin__s2member_utils_strings::parse_emails()}
161
  *
162
  * @param array $array Expects an array passed through by the Filter.
163
  * @return array Returns the array passed through by the Filter.
164
  */
165
+ public static function email_filter ($array = array())
166
  {
167
+ if (isset ($array['to']) && !empty($array['to'])) // Filter list of recipients?
168
  // Reduces `"Name" <email>`, to just an email address *(for best cross-platform compatibility across various MTAs)*.
169
  // Also works around bug in PHP versions prior to fix in 5.2.11. See bug report: <https://bugs.php.net/bug.php?id=28038>.
170
  // Also supplements WordPress. WordPress currently does NOT support semicolon `;` delimitation, s2Member does.
171
+ $array['to'] = implode (',', c_ws_plugin__s2member_utils_strings::parse_emails ($array['to']));
172
 
173
+ return apply_filters('ws_plugin__s2member_after_email_filter', $array, get_defined_vars ());
174
  }
175
+
176
  /**
177
  * Resets a User/Member password and resends the New User Notification email message (to the User/Member only).
178
  *
187
  * @param string $user_email Optional. This defaults to the user's currently configured email address.
188
  * @return bool True if all required parameters are supplied, else false.
189
  */
190
+ public static function reset_pass_resend_new_user_notification ($user_id = 0, $user_pass = '', $notify = array('user'), $user_email = '')
191
  {
192
  foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
193
+ do_action('ws_plugin__s2member_before_reset_pass_resend_new_user_notification', get_defined_vars ());
194
+ unset($__refs, $__v); // Housekeeping.
195
 
196
+ $user_id = (integer)$user_id;
197
+ $user_pass = (string)$user_pass;
198
+ $notify = (array)$notify;
199
+ $user_email = (string)$user_email;
200
 
201
+ if ($user_id && ($user = new WP_User ($user_id)) && !empty($user->ID) && ($user_id = $user->ID) && $notify)
202
+ {
203
+ remove_filter('random_password', 'c_ws_plugin__s2member_registrations::generate_password');
204
+ $user_pass = $user_pass ? $user_pass : wp_generate_password(); // ↑ Make sure it's w/o filter.
205
  wp_set_password($user_pass, $user_id);
206
 
207
  $return = c_ws_plugin__s2member_email_configs::new_user_notification($user_id, $user_pass, $notify, $user_email);
208
  }
209
+ return apply_filters('ws_plugin__s2member_reset_pass_resend_new_user_notification', !empty($return) ? true : false, get_defined_vars ());
210
  }
211
+
212
  /**
213
  * Handles new User/Member notifications.
214
  *
222
  * @param string $user_email Optional. This defaults to the user's currently configured email address.
223
  * @return bool True if all required parameters are supplied, else false.
224
  */
225
+ public static function new_user_notification ($user_id = 0, $user_pass = '', $notify = array('user', 'admin'), $user_email = '')
226
  {
227
  foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
228
+ do_action('ws_plugin__s2member_before_new_user_notification', get_defined_vars ());
229
+ unset($__refs, $__v); // Housekeeping.
230
 
231
+ $user_id = (integer)$user_id;
232
+ $user_pass = (string)$user_pass;
233
+ $notify = (array)$notify;
234
+ $user_email = (string)$user_email;
235
+
236
+ if ($user_id && ($user = new WP_User($user_id)) && !empty($user->ID) && ($user_id = $user->ID) && $notify)
237
  {
238
+ $is_gte_wp43 = version_compare(get_bloginfo('version'), '4.3', '>=');
239
+
240
  $email_configs_were_on = c_ws_plugin__s2member_email_configs::email_config_status ();
241
  c_ws_plugin__s2member_email_configs::email_config_release ();
242
 
243
+ if (in_array('user', $notify, true)
244
+
245
+ // Exclude custom password generated via `wp-login.php` or BP.
246
+ && empty($GLOBALS['ws_plugin__s2member_custom_wp_login_bp_password'])
247
+
248
+ && ( // One of these conditions must be true.
249
+ ($user_pass && stripos($GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_email_message'], '%%user_pass%%') !== false)
250
+ || ($is_gte_wp43 && stripos($GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_email_message'], '%%wp_set_pass_url%%') !== false)
251
+ || ($is_gte_wp43 && stripos(($GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_email_message'] = sprintf(_x("Your Username/Password for:\n%s\n\nUsername: %%%%user_login%%%%\nTo set your password, visit: %%%%wp_set_pass_url%%%%\n\n%%%%wp_login_url%%%%", 's2member-front', 's2member'), get_bloginfo('name'))), '%%wp_set_pass_url%%') !== false)
252
+ )
253
+ ) {
254
+ if($is_gte_wp43 && stripos($GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_email_message'], '%%wp_set_pass_url%%') !== false)
255
+ {
256
+ remove_filter('random_password', 'c_ws_plugin__s2member_registrations::generate_password');
257
+ $user_activation_key = wp_generate_password(20, false); // ↑ Make sure it's w/o filter.
258
+ do_action('retrieve_password_key', $user->user_login, $user_activation_key);
259
+
260
+ if(!class_exists('PasswordHash'))
261
+ require_once ABSPATH.WPINC.'/class-phpass.php';
262
+ $wp_hasher = new PasswordHash(8, true);
263
+
264
+ $user_activation_key_hash = time().':'.$wp_hasher->HashPassword($user_activation_key);
265
+ $GLOBALS['wpdb']->update($GLOBALS['wpdb']->users, array('user_activation_key' => $user_activation_key_hash), array('user_login' => $user->user_login));
266
+
267
+ $wp_set_pass_url_args = array(
268
+ 'action' => 'rp',
269
+ 'key' => $user_activation_key,
270
+ 'login' => $user->user_login,
271
+ );
272
+ $wp_set_pass_url = add_query_arg(urlencode_deep($wp_set_pass_url_args), wp_login_url());
273
+ }
274
+ else $wp_set_pass_url = wp_lostpassword_url(); // Default behavior; and older versions of WordPress.
275
+
276
+ $fields = get_user_option ('s2member_custom_fields', $user_id);
277
+ $cv = preg_split ('/\|/', get_user_option ('s2member_custom', $user_id));
278
+
279
+ $role = c_ws_plugin__s2member_user_access::user_access_role($user);
280
+ $label = c_ws_plugin__s2member_user_access::user_access_label($user);
281
+ $level = c_ws_plugin__s2member_user_access::user_access_level($user);
282
+ $ccaps = implode(',', c_ws_plugin__s2member_user_access::user_access_ccaps($user));
283
+
284
+ $user->user_email = ($user_email) ? $user_email : $user->user_email;
285
+ $user_full_name = trim ($user->first_name . ' ' . $user->last_name);
286
+ $user_ip = $_SERVER['REMOTE_ADDR'];
287
+
288
+ if (($sbj = $GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_email_subject']))
289
+ if (($sbj = preg_replace ('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $sbj)))
290
+ if (($sbj = preg_replace ('/%%wp_set_pass_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($wp_set_pass_url), $sbj)))
291
+ if (($sbj = preg_replace ('/%%wp_login_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $sbj)))
292
+ if (($sbj = preg_replace ('/%%role%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($role), $sbj)))
293
+ if (($sbj = preg_replace ('/%%label%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($label), $sbj)))
294
+ if (($sbj = preg_replace ('/%%level%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($level), $sbj)))
295
+ if (($sbj = preg_replace ('/%%ccaps%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $sbj)))
296
+ if (($sbj = preg_replace ('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $sbj)))
297
+ if (($sbj = preg_replace ('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $sbj)))
298
+ if (($sbj = preg_replace ('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $sbj)))
299
+ if (($sbj = preg_replace ('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $sbj)))
300
+ if (($sbj = preg_replace ('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $sbj)))
301
+ if (($sbj = preg_replace ('/%%user_pass%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $sbj)))
302
+ if (($sbj = preg_replace ('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $sbj)))
303
+ if (($sbj = preg_replace ('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $sbj)))
304
+ {
305
+ if (is_array($fields) && !empty($fields))
306
+ foreach ($fields as $var => $val) // Custom Registration/Profile Fields.
307
+ if (!($sbj = preg_replace ('/%%' . preg_quote ($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $sbj)))
308
+ break; // Empty; we can stop here.
309
+
310
+ if (($msg = $GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_email_message']))
311
+ if (($msg = preg_replace ('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $msg)))
312
+ if (($msg = preg_replace ('/%%wp_set_pass_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($wp_set_pass_url), $msg)))
313
+ if (($msg = preg_replace ('/%%wp_login_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $msg)))
314
+ if (($msg = preg_replace ('/%%role%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($role), $msg)))
315
+ if (($msg = preg_replace ('/%%label%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($label), $msg)))
316
+ if (($msg = preg_replace ('/%%level%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($level), $msg)))
317
+ if (($msg = preg_replace ('/%%ccaps%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $msg)))
318
+ if (($msg = preg_replace ('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $msg)))
319
+ if (($msg = preg_replace ('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $msg)))
320
+ if (($msg = preg_replace ('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $msg)))
321
+ if (($msg = preg_replace ('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $msg)))
322
+ if (($msg = preg_replace ('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $msg)))
323
+ if (($msg = preg_replace ('/%%user_pass%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $msg)))
324
+ if (($msg = preg_replace ('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $msg)))
325
+ if (($msg = preg_replace ('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $msg)))
326
+ {
327
+ if (is_array($fields) && !empty($fields))
328
+ foreach ($fields as $var => $val) // Custom Registration/Profile Fields.
329
+ if (!($msg = preg_replace ('/%%' . preg_quote ($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $msg)))
330
+ break; // Empty; we can stop here.
331
+
332
+ if (($sbj = trim (preg_replace ('/%%(.+?)%%/i', '', $sbj))) && ($msg = trim (preg_replace ('/%%(.+?)%%/i', '', $msg))))
333
+ {
334
+ if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
335
+ {
336
+ $sbj = c_ws_plugin__s2member_utilities::evl($sbj, get_defined_vars());
337
+ $msg = c_ws_plugin__s2member_utilities::evl($msg, get_defined_vars());
338
+ }
339
+ c_ws_plugin__s2member_email_configs::email_config () . wp_mail ($user->user_email, apply_filters('ws_plugin__s2member_welcome_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_welcome_email_msg', $msg, get_defined_vars()), 'From: "' . preg_replace ('/"/', "'", $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_name']) . '" <' . $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_email'] . '>'."\r\n".'Content-Type: text/plain; charset=UTF-8') . c_ws_plugin__s2member_email_configs::email_config_release ();
340
+ }
341
+ }
342
+ }
343
+ }
344
+ if (in_array('admin', $notify, true) && $GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_admin_email_recipients'])
345
  {
346
+ $fields = get_user_option ('s2member_custom_fields', $user_id);
347
+ $cv = preg_split ('/\|/', get_user_option ('s2member_custom', $user_id));
348
 
349
  $role = c_ws_plugin__s2member_user_access::user_access_role($user);
350
  $label = c_ws_plugin__s2member_user_access::user_access_label($user);
351
  $level = c_ws_plugin__s2member_user_access::user_access_level($user);
352
+ $ccaps = implode(',', c_ws_plugin__s2member_user_access::user_access_ccaps($user));
353
 
354
  $user->user_email = ($user_email) ? $user_email : $user->user_email;
355
+ $user_full_name = trim ($user->first_name . ' ' . $user->last_name);
356
+ $user_ip = $_SERVER['REMOTE_ADDR'];
357
+
358
+ if (($rec = $GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_admin_email_recipients']))
359
+ if (($rec = preg_replace ('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $rec)))
360
+ if (($rec = preg_replace ('/%%wp_login_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $rec)))
361
+ if (($rec = preg_replace ('/%%role%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($role), $rec)))
362
+ if (($rec = preg_replace ('/%%label%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($label), $rec)))
363
+ if (($rec = preg_replace ('/%%level%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($level), $rec)))
364
+ if (($rec = preg_replace ('/%%ccaps%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $rec)))
365
+ if (($rec = preg_replace ('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name)), $rec)))
366
+ if (($rec = preg_replace ('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name)), $rec)))
367
+ if (($rec = preg_replace ('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name)), $rec)))
368
+ if (($rec = preg_replace ('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $rec)))
369
+ if (($rec = preg_replace ('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $rec)))
370
+ if (($rec = preg_replace ('/%%user_pass%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $rec)))
371
+ if (($rec = preg_replace ('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $rec)))
372
+ if (($rec = preg_replace ('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $rec)))
373
  {
374
  if (is_array($fields) && !empty($fields))
375
+ foreach ($fields as $var => $val) // Custom Registration/Profile Fields.
376
+ if (!($rec = preg_replace ('/%%' . preg_quote ($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $rec)))
377
+ break; // Empty; we can stop here.
378
+
379
+ if (($sbj = $GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_admin_email_subject']))
380
+ if (($sbj = preg_replace ('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $sbj)))
381
+ if (($sbj = preg_replace ('/%%wp_login_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $sbj)))
382
+ if (($sbj = preg_replace ('/%%role%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($role), $sbj)))
383
+ if (($sbj = preg_replace ('/%%label%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($label), $sbj)))
384
+ if (($sbj = preg_replace ('/%%level%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($level), $sbj)))
385
+ if (($sbj = preg_replace ('/%%ccaps%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $sbj)))
386
+ if (($sbj = preg_replace ('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $sbj)))
387
+ if (($sbj = preg_replace ('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $sbj)))
388
+ if (($sbj = preg_replace ('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $sbj)))
389
+ if (($sbj = preg_replace ('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $sbj)))
390
+ if (($sbj = preg_replace ('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $sbj)))
391
+ if (($sbj = preg_replace ('/%%user_pass%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $sbj)))
392
+ if (($sbj = preg_replace ('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $sbj)))
393
+ if (($sbj = preg_replace ('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $sbj)))
394
  {
395
  if (is_array($fields) && !empty($fields))
396
+ foreach ($fields as $var => $val) // Custom Registration/Profile Fields.
397
+ if (!($sbj = preg_replace ('/%%' . preg_quote ($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $sbj)))
398
+ break; // Empty; we can stop here.
399
+
400
+ if (($msg = $GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_admin_email_message']))
401
+ if (($msg = preg_replace ('/%%cv([0-9]+)%%/ei', 'trim(@$cv[$1])', $msg)))
402
+ if (($msg = preg_replace ('/%%wp_login_url%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $msg)))
403
+ if (($msg = preg_replace ('/%%role%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($role), $msg)))
404
+ if (($msg = preg_replace ('/%%label%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($label), $msg)))
405
+ if (($msg = preg_replace ('/%%level%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($level), $msg)))
406
+ if (($msg = preg_replace ('/%%ccaps%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $msg)))
407
+ if (($msg = preg_replace ('/%%user_first_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $msg)))
408
+ if (($msg = preg_replace ('/%%user_last_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $msg)))
409
+ if (($msg = preg_replace ('/%%user_full_name%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $msg)))
410
+ if (($msg = preg_replace ('/%%user_email%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $msg)))
411
+ if (($msg = preg_replace ('/%%user_login%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $msg)))
412
+ if (($msg = preg_replace ('/%%user_pass%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $msg)))
413
+ if (($msg = preg_replace ('/%%user_ip%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $msg)))
414
+ if (($msg = preg_replace ('/%%user_id%%/i', c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $msg)))
415
+ {
416
+ if (is_array($fields) && !empty($fields))
417
+ foreach ($fields as $var => $val) // Custom Registration/Profile Fields.
418
+ if (!($msg = preg_replace ('/%%' . preg_quote ($var, '/') . '%%/i', c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $msg)))
419
+ break; // Empty; we can stop here.
420
+
421
+ if (($rec = trim (preg_replace ('/%%(.+?)%%/i', '', $rec))) && ($sbj = trim (preg_replace ('/%%(.+?)%%/i', '', $sbj))) && ($msg = trim (preg_replace ('/%%(.+?)%%/i', '', $msg))))
422
+ {
423
+ if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
424
+ {
425
+ $rec = c_ws_plugin__s2member_utilities::evl($rec, get_defined_vars());
426
+ $sbj = c_ws_plugin__s2member_utilities::evl($sbj, get_defined_vars());
427
+ $msg = c_ws_plugin__s2member_utilities::evl($msg, get_defined_vars());
428
+ }
429
+ foreach (c_ws_plugin__s2member_utils_strings::parse_emails ($rec) as $recipient) // A list of receipients.
430
+ wp_mail ($recipient, apply_filters('ws_plugin__s2member_admin_new_user_email_sbj', $sbj, get_defined_vars()), apply_filters('ws_plugin__s2member_admin_new_user_email_msg', $msg, get_defined_vars()), 'Content-Type: text/plain; charset=UTF-8');
431
+ }
432
+ }
433
  }
434
+ }
 
 
 
435
  }
436
+ if ($email_configs_were_on) // Restore?
437
+ c_ws_plugin__s2member_email_configs::email_config();
438
 
439
+ return apply_filters('ws_plugin__s2member_new_user_notification', true, get_defined_vars ());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  }
441
+ return apply_filters('ws_plugin__s2member_new_user_notification', false, get_defined_vars ());
442
  }
443
  }
444
  }
includes/classes/registrations.inc.php CHANGED
@@ -28,45 +28,74 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
28
  class c_ws_plugin__s2member_registrations
29
  {
30
  /**
31
- * Filters WordPress randomly generated Passwords.
32
  *
33
- * Also captures Passwords generated by WordPress
34
- * *(with a global var)*, for internal use.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  *
36
  * @package s2Member\Registrations
37
  * @since 3.5
38
  *
39
  * @attaches-to ``add_filter('random_password');``
40
  *
41
- * @param string $password Expects a plain text Password passed through by the Filter.
42
  *
43
- * @return string Password, possibly assigned through s2Member Custom Registration/Profile Field input.
44
  */
45
  public static function generate_password($password = '')
46
  {
 
 
47
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
48
  do_action('ws_plugin__s2member_before_generate_password', get_defined_vars());
49
- unset($__refs, $__v);
50
 
51
- if($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_password'] || (c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op('create_user')))
52
- {
53
- if($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_password'] && !empty($_POST['ws_plugin__s2member_custom_reg_field_user_pass1']))
54
- {
55
- if(($custom = trim(stripslashes((string)$_POST['ws_plugin__s2member_custom_reg_field_user_pass1']))))
56
- $password = $custom; // Yes, use s2Member custom Password supplied by User.
57
- }
58
- else if($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_password'] && !empty($GLOBALS['ws_plugin__s2member_registration_vars']) && !empty($GLOBALS['ws_plugin__s2member_registration_vars']['ws_plugin__s2member_custom_reg_field_user_pass1']))
59
- {
60
- if(($custom = trim((string)$GLOBALS['ws_plugin__s2member_registration_vars']['ws_plugin__s2member_custom_reg_field_user_pass1'])))
61
- $password = $custom; // Yes, use s2Member custom Password supplied by User.
62
- }
63
- else if(c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op('create_user') && !empty($GLOBALS['ws_plugin__s2member_generate_password_return']))
64
  {
65
- if(($custom = trim(stripslashes((string)$GLOBALS['ws_plugin__s2member_generate_password_return']))))
66
- $password = $custom; // Yes, use s2Member custom Password supplied by Remote Op.
 
 
 
 
 
 
 
 
 
 
67
  }
68
- }
69
- return apply_filters('ws_plugin__s2member_generate_password', ($GLOBALS['ws_plugin__s2member_generate_password_return'] = $password), get_defined_vars());
70
  }
71
 
72
  /**
@@ -91,7 +120,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
91
  {
92
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
93
  do_action('ws_plugin__s2member_before_custom_registration_field_errors', get_defined_vars());
94
- unset($__refs, $__v);
95
 
96
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
97
 
@@ -126,7 +155,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
126
  {
127
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
128
  do_action('ws_plugin__s2member_before_custom_registration_field_errors_4bp', get_defined_vars());
129
- unset($__refs, $__v);
130
 
131
  if(!is_admin() && c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_register_page())
132
  if(in_array('registration', $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields_4bp']))
@@ -165,7 +194,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
165
  {
166
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
167
  do_action('ws_plugin__s2member_before_ms_validate_user_signup', get_defined_vars());
168
- unset($__refs, $__v);
169
 
170
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
171
 
@@ -183,7 +212,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
183
  }
184
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
185
  do_action('ws_plugin__s2member_during_ms_validate_user_signup', get_defined_vars());
186
- unset($__refs, $__v);
187
  }
188
  return apply_filters('ws_plugin__s2member_ms_validate_user_signup', $result, get_defined_vars());
189
  }
@@ -243,7 +272,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
243
 
244
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
245
  do_action('ws_plugin__s2member_before_ms_process_signup_meta', get_defined_vars());
246
- unset($__refs, $__v);
247
 
248
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
249
 
@@ -287,7 +316,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
287
  {
288
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
289
  do_action('ws_plugin__s2member_before_ms_activate_existing_user', get_defined_vars());
290
- unset($__refs, $__v);
291
 
292
  extract($vars); // Extract all variables from ``wpmu_activate_signup()`` function.
293
 
@@ -333,7 +362,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
333
 
334
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
335
  do_action('ws_plugin__s2member_before_configure_user_on_ms_user_activation', get_defined_vars());
336
- unset($__refs, $__v);
337
 
338
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
339
 
@@ -371,7 +400,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
371
  {
372
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
373
  do_action('ws_plugin__s2member_before_configure_user_on_ms_blog_activation', get_defined_vars());
374
- unset($__refs, $__v);
375
 
376
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
377
 
@@ -395,7 +424,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
395
  {
396
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
397
  do_action('ws_plugin__s2member_before_bp_user_activation', get_defined_vars());
398
- unset($__refs, $__v);
399
 
400
  if(is_multisite() || !$user_id) return; // Nothing to do.
401
 
@@ -437,7 +466,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
437
  {
438
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
439
  do_action('ws_plugin__s2member_before_ms_register_existing_user', get_defined_vars());
440
- unset($__refs, $__v);
441
 
442
  /** @var $ms_errors WP_Error Reference for IDEs. This is needed below. */
443
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
@@ -454,13 +483,20 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
454
 
455
  if(empty($other_important_errors_exist)) // Only if/when NO other important errors exist already.
456
  {
457
- $user_pass = wp_generate_password(); // A new Password for this User/Member will be generated now.
 
 
458
  c_ws_plugin__s2member_registrations::ms_create_existing_user($user_login, $user_email, $user_pass, $user_id);
459
- update_user_option($user_id, 'default_password_nag', TRUE, TRUE); // Setup Password-change nag screen.
460
- wp_new_user_notification($user_id, $user_pass); // Welcome email, just like ``register_new_user()``.
461
 
462
- $redirect_to = (!empty($_REQUEST['redirect_to'])) ? trim(stripslashes($_REQUEST['redirect_to'])) : FALSE;
463
- $redirect_to = ($redirect_to) ? $redirect_to : add_query_arg('checkemail', urlencode('registered'), wp_login_url());
 
 
 
 
 
 
 
464
 
465
  do_action('ws_plugin__s2member_during_ms_register_existing_user', get_defined_vars());
466
 
@@ -495,7 +531,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
495
  {
496
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
497
  do_action('ws_plugin__s2member_before_ms_create_existing_user', get_defined_vars());
498
- unset($__refs, $__v);
499
 
500
  if(is_multisite()) // This event should ONLY be processed with Multisite Networking.
501
  {
@@ -543,7 +579,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
543
 
544
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
545
  do_action('ws_plugin__s2member_before_configure_user_registration', get_defined_vars());
546
- unset($__refs, $__v);
547
 
548
  // With Multisite Networking, we need this to run on `user_register` ahead of `wpmu_activate_[user|blog]`.
549
  if(!isset ($email_config) && ($email_config = TRUE)) // Anytime this routine is fired; we configure email.
@@ -639,8 +675,8 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
639
  $name = trim($fname.' '.$lname); // Both names.
640
 
641
  if(!($pass = $password)) // Try s2Member's generator.
642
- if(!empty($GLOBALS['ws_plugin__s2member_generate_password_return']))
643
- $pass = (string)$GLOBALS['ws_plugin__s2member_generate_password_return'];
644
 
645
  if(!$pass) // Also try BuddyPress Password.
646
  if(!empty($_pmr['signup_password'])) // BuddyPress?
@@ -814,8 +850,8 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
814
  $name = trim($fname.' '.$lname); // Both names.
815
 
816
  if(!($pass = $password)) // Try s2Member's generator.
817
- if(!empty($GLOBALS['ws_plugin__s2member_generate_password_return']))
818
- $pass = (string)$GLOBALS['ws_plugin__s2member_generate_password_return'];
819
 
820
  if(!$pass) // Also try BuddyPress Password.
821
  if(!empty($_pmr['signup_password'])) // BuddyPress?
@@ -955,8 +991,8 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
955
  $name = trim($fname.' '.$lname); // Both names.
956
 
957
  if(!($pass = $password)) // Try s2Member's generator.
958
- if(!empty($GLOBALS['ws_plugin__s2member_generate_password_return']))
959
- $pass = (string)$GLOBALS['ws_plugin__s2member_generate_password_return'];
960
 
961
  if(!$pass) // Also try the `Users → Add New` form.
962
  if(!empty($_pmr['pass1'])) // Field in `/user-new.php`.
@@ -1202,7 +1238,7 @@ if(!class_exists('c_ws_plugin__s2member_registrations'))
1202
  }
1203
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
1204
  do_action('ws_plugin__s2member_after_configure_user_registration', get_defined_vars());
1205
- unset($__refs, $__v);
1206
  }
1207
  }
1208
- }
28
  class c_ws_plugin__s2member_registrations
29
  {
30
  /**
31
+ * Custom password; else randomly generated password.
32
  *
33
+ * @package s2Member\Registrations
34
+ * @since 150826
35
+ *
36
+ * @param string $password Expects plain text pass.
37
+ *
38
+ * @return string Password.
39
+ */
40
+ public static function maybe_custom_pass(&$password)
41
+ {
42
+ $GLOBALS['ws_plugin__s2member_custom_password'] = ''; // Initialize.
43
+ $password = trim(stripslashes((string)$password));
44
+
45
+ if($password && $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_password'])
46
+ {
47
+ $GLOBALS['ws_plugin__s2member_custom_password'] = $password;
48
+ return ($GLOBALS['ws_plugin__s2member_plain_text_pass'] = $GLOBALS['ws_plugin__s2member_custom_password']);
49
+ }
50
+ if($password && c_ws_plugin__s2member_utils_conds::pro_is_installed() && c_ws_plugin__s2member_pro_remote_ops::is_remote_op('create_user'))
51
+ {
52
+ $GLOBALS['ws_plugin__s2member_custom_password'] = $password;
53
+ return ($GLOBALS['ws_plugin__s2member_plain_text_pass'] = $GLOBALS['ws_plugin__s2member_custom_password']);
54
+ }
55
+ return ($GLOBALS['ws_plugin__s2member_plain_text_pass'] = wp_generate_password());
56
+ }
57
+
58
+ /**
59
+ * Filters WordPress-generated passwords.
60
+ *
61
+ * This can ONLY be fired through `/wp-login.php` on the front-side.
62
+ * Or through `/register` via BuddyPress.
63
  *
64
  * @package s2Member\Registrations
65
  * @since 3.5
66
  *
67
  * @attaches-to ``add_filter('random_password');``
68
  *
69
+ * @param string $password Expects a plain text password passed through by the filter.
70
  *
71
+ * @return string Plain text password value.
72
  */
73
  public static function generate_password($password = '')
74
  {
75
+ static $did_generate_password = false; // Once only.
76
+
77
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
78
  do_action('ws_plugin__s2member_before_generate_password', get_defined_vars());
79
+ unset($__refs, $__v); // Housekeeping.
80
 
81
+ $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
82
+
83
+ if(!$did_generate_password && !is_admin() && (preg_match('/\/wp-login\.php/'.$ci, $_SERVER['REQUEST_URI']) || (c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_register_page())))
 
 
 
 
 
 
 
 
 
 
84
  {
85
+ $GLOBALS['ws_plugin__s2member_custom_wp_login_bp_password'] = false; // Initialize.
86
+
87
+ if(!empty($_POST['ws_plugin__s2member_custom_reg_field_user_pass1']) && preg_match('/\/wp-login\.php/'.$ci, $_SERVER['REQUEST_URI']))
88
+ {
89
+ $password = self::maybe_custom_pass($_POST['ws_plugin__s2member_custom_reg_field_user_pass1']);
90
+ $GLOBALS['ws_plugin__s2member_custom_wp_login_bp_password'] = !empty($GLOBALS['ws_plugin__s2member_custom_password']) && $password === $GLOBALS['ws_plugin__s2member_custom_password'];
91
+ }
92
+ $GLOBALS['ws_plugin__s2member_plain_text_wp_login_bp_pass'] = $password; // Plain-text password.
93
+ $GLOBALS['ws_plugin__s2member_plain_text_pass'] = $password; // Plain-text password.
94
+
95
+ remove_filter('random_password', 'c_ws_plugin__s2member_registrations::generate_password');
96
+ $did_generate_password = true; // One time only.
97
  }
98
+ return apply_filters('ws_plugin__s2member_generate_password', $password, get_defined_vars());
 
99
  }
100
 
101
  /**
120
  {
121
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
122
  do_action('ws_plugin__s2member_before_custom_registration_field_errors', get_defined_vars());
123
+ unset($__refs, $__v); // Housekeeping.
124
 
125
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
126
 
155
  {
156
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
157
  do_action('ws_plugin__s2member_before_custom_registration_field_errors_4bp', get_defined_vars());
158
+ unset($__refs, $__v); // Housekeeping.
159
 
160
  if(!is_admin() && c_ws_plugin__s2member_utils_conds::bp_is_installed() && bp_is_register_page())
161
  if(in_array('registration', $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields_4bp']))
194
  {
195
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
196
  do_action('ws_plugin__s2member_before_ms_validate_user_signup', get_defined_vars());
197
+ unset($__refs, $__v); // Housekeeping.
198
 
199
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
200
 
212
  }
213
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
214
  do_action('ws_plugin__s2member_during_ms_validate_user_signup', get_defined_vars());
215
+ unset($__refs, $__v); // Housekeeping.
216
  }
217
  return apply_filters('ws_plugin__s2member_ms_validate_user_signup', $result, get_defined_vars());
218
  }
272
 
273
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
274
  do_action('ws_plugin__s2member_before_ms_process_signup_meta', get_defined_vars());
275
+ unset($__refs, $__v); // Housekeeping.
276
 
277
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
278
 
316
  {
317
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
318
  do_action('ws_plugin__s2member_before_ms_activate_existing_user', get_defined_vars());
319
+ unset($__refs, $__v); // Housekeeping.
320
 
321
  extract($vars); // Extract all variables from ``wpmu_activate_signup()`` function.
322
 
362
 
363
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
364
  do_action('ws_plugin__s2member_before_configure_user_on_ms_user_activation', get_defined_vars());
365
+ unset($__refs, $__v); // Housekeeping.
366
 
367
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
368
 
400
  {
401
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
402
  do_action('ws_plugin__s2member_before_configure_user_on_ms_blog_activation', get_defined_vars());
403
+ unset($__refs, $__v); // Housekeeping.
404
 
405
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
406
 
424
  {
425
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
426
  do_action('ws_plugin__s2member_before_bp_user_activation', get_defined_vars());
427
+ unset($__refs, $__v); // Housekeeping.
428
 
429
  if(is_multisite() || !$user_id) return; // Nothing to do.
430
 
466
  {
467
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
468
  do_action('ws_plugin__s2member_before_ms_register_existing_user', get_defined_vars());
469
+ unset($__refs, $__v); // Housekeeping.
470
 
471
  /** @var $ms_errors WP_Error Reference for IDEs. This is needed below. */
472
  $ci = $GLOBALS['WS_PLUGIN__']['s2member']['o']['ruris_case_sensitive'] ? '' : 'i';
483
 
484
  if(empty($other_important_errors_exist)) // Only if/when NO other important errors exist already.
485
  {
486
+ $user_pass = wp_generate_password(); // Generate password for this user.
487
+ $has_custom_password = !empty($GLOBALS['ws_plugin__s2member_custom_password'])
488
+ && $user_pass === $GLOBALS['ws_plugin__s2member_custom_password'];
489
  c_ws_plugin__s2member_registrations::ms_create_existing_user($user_login, $user_email, $user_pass, $user_id);
 
 
490
 
491
+ update_user_option($user_id, 'default_password_nag', $has_custom_password ? false : true, true);
492
+
493
+ if (version_compare(get_bloginfo('version'), '4.3', '>='))
494
+ wp_new_user_notification($user_id, $has_custom_password ? 'admin' : 'both', $user_pass);
495
+ else wp_new_user_notification($user_id, $user_pass);
496
+
497
+ $redirect_to = !empty($_REQUEST['redirect_to']) ? trim(stripslashes($_REQUEST['redirect_to'])) : FALSE;
498
+ $redirect_to = $redirect_to ? $redirect_to // Note: the `checkemail` message is translated if using custom passwords.
499
+ : add_query_arg('checkemail', urlencode('registered'), wp_login_url());
500
 
501
  do_action('ws_plugin__s2member_during_ms_register_existing_user', get_defined_vars());
502
 
531
  {
532
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
533
  do_action('ws_plugin__s2member_before_ms_create_existing_user', get_defined_vars());
534
+ unset($__refs, $__v); // Housekeeping.
535
 
536
  if(is_multisite()) // This event should ONLY be processed with Multisite Networking.
537
  {
579
 
580
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
581
  do_action('ws_plugin__s2member_before_configure_user_registration', get_defined_vars());
582
+ unset($__refs, $__v); // Housekeeping.
583
 
584
  // With Multisite Networking, we need this to run on `user_register` ahead of `wpmu_activate_[user|blog]`.
585
  if(!isset ($email_config) && ($email_config = TRUE)) // Anytime this routine is fired; we configure email.
675
  $name = trim($fname.' '.$lname); // Both names.
676
 
677
  if(!($pass = $password)) // Try s2Member's generator.
678
+ if(!empty($GLOBALS['ws_plugin__s2member_plain_text_pass']))
679
+ $pass = (string)$GLOBALS['ws_plugin__s2member_plain_text_pass'];
680
 
681
  if(!$pass) // Also try BuddyPress Password.
682
  if(!empty($_pmr['signup_password'])) // BuddyPress?
850
  $name = trim($fname.' '.$lname); // Both names.
851
 
852
  if(!($pass = $password)) // Try s2Member's generator.
853
+ if(!empty($GLOBALS['ws_plugin__s2member_plain_text_pass']))
854
+ $pass = (string)$GLOBALS['ws_plugin__s2member_plain_text_pass'];
855
 
856
  if(!$pass) // Also try BuddyPress Password.
857
  if(!empty($_pmr['signup_password'])) // BuddyPress?
991
  $name = trim($fname.' '.$lname); // Both names.
992
 
993
  if(!($pass = $password)) // Try s2Member's generator.
994
+ if(!empty($GLOBALS['ws_plugin__s2member_plain_text_pass']))
995
+ $pass = (string)$GLOBALS['ws_plugin__s2member_plain_text_pass'];
996
 
997
  if(!$pass) // Also try the `Users → Add New` form.
998
  if(!empty($_pmr['pass1'])) // Field in `/user-new.php`.
1238
  }
1239
  foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $$__v;
1240
  do_action('ws_plugin__s2member_after_configure_user_registration', get_defined_vars());
1241
+ unset($__refs, $__v); // Housekeeping.
1242
  }
1243
  }
1244
+ }
includes/classes/ssl-in.inc.php CHANGED
@@ -44,7 +44,6 @@ if(!class_exists('c_ws_plugin__s2member_ssl_in'))
44
  *
45
  * @return null Possibly exiting script execution after redirection to SSL variation.
46
  *
47
- * @todo Add `form` to the array ``$non_ssl_attr_only_tags``?
48
  * @todo Cleanup this routine and convert callback functions to static class methods?
49
  */
50
  public static function force_ssl($vars = array()) // Phase 2 of ``c_ws_plugin__s2member_ssl::check_force_ssl()``.
@@ -78,58 +77,73 @@ if(!class_exists('c_ws_plugin__s2member_ssl_in'))
78
  define('_ws_plugin__s2member_force_ssl_host_port', $ssl_host_port);
79
 
80
  // Filter these. Do NOT create a sitewide conversion to `https`.
81
- add_filter('home_url', '_ws_plugin__s2member_force_non_ssl_scheme', 10, 3);
82
- add_filter('network_home_url', '_ws_plugin__s2member_force_non_ssl_scheme', 10, 3);
83
 
84
  // Filter these. Do NOT create a sitewide conversion to `https`.
85
- add_filter('site_url', '_ws_plugin__s2member_force_non_ssl_scheme', 10, 3);
86
- add_filter('network_site_url', '_ws_plugin__s2member_force_non_ssl_scheme', 10, 3);
87
 
88
- // These additional URLs are NOT Filtered by default; but can be if needed. Use these Filters.
89
- if(apply_filters('_ws_plugin__s2member_force_non_ssl_scheme_plugins_url', FALSE, get_defined_vars()))
90
- add_filter('plugins_url', '_ws_plugin__s2member_force_non_ssl_scheme', 10, 2);
91
-
92
- // These additional URLs are NOT Filtered by default; but can be if needed. Use these Filters.
93
- if(apply_filters('_ws_plugin__s2member_force_non_ssl_scheme_content_url', FALSE, get_defined_vars()))
94
- add_filter('content_url', '_ws_plugin__s2member_force_non_ssl_scheme', 10, 2);
95
 
96
  // Now we create various callback functions associated with SSL and non-SSL buffering.
97
  if(!function_exists('_ws_plugin__s2member_force_ssl_buffer_callback'))
98
  {
99
- function _ws_plugin__s2member_force_ssl_buffer_callback($m = FALSE)
100
  {
101
  $s = preg_replace('/http\:\/\//i', 'https://', $m[0]);
 
102
  if(_ws_plugin__s2member_force_ssl_host && _ws_plugin__s2member_force_ssl_port && _ws_plugin__s2member_force_ssl_host_port)
103
  $s = preg_replace('/(?:https?\:)?\/\/'.preg_quote(_ws_plugin__s2member_force_ssl_host, '/').'(?:\:[0-9]+)?/i', 'https://'._ws_plugin__s2member_force_ssl_host_port, $s);
104
- $s = (strtolower($m[1]) === 'link' && preg_match('/(["\'])(?:alternate|profile|pingback|EditURI|wlwmanifest|prev|next)\\1/i', $m[0])) ? $m[0] : $s;
 
105
 
106
  return $s; // Return string with conversions.
107
  }
108
  }
109
  if(!function_exists('_ws_plugin__s2member_force_non_ssl_buffer_callback'))
110
  {
111
- function _ws_plugin__s2member_force_non_ssl_buffer_callback($m = FALSE)
112
  {
113
- $s = preg_replace('/(?:https?\:)?\/\/'.preg_quote(_ws_plugin__s2member_force_ssl_host_port, '/').'/i', 'http://'._ws_plugin__s2member_force_ssl_host, $m[0]);
 
 
114
  $s = preg_replace('/(?:https?\:)?\/\/'.preg_quote(_ws_plugin__s2member_force_ssl_host, '/').'/i', 'http://'._ws_plugin__s2member_force_ssl_host, $s);
115
 
116
  return $s; // Return string with conversions.
117
  }
118
  }
119
- if(!function_exists('_ws_plugin__s2member_force_non_ssl_scheme'))
120
  {
121
- function _ws_plugin__s2member_force_non_ssl_scheme($url = FALSE, $path = FALSE, $scheme = FALSE)
122
  {
123
- if($scheme === 'relative')
 
 
 
 
 
 
 
124
  return $url; // Nothing to do in this case.
125
 
126
- if(!in_array($scheme, array('http', 'https'), TRUE)) // If NOT explicitly passed through.
127
  {
128
  if(($scheme === 'login_post' || $scheme === 'rpc') && (force_ssl_login() || force_ssl_admin()))
129
- $scheme = 'https';
130
 
131
  else if(($scheme === 'login' || $scheme === 'admin') && force_ssl_admin())
132
- $scheme = 'https';
 
 
 
 
 
133
 
134
  else $scheme = 'http'; // Default to non-SSL: `http`.
135
  }
@@ -138,7 +152,7 @@ if(!class_exists('c_ws_plugin__s2member_ssl_in'))
138
  }
139
  if(!function_exists('_ws_plugin__s2member_force_ssl_buffer'))
140
  {
141
- function _ws_plugin__s2member_force_ssl_buffer($buffer = FALSE)
142
  {
143
  $o_pcre = @ini_get('pcre.backtrack_limit'); // Record existing backtrack limit.
144
  @ini_set('pcre.backtrack_limit', 10000000); // Increase PCRE backtrack limit for this routine.
@@ -149,11 +163,11 @@ if(!class_exists('c_ws_plugin__s2member_ssl_in'))
149
  $ssl_attr_only_tags = array_unique(array_diff(array_map('strtolower', apply_filters('_ws_plugin__s2member_force_ssl_buffer_attr_only_tags', array('link', 'img', 'form', 'input'), get_defined_vars())), $ssl_entire_tags));
150
  $non_ssl_attr_only_tags = array_unique(array_diff(array_map('strtolower', apply_filters('_ws_plugin__s2member_force_non_ssl_buffer_attr_only_tags', array('a'), get_defined_vars())), $non_ssl_entire_tags));
151
 
152
- $buffer = ($ssl_entire_tags) ? preg_replace_callback('/\<('.implode('|', c_ws_plugin__s2member_utils_strings::preg_quote_deep($ssl_entire_tags, '/')).')(?![a-z_0-9\-])[^\>]*?\>.*?\<\/\\1\>/is', '_ws_plugin__s2member_force_ssl_buffer_callback', $buffer) : $buffer;
153
- $buffer = ($ssl_attr_only_tags) ? preg_replace_callback('/\<('.implode('|', c_ws_plugin__s2member_utils_strings::preg_quote_deep($ssl_attr_only_tags, '/')).')(?![a-z_0-9\-])[^\>]+?\>/i', '_ws_plugin__s2member_force_ssl_buffer_callback', $buffer) : $buffer;
154
 
155
- $buffer = ($non_ssl_entire_tags) ? preg_replace_callback('/\<('.implode('|', c_ws_plugin__s2member_utils_strings::preg_quote_deep($non_ssl_entire_tags, '/')).')(?![a-z_0-9\-])[^\>]*?\>.*?\<\/\\1\>/is', '_ws_plugin__s2member_force_non_ssl_buffer_callback', $buffer) : $buffer;
156
- $buffer = ($non_ssl_attr_only_tags) ? preg_replace_callback('/\<('.implode('|', c_ws_plugin__s2member_utils_strings::preg_quote_deep($non_ssl_attr_only_tags, '/')).')(?![a-z_0-9\-])[^\>]+?\>/i', '_ws_plugin__s2member_force_non_ssl_buffer_callback', $buffer) : $buffer;
157
 
158
  @ini_set('pcre.backtrack_limit', $o_pcre); // Restore original PCRE backtrack limit. This just keeps things tidy; probably NOT necessary.
159
 
44
  *
45
  * @return null Possibly exiting script execution after redirection to SSL variation.
46
  *
 
47
  * @todo Cleanup this routine and convert callback functions to static class methods?
48
  */
49
  public static function force_ssl($vars = array()) // Phase 2 of ``c_ws_plugin__s2member_ssl::check_force_ssl()``.
77
  define('_ws_plugin__s2member_force_ssl_host_port', $ssl_host_port);
78
 
79
  // Filter these. Do NOT create a sitewide conversion to `https`.
80
+ add_filter('home_url', '_ws_plugin__s2member_maybe_force_non_ssl_scheme', 10, 3);
81
+ add_filter('network_home_url', '_ws_plugin__s2member_maybe_force_non_ssl_scheme', 10, 3);
82
 
83
  // Filter these. Do NOT create a sitewide conversion to `https`.
84
+ add_filter('site_url', '_ws_plugin__s2member_maybe_force_non_ssl_scheme', 10, 3);
85
+ add_filter('network_site_url', '_ws_plugin__s2member_maybe_force_non_ssl_scheme', 10, 3);
86
 
87
+ // Filter these. Do NOT create a sitewide conversion to `https`.
88
+ // Note: these are necessary because these underlying functions create URLs in bits and pieces.
89
+ // Thus, in order to properly detect static file extensions we need to look at these values also.
90
+ add_filter('plugins_url', '_ws_plugin__s2member_maybe_force_non_ssl_scheme', 10, 2);
91
+ add_filter('content_url', '_ws_plugin__s2member_maybe_force_non_ssl_scheme', 10, 2);
92
+ add_filter('includes_url', '_ws_plugin__s2member_maybe_force_non_ssl_scheme', 10, 2);
 
93
 
94
  // Now we create various callback functions associated with SSL and non-SSL buffering.
95
  if(!function_exists('_ws_plugin__s2member_force_ssl_buffer_callback'))
96
  {
97
+ function _ws_plugin__s2member_force_ssl_buffer_callback($m = array())
98
  {
99
  $s = preg_replace('/http\:\/\//i', 'https://', $m[0]);
100
+
101
  if(_ws_plugin__s2member_force_ssl_host && _ws_plugin__s2member_force_ssl_port && _ws_plugin__s2member_force_ssl_host_port)
102
  $s = preg_replace('/(?:https?\:)?\/\/'.preg_quote(_ws_plugin__s2member_force_ssl_host, '/').'(?:\:[0-9]+)?/i', 'https://'._ws_plugin__s2member_force_ssl_host_port, $s);
103
+
104
+ $s = strtolower($m[1]) === 'link' && preg_match('/(["\'])(?:alternate|profile|pingback|EditURI|wlwmanifest|prev|next)\\1/i', $m[0]) ? $m[0] : $s;
105
 
106
  return $s; // Return string with conversions.
107
  }
108
  }
109
  if(!function_exists('_ws_plugin__s2member_force_non_ssl_buffer_callback'))
110
  {
111
+ function _ws_plugin__s2member_force_non_ssl_buffer_callback($m = array())
112
  {
113
+ $s = $m[0]; // Initialize the `$s` variable.
114
+
115
+ $s = preg_replace('/(?:https?\:)?\/\/'.preg_quote(_ws_plugin__s2member_force_ssl_host_port, '/').'/i', 'http://'._ws_plugin__s2member_force_ssl_host, $s);
116
  $s = preg_replace('/(?:https?\:)?\/\/'.preg_quote(_ws_plugin__s2member_force_ssl_host, '/').'/i', 'http://'._ws_plugin__s2member_force_ssl_host, $s);
117
 
118
  return $s; // Return string with conversions.
119
  }
120
  }
121
+ if(!function_exists('_ws_plugin__s2member_maybe_force_non_ssl_scheme'))
122
  {
123
+ function _ws_plugin__s2member_maybe_force_non_ssl_scheme($url = '', $path = '', $scheme = null)
124
  {
125
+ static $static_file_extensions; // Cache of static file extensions.
126
+ if(!isset($static_file_extensions)) // Cached this yet?
127
+ {
128
+ $wp_media_library_extensions = array_keys(wp_get_mime_types());
129
+ $wp_media_library_extensions = explode('|', strtolower(implode('|', $wp_media_library_extensions)));
130
+ $static_file_extensions = array_unique(array_merge($wp_media_library_extensions, array('eot', 'ttf', 'otf', 'woff')));
131
+ }
132
+ if($scheme === 'relative') // e.g. `/root/relative/path.ext`
133
  return $url; // Nothing to do in this case.
134
 
135
+ if(!in_array($scheme, array('http', 'https'), TRUE)) // If NOT explicit.
136
  {
137
  if(($scheme === 'login_post' || $scheme === 'rpc') && (force_ssl_login() || force_ssl_admin()))
138
+ $scheme = 'https'; // Use an SSL scheme in this case.
139
 
140
  else if(($scheme === 'login' || $scheme === 'admin') && force_ssl_admin())
141
+ $scheme = 'https'; // Use an SSL scheme in this case.
142
+
143
+ else if($url && ($url_path = @parse_url($url, PHP_URL_PATH)) && $url_path !== '/'
144
+ && ($url_ext = strtolower(ltrim((string) strrchr(basename($url_path), '.'), '.')))
145
+ && in_array($url_ext, $static_file_extensions, true) // Static resource?
146
+ ) $scheme = 'https'; // Use an SSL scheme in this case.
147
 
148
  else $scheme = 'http'; // Default to non-SSL: `http`.
149
  }
152
  }
153
  if(!function_exists('_ws_plugin__s2member_force_ssl_buffer'))
154
  {
155
+ function _ws_plugin__s2member_force_ssl_buffer($buffer = '')
156
  {
157
  $o_pcre = @ini_get('pcre.backtrack_limit'); // Record existing backtrack limit.
158
  @ini_set('pcre.backtrack_limit', 10000000); // Increase PCRE backtrack limit for this routine.
163
  $ssl_attr_only_tags = array_unique(array_diff(array_map('strtolower', apply_filters('_ws_plugin__s2member_force_ssl_buffer_attr_only_tags', array('link', 'img', 'form', 'input'), get_defined_vars())), $ssl_entire_tags));
164
  $non_ssl_attr_only_tags = array_unique(array_diff(array_map('strtolower', apply_filters('_ws_plugin__s2member_force_non_ssl_buffer_attr_only_tags', array('a'), get_defined_vars())), $non_ssl_entire_tags));
165
 
166
+ $buffer = $ssl_entire_tags ? preg_replace_callback('/\<('.implode('|', c_ws_plugin__s2member_utils_strings::preg_quote_deep($ssl_entire_tags, '/')).')(?![a-z_0-9\-])[^\>]*?\>.*?\<\/\\1\>/is', '_ws_plugin__s2member_force_ssl_buffer_callback', $buffer) : $buffer;
167
+ $buffer = $ssl_attr_only_tags ? preg_replace_callback('/\<('.implode('|', c_ws_plugin__s2member_utils_strings::preg_quote_deep($ssl_attr_only_tags, '/')).')(?![a-z_0-9\-])[^\>]+?\>/i', '_ws_plugin__s2member_force_ssl_buffer_callback', $buffer) : $buffer;
168
 
169
+ $buffer = $non_ssl_entire_tags ? preg_replace_callback('/\<('.implode('|', c_ws_plugin__s2member_utils_strings::preg_quote_deep($non_ssl_entire_tags, '/')).')(?![a-z_0-9\-])[^\>]*?\>.*?\<\/\\1\>/is', '_ws_plugin__s2member_force_non_ssl_buffer_callback', $buffer) : $buffer;
170
+ $buffer = $non_ssl_attr_only_tags ? preg_replace_callback('/\<('.implode('|', c_ws_plugin__s2member_utils_strings::preg_quote_deep($non_ssl_attr_only_tags, '/')).')(?![a-z_0-9\-])[^\>]+?\>/i', '_ws_plugin__s2member_force_non_ssl_buffer_callback', $buffer) : $buffer;
171
 
172
  @ini_set('pcre.backtrack_limit', $o_pcre); // Restore original PCRE backtrack limit. This just keeps things tidy; probably NOT necessary.
173
 
includes/classes/translations.inc.php CHANGED
@@ -165,4 +165,4 @@ if(!class_exists("c_ws_plugin__s2member_translations"))
165
  return $translated; // No Filters.
166
  }
167
  }
168
- }
165
  return $translated; // No Filters.
166
  }
167
  }
168
+ }
includes/classes/users-list-in.inc.php CHANGED
@@ -210,7 +210,7 @@ if(!class_exists("c_ws_plugin__s2member_users_list_in"))
210
  unset($__refs, $__v);
211
 
212
  echo '<tr>'."\n";
213
- echo '<th><label for="ws-plugin--s2member-profile-reset-pass-resend">Reset Password &amp; Resend Welcome Email Message:</label> <a href="#" onclick="alert(\'Checking this box will tell s2Member to reset this User\\\'s password and then reprocess the New User Email Notification message against this User\\\'s account. This way they\\\'ll get an email message with their Username/Password.\\n\\nThis can be helpful in cases where a User/Member missed the original email message for some reason.\\n\\nThe User\\\'s password is reset to a new auto-generated password by default. However, you can provide a custom password by entering a new password of your choosing in the field above—provided by WordPress itself.\\n\\nIt is also possible to customize the New User Email Notification message with s2Member. Please see: `Dashboard → s2Member → General Options → Email Configuration → New User Notifications`.\'); return false;" tabindex="-1">[?]</a></th>'."\n";
214
  echo '<td><label><input type="checkbox" name="ws_plugin__s2member_profile_reset_pass_resend" id="ws-plugin--s2member-profile-reset-pass-resend" value="1" /> Yes, reset password &amp; resend welcome email message to this User.</label></td>'."\n";
215
  echo '</tr>'."\n";
216
 
210
  unset($__refs, $__v);
211
 
212
  echo '<tr>'."\n";
213
+ echo '<th><label for="ws-plugin--s2member-profile-reset-pass-resend">Reset Password &amp; Resend Welcome Email Message:</label> <a href="#" onclick="alert(\'Checking this box will tell s2Member to reset this User\\\'s password and then reprocess the New User Email Notification message against this User\\\'s account. The user will get an email message with their Username and a Password reset link.\\n\\nThis can be helpful in cases where a User/Member missed the original email message for some reason. The User\\\'s password is reset to a new auto-generated password, nullifying the old one. Then, the user receives a link via email that they can use to set a new password of their choosing.\\n\\nTIP: It is possible to customize the New User Email Notification message with s2Member. Please see: `Dashboard → s2Member → General Options → Email Configuration → New User Notifications`.\'); return false;" tabindex="-1">[?]</a></th>'."\n";
214
  echo '<td><label><input type="checkbox" name="ws_plugin__s2member_profile_reset_pass_resend" id="ws-plugin--s2member-profile-reset-pass-resend" value="1" /> Yes, reset password &amp; resend welcome email message to this User.</label></td>'."\n";
215
  echo '</tr>'."\n";
216
 
includes/functions/pluggables.inc.php CHANGED
@@ -15,9 +15,9 @@
15
  * @since 110707
16
  */
17
  if(!defined('WPINC')) // MUST have WordPress.
18
- exit("Do not access this file directly.");
19
 
20
- if (!function_exists ("wp_new_user_notification"))
21
  {
22
  /**
23
  * New User notifications.
@@ -29,15 +29,36 @@ if (!function_exists ("wp_new_user_notification"))
29
  *
30
  * @return class Return-value of class method.
31
  */
32
- if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_emails_enabled"])
33
  {
34
- function /* Accepts any number of arguments. */ wp_new_user_notification ()
35
  {
36
- $args = /* Pulls the arguments passed in to this function. */ func_get_args ();
37
 
38
- return call_user_func_array("c_ws_plugin__s2member_email_configs::new_user_notification", $args);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
40
- add_filter /* Combine. */ ("wpmu_welcome_user_notification", "wp_new_user_notification", 10, 2);
41
  }
42
- $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["pluggables"]["wp_new_user_notification"] = true;
43
  }
15
  * @since 110707
16
  */
17
  if(!defined('WPINC')) // MUST have WordPress.
18
+ exit('Do not access this file directly.');
19
 
20
+ if (!function_exists ('wp_new_user_notification'))
21
  {
22
  /**
23
  * New User notifications.
29
  *
30
  * @return class Return-value of class method.
31
  */
32
+ if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['new_user_emails_enabled'])
33
  {
34
+ function wp_new_user_notification()
35
  {
36
+ $args = func_get_args(); // Function arguments.
37
 
38
+ if (version_compare(get_bloginfo('version'), '4.3', '>='))
39
+ {
40
+ $_43_args = array(); // Initialize WP v4.3 args.
41
+
42
+ $_43_args[0] = isset($args[0]) ? $args[0] : 0;
43
+ // This is always a user ID. Still the same.
44
+
45
+ $_43_args[1] = isset($args[2]) ? $args[2] : '';
46
+ // Our `wp_new_user_notification()` implementation supports a 3rd arg: `$user_pass`.
47
+ // Default; no passwords via email in WordPress v4.3+.
48
+
49
+ if (!empty($args[1]) && $args[1] === 'both')
50
+ $_43_args[2] = array('user', 'admin');
51
+
52
+ else if (!empty($args[1]) && is_string($args[1])) // Something else?
53
+ $_43_args[2] = array($args[1]); // e.g., `user` or `admin`.
54
+
55
+ else $_43_args[2] = array('admin'); // Default behavior.
56
+
57
+ $args = $_43_args; // Use restructured arguments.
58
+ }
59
+ return call_user_func_array('c_ws_plugin__s2member_email_configs::new_user_notification', $args);
60
  }
61
+ add_filter('wpmu_welcome_user_notification', 'c_ws_plugin__s2member_email_configs::new_user_notification', 10, 2);
62
  }
63
+ $GLOBALS['WS_PLUGIN__']['s2member']['c']['pluggables']['wp_new_user_notification'] = true;
64
  }
includes/menu-pages/gen-ops.inc.php CHANGED
@@ -353,11 +353,11 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
353
  echo '<div class="ws-menu-page-hr"></div>'."\n";
354
 
355
  echo '<h3 style="margin:0;">New User Email Message (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-new-user-email-details\').toggle(); return false;" class="ws-dotted-link">click to customize</a>)</h3>'."\n";
356
- echo '<p style="margin:0;">This email is sent to all new Users/Members. It should always contain their Username/Password. In addition to this email, s2Member will also send new paying Customers a Signup Confirmation Email, which you can customize from your Dashboard, under: <strong>s2Member → PayPal Options</strong>. You may wish to customize these emails further, by providing details that are specifically geared to your site.</p>'."\n";
357
  do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_new_user_email", get_defined_vars());
358
 
359
  echo '<div id="ws-plugin--s2member-new-user-email-details" style="display:none;">'."\n";
360
- echo (c_ws_plugin__s2member_utils_conds::bp_is_installed()) ? '<p><em><strong>BuddyPress:</strong> please note that BuddyPress does NOT send this email to Users that register through the BuddyPress registration system. This is because BuddyPress sends each User an activation link; eliminating the need for this email all together. However, you CAN still customize s2Member\'s separate email to paying Members. See: <strong>s2Member → PayPal Options → Signup Confirmation Email</strong>.</em></p>'."\n" : '';
361
  echo '<table class="form-table">'."\n";
362
  echo '<tbody>'."\n";
363
  echo '<tr>'."\n";
@@ -389,10 +389,12 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
389
  echo '<tr>'."\n";
390
 
391
  echo '<td>'."\n";
 
392
  echo '<textarea name="ws_plugin__s2member_new_user_email_message" id="ws-plugin--s2member-new-user-email-message" rows="10">'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]).'</textarea><br />'."\n";
393
  echo 'Message Body used in the email sent to new Users/Members.<br /><br />'."\n";
394
  echo '<strong>You can also use these special Replacement Codes if you need them:</strong>'."\n";
395
  echo '<ul>'."\n";
 
396
  echo '<li><code>%%role%%</code> = The Role ID <code>(subscriber, s2member_level[0-9]+, administrator, editor, author, contributor)</code>.</li>'."\n";
397
  echo '<li><code>%%label%%</code> = The Role ID Label <code>(Subscriber, s2Member Level 1, s2Member Level 2; or your own custom Labels—if configured)</code>.</li>'."\n";
398
  echo '<li><code>%%level%%</code> = The Level number <code>(0, 1, 2, 3, 4)</code>. (<em>deprecated, no longer recommended; use <code>%%role%%</code></em>)</li>'."\n";
@@ -402,10 +404,10 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
402
  echo '<li><code>%%user_full_name%%</code> = The Full Name (First &amp; Last) of the Member who registered their Username.</li>'."\n";
403
  echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>'."\n";
404
  echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>'."\n";
405
- echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>'."\n";
406
  echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>'."\n";
407
  echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>'."\n";
408
  echo '<li><code>%%wp_login_url%%</code> = The full URL where Users can get logged into your site.</li>'."\n";
 
409
  echo '</ul>'."\n";
410
 
411
  echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>'."\n";
@@ -505,10 +507,10 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
505
  echo '<li><code>%%user_full_name%%</code> = The Full Name (First &amp; Last) of the Member who registered their Username.</li>'."\n";
506
  echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>'."\n";
507
  echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>'."\n";
508
- echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>'."\n";
509
  echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>'."\n";
510
  echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>'."\n";
511
  echo '<li><code>%%wp_login_url%%</code> = The full URL where Users can get logged into your site.</li>'."\n";
 
512
  echo '</ul>'."\n";
513
 
514
  echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>'."\n";
@@ -1093,11 +1095,18 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
1093
  echo '</td>'."\n";
1094
 
1095
  echo '</tr>'."\n";
 
 
 
 
 
 
 
1096
  echo '<tr>'."\n";
1097
 
1098
  echo '<th>'."\n";
1099
  echo '<label for="ws-plugin--s2member-custom-reg-names">'."\n";
1100
- echo 'Collect First/Last Names during Registration?'."\n";
1101
  echo '</label>'."\n";
1102
  echo '</th>'."\n";
1103
 
@@ -1115,11 +1124,18 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
1115
  echo '</td>'."\n";
1116
 
1117
  echo '</tr>'."\n";
 
 
 
 
 
 
 
1118
  echo '<tr>'."\n";
1119
 
1120
  echo '<th>'."\n";
1121
  echo '<label for="ws-plugin--s2member-custom-reg-display-name">'."\n";
1122
- echo 'Set "Display Name" during Registration?'."\n";
1123
  echo '</label>'."\n";
1124
  echo '</th>'."\n";
1125
 
@@ -1138,49 +1154,77 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
1138
  echo '</td>'."\n";
1139
 
1140
  echo '</tr>'."\n";
 
 
 
 
 
 
 
1141
  echo '<tr>'."\n";
1142
 
1143
  echo '<th>'."\n";
1144
  echo '<label for="ws-plugin--s2member-custom-reg-password">'."\n";
1145
- echo 'Allow Custom Passwords during Registration?'."\n";
1146
  echo '</label>'."\n";
1147
  echo '</th>'."\n";
1148
 
1149
  echo '</tr>'."\n";
1150
- echo '<tr style="padding-bottom:0;">'."\n";
1151
 
1152
- echo '<td style="padding-bottom:0;">'."\n";
1153
- echo '<em><strong>Note:</strong> Custom passwords are easier for users. However, auto-generated passwords are recommended for best security; i.e., auto-generated passwords also serve as a form of email confirmation.</em>'."\n";
1154
- echo (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site()) ? '<br /><em>* For security purposes, Custom Passwords are not possible on the Main Site of a Blog Farm. <a href="#" onclick="alert(\'For security purposes, Custom Passwords are not possible on the Main Site of a Blog Farm. A User must wait for the activation/confirmation email; where a randomly generated Password will be assigned. Please note, this limitation only affects your Main Site, via `/wp-signup.php`. In other words, your Customers (i.e., other Blog Owners) will still have the ability to allow Custom Passwords with s2Member. YOU are affected by this limitation, NOT them.\\n\\n* NOTE: s2Member (Pro) removes this limitation.\\nIf you install the s2Member Pro Add-on, you WILL be able to allow Custom Passwords through s2Member Pro-Forms; even on a Multisite Blog Farm.\'); return false;" tabindex="-1">[?]</a></em>'."\n" : '';
1155
- echo (c_ws_plugin__s2member_utils_conds::bp_is_installed()) ? '<br /><em>* Does not affect BuddyPress registration form (always <code>yes</code> with BuddyPress registration).</em>'."\n" : '';
1156
- echo '<br /><select name="ws_plugin__s2member_custom_reg_password" id="ws-plugin--s2member-custom-reg-password"'.((is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() && !c_ws_plugin__s2member_utils_conds::pro_is_installed()) ? ' disabled="disabled"' : '').'>'."\n";
1157
- echo '<option value="0"'.((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"]) ? ' selected="selected"' : '').'>No (send auto-generated passwords via email; after registration)</option>'."\n";
1158
  echo '<option value="1"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"]) ? ' selected="selected"' : '').'>Yes (allow members to create their own password during registration)</option>'."\n";
1159
  echo '</select>'."\n";
1160
  echo '</td>'."\n";
1161
 
1162
  echo '</tr>'."\n";
1163
- echo '<tr style="padding-top:0;">'."\n";
 
1164
 
1165
- echo '<td style="padding-top:2px;">'."\n";
1166
- echo '<div id="ws-plugin--s2member-custom-reg-password-settings">'."\n";
1167
- echo '<small><em><strong>Note:</strong> Minimum characters and password strength also impact profile updates, so it\'s a good idea to configure these even if you\'re using auto-generated passwords during registration.</em></small><br />'."\n";
1168
- echo '<small>Minimum characters:</small> <input type="text" autocomplete="off" name="ws_plugin__s2member_custom_reg_password_min_length" id="ws-plugin--s2member-custom-reg-password-min-length" value="'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_length"]).'" maxlength="2" size="2" style="width:auto;" />'."\n";
1169
- echo '<small>Minimum strength:</small> <select name="ws_plugin__s2member_custom_reg_password_min_strength" id="ws-plugin--s2member-custom-reg-password-min-strength" style="width:auto;">'."\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
1170
  echo '<option value="n/a"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_strength"] === 'n/a') ? ' selected="selected"' : '').'>N/A (do not enforce a password strength requirement)</option>'."\n";
1171
  echo '<option value="weak"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_strength"] === 'weak') ? ' selected="selected"' : '').'>Weak (only needs to meet minimum length requirement)</option>'."\n";
1172
  echo '<option value="good"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_strength"] === 'good') ? ' selected="selected"' : '').'>Good (must have numbers, letters, and mixed caSe)</option>'."\n";
1173
  echo '<option value="strong"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_strength"] === 'strong') ? ' selected="selected"' : '').'>Strong (must have numbers, letters, mixed caSe, and punctuation)</option>'."\n";
1174
  echo '</select>'."\n";
1175
- echo '</div>'."\n";
1176
  echo '</td>'."\n";
1177
 
1178
  echo '</tr>'."\n";
 
 
 
 
 
 
 
1179
  echo '<tr>'."\n";
1180
 
1181
  echo '<th>'."\n";
1182
  echo '<label for="ws-plugin--s2member-custom-reg-force-personal-emails">'."\n";
1183
- echo 'Force Personal Emails during Registration?'."\n";
1184
  echo '</label>'."\n";
1185
  echo '</th>'."\n";
1186
 
@@ -1196,6 +1240,13 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
1196
  echo '</td>'."\n";
1197
 
1198
  echo '</tr>'."\n";
 
 
 
 
 
 
 
1199
  echo '<tr>'."\n";
1200
 
1201
  echo '<th>'."\n";
@@ -1219,6 +1270,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_gen_ops"))
1219
  echo '</tr>'."\n";
1220
  echo '</tbody>'."\n";
1221
  echo '</table>'."\n";
 
1222
  echo '</div>'."\n";
1223
 
1224
  echo '</div>'."\n";
353
  echo '<div class="ws-menu-page-hr"></div>'."\n";
354
 
355
  echo '<h3 style="margin:0;">New User Email Message (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-new-user-email-details\').toggle(); return false;" class="ws-dotted-link">click to customize</a>)</h3>'."\n";
356
+ echo '<p style="margin:0;">This email is sent to new Users/Members who did <em>not</em> set a Custom Password during registration.</p>'."\n";
357
  do_action("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_new_user_email", get_defined_vars());
358
 
359
  echo '<div id="ws-plugin--s2member-new-user-email-details" style="display:none;">'."\n";
360
+ echo c_ws_plugin__s2member_utils_conds::bp_is_installed() ? '<p><em><strong>BuddyPress:</strong> please note that BuddyPress does NOT send this email to Users that register through the BuddyPress registration system. This is because BuddyPress sends each User an activation link; eliminating the need for this email altogether. However, you CAN still customize s2Member\'s separate email to paying Members. See: <strong>s2Member → PayPal Options → Signup Confirmation Email</strong>.</em></p>'."\n" : '';
361
  echo '<table class="form-table">'."\n";
362
  echo '<tbody>'."\n";
363
  echo '<tr>'."\n";
389
  echo '<tr>'."\n";
390
 
391
  echo '<td>'."\n";
392
+ echo '<p><em>(The purpose of this email is to send the user a password-setup link; i.e., <code>%%wp_set_pass_url%%</code>)</em></small><p>'."\n";
393
  echo '<textarea name="ws_plugin__s2member_new_user_email_message" id="ws-plugin--s2member-new-user-email-message" rows="10">'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]).'</textarea><br />'."\n";
394
  echo 'Message Body used in the email sent to new Users/Members.<br /><br />'."\n";
395
  echo '<strong>You can also use these special Replacement Codes if you need them:</strong>'."\n";
396
  echo '<ul>'."\n";
397
+ echo '<li style="margin-bottom:1em;"><code>%%wp_set_pass_url%%</code> = The full URL where Users can set their password for the first time. Note that <code>%%wp_set_pass_url%%</code> should be used instead of the older/deprecated <code style="text-decoration:line-through;">%%user_pass%%</code> Replacement Code. Starting w/ WordPress v4.3+, a user can visit this link (i.e., <code>%%wp_set_pass_url%%</code>) to set a password of their own, and this is accomplished without sending a plain-text password via email; which improves security. It is suggested that you prefix this as follows: <em>To set your password, visit: <code>%%wp_set_pass_url%%</code></em></li>'."\n";
398
  echo '<li><code>%%role%%</code> = The Role ID <code>(subscriber, s2member_level[0-9]+, administrator, editor, author, contributor)</code>.</li>'."\n";
399
  echo '<li><code>%%label%%</code> = The Role ID Label <code>(Subscriber, s2Member Level 1, s2Member Level 2; or your own custom Labels—if configured)</code>.</li>'."\n";
400
  echo '<li><code>%%level%%</code> = The Level number <code>(0, 1, 2, 3, 4)</code>. (<em>deprecated, no longer recommended; use <code>%%role%%</code></em>)</li>'."\n";
404
  echo '<li><code>%%user_full_name%%</code> = The Full Name (First &amp; Last) of the Member who registered their Username.</li>'."\n";
405
  echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>'."\n";
406
  echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>'."\n";
 
407
  echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>'."\n";
408
  echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>'."\n";
409
  echo '<li><code>%%wp_login_url%%</code> = The full URL where Users can get logged into your site.</li>'."\n";
410
+ echo '<li style="margin-top:1em;"><code style="text-decoration:line-through;">%%user_pass%%</code> = <em>Deprecated, please stop using this. Starting w/ WordPress v4.3, this email is only sent to users who did NOT set a Custom Password during registration; i.e., the New User Notification email is only sent to the user whenever they need it to set their password. In that scenario, you should be sending the user the <code>%%wp_set_pass_url%%</code> instead of sending a plain-text password via email; which is a security no-no.</em></li>'."\n";
411
  echo '</ul>'."\n";
412
 
413
  echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>'."\n";
507
  echo '<li><code>%%user_full_name%%</code> = The Full Name (First &amp; Last) of the Member who registered their Username.</li>'."\n";
508
  echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>'."\n";
509
  echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>'."\n";
 
510
  echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>'."\n";
511
  echo '<li><code>%%user_id%%</code> = A unique WordPress User ID generated during registration.</li>'."\n";
512
  echo '<li><code>%%wp_login_url%%</code> = The full URL where Users can get logged into your site.</li>'."\n";
513
+ echo '<li style="margin-top:1em;"><code style="text-decoration:line-through;">%%user_pass%%</code> = <em>Deprecated. Starting w/ WordPress v4.3, this is no longer applicable (or advised).</em></li>'."\n";
514
  echo '</ul>'."\n";
515
 
516
  echo '<strong>Custom Registration/Profile Fields are also supported in this email:</strong>'."\n";
1095
  echo '</td>'."\n";
1096
 
1097
  echo '</tr>'."\n";
1098
+ echo '</tbody>'."\n";
1099
+ echo '</table>'."\n";
1100
+
1101
+ echo '<div class="ws-menu-page-hr"></div>'."\n";
1102
+
1103
+ echo '<table class="form-table">'."\n";
1104
+ echo '<tbody>'."\n";
1105
  echo '<tr>'."\n";
1106
 
1107
  echo '<th>'."\n";
1108
  echo '<label for="ws-plugin--s2member-custom-reg-names">'."\n";
1109
+ echo 'Collect First/Last Names During Registration?'."\n";
1110
  echo '</label>'."\n";
1111
  echo '</th>'."\n";
1112
 
1124
  echo '</td>'."\n";
1125
 
1126
  echo '</tr>'."\n";
1127
+ echo '</tbody>'."\n";
1128
+ echo '</table>'."\n";
1129
+
1130
+ echo '<div class="ws-menu-page-hr"></div>'."\n";
1131
+
1132
+ echo '<table class="form-table">'."\n";
1133
+ echo '<tbody>'."\n";
1134
  echo '<tr>'."\n";
1135
 
1136
  echo '<th>'."\n";
1137
  echo '<label for="ws-plugin--s2member-custom-reg-display-name">'."\n";
1138
+ echo 'Set "Display Name" During Registration?'."\n";
1139
  echo '</label>'."\n";
1140
  echo '</th>'."\n";
1141
 
1154
  echo '</td>'."\n";
1155
 
1156
  echo '</tr>'."\n";
1157
+ echo '</tbody>'."\n";
1158
+ echo '</table>'."\n";
1159
+
1160
+ echo '<div class="ws-menu-page-hr"></div>'."\n";
1161
+
1162
+ echo '<table class="form-table">'."\n";
1163
+ echo '<tbody>'."\n";
1164
  echo '<tr>'."\n";
1165
 
1166
  echo '<th>'."\n";
1167
  echo '<label for="ws-plugin--s2member-custom-reg-password">'."\n";
1168
+ echo 'Allow Custom Passwords During Registration?'."\n";
1169
  echo '</label>'."\n";
1170
  echo '</th>'."\n";
1171
 
1172
  echo '</tr>'."\n";
1173
+ echo '<tr>'."\n";
1174
 
1175
+ echo '<td>'."\n";
1176
+ echo '<p style="margin-bottom:4px;"><em><strong>Note:</strong> Custom Passwords are easier for users. However, this has an impact on site security. Enabling Custom Passwords disables the New User Notification email that contains a password-setup link for each user. In other words, enabling Custom Passwords effectively disables any sort of email verification procedure, because the user is allowed to set their password during registration, instead of doing that via email confirmation—which is the default WordPress behavior.</em></p>'."\n";
1177
+ echo (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site()) ? '<p style="margin-bottom:4px;"><em>* For security purposes, Custom Passwords are not possible on the Main Site of a Blog Farm. <a href="#" onclick="alert(\'For security purposes, Custom Passwords are not possible on the Main Site of a Blog Farm. A User must wait for the activation/confirmation email; where a randomly generated Password will be assigned. Please note, this limitation only affects your Main Site, via `/wp-signup.php`. In other words, your Customers (i.e., other Blog Owners) will still have the ability to allow Custom Passwords with s2Member. YOU are affected by this limitation, NOT them.\\n\\n* NOTE: s2Member (Pro) removes this limitation.\\nIf you install the s2Member Pro Add-on, you WILL be able to allow Custom Passwords through s2Member Pro-Forms; even on a Multisite Blog Farm.\'); return false;" tabindex="-1">[?]</a></em></p>'."\n" : '';
1178
+ echo (c_ws_plugin__s2member_utils_conds::bp_is_installed()) ? '<p style="margin-bottom:4px;"><em>* Does not affect BuddyPress registration form (always <code>yes</code> with BuddyPress registration).</em></p>'."\n" : '';
1179
+ echo '<select name="ws_plugin__s2member_custom_reg_password" id="ws-plugin--s2member-custom-reg-password"'.((is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() && !c_ws_plugin__s2member_utils_conds::pro_is_installed()) ? ' disabled="disabled"' : '').'>'."\n";
1180
+ echo '<option value="0"'.((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"]) ? ' selected="selected"' : '').'>No (send each user a password-setup link after registration; recommended for best security)</option>'."\n";
1181
  echo '<option value="1"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"]) ? ' selected="selected"' : '').'>Yes (allow members to create their own password during registration)</option>'."\n";
1182
  echo '</select>'."\n";
1183
  echo '</td>'."\n";
1184
 
1185
  echo '</tr>'."\n";
1186
+ echo '</tbody>'."\n";
1187
+ echo '</table>'."\n";
1188
 
1189
+ echo '<div class="ws-menu-page-hr"></div>'."\n";
1190
+
1191
+ echo '<table class="form-table">'."\n";
1192
+ echo '<tbody>'."\n";
1193
+ echo '<tr>'."\n";
1194
+
1195
+ echo '<th>'."\n";
1196
+ echo '<label for="ws-plugin--s2member-custom-reg-password-min-length">'."\n";
1197
+ echo 'Minimum Length/Strength for Custom Passwords:'."\n";
1198
+ echo '</label>'."\n";
1199
+ echo '</th>'."\n";
1200
+
1201
+ echo '</tr>'."\n";
1202
+ echo '<tr>'."\n";
1203
+
1204
+ echo '<td>'."\n";
1205
+ echo 'Minimum length: <input type="text" autocomplete="off" name="ws_plugin__s2member_custom_reg_password_min_length" id="ws-plugin--s2member-custom-reg-password-min-length" value="'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_length"]).'" maxlength="2" size="2" style="width:auto;" /> characters.'."\n";
1206
+ echo '&nbsp;&nbsp;&nbsp; Minimum strength: <select name="ws_plugin__s2member_custom_reg_password_min_strength" id="ws-plugin--s2member-custom-reg-password-min-strength" style="width:auto;">'."\n";
1207
  echo '<option value="n/a"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_strength"] === 'n/a') ? ' selected="selected"' : '').'>N/A (do not enforce a password strength requirement)</option>'."\n";
1208
  echo '<option value="weak"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_strength"] === 'weak') ? ' selected="selected"' : '').'>Weak (only needs to meet minimum length requirement)</option>'."\n";
1209
  echo '<option value="good"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_strength"] === 'good') ? ' selected="selected"' : '').'>Good (must have numbers, letters, and mixed caSe)</option>'."\n";
1210
  echo '<option value="strong"'.(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password_min_strength"] === 'strong') ? ' selected="selected"' : '').'>Strong (must have numbers, letters, mixed caSe, and punctuation)</option>'."\n";
1211
  echo '</select>'."\n";
1212
+ echo '<p><em><strong>Tip:</strong> Minimum length and password strength also impact profile updates, so it\'s a good idea to configure these even if you\'re not using Custom Passwords during registration.</em></p>'."\n";
1213
  echo '</td>'."\n";
1214
 
1215
  echo '</tr>'."\n";
1216
+ echo '</tbody>'."\n";
1217
+ echo '</table>'."\n";
1218
+
1219
+ echo '<div class="ws-menu-page-hr"></div>'."\n";
1220
+
1221
+ echo '<table class="form-table">'."\n";
1222
+ echo '<tbody>'."\n";
1223
  echo '<tr>'."\n";
1224
 
1225
  echo '<th>'."\n";
1226
  echo '<label for="ws-plugin--s2member-custom-reg-force-personal-emails">'."\n";
1227
+ echo 'Force Personal Emails During Registration?'."\n";
1228
  echo '</label>'."\n";
1229
  echo '</th>'."\n";
1230
 
1240
  echo '</td>'."\n";
1241
 
1242
  echo '</tr>'."\n";
1243
+ echo '</tbody>'."\n";
1244
+ echo '</table>'."\n";
1245
+
1246
+ echo '<div class="ws-menu-page-hr"></div>'."\n";
1247
+
1248
+ echo '<table class="form-table">'."\n";
1249
+ echo '<tbody>'."\n";
1250
  echo '<tr>'."\n";
1251
 
1252
  echo '<th>'."\n";
1270
  echo '</tr>'."\n";
1271
  echo '</tbody>'."\n";
1272
  echo '</table>'."\n";
1273
+
1274
  echo '</div>'."\n";
1275
 
1276
  echo '</div>'."\n";
includes/menu-pages/menu-pages-s-min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function($){var esc_attr=esc_html=function(string){if(/[&\<\>"']/.test(string=String(string))){string=string.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),string=string.replace(/"/g,"&quot;").replace(/'/g,"&#039;")}return string};ws_plugin__s2member_generateSecurityKey=function(obj){if(!obj){obj="#ws-plugin--s2member-sec-encryption-key"}var mt_rand=function(min,max){min=(arguments.length<1)?0:min;max=(arguments.length<2)?2147483647:max;return Math.floor(Math.random()*(max-min+1))+min};var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%^&*()";for(var i=0,key="";i<64;i++){key+=chars.substr(mt_rand(0,chars.length-1),1)}$(obj).val(key);return false};if(location.href.match(/page\=ws-plugin--s2member/)){$("input.ws-plugin--s2member-update-roles-button, input.ws-plugin--s2member-reset-roles-button").click(function(){var $this=$(this);$this.val("one moment please ...");var levels='<?php echo (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; ?>';var resetUpdate=($this.hasClass("ws-plugin--s2member-reset-roles-button"))?"Reset":"Update";$.post(ajaxurl,{action:"ws_plugin__s2member_update_roles_via_ajax",ws_plugin__s2member_update_roles_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-update-roles-via-ajax")); ?>'},function(response){if(response==="1"){alert("s2Member's Roles/Capabilities "+((resetUpdate.toLowerCase()==="reset")?"have been successfully reset":"updated successfully")+".\nYour installation of s2Member has Membership Levels 0-"+levels+"."),$this.val(resetUpdate+" Roles/Capabilities")}else{if(response==="l"){alert("Sorry, your request failed.\ns2Member's Roles/Capabilities are locked by Filter:\nws_plugin__s2member_lock_roles_caps"),$this.val(resetUpdate+" Roles/Capabilities")}else{alert("Sorry, your request failed.\nAccess denied. Do you have the ability to `create_users`?"),$this.val(resetUpdate+" Roles/Capabilities")}}});return false});$("#ws-plugin--s2member-custom-reg-password").on("change",function(){$("#ws-plugin--s2member-custom-reg-password-settings").css("opacity",$(this).val()==="1"?"1":"0.9")}).trigger("change")}if(location.href.match(/page\=ws-plugin--s2member-logs/)){$("input#ws-plugin--s2member-gateway-debug-logs-extensive-1").click(function(){var $this=$(this),thisChecked=(this.checked)?true:false;if(thisChecked){$("input#ws-plugin--s2member-gateway-debug-logs-1").attr("checked","checked")}});var $toggles=$("a.ws-plugin--s2member-log-file-viewport-toggle");$toggles.click(function(){$("textarea#ws-plugin--s2member-log-file-viewer").each(function(){var $viewer=$(this);if($viewer.attr("data-state")!=="expanded"){$viewer.css({height:($viewer.prop("scrollHeight")+50)+"px","overflow-y":"auto"});$toggles.html("&#8657; normalize viewport &#10073;");$viewer.attr("data-state","expanded")}else{$viewer.css({height:"auto","overflow-y":"scroll"});$toggles.html("&#8659; expand viewport &#8659;");$viewer.attr("data-state","scrolling")}});return false})}if(location.href.match(/page\=ws-plugin--s2member-mms-ops/)){$("select#ws-plugin--s2member-mms-registration-file").change(function(){if($(this).val()==="wp-signup"){var gv=$("select#ws-plugin--s2member-mms-registration-grants").val(),l0v=$("input#ws-plugin--s2member-mms-registration-blogs-level0").val();$("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();$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0")[((gv==="all")?"show":"hide")]();$("input#ws-plugin--s2member-mms-registration-blogs-level0").val(((gv==="all")?((l0v>0)?l0v:"1"):"0"))}else{if($(this).val()==="wp-login"){var gv=$("select#ws-plugin--s2member-mms-registration-grants").val(),l0v=$("input#ws-plugin--s2member-mms-registration-blogs-level0").val();$("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();$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0").hide();$("input#ws-plugin--s2member-mms-registration-blogs-level0").val("0")}}}).trigger("change");$("select#ws-plugin--s2member-mms-registration-grants").change(function(){$("select#ws-plugin--s2member-mms-registration-file").trigger("change")})}if(location.href.match(/page\=ws-plugin--s2member-gen-ops/)){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 unhappy Customers. Data corruption WILL occur! For 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.")){$("input#ws-plugin--s2member-sec-encryption-key").removeAttr("disabled")}return false};ws_plugin__s2member_securityKeyHistory=function(){$("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false};$("select#ws-plugin--s2member-new-user-emails-enabled").change(function(){var $pluggable=$("input#ws-plugin--s2member-pluggables-wp-new-user-notification"),$this=$(this),$newUserEmails=$("div#ws-plugin--s2member-new-user-emails");if($pluggable.val()==="0"||$this.val()==="0"){($pluggable.val()==="0")?$this.attr("disabled","disabled"):$this.removeAttr("disabled");$(":input",$newUserEmails).attr("disabled","disabled"),$newUserEmails.css("opacity","0.5")}else{$this.removeAttr("disabled"),$(":input",$newUserEmails).removeAttr("disabled"),$newUserEmails.css("opacity","")}}).trigger("change");$("select#ws-plugin--s2member-login-reg-design-enabled").change(function(){var $this=$(this),$loginRegDesign=$("div#ws-plugin--s2member-login-reg-design");if($this.val()==="0"){$(":input",$loginRegDesign).attr("disabled","disabled"),$loginRegDesign.css("opacity","0.5"),$loginRegDesign.hide()}else{$(":input",$loginRegDesign).removeAttr("disabled"),$loginRegDesign.css("opacity",""),$loginRegDesign.show()}}).trigger("change");if($("input#ws-plugin--s2member-custom-reg-fields").length&&$("div#ws-plugin--s2member-custom-reg-field-configuration").length){(function(){var i,fieldDefaults,tools,table,$tools,$table;var $fields=$("input#ws-plugin--s2member-custom-reg-fields");var $configuration=$("div#ws-plugin--s2member-custom-reg-field-configuration");var fields=($fields.val())?$.JSON.parse($fields.val()):[];fields=(fields instanceof Array)?fields:[];fieldDefaults={section:"no",sectitle:"",id:"",label:"",type:"text",deflt:"",options:"",expected:"",required:"yes",levels:"all",editable:"yes",classes:"",styles:"",attrs:""};for(i=0;i<fields.length;i++){fields[i]=$.extend(true,{},fieldDefaults,fields[i])}tools='<div id="ws-plugin--s2member-custom-reg-field-configuration-tools"></div>',table='<table id="ws-plugin--s2member-custom-reg-field-configuration-table"></table>';$configuration.html(tools+table);$tools=$("div#ws-plugin--s2member-custom-reg-field-configuration-tools"),$table=$("table#ws-plugin--s2member-custom-reg-field-configuration-table");ws_plugin__s2member_customRegFieldSectionChange=function(select){var section=$(select).val();var sectitle_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle";(section==="yes")?$(sectitle_trs).css("display",""):$(sectitle_trs).css("display","none")};ws_plugin__s2member_customRegFieldTypeChange=function(select){var type=$(select).val();var deflt_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt",options_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-options",expected_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected";(type.match(/^(text|textarea)$/))?$(deflt_trs).css("display",""):$(deflt_trs).css("display","none");(type.match(/^(select|selects|checkboxes|radios)$/))?$(options_trs).css("display",""):$(options_trs).css("display","none");(type.match(/^(text|textarea)$/))?$(expected_trs).css("display",""):$(expected_trs).css("display","none")};ws_plugin__s2member_customRegFieldDelete=function(index){var newFields=new Array();for(var i=0;i<fields.length;i++){if(i!==index){newFields.push(fields[i])}}fields=newFields,updateFields(),buildTable()};ws_plugin__s2member_customRegFieldMoveUp=function(index){if(typeof fields[index]==="object"&&typeof fields[index-1]==="object"){var prevFieldObj=fields[index-1],thisFieldObj=fields[index];fields[index-1]=thisFieldObj,fields[index]=prevFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldMoveDown=function(index){if(typeof fields[index]==="object"&&typeof fields[index+1]==="object"){var nextFieldObj=fields[index+1],thisFieldObj=fields[index];fields[index+1]=thisFieldObj,fields[index]=nextFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldCreate=function(){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field))){fields.push(field),updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+(fields.length-1);alert('Field created successfully.\n* Remember to "Save All Changes".')},500)}};ws_plugin__s2member_customRegFieldUpdate=function(index){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field,index))){fields[index]=field,updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+index;alert('Field updated successfully.\n* Remember to "Save All Changes".')},500)}};ws_plugin__s2member_customRegFieldAdd=function(){buildTools(true)};ws_plugin__s2member_customRegFieldEdit=function(index){buildTools(false,index),scrollReset()};ws_plugin__s2member_customRegFieldCancel=function(){buildTools(),scrollReset()};var validateField=function(field,index){var editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,errors=[],options,i;if(typeof field!=="object"||typeof(field=$.extend(true,{},fieldDefaults,field))!=="object"){alert("Invalid field object. Please try again.");return false}field.sectitle=(field.section==="yes")?field.sectitle:"";field.deflt=(field.type.match(/^(text|textarea)$/))?field.deflt:"";field.deflt=(field.type.match(/^(text)$/))?field.deflt.replace(/[\r\n\t ]+/g," "):field.deflt;field.options=(field.type.match(/^(select|selects|checkboxes|radios)$/))?field.options:"";field.expected=(field.type.match(/^(text|textarea)$/))?field.expected:"";if(!field.id){errors.push("Unique Field ID:\nThis is required. Please try again.")}else{if(fieldIdExists(field.id)&&(!editing||field.id!==fields[index].id)){errors.push("Unique Field ID:\nThat Field ID already exists. Please try again.")}}if(!field.label){errors.push("Field Label/Description:\nThis is required. Please try again.")}if(field.type.match(/^(select|selects|checkboxes|radios)$/)&&!field.options){errors.push("Option Configuration File:\nThis is required. Please try again.")}else{if(field.type.match(/^(select|selects|checkboxes|radios)$/)){for(i=0;i<(options=field.options.split(/[\r\n]+/)).length;i++){if(!(options[i]=$.trim(options[i])).match(/^([^\|]*)(\|)([^\|]*)(\|default)?$/)){errors.push("Option Configuration File:\nInvalid configuration at line #"+(i+1)+".");break}}field.options=$.trim(options.join("\n"))}}if(!(field.levels=field.levels.replace(/ /g,""))){errors.push("Applicable Levels:\nThis is required. Please try again.")}else{if(!field.levels.match(/^(all|[0-9,]+)$/)){errors.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(field.classes&&field.classes.match(/[^a-z 0-9 _ \-]/i)){errors.push("CSS Classes:\nContains invalid characters. Please try again.\n(only: alphanumerics, underscores, hyphens, spaces)")}if(field.styles&&field.styles.match(/["\=\>\<]/)){errors.push('CSS Styles:\nContains invalid characters. Please try again.\n(do NOT use these characters: = " < >)')}if(field.attrs&&field.attrs.match(/[\>\<]/)){errors.push("Other Attributes:\nContains invalid characters. Please try again.\n(do NOT use these characters: < >)")}if(errors.length>0){alert(errors.join("\n\n"));return false}else{return field}};var updateFields=function(){$fields.val(((fields.length>0)?$.JSON.stringify(fields):""))};var fieldId2Var=function(fieldId){return(typeof fieldId==="string")?$.trim(fieldId).toLowerCase().replace(/[^a-z0-9]/g,"_"):""};var fieldTypeDesc=function(type){var types={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 types[type]==="string"){return types[type]}return""};var fieldIdExists=function(fieldId){for(var i=0;i<fields.length;i++){if(fields[i].id===fieldId){return true}}};var scrollReset=function(){scrollTo(0,$("div.ws-plugin--s2member-custom-reg-fields-section").offset()["top"]-100)};var buildTools=function(adding,index){var i=0,html="",form="",w=0,h=0,editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,displayForm=(adding||editing)?true:false,field=(editing)?$.extend(true,{},fieldDefaults,fields[index]):fieldDefaults;html+='<a href="#" onclick="ws_plugin__s2member_customRegFieldAdd(); return false;">Add New Field</a>';tb_remove(),$("div#ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form").remove();if(displayForm){form+='<div id="ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form">';form+='<table id="ws-plugin--s2member-custom-reg-field-configuration-tools-form">';form+="<tbody>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">Starts A New Section?</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<select property="section" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section" onchange="ws_plugin__s2member_customRegFieldSectionChange(this);">';form+='<option value="no"'+((field.section==="no")?' selected="selected"':"")+'">No (this Field flows normally)</option>';form+='<option value="yes"'+((field.section==="yes")?' selected="selected"':"")+'">Yes (this Field begins a new section)</option>';form+="</select><br />";form+="<small>Optional. Allows Fields to be grouped into sections.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+'><td colspan="2"><hr /></td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+">";form+='<td colspan="2">';form+="Title for this new section? (optional)<br />";form+='<input type="text" property="sectitle" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle" value="'+esc_attr(field.sectitle)+'" /><br />';form+="<small>If empty, a simple divider will be used by default.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-type"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">Form Field Type: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<select property="type" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);">';form+='<option value="text"'+((field.type==="text")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("text"))+"</option>";form+='<option value="textarea"'+((field.type==="textarea")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("textarea"))+"</option>";form+='<option value="select"'+((field.type==="select")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("select"))+"</option>";form+='<option value="selects"'+((field.type==="selects")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("selects"))+"</option>";form+='<option value="checkbox"'+((field.type==="checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkbox"))+"</option>";form+='<option value="pre_checkbox"'+((field.type==="pre_checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("pre_checkbox"))+"</option>";form+='<option value="checkboxes"'+((field.type==="checkboxes")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkboxes"))+"</option>";form+='<option value="radios"'+((field.type==="radios")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("radios"))+"</option>";form+="</select><br />";form+="<small>The options below may change, based on the Field Type you choose here.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-label"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">Field Label/Desc: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<input type="text" property="label" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label" value="'+esc_attr(field.label)+'" /><br />';form+="<small>Examples: <code>Choose Country</code>, <code>Street Address</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-id"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">Unique Field ID: *</label></label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<input type="text" property="id" maxlength="25" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id" value="'+esc_attr(field.id)+'" /><br />';form+="<small>Examples: <code>country_code</code>, <code>street_address</code></small><br />";form+='<small>e.g., <code>[s2Get user_field="country_code" /]</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-required"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">Field Required: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<option value="yes"'+((field.required==="yes")?' selected="selected"':"")+'">Yes (required)</option>';form+='<option value="no"'+((field.required==="no")?' selected="selected"':"")+'">No (optional)</option>';form+="</select><br />";form+='<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />';form+="<small>* Administrators are exempt from this requirement.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt">Default Text Value: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="deflt" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt" rows="1">'+esc_html(field.deflt)+"</textarea><br />";form+="<small>Default value before user input is received.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * (one option per line)</label><br />';form+="<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="options" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options" rows="3">'+esc_html(field.options)+"</textarea><br />";form+="Here is a quick example:<br />";form+="<small>You can also specify a <em>default</em> option:</small><br />";form+="<code>US|United States|default</code><br />";form+="<code>CA|Canada</code><br />";form+="<code>VI|Virgin Islands (U.S.)</code>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">';form+='<option value=""'+((field.expected==="")?' selected="selected"':"")+'">Anything Goes</option>';form+='<option disabled="disabled"></option>';form+='<optgroup label="Specific Input Types">';form+='<option value="numeric-wp-commas"'+((field.expected==="numeric-wp-commas")?' selected="selected"':"")+'">Numeric (with or without decimals, commas allowed)</option>';form+='<option value="numeric"'+((field.expected==="numeric")?' selected="selected"':"")+'">Numeric (with or without decimals, no commas)</option>';form+='<option value="integer"'+((field.expected==="integer")?' selected="selected"':"")+'">Integer (whole number, without any decimals)</option>';form+='<option value="integer-gt-0"'+((field.expected==="integer-gt-0")?' selected="selected"':"")+'">Integer > 0 (whole number, no decimals, greater than 0)</option>';form+='<option value="float"'+((field.expected==="float")?' selected="selected"':"")+'">Float (floating point number, decimals required)</option>';form+='<option value="float-gt-0"'+((field.expected==="float-gt-0")?' selected="selected"':"")+'">Float > 0 (floating point number, decimals required, greater than 0)</option>';form+='<option value="date"'+((field.expected==="date")?' selected="selected"':"")+'">Date (required date format: dd/mm/yyyy)</option>';form+='<option value="email"'+((field.expected==="email")?' selected="selected"':"")+'">Email (require valid email)</option>';form+='<option value="url"'+((field.expected==="url")?' selected="selected"':"")+'">Full URL (starting with http or https)</option>';form+='<option value="domain"'+((field.expected==="domain")?' selected="selected"':"")+'">Domain Name (domain name only, without http)</option>';form+='<option value="phone"'+((field.expected==="phone")?' selected="selected"':"")+'">Phone # (10 digits w/possible hyphens,spaces,brackets)</option>';form+='<option value="uszip"'+((field.expected==="uszip")?' selected="selected"':"")+'">US Zipcode (5-9 digits w/possible hyphen)</option>';form+='<option value="cazip"'+((field.expected==="cazip")?' selected="selected"':"")+'">Canadian Zipcode (6 alpha-numerics w/possible space)</option>';form+='<option value="uczip"'+((field.expected==="uczip")?' selected="selected"':"")+'">US/Canadian Zipcode (either a US or Canadian zipcode)</option>';form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Any Character Combination">';for(i=1;i<=25;i++){form+='<option value="any-'+i+'"'+((field.expected==="any-"+i)?' selected="selected"':"")+'">Any Character Combination ('+i+" character minimum)</option>";form+='<option value="any-'+i+'-e"'+((field.expected==="any-"+i+"-e")?' selected="selected"':"")+'">Any Character Combination (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics, Spaces &amp; Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-punctuation-'+i+'"'+((field.expected==="alphanumerics-spaces-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation ('+i+" character minimum)</option>";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>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics &amp; Spaces Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-'+i+'"'+((field.expected==="alphanumerics-spaces-"+i)?' selected="selected"':"")+'">Alphanumerics &amp; Spaces ('+i+" character minimum)</option>";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>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics &amp; Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-punctuation-'+i+'"'+((field.expected==="alphanumerics-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation ('+i+" character minimum)</option>";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>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-'+i+'"'+((field.expected==="alphanumerics-"+i)?' selected="selected"':"")+'">Alphanumerics ('+i+" character minimum)</option>";form+='<option value="alphanumerics-'+i+'-e"'+((field.expected==="alphanumerics-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphabetics Only">';for(i=1;i<=25;i++){form+='<option value="alphabetics-'+i+'"'+((field.expected==="alphabetics-"+i)?' selected="selected"':"")+'">Alphabetics ('+i+" character minimum)</option>";form+='<option value="alphabetics-'+i+'-e"'+((field.expected==="alphabetics-"+i+"-e")?' selected="selected"':"")+'">Alphabetics (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Numeric Digits Only">';for(i=1;i<=25;i++){form+='<option value="numerics-'+i+'"'+((field.expected==="numerics-"+i)?' selected="selected"':"")+'">Numeric Digits ('+i+" digit minimum)</option>";form+='<option value="numerics-'+i+'-e"'+((field.expected==="numerics-"+i+"-e")?' selected="selected"':"")+'">Numeric Digits (exactly '+i+" digit"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+="</select><br />";form+="<small>Only Users/Members will be required to meet this criteria.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">Applicable Membership Levels: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<input type="text" property="levels" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels" value="'+esc_attr(field.levels)+'" /><br />';form+="<small>Please use comma-delimited Level #'s: <code>0,1,2,3,4</code> or type: <code>all</code>.</small><br />";form+="<small>This allows you to enable this field - only at specific Membership Levels.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">Allow Profile Edits: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<option value="yes"'+((field.editable==="yes")?' selected="selected"':"")+'">Yes (editable)</option>';form+='<option value="no"'+((field.editable==="no")?' selected="selected"':"")+'">No (uneditable after registration)</option>';form+='<option value="no-invisible"'+((field.editable==="no-invisible")?' selected="selected"':"")+'">No (uneditable &amp; totally invisible after registration)</option>';form+='<option value="no-always-invisible"'+((field.editable==="no-always-invisible")?' selected="selected"':"")+'">No (uneditable &amp; totally invisible, both during &amp; after registration)</option>';form+='<option value="yes-invisible"'+((field.editable==="yes-invisible")?' selected="selected"':"")+'">Yes (editable after registration / invisible during registration)</option>';form+="</select><br />";form+="<small>If <code>No</code>, this field will be un-editable after registration.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">CSS Classes: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<input type="text" property="classes" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes" value="'+esc_attr(field.classes)+'" /><br />';form+="<small>Example: <code>my-style-1 my-style-2</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">CSS Styles: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<input type="text" property="styles" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles" value="'+esc_attr(field.styles)+'" /><br />';form+="<small>Example: <code>color:#000000; background:#FFFFFF;</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">Other Attributes: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<input type="text" property="attrs" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs" value="'+esc_attr(field.attrs)+'" /><br />';form+='<small>Example: <code>onkeyup="" onblur=""</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons">';form+='<td align="left">';form+='<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />';form+="</td>";form+='<td align="right">';form+='<input type="button" value="'+((editing)?"Update This Field":"Create Registration Field")+'" onclick="'+((editing)?"ws_plugin__s2member_customRegFieldUpdate("+index+");":"ws_plugin__s2member_customRegFieldCreate();")+'" />';form+="</td>";form+="</tr>";form+="</tbody>";form+="</table>";form+="<div>";$("body").append(form);tb_show(((editing)?"Editing Registration/Profile Field":"New Custom Registration/Profile Field"),"#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form");$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form").show()}$tools.html(html)};var buildTable=function(){var l=fields.length,i=0,html="",eo="o";html+="<tbody>";html+="<tr>";html+="<th>Order</th>";html+="<th>Field Type</th>";html+="<th>Unique ID</th>";html+="<th>Required</th>";html+="<th>Levels</th>";html+="<th>- Tools -</th>";html+="</tr>";if(fields.length>0){for(i=0;i<fields.length;i++){html+='<tr class="'+esc_attr((eo=(eo==="o")?"e":"o"))+((fields[i].section==="yes")?" s":"")+" ws-plugin--s2member-custom-reg-field-configuration-table-row-"+i+'">';html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-move-up" href="#" onclick="ws_plugin__s2member_customRegFieldMoveUp('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-move-down" href="#" onclick="ws_plugin__s2member_customRegFieldMoveDown('+i+'); return false;"></a></td>';html+='<td nowrap="nowrap">'+esc_html(fieldTypeDesc(fields[i].type))+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].id)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].required)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].levels)+"</td>";html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-edit" href="#" onclick="ws_plugin__s2member_customRegFieldEdit('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-delete" href="#" onclick="ws_plugin__s2member_customRegFieldDelete('+i+'); return false;"></a></td>';html+="</tr>"}}else{html+="<tr>";html+='<td colspan="6">No Custom Fields are configured.</td>';html+="</tr>"}html+="</tbody>";$table.html(html)};buildTools(),buildTable()})()}}if(location.href.match(/page\=ws-plugin--s2member-res-ops/)){$("input#ws-plugin--s2member-brute-force-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.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 c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's Brute Force Restriction Logs have all been reset."),$this.val("Reset Brute Force Logs")});return false});$("input#ws-plugin--s2member-ip-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.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 c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's IP Restriction Logs have all been reset."),$this.val("Reset IP Restriction Logs")});return false});$('div.ws-plugin--s2member-query-level-access-section input[type="checkbox"][name="ws_plugin__s2member_filter_wp_query[]"]').change(function(){var thisChange=$(this).val();$('div.ws-plugin--s2member-query-level-access-section input[type="checkbox"][name="ws_plugin__s2member_filter_wp_query[]"]').each(function(){var $this=$(this),val=$this.val(),checkboxes='input[type="checkbox"]';if(val==="all"&&this.checked){$this.nextAll(checkboxes).attr({checked:"checked",disabled:"disabled"})}else{if(val==="all"&&!this.checked){$this.nextAll(checkboxes).removeAttr("disabled");(thisChange==="all")?$this.nextAll(checkboxes).removeAttr("checked"):null}}})}).last().trigger("change")}if(location.href.match(/page\=ws-plugin--s2member-down-ops/)){var updateCloudFrontPrivateKey=function(){var $hiddenPrivateKey=$("input#ws-plugin--s2member-amazon-cf-files-private-key");var $visiblePrivateKeyEntry=$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry");var hiddenPrivateKeyValue=$.trim($hiddenPrivateKey.val()),visiblePrivateKeyEntryValue=$.trim($visiblePrivateKeyEntry.val());if((hiddenPrivateKeyValue&&!visiblePrivateKeyEntryValue)||visiblePrivateKeyEntryValue.match(/[^\r\n\u25CF]/)){$hiddenPrivateKey.val(visiblePrivateKeyEntryValue),$visiblePrivateKeyEntry.val(visiblePrivateKeyEntryValue.replace(/[^\r\n]/g,String.fromCharCode(9679)))}};$("form#ws-plugin--s2member-options-form").submit(updateCloudFrontPrivateKey);$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry").change(updateCloudFrontPrivateKey).trigger("change");var updateCloudFrontDistroCfgs=function(){var $hiddenPrivateKey=$("input#ws-plugin--s2member-amazon-cf-files-private-key");var $visiblePrivateKeyId=$("input#ws-plugin--s2member-amazon-cf-files-private-key-id");var $autoConfigDistros=$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros");var $autoConfigDistrosStatus=$("input#ws-plugin--s2member-amazon-cf-files-distros-auto-config-status");var autoConfigDistrosStatusValue=$.trim($autoConfigDistrosStatus.val());var hiddenPrivateKeyValue=$.trim($hiddenPrivateKey.val()),visiblePrivateKeyIdValue=$.trim($visiblePrivateKeyId.val());var hiddenPrivateKeyPrevConfigValue=$.trim($hiddenPrivateKey.attr("data-s-prev-config-value")),visiblePrivateKeyIdPrevConfigValue=$.trim($visiblePrivateKeyId.attr("data-s-prev-config-value"));if(autoConfigDistrosStatusValue==="configured"&&((visiblePrivateKeyIdPrevConfigValue&&visiblePrivateKeyIdValue!==visiblePrivateKeyIdPrevConfigValue)||(hiddenPrivateKeyPrevConfigValue&&hiddenPrivateKeyValue!==hiddenPrivateKeyPrevConfigValue))){alert("s2Member will need to delete and re-configure your Amazon CloudFront distributions if you change this. When you're done editing, click (Save All Changes) below.");$autoConfigDistros.attr("checked","checked")}else{if(autoConfigDistrosStatusValue!=="configured"&&visiblePrivateKeyIdValue&&hiddenPrivateKeyValue){alert("s2Member will need to auto-configure your Amazon CloudFront distributions for you. When you're done editing, click (Save All Changes) below.");$autoConfigDistros.attr("checked","checked")}}};$("input#ws-plugin--s2member-amazon-cf-files-private-key-id").change(updateCloudFrontDistroCfgs);$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry").change(updateCloudFrontDistroCfgs);$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames").change(function(){var $this=$(this),thisChecked=(this.checked)?true:false;var $autoConfigDistros=$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros");var $autoConfigDistroCnames=$("div#ws-plugin--s2member-amazon-cf-files-auto-configure-distro-cnames");(thisChecked)?$autoConfigDistroCnames.show():$autoConfigDistroCnames.hide();(thisChecked)?$autoConfigDistros.attr("checked","checked"):null}).trigger("change")}if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){$("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var $this=$(this),val=$this.val();var $viaCron=$("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(val==2){$viaCron.show()}else{$viaCron.hide()}})}if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){$("div.ws-menu-page select[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification)-term$/)}).change(function(){var button=this.id.replace(/^ws-plugin--s2member-(.+?)-term$/g,"$1");var trialDisabled=($(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;$("p#ws-plugin--s2member-"+button+"-trial-line").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-trial-then").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-20p-rule").css("display",(trialDisabled?"none":""));(trialDisabled)?$("input#ws-plugin--s2member-"+button+"-trial-period").val(0):null;(trialDisabled)?$("input#ws-plugin--s2member-"+button+"-trial-amount").val("0.00"):null});$("div.ws-menu-page input[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification|ccap)-ccaps$/)}).keyup(function(){var value=this.value.replace(/^(-all|-al|-a|-)[;,]*/gi,""),_all=(this.value.match(/^(-all|-al|-a|-)[;,]*/i))?"-all,":"";if(value.match(/[^a-z_0-9,]/)){this.value=_all+$.trim($.trim(value).replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase())}});ws_plugin__s2member_paypalButtonGenerate=function(button){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="",labels={};eval("<?php echo c_ws_plugin__s2member_utils_strings::esc_dq($labels); ?>");var shortCode=$("input#ws-plugin--s2member-"+button+"-shortcode");var code=$("textarea#ws-plugin--s2member-"+button+"-button");var modLevel=$("select#ws-plugin--s2member-modification-level");var level=(button==="modification")?modLevel.val().split(":",2)[1]:button.replace(/^level/,"");var label=labels["level"+level].replace(/"/g,"");var desc=$.trim($("input#ws-plugin--s2member-"+button+"-desc").val().replace(/"/g,""));var trialAmount=$("input#ws-plugin--s2member-"+button+"-trial-amount").val().replace(/[^0-9\.]/g,"");var trialPeriod=$("input#ws-plugin--s2member-"+button+"-trial-period").val().replace(/[^0-9]/g,"");var trialTerm=$("select#ws-plugin--s2member-"+button+"-trial-term").val().replace(/[^A-Z]/g,"");var regAmount=$("input#ws-plugin--s2member-"+button+"-amount").val().replace(/[^0-9\.]/g,"");var regPeriod=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var regTerm=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var regRecur=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var regRecurTimes="",regRecurRetry="1";var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-"+button+"-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-"+button+"-currency").val().replace(/[^A-Z]/g,"");var cCaps=$.trim($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).replace(/^(-all|-al|-a|-)[;,]*/gi,"").replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());cCaps=($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).match(/^(-all|-al|-a|-)[;,]*/i))?((cCaps)?"-all,":"-all")+cCaps.toLowerCase():cCaps.toLowerCase();trialPeriod=(regRecur==="BN")?"0":trialPeriod;trialAmount=(!trialAmount||isNaN(trialAmount)||trialAmount<0.01||trialPeriod<=0)?"0":trialAmount;var levelCcapsPer=(regRecur==="BN"&&regTerm!=="L")?level+":"+cCaps+":"+regPeriod+" "+regTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(trialAmount!=="0"&&(isNaN(trialAmount)||trialAmount<0)){alert("— Oops, a slight problem: —\n\nWhen provided, Trial Amount must be >= 0.00");return false}else{if(trialAmount!=="0"&&trialAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Trial Amount is: 10000.00");return false}else{if(trialTerm==="D"&&trialPeriod>90){alert("— Oops, a slight problem: —\n\nMaximum Trial Days is: 90.\nIf you want to offer more than 90 days, please choose Weeks or Months from the drop-down.");return false}else{if(trialTerm==="W"&&trialPeriod>52){alert("— Oops, a slight problem: —\n\nMaximum Trial Weeks is: 52.\nIf you want to offer more than 52 weeks, please choose Months from the drop-down.");return false}else{if(trialTerm==="M"&&trialPeriod>24){alert("— Oops, a slight problem: —\n\nMaximum Trial Months is: 24.\nIf you want to offer more than 24 months, please choose Years from the drop-down.");return false}else{if(trialTerm==="Y"&&trialPeriod>5){alert("— Oops, a slight problem: —\n\nMax Trial Period Years is: 5.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}}}}}}code.html(code.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(trialPeriod)<=0)?code.html(code.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="(src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;shortCodeTemplateAttrs+=(button==="modification")?'modify="1" ':"";shortCodeTemplateAttrs+='level="'+esc_attr(level)+'" ccaps="'+esc_attr(cCaps)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'" custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';shortCodeTemplateAttrs+=' ta="'+esc_attr(trialAmount)+'" tp="'+esc_attr(trialPeriod)+'" tt="'+esc_attr(trialTerm)+'" ra="'+esc_attr(regAmount)+'" rp="'+esc_attr(regPeriod)+'" rt="'+esc_attr(regTerm)+'" rr="'+esc_attr(regRecur)+'" rrt="'+esc_attr(regRecurTimes)+'" rra="'+esc_attr(regRecurRetry)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(levelCcapsPer)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((button==="modification")?"1":"0")+'"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+esc_attr(regRecur)+'"'));code.html(code.val().replace(/ name\="srt" value\="(.*?)"/,' name="srt" value="'+esc_attr(regRecurTimes)+'"'));code.html(code.val().replace(/ name\="sra" value\="(.*?)"/,' name="sra" value="'+esc_attr(regRecurRetry)+'"'));code.html(code.val().replace(/ name\="a1" value\="(.*?)"/,' name="a1" value="'+esc_attr(trialAmount)+'"'));code.html(code.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+esc_attr(trialPeriod)+'"'));code.html(code.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+esc_attr(trialTerm)+'"'));code.html(code.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+esc_attr(regPeriod)+'"'));code.html(code.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+esc_attr(regTerm)+'"'));$("div#ws-plugin--s2member-"+button+"-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round(new Date().getTime())+'~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["REMOTE_ADDR"])); ?>').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));(button==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode into your Login Welcome Page, or wherever you feel it would be most appropriate.\n\n* Remember, Modification Buttons should be displayed to existing Users/Members, and they should be logged-in, BEFORE clicking this Button."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalCcapButtonGenerate=function(){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="";var shortCode=$("input#ws-plugin--s2member-ccap-shortcode");var code=$("textarea#ws-plugin--s2member-ccap-button");var desc=$.trim($("input#ws-plugin--s2member-ccap-desc").val().replace(/"/g,""));var regAmount=$("input#ws-plugin--s2member-ccap-amount").val().replace(/[^0-9\.]/g,"");var regPeriod=$("select#ws-plugin--s2member-ccap-term").val().split("-")[0].replace(/[^0-9]/g,"");var regTerm=$("select#ws-plugin--s2member-ccap-term").val().split("-")[1].replace(/[^A-Z]/g,"");var regRecur=$("select#ws-plugin--s2member-ccap-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-ccap-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-ccap-currency").val().replace(/[^A-Z]/g,"");var cCaps=$.trim($.trim($("input#ws-plugin--s2member-ccap-ccaps").val()).replace(/^(-all|-al|-a|-)[;,]*/gi,"").replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());cCaps=($.trim($("input#ws-plugin--s2member-ccap-ccaps").val()).match(/^(-all|-al|-a|-)[;,]*/i))?((cCaps)?"-all,":"-all")+cCaps.toLowerCase():cCaps.toLowerCase();var levelCcapsPer=(regRecur==="BN"&&regTerm!=="L")?"*:"+cCaps+":"+regPeriod+" "+regTerm:"*:"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(!cCaps||cCaps==="-all"){alert("— Oops, a slight problem: —\n\nPlease provide at least one Custom Capability.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}shortCodeTemplateAttrs+='level="*" ccaps="'+esc_attr(cCaps)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'"';shortCodeTemplateAttrs+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(regAmount)+'" rp="'+esc_attr(regPeriod)+'" rt="'+esc_attr(regTerm)+'" rr="'+esc_attr(regRecur)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(levelCcapsPer)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));$("div#ws-plugin--s2member-ccap-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round(new Date().getTime())+'~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["REMOTE_ADDR"])); ?>').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));alert("Your Button has been generated.\nPlease copy/paste the Shortcode into your Login Welcome Page, or wherever you feel it would be most appropriate.\n\n* Remember, Independent Custom Capability Buttons should ONLY be displayed to existing Users/Members, and they MUST be logged-in, BEFORE clicking this Button.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="";var shortCode=$("input#ws-plugin--s2member-sp-shortcode");var code=$("textarea#ws-plugin--s2member-sp-button");var leading=$("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var regAmount=$("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var desc=$.trim($("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!leading){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 → Restriction Options → Specific Post/Page Access.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}var spIdsHours="sp:"+ids+":"+hours;shortCodeTemplateAttrs+='sp="1" ids="'+esc_attr(ids)+'" exp="'+esc_attr(hours)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'"';shortCodeTemplateAttrs+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(regAmount)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(spIdsHours)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));$("div#ws-plugin--s2member-sp-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round(new Date().getTime())+'~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["REMOTE_ADDR"])); ?>').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));alert("Your Button has been generated.\nPlease copy/paste the Shortcode into your WordPress Editor.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalRegLinkGenerate=function(){var level=$("select#ws-plugin--s2member-reg-link-level").val().replace(/[^0-9]/g,"");var subscrID=$.trim($("input#ws-plugin--s2member-reg-link-subscr-id").val());var custom=$.trim($("input#ws-plugin--s2member-reg-link-custom").val());var cCaps=$.trim($.trim($("input#ws-plugin--s2member-reg-link-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());var fixedTerm=$.trim($("input#ws-plugin--s2member-reg-link-fixed-term").val().replace(/[^A-Z 0-9]/gi,"").toUpperCase());var $link=$("p#ws-plugin--s2member-reg-link"),$loading=$("img#ws-plugin--s2member-reg-link-loading");var levelCcapsPer=(fixedTerm&&!fixedTerm.match(/L$/))?level+":"+cCaps+":"+fixedTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(!subscrID){alert("— Oops, a slight problem: —\n\nPaid Subscr. ID is a required value.");return false}else{if(!custom||custom.indexOf('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq ($_SERVER["HTTP_HOST"]); ?>')!==0){alert("— Oops, a slight problem: —\n\nThe Custom Value MUST start with your domain name.");return false}else{if(fixedTerm&&!fixedTerm.match(/^[1-9]+ (D|W|M|Y|L)$/)){alert("— Oops, a slight problem: —\n\nThe Fixed Term Length is not formatted properly.");return false}}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_reg_access_link_via_ajax",ws_plugin__s2member_reg_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-reg-access-link-via-ajax")); ?>',s2member_reg_access_link_subscr_gateway:"paypal",s2member_reg_access_link_subscr_id:subscrID,s2member_reg_access_link_custom:custom,s2member_reg_access_link_item_number:levelCcapsPer},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var leading=$("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var $link=$("p#ws-plugin--s2member-sp-link"),$loading=$("img#ws-plugin--s2member-sp-link-loading");if(!leading){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 → Restriction Options → Specific Post/Page Access.");return false}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_sp_access_link_via_ajax",ws_plugin__s2member_sp_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link-via-ajax")); ?>',s2member_sp_access_link_ids:ids,s2member_sp_access_link_hours:hours},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false}}if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){$("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var $this=$(this),val=$this.val();var $rows=$("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var $prevImg=$("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(val<=0){$rows.css("display","none"),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}else{if(val==1){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/unchecked\.png$/,"/checked.png"))}else{if(val==2){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}}}});$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').change(function(){var thisChange=$(this).val(),checkedIndexes=[];$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').each(function(){var $this=$(this),val=$this.val(),checkboxes='input[type="checkbox"]';if(val==="removal-deletion"&&this.checked){$this.nextAll(checkboxes).slice(0,2).attr({checked:"checked",disabled:"disabled"})}else{if(val==="removal-deletion"&&!this.checked){$this.nextAll(checkboxes).slice(0,2).removeAttr("disabled");(thisChange==="removal-deletion")?$this.nextAll(checkboxes).slice(0,2).removeAttr("checked"):null}else{if(val==="modification"&&this.checked){$this.nextAll(checkboxes).slice(0,3).attr({checked:"checked",disabled:"disabled"})}else{if(val==="modification"&&!this.checked){(thisChange==="modification")?$this.nextAll(checkboxes).slice(0,3).removeAttr("checked"):null;$this.nextAll(checkboxes).slice(0,3).removeAttr("disabled")}}}}}).each(function(index){(this.checked)?checkedIndexes.push(index):null});$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").removeAttr("disabled");if($.inArray(3,checkedIndexes)===-1&&$.inArray(4,checkedIndexes)===-1&&$.inArray(5,checkedIndexes)===-1&&$.inArray(6,checkedIndexes)===-1){$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").attr("disabled","disabled")}}).last().trigger("change")}});
1
+ jQuery(document).ready(function($){var esc_attr=esc_html=function(string){if(/[&\<\>"']/.test(string=String(string))){string=string.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),string=string.replace(/"/g,"&quot;").replace(/'/g,"&#039;")}return string};ws_plugin__s2member_generateSecurityKey=function(obj){if(!obj){obj="#ws-plugin--s2member-sec-encryption-key"}var mt_rand=function(min,max){min=(arguments.length<1)?0:min;max=(arguments.length<2)?2147483647:max;return Math.floor(Math.random()*(max-min+1))+min};var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%^&*()";for(var i=0,key="";i<64;i++){key+=chars.substr(mt_rand(0,chars.length-1),1)}$(obj).val(key);return false};if(location.href.match(/page\=ws-plugin--s2member/)){$("input.ws-plugin--s2member-update-roles-button, input.ws-plugin--s2member-reset-roles-button").click(function(){var $this=$(this);$this.val("one moment please ...");var levels='<?php echo (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; ?>';var resetUpdate=($this.hasClass("ws-plugin--s2member-reset-roles-button"))?"Reset":"Update";$.post(ajaxurl,{action:"ws_plugin__s2member_update_roles_via_ajax",ws_plugin__s2member_update_roles_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-update-roles-via-ajax")); ?>'},function(response){if(response==="1"){alert("s2Member's Roles/Capabilities "+((resetUpdate.toLowerCase()==="reset")?"have been successfully reset":"updated successfully")+".\nYour installation of s2Member has Membership Levels 0-"+levels+"."),$this.val(resetUpdate+" Roles/Capabilities")}else{if(response==="l"){alert("Sorry, your request failed.\ns2Member's Roles/Capabilities are locked by Filter:\nws_plugin__s2member_lock_roles_caps"),$this.val(resetUpdate+" Roles/Capabilities")}else{alert("Sorry, your request failed.\nAccess denied. Do you have the ability to `create_users`?"),$this.val(resetUpdate+" Roles/Capabilities")}}});return false})}if(location.href.match(/page\=ws-plugin--s2member-logs/)){$("input#ws-plugin--s2member-gateway-debug-logs-extensive-1").click(function(){var $this=$(this),thisChecked=(this.checked)?true:false;if(thisChecked){$("input#ws-plugin--s2member-gateway-debug-logs-1").attr("checked","checked")}});var $toggles=$("a.ws-plugin--s2member-log-file-viewport-toggle");$toggles.click(function(){$("textarea#ws-plugin--s2member-log-file-viewer").each(function(){var $viewer=$(this);if($viewer.attr("data-state")!=="expanded"){$viewer.css({height:($viewer.prop("scrollHeight")+50)+"px","overflow-y":"auto"});$toggles.html("&#8657; normalize viewport &#10073;");$viewer.attr("data-state","expanded")}else{$viewer.css({height:"auto","overflow-y":"scroll"});$toggles.html("&#8659; expand viewport &#8659;");$viewer.attr("data-state","scrolling")}});return false})}if(location.href.match(/page\=ws-plugin--s2member-mms-ops/)){$("select#ws-plugin--s2member-mms-registration-file").change(function(){if($(this).val()==="wp-signup"){var gv=$("select#ws-plugin--s2member-mms-registration-grants").val(),l0v=$("input#ws-plugin--s2member-mms-registration-blogs-level0").val();$("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();$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0")[((gv==="all")?"show":"hide")]();$("input#ws-plugin--s2member-mms-registration-blogs-level0").val(((gv==="all")?((l0v>0)?l0v:"1"):"0"))}else{if($(this).val()==="wp-login"){var gv=$("select#ws-plugin--s2member-mms-registration-grants").val(),l0v=$("input#ws-plugin--s2member-mms-registration-blogs-level0").val();$("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();$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0").hide();$("input#ws-plugin--s2member-mms-registration-blogs-level0").val("0")}}}).trigger("change");$("select#ws-plugin--s2member-mms-registration-grants").change(function(){$("select#ws-plugin--s2member-mms-registration-file").trigger("change")})}if(location.href.match(/page\=ws-plugin--s2member-gen-ops/)){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 unhappy Customers. Data corruption WILL occur! For 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.")){$("input#ws-plugin--s2member-sec-encryption-key").removeAttr("disabled")}return false};ws_plugin__s2member_securityKeyHistory=function(){$("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false};$("select#ws-plugin--s2member-new-user-emails-enabled").change(function(){var $pluggable=$("input#ws-plugin--s2member-pluggables-wp-new-user-notification"),$this=$(this),$newUserEmails=$("div#ws-plugin--s2member-new-user-emails");if($pluggable.val()==="0"||$this.val()==="0"){($pluggable.val()==="0")?$this.attr("disabled","disabled"):$this.removeAttr("disabled");$(":input",$newUserEmails).attr("disabled","disabled"),$newUserEmails.css("opacity","0.5")}else{$this.removeAttr("disabled"),$(":input",$newUserEmails).removeAttr("disabled"),$newUserEmails.css("opacity","")}}).trigger("change");$("select#ws-plugin--s2member-login-reg-design-enabled").change(function(){var $this=$(this),$loginRegDesign=$("div#ws-plugin--s2member-login-reg-design");if($this.val()==="0"){$(":input",$loginRegDesign).attr("disabled","disabled"),$loginRegDesign.css("opacity","0.5"),$loginRegDesign.hide()}else{$(":input",$loginRegDesign).removeAttr("disabled"),$loginRegDesign.css("opacity",""),$loginRegDesign.show()}}).trigger("change");if($("input#ws-plugin--s2member-custom-reg-fields").length&&$("div#ws-plugin--s2member-custom-reg-field-configuration").length){(function(){var i,fieldDefaults,tools,table,$tools,$table;var $fields=$("input#ws-plugin--s2member-custom-reg-fields");var $configuration=$("div#ws-plugin--s2member-custom-reg-field-configuration");var fields=($fields.val())?$.JSON.parse($fields.val()):[];fields=(fields instanceof Array)?fields:[];fieldDefaults={section:"no",sectitle:"",id:"",label:"",type:"text",deflt:"",options:"",expected:"",required:"yes",levels:"all",editable:"yes",classes:"",styles:"",attrs:""};for(i=0;i<fields.length;i++){fields[i]=$.extend(true,{},fieldDefaults,fields[i])}tools='<div id="ws-plugin--s2member-custom-reg-field-configuration-tools"></div>',table='<table id="ws-plugin--s2member-custom-reg-field-configuration-table"></table>';$configuration.html(tools+table);$tools=$("div#ws-plugin--s2member-custom-reg-field-configuration-tools"),$table=$("table#ws-plugin--s2member-custom-reg-field-configuration-table");ws_plugin__s2member_customRegFieldSectionChange=function(select){var section=$(select).val();var sectitle_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle";(section==="yes")?$(sectitle_trs).css("display",""):$(sectitle_trs).css("display","none")};ws_plugin__s2member_customRegFieldTypeChange=function(select){var type=$(select).val();var deflt_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt",options_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-options",expected_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected";(type.match(/^(text|textarea)$/))?$(deflt_trs).css("display",""):$(deflt_trs).css("display","none");(type.match(/^(select|selects|checkboxes|radios)$/))?$(options_trs).css("display",""):$(options_trs).css("display","none");(type.match(/^(text|textarea)$/))?$(expected_trs).css("display",""):$(expected_trs).css("display","none")};ws_plugin__s2member_customRegFieldDelete=function(index){var newFields=new Array();for(var i=0;i<fields.length;i++){if(i!==index){newFields.push(fields[i])}}fields=newFields,updateFields(),buildTable()};ws_plugin__s2member_customRegFieldMoveUp=function(index){if(typeof fields[index]==="object"&&typeof fields[index-1]==="object"){var prevFieldObj=fields[index-1],thisFieldObj=fields[index];fields[index-1]=thisFieldObj,fields[index]=prevFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldMoveDown=function(index){if(typeof fields[index]==="object"&&typeof fields[index+1]==="object"){var nextFieldObj=fields[index+1],thisFieldObj=fields[index];fields[index+1]=thisFieldObj,fields[index]=nextFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldCreate=function(){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field))){fields.push(field),updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+(fields.length-1);alert('Field created successfully.\n* Remember to "Save All Changes".')},500)}};ws_plugin__s2member_customRegFieldUpdate=function(index){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field,index))){fields[index]=field,updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+index;alert('Field updated successfully.\n* Remember to "Save All Changes".')},500)}};ws_plugin__s2member_customRegFieldAdd=function(){buildTools(true)};ws_plugin__s2member_customRegFieldEdit=function(index){buildTools(false,index),scrollReset()};ws_plugin__s2member_customRegFieldCancel=function(){buildTools(),scrollReset()};var validateField=function(field,index){var editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,errors=[],options,i;if(typeof field!=="object"||typeof(field=$.extend(true,{},fieldDefaults,field))!=="object"){alert("Invalid field object. Please try again.");return false}field.sectitle=(field.section==="yes")?field.sectitle:"";field.deflt=(field.type.match(/^(text|textarea)$/))?field.deflt:"";field.deflt=(field.type.match(/^(text)$/))?field.deflt.replace(/[\r\n\t ]+/g," "):field.deflt;field.options=(field.type.match(/^(select|selects|checkboxes|radios)$/))?field.options:"";field.expected=(field.type.match(/^(text|textarea)$/))?field.expected:"";if(!field.id){errors.push("Unique Field ID:\nThis is required. Please try again.")}else{if(fieldIdExists(field.id)&&(!editing||field.id!==fields[index].id)){errors.push("Unique Field ID:\nThat Field ID already exists. Please try again.")}}if(!field.label){errors.push("Field Label/Description:\nThis is required. Please try again.")}if(field.type.match(/^(select|selects|checkboxes|radios)$/)&&!field.options){errors.push("Option Configuration File:\nThis is required. Please try again.")}else{if(field.type.match(/^(select|selects|checkboxes|radios)$/)){for(i=0;i<(options=field.options.split(/[\r\n]+/)).length;i++){if(!(options[i]=$.trim(options[i])).match(/^([^\|]*)(\|)([^\|]*)(\|default)?$/)){errors.push("Option Configuration File:\nInvalid configuration at line #"+(i+1)+".");break}}field.options=$.trim(options.join("\n"))}}if(!(field.levels=field.levels.replace(/ /g,""))){errors.push("Applicable Levels:\nThis is required. Please try again.")}else{if(!field.levels.match(/^(all|[0-9,]+)$/)){errors.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(field.classes&&field.classes.match(/[^a-z 0-9 _ \-]/i)){errors.push("CSS Classes:\nContains invalid characters. Please try again.\n(only: alphanumerics, underscores, hyphens, spaces)")}if(field.styles&&field.styles.match(/["\=\>\<]/)){errors.push('CSS Styles:\nContains invalid characters. Please try again.\n(do NOT use these characters: = " < >)')}if(field.attrs&&field.attrs.match(/[\>\<]/)){errors.push("Other Attributes:\nContains invalid characters. Please try again.\n(do NOT use these characters: < >)")}if(errors.length>0){alert(errors.join("\n\n"));return false}else{return field}};var updateFields=function(){$fields.val(((fields.length>0)?$.JSON.stringify(fields):""))};var fieldId2Var=function(fieldId){return(typeof fieldId==="string")?$.trim(fieldId).toLowerCase().replace(/[^a-z0-9]/g,"_"):""};var fieldTypeDesc=function(type){var types={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 types[type]==="string"){return types[type]}return""};var fieldIdExists=function(fieldId){for(var i=0;i<fields.length;i++){if(fields[i].id===fieldId){return true}}};var scrollReset=function(){scrollTo(0,$("div.ws-plugin--s2member-custom-reg-fields-section").offset()["top"]-100)};var buildTools=function(adding,index){var i=0,html="",form="",w=0,h=0,editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,displayForm=(adding||editing)?true:false,field=(editing)?$.extend(true,{},fieldDefaults,fields[index]):fieldDefaults;html+='<a href="#" onclick="ws_plugin__s2member_customRegFieldAdd(); return false;">Add New Field</a>';tb_remove(),$("div#ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form").remove();if(displayForm){form+='<div id="ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form">';form+='<table id="ws-plugin--s2member-custom-reg-field-configuration-tools-form">';form+="<tbody>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">Starts A New Section?</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<select property="section" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section" onchange="ws_plugin__s2member_customRegFieldSectionChange(this);">';form+='<option value="no"'+((field.section==="no")?' selected="selected"':"")+'">No (this Field flows normally)</option>';form+='<option value="yes"'+((field.section==="yes")?' selected="selected"':"")+'">Yes (this Field begins a new section)</option>';form+="</select><br />";form+="<small>Optional. Allows Fields to be grouped into sections.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+'><td colspan="2"><hr /></td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+">";form+='<td colspan="2">';form+="Title for this new section? (optional)<br />";form+='<input type="text" property="sectitle" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle" value="'+esc_attr(field.sectitle)+'" /><br />';form+="<small>If empty, a simple divider will be used by default.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-type"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">Form Field Type: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<select property="type" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);">';form+='<option value="text"'+((field.type==="text")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("text"))+"</option>";form+='<option value="textarea"'+((field.type==="textarea")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("textarea"))+"</option>";form+='<option value="select"'+((field.type==="select")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("select"))+"</option>";form+='<option value="selects"'+((field.type==="selects")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("selects"))+"</option>";form+='<option value="checkbox"'+((field.type==="checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkbox"))+"</option>";form+='<option value="pre_checkbox"'+((field.type==="pre_checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("pre_checkbox"))+"</option>";form+='<option value="checkboxes"'+((field.type==="checkboxes")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkboxes"))+"</option>";form+='<option value="radios"'+((field.type==="radios")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("radios"))+"</option>";form+="</select><br />";form+="<small>The options below may change, based on the Field Type you choose here.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-label"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">Field Label/Desc: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<input type="text" property="label" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label" value="'+esc_attr(field.label)+'" /><br />';form+="<small>Examples: <code>Choose Country</code>, <code>Street Address</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-id"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">Unique Field ID: *</label></label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<input type="text" property="id" maxlength="25" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id" value="'+esc_attr(field.id)+'" /><br />';form+="<small>Examples: <code>country_code</code>, <code>street_address</code></small><br />";form+='<small>e.g., <code>[s2Get user_field="country_code" /]</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-required"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">Field Required: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<option value="yes"'+((field.required==="yes")?' selected="selected"':"")+'">Yes (required)</option>';form+='<option value="no"'+((field.required==="no")?' selected="selected"':"")+'">No (optional)</option>';form+="</select><br />";form+='<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />';form+="<small>* Administrators are exempt from this requirement.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt">Default Text Value: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="deflt" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt" rows="1">'+esc_html(field.deflt)+"</textarea><br />";form+="<small>Default value before user input is received.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * (one option per line)</label><br />';form+="<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="options" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options" rows="3">'+esc_html(field.options)+"</textarea><br />";form+="Here is a quick example:<br />";form+="<small>You can also specify a <em>default</em> option:</small><br />";form+="<code>US|United States|default</code><br />";form+="<code>CA|Canada</code><br />";form+="<code>VI|Virgin Islands (U.S.)</code>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+'><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">';form+='<option value=""'+((field.expected==="")?' selected="selected"':"")+'">Anything Goes</option>';form+='<option disabled="disabled"></option>';form+='<optgroup label="Specific Input Types">';form+='<option value="numeric-wp-commas"'+((field.expected==="numeric-wp-commas")?' selected="selected"':"")+'">Numeric (with or without decimals, commas allowed)</option>';form+='<option value="numeric"'+((field.expected==="numeric")?' selected="selected"':"")+'">Numeric (with or without decimals, no commas)</option>';form+='<option value="integer"'+((field.expected==="integer")?' selected="selected"':"")+'">Integer (whole number, without any decimals)</option>';form+='<option value="integer-gt-0"'+((field.expected==="integer-gt-0")?' selected="selected"':"")+'">Integer > 0 (whole number, no decimals, greater than 0)</option>';form+='<option value="float"'+((field.expected==="float")?' selected="selected"':"")+'">Float (floating point number, decimals required)</option>';form+='<option value="float-gt-0"'+((field.expected==="float-gt-0")?' selected="selected"':"")+'">Float > 0 (floating point number, decimals required, greater than 0)</option>';form+='<option value="date"'+((field.expected==="date")?' selected="selected"':"")+'">Date (required date format: dd/mm/yyyy)</option>';form+='<option value="email"'+((field.expected==="email")?' selected="selected"':"")+'">Email (require valid email)</option>';form+='<option value="url"'+((field.expected==="url")?' selected="selected"':"")+'">Full URL (starting with http or https)</option>';form+='<option value="domain"'+((field.expected==="domain")?' selected="selected"':"")+'">Domain Name (domain name only, without http)</option>';form+='<option value="phone"'+((field.expected==="phone")?' selected="selected"':"")+'">Phone # (10 digits w/possible hyphens,spaces,brackets)</option>';form+='<option value="uszip"'+((field.expected==="uszip")?' selected="selected"':"")+'">US Zipcode (5-9 digits w/possible hyphen)</option>';form+='<option value="cazip"'+((field.expected==="cazip")?' selected="selected"':"")+'">Canadian Zipcode (6 alpha-numerics w/possible space)</option>';form+='<option value="uczip"'+((field.expected==="uczip")?' selected="selected"':"")+'">US/Canadian Zipcode (either a US or Canadian zipcode)</option>';form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Any Character Combination">';for(i=1;i<=25;i++){form+='<option value="any-'+i+'"'+((field.expected==="any-"+i)?' selected="selected"':"")+'">Any Character Combination ('+i+" character minimum)</option>";form+='<option value="any-'+i+'-e"'+((field.expected==="any-"+i+"-e")?' selected="selected"':"")+'">Any Character Combination (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics, Spaces &amp; Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-punctuation-'+i+'"'+((field.expected==="alphanumerics-spaces-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics, Spaces &amp; Punctuation ('+i+" character minimum)</option>";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>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics &amp; Spaces Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-'+i+'"'+((field.expected==="alphanumerics-spaces-"+i)?' selected="selected"':"")+'">Alphanumerics &amp; Spaces ('+i+" character minimum)</option>";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>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics &amp; Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-punctuation-'+i+'"'+((field.expected==="alphanumerics-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics &amp; Punctuation ('+i+" character minimum)</option>";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>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-'+i+'"'+((field.expected==="alphanumerics-"+i)?' selected="selected"':"")+'">Alphanumerics ('+i+" character minimum)</option>";form+='<option value="alphanumerics-'+i+'-e"'+((field.expected==="alphanumerics-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphabetics Only">';for(i=1;i<=25;i++){form+='<option value="alphabetics-'+i+'"'+((field.expected==="alphabetics-"+i)?' selected="selected"':"")+'">Alphabetics ('+i+" character minimum)</option>";form+='<option value="alphabetics-'+i+'-e"'+((field.expected==="alphabetics-"+i+"-e")?' selected="selected"':"")+'">Alphabetics (exactly '+i+" character"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Numeric Digits Only">';for(i=1;i<=25;i++){form+='<option value="numerics-'+i+'"'+((field.expected==="numerics-"+i)?' selected="selected"':"")+'">Numeric Digits ('+i+" digit minimum)</option>";form+='<option value="numerics-'+i+'-e"'+((field.expected==="numerics-"+i+"-e")?' selected="selected"':"")+'">Numeric Digits (exactly '+i+" digit"+((i>1)?"s":"")+")</option>"}form+="</optgroup>";form+="</select><br />";form+="<small>Only Users/Members will be required to meet this criteria.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">Applicable Membership Levels: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<input type="text" property="levels" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels" value="'+esc_attr(field.levels)+'" /><br />';form+="<small>Please use comma-delimited Level #'s: <code>0,1,2,3,4</code> or type: <code>all</code>.</small><br />";form+="<small>This allows you to enable this field - only at specific Membership Levels.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">Allow Profile Edits: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<option value="yes"'+((field.editable==="yes")?' selected="selected"':"")+'">Yes (editable)</option>';form+='<option value="no"'+((field.editable==="no")?' selected="selected"':"")+'">No (uneditable after registration)</option>';form+='<option value="no-invisible"'+((field.editable==="no-invisible")?' selected="selected"':"")+'">No (uneditable &amp; totally invisible after registration)</option>';form+='<option value="no-always-invisible"'+((field.editable==="no-always-invisible")?' selected="selected"':"")+'">No (uneditable &amp; totally invisible, both during &amp; after registration)</option>';form+='<option value="yes-invisible"'+((field.editable==="yes-invisible")?' selected="selected"':"")+'">Yes (editable after registration / invisible during registration)</option>';form+="</select><br />";form+="<small>If <code>No</code>, this field will be un-editable after registration.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">CSS Classes: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<input type="text" property="classes" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes" value="'+esc_attr(field.classes)+'" /><br />';form+="<small>Example: <code>my-style-1 my-style-2</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">CSS Styles: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<input type="text" property="styles" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles" value="'+esc_attr(field.styles)+'" /><br />';form+="<small>Example: <code>color:#000000; background:#FFFFFF;</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">Other Attributes: (optional)</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<input type="text" property="attrs" autocomplete="off" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs" value="'+esc_attr(field.attrs)+'" /><br />';form+='<small>Example: <code>onkeyup="" onblur=""</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons"><td colspan="2">&nbsp;</td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons">';form+='<td align="left">';form+='<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />';form+="</td>";form+='<td align="right">';form+='<input type="button" value="'+((editing)?"Update This Field":"Create Registration Field")+'" onclick="'+((editing)?"ws_plugin__s2member_customRegFieldUpdate("+index+");":"ws_plugin__s2member_customRegFieldCreate();")+'" />';form+="</td>";form+="</tr>";form+="</tbody>";form+="</table>";form+="<div>";$("body").append(form);tb_show(((editing)?"Editing Registration/Profile Field":"New Custom Registration/Profile Field"),"#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form");$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form").show()}$tools.html(html)};var buildTable=function(){var l=fields.length,i=0,html="",eo="o";html+="<tbody>";html+="<tr>";html+="<th>Order</th>";html+="<th>Field Type</th>";html+="<th>Unique ID</th>";html+="<th>Required</th>";html+="<th>Levels</th>";html+="<th>- Tools -</th>";html+="</tr>";if(fields.length>0){for(i=0;i<fields.length;i++){html+='<tr class="'+esc_attr((eo=(eo==="o")?"e":"o"))+((fields[i].section==="yes")?" s":"")+" ws-plugin--s2member-custom-reg-field-configuration-table-row-"+i+'">';html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-move-up" href="#" onclick="ws_plugin__s2member_customRegFieldMoveUp('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-move-down" href="#" onclick="ws_plugin__s2member_customRegFieldMoveDown('+i+'); return false;"></a></td>';html+='<td nowrap="nowrap">'+esc_html(fieldTypeDesc(fields[i].type))+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].id)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].required)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].levels)+"</td>";html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-edit" href="#" onclick="ws_plugin__s2member_customRegFieldEdit('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-delete" href="#" onclick="ws_plugin__s2member_customRegFieldDelete('+i+'); return false;"></a></td>';html+="</tr>"}}else{html+="<tr>";html+='<td colspan="6">No Custom Fields are configured.</td>';html+="</tr>"}html+="</tbody>";$table.html(html)};buildTools(),buildTable()})()}}if(location.href.match(/page\=ws-plugin--s2member-res-ops/)){$("input#ws-plugin--s2member-brute-force-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.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 c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's Brute Force Restriction Logs have all been reset."),$this.val("Reset Brute Force Logs")});return false});$("input#ws-plugin--s2member-ip-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.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 c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's IP Restriction Logs have all been reset."),$this.val("Reset IP Restriction Logs")});return false});$('div.ws-plugin--s2member-query-level-access-section input[type="checkbox"][name="ws_plugin__s2member_filter_wp_query[]"]').change(function(){var thisChange=$(this).val();$('div.ws-plugin--s2member-query-level-access-section input[type="checkbox"][name="ws_plugin__s2member_filter_wp_query[]"]').each(function(){var $this=$(this),val=$this.val(),checkboxes='input[type="checkbox"]';if(val==="all"&&this.checked){$this.nextAll(checkboxes).attr({checked:"checked",disabled:"disabled"})}else{if(val==="all"&&!this.checked){$this.nextAll(checkboxes).removeAttr("disabled");(thisChange==="all")?$this.nextAll(checkboxes).removeAttr("checked"):null}}})}).last().trigger("change")}if(location.href.match(/page\=ws-plugin--s2member-down-ops/)){var updateCloudFrontPrivateKey=function(){var $hiddenPrivateKey=$("input#ws-plugin--s2member-amazon-cf-files-private-key");var $visiblePrivateKeyEntry=$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry");var hiddenPrivateKeyValue=$.trim($hiddenPrivateKey.val()),visiblePrivateKeyEntryValue=$.trim($visiblePrivateKeyEntry.val());if((hiddenPrivateKeyValue&&!visiblePrivateKeyEntryValue)||visiblePrivateKeyEntryValue.match(/[^\r\n\u25CF]/)){$hiddenPrivateKey.val(visiblePrivateKeyEntryValue),$visiblePrivateKeyEntry.val(visiblePrivateKeyEntryValue.replace(/[^\r\n]/g,String.fromCharCode(9679)))}};$("form#ws-plugin--s2member-options-form").submit(updateCloudFrontPrivateKey);$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry").change(updateCloudFrontPrivateKey).trigger("change");var updateCloudFrontDistroCfgs=function(){var $hiddenPrivateKey=$("input#ws-plugin--s2member-amazon-cf-files-private-key");var $visiblePrivateKeyId=$("input#ws-plugin--s2member-amazon-cf-files-private-key-id");var $autoConfigDistros=$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros");var $autoConfigDistrosStatus=$("input#ws-plugin--s2member-amazon-cf-files-distros-auto-config-status");var autoConfigDistrosStatusValue=$.trim($autoConfigDistrosStatus.val());var hiddenPrivateKeyValue=$.trim($hiddenPrivateKey.val()),visiblePrivateKeyIdValue=$.trim($visiblePrivateKeyId.val());var hiddenPrivateKeyPrevConfigValue=$.trim($hiddenPrivateKey.attr("data-s-prev-config-value")),visiblePrivateKeyIdPrevConfigValue=$.trim($visiblePrivateKeyId.attr("data-s-prev-config-value"));if(autoConfigDistrosStatusValue==="configured"&&((visiblePrivateKeyIdPrevConfigValue&&visiblePrivateKeyIdValue!==visiblePrivateKeyIdPrevConfigValue)||(hiddenPrivateKeyPrevConfigValue&&hiddenPrivateKeyValue!==hiddenPrivateKeyPrevConfigValue))){alert("s2Member will need to delete and re-configure your Amazon CloudFront distributions if you change this. When you're done editing, click (Save All Changes) below.");$autoConfigDistros.attr("checked","checked")}else{if(autoConfigDistrosStatusValue!=="configured"&&visiblePrivateKeyIdValue&&hiddenPrivateKeyValue){alert("s2Member will need to auto-configure your Amazon CloudFront distributions for you. When you're done editing, click (Save All Changes) below.");$autoConfigDistros.attr("checked","checked")}}};$("input#ws-plugin--s2member-amazon-cf-files-private-key-id").change(updateCloudFrontDistroCfgs);$("textarea#ws-plugin--s2member-amazon-cf-files-private-key-entry").change(updateCloudFrontDistroCfgs);$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames").change(function(){var $this=$(this),thisChecked=(this.checked)?true:false;var $autoConfigDistros=$("input#ws-plugin--s2member-amazon-cf-files-auto-configure-distros");var $autoConfigDistroCnames=$("div#ws-plugin--s2member-amazon-cf-files-auto-configure-distro-cnames");(thisChecked)?$autoConfigDistroCnames.show():$autoConfigDistroCnames.hide();(thisChecked)?$autoConfigDistros.attr("checked","checked"):null}).trigger("change")}if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){$("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var $this=$(this),val=$this.val();var $viaCron=$("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(val==2){$viaCron.show()}else{$viaCron.hide()}})}if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){$("div.ws-menu-page select[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification)-term$/)}).change(function(){var button=this.id.replace(/^ws-plugin--s2member-(.+?)-term$/g,"$1");var trialDisabled=($(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;$("p#ws-plugin--s2member-"+button+"-trial-line").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-trial-then").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-20p-rule").css("display",(trialDisabled?"none":""));(trialDisabled)?$("input#ws-plugin--s2member-"+button+"-trial-period").val(0):null;(trialDisabled)?$("input#ws-plugin--s2member-"+button+"-trial-amount").val("0.00"):null});$("div.ws-menu-page input[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification|ccap)-ccaps$/)}).keyup(function(){var value=this.value.replace(/^(-all|-al|-a|-)[;,]*/gi,""),_all=(this.value.match(/^(-all|-al|-a|-)[;,]*/i))?"-all,":"";if(value.match(/[^a-z_0-9,]/)){this.value=_all+$.trim($.trim(value).replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase())}});ws_plugin__s2member_paypalButtonGenerate=function(button){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="",labels={};eval("<?php echo c_ws_plugin__s2member_utils_strings::esc_dq($labels); ?>");var shortCode=$("input#ws-plugin--s2member-"+button+"-shortcode");var code=$("textarea#ws-plugin--s2member-"+button+"-button");var modLevel=$("select#ws-plugin--s2member-modification-level");var level=(button==="modification")?modLevel.val().split(":",2)[1]:button.replace(/^level/,"");var label=labels["level"+level].replace(/"/g,"");var desc=$.trim($("input#ws-plugin--s2member-"+button+"-desc").val().replace(/"/g,""));var trialAmount=$("input#ws-plugin--s2member-"+button+"-trial-amount").val().replace(/[^0-9\.]/g,"");var trialPeriod=$("input#ws-plugin--s2member-"+button+"-trial-period").val().replace(/[^0-9]/g,"");var trialTerm=$("select#ws-plugin--s2member-"+button+"-trial-term").val().replace(/[^A-Z]/g,"");var regAmount=$("input#ws-plugin--s2member-"+button+"-amount").val().replace(/[^0-9\.]/g,"");var regPeriod=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var regTerm=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var regRecur=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var regRecurTimes="",regRecurRetry="1";var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-"+button+"-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-"+button+"-currency").val().replace(/[^A-Z]/g,"");var cCaps=$.trim($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).replace(/^(-all|-al|-a|-)[;,]*/gi,"").replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());cCaps=($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).match(/^(-all|-al|-a|-)[;,]*/i))?((cCaps)?"-all,":"-all")+cCaps.toLowerCase():cCaps.toLowerCase();trialPeriod=(regRecur==="BN")?"0":trialPeriod;trialAmount=(!trialAmount||isNaN(trialAmount)||trialAmount<0.01||trialPeriod<=0)?"0":trialAmount;var levelCcapsPer=(regRecur==="BN"&&regTerm!=="L")?level+":"+cCaps+":"+regPeriod+" "+regTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(trialAmount!=="0"&&(isNaN(trialAmount)||trialAmount<0)){alert("— Oops, a slight problem: —\n\nWhen provided, Trial Amount must be >= 0.00");return false}else{if(trialAmount!=="0"&&trialAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Trial Amount is: 10000.00");return false}else{if(trialTerm==="D"&&trialPeriod>90){alert("— Oops, a slight problem: —\n\nMaximum Trial Days is: 90.\nIf you want to offer more than 90 days, please choose Weeks or Months from the drop-down.");return false}else{if(trialTerm==="W"&&trialPeriod>52){alert("— Oops, a slight problem: —\n\nMaximum Trial Weeks is: 52.\nIf you want to offer more than 52 weeks, please choose Months from the drop-down.");return false}else{if(trialTerm==="M"&&trialPeriod>24){alert("— Oops, a slight problem: —\n\nMaximum Trial Months is: 24.\nIf you want to offer more than 24 months, please choose Years from the drop-down.");return false}else{if(trialTerm==="Y"&&trialPeriod>5){alert("— Oops, a slight problem: —\n\nMax Trial Period Years is: 5.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}}}}}}code.html(code.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(trialPeriod)<=0)?code.html(code.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="(src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;shortCodeTemplateAttrs+=(button==="modification")?'modify="1" ':"";shortCodeTemplateAttrs+='level="'+esc_attr(level)+'" ccaps="'+esc_attr(cCaps)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'" custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';shortCodeTemplateAttrs+=' ta="'+esc_attr(trialAmount)+'" tp="'+esc_attr(trialPeriod)+'" tt="'+esc_attr(trialTerm)+'" ra="'+esc_attr(regAmount)+'" rp="'+esc_attr(regPeriod)+'" rt="'+esc_attr(regTerm)+'" rr="'+esc_attr(regRecur)+'" rrt="'+esc_attr(regRecurTimes)+'" rra="'+esc_attr(regRecurRetry)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(levelCcapsPer)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((button==="modification")?"1":"0")+'"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+esc_attr(regRecur)+'"'));code.html(code.val().replace(/ name\="srt" value\="(.*?)"/,' name="srt" value="'+esc_attr(regRecurTimes)+'"'));code.html(code.val().replace(/ name\="sra" value\="(.*?)"/,' name="sra" value="'+esc_attr(regRecurRetry)+'"'));code.html(code.val().replace(/ name\="a1" value\="(.*?)"/,' name="a1" value="'+esc_attr(trialAmount)+'"'));code.html(code.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+esc_attr(trialPeriod)+'"'));code.html(code.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+esc_attr(trialTerm)+'"'));code.html(code.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+esc_attr(regPeriod)+'"'));code.html(code.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+esc_attr(regTerm)+'"'));$("div#ws-plugin--s2member-"+button+"-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round(new Date().getTime())+'~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["REMOTE_ADDR"])); ?>').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));(button==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode into your Login Welcome Page, or wherever you feel it would be most appropriate.\n\n* Remember, Modification Buttons should be displayed to existing Users/Members, and they should be logged-in, BEFORE clicking this Button."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalCcapButtonGenerate=function(){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="";var shortCode=$("input#ws-plugin--s2member-ccap-shortcode");var code=$("textarea#ws-plugin--s2member-ccap-button");var desc=$.trim($("input#ws-plugin--s2member-ccap-desc").val().replace(/"/g,""));var regAmount=$("input#ws-plugin--s2member-ccap-amount").val().replace(/[^0-9\.]/g,"");var regPeriod=$("select#ws-plugin--s2member-ccap-term").val().split("-")[0].replace(/[^0-9]/g,"");var regTerm=$("select#ws-plugin--s2member-ccap-term").val().split("-")[1].replace(/[^A-Z]/g,"");var regRecur=$("select#ws-plugin--s2member-ccap-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-ccap-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-ccap-currency").val().replace(/[^A-Z]/g,"");var cCaps=$.trim($.trim($("input#ws-plugin--s2member-ccap-ccaps").val()).replace(/^(-all|-al|-a|-)[;,]*/gi,"").replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());cCaps=($.trim($("input#ws-plugin--s2member-ccap-ccaps").val()).match(/^(-all|-al|-a|-)[;,]*/i))?((cCaps)?"-all,":"-all")+cCaps.toLowerCase():cCaps.toLowerCase();var levelCcapsPer=(regRecur==="BN"&&regTerm!=="L")?"*:"+cCaps+":"+regPeriod+" "+regTerm:"*:"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(!cCaps||cCaps==="-all"){alert("— Oops, a slight problem: —\n\nPlease provide at least one Custom Capability.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}shortCodeTemplateAttrs+='level="*" ccaps="'+esc_attr(cCaps)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'"';shortCodeTemplateAttrs+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(regAmount)+'" rp="'+esc_attr(regPeriod)+'" rt="'+esc_attr(regTerm)+'" rr="'+esc_attr(regRecur)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(levelCcapsPer)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));$("div#ws-plugin--s2member-ccap-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round(new Date().getTime())+'~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["REMOTE_ADDR"])); ?>').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));alert("Your Button has been generated.\nPlease copy/paste the Shortcode into your Login Welcome Page, or wherever you feel it would be most appropriate.\n\n* Remember, Independent Custom Capability Buttons should ONLY be displayed to existing Users/Members, and they MUST be logged-in, BEFORE clicking this Button.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="";var shortCode=$("input#ws-plugin--s2member-sp-shortcode");var code=$("textarea#ws-plugin--s2member-sp-button");var leading=$("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var regAmount=$("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var desc=$.trim($("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!leading){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 → Restriction Options → Specific Post/Page Access.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000&&currencyCode.toUpperCase()==="USD"){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}var spIdsHours="sp:"+ids+":"+hours;shortCodeTemplateAttrs+='sp="1" ids="'+esc_attr(ids)+'" exp="'+esc_attr(hours)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'"';shortCodeTemplateAttrs+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(regAmount)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(spIdsHours)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));$("div#ws-plugin--s2member-sp-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_VALUE_FOR_PP_INV\(\); \?\>/g,Math.round(new Date().getTime())+'~<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (esc_attr ($_SERVER["REMOTE_ADDR"])); ?>').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));alert("Your Button has been generated.\nPlease copy/paste the Shortcode into your WordPress Editor.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalRegLinkGenerate=function(){var level=$("select#ws-plugin--s2member-reg-link-level").val().replace(/[^0-9]/g,"");var subscrID=$.trim($("input#ws-plugin--s2member-reg-link-subscr-id").val());var custom=$.trim($("input#ws-plugin--s2member-reg-link-custom").val());var cCaps=$.trim($.trim($("input#ws-plugin--s2member-reg-link-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^a-z_0-9,]/gi,"").toLowerCase());var fixedTerm=$.trim($("input#ws-plugin--s2member-reg-link-fixed-term").val().replace(/[^A-Z 0-9]/gi,"").toUpperCase());var $link=$("p#ws-plugin--s2member-reg-link"),$loading=$("img#ws-plugin--s2member-reg-link-loading");var levelCcapsPer=(fixedTerm&&!fixedTerm.match(/L$/))?level+":"+cCaps+":"+fixedTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(!subscrID){alert("— Oops, a slight problem: —\n\nPaid Subscr. ID is a required value.");return false}else{if(!custom||custom.indexOf('<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq ($_SERVER["HTTP_HOST"]); ?>')!==0){alert("— Oops, a slight problem: —\n\nThe Custom Value MUST start with your domain name.");return false}else{if(fixedTerm&&!fixedTerm.match(/^[1-9]+ (D|W|M|Y|L)$/)){alert("— Oops, a slight problem: —\n\nThe Fixed Term Length is not formatted properly.");return false}}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_reg_access_link_via_ajax",ws_plugin__s2member_reg_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-reg-access-link-via-ajax")); ?>',s2member_reg_access_link_subscr_gateway:"paypal",s2member_reg_access_link_subscr_id:subscrID,s2member_reg_access_link_custom:custom,s2member_reg_access_link_item_number:levelCcapsPer},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var leading=$("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var $link=$("p#ws-plugin--s2member-sp-link"),$loading=$("img#ws-plugin--s2member-sp-link-loading");if(!leading){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 → Restriction Options → Specific Post/Page Access.");return false}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_sp_access_link_via_ajax",ws_plugin__s2member_sp_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_js_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link-via-ajax")); ?>',s2member_sp_access_link_ids:ids,s2member_sp_access_link_hours:hours},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false}}if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){$("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var $this=$(this),val=$this.val();var $rows=$("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var $prevImg=$("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(val<=0){$rows.css("display","none"),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}else{if(val==1){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/unchecked\.png$/,"/checked.png"))}else{if(val==2){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}}}});$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').change(function(){var thisChange=$(this).val(),checkedIndexes=[];$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').each(function(){var $this=$(this),val=$this.val(),checkboxes='input[type="checkbox"]';if(val==="removal-deletion"&&this.checked){$this.nextAll(checkboxes).slice(0,2).attr({checked:"checked",disabled:"disabled"})}else{if(val==="removal-deletion"&&!this.checked){$this.nextAll(checkboxes).slice(0,2).removeAttr("disabled");(thisChange==="removal-deletion")?$this.nextAll(checkboxes).slice(0,2).removeAttr("checked"):null}else{if(val==="modification"&&this.checked){$this.nextAll(checkboxes).slice(0,3).attr({checked:"checked",disabled:"disabled"})}else{if(val==="modification"&&!this.checked){(thisChange==="modification")?$this.nextAll(checkboxes).slice(0,3).removeAttr("checked"):null;$this.nextAll(checkboxes).slice(0,3).removeAttr("disabled")}}}}}).each(function(index){(this.checked)?checkedIndexes.push(index):null});$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").removeAttr("disabled");if($.inArray(3,checkedIndexes)===-1&&$.inArray(4,checkedIndexes)===-1&&$.inArray(5,checkedIndexes)===-1&&$.inArray(6,checkedIndexes)===-1){$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").attr("disabled","disabled")}}).last().trigger("change")}});
includes/menu-pages/menu-pages-s.js CHANGED
@@ -65,9 +65,6 @@ jQuery(document).ready(function($)
65
  });
66
  return false;
67
  });
68
- $('#ws-plugin--s2member-custom-reg-password').on('change', function(){
69
- $('#ws-plugin--s2member-custom-reg-password-settings').css('opacity', $(this).val() === '1' ? '1' : '0.9');
70
- }).trigger('change');
71
  }
72
  if(location.href.match(/page\=ws-plugin--s2member-logs/))
73
  {
65
  });
66
  return false;
67
  });
 
 
 
68
  }
69
  if(location.href.match(/page\=ws-plugin--s2member-logs/))
70
  {
includes/menu-pages/menu-pages.css CHANGED
@@ -43,7 +43,7 @@ body[class*='s2member'] #wpwrap::before
43
  /*
44
  Align these with menu page.
45
  */
46
- div.updated, div.error
47
  {
48
  margin : 25px 25px 25px 5px;
49
  }
@@ -56,35 +56,35 @@ div.ws-menu-page
56
  min-width : 800px;
57
  margin : 25px 25px 25px 5px;
58
  }
59
- div.ws-menu-page p,
60
- div.ws-menu-page code
61
  {
62
  font-size : inherit;
63
  }
64
- div.ws-menu-page a
65
  {
66
  color : #336695;
67
  }
68
- div.ws-menu-page a:hover,
69
- div.ws-menu-page a:active
70
  {
71
  color : #027E02;
72
  }
73
- div.ws-menu-page p:first-child,
74
- div.ws-menu-page pre:first-child
75
  {
76
  margin-top : 0;
77
  }
78
- div.ws-menu-page p:last-child,
79
- div.ws-menu-page pre:last-child
80
  {
81
  margin-bottom : 0;
82
  }
83
- div.ws-menu-page h3 + p
84
  {
85
  margin-top : 0;
86
  }
87
- div.ws-menu-page a.ws-dotted-link
88
  {
89
  text-decoration : none;
90
  border-bottom : 1px dotted;
@@ -135,19 +135,19 @@ div.ws-menu-page > h2:after
135
 
136
  background : url('<?php echo $i; ?>/s2___end.png') no-repeat right bottom;
137
  }
138
- div.ws-menu-page code
139
  {
140
  border-radius : 3px;
141
  padding : 1px 5px 1px 5px;
142
  background : rgba(255, 255, 255, 0.25);
143
  font-family : 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
144
  }
145
- div.ws-menu-page pre.code
146
  {
147
  padding : 0;
148
  background : none;
149
  }
150
- div.ws-menu-page pre.code > code
151
  {
152
  font-size : 90%;
153
  color : #EEEEEE;
@@ -160,8 +160,8 @@ div.ws-menu-page pre.code > code
160
  display : block;
161
  box-shadow : 0 0 5px 1px #000000 inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
162
  }
163
- div.ws-menu-page code.highlight-php,
164
- div.ws-menu-page code.highlight-shortcodes
165
  {
166
  font-size : 90%;
167
  color : #000000;
@@ -176,11 +176,11 @@ div.ws-menu-page code.highlight-shortcodes
176
  display : block;
177
  box-shadow : 0 0 5px 1px rgba(0, 0, 0, 0.38) inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
178
  }
179
- div.ws-menu-page img
180
  {
181
  border : 0;
182
  }
183
- div.ws-menu-page img.ws-menu-page-bordered
184
  {
185
  border-radius : 4px;
186
  padding : 10px;
@@ -188,50 +188,50 @@ div.ws-menu-page img.ws-menu-page-bordered
188
  border : 1px solid #AFAFAF;
189
  box-shadow : 0 0 2px 1px #D8D8D8 inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
190
  }
191
- div.ws-menu-page .ws-menu-page-right
192
  {
193
  margin-left : 25px;
194
  float : right;
195
  }
196
- div.ws-menu-page .ws-menu-page-left
197
  {
198
  margin-right : 25px;
199
  float : left;
200
  }
201
- div.ws-menu-page .ws-menu-page-center
202
  {
203
  margin-left : auto;
204
  margin-right : auto;
205
  display : block;
206
  }
207
- div.ws-menu-page ul.ws-menu-page-li-margins > li,
208
- div.ws-menu-page ol.ws-menu-page-li-margins > li
209
  {
210
  margin-top : 8px;
211
  margin-bottom : 8px;
212
  }
213
- div.ws-menu-page ul.ws-menu-page-li-margins > li:first-child,
214
- div.ws-menu-page ol.ws-menu-page-li-margins > li:first-child
215
  {
216
  margin-top : 0;
217
  }
218
- div.ws-menu-page ul.ws-menu-page-li-margins > li:last-child,
219
- div.ws-menu-page ol.ws-menu-page-li-margins > li:last-child
220
  {
221
  margin-bottom : 0;
222
  }
223
- div.ws-menu-page div.ws-menu-page-hr
224
  {
225
  height : 1px;
226
  line-height : 1px;
227
  background : #DDDDDD;
228
  margin : 10px 0 10px 0;
229
  }
230
- div.ws-menu-page .ws-menu-page-error
231
  {
232
  color : #962722;
233
  }
234
- div.ws-menu-page .ws-menu-page-hilite
235
  {
236
  font-size : 102%;
237
  background : #DFF0DF;
@@ -239,7 +239,7 @@ div.ws-menu-page .ws-menu-page-hilite
239
  border-radius : 3px;
240
  padding : 0 0.2em;
241
  }
242
- div.ws-menu-page .ws-menu-page-bright-hilite
243
  {
244
  font-size : 102%;
245
  background : #EBF084;
@@ -247,7 +247,7 @@ div.ws-menu-page .ws-menu-page-bright-hilite
247
  border-radius : 3px;
248
  padding : 0 0.2em;
249
  }
250
- div.ws-menu-page .ws-menu-page-warning-hilite
251
  {
252
  color : #FFFFFF;
253
  background : #AC3204;
@@ -255,7 +255,7 @@ div.ws-menu-page .ws-menu-page-warning-hilite
255
  border-radius : 3px;
256
  padding : 0 0.2em;
257
  }
258
- div.ws-menu-page .ws-menu-page-error-hilite
259
  {
260
  color : #FFFFFF;
261
  background : #962722;
@@ -263,13 +263,18 @@ div.ws-menu-page .ws-menu-page-error-hilite
263
  border-radius : 3px;
264
  padding : 0 0.2em;
265
  }
266
- div.ws-menu-page img.ws-menu-page-img-16
267
  {
268
  border : 0;
269
  width : 16px;
270
  height : 16px;
271
  }
272
- div.ws-menu-page label
 
 
 
 
 
273
  {
274
  text-shadow : none;
275
 
@@ -277,15 +282,12 @@ div.ws-menu-page label
277
  -moz-user-select : none;
278
  user-select : none;
279
  }
280
- div.ws-menu-page .form-table td
281
- {
282
- font-size : inherit;
283
- line-height : inherit;
284
- }
285
- div.ws-menu-page select, div.ws-menu-page select:focus,
286
- div.ws-menu-page textarea, div.ws-menu-page textarea:focus,
287
- div.ws-menu-page input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
288
- div.ws-menu-page input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
289
  {
290
  margin : 0;
291
  width : 100%;
@@ -297,74 +299,78 @@ div.ws-menu-page input:not([type='image']):not([type='button']):not([type='submi
297
 
298
  box-sizing : border-box;
299
  }
300
- div.ws-menu-page textarea, div.ws-menu-page textarea:focus,
301
- div.ws-menu-page input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
302
- div.ws-menu-page input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
 
303
  {
304
  font-size : 1em; /* Font size again, for CodeMirror too. */
305
  font-family : 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
306
  }
307
- div.ws-menu-page textarea, div.ws-menu-page textarea:focus
 
308
  {
309
  height : auto; /* Textareas auto. */
310
  white-space : pre; /* Preserve whitespace. */
311
  }
312
- div.ws-menu-page select, div.ws-menu-page select:focus,
313
- div.ws-menu-page textarea, div.ws-menu-page textarea:focus,
314
- div.ws-menu-page input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
315
- div.ws-menu-page input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
 
 
316
  {
317
  border : 0;
318
  padding : 5px;
319
  border-radius : 4px;
320
  box-shadow : 0 0 1px 1px rgba(37, 47, 26, 0.75) inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
321
  }
322
- div.ws-menu-page select,
323
- div.ws-menu-page textarea,
324
- div.ws-menu-page input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox'])
325
  {
326
  color : #F7F7F7;
327
  background : #73834B;
328
  }
329
- div.ws-menu-page select:focus,
330
- div.ws-menu-page textarea:focus,
331
- div.ws-menu-page input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
332
  {
333
  background : #637041;
334
  }
335
- div.ws-menu-page input::-webkit-input-placeholder
336
  {
337
  padding-top : .1em;
338
  font-style : italic;
339
  color : rgba(255, 255, 255, 0.2);
340
  }
341
- div.ws-menu-page input::-moz-placeholder
342
  {
343
  padding-top : .1em;
344
  font-style : italic;
345
  color : rgba(255, 255, 255, 0.2);
346
  }
347
- div.ws-menu-page input:-moz-placeholder
348
  {
349
  padding-top : .1em;
350
  font-style : italic;
351
  color : rgba(255, 255, 255, 0.2);
352
  }
353
- div.ws-menu-page input:-ms-input-placeholder
354
  {
355
  padding-top : .1em;
356
  font-style : italic;
357
  color : rgba(255, 255, 255, 0.2);
358
  }
359
- div.ws-menu-page input[disabled],
360
- div.ws-menu-page select[disabled],
361
- div.ws-menu-page textarea[disabled]
362
  {
363
  opacity : 0.5;
364
  }
365
- div.ws-menu-page button,
366
- div.ws-menu-page input[type='button'],
367
- div.ws-menu-page input[type='submit']
368
  {
369
  line-height : 1em;
370
  font-size : 120%;
@@ -386,88 +392,88 @@ div.ws-menu-page input[type='submit']
386
  -moz-user-select : none;
387
  user-select : none;
388
  }
389
- div.ws-menu-page button:hover,
390
- div.ws-menu-page input[type='button']:hover,
391
- div.ws-menu-page input[type='submit']:hover
392
  {
393
  background : #0D1F2F;
394
  }
395
- div.ws-menu-page button:active,
396
- div.ws-menu-page input[type='button']:active,
397
- div.ws-menu-page input[type='submit']:active
398
  {
399
  -webkit-transform : scale(0.98, 0.98);
400
  transform : scale(0.98, 0.98);
401
  }
402
- div.ws-menu-page button[type='submit'],
403
- div.ws-menu-page input[type='submit']
404
  {
405
  font-size : 150%;
406
  font-weight : bold;
407
  background : #5F7523;
408
  }
409
- div.ws-menu-page button[type='submit']:hover,
410
- div.ws-menu-page input[type='submit']:hover
411
  {
412
  background : #4C6324;
413
  }
414
- div.ws-menu-page p.submit button[type='submit'],
415
- div.ws-menu-page p.submit input[type='submit']
416
  {
417
  width : 100%;
418
  }
419
- div.ws-menu-page input[type='file']
420
  {
421
  width : auto !important;
422
  }
423
- div.ws-menu-page .pro-preview
424
  {
425
  opacity : 0.5;
426
  }
427
- div.ws-menu-page .info,
428
- div.ws-menu-page .notice,
429
- div.ws-menu-page .warning,
430
- div.ws-menu-page .error
431
  {
432
  border-radius : 5px;
433
  padding : 10px;
434
  margin : 0 0 25px 0;
435
  }
436
- div.ws-menu-page .info
437
  {
438
  background : #C9E0FA;
439
  border : 1px solid #35558A;
440
  }
441
- div.ws-menu-page .notice
442
  {
443
  background : #FFFBCC;
444
  border : 1px solid #E6DB55;
445
  }
446
- div.ws-menu-page .warning
447
  {
448
  background : #FADDAB;
449
  border : 1px solid #D29A04;
450
  }
451
- div.ws-menu-page .error
452
  {
453
  background : #FABBC6;
454
  border : 1px solid #711E1E;
455
  }
456
- div.ws-menu-page .monospace
457
  {
458
  font-family : 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
459
  }
460
- div.ws-menu-page textarea.monospace
461
  {
462
  white-space : pre;
463
  }
464
- div.ws-menu-page .clearfix:before,
465
- div.ws-menu-page .clearfix:after
466
  {
467
  display : table;
468
  content : ' ';
469
  }
470
- div.ws-menu-page .clearfix:after
471
  {
472
  clear : both;
473
  }
43
  /*
44
  Align these with menu page.
45
  */
46
+ div.updated.fade, div.error.fade
47
  {
48
  margin : 25px 25px 25px 5px;
49
  }
56
  min-width : 800px;
57
  margin : 25px 25px 25px 5px;
58
  }
59
+ div.ws-menu-page > :not(.fade) p,
60
+ div.ws-menu-page > :not(.fade) code
61
  {
62
  font-size : inherit;
63
  }
64
+ div.ws-menu-page > :not(.fade) a
65
  {
66
  color : #336695;
67
  }
68
+ div.ws-menu-page > :not(.fade) a:hover,
69
+ div.ws-menu-page > :not(.fade) a:active
70
  {
71
  color : #027E02;
72
  }
73
+ div.ws-menu-page > :not(.fade) p:first-child,
74
+ div.ws-menu-page > :not(.fade) pre:first-child
75
  {
76
  margin-top : 0;
77
  }
78
+ div.ws-menu-page > :not(.fade) p:last-child,
79
+ div.ws-menu-page > :not(.fade) pre:last-child
80
  {
81
  margin-bottom : 0;
82
  }
83
+ div.ws-menu-page > :not(.fade) h3 + p
84
  {
85
  margin-top : 0;
86
  }
87
+ div.ws-menu-page > :not(.fade) a.ws-dotted-link
88
  {
89
  text-decoration : none;
90
  border-bottom : 1px dotted;
135
 
136
  background : url('<?php echo $i; ?>/s2___end.png') no-repeat right bottom;
137
  }
138
+ div.ws-menu-page > :not(.fade) code
139
  {
140
  border-radius : 3px;
141
  padding : 1px 5px 1px 5px;
142
  background : rgba(255, 255, 255, 0.25);
143
  font-family : 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
144
  }
145
+ div.ws-menu-page > :not(.fade) pre.code
146
  {
147
  padding : 0;
148
  background : none;
149
  }
150
+ div.ws-menu-page > :not(.fade) pre.code > code
151
  {
152
  font-size : 90%;
153
  color : #EEEEEE;
160
  display : block;
161
  box-shadow : 0 0 5px 1px #000000 inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
162
  }
163
+ div.ws-menu-page > :not(.fade) code.highlight-php,
164
+ div.ws-menu-page > :not(.fade) code.highlight-shortcodes
165
  {
166
  font-size : 90%;
167
  color : #000000;
176
  display : block;
177
  box-shadow : 0 0 5px 1px rgba(0, 0, 0, 0.38) inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
178
  }
179
+ div.ws-menu-page > :not(.fade) img
180
  {
181
  border : 0;
182
  }
183
+ div.ws-menu-page > :not(.fade) img.ws-menu-page-bordered
184
  {
185
  border-radius : 4px;
186
  padding : 10px;
188
  border : 1px solid #AFAFAF;
189
  box-shadow : 0 0 2px 1px #D8D8D8 inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
190
  }
191
+ div.ws-menu-page > :not(.fade) .ws-menu-page-right
192
  {
193
  margin-left : 25px;
194
  float : right;
195
  }
196
+ div.ws-menu-page > :not(.fade) .ws-menu-page-left
197
  {
198
  margin-right : 25px;
199
  float : left;
200
  }
201
+ div.ws-menu-page > :not(.fade) .ws-menu-page-center
202
  {
203
  margin-left : auto;
204
  margin-right : auto;
205
  display : block;
206
  }
207
+ div.ws-menu-page > :not(.fade) ul.ws-menu-page-li-margins > li,
208
+ div.ws-menu-page > :not(.fade) ol.ws-menu-page-li-margins > li
209
  {
210
  margin-top : 8px;
211
  margin-bottom : 8px;
212
  }
213
+ div.ws-menu-page > :not(.fade) ul.ws-menu-page-li-margins > li:first-child,
214
+ div.ws-menu-page > :not(.fade) ol.ws-menu-page-li-margins > li:first-child
215
  {
216
  margin-top : 0;
217
  }
218
+ div.ws-menu-page > :not(.fade) ul.ws-menu-page-li-margins > li:last-child,
219
+ div.ws-menu-page > :not(.fade) ol.ws-menu-page-li-margins > li:last-child
220
  {
221
  margin-bottom : 0;
222
  }
223
+ div.ws-menu-page > :not(.fade) div.ws-menu-page-hr
224
  {
225
  height : 1px;
226
  line-height : 1px;
227
  background : #DDDDDD;
228
  margin : 10px 0 10px 0;
229
  }
230
+ div.ws-menu-page > :not(.fade) .ws-menu-page-error
231
  {
232
  color : #962722;
233
  }
234
+ div.ws-menu-page > :not(.fade) .ws-menu-page-hilite
235
  {
236
  font-size : 102%;
237
  background : #DFF0DF;
239
  border-radius : 3px;
240
  padding : 0 0.2em;
241
  }
242
+ div.ws-menu-page > :not(.fade) .ws-menu-page-bright-hilite
243
  {
244
  font-size : 102%;
245
  background : #EBF084;
247
  border-radius : 3px;
248
  padding : 0 0.2em;
249
  }
250
+ div.ws-menu-page > :not(.fade) .ws-menu-page-warning-hilite
251
  {
252
  color : #FFFFFF;
253
  background : #AC3204;
255
  border-radius : 3px;
256
  padding : 0 0.2em;
257
  }
258
+ div.ws-menu-page > :not(.fade) .ws-menu-page-error-hilite
259
  {
260
  color : #FFFFFF;
261
  background : #962722;
263
  border-radius : 3px;
264
  padding : 0 0.2em;
265
  }
266
+ div.ws-menu-page > :not(.fade) img.ws-menu-page-img-16
267
  {
268
  border : 0;
269
  width : 16px;
270
  height : 16px;
271
  }
272
+ div.ws-menu-page > :not(.fade) .form-table td
273
+ {
274
+ font-size : inherit;
275
+ line-height : inherit;
276
+ }
277
+ div.ws-menu-page > :not(.fade) label
278
  {
279
  text-shadow : none;
280
 
282
  -moz-user-select : none;
283
  user-select : none;
284
  }
285
+ div.ws-menu-page > :not(.fade) select,
286
+ div.ws-menu-page > :not(.fade) select:focus,
287
+ div.ws-menu-page > :not(.fade) textarea,
288
+ div.ws-menu-page > :not(.fade) textarea:focus,
289
+ div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
290
+ div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
 
 
 
291
  {
292
  margin : 0;
293
  width : 100%;
299
 
300
  box-sizing : border-box;
301
  }
302
+ div.ws-menu-page > :not(.fade) textarea,
303
+ div.ws-menu-page > :not(.fade) textarea:focus,
304
+ div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
305
+ div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
306
  {
307
  font-size : 1em; /* Font size again, for CodeMirror too. */
308
  font-family : 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
309
  }
310
+ div.ws-menu-page > :not(.fade) textarea,
311
+ div.ws-menu-page > :not(.fade) textarea:focus
312
  {
313
  height : auto; /* Textareas auto. */
314
  white-space : pre; /* Preserve whitespace. */
315
  }
316
+ div.ws-menu-page > :not(.fade) select,
317
+ div.ws-menu-page > :not(.fade) select:focus,
318
+ div.ws-menu-page > :not(.fade) textarea,
319
+ div.ws-menu-page > :not(.fade) textarea:focus,
320
+ div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']),
321
+ div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
322
  {
323
  border : 0;
324
  padding : 5px;
325
  border-radius : 4px;
326
  box-shadow : 0 0 1px 1px rgba(37, 47, 26, 0.75) inset, 0 0 1px 1px rgba(223, 245, 165, 0.5);
327
  }
328
+ div.ws-menu-page > :not(.fade) select,
329
+ div.ws-menu-page > :not(.fade) textarea,
330
+ div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox'])
331
  {
332
  color : #F7F7F7;
333
  background : #73834B;
334
  }
335
+ div.ws-menu-page > :not(.fade) select:focus,
336
+ div.ws-menu-page > :not(.fade) textarea:focus,
337
+ div.ws-menu-page > :not(.fade) input:not([type='image']):not([type='button']):not([type='submit']):not([type='radio']):not([type='checkbox']):focus
338
  {
339
  background : #637041;
340
  }
341
+ div.ws-menu-page > :not(.fade) input::-webkit-input-placeholder
342
  {
343
  padding-top : .1em;
344
  font-style : italic;
345
  color : rgba(255, 255, 255, 0.2);
346
  }
347
+ div.ws-menu-page > :not(.fade) input::-moz-placeholder
348
  {
349
  padding-top : .1em;
350
  font-style : italic;
351
  color : rgba(255, 255, 255, 0.2);
352
  }
353
+ div.ws-menu-page > :not(.fade) input:-moz-placeholder
354
  {
355
  padding-top : .1em;
356
  font-style : italic;
357
  color : rgba(255, 255, 255, 0.2);
358
  }
359
+ div.ws-menu-page > :not(.fade) input:-ms-input-placeholder
360
  {
361
  padding-top : .1em;
362
  font-style : italic;
363
  color : rgba(255, 255, 255, 0.2);
364
  }
365
+ div.ws-menu-page > :not(.fade) input[disabled],
366
+ div.ws-menu-page > :not(.fade) select[disabled],
367
+ div.ws-menu-page > :not(.fade) textarea[disabled]
368
  {
369
  opacity : 0.5;
370
  }
371
+ div.ws-menu-page > :not(.fade) button,
372
+ div.ws-menu-page > :not(.fade) input[type='button'],
373
+ div.ws-menu-page > :not(.fade) input[type='submit']
374
  {
375
  line-height : 1em;
376
  font-size : 120%;
392
  -moz-user-select : none;
393
  user-select : none;
394
  }
395
+ div.ws-menu-page > :not(.fade) button:hover,
396
+ div.ws-menu-page > :not(.fade) input[type='button']:hover,
397
+ div.ws-menu-page > :not(.fade) input[type='submit']:hover
398
  {
399
  background : #0D1F2F;
400
  }
401
+ div.ws-menu-page > :not(.fade) button:active,
402
+ div.ws-menu-page > :not(.fade) input[type='button']:active,
403
+ div.ws-menu-page > :not(.fade) input[type='submit']:active
404
  {
405
  -webkit-transform : scale(0.98, 0.98);
406
  transform : scale(0.98, 0.98);
407
  }
408
+ div.ws-menu-page > :not(.fade) button[type='submit'],
409
+ div.ws-menu-page > :not(.fade) input[type='submit']
410
  {
411
  font-size : 150%;
412
  font-weight : bold;
413
  background : #5F7523;
414
  }
415
+ div.ws-menu-page > :not(.fade) button[type='submit']:hover,
416
+ div.ws-menu-page > :not(.fade) input[type='submit']:hover
417
  {
418
  background : #4C6324;
419
  }
420
+ div.ws-menu-page > :not(.fade) p.submit button[type='submit'],
421
+ div.ws-menu-page > :not(.fade) p.submit input[type='submit']
422
  {
423
  width : 100%;
424
  }
425
+ div.ws-menu-page > :not(.fade) input[type='file']
426
  {
427
  width : auto !important;
428
  }
429
+ div.ws-menu-page > :not(.fade) .pro-preview
430
  {
431
  opacity : 0.5;
432
  }
433
+ div.ws-menu-page > :not(.fade) .info,
434
+ div.ws-menu-page > :not(.fade) .notice,
435
+ div.ws-menu-page > :not(.fade) .warning,
436
+ div.ws-menu-page > :not(.fade) .error:not(.fade)
437
  {
438
  border-radius : 5px;
439
  padding : 10px;
440
  margin : 0 0 25px 0;
441
  }
442
+ div.ws-menu-page > :not(.fade) .info
443
  {
444
  background : #C9E0FA;
445
  border : 1px solid #35558A;
446
  }
447
+ div.ws-menu-page > :not(.fade) .notice
448
  {
449
  background : #FFFBCC;
450
  border : 1px solid #E6DB55;
451
  }
452
+ div.ws-menu-page > :not(.fade) .warning
453
  {
454
  background : #FADDAB;
455
  border : 1px solid #D29A04;
456
  }
457
+ div.ws-menu-page > :not(.fade) .error:not(.fade)
458
  {
459
  background : #FABBC6;
460
  border : 1px solid #711E1E;
461
  }
462
+ div.ws-menu-page > :not(.fade) .monospace
463
  {
464
  font-family : 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
465
  }
466
+ div.ws-menu-page > :not(.fade) textarea.monospace
467
  {
468
  white-space : pre;
469
  }
470
+ div.ws-menu-page > :not(.fade) .clearfix:before,
471
+ div.ws-menu-page > :not(.fade) .clearfix:after
472
  {
473
  display : table;
474
  content : ' ';
475
  }
476
+ div.ws-menu-page > :not(.fade) .clearfix:after
477
  {
478
  clear : both;
479
  }
includes/syscon.inc.php CHANGED
@@ -212,7 +212,7 @@ if(!function_exists('ws_plugin__s2member_configure_options_and_their_defaults'))
212
  $default_options['new_user_emails_enabled'] = '0';
213
 
214
  $default_options['new_user_email_subject'] = sprintf(_x('[%s] Username/Password', 's2member-front', 's2member'), get_bloginfo('name'));
215
- $default_options['new_user_email_message'] = sprintf(_x("Your Username/Password for:\n%s\n\nUsername: %%%%user_login%%%%\nPassword: %%%%user_pass%%%%\n%%%%wp_login_url%%%%", 's2member-front', 's2member'), get_bloginfo('name'));
216
 
217
  $default_options['new_user_admin_email_recipients'] = get_bloginfo('admin_email');
218
  $default_options['new_user_admin_email_subject'] = sprintf(_x('[%s] New User Registration', 's2member-front', 's2member'), get_bloginfo('name'));
212
  $default_options['new_user_emails_enabled'] = '0';
213
 
214
  $default_options['new_user_email_subject'] = sprintf(_x('[%s] Username/Password', 's2member-front', 's2member'), get_bloginfo('name'));
215
+ $default_options['new_user_email_message'] = sprintf(_x("Your Username/Password for:\n%s\n\nUsername: %%%%user_login%%%%\nTo set your password, visit: %%%%wp_set_pass_url%%%%\n\n%%%%wp_login_url%%%%", 's2member-front', 's2member'), get_bloginfo('name'));
216
 
217
  $default_options['new_user_admin_email_recipients'] = get_bloginfo('admin_email');
218
  $default_options['new_user_admin_email_subject'] = sprintf(_x('[%s] New User Registration', 's2member-front', 's2member'), get_bloginfo('name'));
includes/translations/s2member.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: 150722\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/s2member\n"
7
- "POT-Creation-Date: 2015-07-22 22:47:02+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -285,11 +285,24 @@ msgctxt "s2member-front"
285
  msgid "Must be at least %s %s."
286
  msgstr ""
287
 
288
- #: s2member/includes/classes/email-configs.inc.php:150
289
  msgctxt "s2member-front"
290
  msgid "as a Member"
291
  msgstr ""
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  #: s2member/includes/classes/files-in.inc.php:112
294
  #: s2member/includes/classes/files-in.inc.php:265
295
  msgctxt "s2member-front"
@@ -970,7 +983,7 @@ msgctxt "s2member-front"
970
  msgid "<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance."
971
  msgstr ""
972
 
973
- #: s2member/includes/classes/registrations.inc.php:579
974
  msgctxt "s2member-front"
975
  msgid "s2Member security violation. You attempted to POST administrative variables that will NOT be trusted in a NON-administrative zone!"
976
  msgstr ""
@@ -1598,17 +1611,6 @@ msgctxt "s2member-front"
1598
  msgid "[%s] Username/Password"
1599
  msgstr ""
1600
 
1601
- #: s2member/includes/syscon.inc.php:215
1602
- msgctxt "s2member-front"
1603
- msgid ""
1604
- "Your Username/Password for:\n"
1605
- "%s\n"
1606
- "\n"
1607
- "Username: %%%%user_login%%%%\n"
1608
- "Password: %%%%user_pass%%%%\n"
1609
- "%%%%wp_login_url%%%%"
1610
- msgstr ""
1611
-
1612
  #: s2member/includes/syscon.inc.php:218
1613
  msgctxt "s2member-front"
1614
  msgid "[%s] New User Registration"
@@ -2802,78 +2804,78 @@ msgid "You're <strong>NOT</strong> logged in."
2802
  msgstr ""
2803
 
2804
  #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:289
2805
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:633
2806
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:342
2807
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:667
2808
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:410
2809
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:750
2810
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:477
2811
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:916
2812
  msgctxt "s2member-front"
2813
  msgid "<strong>Thank you.</strong> Your account has been updated."
2814
  msgstr ""
2815
 
2816
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:493
2817
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:750
2818
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:502
2819
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:820
2820
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:587
2821
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:901
2822
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:745
2823
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1070
2824
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:407
2825
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:602
2826
  msgctxt "s2member-front"
2827
  msgid "<strong>Thank you.</strong> Your account has been approved.<br />&mdash; Please <a href=\"%s\" rel=\"nofollow\">log in</a>."
2828
  msgstr ""
2829
 
2830
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:504
2831
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:530
2832
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:759
2833
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:780
2834
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-registration-in.inc.php:123
2835
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-registration-in.inc.php:140
2836
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:511
2837
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:532
2838
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:829
2839
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:850
2840
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:596
2841
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:617
2842
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:910
2843
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:931
2844
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:754
2845
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:775
2846
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1079
2847
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1100
2848
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-registration-in.inc.php:123
2849
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-registration-in.inc.php:140
2850
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:419
2851
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:614
2852
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-registration-in.inc.php:125
2853
  msgctxt "s2member-front"
2854
  msgid "<strong>Oops.</strong> A slight problem. Please contact Support for assistance."
2855
  msgstr ""
2856
 
2857
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:519
2858
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:771
2859
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:523
2860
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:841
2861
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:608
2862
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:922
2863
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:766
2864
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1091
2865
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:408
2866
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:603
2867
  msgctxt "s2member-front"
2868
  msgid "<strong>Thank you.</strong> Your account has been approved.<br />&mdash; You'll receive an email momentarily."
2869
  msgstr ""
2870
 
2871
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:791
2872
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:861
2873
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:942
2874
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1111
2875
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-update-pf-in.inc.php:135
2876
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:618
2877
  msgctxt "s2member-front"
2878
  msgid "<strong>Unknown error.</strong> Please contact Support for assistance."
2879
  msgstr ""
@@ -3067,16 +3069,16 @@ msgctxt "s2member-front"
3067
  msgid "12 December"
3068
  msgstr ""
3069
 
3070
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-registration-in.inc.php:116
3071
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-registration-in.inc.php:116
3072
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-registration-in.inc.php:117
3073
  msgctxt "s2member-front"
3074
  msgid "<strong>Thank you.</strong> Please <a href=\"%s\" rel=\"nofollow\">log in</a>."
3075
  msgstr ""
3076
 
3077
- #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-registration-in.inc.php:133
3078
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-registration-in.inc.php:133
3079
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-registration-in.inc.php:118
3080
  msgctxt "s2member-front"
3081
  msgid "<strong>Thank you.</strong> You'll receive an email momentarily."
3082
  msgstr ""
@@ -3985,9 +3987,9 @@ msgid "Please <a href=\"%s\" rel=\"nofollow\">log in at PayPal</a> to cancel you
3985
  msgstr ""
3986
 
3987
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:354
3988
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:679
3989
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:494
3990
- #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:928
3991
  msgctxt "s2member-front"
3992
  msgid "<strong>Sorry.</strong> Your account is pending other changes. Please try again in 15 minutes."
3993
  msgstr ""
@@ -4135,7 +4137,7 @@ msgid "API failure. Please contact Support for assistance."
4135
  msgstr ""
4136
 
4137
  #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:248
4138
- #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:495
4139
  msgctxt "s2member-front"
4140
  msgid "<strong>Thank you.</strong> Your account has been updated :-)"
4141
  msgstr ""
@@ -4471,7 +4473,7 @@ msgid ""
4471
  "Charges today: %%%%currency_symbol%%%%%%%%initial%%%%\n"
4472
  "Recurring charges: %%%%currency_symbol%%%%%%%%recurring/regular_cycle%%%%\n"
4473
  "\n"
4474
- "Your Username/Password will arrive shortly, in a separate email. If you have any trouble, please feel free to contact us.\n"
4475
  "\n"
4476
  "Best Regards,\n"
4477
  "%s"
@@ -4489,7 +4491,7 @@ msgid ""
4489
  "\n"
4490
  "Your order can be retrieved here:\n"
4491
  "%%%%sp_access_url%%%%\n"
4492
- "( link expires in %%%%sp_access_exp%%%% )\n"
4493
  "\n"
4494
  "If you have any trouble, please feel free to contact us.\n"
4495
  "\n"
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: 150827\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/s2member\n"
7
+ "POT-Creation-Date: 2015-08-27 11:48:33+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
285
  msgid "Must be at least %s %s."
286
  msgstr ""
287
 
288
+ #: s2member/includes/classes/email-configs.inc.php:148
289
  msgctxt "s2member-front"
290
  msgid "as a Member"
291
  msgstr ""
292
 
293
+ #: s2member/includes/classes/email-configs.inc.php:251
294
+ #: s2member/includes/syscon.inc.php:215
295
+ msgctxt "s2member-front"
296
+ msgid ""
297
+ "Your Username/Password for:\n"
298
+ "%s\n"
299
+ "\n"
300
+ "Username: %%%%user_login%%%%\n"
301
+ "To set your password, visit: %%%%wp_set_pass_url%%%%\n"
302
+ "\n"
303
+ "%%%%wp_login_url%%%%"
304
+ msgstr ""
305
+
306
  #: s2member/includes/classes/files-in.inc.php:112
307
  #: s2member/includes/classes/files-in.inc.php:265
308
  msgctxt "s2member-front"
983
  msgid "<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance."
984
  msgstr ""
985
 
986
+ #: s2member/includes/classes/registrations.inc.php:615
987
  msgctxt "s2member-front"
988
  msgid "s2Member security violation. You attempted to POST administrative variables that will NOT be trusted in a NON-administrative zone!"
989
  msgstr ""
1611
  msgid "[%s] Username/Password"
1612
  msgstr ""
1613
 
 
 
 
 
 
 
 
 
 
 
 
1614
  #: s2member/includes/syscon.inc.php:218
1615
  msgctxt "s2member-front"
1616
  msgid "[%s] New User Registration"
2804
  msgstr ""
2805
 
2806
  #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:289
2807
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:638
2808
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:342
2809
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:672
2810
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:410
2811
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:755
2812
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:477
2813
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:921
2814
  msgctxt "s2member-front"
2815
  msgid "<strong>Thank you.</strong> Your account has been updated."
2816
  msgstr ""
2817
 
2818
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:495
2819
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:757
2820
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:504
2821
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:827
2822
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:589
2823
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:908
2824
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:747
2825
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1077
2826
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:410
2827
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:608
2828
  msgctxt "s2member-front"
2829
  msgid "<strong>Thank you.</strong> Your account has been approved.<br />&mdash; Please <a href=\"%s\" rel=\"nofollow\">log in</a>."
2830
  msgstr ""
2831
 
2832
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:506
2833
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:535
2834
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:766
2835
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:790
2836
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-registration-in.inc.php:126
2837
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-registration-in.inc.php:146
2838
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:513
2839
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:537
2840
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:836
2841
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:860
2842
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:598
2843
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:622
2844
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:917
2845
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:941
2846
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:756
2847
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:780
2848
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1086
2849
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1110
2850
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-registration-in.inc.php:126
2851
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-registration-in.inc.php:146
2852
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:422
2853
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:620
2854
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-registration-in.inc.php:128
2855
  msgctxt "s2member-front"
2856
  msgid "<strong>Oops.</strong> A slight problem. Please contact Support for assistance."
2857
  msgstr ""
2858
 
2859
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:524
2860
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:781
2861
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:528
2862
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:851
2863
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:613
2864
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:932
2865
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:771
2866
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1101
2867
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:411
2868
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:609
2869
  msgctxt "s2member-front"
2870
  msgid "<strong>Thank you.</strong> Your account has been approved.<br />&mdash; You'll receive an email momentarily."
2871
  msgstr ""
2872
 
2873
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-checkout-in.inc.php:801
2874
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:871
2875
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-pf-in.inc.php:952
2876
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:1121
2877
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-update-pf-in.inc.php:135
2878
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:624
2879
  msgctxt "s2member-front"
2880
  msgid "<strong>Unknown error.</strong> Please contact Support for assistance."
2881
  msgstr ""
3069
  msgid "12 December"
3070
  msgstr ""
3071
 
3072
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-registration-in.inc.php:119
3073
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-registration-in.inc.php:119
3074
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-registration-in.inc.php:120
3075
  msgctxt "s2member-front"
3076
  msgid "<strong>Thank you.</strong> Please <a href=\"%s\" rel=\"nofollow\">log in</a>."
3077
  msgstr ""
3078
 
3079
+ #: s2member-pro/s2member-pro/includes/classes/gateways/authnet/authnet-registration-in.inc.php:139
3080
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-registration-in.inc.php:139
3081
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-registration-in.inc.php:121
3082
  msgctxt "s2member-front"
3083
  msgid "<strong>Thank you.</strong> You'll receive an email momentarily."
3084
  msgstr ""
3987
  msgstr ""
3988
 
3989
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:354
3990
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-in.inc.php:684
3991
  #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:494
3992
+ #: s2member-pro/s2member-pro/includes/classes/gateways/paypal/paypal-checkout-rdp-in.inc.php:933
3993
  msgctxt "s2member-front"
3994
  msgid "<strong>Sorry.</strong> Your account is pending other changes. Please try again in 15 minutes."
3995
  msgstr ""
4137
  msgstr ""
4138
 
4139
  #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:248
4140
+ #: s2member-pro/s2member-pro/includes/classes/gateways/stripe/stripe-checkout-in.inc.php:498
4141
  msgctxt "s2member-front"
4142
  msgid "<strong>Thank you.</strong> Your account has been updated :-)"
4143
  msgstr ""
4473
  "Charges today: %%%%currency_symbol%%%%%%%%initial%%%%\n"
4474
  "Recurring charges: %%%%currency_symbol%%%%%%%%recurring/regular_cycle%%%%\n"
4475
  "\n"
4476
+ "If you have any trouble, please feel free to contact us.\n"
4477
  "\n"
4478
  "Best Regards,\n"
4479
  "%s"
4491
  "\n"
4492
  "Your order can be retrieved here:\n"
4493
  "%%%%sp_access_url%%%%\n"
4494
+ "(link expires in %%%%sp_access_exp%%%%)\n"
4495
  "\n"
4496
  "If you have any trouble, please feel free to contact us.\n"
4497
  "\n"
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) ===
2
 
3
- Version: 150722
4
- Stable tag: 150722
5
 
6
  SSL Compatible: yes
7
  bbPress® Compatible: yes
@@ -17,7 +17,7 @@ Authorize.Net® Compatible: yes w/s2Member® Pro
17
  Google® Checkout Compatible: yes w/s2Member® Pro
18
  ClickBank® Compatible: yes w/s2Member® Pro
19
 
20
- Tested up to: 4.3-alpha
21
  Requires at least: 4.2
22
 
23
  Requires PHP: 5.2+
@@ -169,12 +169,35 @@ Released under the terms of the [GNU General Public License](http://www.gnu.org/
169
 
170
  == Upgrade Notice ==
171
 
172
- = v150722 =
173
 
174
  (Maintenance Release) Upgrade immediately.
175
 
176
  == Changelog ==
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  = v150722 =
179
 
180
  - (s2Member/s2Member Pro) **New Shortcode:** This release introduces a powerful new shortcode which allows you to display a user's EOT (End of Term) or NPT (next payment time) in a WordPress Post or Page. For further details and some minor limitations, please see [`[s2Eot /]` Shortcode Documentation](http://s2member.com/kb-article/s2eot-shortcode-documentation/). Props to @raamdev and @patdumond for their strategic assistance, feedback, and ideas for this shortcode.
1
  === s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) ===
2
 
3
+ Version: 150827
4
+ Stable tag: 150827
5
 
6
  SSL Compatible: yes
7
  bbPress® Compatible: yes
17
  Google® Checkout Compatible: yes w/s2Member® Pro
18
  ClickBank® Compatible: yes w/s2Member® Pro
19
 
20
+ Tested up to: 4.4-alpha
21
  Requires at least: 4.2
22
 
23
  Requires PHP: 5.2+
169
 
170
  == Upgrade Notice ==
171
 
172
+ = v150827 =
173
 
174
  (Maintenance Release) Upgrade immediately.
175
 
176
  == Changelog ==
177
 
178
+ = v150827 =
179
+
180
+ - (s2Member/s2Member Pro) **WordPress v4.3 Compat./Bug Fix** This release of s2Member alters the way New User Notification Emails are sent, and in how they should be formatted in WordPress v4.3+.
181
+
182
+ The New User Notification Email is now sent (to a user) only if they did _not_ set a Custom Password during their registration; i.e., only if they need this email to set their password for the first time. In short, s2Member now follows the same approach used by WordPress v4.3+.
183
+
184
+ See: **Dashboard → s2Member → General Options → Email Configuration → New User Notification**
185
+
186
+ So the purpose of this particular email has changed just a bit; i.e., the New User Notification Email. Instead of it being sent to every new user, it is only sent to users who need it for the purpose of obtaining a password which grants them access to their account for the first time.
187
+
188
+ **Upgrading to WordPress v4.3 and the latest release of s2Member?**
189
+
190
+ Please review this section of your Dashboard carefully:
191
+ **s2Member → General Options → Email Configuration → New User Notification**
192
+
193
+ - If you are using s2Member to customize the New User Notification email, you should try to update this message so that it includes the new `%%wp_set_pass_url%%` Replacement Code.
194
+
195
+ See also: [this comment at GitHub about the recent changes, with screenshots](https://github.com/websharks/s2member/issues/689#issuecomment-134563230).
196
+
197
+ - (s2Member Pro) **`[s2Member-List /]` Bug Fix:** This release corrects a bug in the `[s2Member-List /]` shortcode that was causing `levels="0"` not to work, and in fact any use of a `0` in the `levels=""` attribute was broken. See [this GitHub issue](https://github.com/websharks/s2member/issues/663) if you'd like additional details. Props to @patdumond for reproducing, reporting and testing this issue.
198
+
199
+ - (s2Member/s2Member Pro) **Emoji Bug Fix:** This release corrects a bug in s2Member's SSL filters that can be applied with the Post/Page Custom Field `s2member_force_ssl` being set to `yes`. A symptom of this bug was to see an SSL warning in the latest release of WordPress related to the new Emoji library. See [this GitHub issue](https://github.com/websharks/s2member/issues/674) if you'd like additional details.
200
+
201
  = v150722 =
202
 
203
  - (s2Member/s2Member Pro) **New Shortcode:** This release introduces a powerful new shortcode which allows you to display a user's EOT (End of Term) or NPT (next payment time) in a WordPress Post or Page. For further details and some minor limitations, please see [`[s2Eot /]` Shortcode Documentation](http://s2member.com/kb-article/s2eot-shortcode-documentation/). Props to @raamdev and @patdumond for their strategic assistance, feedback, and ideas for this shortcode.
s2member.php CHANGED
@@ -19,8 +19,8 @@
19
  */
20
  /* -- This section for WordPress parsing. ------------------------------------------------------------------------------
21
 
22
- Version: 150722
23
- Stable tag: 150722
24
 
25
  SSL Compatible: yes
26
  bbPress Compatible: yes
@@ -35,7 +35,7 @@ Authorize.Net Compatible: yes w/s2Member Pro
35
  Google Wallet Compatible: yes w/s2Member Pro
36
  ClickBank Compatible: yes w/s2Member Pro
37
 
38
- Tested up to: 4.3-alpha
39
  Requires at least: 4.2
40
 
41
  Copyright: © 2009 WebSharks, Inc.
@@ -76,7 +76,7 @@ if(!defined('WPINC')) // MUST have WordPress.
76
  * @var string
77
  */
78
  if(!defined('WS_PLUGIN__S2MEMBER_VERSION'))
79
- define('WS_PLUGIN__S2MEMBER_VERSION', '150722' /* !#distro-version#! */);
80
  /**
81
  * Minimum PHP version required to run s2Member.
82
  *
@@ -106,7 +106,7 @@ if(!defined('WS_PLUGIN__S2MEMBER_MIN_WP_VERSION'))
106
  * @var string
107
  */
108
  if(!defined('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION'))
109
- define('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION', '150722' /* !#distro-version#! */);
110
  /*
111
  Several compatibility checks.
112
  If all pass, load the s2Member plugin.
19
  */
20
  /* -- This section for WordPress parsing. ------------------------------------------------------------------------------
21
 
22
+ Version: 150827
23
+ Stable tag: 150827
24
 
25
  SSL Compatible: yes
26
  bbPress Compatible: yes
35
  Google Wallet Compatible: yes w/s2Member Pro
36
  ClickBank Compatible: yes w/s2Member Pro
37
 
38
+ Tested up to: 4.4-alpha
39
  Requires at least: 4.2
40
 
41
  Copyright: © 2009 WebSharks, Inc.
76
  * @var string
77
  */
78
  if(!defined('WS_PLUGIN__S2MEMBER_VERSION'))
79
+ define('WS_PLUGIN__S2MEMBER_VERSION', '150827' /* !#distro-version#! */);
80
  /**
81
  * Minimum PHP version required to run s2Member.
82
  *
106
  * @var string
107
  */
108
  if(!defined('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION'))
109
+ define('WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION', '150827' /* !#distro-version#! */);
110
  /*
111
  Several compatibility checks.
112
  If all pass, load the s2Member plugin.