Version Description
- New Feature. s2Member now provides a small panel ( aka:
meta box
) inside your Post/Page editing stations. This new panel makes it possible for you to restrict access to a Post/Page, or even a Custom Post Type ( on-the-fly ) without having to go back to your General Options panel all the time. Starting with s2Member v3.2+, you can also tell s2Member to require Custom Capabilities on a per Post/Page basis. So now, s2Member ( if you prefer ) can handle Custom Capabilities for you! Whenever you edit a Post/Page, you can tell s2Member to require certain Custom Capabilities that you type in, using comma delimited format. In other words, you will need to type in some of the trigger words that you used whenever you created your PayPal Pro Forms and/or Standard PayPal Buttons. This way your Members will have the proper Capabilities to view different kinds of content that you offer. All of this is optional. - Compatibility. s2Member, and also the s2Member Pro Module; have both been tested under WordPress 3.0.1. Everything looks good - no conflicts.
- Multisite Networking. s2Member, and also the s2Member Pro Module; are now compatible with WordPress 3.0+ Multisite Networking, formerly known as WPMU. In addition, preliminary ( experimental ) support for Multisite Blog Farms has also been implemented. If you\'re running a Multisite Blog Farm ( i.e. you offer Blogs ), please contact s2Member.com for further details.
- A new panel is made available under
s2Member -> Multisite ( Config )
, whenever Multisite Networking is enabled. This is where a Super Administrator ( operating on the Main Site ) can decide to offer Membership only, or Membership with Blog creation as well. In other words, your site could ALSO offer a Customer access to create a Blog of their own, where a Customer becomes a "Member" of your ( Main Site ), and also a Blog Owner/Administrator. With s2Member installed ( network wide ), each of your Customers could offer Membership too, using a single installation of the s2Member plugin ( which is a great selling point! ). We refer to this as a Multisite Blog Farm. - Bug fix. The s2Member Framework has been updated to fully support installations of WordPress that have two different URLs configured in their
WP Settings -> General
section. This bug was related tobloginfo("url")
vs.bloginfo("wpurl")
. In previous versions of s2Member, a major symptom of this bug was an unexpected redirection to the Home Page after checkout, instead of a formal response to the Customer. This bug was only affecting installations of WordPress that were using a different Site Address URL, inside theirSettings -> General
panel. This has been resolved in s2Member v3.2+. - Bug fix. An issue related to protected File Downloads, where a site owner was using sub-directories to guard specific files from specific Levels, was sometimes resulting in an invalid redirection to the Membership Options Page, with a query string indicating
21
, ( i.e.s2member_level_req=21
). This bug has been corrected in s2Member v3.2+. - Videos. Over six hours of detailed Video Tutorials are now available for s2Member. Additional videos will be released over the coming days and weeks ahead; covering more advanced topics, marketing tips, and an in-depth look at the s2Member Pro Module, plus Multisite Networking; which is also evolving rapidly.
- API Behavior. s2Member's API Notification for EOT/Deletions, has been changed slightly. In previous versions, the EOT/Deletion notification was only processed for a ( paid ) Member, who reached the end of their term, OR ... if a ( paid ) Member was manually deleted by an Administrator through the Dashboard. Starting with s2Member v3.2+, an EOT/Deletion Notification will be processed, EVEN if the account is NOT currently associated with a ( paid ) Member. In other words, starting with s2Member v3.2, if you delete an account manually ( through your WP Dashboard ) this will ALWAYS trigger s2Member's EOT/Deletion Notification; no matter what. For further details, check your Dashboard:
s2Member -> API Notifications -> EOT/Deletion
. - Bug fix. Login message filter (
login_messages
) applied to registrations with a custom password entered during the registration process.Registration complete. Please log in.
This Hook/Filter was renamed to just (login_message
) with the release of WordPress 3.0.1. Very minor issue, but this has been corrected with s2Member v3.2+ - in support of WordPress 3.0.1+. - Feature. Custom Registration Fields for s2Member, now support an Un-editable Mode ( in other words, if you want specific fields to be un-editable after registration ), you can wrap those Custom Fields inside ^carets^. In your WP Dashboard, see:
s2Member -> General Options -> Custom Fields
for additional documentation and examples. - Profile Editing Panel. The Stand-Alone Profile Modification Page ( provided by s2Member ); now includes a password confirmation field ( in other words, a NEW password must be typed in twice as a confirmation ).
- BuddyPress/MailChimp. The first/last name fields were NOT being populated into the MailChimp integration with BuddyPress installed. This has been resolved with s2Member v3.2+.
- Logging routines. s2Member's logging routines have been updated to support Multisite Networking. When Multisite Networking is enabled, s2Member will keep separate log files for each domain/path.
- Validation. The JavaScript validation routine for the
wp-login.php
file, now includes the Username/Email Address to help Customers avoid confusion. - Feature. Integration of Custom Fields into the
Users -> Add New
panel. An account can now be created manually, with all details included initially. As opposed to the old way, where you had to go back and Edit the account manually, after the initial creation. - Feature. s2Member now exposes its
s2member_custom
field inside the admin panel. You can go to yourDashboard -> Users
panel, and click Edit next to a Member. The Custom String is now editable. You're NOT likely to need this, but s2Member makes it editable anyway. Possibly for advanced usage by a developer. - Feature. Integration of Custom Fields into
/wp-signup.php
has been completed. This is only for Multisite Networking; where s2Member is being used in a Blog Farm environment. - PayPal. In the admin panel, a few subtle references to "PayPal" have been changed to just "Paid"; leaving room for additional gateway integration possibilities that are coming soon.
- Feature. In the admin panel, there is now a shortcut link inside the s2Member menu panel; which leads a Site Administrator to
Add A Member
using manual entry. - Compatibility. On a Multisite Network; s2Member is NOT compatible with configurations that use a different Dashboard Blog; other than the Main Site. This is NOT a good idea to try this with s2Member; it opens the door for all sorts of issues. s2Member now forces your Dashboard Blog to the Main Site for sanity/compatibility/security.
- Compatibility. Added support for this Conditional Tag
current_user_can_for_blog( $blog_id, $capability )
in support of Multisite Networking integration. As well as$user->for_blog( $blog_id )
. - Compatibility. Updated function calls with
usermeta
touser_option
; includingget_user_option()
,update_user_option()
,delete_user_option()
. Theusermeta
functions were deprecated as of WP 3.0. The newget_user_option()
function is also Multisite compatible. If you're a developer, you can take a look at s2Member's source code for examples. Or read this article. - Important Database Change. In previous versions of s2Member, data about each Member was stored inside the
wp_usermeta
table automatically; and it STILL is. However, themeta_key
names are now prefixed with$wpdb->prefix
, which on most installations of WordPress this translates towp_
( e.g.wp_s2member_subscr_id
,wp_s2member_custom
, etc, etc. ). s2Member will automatically update your database tables upon re-activation. However, if you're a developer, and you've been usingget_usermeta($user_id, "s2member_subscr_id")
, you should now useget_user_option("s2member_subscr_id", $user_id)
instead. No need to specify thewp_
prefix in that function, it's handled internally by WordPress through theget_user_option()
call. For more information, please read this article. - Bug fix. s2Member's PayPal IPN processor was logging
Skipping Auto-EOT for now ...
, with Refund/reversal IPNs; when a particular Member already had an EOT-Time set. This was NOT the intended behavior in this scenario. In this release, s2Member has been updated to ignore existing Auto-EOT Times under this one special circumstance ( Refund/Reversal ). A Refund/Reversal will ALWAYS trigger an immediate EOT now. - IPN Proxy Keys. s2Member's implementation of the optional Proxy Key for simulated IPN responses, has been updated to support Multisite Networking; through a new PayPal utility function
ws_plugin__s2member_paypal_proxy_key_gen ()
. For further details, check your Dashboard unders2Member -> PayPal Options -> IPN Integration -> Proxy Key
. - UI Improvement. The tabindex property for [?] icons in the admin panel have been set to
tabindex="-1"
to prevent an annoyance. - Compatibility. On a Windows server, the cURL extension is usually NOT compatible with SSL communications. s2Member now signals to the WP_Http class, that it should temporarily disable the cURL transport when a remote URL is being processed with an
https://
prefix. This allows the WP_Http class to recover gracefully (automatically) and fall back on the FOPEN method. If you're running WordPress on a Windows server, you should make sure that you have this inside your php.ini file. ( `allow_url_fopen
Download this release
Release Info
Developer | PriMoThemes |
Plugin | s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) |
Version | 3.2 |
Comparing to | |
See all releases |
Code changes from version 3.1.5 to 3.2
- images/brand-favicon.fla +0 -0
- images/brand-favicon.png +0 -0
- images/large-icon.fla +0 -0
- images/large-icon.png +0 -0
- includes/dropins/bridges/_s2member-bbpress-bridge.php +8 -8
- includes/functions/activate-deactivate.inc.php +61 -28
- includes/functions/auto-eots.inc.php +36 -21
- includes/functions/constants.inc.php +82 -125
- includes/functions/css-js-w-globals.inc.php +19 -21
- includes/functions/email-configs.inc.php +1 -1
- includes/functions/file-download-access.inc.php +34 -38
- includes/functions/force-ssl.inc.php +1 -1
- includes/functions/hide-some-systematics.inc.php +3 -3
- includes/functions/is-systematic.inc.php +2 -2
- includes/functions/list-servers.inc.php +1 -1
- includes/functions/login-customizations.inc.php +5 -4
- includes/functions/login-redirection.inc.php +12 -1
- includes/functions/menu-pages.inc.php +136 -32
- includes/functions/meta-boxes.inc.php +233 -0
- includes/functions/ms-meta-caps.inc.php +60 -0
- includes/functions/nocache.inc.php +3 -3
- includes/functions/page-level-access.inc.php +8 -0
- includes/functions/paypal-button.inc.php +4 -4
- includes/functions/paypal-notify.inc.php +136 -110
- includes/functions/paypal-return.inc.php +55 -27
- includes/functions/paypal-utilities.inc.php +46 -30
- includes/functions/post-level-access.inc.php +9 -1
- includes/functions/profile-modifications.inc.php +30 -14
- includes/functions/readme-parsing.inc.php +90 -28
- includes/functions/register-access.inc.php +930 -113
- includes/functions/sp-access.inc.php +2 -2
- includes/functions/tracking-codes.inc.php +4 -4
- includes/functions/translations.inc.php +38 -3
- includes/functions/user-access-level.inc.php +1 -1
- includes/functions/user-deletions.inc.php +76 -18
- includes/functions/user-has-wp-role.inc.php +0 -44
- includes/functions/user-notes.inc.php +4 -4
- includes/functions/users-list.inc.php +342 -144
- includes/functions/utilities.inc.php +38 -3
- includes/hooks.inc.php +23 -2
- includes/menu-pages/api-ops.inc.php +92 -56
- includes/menu-pages/bridges.inc.php +2 -2
- includes/menu-pages/code-samples/mms-patch-load.php +4 -0
- includes/menu-pages/code-samples/mms-patch-user-new.php +3 -0
- includes/menu-pages/code-samples/mms-patch-wp-login.php +7 -0
- includes/menu-pages/down-ops.inc.php +3 -3
- includes/menu-pages/els-ops.inc.php +3 -3
- includes/menu-pages/info.inc.php +1 -1
- includes/menu-pages/menu-pages-s-min.js +1 -1
- includes/menu-pages/menu-pages-s.js +26 -2
- includes/menu-pages/mms-options.inc.php +353 -0
- includes/menu-pages/options.inc.php +208 -180
- includes/menu-pages/paypal-buttons.inc.php +64 -36
- includes/menu-pages/paypal-ops.inc.php +54 -38
- includes/menu-pages/scripting.inc.php +6 -7
- includes/menu-pages/start.inc.php +10 -18
- includes/menu-pages/trk-ops.inc.php +33 -23
- includes/profile.inc.php +32 -7
- includes/s2member-min.js +1 -1
- includes/s2member.css +19 -2
- includes/s2member.js +36 -2
- includes/syscon.inc.php +30 -19
- ms.txt +7 -0
- readme.txt +78 -23
- s2member.php +15 -14
images/brand-favicon.fla
CHANGED
Binary file
|
images/brand-favicon.png
CHANGED
Binary file
|
images/large-icon.fla
ADDED
Binary file
|
images/large-icon.png
ADDED
Binary file
|
includes/dropins/bridges/_s2member-bbpress-bridge.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Version: 1.0
|
4 |
-
Stable tag: 1.0
|
5 |
Framework: WS-BB-DIP-1.0
|
6 |
|
7 |
Tested up to: 1.0.2
|
8 |
Requires at least: 1.0.2
|
9 |
-
Requires: s2Member 3.
|
10 |
|
11 |
Copyright: © 2009 WebSharks, Inc.
|
12 |
License: GNU General Public License
|
@@ -16,7 +16,7 @@ Author: PriMoThemes.com / WebSharks, Inc.
|
|
16 |
Donate link: http://www.primothemes.com/donate/
|
17 |
|
18 |
Plugin Name: s2Member Bridge
|
19 |
-
Pro Module /
|
20 |
Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
|
21 |
Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
|
22 |
Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
|
@@ -46,9 +46,9 @@ function ws_plugin__s2member_bridge_bbpress_roles () /* On-the-fly. */
|
|
46 |
/**/
|
47 |
if (empty ($user->roles)) /* Only when no bbPress® Role has been assigned yet. */
|
48 |
/**/
|
49 |
-
foreach ($user->wp_capabilities as $wp_cap => $v) /* Check ^s2member_level[
|
50 |
/**/
|
51 |
-
if (preg_match ("/^s2member_level[0-
|
52 |
{
|
53 |
bb_give_user_default_role($user);
|
54 |
break; /* Now a Member! */
|
@@ -89,9 +89,9 @@ function ws_plugin__s2member_bridge_bbpress_access () /* Check Access. */
|
|
89 |
/**/
|
90 |
else if (is_object ($user = bb_get_current_user ()) && $user->ID) /* Logged in? / Got User object? */
|
91 |
/**/
|
92 |
-
foreach ($user->wp_capabilities as $wp_cap => $v) /* Looking for ^(subscriber|s2member_level[0-
|
93 |
/**/
|
94 |
-
if (preg_match ("/^(subscriber|s2member_level[0-
|
95 |
/**/
|
96 |
if (($wp_cap === "subscriber" && $min > 0) || !strlen ($level = preg_replace ("/[^0-9]/", $wp_cap)) || $level < $min)
|
97 |
/**/
|
1 |
<?php
|
2 |
/*
|
3 |
+
Version: 1.0.1
|
4 |
+
Stable tag: 1.0.1
|
5 |
Framework: WS-BB-DIP-1.0
|
6 |
|
7 |
Tested up to: 1.0.2
|
8 |
Requires at least: 1.0.2
|
9 |
+
Requires: s2Member 3.2+, bbPress® 1.0.2+
|
10 |
|
11 |
Copyright: © 2009 WebSharks, Inc.
|
12 |
License: GNU General Public License
|
16 |
Donate link: http://www.primothemes.com/donate/
|
17 |
|
18 |
Plugin Name: s2Member Bridge
|
19 |
+
Pro Module / Prices: http://www.s2member.com/prices/
|
20 |
Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
|
21 |
Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
|
22 |
Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
|
46 |
/**/
|
47 |
if (empty ($user->roles)) /* Only when no bbPress® Role has been assigned yet. */
|
48 |
/**/
|
49 |
+
foreach ($user->wp_capabilities as $wp_cap => $v) /* Check ^s2member_level[1-4]+ */
|
50 |
/**/
|
51 |
+
if (preg_match ("/^s2member_level[0-4]$/", $wp_cap)) /* An s2Member Role? */
|
52 |
{
|
53 |
bb_give_user_default_role($user);
|
54 |
break; /* Now a Member! */
|
89 |
/**/
|
90 |
else if (is_object ($user = bb_get_current_user ()) && $user->ID) /* Logged in? / Got User object? */
|
91 |
/**/
|
92 |
+
foreach ($user->wp_capabilities as $wp_cap => $v) /* Looking for ^(subscriber|s2member_level[0-4])$. */
|
93 |
/**/
|
94 |
+
if (preg_match ("/^(subscriber|s2member_level[0-4])$/", $wp_cap)) /* Subscribers and/or s2Member Roles. */
|
95 |
/**/
|
96 |
if (($wp_cap === "subscriber" && $min > 0) || !strlen ($level = preg_replace ("/[^0-9]/", $wp_cap)) || $level < $min)
|
97 |
/**/
|
includes/functions/activate-deactivate.inc.php
CHANGED
@@ -19,12 +19,22 @@ Attach to: add_action("admin_init");
|
|
19 |
*/
|
20 |
if (!function_exists ("ws_plugin__s2member_check_activation"))
|
21 |
{
|
22 |
-
function ws_plugin__s2member_check_activation () /*
|
23 |
{
|
24 |
$v = get_option ("ws_plugin__s2member_activated_version");
|
25 |
if (!$v || !version_compare ($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
|
26 |
ws_plugin__s2member_activate ();
|
27 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
return;
|
29 |
}
|
30 |
}
|
@@ -42,6 +52,9 @@ if (!function_exists ("ws_plugin__s2member_activate"))
|
|
42 |
{
|
43 |
function ws_plugin__s2member_activate ()
|
44 |
{
|
|
|
|
|
|
|
45 |
do_action ("ws_plugin__s2member_before_activation", get_defined_vars ());
|
46 |
/**/
|
47 |
$role = &get_role ("subscriber");
|
@@ -126,33 +139,53 @@ if (!function_exists ("ws_plugin__s2member_activate"))
|
|
126 |
if (!file_exists ($htaccess = $logs_dir . "/.htaccess"))
|
127 |
file_put_contents ($htaccess, "deny from all");
|
128 |
/**/
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
update_option ("ws_plugin__s2member_cache", array ());
|
134 |
-
/**/
|
135 |
-
if (!is_array (get_option ("ws_plugin__s2member_notices")))
|
136 |
-
update_option ("ws_plugin__s2member_notices", array ());
|
137 |
/**/
|
138 |
-
if (
|
139 |
-
update_option ("ws_plugin__s2member_options", array ());
|
140 |
-
/**/
|
141 |
-
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["configured"]) /* If already configured, read the Changelog. */
|
142 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
$notice = '<strong>s2Member</strong> has been <strong>re-activated</strong>, with the latest version.<br />';
|
144 |
-
$notice .= 'You now have version ' . WS_PLUGIN__S2MEMBER_VERSION . '. Your existing configuration remains
|
145 |
-
|
|
|
146 |
ws_plugin__s2member_enqueue_admin_notice ($notice, array ("plugins.php", "ws-plugin--s2member-options"));
|
147 |
}
|
148 |
-
else /* Otherwise, we'll help the
|
149 |
{
|
150 |
$notice = '<strong>s2Member</strong> v' . WS_PLUGIN__S2MEMBER_VERSION . ' has been <strong>activated</strong>. Nice work!<br />';
|
151 |
$notice .= 'Have fun, <a href="admin.php?page=ws-plugin--s2member-start">read the Quick Start Guide</a>, and make some money! :-)';
|
152 |
ws_plugin__s2member_enqueue_admin_notice ($notice, array ("plugins.php", "ws-plugin--s2member-options"));
|
153 |
}
|
154 |
/**/
|
155 |
-
update_option ("ws_plugin__s2member_activated_version", WS_PLUGIN__S2MEMBER_VERSION);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
/**/
|
157 |
do_action ("ws_plugin__s2member_after_activation", get_defined_vars ());
|
158 |
/**/
|
@@ -168,6 +201,9 @@ if (!function_exists ("ws_plugin__s2member_deactivate"))
|
|
168 |
{
|
169 |
function ws_plugin__s2member_deactivate ()
|
170 |
{
|
|
|
|
|
|
|
171 |
do_action ("ws_plugin__s2member_before_deactivation", get_defined_vars ());
|
172 |
/**/
|
173 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["run_deactivation_routines"])
|
@@ -219,27 +255,24 @@ if (!function_exists ("ws_plugin__s2member_deactivate"))
|
|
219 |
/**/
|
220 |
if (is_dir ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
221 |
{
|
222 |
-
|
223 |
-
if (is_writable ($
|
224 |
-
unlink($
|
225 |
-
/**/
|
226 |
-
if (file_exists ($log = $logs_dir . "/paypal-ipn.log"))
|
227 |
-
if (is_writable ($log))
|
228 |
-
unlink($log);
|
229 |
-
/**/
|
230 |
-
if (file_exists ($log = $logs_dir . "/paypal-rtn.log"))
|
231 |
-
if (is_writable ($log))
|
232 |
-
unlink($log);
|
233 |
/**/
|
234 |
@rmdir($logs_dir);
|
235 |
}
|
236 |
/**/
|
|
|
237 |
delete_option("ws_plugin__s2member_activated_version");
|
238 |
delete_option("ws_plugin__s2member_configured");
|
239 |
delete_option("ws_plugin__s2member_cache");
|
240 |
delete_option("ws_plugin__s2member_notices");
|
241 |
delete_option("ws_plugin__s2member_options");
|
242 |
/**/
|
|
|
|
|
|
|
|
|
243 |
do_action ("ws_plugin__s2member_during_deactivation", get_defined_vars ());
|
244 |
}
|
245 |
/**/
|
19 |
*/
|
20 |
if (!function_exists ("ws_plugin__s2member_check_activation"))
|
21 |
{
|
22 |
+
function ws_plugin__s2member_check_activation () /* Up-to-date? */
|
23 |
{
|
24 |
$v = get_option ("ws_plugin__s2member_activated_version");
|
25 |
if (!$v || !version_compare ($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
|
26 |
ws_plugin__s2member_activate ();
|
27 |
/**/
|
28 |
+
/* Be ABSOLUTELY sure to use "else if" here. Avoid doubles. */
|
29 |
+
/**/
|
30 |
+
else if (is_multisite () && is_main_site ())
|
31 |
+
/* In case a Multisite Network is enabled later on. */
|
32 |
+
{
|
33 |
+
$mms_v = get_option ("ws_plugin__s2member_activated_mms_version");
|
34 |
+
if (!$mms_v || !version_compare ($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
|
35 |
+
ws_plugin__s2member_activate ();
|
36 |
+
}
|
37 |
+
/**/
|
38 |
return;
|
39 |
}
|
40 |
}
|
52 |
{
|
53 |
function ws_plugin__s2member_activate ()
|
54 |
{
|
55 |
+
global $wpdb; /* To update points of origin on a Multisite Network. */
|
56 |
+
global $current_site, $current_blog; /* For Multisite support. */
|
57 |
+
/**/
|
58 |
do_action ("ws_plugin__s2member_before_activation", get_defined_vars ());
|
59 |
/**/
|
60 |
$role = &get_role ("subscriber");
|
139 |
if (!file_exists ($htaccess = $logs_dir . "/.htaccess"))
|
140 |
file_put_contents ($htaccess, "deny from all");
|
141 |
/**/
|
142 |
+
(!is_numeric (get_option ("ws_plugin__s2member_configured"))) ? update_option ("ws_plugin__s2member_configured", "0") : null;
|
143 |
+
(!is_array (get_option ("ws_plugin__s2member_cache"))) ? update_option ("ws_plugin__s2member_cache", array ()) : null;
|
144 |
+
(!is_array (get_option ("ws_plugin__s2member_notices"))) ? update_option ("ws_plugin__s2member_notices", array ()) : null;
|
145 |
+
(!is_array (get_option ("ws_plugin__s2member_options"))) ? update_option ("ws_plugin__s2member_options", array ()) : null;
|
|
|
|
|
|
|
|
|
146 |
/**/
|
147 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["configured"]) /* If already configured, we are re-activating. */
|
|
|
|
|
|
|
148 |
{
|
149 |
+
$v = get_option ("ws_plugin__s2member_activated_version");
|
150 |
+
if (!$v || !version_compare ($v, "3.2", ">=")) /* Needs to be upgraded? */
|
151 |
+
/* Version 3.2 is where the `meta_key` names were changed. They're prefixed now. */
|
152 |
+
{
|
153 |
+
$like = "`meta_key` LIKE 's2member\_%' AND `meta_key` NOT LIKE '%s2member\_originating\_blog%'";
|
154 |
+
$wpdb->query ("UPDATE `" . $wpdb->usermeta . "` SET `meta_key` = CONCAT('" . $wpdb->prefix . "', `meta_key`) WHERE " . $like);
|
155 |
+
}
|
156 |
+
/**/
|
157 |
$notice = '<strong>s2Member</strong> has been <strong>re-activated</strong>, with the latest version.<br />';
|
158 |
+
$notice .= 'You now have version ' . WS_PLUGIN__S2MEMBER_VERSION . '. Your existing configuration remains.';
|
159 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()) /* No Changelog on a Multisite Farm. */
|
160 |
+
$notice .= '<br />Have fun, <a href="admin.php?page=ws-plugin--s2member-info#rm-changelog">read the Changelog</a>, and make some money! :-)';
|
161 |
ws_plugin__s2member_enqueue_admin_notice ($notice, array ("plugins.php", "ws-plugin--s2member-options"));
|
162 |
}
|
163 |
+
else /* Otherwise, (initial activation); we'll help the Site Owner out by giving them a link to the Quick Start Guide. */
|
164 |
{
|
165 |
$notice = '<strong>s2Member</strong> v' . WS_PLUGIN__S2MEMBER_VERSION . ' has been <strong>activated</strong>. Nice work!<br />';
|
166 |
$notice .= 'Have fun, <a href="admin.php?page=ws-plugin--s2member-start">read the Quick Start Guide</a>, and make some money! :-)';
|
167 |
ws_plugin__s2member_enqueue_admin_notice ($notice, array ("plugins.php", "ws-plugin--s2member-options"));
|
168 |
}
|
169 |
/**/
|
170 |
+
update_option ("ws_plugin__s2member_activated_version", WS_PLUGIN__S2MEMBER_VERSION); /* Mark version. */
|
171 |
+
/**/
|
172 |
+
if (is_multisite () && is_main_site ()) /* Network activation routines. A few quick adjustments. */
|
173 |
+
{
|
174 |
+
foreach ((array)($users = $wpdb->get_results ("SELECT `ID` FROM `" . $wpdb->users . "`")) as $user)
|
175 |
+
{
|
176 |
+
/* Here we convert everyone already in the system; without a point of origin.
|
177 |
+
This will set their point of origin to the Main Site ( Dashboard Blog ). */
|
178 |
+
if (!($originating_blog = get_user_meta ($user->ID, "s2member_originating_blog", true)))
|
179 |
+
update_user_meta ($user->ID, "s2member_originating_blog", $current_site->blog_id);
|
180 |
+
}
|
181 |
+
/**/
|
182 |
+
$notice = '<strong>Multisite Network</strong> updated automatically by <strong>s2Member</strong> v' . WS_PLUGIN__S2MEMBER_VERSION . '.<br />';
|
183 |
+
$notice .= 'You\'ll want to configure s2Member\'s Multisite options now.<br />';
|
184 |
+
$notice .= 'In the Dashboard for your Main Site, see:<br /><code>s2Member -> Multisite ( Config )</code>.';
|
185 |
+
ws_plugin__s2member_enqueue_admin_notice ($notice, array ("plugins.php", "ws-plugin--s2member-options"));
|
186 |
+
/**/
|
187 |
+
update_option ("ws_plugin__s2member_activated_mms_version", WS_PLUGIN__S2MEMBER_VERSION);
|
188 |
+
}
|
189 |
/**/
|
190 |
do_action ("ws_plugin__s2member_after_activation", get_defined_vars ());
|
191 |
/**/
|
201 |
{
|
202 |
function ws_plugin__s2member_deactivate ()
|
203 |
{
|
204 |
+
global $wpdb; /* May need this for database cleaning. */
|
205 |
+
global $current_site, $current_blog; /* For Multisite support. */
|
206 |
+
/**/
|
207 |
do_action ("ws_plugin__s2member_before_deactivation", get_defined_vars ());
|
208 |
/**/
|
209 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["run_deactivation_routines"])
|
255 |
/**/
|
256 |
if (is_dir ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
257 |
{
|
258 |
+
foreach (scandir ($logs_dir) as $log_file)
|
259 |
+
if (is_writable ($log_file = $logs_dir . "/" . $log_file))
|
260 |
+
unlink($log_file);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
/**/
|
262 |
@rmdir($logs_dir);
|
263 |
}
|
264 |
/**/
|
265 |
+
delete_option("ws_plugin__s2member_activated_mms_version");
|
266 |
delete_option("ws_plugin__s2member_activated_version");
|
267 |
delete_option("ws_plugin__s2member_configured");
|
268 |
delete_option("ws_plugin__s2member_cache");
|
269 |
delete_option("ws_plugin__s2member_notices");
|
270 |
delete_option("ws_plugin__s2member_options");
|
271 |
/**/
|
272 |
+
$like = "`meta_key` LIKE '%s2member\_%'";
|
273 |
+
$wpdb->query ("DELETE FROM `" . $wpdb->postmeta . "` WHERE " . $like);
|
274 |
+
$wpdb->query ("DELETE FROM `" . $wpdb->usermeta . "` WHERE " . $like);
|
275 |
+
/**/
|
276 |
do_action ("ws_plugin__s2member_during_deactivation", get_defined_vars ());
|
277 |
}
|
278 |
/**/
|
includes/functions/auto-eots.inc.php
CHANGED
@@ -15,14 +15,21 @@ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
|
15 |
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Function processed by WP-Cron. This handles Auto-EOTs.
|
18 |
-
|
|
|
|
|
19 |
To increase, use: add_filter ("ws_plugin__s2member_auto_eot_system_per_process");
|
|
|
|
|
|
|
|
|
20 |
*/
|
21 |
if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
|
22 |
{
|
23 |
function ws_plugin__s2member_auto_eot_system ($per_process = 10)
|
24 |
{
|
25 |
global $wpdb; /* Need global DB obj. */
|
|
|
26 |
/**/
|
27 |
include_once ABSPATH . "wp-admin/includes/admin.php";
|
28 |
/**/
|
@@ -32,36 +39,35 @@ if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
|
|
32 |
{
|
33 |
$per_process = apply_filters ("ws_plugin__s2member_auto_eot_system_per_process", $per_process, get_defined_vars ());
|
34 |
/**/
|
35 |
-
if ($eots = $wpdb->get_results ("SELECT `user_id` AS `ID` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 's2member_auto_eot_time' AND `meta_value` <= '" . $wpdb->escape (strtotime ("now")) . "' LIMIT " . $per_process))
|
36 |
{
|
37 |
-
foreach ($eots as $eot) /* Go through the array of
|
38 |
{
|
39 |
if (($user_id = $eot->ID) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
40 |
{
|
41 |
-
|
42 |
-
/* Removing this prevents re-runs on non WP Roles. Which are scanned for next. */
|
43 |
/**/
|
44 |
-
if (
|
45 |
{
|
46 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "demote")
|
47 |
{
|
|
|
|
|
|
|
48 |
$demotion_role = ws_plugin__s2member_force_demotion_role ("subscriber");
|
49 |
$user->set_role ($demotion_role); /* Defaults to Free Subscriber. */
|
50 |
/**/
|
51 |
-
$subscr_id = get_usermeta ($user_id, "s2member_subscr_id");
|
52 |
-
$custom = get_usermeta ($user_id, "s2member_custom");
|
53 |
-
/**/
|
54 |
-
delete_usermeta ($user_id, "s2member_custom");
|
55 |
-
delete_usermeta ($user_id, "s2member_subscr_id");
|
56 |
-
delete_usermeta ($user_id, "s2member_last_payment_time");
|
57 |
-
delete_usermeta ($user_id, "s2member_auto_eot_time");
|
58 |
-
/**/
|
59 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
60 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
61 |
$user->remove_cap ($ccap = $cap);
|
62 |
/**/
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
65 |
/**/
|
66 |
ws_plugin__s2member_append_user_notes ($user_id, "Demoted by s2Member: " . date ("D M j, Y g:i a T"));
|
67 |
/**/
|
@@ -73,9 +79,10 @@ if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
|
|
73 |
if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
|
74 |
if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
|
75 |
if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
79 |
}
|
80 |
/**/
|
81 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
@@ -84,8 +91,16 @@ if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
|
|
84 |
}
|
85 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "delete")
|
86 |
{
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
/**/
|
90 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
91 |
do_action ("ws_plugin__s2member_during_auto_eot_system_during_delete", get_defined_vars ());
|
15 |
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Function processed by WP-Cron. This handles Auto-EOTs.
|
18 |
+
|
19 |
+
If you have a HUGE userbase, increase the max EOTS per process.
|
20 |
+
~ But NOTE, this runs $per_process ( per Blog ) on a Multisite Network.
|
21 |
To increase, use: add_filter ("ws_plugin__s2member_auto_eot_system_per_process");
|
22 |
+
|
23 |
+
s2Member v3.2 ( VERY IMPORTANT ).
|
24 |
+
AND `meta_value` != ''
|
25 |
+
Because update_user_option() may NOT always delete the key.
|
26 |
*/
|
27 |
if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
|
28 |
{
|
29 |
function ws_plugin__s2member_auto_eot_system ($per_process = 10)
|
30 |
{
|
31 |
global $wpdb; /* Need global DB obj. */
|
32 |
+
global $current_site, $current_blog; /* Multisite. */
|
33 |
/**/
|
34 |
include_once ABSPATH . "wp-admin/includes/admin.php";
|
35 |
/**/
|
39 |
{
|
40 |
$per_process = apply_filters ("ws_plugin__s2member_auto_eot_system_per_process", $per_process, get_defined_vars ());
|
41 |
/**/
|
42 |
+
if (is_array ($eots = $wpdb->get_results ("SELECT `user_id` AS `ID` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_auto_eot_time' AND `meta_value` != '' AND `meta_value` <= '" . $wpdb->escape (strtotime ("now")) . "' LIMIT " . $per_process)))
|
43 |
{
|
44 |
+
foreach ($eots as $eot) /* Go through the array of EOTS. We need to (demote|delete) each of them. */
|
45 |
{
|
46 |
if (($user_id = $eot->ID) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
47 |
{
|
48 |
+
delete_user_option ($user_id, "s2member_auto_eot_time"); /* ALWAYS delete this. */
|
|
|
49 |
/**/
|
50 |
+
if (!$user->has_cap ("administrator")) /* Do NOT process Administrator accounts. */
|
51 |
{
|
52 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "demote")
|
53 |
{
|
54 |
+
$subscr_id = get_user_option ("s2member_subscr_id", $user_id);
|
55 |
+
$custom = get_user_option ("s2member_custom", $user_id);
|
56 |
+
/**/
|
57 |
$demotion_role = ws_plugin__s2member_force_demotion_role ("subscriber");
|
58 |
$user->set_role ($demotion_role); /* Defaults to Free Subscriber. */
|
59 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
61 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
62 |
$user->remove_cap ($ccap = $cap);
|
63 |
/**/
|
64 |
+
delete_user_option ($user_id, "s2member_custom");
|
65 |
+
delete_user_option ($user_id, "s2member_subscr_id");
|
66 |
+
delete_user_option ($user_id, "s2member_last_payment_time");
|
67 |
+
delete_user_option ($user_id, "s2member_auto_eot_time");
|
68 |
+
/**/
|
69 |
+
delete_user_option ($user_id, "s2member_file_download_access_arc");
|
70 |
+
delete_user_option ($user_id, "s2member_file_download_access_log");
|
71 |
/**/
|
72 |
ws_plugin__s2member_append_user_notes ($user_id, "Demoted by s2Member: " . date ("D M j, Y g:i a T"));
|
73 |
/**/
|
79 |
if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
|
80 |
if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
|
81 |
if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
|
82 |
+
if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
|
83 |
+
/**/
|
84 |
+
if (($url = trim ($url))) /* Empty? */
|
85 |
+
ws_plugin__s2member_remote ($url);
|
86 |
}
|
87 |
/**/
|
88 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
91 |
}
|
92 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_eot_behavior"] === "delete")
|
93 |
{
|
94 |
+
if (is_multisite ()) /* Multisite does NOT actually delete; ONLY removes. */
|
95 |
+
{
|
96 |
+
remove_user_from_blog ($user_id, $current_blog->blog_id);
|
97 |
+
/* This will automatically trigger `eot_del_notification_urls` as well. */
|
98 |
+
ws_plugin__s2member_handle_ms_user_deletions ($user_id, $current_blog->blog_id, "s2says");
|
99 |
+
}
|
100 |
+
/**/
|
101 |
+
else /* Otherwise, we can actually delete them. */
|
102 |
+
/* This will automatically trigger `eot_del_notification_urls` as well. */
|
103 |
+
wp_delete_user ($user_id); /* `ws_plugin__s2member_handle_user_deletions()` */
|
104 |
/**/
|
105 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
106 |
do_action ("ws_plugin__s2member_during_auto_eot_system_during_delete", get_defined_vars ());
|
includes/functions/constants.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Define several API Constants for s2Member.
|
18 |
Note that these are duplicated into the JavaScript API as well.
|
@@ -25,94 +25,95 @@ if (!function_exists ("ws_plugin__s2member_constants"))
|
|
25 |
do_action ("ws_plugin__s2member_before_constants", get_defined_vars ());
|
26 |
/**/
|
27 |
$links = ws_plugin__s2member_constant_links ();
|
28 |
-
$metas = ws_plugin__s2member_constant_metas ();
|
29 |
$level = ws_plugin__s2member_user_access_level ();
|
|
|
|
|
30 |
$current_user = (is_user_logged_in ()) ? wp_get_current_user () : false;
|
31 |
-
$file_downloads = ws_plugin__s2member_user_downloads ("", $metas["s2member_file_download_access_log"]);
|
32 |
-
$login_redirection_override = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) ? /* Only when applicable. */
|
33 |
-
ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"], $current_user) : "";
|
34 |
/**/
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
|
37 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
38 |
/**/
|
39 |
-
define ("S2MEMBER_VERSION", WS_PLUGIN__S2MEMBER_VERSION); /*
|
40 |
-
/**/
|
41 |
-
define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN", (($current_user) ? true : false));
|
42 |
-
define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER", (($current_user && $level >= 1) ? true : false));
|
43 |
-
define ("S2MEMBER_CURRENT_USER_ACCESS_LEVEL", (int)$level);
|
44 |
-
define ("S2MEMBER_CURRENT_USER_ACCESS_LABEL", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"]);
|
45 |
-
define ("S2MEMBER_CURRENT_USER_SUBSCR_ID", (($current_user) ? (($
|
46 |
-
define ("S2MEMBER_CURRENT_USER_CUSTOM", (
|
47 |
-
define ("S2MEMBER_CURRENT_USER_REGISTRATION_TIME", (($current_user) ? (int)strtotime ($current_user->user_registered) : 0));
|
48 |
-
define ("S2MEMBER_CURRENT_USER_REGISTRATION_DAYS", (($current_user) ? (int)floor ((strtotime ("now") - strtotime ($current_user->user_registered)) / 86400) : 0));
|
49 |
-
define ("S2MEMBER_CURRENT_USER_DISPLAY_NAME", (($current_user) ? $current_user->display_name : ""));
|
50 |
-
define ("S2MEMBER_CURRENT_USER_FIRST_NAME", (($current_user) ? $current_user->
|
51 |
-
define ("S2MEMBER_CURRENT_USER_LAST_NAME", (($current_user) ? $current_user->
|
52 |
-
define ("S2MEMBER_CURRENT_USER_LOGIN", (($current_user) ? $current_user->user_login : ""));
|
53 |
-
define ("S2MEMBER_CURRENT_USER_EMAIL", (($current_user) ? $current_user->user_email : ""));
|
54 |
-
define ("S2MEMBER_CURRENT_USER_IP", $_SERVER["REMOTE_ADDR"]);
|
55 |
-
define ("S2MEMBER_CURRENT_USER_ID", (($current_user) ? (int)$current_user->ID : 0));
|
56 |
-
define ("S2MEMBER_CURRENT_USER_FIELDS", (($current_user) ? json_encode (array_merge
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
define ("
|
62 |
-
|
63 |
-
define ("
|
64 |
-
define ("
|
65 |
-
|
66 |
-
|
67 |
-
define ("
|
68 |
-
define ("
|
69 |
-
|
70 |
-
define ("
|
71 |
-
define ("
|
72 |
-
define ("
|
73 |
-
|
74 |
-
define ("
|
75 |
-
define ("
|
76 |
-
|
77 |
-
define ("
|
78 |
-
define ("
|
79 |
-
|
80 |
-
define ("
|
81 |
-
define ("
|
82 |
-
|
83 |
-
define ("
|
84 |
-
define ("
|
85 |
-
|
86 |
-
define ("
|
87 |
-
define ("
|
88 |
-
|
89 |
-
define ("
|
90 |
-
define ("
|
91 |
-
|
92 |
-
define ("
|
93 |
-
|
94 |
-
|
95 |
-
define ("
|
96 |
-
/**/
|
97 |
-
define ("
|
98 |
-
define ("
|
99 |
-
|
100 |
-
define ("
|
101 |
-
|
102 |
-
define ("
|
103 |
-
define ("
|
104 |
-
/**/
|
105 |
-
define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0", ((S2MEMBER_CURRENT_USER_SUBSCR_ID) ? "Updating Subscr. ID" : "")); /* Subscr. ID or $user->ID. Either will work. */
|
106 |
-
define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0", ((S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) ? S2MEMBER_CURRENT_USER_SUBSCR_ID : "")); /* Subscr. ID or $user->ID. */
|
107 |
/**/
|
108 |
do_action ("ws_plugin__s2member_after_constants", get_defined_vars ());
|
109 |
/**/
|
110 |
-
return;
|
111 |
}
|
112 |
}
|
113 |
/*
|
114 |
-
This function pulls all of the
|
115 |
-
Page links are cached into the
|
116 |
This allows the API Constants to provide quick access to them without being
|
117 |
forced to execute get_page_link() all the time, which piles up DB queries.
|
118 |
*/
|
@@ -122,11 +123,7 @@ if (!function_exists ("ws_plugin__s2member_constant_links"))
|
|
122 |
{
|
123 |
do_action ("ws_plugin__s2member_before_constant_links", get_defined_vars ());
|
124 |
/**/
|
125 |
-
$
|
126 |
-
/**/
|
127 |
-
$l["login_welcome_page"] = (string)"";
|
128 |
-
$l["membership_options_page"] = (string)"";
|
129 |
-
$l["file_download_limit_exceeded_page"] = (string)"";
|
130 |
/**/
|
131 |
$login_welcome_page = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"];
|
132 |
$membership_options_page = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"];
|
@@ -136,7 +133,7 @@ if (!function_exists ("ws_plugin__s2member_constant_links"))
|
|
136 |
$membership_options_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"];
|
137 |
$file_download_limit_exceeded_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"];
|
138 |
/**/
|
139 |
-
if ($login_welcome_page && $login_welcome_page_cache["page"] === $login_welcome_page && $login_welcome_page_cache["link"] && $login_welcome_page_cache["time"] >= strtotime ("-
|
140 |
{
|
141 |
$l["login_welcome_page"] = $login_welcome_page_cache["link"];
|
142 |
}
|
@@ -149,7 +146,7 @@ if (!function_exists ("ws_plugin__s2member_constant_links"))
|
|
149 |
$cache_needs_updating = true;
|
150 |
}
|
151 |
/**/
|
152 |
-
if ($membership_options_page && $membership_options_page_cache["page"] === $membership_options_page && $membership_options_page_cache["link"] && $membership_options_page_cache["time"] >= strtotime ("-
|
153 |
{
|
154 |
$l["membership_options_page"] = $membership_options_page_cache["link"];
|
155 |
}
|
@@ -162,7 +159,7 @@ if (!function_exists ("ws_plugin__s2member_constant_links"))
|
|
162 |
$cache_needs_updating = true;
|
163 |
}
|
164 |
/**/
|
165 |
-
if ($file_download_limit_exceeded_page && $file_download_limit_exceeded_page_cache["page"] === $file_download_limit_exceeded_page && $file_download_limit_exceeded_page_cache["link"] && $file_download_limit_exceeded_page_cache["time"] >= strtotime ("-
|
166 |
{
|
167 |
$l["file_download_limit_exceeded_page"] = $file_download_limit_exceeded_page_cache["link"];
|
168 |
}
|
@@ -183,44 +180,4 @@ if (!function_exists ("ws_plugin__s2member_constant_links"))
|
|
183 |
return apply_filters ("ws_plugin__s2member_constant_links", $l, get_defined_vars ());
|
184 |
}
|
185 |
}
|
186 |
-
/*
|
187 |
-
This function pulls all of the usermeta details needed for Constants.
|
188 |
-
Pulling them all at once helps to prevent repeated database queries.
|
189 |
-
*/
|
190 |
-
if (!function_exists ("ws_plugin__s2member_constant_metas"))
|
191 |
-
{
|
192 |
-
function ws_plugin__s2member_constant_metas ()
|
193 |
-
{
|
194 |
-
global $wpdb; /* The global database object. */
|
195 |
-
/**/
|
196 |
-
do_action ("ws_plugin__s2member_before_constant_metas", get_defined_vars ());
|
197 |
-
/**/
|
198 |
-
$m["s2member_file_download_access_log"] = array ();
|
199 |
-
$m["s2member_custom_fields"] = array ();
|
200 |
-
$m["s2member_subscr_id"] = (string)"";
|
201 |
-
$m["s2member_custom"] = (string)"";
|
202 |
-
/**/
|
203 |
-
if (($current_user = (is_user_logged_in ()) ? wp_get_current_user () : false))
|
204 |
-
{
|
205 |
-
if (is_array ($results = $wpdb->get_results ("SELECT `meta_key`, `meta_value` FROM `" . $wpdb->usermeta . "` WHERE `user_id` = '" . $current_user->ID . "' AND (meta_key = 's2member_file_download_access_log' OR meta_key = 's2member_custom_fields' OR meta_key = 's2member_subscr_id' OR meta_key = 's2member_custom') LIMIT 3")))
|
206 |
-
{
|
207 |
-
foreach ($results as $r) /* Fill in the array we need. */
|
208 |
-
if ($r->meta_key === "s2member_file_download_access_log")
|
209 |
-
$m["s2member_file_download_access_log"] = (array)maybe_unserialize ($r->meta_value);
|
210 |
-
else if ($r->meta_key === "s2member_custom_fields")
|
211 |
-
$m["s2member_custom_fields"] = (array)maybe_unserialize ($r->meta_value);
|
212 |
-
else if ($r->meta_key === "s2member_subscr_id")
|
213 |
-
$m["s2member_subscr_id"] = (string)$r->meta_value;
|
214 |
-
else if ($r->meta_key === "s2member_custom")
|
215 |
-
$m["s2member_custom"] = (string)$r->meta_value;
|
216 |
-
/**/
|
217 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
218 |
-
do_action ("ws_plugin__s2member_during_constant_metas", get_defined_vars ());
|
219 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
220 |
-
}
|
221 |
-
}
|
222 |
-
/**/
|
223 |
-
return apply_filters ("ws_plugin__s2member_constant_metas", $m, get_defined_vars ());
|
224 |
-
}
|
225 |
-
}
|
226 |
?>
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Define several API Constants for s2Member.
|
18 |
Note that these are duplicated into the JavaScript API as well.
|
25 |
do_action ("ws_plugin__s2member_before_constants", get_defined_vars ());
|
26 |
/**/
|
27 |
$links = ws_plugin__s2member_constant_links ();
|
|
|
28 |
$level = ws_plugin__s2member_user_access_level ();
|
29 |
+
$file_downloads = ws_plugin__s2member_user_downloads ();
|
30 |
+
/**/
|
31 |
$current_user = (is_user_logged_in ()) ? wp_get_current_user () : false;
|
|
|
|
|
|
|
32 |
/**/
|
33 |
+
$subscr_id = ($current_user) ? get_user_option ("s2member_subscr_id", $current_user->ID) : "";
|
34 |
+
$custom = ($current_user) ? get_user_option ("s2member_custom", $current_user->ID) : "";
|
35 |
+
$custom_fields = ($current_user) ? get_user_option ("s2member_custom_fields", $current_user->ID) : array ();
|
36 |
+
/**/
|
37 |
+
$login_redirection_override = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) ? ws_plugin__s2member_fill_login_redirect_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"], $current_user) : "";
|
38 |
+
/**/
|
39 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
40 |
do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
|
41 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
42 |
/**/
|
43 |
+
define ("S2MEMBER_VERSION", WS_PLUGIN__S2MEMBER_VERSION); /* Available since 3.0. */
|
44 |
+
/**/
|
45 |
+
define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN", (($current_user) ? true : false));
|
46 |
+
define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER", (($current_user && $level >= 1) ? true : false));
|
47 |
+
define ("S2MEMBER_CURRENT_USER_ACCESS_LEVEL", (int)$level);
|
48 |
+
define ("S2MEMBER_CURRENT_USER_ACCESS_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"]);
|
49 |
+
define ("S2MEMBER_CURRENT_USER_SUBSCR_ID", (($current_user) ? (($subscr_id) ? (string)$subscr_id : (string)$current_user->ID) : ""));
|
50 |
+
define ("S2MEMBER_CURRENT_USER_CUSTOM", (string)$custom);
|
51 |
+
define ("S2MEMBER_CURRENT_USER_REGISTRATION_TIME", (($current_user) ? (int)strtotime ($current_user->user_registered) : 0));
|
52 |
+
define ("S2MEMBER_CURRENT_USER_REGISTRATION_DAYS", (($current_user) ? (int)floor ((strtotime ("now") - strtotime ($current_user->user_registered)) / 86400) : 0));
|
53 |
+
define ("S2MEMBER_CURRENT_USER_DISPLAY_NAME", (($current_user) ? (string)$current_user->display_name : ""));
|
54 |
+
define ("S2MEMBER_CURRENT_USER_FIRST_NAME", (($current_user) ? (string)$current_user->first_name : ""));
|
55 |
+
define ("S2MEMBER_CURRENT_USER_LAST_NAME", (($current_user) ? (string)$current_user->last_name : ""));
|
56 |
+
define ("S2MEMBER_CURRENT_USER_LOGIN", (($current_user) ? (string)$current_user->user_login : ""));
|
57 |
+
define ("S2MEMBER_CURRENT_USER_EMAIL", (($current_user) ? (string)$current_user->user_email : ""));
|
58 |
+
define ("S2MEMBER_CURRENT_USER_IP", (string)$_SERVER["REMOTE_ADDR"]);
|
59 |
+
define ("S2MEMBER_CURRENT_USER_ID", (($current_user) ? (int)$current_user->ID : 0));
|
60 |
+
define ("S2MEMBER_CURRENT_USER_FIELDS", (($current_user) ? json_encode (array_merge (array ("id" => S2MEMBER_CURRENT_USER_ID, "ip" => S2MEMBER_CURRENT_USER_IP, "email" => S2MEMBER_CURRENT_USER_EMAIL, "login" => S2MEMBER_CURRENT_USER_LOGIN, "first_name" => S2MEMBER_CURRENT_USER_FIRST_NAME, "last_name" => S2MEMBER_CURRENT_USER_LAST_NAME, "display_name" => S2MEMBER_CURRENT_USER_DISPLAY_NAME, "subscr_id" => S2MEMBER_CURRENT_USER_SUBSCR_ID, "custom" => S2MEMBER_CURRENT_USER_CUSTOM), (array)$custom_fields)) : json_encode (array ())));
|
61 |
+
/**/
|
62 |
+
define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED", (int)$file_downloads["allowed"]);
|
63 |
+
define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED", (($file_downloads["allowed"] >= 999999999) ? true : false));
|
64 |
+
define ("S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY", (int)$file_downloads["currently"]);
|
65 |
+
define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS", (int)$file_downloads["allowed_days"]);
|
66 |
+
/**/
|
67 |
+
define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]);
|
68 |
+
define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]);
|
69 |
+
define ("S2MEMBER_LOGIN_WELCOME_PAGE_ID", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]);
|
70 |
+
/**/
|
71 |
+
define ("S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL", get_bloginfo ("wpurl") . "/?s2member_profile=1");
|
72 |
+
define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL", (string)$links["file_download_limit_exceeded_page"]);
|
73 |
+
define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL", (string)$links["membership_options_page"]);
|
74 |
+
define ("S2MEMBER_LOGIN_WELCOME_PAGE_URL", (($login_redirection_override) ? (string)$login_redirection_override : (string)$links["login_welcome_page"]));
|
75 |
+
define ("S2MEMBER_LOGOUT_PAGE_URL", (string)wp_logout_url ());
|
76 |
+
define ("S2MEMBER_LOGIN_PAGE_URL", (string)wp_login_url ());
|
77 |
+
/**/
|
78 |
+
define ("S2MEMBER_LEVEL0_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]);
|
79 |
+
define ("S2MEMBER_LEVEL1_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]);
|
80 |
+
define ("S2MEMBER_LEVEL2_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]);
|
81 |
+
define ("S2MEMBER_LEVEL3_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]);
|
82 |
+
define ("S2MEMBER_LEVEL4_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]);
|
83 |
+
/**/
|
84 |
+
define ("S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed"]);
|
85 |
+
define ("S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed"]);
|
86 |
+
define ("S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed"]);
|
87 |
+
define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed"]);
|
88 |
+
define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed"]);
|
89 |
+
/**/
|
90 |
+
define ("S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed_days"]);
|
91 |
+
define ("S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed_days"]);
|
92 |
+
define ("S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed_days"]);
|
93 |
+
define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed_days"]);
|
94 |
+
define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed_days"]);
|
95 |
+
/**/
|
96 |
+
define ("S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]);
|
97 |
+
/**/
|
98 |
+
define ("S2MEMBER_REG_EMAIL_FROM_NAME", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]);
|
99 |
+
define ("S2MEMBER_REG_EMAIL_FROM_EMAIL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]);
|
100 |
+
/**/
|
101 |
+
define ("S2MEMBER_PAYPAL_NOTIFY_URL", get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1");
|
102 |
+
define ("S2MEMBER_PAYPAL_RETURN_URL", get_bloginfo ("wpurl") . "/?s2member_paypal_return=1");
|
103 |
+
define ("S2MEMBER_PAYPAL_ENDPOINT", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"));
|
104 |
+
define ("S2MEMBER_PAYPAL_BUSINESS", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]);
|
105 |
+
/**/
|
106 |
+
define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0", ((S2MEMBER_CURRENT_USER_SUBSCR_ID) ? "Updating Subscr. ID" : ""));
|
107 |
+
define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0", ((S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) ? S2MEMBER_CURRENT_USER_SUBSCR_ID : ""));
|
|
|
|
|
|
|
108 |
/**/
|
109 |
do_action ("ws_plugin__s2member_after_constants", get_defined_vars ());
|
110 |
/**/
|
111 |
+
return; /* Return nothing here. Just for uniformity. */
|
112 |
}
|
113 |
}
|
114 |
/*
|
115 |
+
This function pulls all of the Page links needed for Constants.
|
116 |
+
Page links are cached into the s2Member options on 15 min intervals.
|
117 |
This allows the API Constants to provide quick access to them without being
|
118 |
forced to execute get_page_link() all the time, which piles up DB queries.
|
119 |
*/
|
123 |
{
|
124 |
do_action ("ws_plugin__s2member_before_constant_links", get_defined_vars ());
|
125 |
/**/
|
126 |
+
$l = array ("login_welcome_page" => "", "membership_options_page" => "", "file_download_limit_exceeded_page" => "");
|
|
|
|
|
|
|
|
|
127 |
/**/
|
128 |
$login_welcome_page = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"];
|
129 |
$membership_options_page = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"];
|
133 |
$membership_options_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"];
|
134 |
$file_download_limit_exceeded_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"];
|
135 |
/**/
|
136 |
+
if ($login_welcome_page && $login_welcome_page_cache["page"] === $login_welcome_page && $login_welcome_page_cache["link"] && $login_welcome_page_cache["time"] >= strtotime ("-15 minutes"))
|
137 |
{
|
138 |
$l["login_welcome_page"] = $login_welcome_page_cache["link"];
|
139 |
}
|
146 |
$cache_needs_updating = true;
|
147 |
}
|
148 |
/**/
|
149 |
+
if ($membership_options_page && $membership_options_page_cache["page"] === $membership_options_page && $membership_options_page_cache["link"] && $membership_options_page_cache["time"] >= strtotime ("-15 minutes"))
|
150 |
{
|
151 |
$l["membership_options_page"] = $membership_options_page_cache["link"];
|
152 |
}
|
159 |
$cache_needs_updating = true;
|
160 |
}
|
161 |
/**/
|
162 |
+
if ($file_download_limit_exceeded_page && $file_download_limit_exceeded_page_cache["page"] === $file_download_limit_exceeded_page && $file_download_limit_exceeded_page_cache["link"] && $file_download_limit_exceeded_page_cache["time"] >= strtotime ("-15 minutes"))
|
163 |
{
|
164 |
$l["file_download_limit_exceeded_page"] = $file_download_limit_exceeded_page_cache["link"];
|
165 |
}
|
180 |
return apply_filters ("ws_plugin__s2member_constant_links", $l, get_defined_vars ());
|
181 |
}
|
182 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
?>
|
includes/functions/css-js-w-globals.inc.php
CHANGED
@@ -12,10 +12,9 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Function adds styles to the header.
|
18 |
-
This function is also fired in the admin area.
|
19 |
Do NOT enqueue styles in the admin area.
|
20 |
Attach to: add_action("wp_print_styles");
|
21 |
*/
|
@@ -25,9 +24,9 @@ if (!function_exists ("ws_plugin__s2member_add_css"))
|
|
25 |
{
|
26 |
do_action ("ws_plugin__s2member_before_add_css", get_defined_vars ());
|
27 |
/**/
|
28 |
-
if (!is_admin () /* Not in the admin. */
|
29 |
{
|
30 |
-
wp_enqueue_style ("ws-plugin--s2member", get_bloginfo ("
|
31 |
/**/
|
32 |
do_action ("ws_plugin__s2member_during_add_css", get_defined_vars ());
|
33 |
}
|
@@ -49,16 +48,16 @@ if (!function_exists ("ws_plugin__s2member_css"))
|
|
49 |
/**/
|
50 |
if ($_GET["ws_plugin__s2member_css"])
|
51 |
{
|
52 |
-
header
|
53 |
-
header
|
54 |
-
header
|
55 |
-
header
|
56 |
-
header
|
57 |
/**/
|
58 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
59 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
60 |
/**/
|
61 |
-
ob_start
|
62 |
/**/
|
63 |
include_once dirname (dirname (__FILE__)) . "/s2member.css";
|
64 |
/**/
|
@@ -72,7 +71,6 @@ if (!function_exists ("ws_plugin__s2member_css"))
|
|
72 |
}
|
73 |
/*
|
74 |
Function for adding scripts to the header.
|
75 |
-
This function is fired in the admin area also.
|
76 |
Do NOT enqueue scripts in the admin area.
|
77 |
Attach to: add_action("wp_print_scripts");
|
78 |
*/
|
@@ -88,7 +86,7 @@ if (!function_exists ("ws_plugin__s2member_add_js_w_globals"))
|
|
88 |
{
|
89 |
$a = get_defined_constants (true);
|
90 |
$c = (array)$a["user"];
|
91 |
-
unset
|
92 |
/**/
|
93 |
foreach ($c as $k => $v)
|
94 |
if (preg_match ("/^S2MEMBER_/i", $k))
|
@@ -96,12 +94,12 @@ if (!function_exists ("ws_plugin__s2member_add_js_w_globals"))
|
|
96 |
/**/
|
97 |
$md5 = md5 (serialize ($s2member)); /* This is a hash based on the global key => values. */
|
98 |
/* The md5 hash allows the script to be cached in the browser until the globals happen to change. */
|
99 |
-
/* For instance, the global variables may change when a
|
100 |
-
wp_enqueue_script ("ws-plugin--s2member", get_bloginfo ("
|
101 |
}
|
102 |
-
else /* Else if they are not logged in, we distinguish the
|
103 |
{ /* This essentially creates 2 versions of the script. One while logged in & another when not. */
|
104 |
-
wp_enqueue_script ("ws-plugin--s2member", get_bloginfo ("
|
105 |
}
|
106 |
/**/
|
107 |
do_action ("ws_plugin__s2member_during_add_js_w_globals", get_defined_vars ());
|
@@ -124,11 +122,11 @@ if (!function_exists ("ws_plugin__s2member_js_w_globals"))
|
|
124 |
/**/
|
125 |
if ($_GET["ws_plugin__s2member_js_w_globals"])
|
126 |
{
|
127 |
-
header
|
128 |
-
header
|
129 |
-
header
|
130 |
-
header
|
131 |
-
header
|
132 |
/**/
|
133 |
$g = "var S2MEMBER_VERSION = '" . ws_plugin__s2member_esc_sq (S2MEMBER_VERSION) . "',"; /* Since 3.0. */
|
134 |
/**/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function adds styles to the header.
|
|
|
18 |
Do NOT enqueue styles in the admin area.
|
19 |
Attach to: add_action("wp_print_styles");
|
20 |
*/
|
24 |
{
|
25 |
do_action ("ws_plugin__s2member_before_add_css", get_defined_vars ());
|
26 |
/**/
|
27 |
+
if (!is_admin ()) /* Not in the admin. */
|
28 |
{
|
29 |
+
wp_enqueue_style ("ws-plugin--s2member", get_bloginfo ("wpurl") . "/?ws_plugin__s2member_css=1&qcABC=1", array (), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"], "all");
|
30 |
/**/
|
31 |
do_action ("ws_plugin__s2member_during_add_css", get_defined_vars ());
|
32 |
}
|
48 |
/**/
|
49 |
if ($_GET["ws_plugin__s2member_css"])
|
50 |
{
|
51 |
+
header("Content-Type: text/css; charset=utf-8");
|
52 |
+
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
|
53 |
+
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
|
54 |
+
header("Cache-Control: max-age=604800");
|
55 |
+
header("Pragma: public");
|
56 |
/**/
|
57 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
58 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
|
59 |
/**/
|
60 |
+
ob_start("ws_plugin__s2member_compress_css"); /* Compress. */
|
61 |
/**/
|
62 |
include_once dirname (dirname (__FILE__)) . "/s2member.css";
|
63 |
/**/
|
71 |
}
|
72 |
/*
|
73 |
Function for adding scripts to the header.
|
|
|
74 |
Do NOT enqueue scripts in the admin area.
|
75 |
Attach to: add_action("wp_print_scripts");
|
76 |
*/
|
86 |
{
|
87 |
$a = get_defined_constants (true);
|
88 |
$c = (array)$a["user"];
|
89 |
+
unset($a);
|
90 |
/**/
|
91 |
foreach ($c as $k => $v)
|
92 |
if (preg_match ("/^S2MEMBER_/i", $k))
|
94 |
/**/
|
95 |
$md5 = md5 (serialize ($s2member)); /* This is a hash based on the global key => values. */
|
96 |
/* The md5 hash allows the script to be cached in the browser until the globals happen to change. */
|
97 |
+
/* For instance, the global variables may change when a User who is logged-in changes their Profile. */
|
98 |
+
wp_enqueue_script ("ws-plugin--s2member", get_bloginfo ("wpurl") . "/?ws_plugin__s2member_js_w_globals=1&qcABC=1&" . $md5, array ("jquery"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);
|
99 |
}
|
100 |
+
else /* Else if they are not logged in, we distinguish the JavaScript file by NOT including $md5. */
|
101 |
{ /* This essentially creates 2 versions of the script. One while logged in & another when not. */
|
102 |
+
wp_enqueue_script ("ws-plugin--s2member", get_bloginfo ("wpurl") . "/?ws_plugin__s2member_js_w_globals=1&qcABC=1", array ("jquery"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);
|
103 |
}
|
104 |
/**/
|
105 |
do_action ("ws_plugin__s2member_during_add_js_w_globals", get_defined_vars ());
|
122 |
/**/
|
123 |
if ($_GET["ws_plugin__s2member_js_w_globals"])
|
124 |
{
|
125 |
+
header("Content-Type: text/javascript; charset=utf-8");
|
126 |
+
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
|
127 |
+
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
|
128 |
+
header("Cache-Control: max-age=604800");
|
129 |
+
header("Pragma: public");
|
130 |
/**/
|
131 |
$g = "var S2MEMBER_VERSION = '" . ws_plugin__s2member_esc_sq (S2MEMBER_VERSION) . "',"; /* Since 3.0. */
|
132 |
/**/
|
includes/functions/email-configs.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Functions that modify the email From: name/address.
|
18 |
*/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Functions that modify the email From: name/address.
|
18 |
*/
|
includes/functions/file-download-access.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Function determines the max period in days for download access.
|
18 |
Returns number of days, where 0 means no access to files has been allowed.
|
@@ -55,7 +55,7 @@ if (!function_exists ("ws_plugin__s2member_user_downloads"))
|
|
55 |
{
|
56 |
function ws_plugin__s2member_user_downloads ($not_counting_this_particular_file = false, $log = null)
|
57 |
{
|
58 |
-
eval
|
59 |
do_action ("ws_plugin__s2member_before_user_downloads", get_defined_vars ());
|
60 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
61 |
/**/
|
@@ -91,7 +91,7 @@ if (!function_exists ("ws_plugin__s2member_user_downloads"))
|
|
91 |
$allowed_days = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed_days"];
|
92 |
}
|
93 |
/**/
|
94 |
-
$file_download_access_log = (isset ($log)) ? (array)$log : (array)
|
95 |
foreach ($file_download_access_log as $file_download_access_log_entry_key => $file_download_access_log_entry)
|
96 |
if (strtotime ($file_download_access_log_entry["date"]) >= strtotime ("-" . (int)$allowed_days . " days"))
|
97 |
if ($file_download_access_log_entry["file"] !== $not_counting_this_particular_file)
|
@@ -160,21 +160,21 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
|
|
160 |
/**/
|
161 |
if (!file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
|
162 |
{
|
163 |
-
header
|
164 |
-
exit
|
165 |
}
|
166 |
else if ($_GET["s2member_file_download_key"] && !$file_download_key_is_valid) /* Was an invalid Key passed in? */
|
167 |
{
|
168 |
-
header
|
169 |
-
exit
|
170 |
}
|
171 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]) /* Is a Membership Options Page configured? */
|
172 |
/* This file will be processed WITHOUT a Download Key, using Membership Level Access ( w/ possible Custom Capabilities ). */
|
173 |
{
|
174 |
if (($file_download_access_is_allowed = $min_level_4_downloads = ws_plugin__s2member_min_level_4_downloads ()) === false)
|
175 |
{
|
176 |
-
header
|
177 |
-
exit
|
178 |
}
|
179 |
/**/
|
180 |
else if (!($current_user = (is_user_logged_in ()) ? wp_get_current_user () : false) /* NOT logged in? */
|
@@ -185,36 +185,32 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
|
|
185 |
&& wp_redirect (add_query_arg (array ("s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]))) !== "nill")
|
186 |
exit ();
|
187 |
/**/
|
188 |
-
else if (preg_match ("/^access[_\-]s2member[_\-]level([0-
|
189 |
{
|
190 |
-
|
191 |
-
$level_req = preg_replace ("/[^0-9]/", "", $level_req);
|
192 |
-
/**/
|
193 |
if (!$current_user->has_cap ("access_s2member_level" . $level_req) /* Does the User have access to this Level? */
|
194 |
&& wp_redirect (add_query_arg (array ("s2member_level_req" => $level_req, "s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
195 |
exit ();
|
196 |
}
|
197 |
/**/
|
198 |
-
else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $_GET["s2member_file_download"]))
|
199 |
{
|
200 |
-
|
201 |
-
|
202 |
-
/**/
|
203 |
-
if (!$current_user->has_cap ($ccap_req) /* Does the User have access to this Custom Capability? */
|
204 |
&& wp_redirect (add_query_arg (array ("s2member_ccap_req" => $ccap_req, "s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
205 |
exit ();
|
206 |
}
|
207 |
/**/
|
208 |
$previous_file_downloads = 0; /* Here we're going to count how many downloads they've performed. */
|
209 |
$max_days_logged = ws_plugin__s2member_max_download_period (); /* The longest period in days. */
|
210 |
-
$file_download_access_log = (array)
|
211 |
-
$file_download_access_arc = (array)
|
212 |
/**/
|
213 |
foreach ($file_download_access_log as $file_download_access_log_entry_key => $file_download_access_log_entry)
|
214 |
{
|
215 |
if (strtotime ($file_download_access_log_entry["date"]) < strtotime ("-" . $max_days_logged . " days"))
|
216 |
{
|
217 |
-
unset
|
218 |
$file_download_access_arc[] = $file_download_access_log_entry;
|
219 |
}
|
220 |
else if (strtotime ($file_download_access_log_entry["date"]) >= strtotime ("-" . $file_downloads["allowed_days"] . " days"))
|
@@ -233,8 +229,8 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
|
|
233 |
if (!$already_downloaded) /* Only add this file to the log if they have not already downloaded it. */
|
234 |
$file_download_access_log[] = array ("date" => date ("Y-m-d"), "file" => $_GET["s2member_file_download"]);
|
235 |
/**/
|
236 |
-
|
237 |
-
|
238 |
}
|
239 |
}
|
240 |
else /* Otherwise... it's either $excluded; or permission was granted with a valid Download Key. */
|
@@ -243,8 +239,8 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
|
|
243 |
/**/
|
244 |
if (!file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
|
245 |
{
|
246 |
-
header
|
247 |
-
exit
|
248 |
}
|
249 |
}
|
250 |
/*
|
@@ -258,28 +254,28 @@ if (!function_exists ("ws_plugin__s2member_check_file_download_access"))
|
|
258 |
$basename = $pathinfo["basename"]; /* The actual file name, including its extension. */
|
259 |
$length = filesize ($file); /* The overall file size, in bytes. */
|
260 |
/**/
|
261 |
-
eval
|
262 |
do_action ("ws_plugin__s2member_during_file_download_access", get_defined_vars ());
|
263 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
264 |
/*
|
265 |
Now send the file to the browser.
|
266 |
Be sure to turn off output compression.
|
267 |
*/
|
268 |
-
set_time_limit
|
269 |
ini_set ("zlib.output_compression", 0);
|
270 |
/**/
|
271 |
-
header
|
272 |
-
header
|
273 |
-
header
|
274 |
/**/
|
275 |
if (!$inline) /* If not inline, we default to serving the file as an attachment. */
|
276 |
-
header
|
277 |
/**/
|
278 |
-
header
|
279 |
-
header
|
280 |
-
header
|
281 |
header ("Cache-Control: post-check=0, pre-check=0", false);
|
282 |
-
header
|
283 |
/**/
|
284 |
ob_clean () . flush () . readfile ($file);
|
285 |
/**/
|
@@ -299,15 +295,15 @@ if (!function_exists ("ws_plugin__s2member_file_download_key"))
|
|
299 |
{
|
300 |
function ws_plugin__s2member_file_download_key ($file = FALSE, $cache_compatible = FALSE)
|
301 |
{
|
302 |
-
eval
|
303 |
do_action ("ws_plugin__s2member_before_file_download_key", get_defined_vars ());
|
304 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
305 |
/**/
|
306 |
$salt = ($cache_compatible) ? $file : date ("Y-m-d") . $_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_USER_AGENT"] . $file;
|
307 |
-
$key = md5 (ws_plugin__s2member_xencrypt ($salt));
|
308 |
/**/
|
309 |
if (!$cache_compatible) /* Disallow caching. */
|
310 |
-
ws_plugin__s2member_nocache_constants
|
311 |
/**/
|
312 |
return apply_filters ("ws_plugin__s2member_file_download_key", $key, get_defined_vars ());
|
313 |
}
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function determines the max period in days for download access.
|
18 |
Returns number of days, where 0 means no access to files has been allowed.
|
55 |
{
|
56 |
function ws_plugin__s2member_user_downloads ($not_counting_this_particular_file = false, $log = null)
|
57 |
{
|
58 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
59 |
do_action ("ws_plugin__s2member_before_user_downloads", get_defined_vars ());
|
60 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
61 |
/**/
|
91 |
$allowed_days = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed_days"];
|
92 |
}
|
93 |
/**/
|
94 |
+
$file_download_access_log = (isset ($log)) ? (array)$log : (array)get_user_option ("s2member_file_download_access_log", $current_user->ID);
|
95 |
foreach ($file_download_access_log as $file_download_access_log_entry_key => $file_download_access_log_entry)
|
96 |
if (strtotime ($file_download_access_log_entry["date"]) >= strtotime ("-" . (int)$allowed_days . " days"))
|
97 |
if ($file_download_access_log_entry["file"] !== $not_counting_this_particular_file)
|
160 |
/**/
|
161 |
if (!file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
|
162 |
{
|
163 |
+
header("HTTP/1.0 404 Not Found"); /* The file does NOT even exist. */
|
164 |
+
exit("404: Sorry, file not found. Please contact Support for assistance.");
|
165 |
}
|
166 |
else if ($_GET["s2member_file_download_key"] && !$file_download_key_is_valid) /* Was an invalid Key passed in? */
|
167 |
{
|
168 |
+
header("HTTP/1.0 503 Service Temporarily Unavailable"); /* Invalid Download Keys are handled separately. */
|
169 |
+
exit("503 ( Invalid Key ): Sorry, your access to this file has expired. Please contact Support for assistance.");
|
170 |
}
|
171 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]) /* Is a Membership Options Page configured? */
|
172 |
/* This file will be processed WITHOUT a Download Key, using Membership Level Access ( w/ possible Custom Capabilities ). */
|
173 |
{
|
174 |
if (($file_download_access_is_allowed = $min_level_4_downloads = ws_plugin__s2member_min_level_4_downloads ()) === false)
|
175 |
{
|
176 |
+
header("HTTP/1.0 503 Service Temporarily Unavailable"); /* File downloads are NOT yet configured? */
|
177 |
+
exit("503: Sorry, file downloads are NOT enabled yet. Please contact Support for assistance. If you are the site owner, please configure `s2Member -> Download Options`.");
|
178 |
}
|
179 |
/**/
|
180 |
else if (!($current_user = (is_user_logged_in ()) ? wp_get_current_user () : false) /* NOT logged in? */
|
185 |
&& wp_redirect (add_query_arg (array ("s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]))) !== "nill")
|
186 |
exit ();
|
187 |
/**/
|
188 |
+
else if (preg_match ("/^access[_\-]s2member[_\-]level([0-4])\//", $_GET["s2member_file_download"], $m))
|
189 |
{
|
190 |
+
$level_req = $m[1]; /* Which Level does this require? */
|
|
|
|
|
191 |
if (!$current_user->has_cap ("access_s2member_level" . $level_req) /* Does the User have access to this Level? */
|
192 |
&& wp_redirect (add_query_arg (array ("s2member_level_req" => $level_req, "s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
193 |
exit ();
|
194 |
}
|
195 |
/**/
|
196 |
+
else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $_GET["s2member_file_download"], $m))
|
197 |
{
|
198 |
+
$ccap_req = preg_replace ("/-/", "_", $m[1]); /* Which Capability does this require? */
|
199 |
+
if (!$current_user->has_cap ("access_s2member_ccap_" . $ccap_req) /* Does the User have access to this Custom Capability? */
|
|
|
|
|
200 |
&& wp_redirect (add_query_arg (array ("s2member_ccap_req" => $ccap_req, "s2member_file_download_req" => $_GET["s2member_file_download"]), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
201 |
exit ();
|
202 |
}
|
203 |
/**/
|
204 |
$previous_file_downloads = 0; /* Here we're going to count how many downloads they've performed. */
|
205 |
$max_days_logged = ws_plugin__s2member_max_download_period (); /* The longest period in days. */
|
206 |
+
$file_download_access_log = (array)get_user_option ("s2member_file_download_access_log", $current_user->ID);
|
207 |
+
$file_download_access_arc = (array)get_user_option ("s2member_file_download_access_arc", $current_user->ID);
|
208 |
/**/
|
209 |
foreach ($file_download_access_log as $file_download_access_log_entry_key => $file_download_access_log_entry)
|
210 |
{
|
211 |
if (strtotime ($file_download_access_log_entry["date"]) < strtotime ("-" . $max_days_logged . " days"))
|
212 |
{
|
213 |
+
unset($file_download_access_log[$file_download_access_log_entry_key]);
|
214 |
$file_download_access_arc[] = $file_download_access_log_entry;
|
215 |
}
|
216 |
else if (strtotime ($file_download_access_log_entry["date"]) >= strtotime ("-" . $file_downloads["allowed_days"] . " days"))
|
229 |
if (!$already_downloaded) /* Only add this file to the log if they have not already downloaded it. */
|
230 |
$file_download_access_log[] = array ("date" => date ("Y-m-d"), "file" => $_GET["s2member_file_download"]);
|
231 |
/**/
|
232 |
+
update_user_option ($current_user->ID, "s2member_file_download_access_arc", ws_plugin__s2member_array_unique ($file_download_access_arc));
|
233 |
+
update_user_option ($current_user->ID, "s2member_file_download_access_log", ws_plugin__s2member_array_unique ($file_download_access_log));
|
234 |
}
|
235 |
}
|
236 |
else /* Otherwise... it's either $excluded; or permission was granted with a valid Download Key. */
|
239 |
/**/
|
240 |
if (!file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
|
241 |
{
|
242 |
+
header("HTTP/1.0 404 Not Found"); /* The file does NOT even exist. */
|
243 |
+
exit("404: Sorry, file not found. Please contact Support for assistance.");
|
244 |
}
|
245 |
}
|
246 |
/*
|
254 |
$basename = $pathinfo["basename"]; /* The actual file name, including its extension. */
|
255 |
$length = filesize ($file); /* The overall file size, in bytes. */
|
256 |
/**/
|
257 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
258 |
do_action ("ws_plugin__s2member_during_file_download_access", get_defined_vars ());
|
259 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
260 |
/*
|
261 |
Now send the file to the browser.
|
262 |
Be sure to turn off output compression.
|
263 |
*/
|
264 |
+
set_time_limit(0); /* Make time. */
|
265 |
ini_set ("zlib.output_compression", 0);
|
266 |
/**/
|
267 |
+
header("Content-Encoding: none");
|
268 |
+
header("Content-Type: " . $mimetype);
|
269 |
+
header("Content-Length: " . $length);
|
270 |
/**/
|
271 |
if (!$inline) /* If not inline, we default to serving the file as an attachment. */
|
272 |
+
header('Content-Disposition: attachment; filename="' . $basename . '"');
|
273 |
/**/
|
274 |
+
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
|
275 |
+
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
|
276 |
+
header("Cache-Control: no-cache, must-revalidate, max-age=0");
|
277 |
header ("Cache-Control: post-check=0, pre-check=0", false);
|
278 |
+
header("Pragma: no-cache");
|
279 |
/**/
|
280 |
ob_clean () . flush () . readfile ($file);
|
281 |
/**/
|
295 |
{
|
296 |
function ws_plugin__s2member_file_download_key ($file = FALSE, $cache_compatible = FALSE)
|
297 |
{
|
298 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
299 |
do_action ("ws_plugin__s2member_before_file_download_key", get_defined_vars ());
|
300 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
301 |
/**/
|
302 |
$salt = ($cache_compatible) ? $file : date ("Y-m-d") . $_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_USER_AGENT"] . $file;
|
303 |
+
$key = md5 (ws_plugin__s2member_xencrypt ($salt)); /* Creates a site-specific/xencrytped hash of the salt.
|
304 |
/**/
|
305 |
if (!$cache_compatible) /* Disallow caching. */
|
306 |
+
ws_plugin__s2member_nocache_constants(true);
|
307 |
/**/
|
308 |
return apply_filters ("ws_plugin__s2member_file_download_key", $key, get_defined_vars ());
|
309 |
}
|
includes/functions/force-ssl.inc.php
CHANGED
@@ -18,7 +18,7 @@ Function that forces SSL on specific Posts/Pages.
|
|
18 |
Attach to: add_action("template_redirect");
|
19 |
|
20 |
Triggered by Custom Field:
|
21 |
-
s2member_force_ssl =
|
22 |
*/
|
23 |
if (!function_exists ("ws_plugin__s2member_check_force_ssl"))
|
24 |
{
|
18 |
Attach to: add_action("template_redirect");
|
19 |
|
20 |
Triggered by Custom Field:
|
21 |
+
s2member_force_ssl = yes
|
22 |
*/
|
23 |
if (!function_exists ("ws_plugin__s2member_check_force_ssl"))
|
24 |
{
|
includes/functions/hide-some-systematics.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Function that hides some of the systematic use pages.
|
18 |
Attach to: add_filter("posts_where");
|
@@ -23,7 +23,7 @@ if (!function_exists ("ws_plugin__s2member_hide_some_systematics"))
|
|
23 |
{
|
24 |
global $wpdb; /* Need this to get the table name. */
|
25 |
/**/
|
26 |
-
eval
|
27 |
do_action ("ws_plugin__s2member_before_hide_some_systematics", get_defined_vars ());
|
28 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
29 |
/**/
|
@@ -31,7 +31,7 @@ if (!function_exists ("ws_plugin__s2member_hide_some_systematics"))
|
|
31 |
{
|
32 |
$where .= " AND " . $wpdb->posts . ".ID NOT IN ('" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] . "', '" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] . "', '" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] . "')";
|
33 |
/**/
|
34 |
-
eval
|
35 |
do_action ("ws_plugin__s2member_during_hide_some_systematics", get_defined_vars ());
|
36 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
37 |
}
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function that hides some of the systematic use pages.
|
18 |
Attach to: add_filter("posts_where");
|
23 |
{
|
24 |
global $wpdb; /* Need this to get the table name. */
|
25 |
/**/
|
26 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
27 |
do_action ("ws_plugin__s2member_before_hide_some_systematics", get_defined_vars ());
|
28 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
29 |
/**/
|
31 |
{
|
32 |
$where .= " AND " . $wpdb->posts . ".ID NOT IN ('" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"] . "', '" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] . "', '" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] . "')";
|
33 |
/**/
|
34 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
35 |
do_action ("ws_plugin__s2member_during_hide_some_systematics", get_defined_vars ());
|
36 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
37 |
}
|
includes/functions/is-systematic.inc.php
CHANGED
@@ -38,7 +38,7 @@ if (!function_exists ("ws_plugin__s2member_is_systematic_use_page"))
|
|
38 |
{
|
39 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
40 |
}
|
41 |
-
else if (preg_match ("/\/wp-login\.php/", $_SERVER["REQUEST_URI"]))
|
42 |
{
|
43 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
44 |
}
|
@@ -58,7 +58,7 @@ if (!function_exists ("ws_plugin__s2member_is_systematic_use_page"))
|
|
58 |
{
|
59 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
60 |
}
|
61 |
-
else if (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && (parse_url ($_SERVER["REQUEST_URI"], PHP_URL_PATH) === "/" || parse_url (rtrim ($_SERVER["REQUEST_URI"], "/"), PHP_URL_PATH) === parse_url (rtrim (get_bloginfo ("
|
62 |
{
|
63 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
64 |
}
|
38 |
{
|
39 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
40 |
}
|
41 |
+
else if (preg_match ("/\/wp-(signup|register|activate|login)\.php/", $_SERVER["REQUEST_URI"]))
|
42 |
{
|
43 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
44 |
}
|
58 |
{
|
59 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
60 |
}
|
61 |
+
else if (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && (parse_url ($_SERVER["REQUEST_URI"], PHP_URL_PATH) === "/" || parse_url (rtrim ($_SERVER["REQUEST_URI"], "/"), PHP_URL_PATH) === parse_url (rtrim (get_bloginfo ("wpurl"), "/"), PHP_URL_PATH)))
|
62 |
{
|
63 |
return ($is_systematic = apply_filters ("ws_plugin__s2member_is_systematic_use_page", true, get_defined_vars ()));
|
64 |
}
|
includes/functions/list-servers.inc.php
CHANGED
@@ -24,7 +24,7 @@ if (!function_exists ("ws_plugin__s2member_process_list_servers"))
|
|
24 |
do_action ("ws_plugin__s2member_before_process_list_servers", get_defined_vars ());
|
25 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
26 |
/**/
|
27 |
-
if (strlen ($level) && is_email ($email) && $opt_in) /* Must have a
|
28 |
{
|
29 |
if (($mailchimp_api_key = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"]))
|
30 |
if (($mailchimp_list_ids = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_mailchimp_list_ids"]))
|
24 |
do_action ("ws_plugin__s2member_before_process_list_servers", get_defined_vars ());
|
25 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
26 |
/**/
|
27 |
+
if (strlen ($level) && is_email ($email) && $opt_in) /* Must have a Level, a valid email, and opt-in permission. */
|
28 |
{
|
29 |
if (($mailchimp_api_key = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"]))
|
30 |
if (($mailchimp_list_ids = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_mailchimp_list_ids"]))
|
includes/functions/login-customizations.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Function for filtering the login logo url.
|
18 |
Attach to: add_filter("login_headerurl");
|
@@ -53,18 +53,19 @@ if (!function_exists ("ws_plugin__s2member_login_header_styles"))
|
|
53 |
{
|
54 |
$s = ""; /* Initialize here to give hooks a chance. */
|
55 |
/**/
|
56 |
-
eval
|
57 |
do_action ("ws_plugin__s2member_before_login_header_styles", get_defined_vars ());
|
58 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
59 |
/**/
|
60 |
$s .= "\n" . '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>' . "\n";
|
61 |
-
$s .= '<script type="text/javascript" src="' . get_bloginfo ("
|
62 |
/**/
|
63 |
$s .= "\n" . '<style type="text/css">' . "\n";
|
64 |
/**/
|
65 |
$s .= 'html, body { border: 0 !important; background: none !important; }' . "\n"; /* Clear borders & existing background. */
|
66 |
$s .= 'html { background-color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"] . ' !important; }' . "\n";
|
67 |
$s .= 'html { background-image: url(' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image"] . ') !important; }' . "\n";
|
|
|
68 |
/**/
|
69 |
$s .= 'p#backtoblog a, p#backtoblog a:hover, p#backtoblog a:active, p#backtoblog a:focus { color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . ' !important; text-shadow: 1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . ' !important; top: 15px !important; left: 15px !important; padding: 10px !important; border:1px solid #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ' !important; background-color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"] . ' !important; -moz-border-radius:3px !important; -webkit-border-radius:3px !important; border-radius:3px !important; }' . "\n";
|
70 |
/**/
|
@@ -83,7 +84,7 @@ if (!function_exists ("ws_plugin__s2member_login_header_styles"))
|
|
83 |
/**/
|
84 |
$s .= '</style>' . "\n\n";
|
85 |
/**/
|
86 |
-
eval
|
87 |
do_action ("ws_plugin__s2member_during_login_header_styles", get_defined_vars ());
|
88 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
89 |
/**/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function for filtering the login logo url.
|
18 |
Attach to: add_filter("login_headerurl");
|
53 |
{
|
54 |
$s = ""; /* Initialize here to give hooks a chance. */
|
55 |
/**/
|
56 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
57 |
do_action ("ws_plugin__s2member_before_login_header_styles", get_defined_vars ());
|
58 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
59 |
/**/
|
60 |
$s .= "\n" . '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>' . "\n";
|
61 |
+
$s .= '<script type="text/javascript" src="' . get_bloginfo ("wpurl") . '/?ws_plugin__s2member_js_w_globals=1&no-cache=' . urlencode (md5 (mt_rand ())) . '"></script>' . "\n";
|
62 |
/**/
|
63 |
$s .= "\n" . '<style type="text/css">' . "\n";
|
64 |
/**/
|
65 |
$s .= 'html, body { border: 0 !important; background: none !important; }' . "\n"; /* Clear borders & existing background. */
|
66 |
$s .= 'html { background-color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"] . ' !important; }' . "\n";
|
67 |
$s .= 'html { background-image: url(' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image"] . ') !important; }' . "\n";
|
68 |
+
$s .= 'html { background-repeat: ' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] . ' !important; }' . "\n";
|
69 |
/**/
|
70 |
$s .= 'p#backtoblog a, p#backtoblog a:hover, p#backtoblog a:active, p#backtoblog a:focus { color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . ' !important; text-shadow: 1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . ' !important; top: 15px !important; left: 15px !important; padding: 10px !important; border:1px solid #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ' !important; background-color: #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"] . ' !important; -moz-border-radius:3px !important; -webkit-border-radius:3px !important; border-radius:3px !important; }' . "\n";
|
71 |
/**/
|
84 |
/**/
|
85 |
$s .= '</style>' . "\n\n";
|
86 |
/**/
|
87 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
88 |
do_action ("ws_plugin__s2member_during_login_header_styles", get_defined_vars ());
|
89 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
90 |
/**/
|
includes/functions/login-redirection.inc.php
CHANGED
@@ -25,12 +25,23 @@ if (!function_exists ("ws_plugin__s2member_login_redirect"))
|
|
25 |
do_action ("ws_plugin__s2member_before_login_redirect", get_defined_vars ());
|
26 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
27 |
/**/
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
{
|
30 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
31 |
do_action ("ws_plugin__s2member_during_login_redirect", get_defined_vars ());
|
32 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
33 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
if (ws_plugin__s2member_ip_restrictions_ok ($_SERVER["REMOTE_ADDR"], strtolower ($username)))
|
35 |
{
|
36 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"])
|
25 |
do_action ("ws_plugin__s2member_before_login_redirect", get_defined_vars ());
|
26 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
27 |
/**/
|
28 |
+
$username = (!$username && is_object ($current_user = wp_get_current_user ())) ? $current_user->user_login : $username;
|
29 |
+
/* This additional check was added in case wp_signon() fires this event with empty $_POST credentials.
|
30 |
+
In this rare case, we can check to see if WordPress® is remembering a previously logged in User. */
|
31 |
+
/**/
|
32 |
+
if (!is_object ($user = new WP_User ($username)) || !($user_id = $user->ID) || !$user->has_cap ("edit_posts"))
|
33 |
{
|
34 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
35 |
do_action ("ws_plugin__s2member_during_login_redirect", get_defined_vars ());
|
36 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
37 |
/**/
|
38 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
|
39 |
+
if (function_exists ("ws_plugin__s2member_generate_password"))
|
40 |
+
{
|
41 |
+
delete_user_setting ("default_password_nag"); /* setcookie() */
|
42 |
+
update_user_option ($user_id, "default_password_nag", false, true);
|
43 |
+
}
|
44 |
+
/**/
|
45 |
if (ws_plugin__s2member_ip_restrictions_ok ($_SERVER["REMOTE_ADDR"], strtolower ($username)))
|
46 |
{
|
47 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"])
|
includes/functions/menu-pages.inc.php
CHANGED
@@ -18,15 +18,18 @@ Function for saving all options from any page.
|
|
18 |
*/
|
19 |
if (!function_exists ("ws_plugin__s2member_update_all_options"))
|
20 |
{
|
21 |
-
function ws_plugin__s2member_update_all_options ()
|
22 |
{
|
23 |
do_action ("ws_plugin__s2member_before_update_all_options", get_defined_vars ());
|
24 |
/**/
|
25 |
-
if (($nonce = $_POST["ws_plugin__s2member_options_save"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-options-save"))
|
26 |
{
|
|
|
|
|
27 |
$options = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]; /* Get current options. */
|
|
|
28 |
/**/
|
29 |
-
foreach ($
|
30 |
{
|
31 |
if (preg_match ("/^" . preg_quote ("ws_plugin__s2member", "/") . "/", $key)) /* Look for keys. */
|
32 |
{
|
@@ -34,7 +37,7 @@ if (!function_exists ("ws_plugin__s2member_update_all_options"))
|
|
34 |
{
|
35 |
update_option ("ws_plugin__s2member_configured", trim (stripslashes ($value))); /* Update this option separately. */
|
36 |
/**/
|
37 |
-
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["configured"] = trim (stripslashes ($value)); /* Update
|
38 |
}
|
39 |
else /* We need to place this option into the array. Here we remove the ws_plugin__s2member_ portion on the beginning. */
|
40 |
{
|
@@ -54,15 +57,24 @@ if (!function_exists ("ws_plugin__s2member_update_all_options"))
|
|
54 |
/**/
|
55 |
update_option ("ws_plugin__s2member_options", $options) . update_option ("ws_plugin__s2member_cache", array ());
|
56 |
/**/
|
57 |
-
if ($
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
61 |
/**/
|
62 |
-
|
|
|
|
|
|
|
|
|
63 |
/**/
|
64 |
if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
|
65 |
-
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
/**/
|
68 |
do_action ("ws_plugin__s2member_after_update_all_options", get_defined_vars ());
|
@@ -78,46 +90,66 @@ if (!function_exists ("ws_plugin__s2member_add_admin_options"))
|
|
78 |
{
|
79 |
function ws_plugin__s2member_add_admin_options ()
|
80 |
{
|
81 |
-
global $menu; /* Need this to work out positioning. */
|
82 |
-
/**/
|
83 |
do_action ("ws_plugin__s2member_before_add_admin_options", get_defined_vars ());
|
84 |
/**/
|
85 |
add_filter ("plugin_action_links", "_ws_plugin__s2member_add_settings_link", 10, 2);
|
86 |
/**/
|
87 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_create_menu_items", true, get_defined_vars ()))
|
88 |
{
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
/**/
|
92 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_paypal_ops_page", true, get_defined_vars ()))
|
93 |
-
add_submenu_page (
|
94 |
/**/
|
95 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_paypal_buttons_page", true, get_defined_vars ()))
|
96 |
-
add_submenu_page (
|
97 |
/**/
|
98 |
-
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_down_ops_page",
|
99 |
-
add_submenu_page (
|
100 |
/**/
|
101 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_trk_ops_page", true, get_defined_vars ()))
|
102 |
-
add_submenu_page (
|
103 |
/**/
|
104 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_els_ops_page", true, get_defined_vars ()))
|
105 |
-
add_submenu_page (
|
106 |
/**/
|
107 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_api_ops_page", true, get_defined_vars ()))
|
108 |
-
add_submenu_page (
|
109 |
/**/
|
110 |
-
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_scripting_page",
|
111 |
-
add_submenu_page (
|
112 |
/**/
|
113 |
-
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_bridges_page",
|
114 |
-
add_submenu_page (
|
115 |
/**/
|
116 |
-
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_info_page",
|
117 |
-
add_submenu_page (
|
118 |
/**/
|
119 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_start_page", true, get_defined_vars ()))
|
120 |
-
add_submenu_page (
|
121 |
}
|
122 |
/**/
|
123 |
do_action ("ws_plugin__s2member_after_add_admin_options", get_defined_vars ());
|
@@ -164,7 +196,7 @@ if (!function_exists ("ws_plugin__s2member_add_admin_scripts"))
|
|
164 |
wp_enqueue_script("jquery");
|
165 |
wp_enqueue_script("thickbox");
|
166 |
wp_enqueue_script("media-upload");
|
167 |
-
wp_enqueue_script ("ws-plugin--s2member-menu-pages", get_bloginfo ("
|
168 |
/**/
|
169 |
do_action ("ws_plugin__s2member_during_add_admin_scripts", get_defined_vars ());
|
170 |
}
|
@@ -187,7 +219,7 @@ if (!function_exists ("ws_plugin__s2member_add_admin_styles"))
|
|
187 |
if ($_GET["page"] && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
|
188 |
{
|
189 |
wp_enqueue_style("thickbox");
|
190 |
-
wp_enqueue_style ("ws-plugin--s2member-menu-pages", get_bloginfo ("
|
191 |
/**/
|
192 |
do_action ("ws_plugin__s2member_during_add_admin_styles", get_defined_vars ());
|
193 |
}
|
@@ -207,7 +239,7 @@ if (!function_exists ("ws_plugin__s2member_menu_pages_js"))
|
|
207 |
{
|
208 |
do_action ("ws_plugin__s2member_before_menu_pages_js", get_defined_vars ());
|
209 |
/**/
|
210 |
-
if ($_GET["ws_plugin__s2member_menu_pages_js"] && is_user_logged_in () && current_user_can ("
|
211 |
{
|
212 |
header("Content-Type: text/javascript; charset=utf-8");
|
213 |
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
|
@@ -242,7 +274,7 @@ if (!function_exists ("ws_plugin__s2member_menu_pages_css"))
|
|
242 |
{
|
243 |
do_action ("ws_plugin__s2member_before_menu_pages_css", get_defined_vars ());
|
244 |
/**/
|
245 |
-
if ($_GET["ws_plugin__s2member_menu_pages_css"] && is_user_logged_in () && current_user_can ("
|
246 |
{
|
247 |
header("Content-Type: text/css; charset=utf-8");
|
248 |
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
|
@@ -270,12 +302,64 @@ if (!function_exists ("ws_plugin__s2member_menu_pages_css"))
|
|
270 |
}
|
271 |
}
|
272 |
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
Function for building and handling the General Options page.
|
274 |
*/
|
275 |
if (!function_exists ("ws_plugin__s2member_options_page"))
|
276 |
{
|
277 |
function ws_plugin__s2member_options_page ()
|
278 |
{
|
|
|
|
|
279 |
do_action ("ws_plugin__s2member_before_options_page", get_defined_vars ());
|
280 |
/**/
|
281 |
ws_plugin__s2member_update_all_options ();
|
@@ -294,6 +378,8 @@ if (!function_exists ("ws_plugin__s2member_paypal_ops_page"))
|
|
294 |
{
|
295 |
function ws_plugin__s2member_paypal_ops_page ()
|
296 |
{
|
|
|
|
|
297 |
do_action ("ws_plugin__s2member_before_paypal_ops_page", get_defined_vars ());
|
298 |
/**/
|
299 |
ws_plugin__s2member_update_all_options ();
|
@@ -337,6 +423,8 @@ if (!function_exists ("ws_plugin__s2member_down_ops_page"))
|
|
337 |
{
|
338 |
function ws_plugin__s2member_down_ops_page ()
|
339 |
{
|
|
|
|
|
340 |
do_action ("ws_plugin__s2member_before_down_ops_page", get_defined_vars ());
|
341 |
/**/
|
342 |
ws_plugin__s2member_update_all_options ();
|
@@ -374,6 +462,8 @@ if (!function_exists ("ws_plugin__s2member_trk_ops_page"))
|
|
374 |
{
|
375 |
function ws_plugin__s2member_trk_ops_page ()
|
376 |
{
|
|
|
|
|
377 |
do_action ("ws_plugin__s2member_before_trk_ops_page", get_defined_vars ());
|
378 |
/**/
|
379 |
ws_plugin__s2member_update_all_options ();
|
@@ -392,6 +482,8 @@ if (!function_exists ("ws_plugin__s2member_els_ops_page"))
|
|
392 |
{
|
393 |
function ws_plugin__s2member_els_ops_page ()
|
394 |
{
|
|
|
|
|
395 |
do_action ("ws_plugin__s2member_before_els_ops_page", get_defined_vars ());
|
396 |
/**/
|
397 |
ws_plugin__s2member_update_all_options ();
|
@@ -410,6 +502,8 @@ if (!function_exists ("ws_plugin__s2member_api_ops_page"))
|
|
410 |
{
|
411 |
function ws_plugin__s2member_api_ops_page ()
|
412 |
{
|
|
|
|
|
413 |
do_action ("ws_plugin__s2member_before_api_ops_page", get_defined_vars ());
|
414 |
/**/
|
415 |
ws_plugin__s2member_update_all_options ();
|
@@ -428,6 +522,8 @@ if (!function_exists ("ws_plugin__s2member_paypal_buttons_page"))
|
|
428 |
{
|
429 |
function ws_plugin__s2member_paypal_buttons_page ()
|
430 |
{
|
|
|
|
|
431 |
do_action ("ws_plugin__s2member_before_paypal_buttons_page", get_defined_vars ());
|
432 |
/**/
|
433 |
if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]) /* Report error if PayPal® Options are not yet configured. */
|
@@ -447,6 +543,8 @@ if (!function_exists ("ws_plugin__s2member_scripting_page"))
|
|
447 |
{
|
448 |
function ws_plugin__s2member_scripting_page ()
|
449 |
{
|
|
|
|
|
450 |
do_action ("ws_plugin__s2member_before_scripting_page", get_defined_vars ());
|
451 |
/**/
|
452 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/scripting.inc.php";
|
@@ -463,6 +561,8 @@ if (!function_exists ("ws_plugin__s2member_bridges_page"))
|
|
463 |
{
|
464 |
function ws_plugin__s2member_bridges_page ()
|
465 |
{
|
|
|
|
|
466 |
do_action ("ws_plugin__s2member_before_bridges_page", get_defined_vars ());
|
467 |
/**/
|
468 |
if (($nonce = $_POST["ws_plugin__s2member_bridge_bbpress"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-bridge-bbpress"))
|
@@ -525,6 +625,8 @@ if (!function_exists ("ws_plugin__s2member_info_page"))
|
|
525 |
{
|
526 |
function ws_plugin__s2member_info_page ()
|
527 |
{
|
|
|
|
|
528 |
do_action ("ws_plugin__s2member_before_info_page", get_defined_vars ());
|
529 |
/**/
|
530 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/info.inc.php";
|
@@ -541,6 +643,8 @@ if (!function_exists ("ws_plugin__s2member_start_page"))
|
|
541 |
{
|
542 |
function ws_plugin__s2member_start_page ()
|
543 |
{
|
|
|
|
|
544 |
do_action ("ws_plugin__s2member_before_start_page", get_defined_vars ());
|
545 |
/**/
|
546 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/start.inc.php";
|
18 |
*/
|
19 |
if (!function_exists ("ws_plugin__s2member_update_all_options"))
|
20 |
{
|
21 |
+
function ws_plugin__s2member_update_all_options ($new_options = FALSE, $verified = FALSE, $update_other = TRUE, $display_notices = TRUE, $enqueue_notices = FALSE)
|
22 |
{
|
23 |
do_action ("ws_plugin__s2member_before_update_all_options", get_defined_vars ());
|
24 |
/**/
|
25 |
+
if ($verified || (($nonce = $_POST["ws_plugin__s2member_options_save"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-options-save")))
|
26 |
{
|
27 |
+
unset($_POST["ws_plugin__s2member_options_save"]); /* Unset this key before we begin. */
|
28 |
+
/**/
|
29 |
$options = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]; /* Get current options. */
|
30 |
+
$new_options = (is_array ($new_options)) ? $new_options : $_POST; /* New! */
|
31 |
/**/
|
32 |
+
foreach ($new_options as $key => $value) /* Go through each POST variable and look for s2member. */
|
33 |
{
|
34 |
if (preg_match ("/^" . preg_quote ("ws_plugin__s2member", "/") . "/", $key)) /* Look for keys. */
|
35 |
{
|
37 |
{
|
38 |
update_option ("ws_plugin__s2member_configured", trim (stripslashes ($value))); /* Update this option separately. */
|
39 |
/**/
|
40 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["configured"] = trim (stripslashes ($value)); /* Update on-the-fly. */
|
41 |
}
|
42 |
else /* We need to place this option into the array. Here we remove the ws_plugin__s2member_ portion on the beginning. */
|
43 |
{
|
57 |
/**/
|
58 |
update_option ("ws_plugin__s2member_options", $options) . update_option ("ws_plugin__s2member_cache", array ());
|
59 |
/**/
|
60 |
+
if ($update_other === true || (is_array ($update_other) && in_array ("auto_eot_system", $update_other)))
|
61 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 1)
|
62 |
+
ws_plugin__s2member_add_auto_eot_system (); /* 1 == WP-Cron. */
|
63 |
+
else /* Otherwise, the Auto-EOT System via WP-Cron is disabled. */
|
64 |
+
ws_plugin__s2member_delete_auto_eot_system ();
|
65 |
/**/
|
66 |
+
if ($display_notices === true || (is_array ($display_notices) && in_array ("options_saved", $display_notices)))
|
67 |
+
if ($enqueue_notices === true || (is_array ($enqueue_notices) && in_array ("options_saved", $enqueue_notices)))
|
68 |
+
ws_plugin__s2member_enqueue_admin_notice('<strong>Options saved.</strong>');
|
69 |
+
else /* Otherwise, we can go ahead and display the notice immediately. Not queuing. */
|
70 |
+
ws_plugin__s2member_display_admin_notice('<strong>Options saved.</strong>');
|
71 |
/**/
|
72 |
if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
|
73 |
+
if ($display_notices === true || (is_array ($display_notices) && in_array ("membership_options_page_warning", $display_notices)))
|
74 |
+
if ($enqueue_notices === true || (is_array ($enqueue_notices) && in_array ("membership_options_page_warning", $enqueue_notices)))
|
75 |
+
ws_plugin__s2member_enqueue_admin_notice ('<strong>NOTE:</strong> s2Member security restrictions will NOT be enforced until you\'ve configured a Membership Options Page. See: <code>s2Member -> General Options -> Membership Options Page</code>.', false, true);
|
76 |
+
else /* Otherwise, we can go ahead and display the notice immediately. Not queuing. */
|
77 |
+
ws_plugin__s2member_display_admin_notice ('<strong>NOTE:</strong> s2Member security restrictions will NOT be enforced until you\'ve configured a Membership Options Page. See: <code>s2Member -> General Options -> Membership Options Page</code>.', true);
|
78 |
}
|
79 |
/**/
|
80 |
do_action ("ws_plugin__s2member_after_update_all_options", get_defined_vars ());
|
90 |
{
|
91 |
function ws_plugin__s2member_add_admin_options ()
|
92 |
{
|
|
|
|
|
93 |
do_action ("ws_plugin__s2member_before_add_admin_options", get_defined_vars ());
|
94 |
/**/
|
95 |
add_filter ("plugin_action_links", "_ws_plugin__s2member_add_settings_link", 10, 2);
|
96 |
/**/
|
97 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_create_menu_items", true, get_defined_vars ()))
|
98 |
{
|
99 |
+
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ())
|
100 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"] = array (); /* Clear right side. */
|
101 |
+
/**/
|
102 |
+
if (is_multisite () && is_main_site ()) /* Re-organize menu whenever Multisite Networking is enabled; and we're on the Main Site. */
|
103 |
+
{
|
104 |
+
$menu = "ws-plugin--s2member-mms-options"; /* Used below for nesting additional sub-menu pages. */
|
105 |
+
/**/
|
106 |
+
add_menu_page ("s2Member Options", "s2Member", "create_users", $menu, "ws_plugin__s2member_mms_options_page", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/brand-favicon.png");
|
107 |
+
/**/
|
108 |
+
add_submenu_page ($menu, "s2Member Multisite ( Main Site Configuration )", "Multisite (Config)", "create_users", "ws-plugin--s2member-mms-options", "ws_plugin__s2member_mms_options_page");
|
109 |
+
add_submenu_page ($menu, "s2Member General Options", "General Options", "create_users", "ws-plugin--s2member-options", "ws_plugin__s2member_options_page");
|
110 |
+
}
|
111 |
+
else /* Otherwise, we use the standard menu configuration here. The parent menu is the General Options for s2Member in this case. */
|
112 |
+
{
|
113 |
+
$menu = "ws-plugin--s2member-options"; /* Used below for nesting additional sub-menu pages. */
|
114 |
+
/**/
|
115 |
+
add_menu_page ("s2Member Options", "s2Member", "create_users", $menu, "ws_plugin__s2member_options_page", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/brand-favicon.png");
|
116 |
+
/**/
|
117 |
+
add_submenu_page ($menu, "s2Member General Options", "General Options", "create_users", "ws-plugin--s2member-options", "ws_plugin__s2member_options_page");
|
118 |
+
(!is_multisite ()) ? add_submenu_page ($menu, "s2Member Multisite ( NOT enabled )", "Multisite Config", "create_users", "ws-plugin--s2member-mms-options", "ws_plugin__s2member_mms_options_page") : null;
|
119 |
+
}
|
120 |
+
/**/
|
121 |
+
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_new_user_page", true, get_defined_vars ())) /* Shortcut. */
|
122 |
+
add_submenu_page ($menu, "s2Member / Add A Member", "Add A Member", "create_users", "user-new.php"); /* Shortcut to user-new.php. */
|
123 |
/**/
|
124 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_paypal_ops_page", true, get_defined_vars ()))
|
125 |
+
add_submenu_page ($menu, "s2Member PayPal Options", "PayPal® Options", "create_users", "ws-plugin--s2member-paypal-ops", "ws_plugin__s2member_paypal_ops_page");
|
126 |
/**/
|
127 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_paypal_buttons_page", true, get_defined_vars ()))
|
128 |
+
add_submenu_page ($menu, "s2Member PayPal® Buttons", "PayPal® Buttons", "create_users", "ws-plugin--s2member-paypal-buttons", "ws_plugin__s2member_paypal_buttons_page");
|
129 |
/**/
|
130 |
+
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_down_ops_page", (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()), get_defined_vars ()))
|
131 |
+
add_submenu_page ($menu, "s2Member File Download Options", "Download Options", "create_users", "ws-plugin--s2member-down-ops", "ws_plugin__s2member_down_ops_page");
|
132 |
/**/
|
133 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_trk_ops_page", true, get_defined_vars ()))
|
134 |
+
add_submenu_page ($menu, "s2Member API / Tracking", "API / Tracking", "create_users", "ws-plugin--s2member-trk-ops", "ws_plugin__s2member_trk_ops_page");
|
135 |
/**/
|
136 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_els_ops_page", true, get_defined_vars ()))
|
137 |
+
add_submenu_page ($menu, "s2Member API / List Servers", "API / List Servers", "create_users", "ws-plugin--s2member-els-ops", "ws_plugin__s2member_els_ops_page");
|
138 |
/**/
|
139 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_api_ops_page", true, get_defined_vars ()))
|
140 |
+
add_submenu_page ($menu, "s2Member API / Notifications", "API / Notifications", "create_users", "ws-plugin--s2member-api-ops", "ws_plugin__s2member_api_ops_page");
|
141 |
/**/
|
142 |
+
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_scripting_page", (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()), get_defined_vars ()))
|
143 |
+
add_submenu_page ($menu, "s2Member API / Scripting", "API / Scripting", "create_users", "ws-plugin--s2member-scripting", "ws_plugin__s2member_scripting_page");
|
144 |
/**/
|
145 |
+
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_bridges_page", (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()), get_defined_vars ()))
|
146 |
+
add_submenu_page ($menu, "s2Member Bridge Integrations", "API / Bridges", "create_users", "ws-plugin--s2member-bridges", "ws_plugin__s2member_bridges_page");
|
147 |
/**/
|
148 |
+
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_info_page", (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()), get_defined_vars ()))
|
149 |
+
add_submenu_page ($menu, "s2Member Information", "s2Member Info", "create_users", "ws-plugin--s2member-info", "ws_plugin__s2member_info_page");
|
150 |
/**/
|
151 |
if (apply_filters ("ws_plugin__s2member_during_add_admin_options_add_start_page", true, get_defined_vars ()))
|
152 |
+
add_submenu_page ($menu, "s2Member Quick-Start Guide", "Quick-Start Guide", "create_users", "ws-plugin--s2member-start", "ws_plugin__s2member_start_page");
|
153 |
}
|
154 |
/**/
|
155 |
do_action ("ws_plugin__s2member_after_add_admin_options", get_defined_vars ());
|
196 |
wp_enqueue_script("jquery");
|
197 |
wp_enqueue_script("thickbox");
|
198 |
wp_enqueue_script("media-upload");
|
199 |
+
wp_enqueue_script ("ws-plugin--s2member-menu-pages", get_bloginfo ("wpurl") . "/?ws_plugin__s2member_menu_pages_js=1", array ("jquery", "thickbox", "media-upload"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);
|
200 |
/**/
|
201 |
do_action ("ws_plugin__s2member_during_add_admin_scripts", get_defined_vars ());
|
202 |
}
|
219 |
if ($_GET["page"] && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
|
220 |
{
|
221 |
wp_enqueue_style("thickbox");
|
222 |
+
wp_enqueue_style ("ws-plugin--s2member-menu-pages", get_bloginfo ("wpurl") . "/?ws_plugin__s2member_menu_pages_css=1", array ("thickbox"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"], "all");
|
223 |
/**/
|
224 |
do_action ("ws_plugin__s2member_during_add_admin_styles", get_defined_vars ());
|
225 |
}
|
239 |
{
|
240 |
do_action ("ws_plugin__s2member_before_menu_pages_js", get_defined_vars ());
|
241 |
/**/
|
242 |
+
if ($_GET["ws_plugin__s2member_menu_pages_js"] && is_user_logged_in () && current_user_can ("create_users"))
|
243 |
{
|
244 |
header("Content-Type: text/javascript; charset=utf-8");
|
245 |
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
|
274 |
{
|
275 |
do_action ("ws_plugin__s2member_before_menu_pages_css", get_defined_vars ());
|
276 |
/**/
|
277 |
+
if ($_GET["ws_plugin__s2member_menu_pages_css"] && is_user_logged_in () && current_user_can ("create_users"))
|
278 |
{
|
279 |
header("Content-Type: text/css; charset=utf-8");
|
280 |
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
|
302 |
}
|
303 |
}
|
304 |
/*
|
305 |
+
Function for building and handling the Main Multisite Options page.
|
306 |
+
*/
|
307 |
+
if (!function_exists ("ws_plugin__s2member_mms_options_page"))
|
308 |
+
{
|
309 |
+
function ws_plugin__s2member_mms_options_page ()
|
310 |
+
{
|
311 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
312 |
+
/**/
|
313 |
+
do_action ("ws_plugin__s2member_before_mms_options_page", get_defined_vars ());
|
314 |
+
/**/
|
315 |
+
ws_plugin__s2member_update_all_options ();
|
316 |
+
/**/
|
317 |
+
if (($nonce = $_POST["ws_plugin__s2member_mms_options_patch_files"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-mms-options-patch-files"))
|
318 |
+
{
|
319 |
+
$wp_login_file = ABSPATH . "wp-login.php";
|
320 |
+
$wp_login_section = "/([\r\n\t\s ]+)(wp_redirect( *?)\(( *?)apply_filters( *?)\(( *?)['\"]wp_signup_location['\"],( *?)get_bloginfo( *?)\(['\"]wpurl['\"]\)( *?)\.( *?)['\"]\/wp-signup\.php['\"]( *?)\)( *?)\);)([\r\n\t\s ]+)(exit;)/";
|
321 |
+
$wp_login_replace = "\n\t\t// Modified for full plugin compatiblity.\n\t\t//wp_redirect( apply_filters( 'wp_signup_location', get_bloginfo('wpurl') . '/wp-signup.php' ) );\n\t\t//exit;";
|
322 |
+
/**/
|
323 |
+
if (file_exists ($wp_login_file) && is_writable ($wp_login_file) && ($wp_login = file_get_contents ($wp_login_file)) && file_put_contents ($wp_login_file, preg_replace ($wp_login_section, $wp_login_replace, $wp_login)))
|
324 |
+
ws_plugin__s2member_display_admin_notice('Your <code>/wp-login.php</code> file was patched successfully.');
|
325 |
+
else /* Otherwise, we need to report that /wp-login.php could NOT be updated. Possibly a permissions error. */
|
326 |
+
ws_plugin__s2member_display_admin_notice ('Your <code>wp-login.php</code> file could NOT be patched. File NOT writable.', true);
|
327 |
+
/**/
|
328 |
+
$load_file = ABSPATH . WPINC . "/load.php";
|
329 |
+
$load_section = "/([\r\n\t\s ]+)(if( *?)\(( *?)empty( *?)\(( *?)\\\$active_plugins( *?)\)( *?)\|\|( *?)defined( *?)\(( *?)['\"]WP_INSTALLING['\"]( *?)\)( *?)\))/";
|
330 |
+
$load_replace = "\n\n\t// Modified for full plugin compatiblity.\n\t//if ( empty( \$active_plugins ) || defined( 'WP_INSTALLING' ) )\n\tif ( empty( \$active_plugins ) || ( defined( 'WP_INSTALLING' ) && !preg_match(\"/\/wp-activate\.php/\", \$_SERVER[\"REQUEST_URI\"]) ) )";
|
331 |
+
/**/
|
332 |
+
if (file_exists ($load_file) && is_writable ($load_file) && ($load = file_get_contents ($load_file)) && file_put_contents ($load_file, preg_replace ($load_section, $load_replace, $load)))
|
333 |
+
ws_plugin__s2member_display_admin_notice('Your <code>/wp-includes/load.php</code> file was patched successfully.');
|
334 |
+
else /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Possibly a permissions error. */
|
335 |
+
ws_plugin__s2member_display_admin_notice ('Your <code>/wp-includes/load.php</code> file could NOT be patched. File NOT writable.', true);
|
336 |
+
/**/
|
337 |
+
$user_new_file = ABSPATH . "wp-admin/user-new.php";
|
338 |
+
$user_new_section = "/([\r\n\t\s ]+)(wpmu_signup_user( *?)\(( *?)\\\$new_user_login,( *?)\\\$_REQUEST\[( *?)'email'( *?)\],( *?)array( *?)\(( *?)'add_to_blog'( *?)\=\>( *?)\\\$wpdb->blogid,( *?)'new_role'( *?)\=\>( *?)\\\$_REQUEST\[( *?)'role'( *?)\]( *?)\)( *?)\);)/";
|
339 |
+
$user_new_replace = "\n\t\t\t\t// Modified for full plugin compatiblity.\n\t\t\t\t//wpmu_signup_user( \$new_user_login, \$_REQUEST[ 'email' ], array( 'add_to_blog' => \$wpdb->blogid, 'new_role' => \$_REQUEST[ 'role' ] ) );\n\t\t\t\twpmu_signup_user( \$new_user_login, \$_REQUEST[ 'email' ], apply_filters( 'add_signup_meta', array( 'add_to_blog' => \$wpdb->blogid, 'new_role' => \$_REQUEST[ 'role' ] ) ) );";
|
340 |
+
/**/
|
341 |
+
if (file_exists ($user_new_file) && is_writable ($user_new_file) && ($user_new = file_get_contents ($user_new_file)) && file_put_contents ($user_new_file, preg_replace ($user_new_section, $user_new_replace, $user_new)))
|
342 |
+
ws_plugin__s2member_display_admin_notice('Your <code>/wp-admin/user-new.php</code> file was patched successfully.');
|
343 |
+
else /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Possibly a permissions error. */
|
344 |
+
ws_plugin__s2member_display_admin_notice ('Your <code>/wp-admin/user-new.php</code> file could NOT be patched. File NOT writable.', true);
|
345 |
+
}
|
346 |
+
/**/
|
347 |
+
include_once dirname (dirname (__FILE__)) . "/menu-pages/mms-options.inc.php";
|
348 |
+
/**/
|
349 |
+
do_action ("ws_plugin__s2member_after_mms_options_page", get_defined_vars ());
|
350 |
+
/**/
|
351 |
+
return;
|
352 |
+
}
|
353 |
+
}
|
354 |
+
/*
|
355 |
Function for building and handling the General Options page.
|
356 |
*/
|
357 |
if (!function_exists ("ws_plugin__s2member_options_page"))
|
358 |
{
|
359 |
function ws_plugin__s2member_options_page ()
|
360 |
{
|
361 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
362 |
+
/**/
|
363 |
do_action ("ws_plugin__s2member_before_options_page", get_defined_vars ());
|
364 |
/**/
|
365 |
ws_plugin__s2member_update_all_options ();
|
378 |
{
|
379 |
function ws_plugin__s2member_paypal_ops_page ()
|
380 |
{
|
381 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
382 |
+
/**/
|
383 |
do_action ("ws_plugin__s2member_before_paypal_ops_page", get_defined_vars ());
|
384 |
/**/
|
385 |
ws_plugin__s2member_update_all_options ();
|
423 |
{
|
424 |
function ws_plugin__s2member_down_ops_page ()
|
425 |
{
|
426 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
427 |
+
/**/
|
428 |
do_action ("ws_plugin__s2member_before_down_ops_page", get_defined_vars ());
|
429 |
/**/
|
430 |
ws_plugin__s2member_update_all_options ();
|
462 |
{
|
463 |
function ws_plugin__s2member_trk_ops_page ()
|
464 |
{
|
465 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
466 |
+
/**/
|
467 |
do_action ("ws_plugin__s2member_before_trk_ops_page", get_defined_vars ());
|
468 |
/**/
|
469 |
ws_plugin__s2member_update_all_options ();
|
482 |
{
|
483 |
function ws_plugin__s2member_els_ops_page ()
|
484 |
{
|
485 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
486 |
+
/**/
|
487 |
do_action ("ws_plugin__s2member_before_els_ops_page", get_defined_vars ());
|
488 |
/**/
|
489 |
ws_plugin__s2member_update_all_options ();
|
502 |
{
|
503 |
function ws_plugin__s2member_api_ops_page ()
|
504 |
{
|
505 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
506 |
+
/**/
|
507 |
do_action ("ws_plugin__s2member_before_api_ops_page", get_defined_vars ());
|
508 |
/**/
|
509 |
ws_plugin__s2member_update_all_options ();
|
522 |
{
|
523 |
function ws_plugin__s2member_paypal_buttons_page ()
|
524 |
{
|
525 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
526 |
+
/**/
|
527 |
do_action ("ws_plugin__s2member_before_paypal_buttons_page", get_defined_vars ());
|
528 |
/**/
|
529 |
if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]) /* Report error if PayPal® Options are not yet configured. */
|
543 |
{
|
544 |
function ws_plugin__s2member_scripting_page ()
|
545 |
{
|
546 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
547 |
+
/**/
|
548 |
do_action ("ws_plugin__s2member_before_scripting_page", get_defined_vars ());
|
549 |
/**/
|
550 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/scripting.inc.php";
|
561 |
{
|
562 |
function ws_plugin__s2member_bridges_page ()
|
563 |
{
|
564 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
565 |
+
/**/
|
566 |
do_action ("ws_plugin__s2member_before_bridges_page", get_defined_vars ());
|
567 |
/**/
|
568 |
if (($nonce = $_POST["ws_plugin__s2member_bridge_bbpress"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-bridge-bbpress"))
|
625 |
{
|
626 |
function ws_plugin__s2member_info_page ()
|
627 |
{
|
628 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
629 |
+
/**/
|
630 |
do_action ("ws_plugin__s2member_before_info_page", get_defined_vars ());
|
631 |
/**/
|
632 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/info.inc.php";
|
643 |
{
|
644 |
function ws_plugin__s2member_start_page ()
|
645 |
{
|
646 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
647 |
+
/**/
|
648 |
do_action ("ws_plugin__s2member_before_start_page", get_defined_vars ());
|
649 |
/**/
|
650 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/start.inc.php";
|
includes/functions/meta-boxes.inc.php
ADDED
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
4 |
+
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
5 |
+
|
6 |
+
Released under the terms of the GNU General Public License.
|
7 |
+
You should have received a copy of the GNU General Public License,
|
8 |
+
along with this software. In the main directory, see: /licensing/
|
9 |
+
If not, see: <http://www.gnu.org/licenses/>.
|
10 |
+
*/
|
11 |
+
/*
|
12 |
+
Direct access denial.
|
13 |
+
*/
|
14 |
+
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
+
/*
|
17 |
+
Function adds meta boxes to Post/Page editing stations.
|
18 |
+
Attach to: add_action("admin_menu");
|
19 |
+
*/
|
20 |
+
if (!function_exists ("ws_plugin__s2member_add_meta_boxes"))
|
21 |
+
{
|
22 |
+
function ws_plugin__s2member_add_meta_boxes ()
|
23 |
+
{
|
24 |
+
do_action ("ws_plugin__s2member_before_add_meta_boxes", get_defined_vars ());
|
25 |
+
/**/
|
26 |
+
add_meta_box ("ws-plugin--s2member-security", "s2Member", "ws_plugin__s2member_security_meta_box", "page", "side", "high");
|
27 |
+
add_meta_box ("ws-plugin--s2member-security", "s2Member", "ws_plugin__s2member_security_meta_box", "post", "side", "high");
|
28 |
+
add_meta_box ("ws-plugin--s2member-security", "s2Member", "ws_plugin__s2member_security_meta_box", "custom_post_type", "side", "high");
|
29 |
+
/**/
|
30 |
+
do_action ("ws_plugin__s2member_after_add_meta_boxes", get_defined_vars ());
|
31 |
+
/**/
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
/*
|
36 |
+
Function adds meta boxes to Post/Page editing stations.
|
37 |
+
Attach to: add_action("admin_menu");
|
38 |
+
*/
|
39 |
+
if (!function_exists ("ws_plugin__s2member_security_meta_box"))
|
40 |
+
{
|
41 |
+
function ws_plugin__s2member_security_meta_box ($post = FALSE)
|
42 |
+
{
|
43 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
44 |
+
do_action ("ws_plugin__s2member_before_security_meta_box", get_defined_vars ());
|
45 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
46 |
+
/**/
|
47 |
+
if (is_object ($post) && ($post_id = $post->ID) && (($post->post_type === "page" && current_user_can ("edit_page", $post_id)) || current_user_can ("edit_post", $post_id)))
|
48 |
+
{
|
49 |
+
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save" id="ws-plugin--s2member-security-meta-box-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-security-meta-box-save")) . '" />' . "\n";
|
50 |
+
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save_id" id="ws-plugin--s2member-security-meta-box-save-id" value="' . esc_attr ($post_id) . '" />' . "\n";
|
51 |
+
/**/
|
52 |
+
if ($post->post_type === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
|
53 |
+
{
|
54 |
+
$pages["0"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"]);
|
55 |
+
$pages["1"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"]);
|
56 |
+
$pages["2"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"]);
|
57 |
+
$pages["3"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"]);
|
58 |
+
$pages["4"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"]);
|
59 |
+
/**/
|
60 |
+
echo '<p style="margin-left:2px;"><strong>Page Level Restriction?</strong></p>' . "\n";
|
61 |
+
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
|
62 |
+
echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
|
63 |
+
echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
|
64 |
+
echo ($pages["0"] !== array ("all")) ? '<option value="0"' . ((in_array ($page_id, $pages["0"])) ? ' selected="selected"' : '') . '>Require Level# 0 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #0 ( already protects "all" Pages )</option>';
|
65 |
+
echo ($pages["1"] !== array ("all")) ? '<option value="1"' . ((in_array ($page_id, $pages["1"])) ? ' selected="selected"' : '') . '>Require Level# 1 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #1 ( already protects "all" Pages )</option>';
|
66 |
+
echo ($pages["2"] !== array ("all")) ? '<option value="2"' . ((in_array ($page_id, $pages["2"])) ? ' selected="selected"' : '') . '>Require Level# 2 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #2 ( already protects "all" Pages )</option>';
|
67 |
+
echo ($pages["3"] !== array ("all")) ? '<option value="3"' . ((in_array ($page_id, $pages["3"])) ? ' selected="selected"' : '') . '>Require Level# 3 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #3 ( already protects "all" Pages )</option>';
|
68 |
+
echo ($pages["4"] !== array ("all")) ? '<option value="4"' . ((in_array ($page_id, $pages["4"])) ? ' selected="selected"' : '') . '>Require Level# 4 ( highest level )</option>' . "\n" : '<option value="" disabled="disabled">Level #4 ( already protects "all" Pages )</option>';
|
69 |
+
echo '</select><br /><small>* see: <code>General Options -> Page Level Access</code></small>' . "\n";
|
70 |
+
/**/
|
71 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
72 |
+
/* ^ Will change once Custom Capabilities are compatible with a Blog Farm. */
|
73 |
+
{
|
74 |
+
echo '<p style="margin-top:15px; margin-left:2px;"><strong>Require Custom Capabilities?</strong></p>' . "\n";
|
75 |
+
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-ccaps">Custom Capabilities?</label>' . "\n";
|
76 |
+
echo '<input type="text" name="ws_plugin__s2member_security_meta_box_ccaps" id="ws-plugin--s2member-security-meta-box-ccaps" value="' . format_to_edit (implode (",", (array)get_post_meta ($page_id, "s2member_ccaps_req", true))) . '" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" style="width:99%;" />' . "\n";
|
77 |
+
echo '<br /><small>* see: <code>API Scripting -> Custom Capabilities</code></small>' . "\n";
|
78 |
+
}
|
79 |
+
}
|
80 |
+
else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
|
81 |
+
{
|
82 |
+
$posts["0"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_posts"]);
|
83 |
+
$posts["1"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"]);
|
84 |
+
$posts["2"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"]);
|
85 |
+
$posts["3"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"]);
|
86 |
+
$posts["4"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"]);
|
87 |
+
/**/
|
88 |
+
echo '<p style="margin-left:2px;"><strong>Post Level Restriction?</strong></p>' . "\n"; /* This allows a site owner to automatically add a Page/Post into their s2Member options. */
|
89 |
+
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
|
90 |
+
echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
|
91 |
+
echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
|
92 |
+
echo ($posts["0"] !== array ("all")) ? '<option value="0"' . ((in_array ($post_id, $posts["0"])) ? ' selected="selected"' : '') . '>Require Level# 0 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #0 ( already protects "all" Posts )</option>';
|
93 |
+
echo ($posts["1"] !== array ("all")) ? '<option value="1"' . ((in_array ($post_id, $posts["1"])) ? ' selected="selected"' : '') . '>Require Level# 1 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #1 ( already protects "all" Posts )</option>';
|
94 |
+
echo ($posts["2"] !== array ("all")) ? '<option value="2"' . ((in_array ($post_id, $posts["2"])) ? ' selected="selected"' : '') . '>Require Level# 2 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #2 ( already protects "all" Posts )</option>';
|
95 |
+
echo ($posts["3"] !== array ("all")) ? '<option value="3"' . ((in_array ($post_id, $posts["3"])) ? ' selected="selected"' : '') . '>Require Level# 3 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #3 ( already protects "all" Posts )</option>';
|
96 |
+
echo ($posts["4"] !== array ("all")) ? '<option value="4"' . ((in_array ($post_id, $posts["4"])) ? ' selected="selected"' : '') . '>Require Level# 4 ( highest level )</option>' . "\n" : '<option value="" disabled="disabled">Level #4 ( already protects "all" Posts )</option>';
|
97 |
+
echo '</select><br /><small>* see: <code>General Options -> Post Level Access</code></small>' . "\n";
|
98 |
+
/**/
|
99 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
100 |
+
/* ^ Will change once Custom Capabilities are compatible with a Blog Farm. */
|
101 |
+
{
|
102 |
+
echo '<p style="margin-top:15px; margin-left:2px;"><strong>Require Custom Capabilities?</strong></p>' . "\n";
|
103 |
+
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-ccaps">Custom Capabilities?</label>' . "\n";
|
104 |
+
echo '<input type="text" name="ws_plugin__s2member_security_meta_box_ccaps" id="ws-plugin--s2member-security-meta-box-ccaps" value="' . format_to_edit (implode (",", (array)get_post_meta ($post_id, "s2member_ccaps_req", true))) . '" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" style="width:99%;" />' . "\n";
|
105 |
+
echo '<br /><small>* see: <code>API Scripting -> Custom Capabilities</code></small>' . "\n";
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
109 |
+
/**/
|
110 |
+
do_action ("ws_plugin__s2member_after_security_meta_box", get_defined_vars ());
|
111 |
+
/**/
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
/*
|
116 |
+
Function save data entered into meta boxes,
|
117 |
+
on Post/Page editing stations.
|
118 |
+
Attach to: add_action("save_post");
|
119 |
+
*/
|
120 |
+
if (!function_exists ("ws_plugin__s2member_save_meta_boxes"))
|
121 |
+
{
|
122 |
+
function ws_plugin__s2member_save_meta_boxes ($post_id = FALSE)
|
123 |
+
{
|
124 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
125 |
+
do_action ("ws_plugin__s2member_before_save_meta_boxes", get_defined_vars ());
|
126 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
127 |
+
/**/
|
128 |
+
if ($post_id && ($nonce = $_POST["ws_plugin__s2member_security_meta_box_save"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-security-meta-box-save"))
|
129 |
+
if ($post_id == $_POST["ws_plugin__s2member_security_meta_box_save_id"]) /* Do NOT process historical revisions. */
|
130 |
+
/* We do NOT process historical revisions here; because it causes confusion in the General Options panel for s2Member. */
|
131 |
+
{
|
132 |
+
$_p = ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST)); /* Clean up all _POST vars; making a local working copy of the array. */
|
133 |
+
/**/
|
134 |
+
if (($_p["post_type"] === "page" && current_user_can ("edit_page", $post_id)) || current_user_can ("edit_post", $post_id))
|
135 |
+
{
|
136 |
+
if ($_p["post_type"] === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
|
137 |
+
{
|
138 |
+
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. It CAN be empty. */
|
139 |
+
{
|
140 |
+
$pages["0"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_pages"]));
|
141 |
+
$pages["1"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"]));
|
142 |
+
$pages["2"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"]));
|
143 |
+
$pages["3"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"]));
|
144 |
+
$pages["4"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"]));
|
145 |
+
/**/
|
146 |
+
if (($i = array_search ($page_id, $pages["0"])) !== false) /* Remove $page_id from existing options. */
|
147 |
+
unset ($pages["0"][$i]);
|
148 |
+
else if (($i = array_search ($page_id, $pages["1"])) !== false)
|
149 |
+
unset ($pages["1"][$i]);
|
150 |
+
else if (($i = array_search ($page_id, $pages["2"])) !== false)
|
151 |
+
unset ($pages["2"][$i]);
|
152 |
+
else if (($i = array_search ($page_id, $pages["3"])) !== false)
|
153 |
+
unset ($pages["3"][$i]);
|
154 |
+
else if (($i = array_search ($page_id, $pages["4"])) !== false)
|
155 |
+
unset ($pages["4"][$i]);
|
156 |
+
/**/
|
157 |
+
if (strlen ($_p["ws_plugin__s2member_security_meta_box_level"]) && is_array ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]))
|
158 |
+
if (!$pages[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
|
159 |
+
array_push ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]], $page_id);
|
160 |
+
/**/
|
161 |
+
$new_options = array_merge ((array)$new_options, array ("ws_plugin__s2member_level0_pages" => implode (",", $pages[0]), "ws_plugin__s2member_level1_pages" => implode (",", $pages[1]), "ws_plugin__s2member_level2_pages" => implode (",", $pages[2]), "ws_plugin__s2member_level3_pages" => implode (",", $pages[3]), "ws_plugin__s2member_level4_pages" => implode (",", $pages[4])));
|
162 |
+
/**/
|
163 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
164 |
+
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
|
165 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
166 |
+
/**/
|
167 |
+
ws_plugin__s2member_update_all_options ($new_options, true, false, array ("membership_options_page_warning"), true);
|
168 |
+
}
|
169 |
+
}
|
170 |
+
/**/
|
171 |
+
else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
|
172 |
+
{
|
173 |
+
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. It CAN be empty. */
|
174 |
+
{
|
175 |
+
$posts["0"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_posts"]));
|
176 |
+
$posts["1"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"]));
|
177 |
+
$posts["2"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"]));
|
178 |
+
$posts["3"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"]));
|
179 |
+
$posts["4"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"]));
|
180 |
+
/**/
|
181 |
+
if (($i = array_search ($post_id, $posts["0"])) !== false) /* Remove $post_id from existing options. */
|
182 |
+
unset ($posts["0"][$i]);
|
183 |
+
else if (($i = array_search ($post_id, $posts["1"])) !== false)
|
184 |
+
unset ($posts["1"][$i]);
|
185 |
+
else if (($i = array_search ($post_id, $posts["2"])) !== false)
|
186 |
+
unset ($posts["2"][$i]);
|
187 |
+
else if (($i = array_search ($post_id, $posts["3"])) !== false)
|
188 |
+
unset ($posts["3"][$i]);
|
189 |
+
else if (($i = array_search ($post_id, $posts["4"])) !== false)
|
190 |
+
unset ($posts["4"][$i]);
|
191 |
+
/**/
|
192 |
+
if (strlen ($_p["ws_plugin__s2member_security_meta_box_level"]) && is_array ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]))
|
193 |
+
if (!$posts[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
|
194 |
+
array_push ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]], $post_id);
|
195 |
+
/**/
|
196 |
+
$new_options = array_merge ((array)$new_options, array ("ws_plugin__s2member_level0_posts" => implode (",", $posts[0]), "ws_plugin__s2member_level1_posts" => implode (",", $posts[1]), "ws_plugin__s2member_level2_posts" => implode (",", $posts[2]), "ws_plugin__s2member_level3_posts" => implode (",", $posts[3]), "ws_plugin__s2member_level4_posts" => implode (",", $posts[4])));
|
197 |
+
/**/
|
198 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
199 |
+
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
|
200 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
201 |
+
/**/
|
202 |
+
ws_plugin__s2member_update_all_options ($new_options, true, false, array ("membership_options_page_warning"), true);
|
203 |
+
}
|
204 |
+
}
|
205 |
+
/**/
|
206 |
+
if ($_p["post_type"] === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
|
207 |
+
{
|
208 |
+
if (isset ($_p["ws_plugin__s2member_security_meta_box_ccaps"])) /* Just needs to be set. It CAN be empty. */
|
209 |
+
{
|
210 |
+
$ccaps_req = trim (strtolower ($_p["ws_plugin__s2member_security_meta_box_ccaps"]), ",");
|
211 |
+
$ccaps_req = trim (preg_replace ("/[^a-z_0-9,]/", "", $ccaps_req), ","); /* Now clean up. */
|
212 |
+
update_post_meta ($page_id, "s2member_ccaps_req", preg_split ("/[\r\n\t\s;,]+/", $ccaps_req));
|
213 |
+
}
|
214 |
+
}
|
215 |
+
/**/
|
216 |
+
else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
|
217 |
+
{
|
218 |
+
if (isset ($_p["ws_plugin__s2member_security_meta_box_ccaps"])) /* Just needs to be set. It CAN be empty. */
|
219 |
+
{
|
220 |
+
$ccaps_req = trim (strtolower ($_p["ws_plugin__s2member_security_meta_box_ccaps"]), ",");
|
221 |
+
$ccaps_req = trim (preg_replace ("/[^a-z_0-9,]/", "", $ccaps_req), ","); /* Now clean up. */
|
222 |
+
update_post_meta ($post_id, "s2member_ccaps_req", preg_split ("/[\r\n\t\s;,]+/", $ccaps_req));
|
223 |
+
}
|
224 |
+
}
|
225 |
+
}
|
226 |
+
}
|
227 |
+
/**/
|
228 |
+
do_action ("ws_plugin__s2member_after_save_meta_boxes", get_defined_vars ());
|
229 |
+
/**/
|
230 |
+
return;
|
231 |
+
}
|
232 |
+
}
|
233 |
+
?>
|
includes/functions/ms-meta-caps.inc.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
4 |
+
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
5 |
+
|
6 |
+
Released under the terms of the GNU General Public License.
|
7 |
+
You should have received a copy of the GNU General Public License,
|
8 |
+
along with this software. In the main directory, see: /licensing/
|
9 |
+
If not, see: <http://www.gnu.org/licenses/>.
|
10 |
+
*/
|
11 |
+
/*
|
12 |
+
Direct access denial.
|
13 |
+
*/
|
14 |
+
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
+
/*
|
17 |
+
Alters `map_meta_cap()` on a Multisite Blog Farm.
|
18 |
+
Attach to: add_action("map_meta_cap");
|
19 |
+
*/
|
20 |
+
if (!function_exists ("ws_plugin__s2member_ms_map_meta_cap"))
|
21 |
+
{
|
22 |
+
function ws_plugin__s2member_ms_map_meta_cap ($caps = FALSE, $cap = FALSE, $user_id = FALSE)
|
23 |
+
{
|
24 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
25 |
+
do_action ("ws_plugin__s2member_before_ms_map_meta_cap", get_defined_vars ());
|
26 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
27 |
+
/**/
|
28 |
+
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_super_admin ())
|
29 |
+
{
|
30 |
+
if (in_array ($cap, array_keys ($map = array ("edit_user" => "edit_users", "edit_users" => "edit_users"))))
|
31 |
+
{
|
32 |
+
if (is_object ($user = new WP_User ($user_id)) && $user->allcaps["administrator"])
|
33 |
+
$caps = array ($map[$cap]);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
return apply_filters ("ws_plugin__s2member_ms_map_meta_cap", $caps, get_defined_vars ());
|
37 |
+
}
|
38 |
+
}
|
39 |
+
/*
|
40 |
+
Alters this Filter inside `/wp-admin/user-edit.php`.
|
41 |
+
Attach to: add_filter("enable_edit_any_user_configuration");
|
42 |
+
*/
|
43 |
+
if (!function_exists ("ws_plugin__s2member_ms_allow_edits"))
|
44 |
+
{
|
45 |
+
function ws_plugin__s2member_ms_allow_edits ($allow = FALSE)
|
46 |
+
{
|
47 |
+
global $user_id; /* Available inside `/wp-admin/user-edit.php`. */
|
48 |
+
/**/
|
49 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
50 |
+
do_action ("ws_plugin__s2member_before_ms_allow_edits", get_defined_vars ());
|
51 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
52 |
+
/**/
|
53 |
+
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && (is_super_admin () || is_user_member_of_blog ($user_id)))
|
54 |
+
{
|
55 |
+
$allow = true; /* Yes, allow editing. */
|
56 |
+
}
|
57 |
+
return apply_filters ("ws_plugin__s2member_ms_allow_edits", $allow, get_defined_vars ());
|
58 |
+
}
|
59 |
+
}
|
60 |
+
?>
|
includes/functions/nocache.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Handles no-cache headers and compatible constants for s2Member.
|
18 |
This is compatible with Quick Cache and also with WP Super Cache.
|
@@ -60,11 +60,11 @@ if (!function_exists ("ws_plugin__s2member_nocache_constants"))
|
|
60 |
{
|
61 |
function ws_plugin__s2member_nocache_constants ($nocache = FALSE)
|
62 |
{
|
63 |
-
eval
|
64 |
do_action ("ws_plugin__s2member_before_nocache_constants", get_defined_vars ());
|
65 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
66 |
/**/
|
67 |
-
if (!$_GET["qcAC"] && ($nocache || is_user_logged_in () || (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && (parse_url ($_SERVER["REQUEST_URI"], PHP_URL_PATH) === "/" || parse_url (rtrim ($_SERVER["REQUEST_URI"], "/"), PHP_URL_PATH) === parse_url (rtrim (get_bloginfo ("
|
68 |
{
|
69 |
define ("QUICK_CACHE_ALLOWED", false) . define ("DONOTCACHEPAGE", true);
|
70 |
/**/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Handles no-cache headers and compatible constants for s2Member.
|
18 |
This is compatible with Quick Cache and also with WP Super Cache.
|
60 |
{
|
61 |
function ws_plugin__s2member_nocache_constants ($nocache = FALSE)
|
62 |
{
|
63 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
64 |
do_action ("ws_plugin__s2member_before_nocache_constants", get_defined_vars ());
|
65 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
66 |
/**/
|
67 |
+
if (!$_GET["qcAC"] && ($nocache || is_user_logged_in () || (preg_match ("/^s2member/", $_SERVER["QUERY_STRING"]) && (parse_url ($_SERVER["REQUEST_URI"], PHP_URL_PATH) === "/" || parse_url (rtrim ($_SERVER["REQUEST_URI"], "/"), PHP_URL_PATH) === parse_url (rtrim (get_bloginfo ("wpurl"), "/"), PHP_URL_PATH)))))
|
68 |
{
|
69 |
define ("QUICK_CACHE_ALLOWED", false) . define ("DONOTCACHEPAGE", true);
|
70 |
/**/
|
includes/functions/page-level-access.inc.php
CHANGED
@@ -74,6 +74,14 @@ if (!function_exists ("ws_plugin__s2member_check_page_level_access"))
|
|
74 |
/**/
|
75 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($page_ID) && wp_redirect (add_query_arg ("s2member_sp_req", $page_ID, get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
76 |
exit ();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
/**/
|
79 |
do_action ("ws_plugin__s2member_during_check_page_level_access", get_defined_vars ());
|
74 |
/**/
|
75 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($page_ID) && wp_redirect (add_query_arg ("s2member_sp_req", $page_ID, get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
76 |
exit ();
|
77 |
+
/**/
|
78 |
+
else if (is_array ($ccaps_req = get_post_meta ($page_ID, "s2member_ccaps_req", true))) /* Check for per Post Custom Capability requirements. */
|
79 |
+
foreach ($ccaps_req as $ccap) /* The $current_user MUST satisfy ALL Custom Capability requirements. These are all stored as a serialized array. */
|
80 |
+
if (strlen ($ccap) && (!$current_user || !$current_user->hap_cap ("access_s2member_ccap_" . $ccap)))
|
81 |
+
{
|
82 |
+
wp_redirect(add_query_arg ("s2member_ccap_req", $ccap, get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
|
83 |
+
exit ();
|
84 |
+
}
|
85 |
}
|
86 |
/**/
|
87 |
do_action ("ws_plugin__s2member_during_check_page_level_access", get_defined_vars ());
|
includes/functions/paypal-button.inc.php
CHANGED
@@ -74,8 +74,8 @@ if (!function_exists ("ws_plugin__s2member_paypal_button"))
|
|
74 |
$code = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $code);
|
75 |
$code = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $code);
|
76 |
$code = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $code);
|
77 |
-
$code = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
78 |
-
$code = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
79 |
$code = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $code);
|
80 |
/**/
|
81 |
$code = preg_replace ('/ name\="item_name" value\="(.*?)"/', ' name="item_name" value="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["desc"])) . '"', $code);
|
@@ -103,8 +103,8 @@ if (!function_exists ("ws_plugin__s2member_paypal_button"))
|
|
103 |
$code = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $code);
|
104 |
$code = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $attr["level"] . "_label"])), $code);
|
105 |
$code = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $code); /* This brings them back to Front Page. */
|
106 |
-
$code = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
107 |
-
$code = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
108 |
$code = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $code);
|
109 |
$code = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ($attr["level"])), $code);
|
110 |
/**/
|
74 |
$code = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $code);
|
75 |
$code = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $code);
|
76 |
$code = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $code);
|
77 |
+
$code = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1")), $code);
|
78 |
+
$code = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_return=1")), $code);
|
79 |
$code = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $code);
|
80 |
/**/
|
81 |
$code = preg_replace ('/ name\="item_name" value\="(.*?)"/', ' name="item_name" value="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["desc"])) . '"', $code);
|
103 |
$code = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $code);
|
104 |
$code = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $attr["level"] . "_label"])), $code);
|
105 |
$code = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $code); /* This brings them back to Front Page. */
|
106 |
+
$code = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1")), $code);
|
107 |
+
$code = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_return=1")), $code);
|
108 |
$code = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $code);
|
109 |
$code = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ($attr["level"])), $code);
|
110 |
/**/
|
includes/functions/paypal-notify.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Handles PayPal® IPN URL processing.
|
18 |
These same routines also handle s2Member Pro/PayPal® Pro operations;
|
@@ -33,6 +33,8 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
33 |
{
|
34 |
include_once ABSPATH . "wp-admin/includes/admin.php";
|
35 |
/**/
|
|
|
|
|
36 |
do_action ("ws_plugin__s2member_before_paypal_notify", get_defined_vars ());
|
37 |
/**/
|
38 |
if ($_GET["s2member_paypal_notify"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])
|
@@ -57,7 +59,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
57 |
/*
|
58 |
Custom conditionals can be applied by filters.
|
59 |
*/
|
60 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
61 |
if (!apply_filters ("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars ()))
|
62 |
{
|
63 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
@@ -71,7 +73,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
71 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
72 |
&& $paypal["txn_id"]/**/)
|
73 |
{
|
74 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
75 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_virtual_terminal", get_defined_vars ());
|
76 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
77 |
/**/
|
@@ -81,11 +83,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
81 |
/**/
|
82 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
83 |
/**/
|
84 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
85 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_virtual_terminal", get_defined_vars ());
|
86 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
87 |
/**/
|
88 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
89 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_virtual_terminal", get_defined_vars ());
|
90 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
91 |
}
|
@@ -99,7 +101,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
99 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
100 |
&& $paypal["txn_id"]/**/)
|
101 |
{
|
102 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
103 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
|
104 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
105 |
/**/
|
@@ -110,11 +112,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
110 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
111 |
$paypal["s2member_log"][] = "s2Member Pro handles Express Checkout events on-site, with an IPN proxy.";
|
112 |
/**/
|
113 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
114 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_express_checkout", get_defined_vars ());
|
115 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
116 |
/**/
|
117 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
118 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_express_checkout", get_defined_vars ());
|
119 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
120 |
}
|
@@ -128,7 +130,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
128 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
129 |
&& $paypal["txn_id"]/**/)
|
130 |
{
|
131 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
132 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
|
133 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
134 |
/**/
|
@@ -139,11 +141,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
139 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
140 |
$paypal["s2member_log"][] = "s2Member Pro handles Cart events on-site, with an IPN proxy.";
|
141 |
/**/
|
142 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
143 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_cart", get_defined_vars ());
|
144 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
145 |
/**/
|
146 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
147 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_cart", get_defined_vars ());
|
148 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
149 |
}
|
@@ -155,7 +157,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
155 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
156 |
&& $paypal["payer_email"] && $paypal["txn_id"]/**/)
|
157 |
{
|
158 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
159 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_access", get_defined_vars ());
|
160 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
161 |
/**/
|
@@ -220,7 +222,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
220 |
if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
|
221 |
/**/
|
222 |
if (($url = trim ($url))) /* Empty? */
|
223 |
-
ws_plugin__s2member_remote($url);
|
224 |
/**/
|
225 |
$paypal["s2member_log"][] = "Specific Post/Page Access Notification URLs have been processed.";
|
226 |
}
|
@@ -256,7 +258,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
256 |
}
|
257 |
}
|
258 |
/**/
|
259 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
260 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_access", get_defined_vars ());
|
261 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
262 |
}
|
@@ -265,7 +267,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
265 |
$paypal["s2member_log"][] = "Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?";
|
266 |
}
|
267 |
/**/
|
268 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
269 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_access", get_defined_vars ());
|
270 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
271 |
}
|
@@ -280,7 +282,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
280 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
281 |
&& $paypal["payer_email"]/**/)
|
282 |
{
|
283 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
284 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup", get_defined_vars ());
|
285 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
286 |
/**/
|
@@ -306,7 +308,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
306 |
/* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified. PayPal will not allow the
|
307 |
modify=1|2 parameter to be used in those scenarios, because technically there is nothing to update. The only thing that actually needs to be updated is the account. */
|
308 |
{
|
309 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
310 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_w_update_vars", get_defined_vars ());
|
311 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
312 |
/**/
|
@@ -315,13 +317,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
315 |
/* Check for both the old & new subscr_id's, just in case the Return routine already changed it. */
|
316 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"], $paypal["option_selection1"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
317 |
{
|
318 |
-
if (
|
319 |
{
|
320 |
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
|
321 |
/**/
|
322 |
$user->set_role ("s2member_level" . $paypal["level"]);
|
323 |
-
update_usermeta ($user_id, "s2member_subscr_id", $paypal["subscr_id"]);
|
324 |
-
update_usermeta ($user_id, "s2member_custom", $paypal["custom"]);
|
325 |
/**/
|
326 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
327 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
@@ -331,13 +331,16 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
331 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
332 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
333 |
/**/
|
334 |
-
|
335 |
-
|
|
|
|
|
|
|
336 |
/**/
|
337 |
if (preg_match ("/^web_accept$/i", $paypal["txn_type"]) && $paypal["eotper"])
|
338 |
-
|
339 |
else /* Otherwise, we need to clear the eot time. */
|
340 |
-
|
341 |
/**/
|
342 |
ws_plugin__s2member_clear_user_note_lines ($user_id, "/^Demoted by s2Member\:/");
|
343 |
/**/
|
@@ -347,13 +350,13 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
347 |
/**/
|
348 |
$paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
|
349 |
/**/
|
350 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
351 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars", get_defined_vars ());
|
352 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
353 |
}
|
354 |
else
|
355 |
{
|
356 |
-
$paypal["s2member_log"][] = "Unable to modify Subscription. The existing User ID
|
357 |
}
|
358 |
}
|
359 |
else
|
@@ -361,7 +364,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
361 |
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB. Please check the on0 and os0 variables in your Button Code.";
|
362 |
}
|
363 |
/**/
|
364 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
365 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_w_update_vars", get_defined_vars ());
|
366 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
367 |
}
|
@@ -370,7 +373,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
370 |
*/
|
371 |
else /* Else this is a normal Subscription signup, we are not updating anything. */
|
372 |
{
|
373 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
374 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_wo_update_vars", get_defined_vars ());
|
375 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
376 |
/**/
|
@@ -437,7 +440,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
437 |
if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
|
438 |
/**/
|
439 |
if (($url = trim ($url))) /* Empty? */
|
440 |
-
ws_plugin__s2member_remote($url);
|
441 |
/**/
|
442 |
$paypal["s2member_log"][] = "Signup Notification URLs have been processed.";
|
443 |
}
|
@@ -459,7 +462,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
459 |
}
|
460 |
}
|
461 |
/**/
|
462 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
463 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
464 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
465 |
}
|
@@ -468,7 +471,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
468 |
$paypal["s2member_log"][] = "Unable to generate Registration URL for Membership Access. Possible data corruption within the IPN response.";
|
469 |
}
|
470 |
/**/
|
471 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
472 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
473 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
474 |
}
|
@@ -495,19 +498,20 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
495 |
foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_urls"]) as $url)
|
496 |
/**/
|
497 |
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["subscr_id"])), $url)))
|
498 |
-
if (($url = preg_replace ("/%%
|
499 |
-
if (($url = preg_replace ("/%%
|
500 |
-
if (($url = preg_replace ("/%%
|
501 |
-
if (($url = preg_replace ("/%%
|
502 |
-
if (($url = preg_replace ("/%%
|
503 |
-
|
504 |
-
|
505 |
-
|
|
|
506 |
/**/
|
507 |
$paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
|
508 |
}
|
509 |
/**/
|
510 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
511 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
|
512 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
513 |
}
|
@@ -524,7 +528,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
524 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/)
|
525 |
/* "payer_email" is not passed in `recurring_payment_profile_created` ?? */
|
526 |
{
|
527 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
528 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
|
529 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
530 |
/**/
|
@@ -535,11 +539,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
535 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
536 |
$paypal["s2member_log"][] = "s2Member Pro handles this event on-site, with an IPN proxy.";
|
537 |
/**/
|
538 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
539 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_recurring_payment_profile_created", get_defined_vars ());
|
540 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
541 |
/**/
|
542 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
543 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_recurring_payment_profile_created", get_defined_vars ());
|
544 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
545 |
}
|
@@ -550,7 +554,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
550 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/
|
551 |
&& $paypal["subscr_id"] && $paypal["payer_email"]/**/)
|
552 |
{
|
553 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
554 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_modify", get_defined_vars ());
|
555 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
556 |
/**/
|
@@ -560,13 +564,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
560 |
/**/
|
561 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
562 |
{
|
563 |
-
if (
|
564 |
{
|
565 |
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
|
566 |
/**/
|
567 |
$user->set_role ("s2member_level" . $paypal["level"]);
|
568 |
-
update_usermeta ($user_id, "s2member_subscr_id", $paypal["subscr_id"]);
|
569 |
-
update_usermeta ($user_id, "s2member_custom", $paypal["custom"]);
|
570 |
/**/
|
571 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
572 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
@@ -576,9 +578,13 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
576 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
577 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
578 |
/**/
|
579 |
-
|
580 |
-
|
581 |
-
|
|
|
|
|
|
|
|
|
582 |
/**/
|
583 |
ws_plugin__s2member_clear_user_note_lines ($user_id, "/^Demoted by s2Member\:/");
|
584 |
/**/
|
@@ -588,13 +594,13 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
588 |
/**/
|
589 |
$paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
|
590 |
/**/
|
591 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
592 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_modify", get_defined_vars ());
|
593 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
594 |
}
|
595 |
else
|
596 |
{
|
597 |
-
$paypal["s2member_log"][] = "Unable to modify Subscription. The existing User ID
|
598 |
}
|
599 |
}
|
600 |
else
|
@@ -602,7 +608,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
602 |
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
|
603 |
}
|
604 |
/**/
|
605 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
606 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_modify", get_defined_vars ());
|
607 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
608 |
}
|
@@ -618,14 +624,14 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
618 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
|
619 |
&& $paypal["payer_email"] && $paypal["txn_id"] && $paypal["mc_gross"]/**/)
|
620 |
{
|
621 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
622 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_payment", get_defined_vars ());
|
623 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
624 |
/**/
|
625 |
$paypal["s2member_log"][] = "s2Member txn_type identified as subscr_payment|recurring_payment.";
|
626 |
$paypal["s2member_log"][] = "Sleeping for 2 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
|
627 |
-
sleep(2); /* Sleep here for a moment. PayPal® sometimes sends a subscr_payment before the subscr_signup, subscr_modify.
|
628 |
-
|
629 |
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as subscr_payment|recurring_payment.";
|
630 |
/**/
|
631 |
list ($paypal["level"], $paypal["ccaps"]) = preg_split ("/\:/", $paypal["item_number"], 2);
|
@@ -634,7 +640,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
634 |
{
|
635 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
636 |
/**/
|
637 |
-
|
638 |
/**/
|
639 |
$paypal["s2member_log"][] = "Updated Last Payment Time for this Member.";
|
640 |
/**/
|
@@ -643,19 +649,20 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
643 |
foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_urls"]) as $url)
|
644 |
/**/
|
645 |
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["subscr_id"])), $url)))
|
646 |
-
if (($url = preg_replace ("/%%
|
647 |
-
if (($url = preg_replace ("/%%
|
648 |
-
if (($url = preg_replace ("/%%
|
649 |
-
if (($url = preg_replace ("/%%
|
650 |
-
if (($url = preg_replace ("/%%
|
651 |
-
|
652 |
-
|
653 |
-
|
|
|
654 |
/**/
|
655 |
$paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
|
656 |
}
|
657 |
/**/
|
658 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
659 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
|
660 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
661 |
}
|
@@ -666,7 +673,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
666 |
set_transient (md5 ("s2member_transient_ipn_subscr_payment_" . $paypal["subscr_id"]), $_POST, 43200);
|
667 |
}
|
668 |
/**/
|
669 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
670 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_payment", get_defined_vars ());
|
671 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
672 |
}
|
@@ -683,7 +690,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
683 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
|
684 |
&& $paypal["payer_email"]/**/)
|
685 |
{
|
686 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
687 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_failed", get_defined_vars ());
|
688 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
689 |
/**/
|
@@ -695,11 +702,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
695 |
$paypal["s2member_log"][] = "s2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.";
|
696 |
$paypal["s2member_log"][] = "When multiple consecutive payments fail, a special IPN response will be triggered.";
|
697 |
/**/
|
698 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
699 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_failed", get_defined_vars ());
|
700 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
701 |
/**/
|
702 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
703 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_failed", get_defined_vars ());
|
704 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
705 |
}
|
@@ -718,7 +725,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
718 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
719 |
&& $paypal["payer_email"]/**/)
|
720 |
{
|
721 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
722 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_cancel", get_defined_vars ());
|
723 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
724 |
/**/
|
@@ -728,17 +735,17 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
728 |
/**/
|
729 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
730 |
{
|
731 |
-
if (!
|
732 |
{
|
733 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
734 |
/**/
|
735 |
$auto_eot_time = ws_plugin__s2member_paypal_auto_eot_time ($user_id, $paypal["period1"], $paypal["period3"]);
|
736 |
/**/
|
737 |
-
|
738 |
/**/
|
739 |
$paypal["s2member_log"][] = "Auto-EOT Time for this account: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
740 |
/**/
|
741 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
742 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_cancel", get_defined_vars ());
|
743 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
744 |
}
|
@@ -752,7 +759,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
752 |
$paypal["s2member_log"][] = "Unable to handle Cancellation. Could not get the existing User ID from the DB.";
|
753 |
}
|
754 |
/**/
|
755 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
756 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_cancel", get_defined_vars ());
|
757 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
758 |
}
|
@@ -768,7 +775,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
768 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/
|
769 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]) || ($paypal["subscr_id"] = $paypal["parent_txn_id"]))/**/)
|
770 |
{
|
771 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
772 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
|
773 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
774 |
/**/
|
@@ -776,9 +783,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
776 |
/**/
|
777 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"], $paypal["option_selection1"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
778 |
{
|
779 |
-
if (!
|
|
|
|
|
780 |
{
|
781 |
-
if (
|
782 |
{
|
783 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"]) /* EOT enabled? */
|
784 |
{
|
@@ -789,17 +798,17 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
789 |
$demotion_role = ws_plugin__s2member_force_demotion_role ("subscriber");
|
790 |
$user->set_role ($demotion_role); /* Defaults to Free Subscriber. */
|
791 |
/**/
|
792 |
-
delete_usermeta ($user_id, "s2member_custom");
|
793 |
-
delete_usermeta ($user_id, "s2member_subscr_id");
|
794 |
-
delete_usermeta ($user_id, "s2member_last_payment_time");
|
795 |
-
delete_usermeta ($user_id, "s2member_auto_eot_time");
|
796 |
-
/**/
|
797 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
798 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
799 |
$user->remove_cap ($ccap = $cap);
|
800 |
/**/
|
801 |
-
|
802 |
-
|
|
|
|
|
|
|
|
|
|
|
803 |
/**/
|
804 |
ws_plugin__s2member_append_user_notes ($user_id, "Demoted by s2Member: " . date ("D M j, Y g:i a T"));
|
805 |
/**/
|
@@ -813,14 +822,15 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
813 |
if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
|
814 |
if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
|
815 |
if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
|
816 |
-
|
817 |
-
|
818 |
-
|
|
|
819 |
/**/
|
820 |
$paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
|
821 |
}
|
822 |
/**/
|
823 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
824 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
|
825 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
826 |
}
|
@@ -828,19 +838,27 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
828 |
{
|
829 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
830 |
/**/
|
831 |
-
|
832 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
/**/
|
834 |
-
$paypal["s2member_log"][] = "
|
835 |
/**/
|
836 |
$paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
|
837 |
/**/
|
838 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
839 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delete", get_defined_vars ());
|
840 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
841 |
}
|
842 |
/**/
|
843 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
844 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot", get_defined_vars ());
|
845 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
846 |
}
|
@@ -849,19 +867,19 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
849 |
{
|
850 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
851 |
/**/
|
852 |
-
|
853 |
/**/
|
854 |
$paypal["s2member_log"][] = "Auto-EOT is currently disabled. Skipping immediate EOT (demote|delete), for now.";
|
855 |
$paypal["s2member_log"][] = "Recording the Auto-EOT Time for this Member's account: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
856 |
/**/
|
857 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
858 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_disabled", get_defined_vars ());
|
859 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
860 |
}
|
861 |
}
|
862 |
else
|
863 |
{
|
864 |
-
$paypal["s2member_log"][] = "Unable to (demote|delete) Member. The existing User ID
|
865 |
}
|
866 |
}
|
867 |
else
|
@@ -885,25 +903,26 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
885 |
{
|
886 |
foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ref_rev_notification_urls"]) as $url)
|
887 |
/**/
|
888 |
-
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["subscr_id"])), $url)))
|
889 |
-
if (($url = preg_replace ("
|
890 |
-
if (($url = preg_replace ("
|
891 |
if (($url = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["first_name"])), $url)) && ($url = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["last_name"])), $url)))
|
892 |
if (($url = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($paypal["first_name"] . " " . $paypal["last_name"]))), $url)))
|
893 |
if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
|
894 |
-
|
895 |
-
|
896 |
-
|
|
|
897 |
/**/
|
898 |
$paypal["s2member_log"][] = "Refund/Reversal Notification URLs have been processed.";
|
899 |
}
|
900 |
/**/
|
901 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
902 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
|
903 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
904 |
}
|
905 |
/**/
|
906 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
907 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_eot", get_defined_vars ());
|
908 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
909 |
}
|
@@ -937,9 +956,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
937 |
/*
|
938 |
Otherwise, POST vars could not even be verified. This needs to be reported in the logs.
|
939 |
*/
|
940 |
-
else
|
941 |
{
|
942 |
$paypal["s2member_log"][] = "Unable to verify POST vars. Possibly caused by a fraudulent request. If this error continues, please run IPN tests against your server from a PayPal® Sandbox account. They provide special diagnostic tools to assist you.";
|
|
|
|
|
943 |
$paypal["s2member_log"][] = var_export ($_POST, true); /* Recording _POST vars for analysis and debugging. */
|
944 |
}
|
945 |
/*
|
@@ -954,20 +975,25 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
|
|
954 |
$paypal["s2member_paypal_proxy_verification"] = $_GET["s2member_paypal_proxy_verification"];
|
955 |
/*
|
956 |
If debugging/logging is enabled; we need to append $paypal to the log file.
|
|
|
957 |
*/
|
|
|
|
|
|
|
|
|
958 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) /* Append to log? */
|
959 |
if (is_dir ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
960 |
if (is_writable ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
961 |
-
file_put_contents ($logs_dir . "/
|
962 |
/**/
|
963 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
964 |
do_action ("ws_plugin__s2member_during_paypal_notify", get_defined_vars ());
|
965 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
966 |
/**/
|
967 |
-
exit($paypal["proxy_return_url"]); /* Return, if/when applicable. */
|
968 |
}
|
969 |
/**/
|
970 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
971 |
do_action ("ws_plugin__s2member_after_paypal_notify", get_defined_vars ());
|
972 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
973 |
}
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Handles PayPal® IPN URL processing.
|
18 |
These same routines also handle s2Member Pro/PayPal® Pro operations;
|
33 |
{
|
34 |
include_once ABSPATH . "wp-admin/includes/admin.php";
|
35 |
/**/
|
36 |
+
global $current_site, $current_blog; /* For Multisite support. */
|
37 |
+
/**/
|
38 |
do_action ("ws_plugin__s2member_before_paypal_notify", get_defined_vars ());
|
39 |
/**/
|
40 |
if ($_GET["s2member_paypal_notify"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])
|
59 |
/*
|
60 |
Custom conditionals can be applied by filters.
|
61 |
*/
|
62 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
63 |
if (!apply_filters ("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars ()))
|
64 |
{
|
65 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
73 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
74 |
&& $paypal["txn_id"]/**/)
|
75 |
{
|
76 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
77 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_virtual_terminal", get_defined_vars ());
|
78 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
79 |
/**/
|
83 |
/**/
|
84 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
85 |
/**/
|
86 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
87 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_virtual_terminal", get_defined_vars ());
|
88 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
89 |
/**/
|
90 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
91 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_virtual_terminal", get_defined_vars ());
|
92 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
93 |
}
|
101 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
102 |
&& $paypal["txn_id"]/**/)
|
103 |
{
|
104 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
105 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
|
106 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
107 |
/**/
|
112 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
113 |
$paypal["s2member_log"][] = "s2Member Pro handles Express Checkout events on-site, with an IPN proxy.";
|
114 |
/**/
|
115 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
116 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_express_checkout", get_defined_vars ());
|
117 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
118 |
/**/
|
119 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
120 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_express_checkout", get_defined_vars ());
|
121 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
122 |
}
|
130 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
131 |
&& $paypal["txn_id"]/**/)
|
132 |
{
|
133 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
134 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
|
135 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
136 |
/**/
|
141 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
142 |
$paypal["s2member_log"][] = "s2Member Pro handles Cart events on-site, with an IPN proxy.";
|
143 |
/**/
|
144 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
145 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_cart", get_defined_vars ());
|
146 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
147 |
/**/
|
148 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
149 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_cart", get_defined_vars ());
|
150 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
151 |
}
|
157 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
158 |
&& $paypal["payer_email"] && $paypal["txn_id"]/**/)
|
159 |
{
|
160 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
161 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_access", get_defined_vars ());
|
162 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
163 |
/**/
|
222 |
if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
|
223 |
/**/
|
224 |
if (($url = trim ($url))) /* Empty? */
|
225 |
+
ws_plugin__s2member_remote ($url);
|
226 |
/**/
|
227 |
$paypal["s2member_log"][] = "Specific Post/Page Access Notification URLs have been processed.";
|
228 |
}
|
258 |
}
|
259 |
}
|
260 |
/**/
|
261 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
262 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_access", get_defined_vars ());
|
263 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
264 |
}
|
267 |
$paypal["s2member_log"][] = "Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?";
|
268 |
}
|
269 |
/**/
|
270 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
271 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_access", get_defined_vars ());
|
272 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
273 |
}
|
282 |
&& !preg_match ($payment_status_issues, $paypal["payment_status"])/**/
|
283 |
&& $paypal["payer_email"]/**/)
|
284 |
{
|
285 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
286 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup", get_defined_vars ());
|
287 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
288 |
/**/
|
308 |
/* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified. PayPal will not allow the
|
309 |
modify=1|2 parameter to be used in those scenarios, because technically there is nothing to update. The only thing that actually needs to be updated is the account. */
|
310 |
{
|
311 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
312 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_w_update_vars", get_defined_vars ());
|
313 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
314 |
/**/
|
317 |
/* Check for both the old & new subscr_id's, just in case the Return routine already changed it. */
|
318 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"], $paypal["option_selection1"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
319 |
{
|
320 |
+
if (!$user->has_cap ("administrator")) /* Do NOT process this routine on Administrators. */
|
321 |
{
|
322 |
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
|
323 |
/**/
|
324 |
$user->set_role ("s2member_level" . $paypal["level"]);
|
|
|
|
|
325 |
/**/
|
326 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
327 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
331 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
332 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
333 |
/**/
|
334 |
+
update_user_option ($user_id, "s2member_subscr_id", $paypal["subscr_id"]);
|
335 |
+
update_user_option ($user_id, "s2member_custom", $paypal["custom"]);
|
336 |
+
/**/
|
337 |
+
delete_user_option ($user_id, "s2member_file_download_access_arc");
|
338 |
+
delete_user_option ($user_id, "s2member_file_download_access_log");
|
339 |
/**/
|
340 |
if (preg_match ("/^web_accept$/i", $paypal["txn_type"]) && $paypal["eotper"])
|
341 |
+
update_user_option ($user_id, "s2member_auto_eot_time", ws_plugin__s2member_paypal_auto_eot_time (0, 0, 0, $paypal["eotper"]));
|
342 |
else /* Otherwise, we need to clear the eot time. */
|
343 |
+
delete_user_option ($user_id, "s2member_auto_eot_time");
|
344 |
/**/
|
345 |
ws_plugin__s2member_clear_user_note_lines ($user_id, "/^Demoted by s2Member\:/");
|
346 |
/**/
|
350 |
/**/
|
351 |
$paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
|
352 |
/**/
|
353 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
354 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars", get_defined_vars ());
|
355 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
356 |
}
|
357 |
else
|
358 |
{
|
359 |
+
$paypal["s2member_log"][] = "Unable to modify Subscription. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.";
|
360 |
}
|
361 |
}
|
362 |
else
|
364 |
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB. Please check the on0 and os0 variables in your Button Code.";
|
365 |
}
|
366 |
/**/
|
367 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
368 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_w_update_vars", get_defined_vars ());
|
369 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
370 |
}
|
373 |
*/
|
374 |
else /* Else this is a normal Subscription signup, we are not updating anything. */
|
375 |
{
|
376 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
377 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_wo_update_vars", get_defined_vars ());
|
378 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
379 |
/**/
|
440 |
if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
|
441 |
/**/
|
442 |
if (($url = trim ($url))) /* Empty? */
|
443 |
+
ws_plugin__s2member_remote ($url);
|
444 |
/**/
|
445 |
$paypal["s2member_log"][] = "Signup Notification URLs have been processed.";
|
446 |
}
|
462 |
}
|
463 |
}
|
464 |
/**/
|
465 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
466 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
467 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
468 |
}
|
471 |
$paypal["s2member_log"][] = "Unable to generate Registration URL for Membership Access. Possible data corruption within the IPN response.";
|
472 |
}
|
473 |
/**/
|
474 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
475 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
476 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
477 |
}
|
498 |
foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_urls"]) as $url)
|
499 |
/**/
|
500 |
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["subscr_id"])), $url)))
|
501 |
+
if (($url = preg_replace ("/%%subscr_payment%%/i", ws_plugin__s2member_esc_ds (urlencode ("0")), $url)) && ($url = preg_replace ("/%%subscr_payment_user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ("")), $url)))
|
502 |
+
if (($url = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["mc_gross"])), $url)) && ($url = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["txn_id"])), $url)))
|
503 |
+
if (($url = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["item_number"])), $url)) && ($url = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["item_name"])), $url)))
|
504 |
+
if (($url = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["first_name"])), $url)) && ($url = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["last_name"])), $url)))
|
505 |
+
if (($url = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($paypal["first_name"] . " " . $paypal["last_name"]))), $url)))
|
506 |
+
if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
|
507 |
+
/**/
|
508 |
+
if (($url = trim ($url))) /* Empty? */
|
509 |
+
ws_plugin__s2member_remote ($url);
|
510 |
/**/
|
511 |
$paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
|
512 |
}
|
513 |
/**/
|
514 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
515 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
|
516 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
517 |
}
|
528 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/)
|
529 |
/* "payer_email" is not passed in `recurring_payment_profile_created` ?? */
|
530 |
{
|
531 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
532 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
|
533 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
534 |
/**/
|
539 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
540 |
$paypal["s2member_log"][] = "s2Member Pro handles this event on-site, with an IPN proxy.";
|
541 |
/**/
|
542 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
543 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_recurring_payment_profile_created", get_defined_vars ());
|
544 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
545 |
/**/
|
546 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
547 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_recurring_payment_profile_created", get_defined_vars ());
|
548 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
549 |
}
|
554 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/
|
555 |
&& $paypal["subscr_id"] && $paypal["payer_email"]/**/)
|
556 |
{
|
557 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
558 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_modify", get_defined_vars ());
|
559 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
560 |
/**/
|
564 |
/**/
|
565 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
566 |
{
|
567 |
+
if (!$user->has_cap ("administrator")) /* Do NOT process this routine on Administrators. */
|
568 |
{
|
569 |
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
|
570 |
/**/
|
571 |
$user->set_role ("s2member_level" . $paypal["level"]);
|
|
|
|
|
572 |
/**/
|
573 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
574 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
578 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
579 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
580 |
/**/
|
581 |
+
update_user_option ($user_id, "s2member_subscr_id", $paypal["subscr_id"]);
|
582 |
+
update_user_option ($user_id, "s2member_custom", $paypal["custom"]);
|
583 |
+
/**/
|
584 |
+
delete_user_option ($user_id, "s2member_file_download_access_arc");
|
585 |
+
delete_user_option ($user_id, "s2member_file_download_access_log");
|
586 |
+
/**/
|
587 |
+
delete_user_option ($user_id, "s2member_auto_eot_time");
|
588 |
/**/
|
589 |
ws_plugin__s2member_clear_user_note_lines ($user_id, "/^Demoted by s2Member\:/");
|
590 |
/**/
|
594 |
/**/
|
595 |
$paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
|
596 |
/**/
|
597 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
598 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_modify", get_defined_vars ());
|
599 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
600 |
}
|
601 |
else
|
602 |
{
|
603 |
+
$paypal["s2member_log"][] = "Unable to modify Subscription. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.";
|
604 |
}
|
605 |
}
|
606 |
else
|
608 |
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
|
609 |
}
|
610 |
/**/
|
611 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
612 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_modify", get_defined_vars ());
|
613 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
614 |
}
|
624 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
|
625 |
&& $paypal["payer_email"] && $paypal["txn_id"] && $paypal["mc_gross"]/**/)
|
626 |
{
|
627 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
628 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_payment", get_defined_vars ());
|
629 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
630 |
/**/
|
631 |
$paypal["s2member_log"][] = "s2Member txn_type identified as subscr_payment|recurring_payment.";
|
632 |
$paypal["s2member_log"][] = "Sleeping for 2 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
|
633 |
+
sleep (2); /* Sleep here for a moment. PayPal® sometimes sends a subscr_payment before the subscr_signup, subscr_modify.
|
634 |
+
It is NOT a big deal if they do. However, s2Member goes to sleep here, just to help keep the log files in a logical order. */
|
635 |
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as subscr_payment|recurring_payment.";
|
636 |
/**/
|
637 |
list ($paypal["level"], $paypal["ccaps"]) = preg_split ("/\:/", $paypal["item_number"], 2);
|
640 |
{
|
641 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
642 |
/**/
|
643 |
+
update_user_option ($user_id, "s2member_last_payment_time", time ());
|
644 |
/**/
|
645 |
$paypal["s2member_log"][] = "Updated Last Payment Time for this Member.";
|
646 |
/**/
|
649 |
foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_urls"]) as $url)
|
650 |
/**/
|
651 |
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["subscr_id"])), $url)))
|
652 |
+
if (($url = preg_replace ("/%%subscr_payment%%/i", ws_plugin__s2member_esc_ds (urlencode ("1")), $url)) && ($url = preg_replace ("/%%subscr_payment_user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
|
653 |
+
if (($url = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["mc_gross"])), $url)) && ($url = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["txn_id"])), $url)))
|
654 |
+
if (($url = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["item_number"])), $url)) && ($url = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["item_name"])), $url)))
|
655 |
+
if (($url = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["first_name"])), $url)) && ($url = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["last_name"])), $url)))
|
656 |
+
if (($url = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($paypal["first_name"] . " " . $paypal["last_name"]))), $url)))
|
657 |
+
if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
|
658 |
+
/**/
|
659 |
+
if (($url = trim ($url))) /* Empty? */
|
660 |
+
ws_plugin__s2member_remote ($url);
|
661 |
/**/
|
662 |
$paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
|
663 |
}
|
664 |
/**/
|
665 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
666 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
|
667 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
668 |
}
|
673 |
set_transient (md5 ("s2member_transient_ipn_subscr_payment_" . $paypal["subscr_id"]), $_POST, 43200);
|
674 |
}
|
675 |
/**/
|
676 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
677 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_payment", get_defined_vars ());
|
678 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
679 |
}
|
690 |
&& ($paypal["item_name"] || ($paypal["item_name"] = $paypal["product_name"]))/**/
|
691 |
&& $paypal["payer_email"]/**/)
|
692 |
{
|
693 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
694 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_failed", get_defined_vars ());
|
695 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
696 |
/**/
|
702 |
$paypal["s2member_log"][] = "s2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.";
|
703 |
$paypal["s2member_log"][] = "When multiple consecutive payments fail, a special IPN response will be triggered.";
|
704 |
/**/
|
705 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
706 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_failed", get_defined_vars ());
|
707 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
708 |
/**/
|
709 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
710 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_failed", get_defined_vars ());
|
711 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
712 |
}
|
725 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]))/**/
|
726 |
&& $paypal["payer_email"]/**/)
|
727 |
{
|
728 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
729 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_cancel", get_defined_vars ());
|
730 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
731 |
/**/
|
735 |
/**/
|
736 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
737 |
{
|
738 |
+
if (!get_user_option ("s2member_auto_eot_time", $user_id)) /* Respect existing. */
|
739 |
{
|
740 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
741 |
/**/
|
742 |
$auto_eot_time = ws_plugin__s2member_paypal_auto_eot_time ($user_id, $paypal["period1"], $paypal["period3"]);
|
743 |
/**/
|
744 |
+
update_user_option ($user_id, "s2member_auto_eot_time", $auto_eot_time); /* s2Member will follow-up on this later. */
|
745 |
/**/
|
746 |
$paypal["s2member_log"][] = "Auto-EOT Time for this account: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
747 |
/**/
|
748 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
749 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_cancel", get_defined_vars ());
|
750 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
751 |
}
|
759 |
$paypal["s2member_log"][] = "Unable to handle Cancellation. Could not get the existing User ID from the DB.";
|
760 |
}
|
761 |
/**/
|
762 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
763 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_cancel", get_defined_vars ());
|
764 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
765 |
}
|
775 |
&& preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", $paypal["item_number"])/**/
|
776 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["recurring_payment_id"]) || ($paypal["subscr_id"] = $paypal["parent_txn_id"]))/**/)
|
777 |
{
|
778 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
779 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
|
780 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
781 |
/**/
|
783 |
/**/
|
784 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"], $paypal["option_selection1"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
785 |
{
|
786 |
+
if (!get_user_option ("s2member_auto_eot_time", $user_id) || /* Respect Auto-EOT; EXCEPT on refund/reverals. */
|
787 |
+
(!$paypal["txn_type"] && preg_match ("/^(refunded|reversed)$/i", $paypal["payment_status"]) && $paypal["parent_txn_id"]))
|
788 |
+
/* A refund/reversal will ALWAYS trigger an immediate EOT; even if there is already an Auto-EOT set. */
|
789 |
{
|
790 |
+
if (!$user->has_cap ("administrator")) /* Do NOT process this routine on Administrators. */
|
791 |
{
|
792 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"]) /* EOT enabled? */
|
793 |
{
|
798 |
$demotion_role = ws_plugin__s2member_force_demotion_role ("subscriber");
|
799 |
$user->set_role ($demotion_role); /* Defaults to Free Subscriber. */
|
800 |
/**/
|
|
|
|
|
|
|
|
|
|
|
801 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
802 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
803 |
$user->remove_cap ($ccap = $cap);
|
804 |
/**/
|
805 |
+
delete_user_option ($user_id, "s2member_custom");
|
806 |
+
delete_user_option ($user_id, "s2member_subscr_id");
|
807 |
+
delete_user_option ($user_id, "s2member_last_payment_time");
|
808 |
+
delete_user_option ($user_id, "s2member_auto_eot_time");
|
809 |
+
/**/
|
810 |
+
delete_user_option ($user_id, "s2member_file_download_access_arc");
|
811 |
+
delete_user_option ($user_id, "s2member_file_download_access_log");
|
812 |
/**/
|
813 |
ws_plugin__s2member_append_user_notes ($user_id, "Demoted by s2Member: " . date ("D M j, Y g:i a T"));
|
814 |
/**/
|
822 |
if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
|
823 |
if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
|
824 |
if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
|
825 |
+
if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
|
826 |
+
/**/
|
827 |
+
if (($url = trim ($url))) /* Empty? */
|
828 |
+
ws_plugin__s2member_remote ($url);
|
829 |
/**/
|
830 |
$paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
|
831 |
}
|
832 |
/**/
|
833 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
834 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
|
835 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
836 |
}
|
838 |
{
|
839 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
840 |
/**/
|
841 |
+
if (is_multisite ()) /* Multisite does NOT actually delete; ONLY removes. */
|
842 |
+
{
|
843 |
+
remove_user_from_blog ($user_id, $current_blog->blog_id);
|
844 |
+
/* This will automatically trigger `eot_del_notification_urls` as well. */
|
845 |
+
ws_plugin__s2member_handle_ms_user_deletions ($user_id, $current_blog->blog_id, "s2says");
|
846 |
+
}
|
847 |
+
/**/
|
848 |
+
else /* Otherwise, we can actually delete them. */
|
849 |
+
/* This will automatically trigger `eot_del_notification_urls` as well. */
|
850 |
+
wp_delete_user ($user_id); /* `ws_plugin__s2member_handle_user_deletions()` */
|
851 |
/**/
|
852 |
+
$paypal["s2member_log"][] = "This Member's account has been " . ((is_multisite ()) ? "removed" : "deleted") . ".";
|
853 |
/**/
|
854 |
$paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
|
855 |
/**/
|
856 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
857 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delete", get_defined_vars ());
|
858 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
859 |
}
|
860 |
/**/
|
861 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
862 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot", get_defined_vars ());
|
863 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
864 |
}
|
867 |
{
|
868 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
869 |
/**/
|
870 |
+
update_user_option ($user_id, "s2member_auto_eot_time", ($auto_eot_time = strtotime ("now")));
|
871 |
/**/
|
872 |
$paypal["s2member_log"][] = "Auto-EOT is currently disabled. Skipping immediate EOT (demote|delete), for now.";
|
873 |
$paypal["s2member_log"][] = "Recording the Auto-EOT Time for this Member's account: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
874 |
/**/
|
875 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
876 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_disabled", get_defined_vars ());
|
877 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
878 |
}
|
879 |
}
|
880 |
else
|
881 |
{
|
882 |
+
$paypal["s2member_log"][] = "Unable to (demote|delete) Member. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.";
|
883 |
}
|
884 |
}
|
885 |
else
|
903 |
{
|
904 |
foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ref_rev_notification_urls"]) as $url)
|
905 |
/**/
|
906 |
+
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["subscr_id"])), $url)) && ($url = preg_replace ("/%%parent_txn_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["parent_txn_id"])), $url)))
|
907 |
+
if (($url = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["item_number"])), $url)) && ($url = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["item_name"])), $url)))
|
908 |
+
if (($url = preg_replace ("/%%-amount%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["mc_gross"])), $url)) && ($url = preg_replace ("/%%-fee%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["mc_fee"])), $url)))
|
909 |
if (($url = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["first_name"])), $url)) && ($url = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["last_name"])), $url)))
|
910 |
if (($url = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($paypal["first_name"] . " " . $paypal["last_name"]))), $url)))
|
911 |
if (($url = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["payer_email"])), $url)))
|
912 |
+
if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
|
913 |
+
/**/
|
914 |
+
if (($url = trim ($url))) /* Empty? */
|
915 |
+
ws_plugin__s2member_remote ($url);
|
916 |
/**/
|
917 |
$paypal["s2member_log"][] = "Refund/Reversal Notification URLs have been processed.";
|
918 |
}
|
919 |
/**/
|
920 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
921 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
|
922 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
923 |
}
|
924 |
/**/
|
925 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
926 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_eot", get_defined_vars ());
|
927 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
928 |
}
|
956 |
/*
|
957 |
Otherwise, POST vars could not even be verified. This needs to be reported in the logs.
|
958 |
*/
|
959 |
+
else /* Extensive log reporting here. This is an area where many site owners find trouble. Depending on server configuration; remote HTTPS connections may fail. */
|
960 |
{
|
961 |
$paypal["s2member_log"][] = "Unable to verify POST vars. Possibly caused by a fraudulent request. If this error continues, please run IPN tests against your server from a PayPal® Sandbox account. They provide special diagnostic tools to assist you.";
|
962 |
+
$paypal["s2member_log"][] = "If you're absolutely SURE that your PayPal® configuration is valid, you may want to run some tests on your server, just to be sure \$_POST variables are populated, and that your server is able to connect to PayPal® over an HTTPS connection.";
|
963 |
+
$paypal["s2member_log"][] = "s2Member uses the WP_Http class for remote connections; which will try to use cURL first, and then fall back on the FOPEN method when cURL is not available. On a Windows® server, you may have to disable your cURL extension. Instead, set allow_url_fopen = yes in your php.ini file. The cURL extension (usually) does NOT support SSL connections on a Windows® server.";
|
964 |
$paypal["s2member_log"][] = var_export ($_POST, true); /* Recording _POST vars for analysis and debugging. */
|
965 |
}
|
966 |
/*
|
975 |
$paypal["s2member_paypal_proxy_verification"] = $_GET["s2member_paypal_proxy_verification"];
|
976 |
/*
|
977 |
If debugging/logging is enabled; we need to append $paypal to the log file.
|
978 |
+
Logging now supports Multisite Networking as well.
|
979 |
*/
|
980 |
+
$log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
|
981 |
+
$log4 = (is_multisite () && !is_main_site ()) ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
|
982 |
+
$log2 = (is_multisite () && !is_main_site ()) ? "paypal-ipn-4-" . trim (preg_replace ("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "paypal-ipn.log";
|
983 |
+
/**/
|
984 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) /* Append to log? */
|
985 |
if (is_dir ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
986 |
if (is_writable ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
987 |
+
file_put_contents ($logs_dir . "/" . $log2, $log4 . "\n" . var_export ($paypal, true) . "\n\n", FILE_APPEND);
|
988 |
/**/
|
989 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
990 |
do_action ("ws_plugin__s2member_during_paypal_notify", get_defined_vars ());
|
991 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
992 |
/**/
|
993 |
+
exit ($paypal["proxy_return_url"]); /* Return, if/when applicable. */
|
994 |
}
|
995 |
/**/
|
996 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
997 |
do_action ("ws_plugin__s2member_after_paypal_notify", get_defined_vars ());
|
998 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
999 |
}
|
includes/functions/paypal-return.inc.php
CHANGED
@@ -22,6 +22,8 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
22 |
{
|
23 |
function ws_plugin__s2member_paypal_return ()
|
24 |
{
|
|
|
|
|
25 |
do_action ("ws_plugin__s2member_before_paypal_return", get_defined_vars ());
|
26 |
/**/
|
27 |
if ($_GET["s2member_paypal_return"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])
|
@@ -142,13 +144,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
142 |
/* Check for both the old & new subscr_id's, just in case the IPN routine already changed it. */
|
143 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"], $paypal["option_selection1"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
144 |
{
|
145 |
-
if (
|
146 |
{
|
147 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
148 |
/**/
|
149 |
$user->set_role ("s2member_level" . $paypal["level"]);
|
150 |
-
update_usermeta ($user_id, "s2member_subscr_id", $paypal["subscr_id"]);
|
151 |
-
update_usermeta ($user_id, "s2member_custom", $paypal["custom"]);
|
152 |
/**/
|
153 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
154 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
@@ -158,13 +158,16 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
158 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
159 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
160 |
/**/
|
161 |
-
|
162 |
-
|
|
|
|
|
|
|
163 |
/**/
|
164 |
if (preg_match ("/^web_accept$/i", $paypal["txn_type"]) && $paypal["eotper"])
|
165 |
-
|
166 |
else /* Otherwise, we need to clear the eot time. */
|
167 |
-
|
168 |
/**/
|
169 |
ws_plugin__s2member_clear_user_note_lines ($user_id, "/^Demoted by s2Member\:/");
|
170 |
/**/
|
@@ -183,12 +186,12 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
183 |
}
|
184 |
else
|
185 |
{
|
186 |
-
$paypal["s2member_log"][] = "Unable to modify Subscription. The existing User ID
|
187 |
/**/
|
188 |
$paypal["s2member_log"][] = "Redirecting Customer to the Login Page, due to an error that occurred.";
|
189 |
/**/
|
190 |
echo '<script type="text/javascript">' . "\n";
|
191 |
-
echo "alert('ERROR: Unable to modify Subscription. Please contact Support for assistance.\\n\\nThe existing User ID
|
192 |
echo "window.location = '" . esc_js (wp_login_url ()) . "';";
|
193 |
echo '</script>' . "\n";
|
194 |
}
|
@@ -232,12 +235,22 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
232 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
233 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
234 |
/**/
|
235 |
-
$paypal["s2member_log"][] = "Redirecting Customer to Registration Page. They need to
|
236 |
/**/
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
/**/
|
242 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
243 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
@@ -265,13 +278,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
265 |
/**/
|
266 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
267 |
{
|
268 |
-
if (
|
269 |
{
|
270 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
271 |
/**/
|
272 |
$user->set_role ("s2member_level" . $paypal["level"]);
|
273 |
-
update_usermeta ($user_id, "s2member_subscr_id", $paypal["subscr_id"]);
|
274 |
-
update_usermeta ($user_id, "s2member_custom", $paypal["custom"]);
|
275 |
/**/
|
276 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
277 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
@@ -281,9 +292,13 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
281 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
282 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
283 |
/**/
|
284 |
-
|
285 |
-
|
286 |
-
|
|
|
|
|
|
|
|
|
287 |
/**/
|
288 |
ws_plugin__s2member_clear_user_note_lines ($user_id, "/^Demoted by s2Member\:/");
|
289 |
/**/
|
@@ -302,12 +317,12 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
302 |
}
|
303 |
else
|
304 |
{
|
305 |
-
$paypal["s2member_log"][] = "Unable to modify Subscription. The existing User ID
|
306 |
/**/
|
307 |
$paypal["s2member_log"][] = "Redirecting Customer to the Login Page, due to an error that occurred.";
|
308 |
/**/
|
309 |
echo '<script type="text/javascript">' . "\n";
|
310 |
-
echo "alert('ERROR: Unable to modify Subscription. Please contact Support for assistance.\\n\\nThe existing User ID
|
311 |
echo "window.location = '" . esc_js (wp_login_url ()) . "';";
|
312 |
echo '</script>' . "\n";
|
313 |
}
|
@@ -379,9 +394,11 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
379 |
do_action ("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars ());
|
380 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
381 |
}
|
382 |
-
else
|
383 |
{
|
384 |
$paypal["s2member_log"][] = "Unable to verify POST vars. This is most likely related to an invalid PayPal® configuration. Please check: s2Member -> PayPal® Options.";
|
|
|
|
|
385 |
$paypal["s2member_log"][] = var_export ($_POST, true); /* Recording _POST vars for analysis and debugging. */
|
386 |
/**/
|
387 |
$paypal["s2member_log"][] = "Redirecting Customer to the Login Page, due to an error that occurred.";
|
@@ -391,17 +408,28 @@ if (!function_exists ("ws_plugin__s2member_paypal_return"))
|
|
391 |
echo "window.location = '" . esc_js (wp_login_url ()) . "';";
|
392 |
echo '</script>' . "\n";
|
393 |
}
|
394 |
-
|
|
|
|
|
395 |
if ($_GET["s2member_paypal_proxy"]) /* For proxy identification. */
|
396 |
$paypal["s2member_paypal_proxy"] = $_GET["s2member_paypal_proxy"];
|
397 |
-
|
|
|
|
|
398 |
if ($_GET["s2member_paypal_proxy_verification"]) /* Proxy identification w/verification. */
|
399 |
$paypal["s2member_paypal_proxy_verification"] = $_GET["s2member_paypal_proxy_verification"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
/**/
|
401 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) /* Append to log? */
|
402 |
-
if (is_dir ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
403 |
if (is_writable ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
404 |
-
file_put_contents ($logs_dir . "/
|
405 |
/**/
|
406 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
407 |
do_action ("ws_plugin__s2member_during_paypal_return", get_defined_vars ());
|
22 |
{
|
23 |
function ws_plugin__s2member_paypal_return ()
|
24 |
{
|
25 |
+
global $current_site, $current_blog; /* For Multisite support. */
|
26 |
+
/**/
|
27 |
do_action ("ws_plugin__s2member_before_paypal_return", get_defined_vars ());
|
28 |
/**/
|
29 |
if ($_GET["s2member_paypal_return"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])
|
144 |
/* Check for both the old & new subscr_id's, just in case the IPN routine already changed it. */
|
145 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"], $paypal["option_selection1"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
146 |
{
|
147 |
+
if (!$user->has_cap ("administrator")) /* Do NOT process this routine on Administrators. */
|
148 |
{
|
149 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
150 |
/**/
|
151 |
$user->set_role ("s2member_level" . $paypal["level"]);
|
|
|
|
|
152 |
/**/
|
153 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
154 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
158 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
159 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
160 |
/**/
|
161 |
+
update_user_option ($user_id, "s2member_subscr_id", $paypal["subscr_id"]);
|
162 |
+
update_user_option ($user_id, "s2member_custom", $paypal["custom"]);
|
163 |
+
/**/
|
164 |
+
delete_user_option ($user_id, "s2member_file_download_access_arc");
|
165 |
+
delete_user_option ($user_id, "s2member_file_download_access_log");
|
166 |
/**/
|
167 |
if (preg_match ("/^web_accept$/i", $paypal["txn_type"]) && $paypal["eotper"])
|
168 |
+
update_user_option ($user_id, "s2member_auto_eot_time", ws_plugin__s2member_paypal_auto_eot_time (0, 0, 0, $paypal["eotper"]));
|
169 |
else /* Otherwise, we need to clear the eot time. */
|
170 |
+
delete_user_option ($user_id, "s2member_auto_eot_time");
|
171 |
/**/
|
172 |
ws_plugin__s2member_clear_user_note_lines ($user_id, "/^Demoted by s2Member\:/");
|
173 |
/**/
|
186 |
}
|
187 |
else
|
188 |
{
|
189 |
+
$paypal["s2member_log"][] = "Unable to modify Subscription. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.";
|
190 |
/**/
|
191 |
$paypal["s2member_log"][] = "Redirecting Customer to the Login Page, due to an error that occurred.";
|
192 |
/**/
|
193 |
echo '<script type="text/javascript">' . "\n";
|
194 |
+
echo "alert('ERROR: Unable to modify Subscription. Please contact Support for assistance.\\n\\nThe existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access. Please make sure that you are NOT logged in as an Administrator while testing.');" . "\n";
|
195 |
echo "window.location = '" . esc_js (wp_login_url ()) . "';";
|
196 |
echo '</script>' . "\n";
|
197 |
}
|
235 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
236 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
237 |
/**/
|
238 |
+
$paypal["s2member_log"][] = "Redirecting Customer to Registration Page. They need to Register now.";
|
239 |
/**/
|
240 |
+
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && is_main_site ())
|
241 |
+
{
|
242 |
+
echo '<script type="text/javascript">' . "\n";
|
243 |
+
echo "alert('Thank You! Your account has been approved.\\nThe next step is to Register.\\n\\nPlease click OK to Register now.');" . "\n";/**/
|
244 |
+
echo "window.location = '" . esc_js (apply_filters ("wp_signup_location", get_bloginfo ("wpurl") . "/wp-signup.php")) . "';" . "\n";
|
245 |
+
echo '</script>' . "\n";
|
246 |
+
}
|
247 |
+
else /* Otherwise, this is NOT a Multisite install. Or it is, but the Super Administrator is NOT selling Blog creation. */
|
248 |
+
{
|
249 |
+
echo '<script type="text/javascript">' . "\n";
|
250 |
+
echo "alert('Thank You! Your account has been approved.\\nThe next step is to Register a Username.\\n\\nPlease click OK to Register now.');" . "\n";/**/
|
251 |
+
echo "window.location = '" . esc_js (add_query_arg ("action", "register", wp_login_url ())) . "';" . "\n";
|
252 |
+
echo '</script>' . "\n";
|
253 |
+
}
|
254 |
/**/
|
255 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
256 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
278 |
/**/
|
279 |
if (($user_id = ws_plugin__s2member_paypal_user_id ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
280 |
{
|
281 |
+
if (!$user->has_cap ("administrator")) /* Do NOT process this routine on Administrators. */
|
282 |
{
|
283 |
$processing = $during = true; /* Yes, we ARE processing this. */
|
284 |
/**/
|
285 |
$user->set_role ("s2member_level" . $paypal["level"]);
|
|
|
|
|
286 |
/**/
|
287 |
foreach ($user->allcaps as $cap => $cap_enabled)
|
288 |
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
292 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
293 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
294 |
/**/
|
295 |
+
update_user_option ($user_id, "s2member_subscr_id", $paypal["subscr_id"]);
|
296 |
+
update_user_option ($user_id, "s2member_custom", $paypal["custom"]);
|
297 |
+
/**/
|
298 |
+
delete_user_option ($user_id, "s2member_file_download_access_arc");
|
299 |
+
delete_user_option ($user_id, "s2member_file_download_access_log");
|
300 |
+
/**/
|
301 |
+
delete_user_option ($user_id, "s2member_auto_eot_time");
|
302 |
/**/
|
303 |
ws_plugin__s2member_clear_user_note_lines ($user_id, "/^Demoted by s2Member\:/");
|
304 |
/**/
|
317 |
}
|
318 |
else
|
319 |
{
|
320 |
+
$paypal["s2member_log"][] = "Unable to modify Subscription. The existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access.";
|
321 |
/**/
|
322 |
$paypal["s2member_log"][] = "Redirecting Customer to the Login Page, due to an error that occurred.";
|
323 |
/**/
|
324 |
echo '<script type="text/javascript">' . "\n";
|
325 |
+
echo "alert('ERROR: Unable to modify Subscription. Please contact Support for assistance.\\n\\nThe existing User ID is associated with an Administrator. Stopping here. Otherwise, an Administrator could lose access. Please make sure that you are NOT logged in as an Administrator while testing.');" . "\n";
|
326 |
echo "window.location = '" . esc_js (wp_login_url ()) . "';";
|
327 |
echo '</script>' . "\n";
|
328 |
}
|
394 |
do_action ("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars ());
|
395 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
396 |
}
|
397 |
+
else /* Extensive log reporting here. This is an area where many site owners find trouble. Depending on server configuration; remote HTTPS connections may fail. */
|
398 |
{
|
399 |
$paypal["s2member_log"][] = "Unable to verify POST vars. This is most likely related to an invalid PayPal® configuration. Please check: s2Member -> PayPal® Options.";
|
400 |
+
$paypal["s2member_log"][] = "If you're absolutely SURE that your PayPal® configuration is valid, you may want to run some tests on your server, just to be sure \$_POST variables are populated, and that your server is able to connect to PayPal® over an HTTPS connection.";
|
401 |
+
$paypal["s2member_log"][] = "s2Member uses the WP_Http class for remote connections; which will try to use cURL first, and then fall back on the FOPEN method when cURL is not available. On a Windows® server, you may have to disable your cURL extension. Instead, set allow_url_fopen = yes in your php.ini file. The cURL extension (usually) does NOT support SSL connections on a Windows® server.";
|
402 |
$paypal["s2member_log"][] = var_export ($_POST, true); /* Recording _POST vars for analysis and debugging. */
|
403 |
/**/
|
404 |
$paypal["s2member_log"][] = "Redirecting Customer to the Login Page, due to an error that occurred.";
|
408 |
echo "window.location = '" . esc_js (wp_login_url ()) . "';";
|
409 |
echo '</script>' . "\n";
|
410 |
}
|
411 |
+
/*
|
412 |
+
Add RTN proxy identification ( when available ) to the $paypal array for log reporting.
|
413 |
+
*/
|
414 |
if ($_GET["s2member_paypal_proxy"]) /* For proxy identification. */
|
415 |
$paypal["s2member_paypal_proxy"] = $_GET["s2member_paypal_proxy"];
|
416 |
+
/*
|
417 |
+
Also add RTN proxy self-verification ( when available ) to the $paypal array.
|
418 |
+
*/
|
419 |
if ($_GET["s2member_paypal_proxy_verification"]) /* Proxy identification w/verification. */
|
420 |
$paypal["s2member_paypal_proxy_verification"] = $_GET["s2member_paypal_proxy_verification"];
|
421 |
+
/*
|
422 |
+
If debugging/logging is enabled; we need to append $paypal to the log file.
|
423 |
+
Logging now supports Multisite Networking as well.
|
424 |
+
*/
|
425 |
+
$log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
|
426 |
+
$log4 = (is_multisite () && !is_main_site ()) ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
|
427 |
+
$log2 = (is_multisite () && !is_main_site ()) ? "paypal-rtn-4-" . trim (preg_replace ("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "paypal-rtn.log";
|
428 |
/**/
|
429 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) /* Append to log? */
|
430 |
+
if (is_dir ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) /* Dir exists? */
|
431 |
if (is_writable ($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]))
|
432 |
+
file_put_contents ($logs_dir . "/" . $log2, $log4 . "\n" . var_export ($paypal, true) . "\n\n", FILE_APPEND);
|
433 |
/**/
|
434 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
435 |
do_action ("ws_plugin__s2member_during_paypal_return", get_defined_vars ());
|
includes/functions/paypal-utilities.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Get POST vars from PayPal®, verify and return array.
|
18 |
*/
|
@@ -20,13 +20,13 @@ if (!function_exists ("ws_plugin__s2member_paypal_postvars"))
|
|
20 |
{
|
21 |
function ws_plugin__s2member_paypal_postvars ()
|
22 |
{
|
23 |
-
eval
|
24 |
do_action ("ws_plugin__s2member_before_paypal_postvars", get_defined_vars ());
|
25 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
26 |
/*
|
27 |
Custom conditionals can be applied by filters.
|
28 |
*/
|
29 |
-
eval
|
30 |
if (!($postvars = apply_filters ("ws_plugin__s2member_during_paypal_postvars_conditionals", array (), get_defined_vars ())))
|
31 |
{
|
32 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
@@ -67,18 +67,12 @@ if (!function_exists ("ws_plugin__s2member_paypal_postvars"))
|
|
67 |
/**/
|
68 |
$endpoint = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com";
|
69 |
/**/
|
70 |
-
if ($_GET["s2member_paypal_proxy"] &&
|
71 |
-
|
72 |
-
|
73 |
-
}
|
74 |
-
else if ($_GET["s2member_paypal_proxy"] && $_GET["s2member_paypal_proxy_verification"] === md5 (ws_plugin__s2member_xencrypt (preg_replace ("/\:[0-9]+$/", "", $_SERVER["HTTP_HOST"]))))
|
75 |
-
{
|
76 |
-
return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
|
77 |
-
}
|
78 |
else if (strtolower (trim (ws_plugin__s2member_remote ("https://" . $endpoint . "/cgi-bin/webscr", $postback, array ("timeout" => 20)))) === "verified")
|
79 |
-
|
80 |
-
|
81 |
-
}
|
82 |
else /* Nope. */
|
83 |
return false;
|
84 |
}
|
@@ -94,6 +88,28 @@ if (!function_exists ("ws_plugin__s2member_paypal_postvars"))
|
|
94 |
}
|
95 |
}
|
96 |
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
Get the custom value for an existing Member, referenced by a Subscr. ID.
|
98 |
A second lookup parameter can be provided, which will trigger some additional routines.
|
99 |
The $os0 value comes from advanced update vars, pertaining to subscription modifications.
|
@@ -104,21 +120,21 @@ if (!function_exists ("ws_plugin__s2member_paypal_custom"))
|
|
104 |
{
|
105 |
global $wpdb; /* Need global DB obj. */
|
106 |
/**/
|
107 |
-
eval
|
108 |
do_action ("ws_plugin__s2member_before_paypal_custom", get_defined_vars ());
|
109 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
110 |
/**/
|
111 |
if ($subscr_id && $os0) /* This case includes some additional routines that can use the $os0 value. */
|
112 |
{
|
113 |
-
if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 's2member_subscr_id' AND (`meta_value` = '" . $wpdb->escape ($subscr_id) . "' OR `meta_value` = '" . $wpdb->escape ($os0) . "') LIMIT 1"))/**/
|
114 |
|| ($q = $wpdb->get_row ("SELECT `ID` AS `user_id` FROM `" . $wpdb->users . "` WHERE `ID` = '" . $wpdb->escape ($os0) . "' LIMIT 1")))
|
115 |
-
if (($custom =
|
116 |
return apply_filters ("ws_plugin__s2member_paypal_custom", $custom, get_defined_vars ());
|
117 |
}
|
118 |
else if ($subscr_id) /* Otherwise, if all we have is a Subscr. ID value. */
|
119 |
{
|
120 |
-
if ($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 's2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))
|
121 |
-
if (($custom =
|
122 |
return apply_filters ("ws_plugin__s2member_paypal_custom", $custom, get_defined_vars ());
|
123 |
}
|
124 |
/**/
|
@@ -136,19 +152,19 @@ if (!function_exists ("ws_plugin__s2member_paypal_user_id"))
|
|
136 |
{
|
137 |
global $wpdb; /* Need global DB obj. */
|
138 |
/**/
|
139 |
-
eval
|
140 |
do_action ("ws_plugin__s2member_before_paypal_user_id", get_defined_vars ());
|
141 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
142 |
/**/
|
143 |
if ($subscr_id && $os0) /* This case includes some additional routines that can use the $os0 value. */
|
144 |
{
|
145 |
-
if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 's2member_subscr_id' AND (`meta_value` = '" . $wpdb->escape ($subscr_id) . "' OR `meta_value` = '" . $wpdb->escape ($os0) . "') LIMIT 1"))/**/
|
146 |
|| ($q = $wpdb->get_row ("SELECT `ID` AS `user_id` FROM `" . $wpdb->users . "` WHERE `ID` = '" . $wpdb->escape ($os0) . "' LIMIT 1")))
|
147 |
return apply_filters ("ws_plugin__s2member_paypal_user_id", $q->user_id, get_defined_vars ());
|
148 |
}
|
149 |
else if ($subscr_id) /* Otherwise, if all we have is a Subscr. ID value. */
|
150 |
{
|
151 |
-
if ($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 's2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))
|
152 |
return apply_filters ("ws_plugin__s2member_paypal_user_id", $q->user_id, get_defined_vars ());
|
153 |
}
|
154 |
/**/
|
@@ -163,14 +179,14 @@ if (!function_exists ("ws_plugin__s2member_paypal_auto_eot_time"))
|
|
163 |
{
|
164 |
function ws_plugin__s2member_paypal_auto_eot_time ($user_id = FALSE, $period1 = FALSE, $period3 = FALSE, $eotper = FALSE)
|
165 |
{
|
166 |
-
eval
|
167 |
do_action ("ws_plugin__s2member_before_paypal_auto_eot_time", get_defined_vars ());
|
168 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
169 |
/**/
|
170 |
if ($user_id && ($user = new WP_User ($user_id)) && $user->ID) /* Valid user_id? */
|
171 |
{
|
172 |
$registration_time = strtotime ($user->user_registered);
|
173 |
-
$last_payment_time = (int)
|
174 |
/**/
|
175 |
if (!($p1_time = 0) && ($period1 = trim (strtoupper ($period1))))
|
176 |
{
|
@@ -259,7 +275,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_pro_term"))
|
|
259 |
{
|
260 |
function ws_plugin__s2member_paypal_pro_term ($term = FALSE)
|
261 |
{
|
262 |
-
eval
|
263 |
do_action ("ws_plugin__s2member_before_paypal_pro_term", get_defined_vars ());
|
264 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
265 |
/**/
|
@@ -276,7 +292,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_std_term"))
|
|
276 |
{
|
277 |
function ws_plugin__s2member_paypal_std_term ($term = FALSE)
|
278 |
{
|
279 |
-
eval
|
280 |
do_action ("ws_plugin__s2member_before_paypal_std_term", get_defined_vars ());
|
281 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
282 |
/**/
|
@@ -295,7 +311,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_term_cycle"))
|
|
295 |
{
|
296 |
function ws_plugin__s2member_paypal_term_cycle ($term_or_period_term = FALSE)
|
297 |
{
|
298 |
-
eval
|
299 |
do_action ("ws_plugin__s2member_before_paypal_term_cycle", get_defined_vars ());
|
300 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
301 |
/**/
|
@@ -314,7 +330,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_pro_item_number"))
|
|
314 |
{
|
315 |
function ws_plugin__s2member_paypal_pro_item_number ($array_or_string = FALSE)
|
316 |
{
|
317 |
-
eval
|
318 |
do_action ("ws_plugin__s2member_before_paypal_pro_item_number", get_defined_vars ());
|
319 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
320 |
/**/
|
@@ -347,7 +363,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_pro_period1"))
|
|
347 |
{
|
348 |
function ws_plugin__s2member_paypal_pro_period1 ($array_or_string = FALSE)
|
349 |
{
|
350 |
-
eval
|
351 |
do_action ("ws_plugin__s2member_before_paypal_pro_period1", get_defined_vars ());
|
352 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
353 |
/**/
|
@@ -392,7 +408,7 @@ if (!function_exists ("ws_plugin__s2member_paypal_pro_period3"))
|
|
392 |
{
|
393 |
function ws_plugin__s2member_paypal_pro_period3 ($array_or_string = FALSE)
|
394 |
{
|
395 |
-
eval
|
396 |
do_action ("ws_plugin__s2member_before_paypal_pro_period3", get_defined_vars ());
|
397 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
398 |
/**/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Get POST vars from PayPal®, verify and return array.
|
18 |
*/
|
20 |
{
|
21 |
function ws_plugin__s2member_paypal_postvars ()
|
22 |
{
|
23 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
24 |
do_action ("ws_plugin__s2member_before_paypal_postvars", get_defined_vars ());
|
25 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
26 |
/*
|
27 |
Custom conditionals can be applied by filters.
|
28 |
*/
|
29 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
30 |
if (!($postvars = apply_filters ("ws_plugin__s2member_during_paypal_postvars_conditionals", array (), get_defined_vars ())))
|
31 |
{
|
32 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
67 |
/**/
|
68 |
$endpoint = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com";
|
69 |
/**/
|
70 |
+
if ($_GET["s2member_paypal_proxy"] && $_GET["s2member_paypal_proxy_verification"] === ws_plugin__s2member_paypal_proxy_key_gen ())
|
71 |
+
return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
|
72 |
+
/**/
|
|
|
|
|
|
|
|
|
|
|
73 |
else if (strtolower (trim (ws_plugin__s2member_remote ("https://" . $endpoint . "/cgi-bin/webscr", $postback, array ("timeout" => 20)))) === "verified")
|
74 |
+
return apply_filters ("ws_plugin__s2member_paypal_postvars", $postvars, get_defined_vars ());
|
75 |
+
/**/
|
|
|
76 |
else /* Nope. */
|
77 |
return false;
|
78 |
}
|
88 |
}
|
89 |
}
|
90 |
/*
|
91 |
+
Function generated a PayPal® Proxy Key, for simulated IPN responses.
|
92 |
+
*/
|
93 |
+
if (!function_exists ("ws_plugin__s2member_paypal_proxy_key_gen"))
|
94 |
+
{
|
95 |
+
function ws_plugin__s2member_paypal_proxy_key_gen () /* Generate Key. */
|
96 |
+
{
|
97 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
98 |
+
/**/
|
99 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
100 |
+
do_action ("ws_plugin__s2member_before_paypal_proxy_key_gen", get_defined_vars ());
|
101 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
102 |
+
/**/
|
103 |
+
if (!is_multisite () || is_main_site ())
|
104 |
+
$key = md5 (ws_plugin__s2member_xencrypt (preg_replace ("/\:[0-9]+$/", "", $_SERVER["HTTP_HOST"])));
|
105 |
+
/**/
|
106 |
+
else if (is_multisite ())
|
107 |
+
$key = md5 (ws_plugin__s2member_xencrypt ($current_blog->domain . $current_blog->path));
|
108 |
+
/**/
|
109 |
+
return apply_filters ("ws_plugin__s2member_paypal_proxy_key_gen", $key, get_defined_vars ());
|
110 |
+
}
|
111 |
+
}
|
112 |
+
/*
|
113 |
Get the custom value for an existing Member, referenced by a Subscr. ID.
|
114 |
A second lookup parameter can be provided, which will trigger some additional routines.
|
115 |
The $os0 value comes from advanced update vars, pertaining to subscription modifications.
|
120 |
{
|
121 |
global $wpdb; /* Need global DB obj. */
|
122 |
/**/
|
123 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
124 |
do_action ("ws_plugin__s2member_before_paypal_custom", get_defined_vars ());
|
125 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
126 |
/**/
|
127 |
if ($subscr_id && $os0) /* This case includes some additional routines that can use the $os0 value. */
|
128 |
{
|
129 |
+
if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND (`meta_value` = '" . $wpdb->escape ($subscr_id) . "' OR `meta_value` = '" . $wpdb->escape ($os0) . "') LIMIT 1"))/**/
|
130 |
|| ($q = $wpdb->get_row ("SELECT `ID` AS `user_id` FROM `" . $wpdb->users . "` WHERE `ID` = '" . $wpdb->escape ($os0) . "' LIMIT 1")))
|
131 |
+
if (($custom = get_user_option ("s2member_custom", $q->user_id)))
|
132 |
return apply_filters ("ws_plugin__s2member_paypal_custom", $custom, get_defined_vars ());
|
133 |
}
|
134 |
else if ($subscr_id) /* Otherwise, if all we have is a Subscr. ID value. */
|
135 |
{
|
136 |
+
if ($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))
|
137 |
+
if (($custom = get_user_option ("s2member_custom", $q->user_id)))
|
138 |
return apply_filters ("ws_plugin__s2member_paypal_custom", $custom, get_defined_vars ());
|
139 |
}
|
140 |
/**/
|
152 |
{
|
153 |
global $wpdb; /* Need global DB obj. */
|
154 |
/**/
|
155 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
156 |
do_action ("ws_plugin__s2member_before_paypal_user_id", get_defined_vars ());
|
157 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
158 |
/**/
|
159 |
if ($subscr_id && $os0) /* This case includes some additional routines that can use the $os0 value. */
|
160 |
{
|
161 |
+
if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND (`meta_value` = '" . $wpdb->escape ($subscr_id) . "' OR `meta_value` = '" . $wpdb->escape ($os0) . "') LIMIT 1"))/**/
|
162 |
|| ($q = $wpdb->get_row ("SELECT `ID` AS `user_id` FROM `" . $wpdb->users . "` WHERE `ID` = '" . $wpdb->escape ($os0) . "' LIMIT 1")))
|
163 |
return apply_filters ("ws_plugin__s2member_paypal_user_id", $q->user_id, get_defined_vars ());
|
164 |
}
|
165 |
else if ($subscr_id) /* Otherwise, if all we have is a Subscr. ID value. */
|
166 |
{
|
167 |
+
if ($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))
|
168 |
return apply_filters ("ws_plugin__s2member_paypal_user_id", $q->user_id, get_defined_vars ());
|
169 |
}
|
170 |
/**/
|
179 |
{
|
180 |
function ws_plugin__s2member_paypal_auto_eot_time ($user_id = FALSE, $period1 = FALSE, $period3 = FALSE, $eotper = FALSE)
|
181 |
{
|
182 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
183 |
do_action ("ws_plugin__s2member_before_paypal_auto_eot_time", get_defined_vars ());
|
184 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
185 |
/**/
|
186 |
if ($user_id && ($user = new WP_User ($user_id)) && $user->ID) /* Valid user_id? */
|
187 |
{
|
188 |
$registration_time = strtotime ($user->user_registered);
|
189 |
+
$last_payment_time = (int)get_user_option ("s2member_last_payment_time", $user_id);
|
190 |
/**/
|
191 |
if (!($p1_time = 0) && ($period1 = trim (strtoupper ($period1))))
|
192 |
{
|
275 |
{
|
276 |
function ws_plugin__s2member_paypal_pro_term ($term = FALSE)
|
277 |
{
|
278 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
279 |
do_action ("ws_plugin__s2member_before_paypal_pro_term", get_defined_vars ());
|
280 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
281 |
/**/
|
292 |
{
|
293 |
function ws_plugin__s2member_paypal_std_term ($term = FALSE)
|
294 |
{
|
295 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
296 |
do_action ("ws_plugin__s2member_before_paypal_std_term", get_defined_vars ());
|
297 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
298 |
/**/
|
311 |
{
|
312 |
function ws_plugin__s2member_paypal_term_cycle ($term_or_period_term = FALSE)
|
313 |
{
|
314 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
315 |
do_action ("ws_plugin__s2member_before_paypal_term_cycle", get_defined_vars ());
|
316 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
317 |
/**/
|
330 |
{
|
331 |
function ws_plugin__s2member_paypal_pro_item_number ($array_or_string = FALSE)
|
332 |
{
|
333 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
334 |
do_action ("ws_plugin__s2member_before_paypal_pro_item_number", get_defined_vars ());
|
335 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
336 |
/**/
|
363 |
{
|
364 |
function ws_plugin__s2member_paypal_pro_period1 ($array_or_string = FALSE)
|
365 |
{
|
366 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
367 |
do_action ("ws_plugin__s2member_before_paypal_pro_period1", get_defined_vars ());
|
368 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
369 |
/**/
|
408 |
{
|
409 |
function ws_plugin__s2member_paypal_pro_period3 ($array_or_string = FALSE)
|
410 |
{
|
411 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
412 |
do_action ("ws_plugin__s2member_before_paypal_pro_period3", get_defined_vars ());
|
413 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
414 |
/**/
|
includes/functions/post-level-access.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function for handling post level access permissions.
|
18 |
Attach to: add_action("template_redirect");
|
@@ -66,6 +66,14 @@ if (!function_exists ("ws_plugin__s2member_check_post_level_access"))
|
|
66 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($post_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($post_ID) && wp_redirect (add_query_arg ("s2member_sp_req", $post_ID, get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
67 |
exit ();
|
68 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
do_action ("ws_plugin__s2member_during_check_post_level_access", get_defined_vars ());
|
70 |
}
|
71 |
}
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Function for handling post level access permissions.
|
18 |
Attach to: add_action("template_redirect");
|
66 |
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($post_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && ws_plugin__s2member_nocache_constants (true) !== "nill" && !ws_plugin__s2member_sp_access ($post_ID) && wp_redirect (add_query_arg ("s2member_sp_req", $post_ID, get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]))) !== "nill")
|
67 |
exit ();
|
68 |
/**/
|
69 |
+
else if (is_array ($ccaps_req = get_post_meta ($post_ID, "s2member_ccaps_req", true))) /* Check for per Post Custom Capability requirements. */
|
70 |
+
foreach ($ccaps_req as $ccap) /* The $current_user MUST satisfy ALL Custom Capability requirements. These are all stored as a serialized array. */
|
71 |
+
if (strlen ($ccap) && (!$current_user || !$current_user->hap_cap ("access_s2member_ccap_" . $ccap)))
|
72 |
+
{
|
73 |
+
wp_redirect (add_query_arg ("s2member_ccap_req", $ccap, get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])));
|
74 |
+
exit ();
|
75 |
+
}
|
76 |
+
/**/
|
77 |
do_action ("ws_plugin__s2member_during_check_post_level_access", get_defined_vars ());
|
78 |
}
|
79 |
}
|
includes/functions/profile-modifications.inc.php
CHANGED
@@ -49,35 +49,51 @@ if (!function_exists ("ws_plugin__s2member_handle_profile_modifications"))
|
|
49 |
{
|
50 |
if (($nonce = $_POST["ws_plugin__s2member_profile_save"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-profile-save"))
|
51 |
{
|
52 |
-
$_POST = stripslashes_deep ($_POST); /* Clean POST vars. */
|
53 |
/**/
|
54 |
$userdata["ID"] = $user_id = $current_user->ID;
|
55 |
/**/
|
56 |
include_once ABSPATH . WPINC . "/registration.php";
|
57 |
/**/
|
58 |
-
if (
|
59 |
-
if (
|
60 |
-
|
61 |
-
$userdata["user_email"] = trim ($_POST["ws_plugin__s2member_profile_email"]);
|
62 |
/**/
|
63 |
-
if (
|
64 |
-
if ($current_user->user_login !== "demo") /* No
|
65 |
-
$userdata["user_pass"] =
|
66 |
/**/
|
67 |
-
|
|
|
68 |
/**/
|
69 |
-
|
|
|
70 |
/**/
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
72 |
/**/
|
73 |
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
74 |
{
|
75 |
-
|
|
|
|
|
|
|
76 |
{
|
77 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
78 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
79 |
/**/
|
80 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
}
|
83 |
/**/
|
@@ -85,7 +101,7 @@ if (!function_exists ("ws_plugin__s2member_handle_profile_modifications"))
|
|
85 |
do_action ("ws_plugin__s2member_during_handle_profile_modifications", get_defined_vars ());
|
86 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
87 |
/**/
|
88 |
-
|
89 |
/**/
|
90 |
echo '<script type="text/javascript">' . "\n";
|
91 |
echo "if(window.parent && window.parent != window) { try{ window.parent.Shadowbox.close(); } catch(e){} try{ window.parent.tb_remove(); } catch(e){} window.parent.alert('Profile updated successfully!'); window.parent.location = '" . esc_js (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"])) . "'; }";
|
49 |
{
|
50 |
if (($nonce = $_POST["ws_plugin__s2member_profile_save"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-profile-save"))
|
51 |
{
|
52 |
+
$_POST = ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST)); /* Clean POST vars. */
|
53 |
/**/
|
54 |
$userdata["ID"] = $user_id = $current_user->ID;
|
55 |
/**/
|
56 |
include_once ABSPATH . WPINC . "/registration.php";
|
57 |
/**/
|
58 |
+
if (is_email ($_POST["ws_plugin__s2member_profile_email"]))
|
59 |
+
if (!email_exists ($_POST["ws_plugin__s2member_profile_email"]))
|
60 |
+
$userdata["user_email"] = $_POST["ws_plugin__s2member_profile_email"];
|
|
|
61 |
/**/
|
62 |
+
if ($_POST["ws_plugin__s2member_profile_password"])
|
63 |
+
if ($current_user->user_login !== "demo") /* No pass change on demo. */
|
64 |
+
$userdata["user_pass"] = $_POST["ws_plugin__s2member_profile_password"];
|
65 |
/**/
|
66 |
+
if ($_POST["ws_plugin__s2member_profile_first_name"])
|
67 |
+
$userdata["first_name"] = $_POST["ws_plugin__s2member_profile_first_name"];
|
68 |
/**/
|
69 |
+
if ($_POST["ws_plugin__s2member_profile_display_name"])
|
70 |
+
$userdata["display_name"] = $_POST["ws_plugin__s2member_profile_display_name"];
|
71 |
/**/
|
72 |
+
if ($_POST["ws_plugin__s2member_profile_last_name"])
|
73 |
+
$userdata["last_name"] = $_POST["ws_plugin__s2member_profile_last_name"];
|
74 |
+
/**/
|
75 |
+
wp_update_user ($userdata); /* OK. Now send this array for an update. */
|
76 |
+
/**/
|
77 |
+
$_existing_fields = (array)get_user_option ("s2member_custom_fields", $user_id);
|
78 |
/**/
|
79 |
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
80 |
{
|
81 |
+
$une = preg_match ("/\^/", $field); /* Uneditable fields should be wrapped inside carets. */
|
82 |
+
$req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
|
83 |
+
/**/
|
84 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
85 |
{
|
86 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
87 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
88 |
/**/
|
89 |
+
if ($une || !isset ($_POST["ws_plugin__s2member_profile_" . $field_var]))
|
90 |
+
$fields[$field_var] = $_existing_fields[$field_var];
|
91 |
+
/**/
|
92 |
+
else if ($req && !strlen ($_POST["ws_plugin__s2member_profile_" . $field_var]))
|
93 |
+
$fields[$field_var] = $_existing_fields[$field_var];
|
94 |
+
/**/
|
95 |
+
else /* Otherwise, we can use the new value. */
|
96 |
+
$fields[$field_var] = $_POST["ws_plugin__s2member_profile_" . $field_var];
|
97 |
}
|
98 |
}
|
99 |
/**/
|
101 |
do_action ("ws_plugin__s2member_during_handle_profile_modifications", get_defined_vars ());
|
102 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
103 |
/**/
|
104 |
+
update_user_option ($user_id, "s2member_custom_fields", $fields);
|
105 |
/**/
|
106 |
echo '<script type="text/javascript">' . "\n";
|
107 |
echo "if(window.parent && window.parent != window) { try{ window.parent.Shadowbox.close(); } catch(e){} try{ window.parent.tb_remove(); } catch(e){} window.parent.alert('Profile updated successfully!'); window.parent.location = '" . esc_js (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"])) . "'; }";
|
includes/functions/readme-parsing.inc.php
CHANGED
@@ -12,13 +12,13 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Function that handles readme.txt parsing.
|
18 |
*/
|
19 |
if (!function_exists ("ws_plugin__s2member_parse_readme"))
|
20 |
{
|
21 |
-
function ws_plugin__s2member_parse_readme ($specific_path = FALSE)
|
22 |
{
|
23 |
if (!($path = $specific_path)) /* Was a specific path passed in? */
|
24 |
{
|
@@ -27,7 +27,7 @@ if (!function_exists ("ws_plugin__s2member_parse_readme"))
|
|
27 |
$path = (file_exists ($dev_path)) ? $dev_path : $path;
|
28 |
}
|
29 |
/**/
|
30 |
-
eval
|
31 |
do_action ("ws_plugin__s2member_before_parse_readme", get_defined_vars ());
|
32 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
33 |
/**/
|
@@ -43,30 +43,92 @@ if (!function_exists ("ws_plugin__s2member_parse_readme"))
|
|
43 |
$mb = function_exists ("mb_convert_encoding") ? @mb_convert_encoding ($rm, "UTF-8",@mb_detect_encoding ($rm, "WINDOWS-1252, UTF-8")) : $rm;
|
44 |
$rm = ($mb) ? $mb : $rm; /* Double check this, just in case conversion fails on an unpredicted charset. */
|
45 |
/**/
|
46 |
-
$
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
else /* Just in case readme.txt was deleted by the site owner. */
|
72 |
{
|
@@ -106,7 +168,7 @@ if (!function_exists ("ws_plugin__s2member_parse_readme_value"))
|
|
106 |
$path = (file_exists ($dev_path)) ? $dev_path : $path;
|
107 |
}
|
108 |
/**/
|
109 |
-
eval
|
110 |
do_action ("ws_plugin__s2member_before_parse_readme_value", get_defined_vars ());
|
111 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
112 |
/**/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function that handles readme.txt parsing.
|
18 |
*/
|
19 |
if (!function_exists ("ws_plugin__s2member_parse_readme"))
|
20 |
{
|
21 |
+
function ws_plugin__s2member_parse_readme ($specific_path = FALSE, $specific_section = FALSE, $_blank_targets = TRUE, $process_wp_syntax = FALSE)
|
22 |
{
|
23 |
if (!($path = $specific_path)) /* Was a specific path passed in? */
|
24 |
{
|
27 |
$path = (file_exists ($dev_path)) ? $dev_path : $path;
|
28 |
}
|
29 |
/**/
|
30 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
31 |
do_action ("ws_plugin__s2member_before_parse_readme", get_defined_vars ());
|
32 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
33 |
/**/
|
43 |
$mb = function_exists ("mb_convert_encoding") ? @mb_convert_encoding ($rm, "UTF-8",@mb_detect_encoding ($rm, "WINDOWS-1252, UTF-8")) : $rm;
|
44 |
$rm = ($mb) ? $mb : $rm; /* Double check this, just in case conversion fails on an unpredicted charset. */
|
45 |
/**/
|
46 |
+
if ($specific_section) /* If we are ONLY parsing a specific section. This is a very useful way of pulling details out. */
|
47 |
+
{
|
48 |
+
preg_match ("/(\=\= )(" . preg_quote ($specific_section, "/") . ")( \=\=)(.+?)([\r\n]+\=\= |$)/si", $rm, $m);
|
49 |
+
/**/
|
50 |
+
if ($rm = trim ($m[4])) /* Looking for a specific section, indicated by `$specific_section`. */
|
51 |
+
{
|
52 |
+
$rm = preg_replace ("/(\=\=\=)( )(.+?)( )(\=\=\=)/", "<h4 id=\"rm-specs\">Specifications</h4>", $rm);
|
53 |
+
$rm = preg_replace ("/(\=\=)( )(Installation)( )(\=\=)/", "<h4 id=\"rm-installation\">$3</h4>", $rm);
|
54 |
+
$rm = preg_replace ("/(\=\=)( )(Description)( )(\=\=)/", "<h4 id=\"rm-description\">$3</h4>", $rm);
|
55 |
+
$rm = preg_replace ("/(\=\=)( )(Screenshots)( )(\=\=)/", "<h4 id=\"rm-screenshots\">$3</h4>", $rm);
|
56 |
+
$rm = preg_replace ("/(\=\=)( )(Frequently Asked Questions)( )(\=\=)/", "<h4 id=\"rm-faqs\">$3</h4>", $rm);
|
57 |
+
$rm = preg_replace ("/(\=\=)( )(Changelog)( )(\=\=)/", "<h4 id=\"rm-changelog\">$3</h4>", $rm);
|
58 |
+
$rm = preg_replace ("/(\=\=)( )(.+?)( )(\=\=)/", "<h4>$3</h4>", $rm);
|
59 |
+
$rm = preg_replace ("/(\=)( )(.+?)( )(\=)/", "<h6>$3</h6>", $rm);
|
60 |
+
/**/
|
61 |
+
$rm = NC_Markdown ($rm); /* Parse out the Markdown syntax. */
|
62 |
+
/**/
|
63 |
+
$r1 = "/(\<a)( href)/i"; /* Modify all links. Assume a nofollow relationship. */
|
64 |
+
/**/
|
65 |
+
if ($_blank_targets) /* Modify all links. Always nofollow. ( with _blank targets ? ). */
|
66 |
+
$rm = preg_replace ($r1, "$1" . ' target="_blank" rel="nofollow external"' . "$2", $rm);
|
67 |
+
else /* Otherwise, we don't need to set _blank targets. So external is removed also. */
|
68 |
+
$rm = preg_replace ($r1, "$1" . ' rel="nofollow"' . "$2", $rm);
|
69 |
+
/**/
|
70 |
+
if ($process_wp_syntax) /* If we're processing <pre><code> tags for WP-Syntax. */
|
71 |
+
if (function_exists ("wp_syntax_before_filter") && function_exists ("wp_syntax_before_filter"))
|
72 |
+
{
|
73 |
+
$rm = preg_replace ("/\<pre\>\<code\>/i", '<pre lang="php" escaped="true">', $rm);
|
74 |
+
$rm = preg_replace ("/\<\/code\>\<\/pre\>/i", '</pre>', $rm);
|
75 |
+
$rm = wp_syntax_after_filter (wp_syntax_before_filter ($rm));
|
76 |
+
}
|
77 |
+
}
|
78 |
+
/**/
|
79 |
+
ini_set ("pcre.backtrack_limit", $o_pcre);
|
80 |
+
/**/
|
81 |
+
$readme = '<div class="readme">' . "\n";
|
82 |
+
$readme .= $rm . "\n"; /* Content. */
|
83 |
+
$readme .= '</div>' . "\n";
|
84 |
+
/**/
|
85 |
+
return apply_filters ("ws_plugin__s2member_parse_readme", $readme, get_defined_vars ());
|
86 |
+
}
|
87 |
+
else /* Otherwise, we're going for the entire readme file. Here we have lots of work to do. */
|
88 |
+
{
|
89 |
+
$rm = preg_replace ("/(\=\=\=)( )(.+?)( )(\=\=\=)/", "<h2 id=\"rm-specs\">Specifications</h2>", $rm);
|
90 |
+
$rm = preg_replace ("/(\=\=)( )(Installation)( )(\=\=)/", "<h2 id=\"rm-installation\">$3</h2>", $rm);
|
91 |
+
$rm = preg_replace ("/(\=\=)( )(Description)( )(\=\=)/", "<h2 id=\"rm-description\">$3</h2>", $rm);
|
92 |
+
$rm = preg_replace ("/(\=\=)( )(Screenshots)( )(\=\=)/", "<h2 id=\"rm-screenshots\">$3</h2>", $rm);
|
93 |
+
$rm = preg_replace ("/(\=\=)( )(Frequently Asked Questions)( )(\=\=)/", "<h2 id=\"rm-faqs\">$3</h2>", $rm);
|
94 |
+
$rm = preg_replace ("/(\=\=)( )(Changelog)( )(\=\=)/", "<h2 id=\"rm-changelog\">$3</h2>", $rm);
|
95 |
+
$rm = preg_replace ("/(\=\=)( )(.+?)( )(\=\=)/", "<h2>$3</h2>", $rm);
|
96 |
+
$rm = preg_replace ("/(\=)( )(.+?)( )(\=)/", "<h3>$3</h3>", $rm);
|
97 |
+
/**/
|
98 |
+
$rm = NC_Markdown ($rm); /* Parse out the Markdown syntax. */
|
99 |
+
/**/
|
100 |
+
$r1 = "/(\<h2(.*?)\>)(.+?)(\<\/h2\>)(.+?)(\<h2(.*?)\>|$)/si";
|
101 |
+
$r2 = "/(\<\/div\>)(\<h2(.*?)\>)(.+?)(\<\/h2\>)(.+?)(\<div class\=\"section\"\>\<h2(.*?)\>|$)/si";
|
102 |
+
$r3 = "/(\<div class\=\"section\"\>)(\<h2 id\=\"rm-specs\"\>)(Specifications)(\<\/h2\>)(\<div class\=\"content\"\>)(.+?)(\<\/div\>\<\/div\>)/sei";
|
103 |
+
$r4 = "/(\<div class\=\"section\"\>)(\<h2 id\=\"rm-screenshots\"\>)(Screenshots)(\<\/h2\>)(\<div class\=\"content\"\>)(.+?)(\<\/div\>\<\/div\>)/sei";
|
104 |
+
$r5 = "/(\<a)( href)/i"; /* Modify all links. Assume a nofollow relationship since destinations are unknown. */
|
105 |
+
/**/
|
106 |
+
$rm = preg_replace ($r1, '<div class="section">' . "$1$3$4" . '<div class="content">' . "$5" . '</div></div>' . "$6", $rm);
|
107 |
+
$rm = preg_replace ($r2, "$1" . '<div class="section">' . "$2$4$5" . '<div class="content">' . "$6" . '</div></div>' . "$7", $rm);
|
108 |
+
$rm = stripslashes (preg_replace ($r3, "'$1$2$3$4$5'._ws_plugin__s2member_parse_readme_specs('$6').'$7'", $rm, 1));
|
109 |
+
$rm = preg_replace ($r4, "", $rm, 1); /* Here we just remove the screenshots completely. */
|
110 |
+
/**/
|
111 |
+
if ($_blank_targets) /* Modify all links. Always nofollow. ( with _blank targets ? ). */
|
112 |
+
$rm = preg_replace ($r5, "$1" . ' target="_blank" rel="nofollow external"' . "$2", $rm);
|
113 |
+
else /* Otherwise, we don't need to set _blank targets. So external is removed also. */
|
114 |
+
$rm = preg_replace ($r5, "$1" . ' rel="nofollow"' . "$2", $rm);
|
115 |
+
/**/
|
116 |
+
if ($process_wp_syntax) /* If we're processing <pre><code> tags for WP-Syntax. */
|
117 |
+
if (function_exists ("wp_syntax_before_filter") && function_exists ("wp_syntax_before_filter"))
|
118 |
+
{
|
119 |
+
$rm = preg_replace ("/\<pre\>\<code\>/i", '<pre lang="php" escaped="true">', $rm);
|
120 |
+
$rm = preg_replace ("/\<\/code\>\<\/pre\>/i", '</pre>', $rm);
|
121 |
+
$rm = wp_syntax_after_filter (wp_syntax_before_filter ($rm));
|
122 |
+
}
|
123 |
+
/**/
|
124 |
+
ini_set ("pcre.backtrack_limit", $o_pcre);
|
125 |
+
/**/
|
126 |
+
$readme = '<div class="readme">' . "\n";
|
127 |
+
$readme .= $rm . "\n"; /* Content. */
|
128 |
+
$readme .= '</div>' . "\n";
|
129 |
+
/**/
|
130 |
+
return apply_filters ("ws_plugin__s2member_parse_readme", $readme, get_defined_vars ());
|
131 |
+
}
|
132 |
}
|
133 |
else /* Just in case readme.txt was deleted by the site owner. */
|
134 |
{
|
168 |
$path = (file_exists ($dev_path)) ? $dev_path : $path;
|
169 |
}
|
170 |
/**/
|
171 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
172 |
do_action ("ws_plugin__s2member_before_parse_readme_value", get_defined_vars ());
|
173 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
174 |
/**/
|
includes/functions/register-access.inc.php
CHANGED
@@ -14,7 +14,7 @@ Direct access denial.
|
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
-
Forces a default Role for new registrations
|
18 |
Attach to: add_filter("pre_option_default_role");
|
19 |
*/
|
20 |
if (!function_exists ("ws_plugin__s2member_force_default_role"))
|
@@ -27,30 +27,155 @@ if (!function_exists ("ws_plugin__s2member_force_default_role"))
|
|
27 |
}
|
28 |
}
|
29 |
/*
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
Attach to: add_filter("pre_option_users_can_register");
|
32 |
*/
|
33 |
if (!function_exists ("ws_plugin__s2member_check_register_access"))
|
34 |
{
|
35 |
function ws_plugin__s2member_check_register_access ($users_can_register = FALSE)
|
36 |
{
|
37 |
-
global $wpdb
|
38 |
/**/
|
39 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
40 |
do_action ("ws_plugin__s2member_before_check_register_access", get_defined_vars ());
|
41 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
42 |
/**/
|
43 |
-
$users_can_register = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
/**/
|
45 |
-
if ($
|
46 |
{
|
47 |
-
if (
|
48 |
{
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
}
|
52 |
/**/
|
53 |
-
return apply_filters ("
|
54 |
}
|
55 |
}
|
56 |
/*
|
@@ -65,13 +190,17 @@ if (!function_exists ("ws_plugin__s2member_general_ops_notice"))
|
|
65 |
/**/
|
66 |
do_action ("ws_plugin__s2member_before_general_ops_notice", get_defined_vars ());
|
67 |
/**/
|
68 |
-
if ($pagenow === "options-general.php" && !isset ($_GET["page"]))
|
69 |
{
|
70 |
-
$notice = "<em>* Note: The s2Member plugin has control over two options on this page
|
|
|
|
|
|
|
|
|
71 |
/**/
|
72 |
do_action ("ws_plugin__s2member_during_general_ops_notice", get_defined_vars ());
|
73 |
/**/
|
74 |
-
ws_plugin__s2member_enqueue_admin_notice ($notice, $pagenow);
|
75 |
}
|
76 |
/**/
|
77 |
do_action ("ws_plugin__s2member_after_general_ops_notice", get_defined_vars ());
|
@@ -80,7 +209,368 @@ if (!function_exists ("ws_plugin__s2member_general_ops_notice"))
|
|
80 |
}
|
81 |
}
|
82 |
/*
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
Attach to: add_action("register_form");
|
85 |
*/
|
86 |
if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
|
@@ -89,6 +579,8 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
|
|
89 |
{
|
90 |
do_action ("ws_plugin__s2member_before_custom_registration_fields", get_defined_vars ());
|
91 |
/**/
|
|
|
|
|
92 |
echo '<input type="hidden" name="ws_plugin__s2member_registration" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-registration")) . '" />' . "\n";
|
93 |
/**/
|
94 |
$tabindex = 20; /* Incremented tabindex starting with 20. */
|
@@ -106,7 +598,7 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
|
|
106 |
echo '<p>' . "\n";
|
107 |
echo '<label>' . "\n";
|
108 |
echo 'Password *' . "\n";
|
109 |
-
echo '<input aria-required="true" type="password" maxlength="100" autocomplete="off" name="ws_plugin__s2member_custom_reg_field_user_pass" id="ws-plugin--s2member-custom-reg-field-user-pass" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit (
|
110 |
echo '</label>' . "\n";
|
111 |
echo '</p>';
|
112 |
/**/
|
@@ -122,7 +614,7 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
|
|
122 |
echo '<p>' . "\n";
|
123 |
echo '<label>' . "\n";
|
124 |
echo 'First Name *' . "\n";
|
125 |
-
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_first_name" id="ws-plugin--s2member-custom-reg-field-first-name" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit (
|
126 |
echo '</label>' . "\n";
|
127 |
echo '</p>';
|
128 |
/**/
|
@@ -137,7 +629,7 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
|
|
137 |
echo '<p>' . "\n";
|
138 |
echo '<label>' . "\n";
|
139 |
echo 'Last Name *' . "\n";
|
140 |
-
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_last_name" id="ws-plugin--s2member-custom-reg-field-last-name" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit (
|
141 |
echo '</label>' . "\n";
|
142 |
echo '</p>';
|
143 |
/**/
|
@@ -150,7 +642,7 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
|
|
150 |
$req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
|
151 |
$req = ($req) ? ' aria-required="true"' : ''; /* Has JavaScript validation applied. */
|
152 |
/**/
|
153 |
-
if ($field = trim ($field, "
|
154 |
{
|
155 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
156 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_custom_fields", get_defined_vars ());
|
@@ -162,7 +654,7 @@ if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
|
|
162 |
echo '<p>' . "\n";
|
163 |
echo '<label>' . "\n";
|
164 |
echo esc_html ($field) . (($req) ? " *" : "") . "\n";
|
165 |
-
echo '<input' . $req . ' type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_' . $field_var . '" id="ws-plugin--s2member-custom-reg-field-' . $field_id_class . '" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit (
|
166 |
echo '</label>' . "\n";
|
167 |
echo '</p>';
|
168 |
/**/
|
@@ -248,7 +740,7 @@ if (!function_exists ("ws_plugin__s2member_register_link_gen"))
|
|
248 |
if ($subscr_id && $custom && $item_number) /* Must have all of these. */
|
249 |
{
|
250 |
$register = ws_plugin__s2member_encrypt ("subscr_id_custom_item_number_time:.:|:.:" . $subscr_id . ":.:|:.:" . $custom . ":.:|:.:" . $item_number . ":.:|:.:" . strtotime ("now"));
|
251 |
-
$register_link = add_query_arg ("s2member_register", $register, get_bloginfo ("
|
252 |
/**/
|
253 |
if ($shrink && ($tinyurl = ws_plugin__s2member_remote ("http://tinyurl.com/api-create.php?url=" . rawurlencode ($register_link))))
|
254 |
return apply_filters ("ws_plugin__s2member_register_link_gen", $tinyurl, get_defined_vars ()); /* tinyURL is easier to work with. */
|
@@ -283,9 +775,18 @@ if (!function_exists ("ws_plugin__s2member_register"))
|
|
283 |
/**/
|
284 |
do_action ("ws_plugin__s2member_during_register", get_defined_vars ());
|
285 |
/**/
|
286 |
-
|
287 |
-
|
288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
}
|
290 |
}
|
291 |
}
|
@@ -299,30 +800,159 @@ if (!function_exists ("ws_plugin__s2member_register"))
|
|
299 |
}
|
300 |
}
|
301 |
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
Function for configuring new users.
|
303 |
Attach to: add_action("user_register");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
*/
|
305 |
if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
|
306 |
{
|
307 |
-
function ws_plugin__s2member_configure_user_registration ($user_id = FALSE)
|
308 |
{
|
309 |
global $wpdb; /* Global database object may be required for this routine. */
|
310 |
-
|
|
|
|
|
311 |
/**/
|
312 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
313 |
do_action ("ws_plugin__s2member_before_configure_user_registration", get_defined_vars ());
|
314 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
315 |
/**/
|
316 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
{
|
318 |
-
|
|
|
|
|
|
|
319 |
/**/
|
320 |
if (!is_admin () /* Only run this particular routine whenever a Member [1-4] is registering themselves with cookies. */
|
321 |
-
&& ($subscr_id = ws_plugin__s2member_decrypt ($_COOKIE["s2member_subscr_id"])) && ($custom = ws_plugin__s2member_decrypt ($_COOKIE["s2member_custom"])) && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", ($level = ws_plugin__s2member_decrypt ($_COOKIE["s2member_level"])))/**/
|
322 |
-
&& (!$usermeta = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 's2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1")))
|
323 |
-
/* ^ This is for security ^ It checks the database to make sure the User/Member has not already registered in the past, with the same
|
324 |
-
{
|
325 |
-
|
|
|
|
|
|
|
|
|
326 |
/**/
|
327 |
list ($level, $ccaps, $eotper) = preg_split ("/\:/", $level, 3);
|
328 |
$role = "s2member_level" . $level; /* Level 1-4. */
|
@@ -331,37 +961,90 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
|
|
331 |
$login = $user->user_login;
|
332 |
$ip = $_SERVER["REMOTE_ADDR"];
|
333 |
$cv = preg_split ("/\|/", $custom);
|
334 |
-
$fname = (!$user->first_name) ? trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]) : $user->first_name;
|
335 |
-
$lname = (!$user->last_name) ? trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]) : $user->last_name;
|
336 |
-
$name = trim ($fname . " " . $lname);
|
337 |
/**/
|
338 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
if ($GLOBALS["ws_plugin__s2member_generate_password_return"])
|
340 |
$pass = $GLOBALS["ws_plugin__s2member_generate_password_return"];
|
341 |
/**/
|
342 |
-
if (!$pass) /* Also try
|
343 |
-
if ($
|
344 |
-
$pass =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
/**/
|
346 |
-
|
|
|
|
|
347 |
/**/
|
348 |
-
|
|
|
349 |
/**/
|
350 |
-
|
351 |
-
|
|
|
|
|
|
|
352 |
/**/
|
353 |
-
|
|
|
|
|
354 |
foreach (preg_split ("/[\r\n\t\s;,]+/", $ccaps) as $ccap)
|
355 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
356 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
357 |
/**/
|
358 |
-
|
359 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
/**/
|
361 |
if (($transient = md5 ("s2member_transient_ipn_subscr_payment_" . $subscr_id)) && is_array ($subscr_payment = get_transient ($transient)))
|
362 |
{
|
363 |
$proxy = array ("s2member_paypal_notify" => "1", "s2member_paypal_proxy" => "s2member_transient_ipn_subscr_payment");
|
364 |
-
ws_plugin__s2member_remote (add_query_arg ($proxy, get_bloginfo ("
|
365 |
delete_transient ($transient);
|
366 |
}
|
367 |
/**/
|
@@ -372,94 +1055,232 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
|
|
372 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
373 |
}
|
374 |
/**/
|
375 |
-
else if (!is_admin ()
|
376 |
-
{
|
377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
/**/
|
379 |
-
$level = (
|
380 |
-
$
|
|
|
|
|
|
|
|
|
381 |
/**/
|
382 |
$email = $user->user_email;
|
383 |
$login = $user->user_login;
|
384 |
$ip = $_SERVER["REMOTE_ADDR"];
|
385 |
-
$
|
386 |
-
$
|
387 |
-
$
|
388 |
-
|
|
|
|
|
|
|
|
|
|
|
389 |
/**/
|
390 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
if ($GLOBALS["ws_plugin__s2member_generate_password_return"])
|
392 |
$pass = $GLOBALS["ws_plugin__s2member_generate_password_return"];
|
393 |
/**/
|
394 |
-
if (!$pass) /* Also try
|
395 |
-
if ($
|
396 |
-
$pass =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
/**/
|
398 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
/**/
|
400 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
401 |
do_action ("ws_plugin__s2member_during_configure_user_registration_front_side", get_defined_vars ());
|
402 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
403 |
}
|
404 |
/**/
|
405 |
-
else if (is_admin () &&
|
406 |
-
{
|
407 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
/**/
|
409 |
-
$level = (
|
410 |
-
$
|
|
|
|
|
|
|
|
|
411 |
/**/
|
412 |
$email = $user->user_email;
|
413 |
$login = $user->user_login;
|
414 |
$ip = ""; /* N/Applicable. */
|
415 |
-
$
|
416 |
-
$
|
417 |
-
$
|
418 |
-
|
|
|
|
|
|
|
|
|
|
|
419 |
/**/
|
420 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
if ($GLOBALS["ws_plugin__s2member_generate_password_return"])
|
422 |
$pass = $GLOBALS["ws_plugin__s2member_generate_password_return"];
|
423 |
/**/
|
424 |
if (!$pass) /* Also try the `Users -> Add New` form. */
|
425 |
-
if ($
|
426 |
-
$pass =
|
427 |
/**/
|
428 |
-
$
|
|
|
|
|
|
|
|
|
429 |
/**/
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
update_usermeta ($user_id, "first_name", $first_name) . /* And display name. */
|
439 |
-
wp_update_user (array ("ID" => $user_id, "display_name" => $first_name));
|
440 |
/**/
|
441 |
-
if (!$user->last_name &&
|
442 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
/**/
|
444 |
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
445 |
{
|
446 |
-
if ($field = trim ($field, "
|
447 |
{
|
448 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
449 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
450 |
/**/
|
451 |
-
|
452 |
-
$fields[$field_var] = trim ($_POST["ws_plugin__s2member_custom_reg_field_" . $field_var]);
|
453 |
}
|
454 |
}
|
455 |
/**/
|
456 |
-
|
457 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
ws_plugin__s2member_process_list_servers ($level, $email, $fname, $lname, $ip, $opt_in);
|
459 |
/**/
|
460 |
if ($urls = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_urls"])
|
461 |
foreach (preg_split ("/[\r\n\t]+/", $urls) as $url) /* Notify each of the urls. */
|
462 |
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
if (($url = preg_replace ("/%%level%%/i", ws_plugin__s2member_esc_ds (urlencode ($level)), $url)))
|
464 |
if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($fname)), $url)))
|
465 |
if (($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($lname)), $url)))
|
@@ -468,21 +1289,8 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
|
|
468 |
if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
|
469 |
if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
|
470 |
if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
|
471 |
-
if (($url = trim ($url))) /* Empty? */
|
472 |
-
|
473 |
-
/**/
|
474 |
-
if ($url = $GLOBALS["ws_plugin__s2member_registration_return_url"])
|
475 |
-
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
|
476 |
-
if (($url = preg_replace ("/%%level%%/i", ws_plugin__s2member_esc_ds (urlencode ($level)), $url)))
|
477 |
-
if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($fname)), $url)))
|
478 |
-
if (($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($lname)), $url)))
|
479 |
-
if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($name)), $url)))
|
480 |
-
if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($email)), $url)))
|
481 |
-
if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
|
482 |
-
if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
|
483 |
-
if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
|
484 |
-
if (($url = trim ($url))) /* Empty? ... Otherwise, re-fill. */
|
485 |
-
$GLOBALS["ws_plugin__s2member_registration_return_url"] = $url;
|
486 |
/**/
|
487 |
setcookie ("s2member_subscr_id", "", time () + 31556926, "/");
|
488 |
setcookie ("s2member_custom", "", time () + 31556926, "/");
|
@@ -525,20 +1333,11 @@ if (!function_exists ("wp_generate_password"))
|
|
525 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
|
526 |
if ($custom = trim (stripslashes ($_POST["ws_plugin__s2member_custom_reg_field_user_pass"])))
|
527 |
{
|
528 |
-
$password = $custom; /* Use custom password
|
529 |
-
add_filter ("login_messages", "_ws_plugin__s2member_registration_login_message");
|
530 |
}
|
531 |
/**/
|
532 |
return ($GLOBALS["ws_plugin__s2member_generate_password_return"] = $password);
|
533 |
}
|
534 |
-
/**/
|
535 |
-
function _ws_plugin__s2member_registration_login_message ($message = FALSE)
|
536 |
-
{
|
537 |
-
if ($message === "Registration complete. Please check your e-mail.")
|
538 |
-
return apply_filters ("_ws_plugin__s2member_registration_login_message", "Registration complete. Please log in.", get_defined_vars ());
|
539 |
-
/**/
|
540 |
-
return $message;
|
541 |
-
}
|
542 |
}
|
543 |
}
|
544 |
/*
|
@@ -564,4 +1363,22 @@ if (!function_exists ("ws_plugin__s2member_demo_hide_password_fields"))
|
|
564 |
return $show;
|
565 |
}
|
566 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
?>
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
+
Forces a default Role for new registrations, NOT tied to an incoming payment.
|
18 |
Attach to: add_filter("pre_option_default_role");
|
19 |
*/
|
20 |
if (!function_exists ("ws_plugin__s2member_force_default_role"))
|
27 |
}
|
28 |
}
|
29 |
/*
|
30 |
+
Forces a default Role for new Multisite registrations ( on the Main Site ) NOT tied to an incoming payment.
|
31 |
+
Attach to: add_filter("pre_site_option_default_user_role");
|
32 |
+
*/
|
33 |
+
if (!function_exists ("ws_plugin__s2member_force_mms_default_role"))
|
34 |
+
{
|
35 |
+
function ws_plugin__s2member_force_mms_default_role ($default_role = FALSE)
|
36 |
+
{
|
37 |
+
do_action ("ws_plugin__s2member_before_force_mms_default_role", get_defined_vars ());
|
38 |
+
/**/
|
39 |
+
return apply_filters ("ws_plugin__s2member_force_mms_default_role", ($default_role = "subscriber"), get_defined_vars ());
|
40 |
+
}
|
41 |
+
}
|
42 |
+
/*
|
43 |
+
Allows new Users to be created on a Multisite Network.
|
44 |
+
Attach to: add_filter("pre_site_option_add_new_users");
|
45 |
+
*/
|
46 |
+
if (!function_exists ("ws_plugin__s2member_mms_allow_new_users"))
|
47 |
+
{
|
48 |
+
function ws_plugin__s2member_mms_allow_new_users ($allow = FALSE)
|
49 |
+
{
|
50 |
+
do_action ("ws_plugin__s2member_before_mms_allow_new_users", get_defined_vars ());
|
51 |
+
/**/
|
52 |
+
return apply_filters ("ws_plugin__s2member_mms_allow_new_users", ($allow = "1"), get_defined_vars ());
|
53 |
+
}
|
54 |
+
}
|
55 |
+
/*
|
56 |
+
Forces a Multisite Dashboard Blog to be the Main Site.
|
57 |
+
Attach to: add_filter("pre_site_option_dashboard_blog");
|
58 |
+
*/
|
59 |
+
if (!function_exists ("ws_plugin__s2member_mms_dashboard_blog"))
|
60 |
+
{
|
61 |
+
function ws_plugin__s2member_mms_dashboard_blog ($dashboard_blog = FALSE)
|
62 |
+
{
|
63 |
+
global $current_site, $current_blog; /* For Multisite support. */
|
64 |
+
/**/
|
65 |
+
do_action ("ws_plugin__s2member_before_mms_dashboard_blog", get_defined_vars ());
|
66 |
+
/**/
|
67 |
+
$main_site = ((is_multisite ()) ? $current_site->blog_id : "1"); /* Forces the Main Site. */
|
68 |
+
/**/
|
69 |
+
return apply_filters ("ws_plugin__s2member_mms_dashboard_blog", ($dashboard_blog = $main_site), get_defined_vars ());
|
70 |
+
}
|
71 |
+
}
|
72 |
+
/*
|
73 |
+
Function for allowing access to the Registration Form.
|
74 |
+
This function has been further optimized to reduce DB queries.
|
75 |
Attach to: add_filter("pre_option_users_can_register");
|
76 |
*/
|
77 |
if (!function_exists ("ws_plugin__s2member_check_register_access"))
|
78 |
{
|
79 |
function ws_plugin__s2member_check_register_access ($users_can_register = FALSE)
|
80 |
{
|
81 |
+
global $wpdb; /* Global database object reference */
|
82 |
/**/
|
83 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
84 |
do_action ("ws_plugin__s2member_before_check_register_access", get_defined_vars ());
|
85 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
86 |
/**/
|
87 |
+
$by_default = $users_can_register = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"];
|
88 |
+
/**/
|
89 |
+
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && is_main_site ())
|
90 |
+
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "0"), get_defined_vars ());
|
91 |
+
/**/
|
92 |
+
else if (!is_admin () && !$users_can_register) /* Do NOT run these security checks on option pages; it's confusing to a site owner. */
|
93 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || !is_main_site () || is_super_admin () || current_user_can ("create_users"))
|
94 |
+
{
|
95 |
+
if ((is_multisite () && is_super_admin ()) || current_user_can ("create_users") || (($subscr_id = ws_plugin__s2member_decrypt ($_COOKIE["s2member_subscr_id"])) && preg_match ("/^" . preg_quote (preg_replace ("/\:([0-9]+)$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", ($custom = ws_plugin__s2member_decrypt ($_COOKIE["s2member_custom"]))) && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", ($level = ws_plugin__s2member_decrypt ($_COOKIE["s2member_level"]))) && !($exists = $wpdb->get_var ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))))
|
96 |
+
{
|
97 |
+
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "1"), get_defined_vars ());
|
98 |
+
}
|
99 |
+
}
|
100 |
+
/**/
|
101 |
+
return apply_filters ("ws_plugin__s2member_check_register_access", $users_can_register, get_defined_vars ());
|
102 |
+
}
|
103 |
+
}
|
104 |
+
/*
|
105 |
+
Function for allowing access to the main Multisite Registration Form.
|
106 |
+
This function has been further optimized to reduce DB queries.
|
107 |
+
Attach to: add_filter("pre_site_option_registration");
|
108 |
+
*/
|
109 |
+
if (!function_exists ("ws_plugin__s2member_check_mms_register_access"))
|
110 |
+
{
|
111 |
+
function ws_plugin__s2member_check_mms_register_access ($users_can_register = FALSE)
|
112 |
+
{
|
113 |
+
global $wpdb; /* Global database object reference */
|
114 |
+
global $current_site, $current_blog; /* For Multisite support. */
|
115 |
+
/**/
|
116 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
117 |
+
do_action ("ws_plugin__s2member_before_check_register_access", get_defined_vars ());
|
118 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
119 |
+
/**/
|
120 |
+
$by_default = $users_can_register = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_grants"];
|
121 |
+
/**/
|
122 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || !is_main_site ()) /* NOT a Blog Farm. */
|
123 |
+
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "none"), get_defined_vars ());
|
124 |
+
/**/
|
125 |
+
else if (!is_admin () && $users_can_register !== "all") /* Do NOT run these security checks on option pages; it's confusing to a site owner. */
|
126 |
+
{
|
127 |
+
if (is_super_admin () || current_user_can ("create_users") || (($subscr_id = ws_plugin__s2member_decrypt ($_COOKIE["s2member_subscr_id"])) && preg_match ("/^" . preg_quote (preg_replace ("/\:([0-9]+)$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", ($custom = ws_plugin__s2member_decrypt ($_COOKIE["s2member_custom"]))) && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", ($level = ws_plugin__s2member_decrypt ($_COOKIE["s2member_level"]))) && !($exists = $wpdb->get_var ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))))
|
128 |
+
{
|
129 |
+
if (is_super_admin () || current_user_can ("create_users"))
|
130 |
+
{
|
131 |
+
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
|
132 |
+
}
|
133 |
+
else if ($subscr_id && $custom && $level) /* A paying Customer? Cookies have already been authenticated above. */
|
134 |
+
{
|
135 |
+
list ($level) = preg_split ("/\:/", $level, 1); /* Parse out the level now. */
|
136 |
+
/**/
|
137 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . $level])
|
138 |
+
{
|
139 |
+
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
|
140 |
+
}
|
141 |
+
else /* Otherwise, we MUST allow them to create an account; they paid for it! */
|
142 |
+
{
|
143 |
+
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "user"), get_defined_vars ());
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
+
/* --------------------> $users_can_register !== "all", so exclude Level #0. */
|
148 |
+
else if (is_user_logged_in () && current_user_can ("access_s2member_level1") && is_object ($current_user = wp_get_current_user ()))
|
149 |
+
{
|
150 |
+
$blogs_allowed = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . ws_plugin__s2member_user_access_level ()];
|
151 |
+
$current_user_blogs = (is_array ($blogs = get_blogs_of_user ($current_user->ID))) ? count ($blogs) - 1 : 0;
|
152 |
+
$current_user_blogs = ($current_user_blogs >= 0) ? $current_user_blogs : 0;
|
153 |
+
$blogs_allowed = ($blogs_allowed >= 0) ? $blogs_allowed : 0;
|
154 |
+
/**/
|
155 |
+
if ($current_user_blogs < $blogs_allowed) /* Are they within their limit? */
|
156 |
+
{
|
157 |
+
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
161 |
/**/
|
162 |
+
else if (!is_admin () && $users_can_register === "all") /* Do NOT run these security checks on option pages; it's confusing to a site owner. */
|
163 |
{
|
164 |
+
if (is_user_logged_in () && is_object ($current_user = wp_get_current_user ()))
|
165 |
{
|
166 |
+
$blogs_allowed = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . ws_plugin__s2member_user_access_level ()];
|
167 |
+
$current_user_blogs = (is_array ($blogs = get_blogs_of_user ($current_user->ID))) ? count ($blogs) - 1 : 0;
|
168 |
+
$current_user_blogs = ($current_user_blogs >= 0) ? $current_user_blogs : 0;
|
169 |
+
$blogs_allowed = ($blogs_allowed >= 0) ? $blogs_allowed : 0;
|
170 |
+
/**/
|
171 |
+
if ($current_user_blogs >= $blogs_allowed) /* Are they at their limit? */
|
172 |
+
{
|
173 |
+
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "none"), get_defined_vars ());
|
174 |
+
}
|
175 |
}
|
176 |
}
|
177 |
/**/
|
178 |
+
return apply_filters ("ws_plugin__s2member_check_mms_register_access", $users_can_register, get_defined_vars ());
|
179 |
}
|
180 |
}
|
181 |
/*
|
190 |
/**/
|
191 |
do_action ("ws_plugin__s2member_before_general_ops_notice", get_defined_vars ());
|
192 |
/**/
|
193 |
+
if (is_admin () && $pagenow === "options-general.php" && !isset ($_GET["page"]) && !is_multisite ()) /* Multisite does NOT provide these options. */
|
194 |
{
|
195 |
+
$notice = "<em>* Note: The s2Member plugin has control over two options on this page.<br /><code>Allow Open Registration = " . esc_html (get_option ("users_can_register")) . "</code>, and <code>Default Role = " . esc_html (get_option ("default_role")) . "</code>.<br />For further details, see: <code>s2Member -> General Options -> Open Registration</code>.";
|
196 |
+
/**/
|
197 |
+
$js = '<script type="text/javascript">';
|
198 |
+
$js .= "jQuery('input#users_can_register, select#default_role').attr('disabled', 'disabled');";
|
199 |
+
$js .= '</script>';
|
200 |
/**/
|
201 |
do_action ("ws_plugin__s2member_during_general_ops_notice", get_defined_vars ());
|
202 |
/**/
|
203 |
+
ws_plugin__s2member_enqueue_admin_notice ($notice . $js, $pagenow);
|
204 |
}
|
205 |
/**/
|
206 |
do_action ("ws_plugin__s2member_after_general_ops_notice", get_defined_vars ());
|
209 |
}
|
210 |
}
|
211 |
/*
|
212 |
+
Function that describes the Multisite Option overrides for clarity.
|
213 |
+
Attach to: add_action("admin_init");
|
214 |
+
*/
|
215 |
+
if (!function_exists ("ws_plugin__s2member_multisite_ops_notice"))
|
216 |
+
{
|
217 |
+
function ws_plugin__s2member_multisite_ops_notice ()
|
218 |
+
{
|
219 |
+
global $pagenow; /* Need this. */
|
220 |
+
/**/
|
221 |
+
do_action ("ws_plugin__s2member_before_multisite_ops_notice", get_defined_vars ());
|
222 |
+
/**/
|
223 |
+
if (is_admin () && $pagenow === "ms-options.php" && !isset ($_GET["page"]) && is_multisite ()) /* Only with Multisite Networking enabled. */
|
224 |
+
{
|
225 |
+
$notice = "<em>* Note: The s2Member plugin has control over four options on this page.<br /><code>Dashboard Blog = " . esc_html (get_site_option ("dashboard_blog")) . " / Main Site</code>, <code>Default Role = " . esc_html (get_site_option ("default_user_role")) . "</code>, <code>Allow Open Registration = " . esc_html (get_site_option ("registration")) . "</code>, and <code>Add New Users = " . esc_html (get_site_option ("add_new_users")) . "</code>.<br />In your Dashboard ( on the Main Site ), see: <code>s2Member -> Multisite ( Config )</code>.";
|
226 |
+
/**/
|
227 |
+
$js = '<script type="text/javascript">';
|
228 |
+
$js .= "jQuery('input#dashboard_blog, select#default_user_role, input[name=registration], input#add_new_users').attr('disabled', 'disabled');";
|
229 |
+
$js .= '</script>';
|
230 |
+
/**/
|
231 |
+
do_action ("ws_plugin__s2member_during_multisite_ops_notice", get_defined_vars ());
|
232 |
+
/**/
|
233 |
+
ws_plugin__s2member_enqueue_admin_notice ($notice . $js, $pagenow);
|
234 |
+
}
|
235 |
+
/**/
|
236 |
+
do_action ("ws_plugin__s2member_after_multisite_ops_notice", get_defined_vars ());
|
237 |
+
/**/
|
238 |
+
return;
|
239 |
+
}
|
240 |
+
}
|
241 |
+
/*
|
242 |
+
Function that adds custom fields to `/wp-admin/user-new.php`.
|
243 |
+
We have to buffer output because `/user-new.php` has NO Hooks.
|
244 |
+
Attach to: add_action("admin_init");
|
245 |
+
*/
|
246 |
+
if (!function_exists ("ws_plugin__s2member_admin_user_new_fields"))
|
247 |
+
{
|
248 |
+
function ws_plugin__s2member_admin_user_new_fields ()
|
249 |
+
{
|
250 |
+
global $pagenow; /* The current admin page file name. */
|
251 |
+
/**/
|
252 |
+
do_action ("ws_plugin__s2member_before_admin_user_new_fields", get_defined_vars ());
|
253 |
+
/**/
|
254 |
+
if (is_admin () && $pagenow === "user-new.php" && current_user_can ("create_users"))
|
255 |
+
{
|
256 |
+
ob_start ("_ws_plugin__s2member_admin_user_new_fields"); /* No Hooks, so we buffer. */
|
257 |
+
/**/
|
258 |
+
do_action ("ws_plugin__s2member_during_admin_user_new_fields", get_defined_vars ());
|
259 |
+
}
|
260 |
+
/**/
|
261 |
+
do_action ("ws_plugin__s2member_after_admin_user_new_fields", get_defined_vars ());
|
262 |
+
/**/
|
263 |
+
return;
|
264 |
+
}
|
265 |
+
}
|
266 |
+
/*
|
267 |
+
Callback that adds custom fields to `/wp-admin/user-new.php`.
|
268 |
+
We have to buffer output because `/user-new.php` has NO Hooks.
|
269 |
+
Attach to: ob_start("_ws_plugin__s2member_admin_user_new_fields");
|
270 |
+
*/
|
271 |
+
if (!function_exists ("_ws_plugin__s2member_admin_user_new_fields"))
|
272 |
+
{
|
273 |
+
function _ws_plugin__s2member_admin_user_new_fields ($buffer = FALSE)
|
274 |
+
{
|
275 |
+
global $pagenow; /* The current admin page file name. */
|
276 |
+
/**/
|
277 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
278 |
+
do_action ("_ws_plugin__s2member_before_admin_user_new_fields", get_defined_vars ());
|
279 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
280 |
+
/**/
|
281 |
+
if (is_admin () && $pagenow === "user-new.php" && current_user_can ("create_users"))
|
282 |
+
{
|
283 |
+
$_POST = ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST));
|
284 |
+
/**/
|
285 |
+
$unfs = '<div style="margin:25px 0 25px 0; height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
286 |
+
/**/
|
287 |
+
$unfs .= '<h3 style="position:relative;"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/large-icon.png" title="s2Member ( a Membership management system for WordPress® )" alt="" style="position:absolute; top:-15px; right:0; border:0;" />s2Member Configuration & Profile Fields' . ((is_multisite ()) ? ' ( for this Blog )' : '') . '</h3>' . "\n";
|
288 |
+
/**/
|
289 |
+
$unfs .= '<table class="form-table">' . "\n";
|
290 |
+
/**/
|
291 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
292 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before", get_defined_vars ());
|
293 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
294 |
+
/**/
|
295 |
+
if (is_multisite ()) /* Multisite Networking is currently lacking these fields; we pop them in. */
|
296 |
+
{
|
297 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
298 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before_first_name", get_defined_vars ());
|
299 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
300 |
+
/**/
|
301 |
+
$unfs .= '<tr>' . "\n";
|
302 |
+
$unfs .= '<th><label>First Name:</label></th>' . "\n";
|
303 |
+
$unfs .= '<td><input type="text" name="ws_plugin__s2member_user_new_first_name" value="' . format_to_edit ($_POST["ws_plugin__s2member_user_new_first_name"]) . '" class="regular-text" /></td>' . "\n";
|
304 |
+
$unfs .= '</tr>' . "\n";
|
305 |
+
/**/
|
306 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
307 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after_first_name", get_defined_vars ());
|
308 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
309 |
+
/**/
|
310 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
311 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before_last_name", get_defined_vars ());
|
312 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
313 |
+
/**/
|
314 |
+
$unfs .= '<tr>' . "\n";
|
315 |
+
$unfs .= '<th><label>Last Name:</label></th>' . "\n";
|
316 |
+
$unfs .= '<td><input type="text" name="ws_plugin__s2member_user_new_last_name" value="' . format_to_edit ($_POST["ws_plugin__s2member_user_new_last_name"]) . '" class="regular-text" /></td>' . "\n";
|
317 |
+
$unfs .= '</tr>' . "\n";
|
318 |
+
/**/
|
319 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
320 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after_last_name", get_defined_vars ());
|
321 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
322 |
+
}
|
323 |
+
/**/
|
324 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
325 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before_subscr_id", get_defined_vars ());
|
326 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
327 |
+
/**/
|
328 |
+
$unfs .= '<tr>' . "\n";
|
329 |
+
$unfs .= '<th><label>Paid Subscr. ID:</label> <a href="#" onclick="alert(\'A Paid Subscr. ID is only valid for paid Members. Under normal circumstances, this is filled automatically by s2Member. This field is ONLY here for Customer Service purposes; just in case you ever need to enter a Paid Subscr. ID manually.\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
330 |
+
$unfs .= '<td><input type="text" name="ws_plugin__s2member_user_new_s2member_subscr_id" value="' . format_to_edit ($_POST["ws_plugin__s2member_user_new_s2member_subscr_id"]) . '" class="regular-text" /></td>' . "\n";
|
331 |
+
$unfs .= '</tr>' . "\n";
|
332 |
+
/**/
|
333 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
334 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after_subscr_id", get_defined_vars ());
|
335 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
336 |
+
/**/
|
337 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
338 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before_custom", get_defined_vars ());
|
339 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
340 |
+
/**/
|
341 |
+
$unfs .= '<tr>' . "\n";
|
342 |
+
$unfs .= '<th><label>Custom Value:</label> <a href="#" onclick="alert(\'A Paid Subscription is always associated with a Custom String that is passed through the custom=\\\'\\\'' . ws_plugin__s2member_esc_sq ($_SERVER["HTTP_HOST"]) . '\\\'\\\' attribute of your Shortcode. This Custom Value, MUST always start with your domain name. However, you can also pipe delimit additional values after your domain, if you need to.\\n\\nFor example:\n' . ws_plugin__s2member_esc_sq ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
343 |
+
$unfs .= '<td><input type="text" name="ws_plugin__s2member_user_new_s2member_custom" value="' . format_to_edit ($_POST["ws_plugin__s2member_user_new_s2member_custom"]) . '" class="regular-text" /></td>' . "\n";
|
344 |
+
$unfs .= '</tr>' . "\n";
|
345 |
+
/**/
|
346 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
347 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after_custom", get_defined_vars ());
|
348 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
349 |
+
/**/
|
350 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
351 |
+
/* ^ Will change once Custom Capabilities are compatible with a Blog Farm. */
|
352 |
+
{
|
353 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
354 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before_ccaps", get_defined_vars ());
|
355 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
356 |
+
/**/
|
357 |
+
$unfs .= '<tr>' . "\n";
|
358 |
+
$unfs .= '<th><label>Custom Capabilities:</label> <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.' . ((is_multisite ()) ? '\\n\\nCustom Capabilities are assigned on a per-Blog basis. So having a set of Custom Capabilities for one Blog, and having NO Custom Capabilities on another Blog - is very common. This is how permissions are designed to work.' : '') . '\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
359 |
+
$unfs .= '<td><input type="text" name="ws_plugin__s2member_user_new_s2member_ccaps" value="' . format_to_edit ($_POST["ws_plugin__s2member_user_new_s2member_ccaps"]) . '" class="regular-text" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" /></td>' . "\n";
|
360 |
+
$unfs .= '</tr>' . "\n";
|
361 |
+
/**/
|
362 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
363 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after_ccaps", get_defined_vars ());
|
364 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
365 |
+
}
|
366 |
+
/**/
|
367 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
368 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before_auto_eot_time", get_defined_vars ());
|
369 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
370 |
+
/**/
|
371 |
+
$unfs .= '<tr>' . "\n";
|
372 |
+
$unfs .= '<th><label>Automatic EOT Time:</label> <a href="#" onclick="alert(\'EOT = End Of Term. ( i.e. Account Expiration / Termination. ).\\n\\nIf you leave this empty, s2Member will configure an EOT Time automatically, based on the paid Subscription associated with this account. In other words, if a paid Subscription expires, is cancelled, terminated, refunded, reversed, or charged back to you; s2Member will deal with the EOT automatically.\\n\\nThat being said, if you would rather take control over this, you can. If you type in a date manually, s2Member will obey the Auto-EOT Time that you\\\'ve given, no matter what. In other words, you can force certain Members to expire automatically, at a time that you specify. s2Member will obey.\\n\\nValid formats for Automatic EOT Time:\\n\\nmm/dd/yyyy\\nyyyy-mm-dd\\n+1 year\\n+2 weeks\\n+2 months\\n+10 minutes\\nnext thursday\\ntomorrow\\ntoday\\n\\n* anything compatible with PHP\\\'s strtotime() function.\'); return false;" tabindex="-1">[?]</a>' . (($auto_eot_time) ? '<br /><small>( based on server time )</small>' : '') . '</th>' . "\n";
|
373 |
+
$unfs .= '<td><input type="text" name="ws_plugin__s2member_user_new_s2member_auto_eot_time" value="' . format_to_edit ($_POST["ws_plugin__s2member_user_new_s2member_auto_eot_time"]) . '" class="regular-text" /></td>' . "\n";
|
374 |
+
$unfs .= '</tr>' . "\n";
|
375 |
+
/**/
|
376 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
377 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after_auto_eot_time", get_defined_vars ());
|
378 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
379 |
+
/**/
|
380 |
+
if (ws_plugin__s2member_list_servers_integrated ()) /* Only if integrated with s2Member. */
|
381 |
+
{
|
382 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
383 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before_opt_in", get_defined_vars ());
|
384 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
385 |
+
/**/
|
386 |
+
$unfs .= '<tr>' . "\n";
|
387 |
+
$unfs .= '<th><label>Process List Servers:</label> <a href="#" onclick="alert(\'You have at least one List Server integrated with s2Member. Would you like to process a confirmation request for this new User? If not, just leave the box un-checked.\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
388 |
+
$unfs .= '<td><label><input type="checkbox" name="ws_plugin__s2member_user_new_opt_in" value="1"' . (($_POST["ws_plugin__s2member_user_new_opt_in"]) ? ' checked="checked"' : '') . ' /> Yes, send a mailing list confirmation email to this new User.</label></td>' . "\n";
|
389 |
+
$unfs .= '</tr>' . "\n";
|
390 |
+
/**/
|
391 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
392 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after_opt_in", get_defined_vars ());
|
393 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
394 |
+
}
|
395 |
+
/**/
|
396 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) /* Only if configured. */
|
397 |
+
{
|
398 |
+
$unfs .= '<tr>' . "\n";
|
399 |
+
$unfs .= '<td colspan="2">' . "\n";
|
400 |
+
$unfs .= '<div style="height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
401 |
+
$unfs .= '</td>' . "\n";
|
402 |
+
$unfs .= '</tr>' . "\n";
|
403 |
+
/**/
|
404 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
405 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before_custom_fields", get_defined_vars ());
|
406 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
407 |
+
/**/
|
408 |
+
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
409 |
+
{
|
410 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
411 |
+
{
|
412 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
413 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_during_custom_fields_before", get_defined_vars ());
|
414 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
415 |
+
/**/
|
416 |
+
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
417 |
+
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
418 |
+
/**/
|
419 |
+
$unfs .= '<tr>' . "\n";
|
420 |
+
$unfs .= '<th><label>' . esc_html ($field) . ':</label></th>' . "\n";
|
421 |
+
$unfs .= '<td><input type="text" name="ws_plugin__s2member_user_new_' . $field_var . '" value="' . format_to_edit ($_POST["ws_plugin__s2member_user_new_" . $field_var]) . '" class="regular-text" /></td>' . "\n";
|
422 |
+
$unfs .= '</tr>' . "\n";
|
423 |
+
/**/
|
424 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
425 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_during_custom_fields_after", get_defined_vars ());
|
426 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
427 |
+
}
|
428 |
+
}
|
429 |
+
/**/
|
430 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
431 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after_custom_fields", get_defined_vars ());
|
432 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
433 |
+
/**/
|
434 |
+
$unfs .= '<tr>' . "\n";
|
435 |
+
$unfs .= '<td colspan="2">' . "\n";
|
436 |
+
$unfs .= '<div style="height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
437 |
+
$unfs .= '</td>' . "\n";
|
438 |
+
$unfs .= '</tr>' . "\n";
|
439 |
+
}
|
440 |
+
/**/
|
441 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
442 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_before_notes", get_defined_vars ());
|
443 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
444 |
+
/**/
|
445 |
+
$unfs .= '<tr>' . "\n";
|
446 |
+
$unfs .= '<th><label>Administrative<br />Notations:</label> <a href="#" onclick="alert(\'This is for Administrative purposes. You can keep a list of Notations about this account. These Notations are private; Users/Members will never see these.\\n\\n*Note* The s2Member software may `append` Notes to this field occassionaly, under special circumstances. For example, when/if s2Member demotes a paid Member to a Free Subscriber, s2Member will leave a Note in this field.\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
447 |
+
$unfs .= '<td><textarea name="ws_plugin__s2member_user_new_s2member_notes" rows="5" wrap="off" spellcheck="false" style="width:99%;">' . format_to_edit ($_POST["ws_plugin__s2member_user_new_s2member_notes"]) . '</textarea></td>' . "\n";
|
448 |
+
$unfs .= '</tr>' . "\n";
|
449 |
+
/**/
|
450 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
451 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after_notes", get_defined_vars ());
|
452 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
453 |
+
/**/
|
454 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
455 |
+
do_action ("_ws_plugin__s2member_during_admin_user_new_fields_after", get_defined_vars ());
|
456 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
457 |
+
/**/
|
458 |
+
$unfs .= '</table>' . "\n";
|
459 |
+
/**/
|
460 |
+
$unfs .= '<div style="margin:25px 0 25px 0; height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
461 |
+
/**/
|
462 |
+
$buffer = preg_replace ("/(\<\/table\>)([\r\n\t\s ]*)(\<p class\=\"submit\"\>)/", "$1$2" . $unfs . "$3", $buffer);
|
463 |
+
}
|
464 |
+
/**/
|
465 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
466 |
+
do_action ("_ws_plugin__s2member_after_admin_user_new_fields", get_defined_vars ());
|
467 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
468 |
+
/**/
|
469 |
+
return apply_filters ("_ws_plugin__s2member_admin_user_new_fields", $buffer, get_defined_vars ());
|
470 |
+
}
|
471 |
+
}
|
472 |
+
/*
|
473 |
+
This adds custom fields to `wp-signup.php`.
|
474 |
+
Attach to: add_action("signup_extra_fields");
|
475 |
+
~ For Multisite Blog Farms.
|
476 |
+
*/
|
477 |
+
if (!function_exists ("ws_plugin__s2member_ms_custom_registration_fields"))
|
478 |
+
{
|
479 |
+
function ws_plugin__s2member_ms_custom_registration_fields ()
|
480 |
+
{
|
481 |
+
do_action ("ws_plugin__s2member_before_ms_custom_registration_fields", get_defined_vars ());
|
482 |
+
/**/
|
483 |
+
if (is_multisite () && is_main_site ()) /* Must be Multisite / Main Site. */
|
484 |
+
{
|
485 |
+
$_POST = ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST));
|
486 |
+
/**/
|
487 |
+
echo '<input type="hidden" name="ws_plugin__s2member_registration" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-registration")) . '" />' . "\n";
|
488 |
+
/**/
|
489 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
490 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before", get_defined_vars ());
|
491 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
492 |
+
/**/
|
493 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
494 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_first_name", get_defined_vars ());
|
495 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
496 |
+
/**/
|
497 |
+
echo '<label for="ws-plugin--s2member-custom-reg-field-first-name">First Name *</label>' . "\n";
|
498 |
+
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_first_name" id="ws-plugin--s2member-custom-reg-field-first-name" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]) . '" />' . "\n";
|
499 |
+
echo '<br />' . "\n";
|
500 |
+
/**/
|
501 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
502 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_first_name", get_defined_vars ());
|
503 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
504 |
+
/**/
|
505 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
506 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_last_name", get_defined_vars ());
|
507 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
508 |
+
/**/
|
509 |
+
echo '<label for="ws-plugin--s2member-custom-reg-field-last-name">Last Name *</label>' . "\n";
|
510 |
+
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_last_name" id="ws-plugin--s2member-custom-reg-field-last-name" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]) . '" />' . "\n";
|
511 |
+
echo '<br />' . "\n";
|
512 |
+
/**/
|
513 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
514 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_last_name", get_defined_vars ());
|
515 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
516 |
+
/**/
|
517 |
+
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
518 |
+
{
|
519 |
+
$req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
|
520 |
+
$req = ($req) ? ' aria-required="true"' : ''; /* Has JavaScript validation applied. */
|
521 |
+
/**/
|
522 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
523 |
+
{
|
524 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
525 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_custom_fields", get_defined_vars ());
|
526 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
527 |
+
/**/
|
528 |
+
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
529 |
+
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
530 |
+
/**/
|
531 |
+
echo '<label for="ws-plugin--s2member-custom-reg-field-' . $field_id_class . '">' . esc_html ($field) . (($req) ? " *" : "") . '</label>' . "\n";
|
532 |
+
echo '<input' . $req . ' type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_' . $field_var . '" id="ws-plugin--s2member-custom-reg-field-' . $field_id_class . '" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit ($_POST["ws_plugin__s2member_custom_reg_field_" . $field_var]) . '" />' . "\n";
|
533 |
+
echo '<br />' . "\n";
|
534 |
+
/**/
|
535 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
536 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_custom_fields", get_defined_vars ());
|
537 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
538 |
+
}
|
539 |
+
}
|
540 |
+
/**/
|
541 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && ws_plugin__s2member_list_servers_integrated ())
|
542 |
+
{
|
543 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
544 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_opt_in", get_defined_vars ());
|
545 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
546 |
+
/**/
|
547 |
+
echo '<label for="ws-plugin--s2member-custom-reg-field-opt-in">' . "\n";
|
548 |
+
echo '<input type="checkbox" name="ws_plugin__s2member_custom_reg_field_opt_in" id="ws-plugin--s2member-custom-reg-field-opt-in" value="1"' . (((empty ($_POST) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] == 1) || $_POST["ws_plugin__s2member_custom_reg_field_opt_in"]) ? ' checked="checked"' : '') . ' />' . "\n";
|
549 |
+
echo $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in_label"] . "\n";
|
550 |
+
echo '</label>' . "\n";
|
551 |
+
echo '<br />' . "\n";
|
552 |
+
/**/
|
553 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
554 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_opt_in", get_defined_vars ());
|
555 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
556 |
+
}
|
557 |
+
/**/
|
558 |
+
echo '<br />' . "\n"; /* Toss in one extra line break ( extra margin ). */
|
559 |
+
/**/
|
560 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
561 |
+
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after", get_defined_vars ());
|
562 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
563 |
+
}
|
564 |
+
/**/
|
565 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
566 |
+
do_action ("ws_plugin__s2member_after_ms_custom_registration_fields", get_defined_vars ());
|
567 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
568 |
+
/**/
|
569 |
+
return;
|
570 |
+
}
|
571 |
+
}
|
572 |
+
/*
|
573 |
+
This adds custom fields to `wp-login.php?action=register`.
|
574 |
Attach to: add_action("register_form");
|
575 |
*/
|
576 |
if (!function_exists ("ws_plugin__s2member_custom_registration_fields"))
|
579 |
{
|
580 |
do_action ("ws_plugin__s2member_before_custom_registration_fields", get_defined_vars ());
|
581 |
/**/
|
582 |
+
$_POST = ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST));
|
583 |
+
/**/
|
584 |
echo '<input type="hidden" name="ws_plugin__s2member_registration" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-registration")) . '" />' . "\n";
|
585 |
/**/
|
586 |
$tabindex = 20; /* Incremented tabindex starting with 20. */
|
598 |
echo '<p>' . "\n";
|
599 |
echo '<label>' . "\n";
|
600 |
echo 'Password *' . "\n";
|
601 |
+
echo '<input aria-required="true" type="password" maxlength="100" autocomplete="off" name="ws_plugin__s2member_custom_reg_field_user_pass" id="ws-plugin--s2member-custom-reg-field-user-pass" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit ($_POST["ws_plugin__s2member_custom_reg_field_user_pass"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
|
602 |
echo '</label>' . "\n";
|
603 |
echo '</p>';
|
604 |
/**/
|
614 |
echo '<p>' . "\n";
|
615 |
echo '<label>' . "\n";
|
616 |
echo 'First Name *' . "\n";
|
617 |
+
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_first_name" id="ws-plugin--s2member-custom-reg-field-first-name" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
|
618 |
echo '</label>' . "\n";
|
619 |
echo '</p>';
|
620 |
/**/
|
629 |
echo '<p>' . "\n";
|
630 |
echo '<label>' . "\n";
|
631 |
echo 'Last Name *' . "\n";
|
632 |
+
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_last_name" id="ws-plugin--s2member-custom-reg-field-last-name" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
|
633 |
echo '</label>' . "\n";
|
634 |
echo '</p>';
|
635 |
/**/
|
642 |
$req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
|
643 |
$req = ($req) ? ' aria-required="true"' : ''; /* Has JavaScript validation applied. */
|
644 |
/**/
|
645 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
646 |
{
|
647 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
648 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_custom_fields", get_defined_vars ());
|
654 |
echo '<p>' . "\n";
|
655 |
echo '<label>' . "\n";
|
656 |
echo esc_html ($field) . (($req) ? " *" : "") . "\n";
|
657 |
+
echo '<input' . $req . ' type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_' . $field_var . '" id="ws-plugin--s2member-custom-reg-field-' . $field_id_class . '" class="ws-plugin--s2member-custom-reg-field input" size="25" value="' . format_to_edit ($_POST["ws_plugin__s2member_custom_reg_field_" . $field_var]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
|
658 |
echo '</label>' . "\n";
|
659 |
echo '</p>';
|
660 |
/**/
|
740 |
if ($subscr_id && $custom && $item_number) /* Must have all of these. */
|
741 |
{
|
742 |
$register = ws_plugin__s2member_encrypt ("subscr_id_custom_item_number_time:.:|:.:" . $subscr_id . ":.:|:.:" . $custom . ":.:|:.:" . $item_number . ":.:|:.:" . strtotime ("now"));
|
743 |
+
$register_link = add_query_arg ("s2member_register", $register, get_bloginfo ("wpurl") . "/");
|
744 |
/**/
|
745 |
if ($shrink && ($tinyurl = ws_plugin__s2member_remote ("http://tinyurl.com/api-create.php?url=" . rawurlencode ($register_link))))
|
746 |
return apply_filters ("ws_plugin__s2member_register_link_gen", $tinyurl, get_defined_vars ()); /* tinyURL is easier to work with. */
|
775 |
/**/
|
776 |
do_action ("ws_plugin__s2member_during_register", get_defined_vars ());
|
777 |
/**/
|
778 |
+
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && is_main_site ())
|
779 |
+
{
|
780 |
+
echo '<script type="text/javascript">' . "\n";
|
781 |
+
echo "window.location = '" . esc_js (apply_filters ("wp_signup_location", get_bloginfo ("wpurl") . "/wp-signup.php")) . "';";
|
782 |
+
echo '</script>' . "\n";
|
783 |
+
}
|
784 |
+
else /* Otherwise, this is NOT a Multisite install. Or it is, but the Super Administrator is NOT selling Blog creation. */
|
785 |
+
{
|
786 |
+
echo '<script type="text/javascript">' . "\n";
|
787 |
+
echo "window.location = '" . esc_js (add_query_arg ("action", "register", wp_login_url ())) . "';";
|
788 |
+
echo '</script>' . "\n";
|
789 |
+
}
|
790 |
}
|
791 |
}
|
792 |
}
|
800 |
}
|
801 |
}
|
802 |
/*
|
803 |
+
Function that adds customs fields to $meta on signup.
|
804 |
+
Attach to: add_filter("add_signup_meta");
|
805 |
+
|
806 |
+
This can be fired through wp-signup.php on the front-side,
|
807 |
+
or possibly through user-new.php in the admin.
|
808 |
+
*/
|
809 |
+
if (!function_exists ("ws_plugin__s2member_ms_process_signup_meta"))
|
810 |
+
{
|
811 |
+
function ws_plugin__s2member_ms_process_signup_meta ($meta = FALSE)
|
812 |
+
{
|
813 |
+
global $pagenow; /* Need this to detect the current admin page. */
|
814 |
+
/**/
|
815 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
816 |
+
do_action ("ws_plugin__s2member_before_ms_process_signup_meta", get_defined_vars ());
|
817 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
818 |
+
/**/
|
819 |
+
if (is_multisite ()) /* This event should ONLY be processed with Multisite Networking. */
|
820 |
+
if ((is_admin () && $pagenow === "user-new.php") || (ws_plugin__s2member_is_multisite_farm () && is_main_site () && preg_match ("/\/wp-signup\.php/", $_SERVER["REQUEST_URI"]) && $_POST["stage"] === "validate-user-signup"))
|
821 |
+
{
|
822 |
+
ws_plugin__s2member_email_config (); /* Configures From: header that will be used in notifications. */
|
823 |
+
/**/
|
824 |
+
foreach ((array)ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST)) as $key => $value)
|
825 |
+
if (preg_match ("/^ws_plugin__s2member_(custom_reg_field|user_new)_/", $key))
|
826 |
+
if ($key = preg_replace ("/_user_new_/", "_custom_reg_field_", $key))
|
827 |
+
$meta["s2member_ms_signup_meta"][$key] = $value;
|
828 |
+
}
|
829 |
+
/**/
|
830 |
+
return apply_filters ("ws_plugin__s2member_ms_process_signup_meta", $meta, get_defined_vars ());
|
831 |
+
}
|
832 |
+
}
|
833 |
+
/*
|
834 |
+
Function for configuring new users.
|
835 |
+
Attach to: add_action("wpmu_activate_user");
|
836 |
+
|
837 |
+
This does NOT fire for a Super Admin managing Network Users.
|
838 |
+
Which is good. A Super Admin will NOT trigger this event.
|
839 |
+
~ They fire wpmu_create_user(), bypassing activation.
|
840 |
+
- through ms-edit.php.
|
841 |
+
|
842 |
+
However, a Super Admin CAN trigger this event by adding a new User through the Users -> Add New menu.
|
843 |
+
~ If they choose to bypass activation; an activation IS fired immediately. Otherwise, it's delayed.
|
844 |
+
- via user-new.php.
|
845 |
+
|
846 |
+
So this function may get fired inside the admin panel ( user-new.php ).
|
847 |
+
Or also during an actual activation; through wp-activate.php.
|
848 |
+
*/
|
849 |
+
if (!function_exists ("ws_plugin__s2member_configure_user_on_ms_user_activation"))
|
850 |
+
{
|
851 |
+
function ws_plugin__s2member_configure_user_on_ms_user_activation ($user_id = FALSE, $password = FALSE, $meta = FALSE)
|
852 |
+
{
|
853 |
+
global $pagenow; /* Need this to detect the current admin page. */
|
854 |
+
/**/
|
855 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
856 |
+
do_action ("ws_plugin__s2member_before_configure_user_on_ms_user_activation", get_defined_vars ());
|
857 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
858 |
+
/**/
|
859 |
+
if (is_multisite ()) /* This event should ONLY be processed with Multisite Networking. */
|
860 |
+
if ((is_admin () && $pagenow === "user-new.php") || (!is_admin () && preg_match ("/\/wp-activate\.php/", $_SERVER["REQUEST_URI"])))
|
861 |
+
{
|
862 |
+
ws_plugin__s2member_configure_user_registration ($user_id, $password, $meta["s2member_ms_signup_meta"]);
|
863 |
+
delete_user_meta ($user_id, "s2member_ms_signup_meta");
|
864 |
+
}
|
865 |
+
/**/
|
866 |
+
do_action ("ws_plugin__s2member_after_configure_user_on_ms_user_activation", get_defined_vars ());
|
867 |
+
/**/
|
868 |
+
return;
|
869 |
+
}
|
870 |
+
}
|
871 |
+
/*
|
872 |
+
Function for configuring new users.
|
873 |
+
Attach to: add_action("wpmu_activate_blog");
|
874 |
+
|
875 |
+
This does NOT fire for a Super Admin managing Network Blogs.
|
876 |
+
~ Actually they do; BUT it's blocked by the routine below.
|
877 |
+
Which is good. A Super Admin should NOT trigger this event.
|
878 |
+
|
879 |
+
This function should ONLY be fired through wp-activate.php.
|
880 |
+
*/
|
881 |
+
if (!function_exists ("ws_plugin__s2member_configure_user_on_ms_blog_activation"))
|
882 |
+
{
|
883 |
+
function ws_plugin__s2member_configure_user_on_ms_blog_activation ($blog_id = FALSE, $user_id = FALSE, $password = FALSE, $title = FALSE, $meta = FALSE)
|
884 |
+
{
|
885 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
886 |
+
do_action ("ws_plugin__s2member_before_configure_user_on_ms_blog_activation", get_defined_vars ());
|
887 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
888 |
+
/**/
|
889 |
+
if (is_multisite ()) /* This event should ONLY be processed with Multisite Networking. */
|
890 |
+
if (!is_admin () && preg_match ("/\/wp-activate\.php/", $_SERVER["REQUEST_URI"])) /* ONLY `wp-activate.php`. */
|
891 |
+
{
|
892 |
+
ws_plugin__s2member_configure_user_registration ($user_id, $password, $meta["s2member_ms_signup_meta"]);
|
893 |
+
delete_user_meta ($user_id, "s2member_ms_signup_meta");
|
894 |
+
}
|
895 |
+
/**/
|
896 |
+
do_action ("ws_plugin__s2member_after_configure_user_on_ms_blog_activation", get_defined_vars ());
|
897 |
+
/**/
|
898 |
+
return;
|
899 |
+
}
|
900 |
+
}
|
901 |
+
/*
|
902 |
Function for configuring new users.
|
903 |
Attach to: add_action("user_register");
|
904 |
+
|
905 |
+
This also receives Multisite events.
|
906 |
+
Attach to: add_action("wpmu_activate_user");
|
907 |
+
Attach to: add_action("wpmu_activate_blog");
|
908 |
+
|
909 |
+
The Hook `user_register` is also fired by calling:
|
910 |
+
wpmu_create_user()
|
911 |
+
|
912 |
+
This function also receives simulated events from s2Member Pro.
|
913 |
*/
|
914 |
if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
|
915 |
{
|
916 |
+
function ws_plugin__s2member_configure_user_registration ($user_id = FALSE, $password = FALSE, $meta = FALSE)
|
917 |
{
|
918 |
global $wpdb; /* Global database object may be required for this routine. */
|
919 |
+
global $pagenow; /* Need this to detect the current admin page. */
|
920 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
921 |
+
static $email_config, $processed; /* No duplicate processing. */
|
922 |
/**/
|
923 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
924 |
do_action ("ws_plugin__s2member_before_configure_user_registration", get_defined_vars ());
|
925 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
926 |
/**/
|
927 |
+
/* With Multisite Networking, we need this to run on `user_register` ahead of `wpmu_activate_user|blog`. */
|
928 |
+
if (!$email_config && ($email_config = true)) /* Anytime this routine is fired; we config email; no exceptions. */
|
929 |
+
ws_plugin__s2member_email_config (); /* Configures From: header that will be used in new user notifications. */
|
930 |
+
/**/
|
931 |
+
if (!$processed /* Process only once. Safeguard this routine against duplicate processing via plugins ( or even WordPress® itself ). */
|
932 |
+
&& (is_array ($_POST = ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST))) || is_array (ws_plugin__s2member_trim_deep (stripslashes_deep ($meta))))/**/
|
933 |
+
/**/
|
934 |
+
/* These negative matches are designed to prevent this routine from running under certain conditions; where we need to wait for `wpmu_activate_user|blog` instead. */
|
935 |
+
&& !(is_admin () && is_multisite () && $pagenow === "user-new.php" && isset ($_POST["noconfirmation"]) && is_super_admin () && empty ($meta))/**/
|
936 |
+
&& !(preg_match ("/\/wp-activate\.php/", $_SERVER["REQUEST_URI"]) && empty ($meta)) /* If activating; we MUST have a meta array. */
|
937 |
+
/* The $meta array is ONLY filled by hand-offs from `wpmu_activate_user|blog`. So this is how we check for these events. */
|
938 |
+
/**/
|
939 |
+
&& $user_id && is_object ($user = new WP_User ($user_id)) && $user->ID && ($processed = true)) /* Process only once. */
|
940 |
{
|
941 |
+
if (!is_admin () && ($_POST["ws_plugin__s2member_custom_reg_field_s2member_custom"] || $_POST["ws_plugin__s2member_custom_reg_field_s2member_subscr_id"] || $_POST["ws_plugin__s2member_custom_reg_field_s2member_ccaps"] || $_POST["ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time"] || $_POST["ws_plugin__s2member_custom_reg_field_s2member_notes"]))
|
942 |
+
exit ("s2Member security violation. You attempted to POST variables that will NOT be trusted!");
|
943 |
+
/**/
|
944 |
+
$_pm = array_merge ((array)$_POST, (array)$meta); /* Merge these two data sources together. */
|
945 |
/**/
|
946 |
if (!is_admin () /* Only run this particular routine whenever a Member [1-4] is registering themselves with cookies. */
|
947 |
+
&& ($subscr_id = ws_plugin__s2member_decrypt ($_COOKIE["s2member_subscr_id"])) && preg_match ("/^" . preg_quote (preg_replace ("/\:([0-9]+)$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", ($custom = ws_plugin__s2member_decrypt ($_COOKIE["s2member_custom"]))) && preg_match ("/^[1-4](\:|$)([a-z_0-9,]+)?(\:)?([0-9]+ [A-Z])?$/", ($level = ws_plugin__s2member_decrypt ($_COOKIE["s2member_level"])))/**/
|
948 |
+
&& (!$usermeta = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1")))
|
949 |
+
/* ^ This is for security ^ It checks the database to make sure the User/Member has not already registered in the past, with the same Paid Subscr. ID. */
|
950 |
+
{ /*
|
951 |
+
This routine could be processed through `wp-login.php?action=register` - OR - through `wp-activate.php`.
|
952 |
+
If processed through `wp-activate.php`, it could've originated inside the admin, via `user-new.php`.
|
953 |
+
This may also be processed through BuddyPress, or another plugin calling `user_register`.
|
954 |
+
*/
|
955 |
+
$processed = "yes"; /* Mark this as yes, to indicate that a routine was processed. */
|
956 |
/**/
|
957 |
list ($level, $ccaps, $eotper) = preg_split ("/\:/", $level, 3);
|
958 |
$role = "s2member_level" . $level; /* Level 1-4. */
|
961 |
$login = $user->user_login;
|
962 |
$ip = $_SERVER["REMOTE_ADDR"];
|
963 |
$cv = preg_split ("/\|/", $custom);
|
|
|
|
|
|
|
964 |
/**/
|
965 |
+
if ($eotper) /* If a specific EOT Period has been attached; we need to calculate that now. */
|
966 |
+
$auto_eot_time = ws_plugin__s2member_paypal_auto_eot_time (0, 0, 0, $eotper);
|
967 |
+
/**/
|
968 |
+
$notes = $_pm["ws_plugin__s2member_custom_reg_field_s2member_notes"];
|
969 |
+
/**/
|
970 |
+
$opt_in = (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"]) ? true : false;
|
971 |
+
$opt_in = (!$opt_in && $_pm["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : $opt_in;
|
972 |
+
/**/
|
973 |
+
if (!($fname = $user->first_name))
|
974 |
+
if ($_pm["ws_plugin__s2member_custom_reg_field_first_name"])
|
975 |
+
$fname = $_pm["ws_plugin__s2member_custom_reg_field_first_name"];
|
976 |
+
/**/
|
977 |
+
if (!$fname) /* Also try BuddyPress. */
|
978 |
+
if ($_pm["field_1"]) /* BuddyPress. */
|
979 |
+
$fname = trim (preg_replace ("/ (.*)$/", "", $_pm["field_1"]));
|
980 |
+
/**/
|
981 |
+
if (!($lname = $user->last_name))
|
982 |
+
if ($_pm["ws_plugin__s2member_custom_reg_field_last_name"])
|
983 |
+
$lname = $_pm["ws_plugin__s2member_custom_reg_field_last_name"];
|
984 |
+
/**/
|
985 |
+
if (!$lname) /* Also try BuddyPress. */
|
986 |
+
if ($_pm["field_1"] && preg_match ("/^(.+?) (.+)$/", $_pm["field_1"]))
|
987 |
+
$lname = trim (preg_replace ("/^(.+?) (.+)$/", "$2", $_pm["field_1"]));
|
988 |
+
/**/
|
989 |
+
$name = trim ($fname . " " . $lname); /* Both names. */
|
990 |
+
/**/
|
991 |
+
if (!($pass = $password)) /* Try s2Member's generator. */
|
992 |
if ($GLOBALS["ws_plugin__s2member_generate_password_return"])
|
993 |
$pass = $GLOBALS["ws_plugin__s2member_generate_password_return"];
|
994 |
/**/
|
995 |
+
if (!$pass) /* Also try BuddyPress password. */
|
996 |
+
if ($_pm["signup_password"]) /* BuddyPress. */
|
997 |
+
$pass = $_pm["signup_password"];
|
998 |
+
/**/
|
999 |
+
if ($pass) /* No password nag. Update this globally. */
|
1000 |
+
{
|
1001 |
+
delete_user_setting ("default_password_nag"); /* setcookie() */
|
1002 |
+
update_user_option ($user_id, "default_password_nag", false, true);
|
1003 |
+
}
|
1004 |
+
/**/
|
1005 |
+
update_user_option ($user_id, "s2member_auto_eot_time", $auto_eot_time);
|
1006 |
+
update_user_option ($user_id, "s2member_subscr_id", $subscr_id);
|
1007 |
+
update_user_option ($user_id, "s2member_custom", $custom);
|
1008 |
+
update_user_option ($user_id, "s2member_notes", $notes);
|
1009 |
/**/
|
1010 |
+
if (!$user->first_name && $fname)
|
1011 |
+
update_user_meta ($user_id, "first_name", $fname) ./**/
|
1012 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $fname));
|
1013 |
/**/
|
1014 |
+
if (!$user->last_name && $lname)
|
1015 |
+
update_user_meta ($user_id, "last_name", $lname);
|
1016 |
/**/
|
1017 |
+
if (is_multisite ()) /* Originating Blog ID#, and adjust Main Site permissions. */
|
1018 |
+
{
|
1019 |
+
(!is_main_site ()) ? remove_user_from_blog ($user_id, $current_site->blog_id) : null;
|
1020 |
+
update_user_meta ($user_id, "s2member_originating_blog", $current_blog->blog_id);
|
1021 |
+
}
|
1022 |
/**/
|
1023 |
+
$user->set_role ($role); /* s2Member. */
|
1024 |
+
/**/
|
1025 |
+
if ($ccaps) /* Add Custom Capabilities. */
|
1026 |
foreach (preg_split ("/[\r\n\t\s;,]+/", $ccaps) as $ccap)
|
1027 |
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
1028 |
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
1029 |
/**/
|
1030 |
+
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
1031 |
+
{
|
1032 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
1033 |
+
{
|
1034 |
+
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
1035 |
+
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
1036 |
+
/**/
|
1037 |
+
if (strlen ($_pm["ws_plugin__s2member_custom_reg_field_" . $field_var]))
|
1038 |
+
$fields[$field_var] = $_pm["ws_plugin__s2member_custom_reg_field_" . $field_var];
|
1039 |
+
}
|
1040 |
+
}
|
1041 |
+
/**/
|
1042 |
+
update_user_option ($user_id, "s2member_custom_fields", $fields);
|
1043 |
/**/
|
1044 |
if (($transient = md5 ("s2member_transient_ipn_subscr_payment_" . $subscr_id)) && is_array ($subscr_payment = get_transient ($transient)))
|
1045 |
{
|
1046 |
$proxy = array ("s2member_paypal_notify" => "1", "s2member_paypal_proxy" => "s2member_transient_ipn_subscr_payment");
|
1047 |
+
ws_plugin__s2member_remote (add_query_arg ($proxy, get_bloginfo ("wpurl")), stripslashes_deep ($subscr_payment), array ("timeout" => 20));
|
1048 |
delete_transient ($transient);
|
1049 |
}
|
1050 |
/**/
|
1055 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1056 |
}
|
1057 |
/**/
|
1058 |
+
else if (!is_admin ()) /* Otherwise, if we are NOT inside the Dashboard during the creation of this account. */
|
1059 |
+
{ /*
|
1060 |
+
This routine could be processed through `wp-login.php?action=register` - OR - through `wp-activate.php`.
|
1061 |
+
If processed through `wp-activate.php`, it could've originated inside the admin, via `user-new.php`.
|
1062 |
+
This may also be processed through BuddyPress, or another plugin calling `user_register`.
|
1063 |
+
*/
|
1064 |
+
$processed = "yes"; /* Mark this as yes, to indicate that a routine was processed. */
|
1065 |
+
/**/
|
1066 |
+
$role = $role = $user->roles[0]; /* If they already have a Role, we can use it. */
|
1067 |
+
$role = (!$role && is_multisite () && is_main_site ()) ? get_site_option ("default_user_role") : $role;
|
1068 |
+
$role = (!$role) ? get_option ("default_role") : $role; /* Otherwise, the default role. */
|
1069 |
/**/
|
1070 |
+
$level = (preg_match ("/^(administrator|editor|author|contributor)$/i", $role)) ? "4" : $level;
|
1071 |
+
$level = (!$level && preg_match ("/^s2member_level[1-4]$/i", $role)) ? preg_replace ("/^s2member_level/", "", $role) : $level;
|
1072 |
+
$level = (!$level && preg_match ("/^subscriber$/i", $role)) ? "0" : $level;
|
1073 |
+
$level = (!$level) ? "0" : $level;
|
1074 |
+
/**/
|
1075 |
+
$ccaps = $_pm["ws_plugin__s2member_custom_reg_field_s2member_ccaps"];
|
1076 |
/**/
|
1077 |
$email = $user->user_email;
|
1078 |
$login = $user->user_login;
|
1079 |
$ip = $_SERVER["REMOTE_ADDR"];
|
1080 |
+
$custom = $_pm["ws_plugin__s2member_custom_reg_field_s2member_custom"];
|
1081 |
+
$subscr_id = $_pm["ws_plugin__s2member_custom_reg_field_s2member_subscr_id"];
|
1082 |
+
$cv = preg_split ("/\|/", $_pm["ws_plugin__s2member_custom_reg_field_s2member_custom"]);
|
1083 |
+
/**/
|
1084 |
+
$auto_eot_time = ($eot = $_pm["ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time"]) ? strtotime ($eot) : "";
|
1085 |
+
$notes = $_pm["ws_plugin__s2member_custom_reg_field_s2member_notes"];
|
1086 |
+
/**/
|
1087 |
+
$opt_in = (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"]) ? true : false;
|
1088 |
+
$opt_in = (!$opt_in && $_pm["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : $opt_in;
|
1089 |
/**/
|
1090 |
+
if (!($fname = $user->first_name))
|
1091 |
+
if ($_pm["ws_plugin__s2member_custom_reg_field_first_name"])
|
1092 |
+
$fname = $_pm["ws_plugin__s2member_custom_reg_field_first_name"];
|
1093 |
+
/**/
|
1094 |
+
if (!$fname) /* Also try BuddyPress. */
|
1095 |
+
if ($_pm["field_1"]) /* BuddyPress. */
|
1096 |
+
$fname = trim (preg_replace ("/ (.*)$/", "", $_pm["field_1"]));
|
1097 |
+
/**/
|
1098 |
+
if (!($lname = $user->last_name))
|
1099 |
+
if ($_pm["ws_plugin__s2member_custom_reg_field_last_name"])
|
1100 |
+
$lname = $_pm["ws_plugin__s2member_custom_reg_field_last_name"];
|
1101 |
+
/**/
|
1102 |
+
if (!$lname) /* Also try BuddyPress. */
|
1103 |
+
if ($_pm["field_1"] && preg_match ("/^(.+?) (.+)$/", $_pm["field_1"]))
|
1104 |
+
$lname = trim (preg_replace ("/^(.+?) (.+)$/", "$2", $_pm["field_1"]));
|
1105 |
+
/**/
|
1106 |
+
$name = trim ($fname . " " . $lname); /* Both names. */
|
1107 |
+
/**/
|
1108 |
+
if (!($pass = $password)) /* Try s2Member's generator. */
|
1109 |
if ($GLOBALS["ws_plugin__s2member_generate_password_return"])
|
1110 |
$pass = $GLOBALS["ws_plugin__s2member_generate_password_return"];
|
1111 |
/**/
|
1112 |
+
if (!$pass) /* Also try BuddyPress password. */
|
1113 |
+
if ($_pm["signup_password"]) /* BuddyPress. */
|
1114 |
+
$pass = $_pm["signup_password"];
|
1115 |
+
/**/
|
1116 |
+
if ($pass) /* No password nag. Update this globally. */
|
1117 |
+
{
|
1118 |
+
delete_user_setting ("default_password_nag"); /* setcookie() */
|
1119 |
+
update_user_option ($user_id, "default_password_nag", false, true);
|
1120 |
+
}
|
1121 |
+
/**/
|
1122 |
+
update_user_option ($user_id, "s2member_auto_eot_time", $auto_eot_time);
|
1123 |
+
update_user_option ($user_id, "s2member_subscr_id", $subscr_id);
|
1124 |
+
update_user_option ($user_id, "s2member_custom", $custom);
|
1125 |
+
update_user_option ($user_id, "s2member_notes", $notes);
|
1126 |
+
/**/
|
1127 |
+
if (!$user->first_name && $fname)
|
1128 |
+
update_user_meta ($user_id, "first_name", $fname) ./**/
|
1129 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $fname));
|
1130 |
+
/**/
|
1131 |
+
if (!$user->last_name && $lname)
|
1132 |
+
update_user_meta ($user_id, "last_name", $lname);
|
1133 |
+
/**/
|
1134 |
+
if (is_multisite ()) /* Originating Blog ID#, and adjust Main Site permissions. */
|
1135 |
+
{
|
1136 |
+
(!is_main_site ()) ? remove_user_from_blog ($user_id, $current_site->blog_id) : null;
|
1137 |
+
update_user_meta ($user_id, "s2member_originating_blog", $current_blog->blog_id);
|
1138 |
+
}
|
1139 |
+
/**/
|
1140 |
+
$user->set_role ($role); /* s2Member. */
|
1141 |
/**/
|
1142 |
+
if ($ccaps) /* Add Custom Capabilities. */
|
1143 |
+
foreach (preg_split ("/[\r\n\t\s;,]+/", $ccaps) as $ccap)
|
1144 |
+
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
1145 |
+
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
1146 |
+
/**/
|
1147 |
+
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
1148 |
+
{
|
1149 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
1150 |
+
{
|
1151 |
+
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
1152 |
+
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
1153 |
+
/**/
|
1154 |
+
if (strlen ($_pm["ws_plugin__s2member_custom_reg_field_" . $field_var]))
|
1155 |
+
$fields[$field_var] = $_pm["ws_plugin__s2member_custom_reg_field_" . $field_var];
|
1156 |
+
}
|
1157 |
+
}
|
1158 |
+
/**/
|
1159 |
+
update_user_option ($user_id, "s2member_custom_fields", $fields);
|
1160 |
/**/
|
1161 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1162 |
do_action ("ws_plugin__s2member_during_configure_user_registration_front_side", get_defined_vars ());
|
1163 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1164 |
}
|
1165 |
/**/
|
1166 |
+
else if (is_admin () && $pagenow === "user-new.php") /* Else, if we're on this admin page. */
|
1167 |
+
{ /*
|
1168 |
+
This routine can ONLY be processed through `user-new.php` inside the Dashboard.
|
1169 |
+
*/
|
1170 |
+
$processed = "yes"; /* Mark this as yes, to indicate that a routine was processed. */
|
1171 |
+
/**/
|
1172 |
+
$role = $role = $user->roles[0]; /* If they already have a Role, we can use it. */
|
1173 |
+
$role = (!$role && is_multisite () && is_main_site ()) ? get_site_option ("default_user_role") : $role;
|
1174 |
+
$role = (!$role) ? get_option ("default_role") : $role; /* Otherwise, the default role. */
|
1175 |
/**/
|
1176 |
+
$level = (preg_match ("/^(administrator|editor|author|contributor)$/i", $role)) ? "4" : $level;
|
1177 |
+
$level = (!$level && preg_match ("/^s2member_level[1-4]$/i", $role)) ? preg_replace ("/^s2member_level/", "", $role) : $level;
|
1178 |
+
$level = (!$level && preg_match ("/^subscriber$/i", $role)) ? "0" : $level;
|
1179 |
+
$level = (!$level) ? "0" : $level;
|
1180 |
+
/**/
|
1181 |
+
$ccaps = $_pm["ws_plugin__s2member_custom_reg_field_s2member_ccaps"];
|
1182 |
/**/
|
1183 |
$email = $user->user_email;
|
1184 |
$login = $user->user_login;
|
1185 |
$ip = ""; /* N/Applicable. */
|
1186 |
+
$custom = $_pm["ws_plugin__s2member_custom_reg_field_s2member_custom"];
|
1187 |
+
$subscr_id = $_pm["ws_plugin__s2member_custom_reg_field_s2member_subscr_id"];
|
1188 |
+
$cv = preg_split ("/\|/", $_pm["ws_plugin__s2member_custom_reg_field_s2member_custom"]);
|
1189 |
+
/**/
|
1190 |
+
$auto_eot_time = ($eot = $_pm["ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time"]) ? strtotime ($eot) : "";
|
1191 |
+
$notes = $_pm["ws_plugin__s2member_custom_reg_field_s2member_notes"];
|
1192 |
+
/**/
|
1193 |
+
$opt_in = (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"]) ? true : false;
|
1194 |
+
$opt_in = (!$opt_in && $_pm["ws_plugin__s2member_custom_reg_field_opt_in"]) ? true : $opt_in;
|
1195 |
/**/
|
1196 |
+
if (!($fname = $user->first_name)) /* `Users -> Add New`. */
|
1197 |
+
if ($_pm["ws_plugin__s2member_custom_reg_field_first_name"])
|
1198 |
+
$fname = $_pm["ws_plugin__s2member_custom_reg_field_first_name"];
|
1199 |
+
/**/
|
1200 |
+
if (!($lname = $user->last_name)) /* `Users -> Add New`. */
|
1201 |
+
if ($_pm["ws_plugin__s2member_custom_reg_field_last_name"])
|
1202 |
+
$lname = $_pm["ws_plugin__s2member_custom_reg_field_last_name"];
|
1203 |
+
/**/
|
1204 |
+
$name = trim ($fname . " " . $lname); /* Both names. */
|
1205 |
+
/**/
|
1206 |
+
if (!($pass = $password)) /* Try s2Member's generator. */
|
1207 |
if ($GLOBALS["ws_plugin__s2member_generate_password_return"])
|
1208 |
$pass = $GLOBALS["ws_plugin__s2member_generate_password_return"];
|
1209 |
/**/
|
1210 |
if (!$pass) /* Also try the `Users -> Add New` form. */
|
1211 |
+
if ($_pm["pass1"]) /* Field in user-new.php. */
|
1212 |
+
$pass = $_pm["pass1"];
|
1213 |
/**/
|
1214 |
+
if ($pass) /* No password nag. Update this globally. */
|
1215 |
+
{
|
1216 |
+
delete_user_setting ("default_password_nag"); /* setcookie() */
|
1217 |
+
update_user_option ($user_id, "default_password_nag", false, true);
|
1218 |
+
}
|
1219 |
/**/
|
1220 |
+
update_user_option ($user_id, "s2member_auto_eot_time", $auto_eot_time);
|
1221 |
+
update_user_option ($user_id, "s2member_subscr_id", $subscr_id);
|
1222 |
+
update_user_option ($user_id, "s2member_custom", $custom);
|
1223 |
+
update_user_option ($user_id, "s2member_notes", $notes);
|
1224 |
+
/**/
|
1225 |
+
if (!$user->first_name && $fname)
|
1226 |
+
update_user_meta ($user_id, "first_name", $fname) ./**/
|
1227 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $fname));
|
|
|
|
|
1228 |
/**/
|
1229 |
+
if (!$user->last_name && $lname)
|
1230 |
+
update_user_meta ($user_id, "last_name", $lname);
|
1231 |
+
/**/
|
1232 |
+
if (is_multisite ()) /* Originating Blog ID#, and adjust Main Site permissions. */
|
1233 |
+
{
|
1234 |
+
(!is_main_site ()) ? remove_user_from_blog ($user_id, $current_site->blog_id) : null;
|
1235 |
+
update_user_meta ($user_id, "s2member_originating_blog", $current_blog->blog_id);
|
1236 |
+
}
|
1237 |
+
/**/
|
1238 |
+
$user->set_role ($role); /* s2Member. */
|
1239 |
+
/**/
|
1240 |
+
foreach (preg_split ("/[\r\n\t\s;,]+/", $ccaps) as $ccap)
|
1241 |
+
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
1242 |
+
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
1243 |
/**/
|
1244 |
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
1245 |
{
|
1246 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
1247 |
{
|
1248 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
1249 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
1250 |
/**/
|
1251 |
+
$fields[$field_var] = $_pm["ws_plugin__s2member_custom_reg_field_" . $field_var];
|
|
|
1252 |
}
|
1253 |
}
|
1254 |
/**/
|
1255 |
+
update_user_option ($user_id, "s2member_custom_fields", $fields);
|
1256 |
/**/
|
1257 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1258 |
+
do_action ("ws_plugin__s2member_during_configure_user_registration_admin_side", get_defined_vars ());
|
1259 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1260 |
+
}
|
1261 |
+
/**/
|
1262 |
+
if ($processed === "yes") /* If registration was processed by one of the routines above. */
|
1263 |
+
{
|
1264 |
ws_plugin__s2member_process_list_servers ($level, $email, $fname, $lname, $ip, $opt_in);
|
1265 |
/**/
|
1266 |
if ($urls = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_urls"])
|
1267 |
foreach (preg_split ("/[\r\n\t]+/", $urls) as $url) /* Notify each of the urls. */
|
1268 |
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
|
1269 |
+
if (($url = preg_replace ("/%%role%%/i", ws_plugin__s2member_esc_ds (urlencode ($role)), $url)))
|
1270 |
+
if (($url = preg_replace ("/%%level%%/i", ws_plugin__s2member_esc_ds (urlencode ($level)), $url)))
|
1271 |
+
if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($fname)), $url)))
|
1272 |
+
if (($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($lname)), $url)))
|
1273 |
+
if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($name)), $url)))
|
1274 |
+
if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($email)), $url)))
|
1275 |
+
if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
|
1276 |
+
if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
|
1277 |
+
if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
|
1278 |
+
if (($url = trim ($url))) /* Empty? */
|
1279 |
+
ws_plugin__s2member_remote ($url);
|
1280 |
+
/**/
|
1281 |
+
if ($url = $GLOBALS["ws_plugin__s2member_registration_return_url"])
|
1282 |
+
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
|
1283 |
+
if (($url = preg_replace ("/%%role%%/i", ws_plugin__s2member_esc_ds (urlencode ($role)), $url)))
|
1284 |
if (($url = preg_replace ("/%%level%%/i", ws_plugin__s2member_esc_ds (urlencode ($level)), $url)))
|
1285 |
if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($fname)), $url)))
|
1286 |
if (($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($lname)), $url)))
|
1289 |
if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
|
1290 |
if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
|
1291 |
if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
|
1292 |
+
if (($url = trim ($url))) /* Empty? ... Otherwise, re-fill. */
|
1293 |
+
$GLOBALS["ws_plugin__s2member_registration_return_url"] = $url;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1294 |
/**/
|
1295 |
setcookie ("s2member_subscr_id", "", time () + 31556926, "/");
|
1296 |
setcookie ("s2member_custom", "", time () + 31556926, "/");
|
1333 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
|
1334 |
if ($custom = trim (stripslashes ($_POST["ws_plugin__s2member_custom_reg_field_user_pass"])))
|
1335 |
{
|
1336 |
+
$password = $custom; /* Use custom password. */
|
|
|
1337 |
}
|
1338 |
/**/
|
1339 |
return ($GLOBALS["ws_plugin__s2member_generate_password_return"] = $password);
|
1340 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1341 |
}
|
1342 |
}
|
1343 |
/*
|
1363 |
return $show;
|
1364 |
}
|
1365 |
}
|
1366 |
+
/*
|
1367 |
+
Convert primitive Role names in emails sent by WordPress®.
|
1368 |
+
Attach to: add_filter("wpmu_signup_user_notification_email");
|
1369 |
+
~ Only necessary with this particular email.
|
1370 |
+
*/
|
1371 |
+
if (!function_exists ("ws_plugin__s2member_ms_nice_email_roles"))
|
1372 |
+
{
|
1373 |
+
function ws_plugin__s2member_ms_nice_email_roles ($message = FALSE)
|
1374 |
+
{
|
1375 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1376 |
+
do_action ("ws_plugin__s2member_before_ms_nice_email_roles", get_defined_vars ());
|
1377 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1378 |
+
/**/
|
1379 |
+
$message = preg_replace ("/ as a (subscriber|s2member_level[1-4])/i", " as a Member", $message);
|
1380 |
+
/**/
|
1381 |
+
return apply_filters ("ws_plugin__s2member_ms_nice_email_roles", $message, get_defined_vars ());
|
1382 |
+
}
|
1383 |
+
}
|
1384 |
?>
|
includes/functions/sp-access.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Generates Specific Post/Page Access links.
|
18 |
*/
|
@@ -48,7 +48,7 @@ if (!function_exists ("ws_plugin__s2member_sp_access_link"))
|
|
48 |
{
|
49 |
do_action ("ws_plugin__s2member_before_sp_access_link", get_defined_vars ());
|
50 |
/**/
|
51 |
-
if (current_user_can ("
|
52 |
if (($nonce = $_POST["s2member_sp_access_link"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-sp-access-link"))
|
53 |
echo apply_filters ("ws_plugin__s2member_sp_access_link", ws_plugin__s2member_sp_access_link_gen ($_POST["s2member_sp_access_link_ids"], $_POST["s2member_sp_access_link_hours"]), get_defined_vars ());
|
54 |
/**/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Generates Specific Post/Page Access links.
|
18 |
*/
|
48 |
{
|
49 |
do_action ("ws_plugin__s2member_before_sp_access_link", get_defined_vars ());
|
50 |
/**/
|
51 |
+
if (current_user_can ("create_users")) /* Check priveledges as well. */
|
52 |
if (($nonce = $_POST["s2member_sp_access_link"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-sp-access-link"))
|
53 |
echo apply_filters ("ws_plugin__s2member_sp_access_link", ws_plugin__s2member_sp_access_link_gen ($_POST["s2member_sp_access_link_ids"], $_POST["s2member_sp_access_link_hours"]), get_defined_vars ());
|
54 |
/**/
|
includes/functions/tracking-codes.inc.php
CHANGED
@@ -39,13 +39,13 @@ if (!function_exists ("ws_plugin__s2member_display_signup_tracking_codes"))
|
|
39 |
{
|
40 |
delete_transient ($transient); /* Only display this ONE time. Delete transient immediately. */
|
41 |
/**/
|
42 |
-
echo '<img src="' . add_query_arg ("s2member_delete_signup_tracking_cookie", "1", get_bloginfo ("
|
43 |
/**/
|
44 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
45 |
do_action ("ws_plugin__s2member_during_display_signup_tracking_codes", get_defined_vars ());
|
46 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
47 |
/**/
|
48 |
-
if (ws_plugin__s2member_is_multisite_farm ())
|
49 |
{
|
50 |
echo $code . "\n"; /* No PHP here. */
|
51 |
}
|
@@ -103,13 +103,13 @@ if (!function_exists ("ws_plugin__s2member_display_sp_tracking_codes"))
|
|
103 |
{
|
104 |
delete_transient ($transient); /* Only display this ONE time. Delete transient immediately. */
|
105 |
/**/
|
106 |
-
echo '<img src="' . add_query_arg ("s2member_delete_sp_tracking_cookie", "1", get_bloginfo ("
|
107 |
/**/
|
108 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
109 |
do_action ("ws_plugin__s2member_during_display_sp_tracking_codes", get_defined_vars ());
|
110 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
111 |
/**/
|
112 |
-
if (ws_plugin__s2member_is_multisite_farm ())
|
113 |
{
|
114 |
echo $code . "\n"; /* No PHP here. */
|
115 |
}
|
39 |
{
|
40 |
delete_transient ($transient); /* Only display this ONE time. Delete transient immediately. */
|
41 |
/**/
|
42 |
+
echo '<img src="' . add_query_arg ("s2member_delete_signup_tracking_cookie", "1", get_bloginfo ("wpurl")) . '" alt="." style="width:1px; height:1px; border:0;" />' . "\n";
|
43 |
/**/
|
44 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
45 |
do_action ("ws_plugin__s2member_during_display_signup_tracking_codes", get_defined_vars ());
|
46 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
47 |
/**/
|
48 |
+
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ())
|
49 |
{
|
50 |
echo $code . "\n"; /* No PHP here. */
|
51 |
}
|
103 |
{
|
104 |
delete_transient ($transient); /* Only display this ONE time. Delete transient immediately. */
|
105 |
/**/
|
106 |
+
echo '<img src="' . add_query_arg ("s2member_delete_sp_tracking_cookie", "1", get_bloginfo ("wpurl")) . '" alt="." style="width:1px; height:1px; border:0;" />' . "\n";
|
107 |
/**/
|
108 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
109 |
do_action ("ws_plugin__s2member_during_display_sp_tracking_codes", get_defined_vars ());
|
110 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
111 |
/**/
|
112 |
+
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ())
|
113 |
{
|
114 |
echo $code . "\n"; /* No PHP here. */
|
115 |
}
|
includes/functions/translations.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Mangles internal translations.
|
18 |
Attach to: add_filter("gettext");
|
@@ -21,7 +21,8 @@ if (!function_exists ("ws_plugin__s2member_translation_mangler"))
|
|
21 |
{
|
22 |
function ws_plugin__s2member_translation_mangler ($translated = FALSE, $original = FALSE, $domain = FALSE)
|
23 |
{
|
24 |
-
|
|
|
25 |
/**/
|
26 |
if (!isset ($is_admin_media_upload) || $is_admin_media_upload)
|
27 |
{
|
@@ -38,7 +39,36 @@ if (!function_exists ("ws_plugin__s2member_translation_mangler"))
|
|
38 |
$is_admin_media_upload = false;
|
39 |
}
|
40 |
/**/
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
{
|
43 |
if ($is_wp_login || preg_match ("/\/wp-login\.php/", $_SERVER["REQUEST_URI"]))
|
44 |
{
|
@@ -52,6 +82,11 @@ if (!function_exists ("ws_plugin__s2member_translation_mangler"))
|
|
52 |
{
|
53 |
$translated = apply_filters ("ws_plugin__s2member_translation_mangler", "Email Address *", get_defined_vars ());
|
54 |
}
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
else /* Otherwise, false. */
|
57 |
$is_wp_login = false;
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Mangles internal translations.
|
18 |
Attach to: add_filter("gettext");
|
21 |
{
|
22 |
function ws_plugin__s2member_translation_mangler ($translated = FALSE, $original = FALSE, $domain = FALSE)
|
23 |
{
|
24 |
+
global $current_site, $current_blog; /* In support of Multisite Networking. */
|
25 |
+
static $is_admin_media_upload, $is_wp_signup, $is_wp_login; /* Optimizes this routine. */
|
26 |
/**/
|
27 |
if (!isset ($is_admin_media_upload) || $is_admin_media_upload)
|
28 |
{
|
39 |
$is_admin_media_upload = false;
|
40 |
}
|
41 |
/**/
|
42 |
+
if ((!isset ($is_wp_signup) || $is_wp_signup) && is_multisite () && is_main_site ())
|
43 |
+
{
|
44 |
+
if ($is_wp_signup || preg_match ("/\/wp-signup\.php/", $_SERVER["REQUEST_URI"]))
|
45 |
+
{
|
46 |
+
$is_wp_signup = true; /* Yes, we are in this area. */
|
47 |
+
/**/
|
48 |
+
if ($translated === "If you’re not going to use a great site domain, leave it for a new user. Now have at it!")
|
49 |
+
$translated = apply_filters ("ws_plugin__s2member_translation_mangler", "", get_defined_vars ());
|
50 |
+
/**/
|
51 |
+
else if ($translated === "Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart’s content, but write responsibly!")
|
52 |
+
{
|
53 |
+
if (is_user_logged_in () && is_object ($current_user = wp_get_current_user ())) /* Must have a User obj. */
|
54 |
+
{
|
55 |
+
$blogs_allowed = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . ws_plugin__s2member_user_access_level ()];
|
56 |
+
$current_user_blogs = (is_array ($blogs = get_blogs_of_user ($current_user->ID))) ? count ($blogs) - 1 : 0;
|
57 |
+
$current_user_blogs = ($current_user_blogs >= 0) ? $current_user_blogs : 0;
|
58 |
+
/**/
|
59 |
+
if ($current_user_blogs >= 1) /* So here they already have at least 1 Blog. This message works fine. */
|
60 |
+
$translated = apply_filters ("ws_plugin__s2member_translation_mangler", "Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. You may create up to " . $blogs_allowed . " site" . (($blogs_allowed < 1 || $blogs_allowed > 1) ? "s" : "") . "; but please write responsibly<em>!</em>", get_defined_vars ());
|
61 |
+
/**/
|
62 |
+
else /* Otherwise, we need a different message. One that is NOT confusing to a new Customer. */
|
63 |
+
$translated = apply_filters ("ws_plugin__s2member_translation_mangler", "Hi %s. By filling out the form below, you can <strong>add a site to your account</strong>. You may create up to " . $blogs_allowed . " site" . (($blogs_allowed < 1 || $blogs_allowed > 1) ? "s" : "") . "; but please write responsibly<em>!</em>", get_defined_vars ());
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
else /* Otherwise, false. */
|
68 |
+
$is_wp_signup = false;
|
69 |
+
}
|
70 |
+
/**/
|
71 |
+
if (!isset ($is_wp_login) || $is_wp_login)
|
72 |
{
|
73 |
if ($is_wp_login || preg_match ("/\/wp-login\.php/", $_SERVER["REQUEST_URI"]))
|
74 |
{
|
82 |
{
|
83 |
$translated = apply_filters ("ws_plugin__s2member_translation_mangler", "Email Address *", get_defined_vars ());
|
84 |
}
|
85 |
+
else if ($translated === "Registration complete. Please check your e-mail.")
|
86 |
+
{
|
87 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"] && function_exists ("ws_plugin__s2member_generate_password"))
|
88 |
+
$translated = "Registration complete. Please log in.";
|
89 |
+
}
|
90 |
}
|
91 |
else /* Otherwise, false. */
|
92 |
$is_wp_login = false;
|
includes/functions/user-access-level.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
Function for determing the Access Level of a User/Member.
|
18 |
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function for determing the Access Level of a User/Member.
|
18 |
|
includes/functions/user-deletions.inc.php
CHANGED
@@ -12,39 +12,97 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
/*
|
17 |
Function for handling user deletions.
|
18 |
Attach to: add_action("delete_user");
|
|
|
|
|
|
|
|
|
19 |
*/
|
20 |
if (!function_exists ("ws_plugin__s2member_handle_user_deletions"))
|
21 |
{
|
22 |
function ws_plugin__s2member_handle_user_deletions ($user_id = FALSE)
|
23 |
{
|
24 |
-
|
|
|
|
|
25 |
do_action ("ws_plugin__s2member_before_handle_user_deletions", get_defined_vars ());
|
26 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
27 |
/**/
|
28 |
-
$
|
29 |
-
$subscr_id = get_usermeta ($user_id, "s2member_subscr_id");
|
30 |
-
/**/
|
31 |
-
if (is_object ($user = new WP_User ($user_id)) && $user->ID && $subscr_id && $custom && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $custom)))
|
32 |
{
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
41 |
/**/
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
/**/
|
47 |
-
eval
|
48 |
do_action ("ws_plugin__s2member_after_handle_user_deletions", get_defined_vars ());
|
49 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
50 |
/**/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
+
/*
|
17 |
+
Function for handling user deletions.
|
18 |
+
Attach to: add_action("remove_user_from_blog");
|
19 |
+
*/
|
20 |
+
if (!function_exists ("ws_plugin__s2member_handle_ms_user_deletions"))
|
21 |
+
{
|
22 |
+
function ws_plugin__s2member_handle_ms_user_deletions ($user_id = FALSE, $blog_id = FALSE, $s2says = FALSE)
|
23 |
+
{
|
24 |
+
static $processed = array (); /* No duplicate processing. */
|
25 |
+
global $pagenow; /* Need this to detect the current admin page. */
|
26 |
+
/**/
|
27 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
28 |
+
do_action ("ws_plugin__s2member_before_handle_ms_user_deletions", get_defined_vars ());
|
29 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
30 |
+
/**/
|
31 |
+
if (is_multisite () && !$processed[$user_id]) /* Safeguard this routine against duplicate processing via plugins ( or even WordPress® itself ). */
|
32 |
+
{
|
33 |
+
if (($s2says || (is_admin () && $pagenow === "users.php")) && ($processed[$user_id] = true)) /* If s2Member says, or on users.php. */
|
34 |
+
/* We don't react on this event globally, because there are many routines that remove Users from a Blog; w/ harmless reasons. */
|
35 |
+
{
|
36 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
37 |
+
do_action ("ws_plugin__s2member_during_handle_ms_user_deletions_before", get_defined_vars ());
|
38 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
39 |
+
/**/
|
40 |
+
ws_plugin__s2member_handle_user_deletions($user_id); /* Now hand this over. */
|
41 |
+
/**/
|
42 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
43 |
+
do_action ("ws_plugin__s2member_during_handle_ms_user_deletions_after", get_defined_vars ());
|
44 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
45 |
+
}
|
46 |
+
}
|
47 |
+
/**/
|
48 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
49 |
+
do_action ("ws_plugin__s2member_after_handle_ms_user_deletions", get_defined_vars ());
|
50 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
51 |
+
/**/
|
52 |
+
return;
|
53 |
+
}
|
54 |
+
}
|
55 |
/*
|
56 |
Function for handling user deletions.
|
57 |
Attach to: add_action("delete_user");
|
58 |
+
Attach to: add_action("wpmu_delete_user");
|
59 |
+
|
60 |
+
This also handles Multisite removal hand-offs.
|
61 |
+
ws_plugin__s2member_handle_ms_user_deletions().
|
62 |
*/
|
63 |
if (!function_exists ("ws_plugin__s2member_handle_user_deletions"))
|
64 |
{
|
65 |
function ws_plugin__s2member_handle_user_deletions ($user_id = FALSE)
|
66 |
{
|
67 |
+
static $processed = array (); /* No duplicate processing. */
|
68 |
+
/**/
|
69 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
70 |
do_action ("ws_plugin__s2member_before_handle_user_deletions", get_defined_vars ());
|
71 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
72 |
/**/
|
73 |
+
if (!$processed[$user_id] && ($processed[$user_id] = true)) /* Safeguard this routine against duplicate processing via plugins ( or even WordPress® itself ). */
|
|
|
|
|
|
|
74 |
{
|
75 |
+
$custom = get_user_option ("s2member_custom", $user_id); /* An EOT Notification is triggered, EVEN if this is empty. */
|
76 |
+
$subscr_id = get_user_option ("s2member_subscr_id", $user_id); /* And also, EVEN if this is empty. */
|
77 |
+
/**/
|
78 |
+
delete_user_option ($user_id, "s2member_custom"); /* Now we can remove these User options ( for this Blog ). */
|
79 |
+
delete_user_option ($user_id, "s2member_subscr_id"); /* The `wpmu_delete_user` Hook also handles this. */
|
80 |
+
delete_user_option ($user_id, "s2member_last_payment_time");
|
81 |
+
delete_user_option ($user_id, "s2member_auto_eot_time");
|
82 |
+
delete_user_option ($user_id, "s2member_notes");
|
83 |
+
/**/
|
84 |
+
delete_user_option ($user_id, "s2member_file_download_access_arc");
|
85 |
+
delete_user_option ($user_id, "s2member_file_download_access_log");
|
86 |
/**/
|
87 |
+
if (is_object ($user = new WP_User ($user_id)) && $user->ID && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $custom)))
|
88 |
+
{
|
89 |
+
foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) /* Handle EOT Notifications on user deletion. */
|
90 |
+
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($subscr_id)), $url)))
|
91 |
+
if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
|
92 |
+
if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
|
93 |
+
if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
|
94 |
+
if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
|
95 |
+
/**/
|
96 |
+
if (($url = trim ($url))) /* Empty? */
|
97 |
+
ws_plugin__s2member_remote($url);
|
98 |
+
/**/
|
99 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
100 |
+
do_action ("ws_plugin__s2member_during_handle_user_deletions", get_defined_vars ());
|
101 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
102 |
+
}
|
103 |
}
|
104 |
/**/
|
105 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
106 |
do_action ("ws_plugin__s2member_after_handle_user_deletions", get_defined_vars ());
|
107 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
108 |
/**/
|
includes/functions/user-has-wp-role.inc.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
4 |
-
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
5 |
-
|
6 |
-
Released under the terms of the GNU General Public License.
|
7 |
-
You should have received a copy of the GNU General Public License,
|
8 |
-
along with this software. In the main directory, see: /licensing/
|
9 |
-
If not, see: <http://www.gnu.org/licenses/>.
|
10 |
-
*/
|
11 |
-
/*
|
12 |
-
Direct access denial.
|
13 |
-
*/
|
14 |
-
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit ("Do not access this file directly.");
|
16 |
-
/*
|
17 |
-
Function for determing whether $user has a built-in WP Role.
|
18 |
-
One of: (administrator|editor|author|contributor).
|
19 |
-
By default, this excludes the "subscriber" role.
|
20 |
-
*/
|
21 |
-
if (!function_exists ("ws_plugin__s2member_user_has_wp_role"))
|
22 |
-
{
|
23 |
-
function ws_plugin__s2member_user_has_wp_role ($user = FALSE, $exclude = array ("subscriber"))
|
24 |
-
{
|
25 |
-
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
26 |
-
do_action ("ws_plugin__s2member_before_user_has_wp_role", get_defined_vars ());
|
27 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
28 |
-
/**/
|
29 |
-
if (!is_object ($user) || !is_array ($user->roles) || empty ($user->roles))
|
30 |
-
return apply_filters ("ws_plugin__s2member_user_has_wp_role", false, get_defined_vars ());
|
31 |
-
/**/
|
32 |
-
$exclude = (array)$exclude; /* Force array on the exclusions. */
|
33 |
-
/**/
|
34 |
-
if (in_array ("administrator", $exclude) || !in_array ("administrator", $user->roles))
|
35 |
-
if (in_array ("editor", $exclude) || !in_array ("editor", $user->roles))
|
36 |
-
if (in_array ("author", $exclude) || !in_array ("author", $user->roles))
|
37 |
-
if (in_array ("contributor", $exclude) || !in_array ("contributor", $user->roles))
|
38 |
-
if (in_array ("subscriber", $exclude) || !in_array ("subscriber", $user->roles))
|
39 |
-
return apply_filters ("ws_plugin__s2member_user_has_wp_role", false, get_defined_vars ());
|
40 |
-
/**/
|
41 |
-
return apply_filters ("ws_plugin__s2member_user_has_wp_role", true, get_defined_vars ());
|
42 |
-
}
|
43 |
-
}
|
44 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/functions/user-notes.inc.php
CHANGED
@@ -30,9 +30,9 @@ if (!function_exists ("ws_plugin__s2member_append_user_notes"))
|
|
30 |
do_action ("ws_plugin__s2member_during_append_user_notes", get_defined_vars ());
|
31 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
32 |
/**/
|
33 |
-
$notes = trim (
|
34 |
/**/
|
35 |
-
|
36 |
}
|
37 |
/**/
|
38 |
return apply_filters ("ws_plugin__s2member_append_user_notes", $notes, get_defined_vars ());
|
@@ -52,7 +52,7 @@ if (!function_exists ("ws_plugin__s2member_clear_user_note_lines"))
|
|
52 |
if ($user_id && $regex && is_string ($regex) && ($lines = array ()))
|
53 |
{
|
54 |
/* Careful here to preserve empty lines. */
|
55 |
-
$notes = trim (
|
56 |
foreach (preg_split ("/\n/", $notes) as $line)
|
57 |
if (!preg_match ($regex, $line))
|
58 |
$lines[] = $line;
|
@@ -63,7 +63,7 @@ if (!function_exists ("ws_plugin__s2member_clear_user_note_lines"))
|
|
63 |
do_action ("ws_plugin__s2member_during_clear_user_note_lines", get_defined_vars ());
|
64 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
65 |
/**/
|
66 |
-
|
67 |
}
|
68 |
/**/
|
69 |
return apply_filters ("ws_plugin__s2member_clear_user_note_lines", $notes, get_defined_vars ());
|
30 |
do_action ("ws_plugin__s2member_during_append_user_notes", get_defined_vars ());
|
31 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
32 |
/**/
|
33 |
+
$notes = trim (get_user_option ("s2member_notes", $user_id) . "\n" . $notes);
|
34 |
/**/
|
35 |
+
update_user_option ($user_id, "s2member_notes", $notes);
|
36 |
}
|
37 |
/**/
|
38 |
return apply_filters ("ws_plugin__s2member_append_user_notes", $notes, get_defined_vars ());
|
52 |
if ($user_id && $regex && is_string ($regex) && ($lines = array ()))
|
53 |
{
|
54 |
/* Careful here to preserve empty lines. */
|
55 |
+
$notes = trim (get_user_option ("s2member_notes", $user_id));
|
56 |
foreach (preg_split ("/\n/", $notes) as $line)
|
57 |
if (!preg_match ($regex, $line))
|
58 |
$lines[] = $line;
|
63 |
do_action ("ws_plugin__s2member_during_clear_user_note_lines", get_defined_vars ());
|
64 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
65 |
/**/
|
66 |
+
update_user_option ($user_id, "s2member_notes", $notes);
|
67 |
}
|
68 |
/**/
|
69 |
return apply_filters ("ws_plugin__s2member_clear_user_note_lines", $notes, get_defined_vars ());
|
includes/functions/users-list.inc.php
CHANGED
@@ -26,12 +26,15 @@ if (!function_exists ("ws_plugin__s2member_users_list_cols"))
|
|
26 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
27 |
/**/
|
28 |
$cols["s2member_registration_time"] = "Registered On"; /* Date they signed up. */
|
29 |
-
$cols["s2member_subscr_id"] = "
|
30 |
-
|
|
|
|
|
|
|
31 |
/**/
|
32 |
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
33 |
{
|
34 |
-
if ($field = trim ($field, "
|
35 |
{
|
36 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
37 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
@@ -64,13 +67,13 @@ if (!function_exists ("ws_plugin__s2member_users_list_display_cols"))
|
|
64 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
65 |
/**/
|
66 |
if ((!isset ($fields) || $fields_4_user_id !== $user_id) && ($fields_4_user_id = $user_id))
|
67 |
-
$fields =
|
68 |
/**/
|
69 |
if ($col === "s2member_registration_time")
|
70 |
$val = ($r = $user->user_registered) ? date ("D M j, Y", strtotime ($r)) . '<br />@exactly ' . date ("g:i a", strtotime ($r)) : "—";
|
71 |
/**/
|
72 |
else if ($col === "s2member_subscr_id")
|
73 |
-
$val = ($r =
|
74 |
/**/
|
75 |
else if ($col === "s2member_ccaps") /* Custom Capabilities. */
|
76 |
{
|
@@ -91,148 +94,270 @@ if (!function_exists ("ws_plugin__s2member_users_list_display_cols"))
|
|
91 |
}
|
92 |
}
|
93 |
/*
|
94 |
-
Function
|
95 |
-
|
96 |
-
Attach to: add_action("
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
*/
|
98 |
if (!function_exists ("ws_plugin__s2member_users_list_edit_cols"))
|
99 |
{
|
100 |
function ws_plugin__s2member_users_list_edit_cols ($user = FALSE)
|
101 |
{
|
|
|
|
|
102 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
103 |
do_action ("ws_plugin__s2member_before_users_list_edit_cols", get_defined_vars ());
|
104 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
105 |
/**/
|
106 |
-
|
|
|
|
|
107 |
{
|
108 |
-
|
109 |
-
/**/
|
110 |
-
echo '<h3>s2Member Configuration & Profile Fields</h3>' . "\n";
|
111 |
-
/**/
|
112 |
-
echo '<table class="form-table">' . "\n";
|
113 |
-
/**/
|
114 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
115 |
-
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before", get_defined_vars ());
|
116 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
117 |
-
/**/
|
118 |
-
if (!ws_plugin__s2member_user_has_wp_role ($user)) /* Not for WP Roles. */
|
119 |
{
|
120 |
-
|
121 |
-
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_subscr_id", get_defined_vars ());
|
122 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
123 |
/**/
|
124 |
-
echo '<
|
125 |
-
|
126 |
-
echo '<
|
127 |
-
echo '</tr>' . "\n";
|
128 |
/**/
|
129 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
130 |
-
do_action ("
|
131 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
154 |
-
do_action ("
|
155 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
156 |
/**/
|
157 |
echo '<tr>' . "\n";
|
158 |
-
|
159 |
-
|
160 |
-
echo '<th><label>Automatic EOT Time:</label> <a href="#" onclick="alert(\'EOT = End Of Term. ( i.e. Account Expiration / Termination. ).\\n\\nIf you leave this empty, s2Member will configure an EOT Time automatically, based on the PayPal® Subscription associated with this account. In other words, if a PayPal® Subscription expires, is cancelled, terminated, refunded, reversed, or charged back to you; s2Member will deal with the EOT automatically.\\n\\nThat being said, if you would rather take control over this, you can. If you type in a date manually, s2Member will obey the Auto-EOT Time that you\\\'ve given, no matter what. In other words, you can force certain Members to expire automatically, at a time that you specify. s2Member will obey.\\n\\nValid formats for Automatic EOT Time:\\n\\nmm/dd/yyyy\\nyyyy-mm-dd\\n+1 year\\n+2 weeks\\n+2 months\\n+10 minutes\\nnext thursday\\ntomorrow\\ntoday\\n\\n* anything compatible with PHP\\\'s strtotime() function.\'); return false;">[?]</a>' . (($auto_eot_time) ? '<br /><small>( based on server time )</small>' : '') . '</th>' . "\n";
|
161 |
-
echo '<td><input type="text" name="ws_plugin__s2member_profile_s2member_auto_eot_time" value="' . format_to_edit ($auto_eot_time) . '" class="regular-text" /></td>' . "\n";
|
162 |
echo '</tr>' . "\n";
|
163 |
/**/
|
164 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
165 |
-
do_action ("
|
166 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
167 |
-
}
|
168 |
-
/**/
|
169 |
-
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) /* Only if configured. */
|
170 |
-
{
|
171 |
-
echo '<tr>' . "\n";
|
172 |
-
echo '<td colspan="2">' . "\n";
|
173 |
-
echo '<div style="height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
174 |
-
echo '</td>' . "\n";
|
175 |
-
echo '</tr>' . "\n";
|
176 |
-
/**/
|
177 |
-
$fields = get_usermeta ($user->ID, "s2member_custom_fields"); /* Get existing field values. */
|
178 |
/**/
|
179 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
180 |
-
do_action ("
|
181 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
182 |
/**/
|
183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
{
|
185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
{
|
187 |
-
|
188 |
-
|
189 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
190 |
/**/
|
191 |
-
$
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
}
|
204 |
-
/**/
|
205 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
206 |
-
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_custom_fields", get_defined_vars ());
|
207 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
208 |
-
/**/
|
209 |
-
echo '<tr>' . "\n";
|
210 |
-
echo '<td colspan="2">' . "\n";
|
211 |
-
echo '<div style="height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
212 |
-
echo '</td>' . "\n";
|
213 |
-
echo '</tr>' . "\n";
|
214 |
}
|
215 |
-
/**/
|
216 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
217 |
-
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_notes", get_defined_vars ());
|
218 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
219 |
-
/**/
|
220 |
-
echo '<tr>' . "\n";
|
221 |
-
echo '<th><label>Administrative<br />Notations:</label> <a href="#" onclick="alert(\'This is for Administrative purposes. You can keep a list of Notations about this account. These Notations are private; Users/Members will never see these.\\n\\n*Note* The s2Member software may `append` Notes to this field occassionaly, under special circumstances. For example, when/if s2Member demotes a paid Member to a Free Subscriber, s2Member will leave a Note in this field.\'); return false;">[?]</a></th>' . "\n";
|
222 |
-
echo '<td><textarea name="ws_plugin__s2member_profile_s2member_notes" rows="5" wrap="off" spellcheck="false">' . format_to_edit (get_usermeta ($user->ID, "s2member_notes")) . '</textarea></td>' . "\n";
|
223 |
-
echo '</tr>' . "\n";
|
224 |
-
/**/
|
225 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
226 |
-
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_notes", get_defined_vars ());
|
227 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
228 |
-
/**/
|
229 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
230 |
-
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after", get_defined_vars ());
|
231 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
232 |
-
/**/
|
233 |
-
echo '</table>' . "\n";
|
234 |
-
/**/
|
235 |
-
echo '<div style="margin:25px 0 25px 0; height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
236 |
}
|
237 |
/**/
|
238 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
@@ -244,52 +369,125 @@ if (!function_exists ("ws_plugin__s2member_users_list_edit_cols"))
|
|
244 |
}
|
245 |
/*
|
246 |
Function that saves custom fields after an admin updates profile.
|
247 |
-
|
248 |
-
Attach to: add_action("
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
*/
|
250 |
if (!function_exists ("ws_plugin__s2member_users_list_update_cols"))
|
251 |
{
|
252 |
function ws_plugin__s2member_users_list_update_cols ($user_id = FALSE)
|
253 |
{
|
|
|
|
|
254 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
255 |
do_action ("ws_plugin__s2member_before_users_list_update_cols", get_defined_vars ());
|
256 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
257 |
/**/
|
258 |
-
|
|
|
|
|
|
|
259 |
{
|
260 |
-
if (
|
261 |
{
|
262 |
-
|
263 |
-
/**/
|
264 |
-
foreach ($user->allcaps as $cap => $cap_enabled)
|
265 |
-
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
266 |
-
$user->remove_cap ($ccap = $cap);
|
267 |
-
/**/
|
268 |
-
foreach (preg_split ("/[\r\n\t\s;,]+/", $_POST["ws_plugin__s2member_profile_s2member_ccaps"]) as $ccap)
|
269 |
-
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
270 |
-
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
271 |
-
/**/
|
272 |
-
$auto_eot_time = ($eot = $_POST["ws_plugin__s2member_profile_s2member_auto_eot_time"]) ? strtotime ($eot) : "";
|
273 |
-
update_usermeta ($user_id, "s2member_auto_eot_time", $auto_eot_time);
|
274 |
-
/**/
|
275 |
-
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
276 |
{
|
277 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
{
|
279 |
-
$
|
280 |
-
|
|
|
281 |
/**/
|
282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
}
|
285 |
-
/**/
|
286 |
-
update_usermeta ($user_id, "s2member_custom_fields", $fields);
|
287 |
-
/**/
|
288 |
-
update_usermeta ($user_id, "s2member_notes", $_POST["ws_plugin__s2member_profile_s2member_notes"]);
|
289 |
-
/**/
|
290 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
291 |
-
do_action ("ws_plugin__s2member_during_users_list_update_cols", get_defined_vars ());
|
292 |
-
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
293 |
}
|
294 |
}
|
295 |
/**/
|
26 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
27 |
/**/
|
28 |
$cols["s2member_registration_time"] = "Registered On"; /* Date they signed up. */
|
29 |
+
$cols["s2member_subscr_id"] = "Paid Subscr. ID"; /* Special field that is always applied. */
|
30 |
+
/**/
|
31 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
32 |
+
/* ^ Will change once Custom Capabilities are compatible with a Blog Farm. */
|
33 |
+
$cols["s2member_ccaps"] = "Custom Capabilities"; /* Custom Capabilities. */
|
34 |
/**/
|
35 |
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
36 |
{
|
37 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
38 |
{
|
39 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
40 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
67 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
68 |
/**/
|
69 |
if ((!isset ($fields) || $fields_4_user_id !== $user_id) && ($fields_4_user_id = $user_id))
|
70 |
+
$fields = get_user_option ("s2member_custom_fields", $user_id);
|
71 |
/**/
|
72 |
if ($col === "s2member_registration_time")
|
73 |
$val = ($r = $user->user_registered) ? date ("D M j, Y", strtotime ($r)) . '<br />@exactly ' . date ("g:i a", strtotime ($r)) : "—";
|
74 |
/**/
|
75 |
else if ($col === "s2member_subscr_id")
|
76 |
+
$val = ($r = get_user_option ("s2member_subscr_id", $user_id)) ? esc_html ($r) : "—";
|
77 |
/**/
|
78 |
else if ($col === "s2member_ccaps") /* Custom Capabilities. */
|
79 |
{
|
94 |
}
|
95 |
}
|
96 |
/*
|
97 |
+
Function adds Custom Fields to the admin profile editing page.
|
98 |
+
|
99 |
+
Attach to: add_action("edit_user_profile");
|
100 |
+
Attach to: add_action("show_user_profile");
|
101 |
+
w/ the Contant available:
|
102 |
+
IS_PROFILE_PAGE
|
103 |
+
|
104 |
+
Conditionals here need to match those in the function below:
|
105 |
+
ws_plugin__s2member_users_list_update_cols()
|
106 |
*/
|
107 |
if (!function_exists ("ws_plugin__s2member_users_list_edit_cols"))
|
108 |
{
|
109 |
function ws_plugin__s2member_users_list_edit_cols ($user = FALSE)
|
110 |
{
|
111 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
112 |
+
/**/
|
113 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
114 |
do_action ("ws_plugin__s2member_before_users_list_edit_cols", get_defined_vars ());
|
115 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
116 |
/**/
|
117 |
+
$current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
|
118 |
+
/**/
|
119 |
+
if ($user && $user->ID && $current_user && $current_user->ID) /* Validate both of these User objects beforehand. */
|
120 |
{
|
121 |
+
if (current_user_can ("edit_users") && (is_super_admin () || is_user_member_of_blog ($user->ID))) /* Security! */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
{
|
123 |
+
echo '<div style="margin:25px 0 25px 0; height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
|
|
|
|
124 |
/**/
|
125 |
+
echo '<h3 style="position:relative;"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/large-icon.png" title="s2Member ( a Membership management system for WordPress® )" alt="" style="position:absolute; top:-15px; right:0; border:0;" />s2Member Configuration & Profile Fields' . ((is_multisite ()) ? ' ( for this Blog )' : '') . '</h3>' . "\n";
|
126 |
+
/**/
|
127 |
+
echo '<table class="form-table">' . "\n";
|
|
|
128 |
/**/
|
129 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
130 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before", get_defined_vars ());
|
131 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
132 |
+
/**/
|
133 |
+
if (is_multisite () && is_super_admin ()) /* MUST be a Super Admin. */
|
134 |
+
/* On a Multisite Network, the Super Administrator can ALWAYS edit this. */
|
135 |
+
{
|
136 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
137 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_originating_blog", get_defined_vars ());
|
138 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
139 |
+
/**/
|
140 |
+
echo '<tr>' . "\n";
|
141 |
+
echo '<th><label>Originating Blog ID#:</label> <a href="#" onclick="alert(\'On a Multisite Network, this is how s2Member keeps track of which Blog each User/Member originated from. So this ID#, is automatically associated with a Blog in your Network, matching the User\\\'s point of origin. ~ ONLY a Super Admin can modify this.\\n\\nOn a Multisite Blog Farm, the Originating Blog ID# for your own Customers, will ALWAYS be associated with your ( Main Site ). It is NOT likely that you\\\'ll need to modify this manually, but s2Member makes it available; just in case.\\n\\n*Tip* - If you add Users ( and/or Blogs ) with the `Super Admin` panel inside WordPress® ( via: ms-users.php / ms-sites.php ), then you WILL need to set everything manually. s2Member does NOT tamper with any automation routines whenever YOU ( as a Super Administrator ) are working with that special panel in WordPress®.\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
142 |
+
echo '<td><input type="text" name="ws_plugin__s2member_profile_s2member_originating_blog" value="' . format_to_edit (get_user_meta ($user->ID, "s2member_originating_blog", true)) . '" class="regular-text" /></td>' . "\n";
|
143 |
+
echo '</tr>' . "\n";
|
144 |
+
/**/
|
145 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
146 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_originating_blog", get_defined_vars ());
|
147 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
148 |
+
}
|
149 |
+
/**/
|
150 |
+
if (!$user->has_cap ("administrator")) /* Do NOT present these details for Administrator accounts. */
|
151 |
+
{
|
152 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
153 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_subscr_id", get_defined_vars ());
|
154 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
155 |
+
/**/
|
156 |
+
echo '<tr>' . "\n";
|
157 |
+
echo '<th><label>Paid Subscr. ID:</label> <a href="#" onclick="alert(\'A Paid Subscr. ID is only valid for paid Members. This will be filled automatically by s2Member. This field will be empty for Free Subscribers, and/or anyone who is NOT paying you. This field is ONLY editable for Customer Service purposes; just in case you ever need to update the Paid Subscr. ID manually. You are not likely to need this, but s2Member makes it editable, just in case.\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
158 |
+
echo '<td><input type="text" name="ws_plugin__s2member_profile_s2member_subscr_id" value="' . format_to_edit (get_user_option ("s2member_subscr_id", $user->ID)) . '" class="regular-text" /></td>' . "\n";
|
159 |
+
echo '</tr>' . "\n";
|
160 |
+
/**/
|
161 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
162 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_subscr_id", get_defined_vars ());
|
163 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
164 |
+
/**/
|
165 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
166 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_custom", get_defined_vars ());
|
167 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
168 |
+
/**/
|
169 |
+
echo '<tr>' . "\n";
|
170 |
+
echo '<th><label>Custom Value:</label> <a href="#" onclick="alert(\'A Paid Subscription is always associated with a Custom String that is passed through the custom=\\\'\\\'' . ws_plugin__s2member_esc_sq ($_SERVER["HTTP_HOST"]) . '\\\'\\\' attribute of your Shortcode. This Custom Value, MUST always start with your domain name. However, you can also pipe delimit additional values after your domain, if you need to.\\n\\nFor example:\n' . ws_plugin__s2member_esc_sq ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
171 |
+
echo '<td><input type="text" name="ws_plugin__s2member_profile_s2member_custom" value="' . format_to_edit (get_user_option ("s2member_custom", $user->ID)) . '" class="regular-text" /></td>' . "\n";
|
172 |
+
echo '</tr>' . "\n";
|
173 |
+
/**/
|
174 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
175 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_custom", get_defined_vars ());
|
176 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
177 |
+
}
|
178 |
+
/**/
|
179 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
180 |
+
/* ^ Will change once Custom Capabilities are compatible with a Blog Farm. */
|
181 |
+
{
|
182 |
+
foreach ($user->allcaps as $cap => $cap_enabled)
|
183 |
+
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
184 |
+
$ccaps[] = preg_replace ("/^access_s2member_ccap_/", "", $cap);
|
185 |
+
/**/
|
186 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
187 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_ccaps", get_defined_vars ());
|
188 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
189 |
+
/**/
|
190 |
+
echo '<tr>' . "\n";
|
191 |
+
echo '<th><label>Custom Capabilities:</label> <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.' . ((is_multisite ()) ? '\\n\\nCustom Capabilities are assigned on a per-Blog basis. So having a set of Custom Capabilities for one Blog, and having NO Custom Capabilities on another Blog - is very common. This is how permissions are designed to work.' : '') . '\'); return false;" tabindex="-1">[?]</a>' . ((is_multisite ()) ? '<br /><small>( for this Blog )</small>' : '') . '</th>' . "\n";
|
192 |
+
echo '<td><input type="text" name="ws_plugin__s2member_profile_s2member_ccaps" value="' . format_to_edit (((!empty ($ccaps)) ? implode (",", $ccaps) : "")) . '" class="regular-text" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" /></td>' . "\n";
|
193 |
+
echo '</tr>' . "\n";
|
194 |
+
/**/
|
195 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
196 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_ccaps", get_defined_vars ());
|
197 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
198 |
+
}
|
199 |
+
/**/
|
200 |
+
if (!$user->has_cap ("administrator")) /* Do NOT present these details for Administrator accounts. */
|
201 |
+
{
|
202 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
203 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_auto_eot_time", get_defined_vars ());
|
204 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
205 |
+
/**/
|
206 |
+
echo '<tr>' . "\n";
|
207 |
+
$auto_eot_time = get_user_option ("s2member_auto_eot_time", $user->ID);
|
208 |
+
$auto_eot_time = ($auto_eot_time) ? date ("D M j, Y g:i a T", $auto_eot_time) : "";
|
209 |
+
echo '<th><label>Automatic EOT Time:</label> <a href="#" onclick="alert(\'EOT = End Of Term. ( i.e. Account Expiration / Termination. ).\\n\\nIf you leave this empty, s2Member will configure an EOT Time automatically, based on the paid Subscription associated with this account. In other words, if a paid Subscription expires, is cancelled, terminated, refunded, reversed, or charged back to you; s2Member will deal with the EOT automatically.\\n\\nThat being said, if you would rather take control over this, you can. If you type in a date manually, s2Member will obey the Auto-EOT Time that you\\\'ve given, no matter what. In other words, you can force certain Members to expire automatically, at a time that you specify. s2Member will obey.\\n\\nValid formats for Automatic EOT Time:\\n\\nmm/dd/yyyy\\nyyyy-mm-dd\\n+1 year\\n+2 weeks\\n+2 months\\n+10 minutes\\nnext thursday\\ntomorrow\\ntoday\\n\\n* anything compatible with PHP\\\'s strtotime() function.\'); return false;" tabindex="-1">[?]</a>' . (($auto_eot_time) ? '<br /><small>( based on server time )</small>' : '') . '</th>' . "\n";
|
210 |
+
echo '<td><input type="text" name="ws_plugin__s2member_profile_s2member_auto_eot_time" value="' . format_to_edit ($auto_eot_time) . '" class="regular-text" /></td>' . "\n";
|
211 |
+
echo '</tr>' . "\n";
|
212 |
+
/**/
|
213 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
214 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_auto_eot_time", get_defined_vars ());
|
215 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
216 |
+
}
|
217 |
+
/**/
|
218 |
+
if (ws_plugin__s2member_list_servers_integrated ()) /* Only if integrated with s2Member. */
|
219 |
+
{
|
220 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
221 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_opt_in", get_defined_vars ());
|
222 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
223 |
+
/**/
|
224 |
+
echo '<tr>' . "\n";
|
225 |
+
echo '<th><label>Process List Servers:</label> <a href="#" onclick="alert(\'You have at least one List Server integrated with s2Member. Would you like to process a confirmation request for this User? If not, just leave the box un-checked.\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
226 |
+
echo '<td><label><input type="checkbox" name="ws_plugin__s2member_profile_opt_in" value="1" /> Yes, send a mailing list confirmation email to this User.</label></td>' . "\n";
|
227 |
+
echo '</tr>' . "\n";
|
228 |
+
/**/
|
229 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
230 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_opt_in", get_defined_vars ());
|
231 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
232 |
+
}
|
233 |
+
/**/
|
234 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) /* Only if configured. */
|
235 |
+
{
|
236 |
+
echo '<tr>' . "\n";
|
237 |
+
echo '<td colspan="2">' . "\n";
|
238 |
+
echo '<div style="height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
239 |
+
echo '</td>' . "\n";
|
240 |
+
echo '</tr>' . "\n";
|
241 |
+
/**/
|
242 |
+
$fields = get_user_option ("s2member_custom_fields", $user->ID); /* Get existing field values. */
|
243 |
+
/**/
|
244 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
245 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_custom_fields", get_defined_vars ());
|
246 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
247 |
+
/**/
|
248 |
+
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
249 |
+
{
|
250 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
251 |
+
{
|
252 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
253 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_during_custom_fields_before", get_defined_vars ());
|
254 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
255 |
+
/**/
|
256 |
+
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
257 |
+
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
258 |
+
/**/
|
259 |
+
echo '<tr>' . "\n";
|
260 |
+
echo '<th><label>' . esc_html ($field) . ':</label></th>' . "\n";
|
261 |
+
echo '<td><input type="text" name="ws_plugin__s2member_profile_' . $field_var . '" value="' . format_to_edit ($fields[$field_var]) . '" class="regular-text" /></td>' . "\n";
|
262 |
+
echo '</tr>' . "\n";
|
263 |
+
/**/
|
264 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
265 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_during_custom_fields_after", get_defined_vars ());
|
266 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
267 |
+
}
|
268 |
+
}
|
269 |
+
/**/
|
270 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
271 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_custom_fields", get_defined_vars ());
|
272 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
273 |
+
/**/
|
274 |
+
echo '<tr>' . "\n";
|
275 |
+
echo '<td colspan="2">' . "\n";
|
276 |
+
echo '<div style="height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
277 |
+
echo '</td>' . "\n";
|
278 |
+
echo '</tr>' . "\n";
|
279 |
+
}
|
280 |
+
/**/
|
281 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
282 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_notes", get_defined_vars ());
|
283 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
284 |
/**/
|
285 |
echo '<tr>' . "\n";
|
286 |
+
echo '<th><label>Administrative<br />Notations:</label> <a href="#" onclick="alert(\'This is for Administrative purposes. You can keep a list of Notations about this account. These Notations are private; Users/Members will never see these.\\n\\n*Note* The s2Member software may `append` Notes to this field occassionaly, under special circumstances. For example, when/if s2Member demotes a paid Member to a Free Subscriber, s2Member will leave a Note in this field.\'); return false;" tabindex="-1">[?]</a></th>' . "\n";
|
287 |
+
echo '<td><textarea name="ws_plugin__s2member_profile_s2member_notes" rows="5" wrap="off" spellcheck="false" style="width:99%;">' . format_to_edit (get_user_option ("s2member_notes", $user->ID)) . '</textarea></td>' . "\n";
|
|
|
|
|
288 |
echo '</tr>' . "\n";
|
289 |
/**/
|
290 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
291 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_notes", get_defined_vars ());
|
292 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
/**/
|
294 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
295 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after", get_defined_vars ());
|
296 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
297 |
/**/
|
298 |
+
echo '</table>' . "\n";
|
299 |
+
/**/
|
300 |
+
echo '<div style="margin:25px 0 25px 0; height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
301 |
+
}
|
302 |
+
/**/
|
303 |
+
else if ($current_user->ID === $user->ID) /* Otherwise, a User can always edit their own Profile. */
|
304 |
+
{
|
305 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) /* Only if configured. */
|
306 |
{
|
307 |
+
echo '<div style="margin:25px 0 25px 0; height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
308 |
+
/**/
|
309 |
+
echo '<h3>Additional Profile Fields' . ((is_multisite ()) ? ' ( for this Blog )' : '') . '</h3>' . "\n";
|
310 |
+
/**/
|
311 |
+
echo '<table class="form-table">' . "\n";
|
312 |
+
/**/
|
313 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
314 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before", get_defined_vars ());
|
315 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
316 |
+
/**/
|
317 |
+
$fields = get_user_option ("s2member_custom_fields", $user->ID); /* Get existing field values. */
|
318 |
+
/**/
|
319 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
320 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_before_custom_fields", get_defined_vars ());
|
321 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
322 |
+
/**/
|
323 |
+
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
324 |
{
|
325 |
+
$une = preg_match ("/\^/", $field); /* Preventing this field from being edited? */
|
326 |
+
$une = ($une) ? ' disabled="disabled"' : ''; /* Prevent this field from being edited. */
|
|
|
327 |
/**/
|
328 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
329 |
+
{
|
330 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
331 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_during_custom_fields_before", get_defined_vars ());
|
332 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
333 |
+
/**/
|
334 |
+
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
335 |
+
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
336 |
+
/**/
|
337 |
+
echo '<tr>' . "\n";
|
338 |
+
echo '<th><label>' . esc_html ($field) . ':</label></th>' . "\n";
|
339 |
+
echo '<td><input' . $une . ' type="text" name="ws_plugin__s2member_profile_' . $field_var . '" value="' . format_to_edit ($fields[$field_var]) . '" class="regular-text" /></td>' . "\n";
|
340 |
+
echo '</tr>' . "\n";
|
341 |
+
/**/
|
342 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
343 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_during_custom_fields_after", get_defined_vars ());
|
344 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
345 |
+
}
|
346 |
}
|
347 |
+
/**/
|
348 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
349 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after_custom_fields", get_defined_vars ());
|
350 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
351 |
+
/**/
|
352 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
353 |
+
do_action ("ws_plugin__s2member_during_users_list_edit_cols_after", get_defined_vars ());
|
354 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
355 |
+
/**/
|
356 |
+
echo '</table>' . "\n";
|
357 |
+
/**/
|
358 |
+
echo '<div style="margin:25px 0 25px 0; height:1px; line-height:1px; background:#CCCCCC;"></div>' . "\n";
|
359 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
}
|
362 |
/**/
|
363 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
369 |
}
|
370 |
/*
|
371 |
Function that saves custom fields after an admin updates profile.
|
372 |
+
|
373 |
+
Attach to: add_action("edit_user_profile_update");
|
374 |
+
Attach to: add_action("personal_options_update");
|
375 |
+
w/ the Contant available:
|
376 |
+
IS_PROFILE_PAGE
|
377 |
+
|
378 |
+
Conditionals here need to match those in the function above:
|
379 |
+
ws_plugin__s2member_users_list_edit_cols()
|
380 |
*/
|
381 |
if (!function_exists ("ws_plugin__s2member_users_list_update_cols"))
|
382 |
{
|
383 |
function ws_plugin__s2member_users_list_update_cols ($user_id = FALSE)
|
384 |
{
|
385 |
+
global $current_site, $current_blog; /* Multisite Networking. */
|
386 |
+
/**/
|
387 |
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
388 |
do_action ("ws_plugin__s2member_before_users_list_update_cols", get_defined_vars ());
|
389 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
390 |
/**/
|
391 |
+
$user = new WP_User ($user_id); /* We need both. The $user and $current_user. */
|
392 |
+
$current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Get the current User's object. */
|
393 |
+
/**/
|
394 |
+
if ($user && $user->ID && $current_user && $current_user->ID) /* Validate both of these User objects before we even begin. */
|
395 |
{
|
396 |
+
if (current_user_can ("edit_users") && (is_super_admin () || is_user_member_of_blog ($user->ID))) /* Security! */
|
397 |
{
|
398 |
+
if (is_array ($_POST = ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST))) && !empty ($_POST))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
{
|
400 |
+
if (isset ($_POST["ws_plugin__s2member_profile_s2member_originating_blog"]) && is_multisite () && is_super_admin ())
|
401 |
+
update_user_meta ($user_id, "s2member_originating_blog", $_POST["ws_plugin__s2member_profile_s2member_originating_blog"]);
|
402 |
+
/**/
|
403 |
+
if (isset ($_POST["ws_plugin__s2member_profile_s2member_custom"]))
|
404 |
+
update_user_option ($user_id, "s2member_custom", $_POST["ws_plugin__s2member_profile_s2member_custom"]);
|
405 |
+
/**/
|
406 |
+
if (isset ($_POST["ws_plugin__s2member_profile_s2member_subscr_id"]))
|
407 |
+
update_user_option ($user_id, "s2member_subscr_id", $_POST["ws_plugin__s2member_profile_s2member_subscr_id"]);
|
408 |
+
/**/
|
409 |
+
if (isset ($_POST["ws_plugin__s2member_profile_s2member_notes"]))
|
410 |
+
update_user_option ($user_id, "s2member_notes", $_POST["ws_plugin__s2member_profile_s2member_notes"]);
|
411 |
+
/**/
|
412 |
+
$auto_eot_time = ($eot = $_POST["ws_plugin__s2member_profile_s2member_auto_eot_time"]) ? strtotime ($eot) : "";
|
413 |
+
if (isset ($_POST["ws_plugin__s2member_profile_s2member_auto_eot_time"])) /* Then check if set. */
|
414 |
+
update_user_option ($user_id, "s2member_auto_eot_time", $auto_eot_time);
|
415 |
+
/**/
|
416 |
+
if ($_POST["ws_plugin__s2member_profile_opt_in"]) /* Process list servers for this User? */
|
417 |
+
ws_plugin__s2member_process_list_servers (ws_plugin__s2member_user_access_level ($user), $user->user_email, $user->first_name, $user->last_name, "", true);
|
418 |
+
/**/
|
419 |
+
if (isset ($_POST["ws_plugin__s2member_profile_s2member_ccaps"]))
|
420 |
{
|
421 |
+
foreach ($user->allcaps as $cap => $cap_enabled)
|
422 |
+
if (preg_match ("/^access_s2member_ccap_/", $cap))
|
423 |
+
$user->remove_cap ($ccap = $cap);
|
424 |
/**/
|
425 |
+
foreach (preg_split ("/[\r\n\t\s;,]+/", $_POST["ws_plugin__s2member_profile_s2member_ccaps"]) as $ccap)
|
426 |
+
if (strlen ($ccap)) /* Don't add empty capabilities. */
|
427 |
+
$user->add_cap ("access_s2member_ccap_" . trim (strtolower ($ccap)));
|
428 |
+
}
|
429 |
+
/**/
|
430 |
+
$_existing_fields = (array)get_user_option ("s2member_custom_fields", $user_id);
|
431 |
+
/**/
|
432 |
+
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
433 |
+
{
|
434 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
435 |
+
{
|
436 |
+
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
437 |
+
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
438 |
+
/**/
|
439 |
+
if (!isset ($_POST["ws_plugin__s2member_profile_" . $field_var]))
|
440 |
+
$fields[$field_var] = $_existing_fields[$field_var];
|
441 |
+
/**/
|
442 |
+
else /* Otherwise, we can use the newly updated value. */
|
443 |
+
$fields[$field_var] = $_POST["ws_plugin__s2member_profile_" . $field_var];
|
444 |
+
}
|
445 |
}
|
446 |
+
/**/
|
447 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
448 |
+
do_action ("ws_plugin__s2member_during_users_list_update_cols", get_defined_vars ());
|
449 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
450 |
+
/**/
|
451 |
+
update_user_option ($user_id, "s2member_custom_fields", $fields);
|
452 |
+
}
|
453 |
+
}
|
454 |
+
/**/
|
455 |
+
else if ($current_user->ID === $user->ID) /* Otherwise, a User can always edit their own Profile. */
|
456 |
+
{
|
457 |
+
if (is_array ($_POST = ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST))) && !empty ($_POST))
|
458 |
+
{
|
459 |
+
if (isset ($_POST["ws_plugin__s2member_profile_s2member_originating_blog"]) && is_multisite () && is_super_admin ())
|
460 |
+
update_user_meta ($user_id, "s2member_originating_blog", $_POST["ws_plugin__s2member_profile_s2member_originating_blog"]);
|
461 |
+
/**/
|
462 |
+
$_existing_fields = (array)get_user_option ("s2member_custom_fields", $user_id);
|
463 |
+
/**/
|
464 |
+
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
465 |
+
{
|
466 |
+
$une = preg_match ("/\^/", $field); /* Uneditable fields should be wrapped inside carets. */
|
467 |
+
$req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
|
468 |
+
/**/
|
469 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
470 |
+
{
|
471 |
+
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
|
472 |
+
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
473 |
+
/**/
|
474 |
+
if ($une || !isset ($_POST["ws_plugin__s2member_profile_" . $field_var]))
|
475 |
+
$fields[$field_var] = $_existing_fields[$field_var];
|
476 |
+
/**/
|
477 |
+
else if ($req && !strlen ($_POST["ws_plugin__s2member_profile_" . $field_var]))
|
478 |
+
$fields[$field_var] = $_existing_fields[$field_var];
|
479 |
+
/**/
|
480 |
+
else /* Otherwise, we can use the newly updated value. */
|
481 |
+
$fields[$field_var] = $_POST["ws_plugin__s2member_profile_" . $field_var];
|
482 |
+
}
|
483 |
+
}
|
484 |
+
/**/
|
485 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
486 |
+
do_action ("ws_plugin__s2member_during_users_list_update_cols", get_defined_vars ());
|
487 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
488 |
+
/**/
|
489 |
+
update_user_option ($user_id, "s2member_custom_fields", $fields);
|
490 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
}
|
492 |
}
|
493 |
/**/
|
includes/functions/utilities.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Function that handles a remote request.
|
18 |
This extends wp_remote_request() through the `WP_Http` class.
|
@@ -30,19 +30,40 @@ if (!function_exists ("ws_plugin__s2member_remote"))
|
|
30 |
/**/
|
31 |
if ($url) /* Obviously, we must have a URL to do anything. */
|
32 |
{
|
|
|
|
|
|
|
33 |
if ((is_array ($post_vars) || is_string ($post_vars)) && !empty ($post_vars))
|
34 |
{
|
35 |
$args["method"] = "POST";
|
36 |
$args["body"] = $post_vars;
|
37 |
}
|
38 |
/**/
|
39 |
-
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
/**/
|
42 |
return false;
|
43 |
}
|
44 |
}
|
45 |
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
A sort of callback function that filters the WP_Http response for additional gzinflate variations.
|
47 |
Attach to: add_filter("http_response");
|
48 |
*/
|
@@ -208,12 +229,26 @@ if (!function_exists ("ws_plugin__s2member_trim_quot_deep"))
|
|
208 |
}
|
209 |
/*
|
210 |
Determines whether or not this is a Multisite Farm.
|
|
|
|
|
211 |
*/
|
212 |
if (!function_exists ("ws_plugin__s2member_is_multisite_farm"))
|
213 |
{
|
214 |
function ws_plugin__s2member_is_multisite_farm ()
|
215 |
{
|
216 |
-
return (is_multisite () && defined ("MULTISITE_FARM") && MULTISITE_FARM);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
}
|
218 |
}
|
219 |
/*
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Function that handles a remote request.
|
18 |
This extends wp_remote_request() through the `WP_Http` class.
|
30 |
/**/
|
31 |
if ($url) /* Obviously, we must have a URL to do anything. */
|
32 |
{
|
33 |
+
if (preg_match ("/^https/i", $url) && strtolower (substr (PHP_OS, 0, 3)) === "win")
|
34 |
+
add_filter ("use_curl_transport", "_ws_plugin__s2member_remote_disable_curl");
|
35 |
+
/**/
|
36 |
if ((is_array ($post_vars) || is_string ($post_vars)) && !empty ($post_vars))
|
37 |
{
|
38 |
$args["method"] = "POST";
|
39 |
$args["body"] = $post_vars;
|
40 |
}
|
41 |
/**/
|
42 |
+
$body = wp_remote_retrieve_body (wp_remote_request ($url, $args));
|
43 |
+
/**/
|
44 |
+
remove_filter ("use_curl_transport", "_ws_plugin__s2member_remote_disable_curl");
|
45 |
+
/**/
|
46 |
+
return $body; /* The body content received. */
|
47 |
}
|
48 |
/**/
|
49 |
return false;
|
50 |
}
|
51 |
}
|
52 |
/*
|
53 |
+
A sort of callback function that disables the WP_Http cURL transport option.
|
54 |
+
This is ONLY necessary on a Windows OS; and ONLY when processing https requests.
|
55 |
+
Attach to: add_filter("use_curl_transport");
|
56 |
+
|
57 |
+
If you're going to process SSL requests over https, Windows servers should set `allow_url_fopen = on` inside their php.ini file.
|
58 |
+
*/
|
59 |
+
if (!function_exists ("_ws_plugin__s2member_remote_disable_curl"))
|
60 |
+
{
|
61 |
+
function _ws_plugin__s2member_remote_disable_curl ($use_curl_transport = TRUE)
|
62 |
+
{
|
63 |
+
return ($use_curl_transport = FALSE);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
/*
|
67 |
A sort of callback function that filters the WP_Http response for additional gzinflate variations.
|
68 |
Attach to: add_filter("http_response");
|
69 |
*/
|
229 |
}
|
230 |
/*
|
231 |
Determines whether or not this is a Multisite Farm.
|
232 |
+
With s2Member, this option may also indicate a Multisite Blog Farm.
|
233 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_file"] === "wp-signup"
|
234 |
*/
|
235 |
if (!function_exists ("ws_plugin__s2member_is_multisite_farm"))
|
236 |
{
|
237 |
function ws_plugin__s2member_is_multisite_farm ()
|
238 |
{
|
239 |
+
return (is_multisite () && ((is_main_site () && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_file"] === "wp-signup") || (defined ("MULTISITE_FARM") && MULTISITE_FARM)));
|
240 |
+
}
|
241 |
+
}
|
242 |
+
/*
|
243 |
+
Determines whether or not this is a Multisite Dashboard blog.
|
244 |
+
*/
|
245 |
+
if (!function_exists ("ws_plugin__s2member_is_main_dashboard"))
|
246 |
+
{
|
247 |
+
function ws_plugin__s2member_is_main_dashboard ()
|
248 |
+
{
|
249 |
+
global $current_blog; /* Needed for comparison to the Dashboard Blog. */
|
250 |
+
/**/
|
251 |
+
return (is_multisite () && $current_blog->blog_id == get_site_option ("dashboard_blog"));
|
252 |
}
|
253 |
}
|
254 |
/*
|
includes/hooks.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
Add the plugin actions/filters here.
|
18 |
*/
|
@@ -47,12 +47,28 @@ add_filter ("gettext", "ws_plugin__s2member_translation_mangler", 10, 3);
|
|
47 |
add_filter ("posts_where", "ws_plugin__s2member_hide_some_systematics");
|
48 |
/**/
|
49 |
add_action ("delete_user", "ws_plugin__s2member_handle_user_deletions");
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
add_filter ("pre_option_default_role", "ws_plugin__s2member_force_default_role");
|
|
|
|
|
|
|
51 |
add_filter ("pre_option_users_can_register", "ws_plugin__s2member_check_register_access");
|
|
|
|
|
52 |
add_action ("user_register", "ws_plugin__s2member_configure_user_registration");
|
53 |
add_action ("register_form", "ws_plugin__s2member_custom_registration_fields");
|
54 |
add_action ("bp_before_registration_submit_buttons", "ws_plugin__s2member_opt_in_4bp");
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
56 |
/**/
|
57 |
add_action ("wp_login", "ws_plugin__s2member_login_redirect");
|
58 |
add_action ("login_head", "ws_plugin__s2member_login_header_styles");
|
@@ -66,7 +82,11 @@ add_action ("wp_footer", "ws_plugin__s2member_display_sp_tracking_codes");
|
|
66 |
add_action ("admin_init", "ws_plugin__s2member_admin_lockout");
|
67 |
add_action ("admin_init", "ws_plugin__s2member_check_activation");
|
68 |
add_action ("admin_init", "ws_plugin__s2member_general_ops_notice");
|
|
|
|
|
69 |
add_action ("admin_notices", "ws_plugin__s2member_admin_notices");
|
|
|
|
|
70 |
add_action ("admin_menu", "ws_plugin__s2member_add_admin_options");
|
71 |
add_action ("admin_print_scripts", "ws_plugin__s2member_add_admin_scripts");
|
72 |
add_action ("admin_print_styles", "ws_plugin__s2member_add_admin_styles");
|
@@ -78,6 +98,7 @@ add_action ("edit_user_profile", "ws_plugin__s2member_users_list_edit_cols");
|
|
78 |
add_action ("show_user_profile", "ws_plugin__s2member_users_list_edit_cols");
|
79 |
add_action ("edit_user_profile_update", "ws_plugin__s2member_users_list_update_cols");
|
80 |
add_action ("personal_options_update", "ws_plugin__s2member_users_list_update_cols");
|
|
|
81 |
/**/
|
82 |
add_filter ("cron_schedules", "ws_plugin__s2member_extend_cron_schedules");
|
83 |
/**/
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
Add the plugin actions/filters here.
|
18 |
*/
|
47 |
add_filter ("posts_where", "ws_plugin__s2member_hide_some_systematics");
|
48 |
/**/
|
49 |
add_action ("delete_user", "ws_plugin__s2member_handle_user_deletions");
|
50 |
+
add_action ("wpmu_delete_user", "ws_plugin__s2member_handle_ms_user_deletions");
|
51 |
+
add_action ("remove_user_from_blog", "ws_plugin__s2member_handle_ms_user_deletions", 10, 2);
|
52 |
+
/**/
|
53 |
+
add_filter ("enable_edit_any_user_configuration", "ws_plugin__s2member_ms_allow_edits");
|
54 |
+
add_filter ("map_meta_cap", "ws_plugin__s2member_ms_map_meta_cap", 10, 3);
|
55 |
+
/**/
|
56 |
add_filter ("pre_option_default_role", "ws_plugin__s2member_force_default_role");
|
57 |
+
add_filter ("pre_site_option_default_user_role", "ws_plugin__s2member_force_mms_default_role");
|
58 |
+
add_filter ("pre_site_option_add_new_users", "ws_plugin__s2member_mms_allow_new_users");
|
59 |
+
add_filter ("pre_site_option_dashboard_blog", "ws_plugin__s2member_mms_dashboard_blog");
|
60 |
add_filter ("pre_option_users_can_register", "ws_plugin__s2member_check_register_access");
|
61 |
+
add_filter ("pre_site_option_registration", "ws_plugin__s2member_check_mms_register_access");
|
62 |
+
/**/
|
63 |
add_action ("user_register", "ws_plugin__s2member_configure_user_registration");
|
64 |
add_action ("register_form", "ws_plugin__s2member_custom_registration_fields");
|
65 |
add_action ("bp_before_registration_submit_buttons", "ws_plugin__s2member_opt_in_4bp");
|
66 |
+
/**/
|
67 |
+
add_filter ("add_signup_meta", "ws_plugin__s2member_ms_process_signup_meta");
|
68 |
+
add_filter ("wpmu_signup_user_notification_email", "ws_plugin__s2member_ms_nice_email_roles", 11);
|
69 |
+
add_action ("wpmu_activate_user", "ws_plugin__s2member_configure_user_on_ms_user_activation", 10, 3);
|
70 |
+
add_action ("wpmu_activate_blog", "ws_plugin__s2member_configure_user_on_ms_blog_activation", 10, 5);
|
71 |
+
add_action ("signup_extra_fields", "ws_plugin__s2member_ms_custom_registration_fields");
|
72 |
/**/
|
73 |
add_action ("wp_login", "ws_plugin__s2member_login_redirect");
|
74 |
add_action ("login_head", "ws_plugin__s2member_login_header_styles");
|
82 |
add_action ("admin_init", "ws_plugin__s2member_admin_lockout");
|
83 |
add_action ("admin_init", "ws_plugin__s2member_check_activation");
|
84 |
add_action ("admin_init", "ws_plugin__s2member_general_ops_notice");
|
85 |
+
add_action ("admin_init", "ws_plugin__s2member_multisite_ops_notice");
|
86 |
+
add_action ("admin_init", "ws_plugin__s2member_admin_user_new_fields");
|
87 |
add_action ("admin_notices", "ws_plugin__s2member_admin_notices");
|
88 |
+
add_action ("admin_menu", "ws_plugin__s2member_add_meta_boxes");
|
89 |
+
add_action ("save_post", "ws_plugin__s2member_save_meta_boxes");
|
90 |
add_action ("admin_menu", "ws_plugin__s2member_add_admin_options");
|
91 |
add_action ("admin_print_scripts", "ws_plugin__s2member_add_admin_scripts");
|
92 |
add_action ("admin_print_styles", "ws_plugin__s2member_add_admin_styles");
|
98 |
add_action ("show_user_profile", "ws_plugin__s2member_users_list_edit_cols");
|
99 |
add_action ("edit_user_profile_update", "ws_plugin__s2member_users_list_update_cols");
|
100 |
add_action ("personal_options_update", "ws_plugin__s2member_users_list_update_cols");
|
101 |
+
add_filter ("show_password_fields", "ws_plugin__s2member_demo_hide_password_fields", 10, 2);
|
102 |
/**/
|
103 |
add_filter ("cron_schedules", "ws_plugin__s2member_extend_cron_schedules");
|
104 |
/**/
|
includes/menu-pages/api-ops.inc.php
CHANGED
@@ -42,7 +42,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
42 |
/**/
|
43 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-notifications-section">' . "\n";
|
44 |
echo '<h3>Signup Notification URLs ( optional )</h3>' . "\n";
|
45 |
-
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a new Subscription is created, you\'ll want to read this section. This is marked `Signup`, because the URLs that you list below, will be notified each time a Member signs up. Depending on your fee structure, this may include a first initial payment that establishes their Subscription. This Notification will only be triggered once for each Member. Signup Notifications are sent right after a Member signs up successfully through PayPal®, regardless of whether any money has actually been received. In other words, this Notification is triggered anytime a Member signs up, even if you provided them with a free trial. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Signup Notifications are an added layer of functionality, and they are completely optional
|
46 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_signup_notifications", get_defined_vars ());
|
47 |
/**/
|
48 |
echo '<table class="form-table">' . "\n";
|
@@ -77,14 +77,19 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
77 |
echo '<li><code>%%initial_term%%</code> = This is the term length of the initial period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D ( this means 1 Day )\\n%%initial_term%% = 1 W ( this means 1 Week )\\n%%initial_term%% = 1 M ( this means 1 Month )\\n%%initial_term%% = 1 Y ( this means 1 Year )\\n\\nThe initial period never recurs, so this only lasts for the term length specified, then it is over. If no initial period was even offered, the value of %%initial_term%% will just be: 0 D, meaning zero days.\'); return false;">?</a> ]</li>' . "\n";
|
78 |
echo '<li><code>%%regular_term%%</code> = This is the term length of the regular period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D ( this means 1 Day )\\n%%regular_term%% = 1 W ( this means 1 Week )\\n%%regular_term%% = 1 M ( this means 1 Month )\\n%%regular_term%% = 1 Y ( this means 1 Year )\\n%%regular_term%% = 1 L ( this means 1 Lifetime )\\n\\nThe regular term is usually recurring. So the regular term value represents the period ( or duration ) of each recurring period. If %%recurring%% = 0, then the regular term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their membership privileges are going to last after the %%initial_term%% has expired, if there was an initial term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
|
79 |
echo '</ul>' . "\n";
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
88 |
echo '</td>' . "\n";
|
89 |
/**/
|
90 |
echo '</tr>' . "\n";
|
@@ -103,7 +108,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
103 |
/**/
|
104 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-notifications-section">' . "\n";
|
105 |
echo '<h3>Registration Notification URLs ( optional )</h3>' . "\n";
|
106 |
-
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a new Member is created, you\'ll want to read this section. This is marked `Registration`, because the URLs that you list below, will be notified each time a Member registers a Username. This is usually triggered right after a `Signup` Notification; at the point in which a new Member successfully completes the Registration form, and they are assigned a Username. However, this is ALSO triggered whenever you create a new User inside your WordPress® Dashboard
|
107 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_registration_notifications", get_defined_vars ());
|
108 |
/**/
|
109 |
echo '<table class="form-table">' . "\n";
|
@@ -125,7 +130,8 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
125 |
echo 'Registration Notifications take place silently behind-the-scene, using an HTTP connection. Each URL will be notified every time a new user registers a Username.<br /><br />' . "\n";
|
126 |
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
|
127 |
echo '<ul>' . "\n";
|
128 |
-
echo '<li><code>%%
|
|
|
129 |
echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n";
|
130 |
echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n";
|
131 |
echo '<li><code>%%user_full_name%%</code> = The Full Name ( First & Last ) of the Member who registered their Username.</li>' . "\n";
|
@@ -134,14 +140,19 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
134 |
echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n";
|
135 |
echo '<li><code>%%user_id%%</code> = A unique WordPress® User ID generated during registration.</li>' . "\n";
|
136 |
echo '</ul>' . "\n";
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
145 |
echo '</td>' . "\n";
|
146 |
/**/
|
147 |
echo '</tr>' . "\n";
|
@@ -162,7 +173,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
162 |
/**/
|
163 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-payment-notifications-section">' . "\n";
|
164 |
echo '<h3>Payment Notification URLs ( optional )</h3>' . "\n";
|
165 |
-
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever payment transactions take place, and/or for recurring payments, you\'ll want to read this section. This is marked `Payment`, because the URLs that you list below, will be notified each time an actual payment occurs. Depending on your fee structure, this may include a first initial payment that establishes a Subscription. But more importantly, this will be triggered on all future payments that are received for the lifetime of the Subscription. So unlike the `Signup` Notification, `Payment` Notifications take place whenever actual payments are received, instead of just once after signup is completed. If a payment is required during signup ( e.g. no free trial is being offered ), a Signup Notification will be triggered, and a Payment Notification will ALSO be triggered. In other words, a Payment Notification occurs anytime funds are received, no matter what. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Payment Notifications are an added layer of functionality, and they are completely optional
|
166 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_payment_notifications", get_defined_vars ());
|
167 |
/**/
|
168 |
echo '<table class="form-table">' . "\n";
|
@@ -193,15 +204,22 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
193 |
echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
194 |
echo '<li><code>%%item_number%%</code> = The Item Number ( colon separated <code><em>level:custom_capabilities:fixed term</em></code> ) that the payment is for.</li>' . "\n";
|
195 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
|
|
|
|
196 |
echo '</ul>' . "\n";
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
|
|
|
|
|
|
|
|
|
|
205 |
echo '</td>' . "\n";
|
206 |
/**/
|
207 |
echo '</tr>' . "\n";
|
@@ -223,7 +241,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
223 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-eot-deletion-notifications-section">' . "\n";
|
224 |
echo '<h3>EOT/Deletion Notification URLs ( optional )</h3>' . "\n";
|
225 |
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have ended ( and a Member is demoted to a Free Subscriber ), or when an account is deleted from the system, you\'ll want to read this section. This is marked `EOT/Deletion`, because the URLs that you list below, will be notified in both cases. EOT = End Of Term. An EOT is triggered <em>immediately</em> when you refund a Customer, when a Customer forces a chargeback to occur, or when a PayPal® Subscription ends naturally ( i.e. expires ), and the PayPal® IPN service sends s2Member a <code>subscr_eot</code> response. Delayed EOTs occur after a cancellation, either as a result of you cancelling a Customer\'s Subscription, or a Customer cancelling their own Subscription through PayPal®. A cancellation usually results in a delayed EOT, because a cancellation does not always warrant an immediate EOT; there could still be time left on their Subscription.</p>' . "\n";
|
226 |
-
echo '<p>Manual Deletions will trigger an immediate Notification. If you delete an account manually from within your WordPress® Dashboard, your URLs can be notified automatically through this system. So the two events are an EOT and/or a Manual Deletion. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These EOT/Deletion Notifications are an added layer of functionality, and they are completely optional
|
227 |
echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s membership privileges when PayPal® sends a <code>subscr_eot</code> notification via the IPN service, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
|
228 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_eot_deletion_notifications", get_defined_vars ());
|
229 |
/**/
|
@@ -251,15 +269,21 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
251 |
echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
|
252 |
echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
|
253 |
echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
|
|
|
254 |
echo '</ul>' . "\n";
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
|
|
|
|
|
|
|
|
|
|
263 |
echo '</td>' . "\n";
|
264 |
/**/
|
265 |
echo '</tr>' . "\n";
|
@@ -281,7 +305,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
281 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-refund-reversal-notifications-section">' . "\n";
|
282 |
echo '<h3>Refund/Reversal Notification URLs ( optional )</h3>' . "\n";
|
283 |
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have been refunded or reversed ( i.e. charged back to you ), you\'ll want to read this section. This is marked `Refund/Reversal`, because the URLs that you list below, will ONLY be notified in those specific cases, as opposed to the EOT Notifications, which are all-inclusive. This is very similar to the EOT/Deletion described above. But, there is an important distinction. EOT includes cancellations, expirations, failed payments, refunds, chargebacks, etc, etc. In other words, ANY time a deletion or End Of Term action takes place.</p>' . "\n";
|
284 |
-
echo '<p>So the distinction is that Refund/Reversal Notifications are ONLY sent under these specific circumstances: 1. You log into your PayPal® account and refund a payment that is associated with a Subscription. 2. The Customer complains to PayPal® and a chargeback occurs, forcing a Reversal. In both of these cases, an EOT/Deletion Notification will be sent ( as described above ), but since EOT is a more broad Notification, the Refund/Reversal Notification is here so you can nail down specific back-office operations in these two specific scenarios. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Refund/Reversal Notifications are an added layer of functionality, and they are completely optional
|
285 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_refund_reversal_notifications", get_defined_vars ());
|
286 |
/**/
|
287 |
echo '<table class="form-table">' . "\n";
|
@@ -306,21 +330,28 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
306 |
echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remained constant throughout the lifetime of the membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase.\\n\\nPayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime & Fixed-Term Subscriptions are NOT recurring ( i.e. there was only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
|
307 |
echo '<li><code>%%parent_txn_id%%</code> = The PayPal® Transaction ID, associated with the original payment that is being refunded/reversed.</li>' . "\n";
|
308 |
echo '<li><code>%%-amount%%</code> = The Negative Amount of the payment, that was refunded or reversed back to the Customer.</li>' . "\n";
|
|
|
309 |
echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
310 |
echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
311 |
echo '<li><code>%%full_name%%</code> = The Full Name ( First & Last ) of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
312 |
echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
313 |
echo '<li><code>%%item_number%%</code> = The Item Number ( colon separated <em>level:custom_capabilities:fixed term</em> ) that the payment was for.</li>' . "\n";
|
314 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
|
|
315 |
echo '</ul>' . "\n";
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
324 |
echo '</td>' . "\n";
|
325 |
/**/
|
326 |
echo '</tr>' . "\n";
|
@@ -341,7 +372,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
341 |
/**/
|
342 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-notifications-section">' . "\n";
|
343 |
echo '<h3>Specific Post/Page Access Notification URLs ( optional )</h3>' . "\n";
|
344 |
-
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Specific Post/Page transactions take place, you\'ll want to read this section. This is marked `Specific Post/Page`, because the URLs that you list below, will be notified each time a payment occurs, for access to a Specific Post/Page sale. This is the only Notification that is sent for Specific Post/Page Access. All of the other API Notifications are designed for Membership Level Access. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Payment Notifications are an added layer of functionality, and they are completely optional
|
345 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_sp_notifications", get_defined_vars ());
|
346 |
/**/
|
347 |
echo '<table class="form-table">' . "\n";
|
@@ -374,14 +405,19 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
|
|
374 |
echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> ( translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code> ).</li>' . "\n";
|
375 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
376 |
echo '</ul>' . "\n";
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
|
|
|
|
|
|
|
|
|
|
385 |
echo '</td>' . "\n";
|
386 |
/**/
|
387 |
echo '</tr>' . "\n";
|
@@ -409,7 +445,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
409 |
do_action ("ws_plugin__s2member_during_api_ops_page_before_right_sections", get_defined_vars ());
|
410 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
411 |
/**/
|
412 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
413 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
414 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
415 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
42 |
/**/
|
43 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-notifications-section">' . "\n";
|
44 |
echo '<h3>Signup Notification URLs ( optional )</h3>' . "\n";
|
45 |
+
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a new Subscription is created, you\'ll want to read this section. This is marked `Signup`, because the URLs that you list below, will be notified each time a Member signs up. Depending on your fee structure, this may include a first initial payment that establishes their Subscription. This Notification will only be triggered once for each Member. Signup Notifications are sent right after a Member signs up successfully through PayPal®, regardless of whether any money has actually been received. In other words, this Notification is triggered anytime a Member signs up, even if you provided them with a free trial. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Signup Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
|
46 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_signup_notifications", get_defined_vars ());
|
47 |
/**/
|
48 |
echo '<table class="form-table">' . "\n";
|
77 |
echo '<li><code>%%initial_term%%</code> = This is the term length of the initial period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D ( this means 1 Day )\\n%%initial_term%% = 1 W ( this means 1 Week )\\n%%initial_term%% = 1 M ( this means 1 Month )\\n%%initial_term%% = 1 Y ( this means 1 Year )\\n\\nThe initial period never recurs, so this only lasts for the term length specified, then it is over. If no initial period was even offered, the value of %%initial_term%% will just be: 0 D, meaning zero days.\'); return false;">?</a> ]</li>' . "\n";
|
78 |
echo '<li><code>%%regular_term%%</code> = This is the term length of the regular period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D ( this means 1 Day )\\n%%regular_term%% = 1 W ( this means 1 Week )\\n%%regular_term%% = 1 M ( this means 1 Month )\\n%%regular_term%% = 1 Y ( this means 1 Year )\\n%%regular_term%% = 1 L ( this means 1 Lifetime )\\n\\nThe regular term is usually recurring. So the regular term value represents the period ( or duration ) of each recurring period. If %%recurring%% = 0, then the regular term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their membership privileges are going to last after the %%initial_term%% has expired, if there was an initial term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
|
79 |
echo '</ul>' . "\n";
|
80 |
+
/**/
|
81 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
82 |
+
{
|
83 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
84 |
+
echo '<ul>' . "\n";
|
85 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
86 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
87 |
+
echo '</ul>' . "\n";
|
88 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
89 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
90 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
91 |
+
}
|
92 |
+
/**/
|
93 |
echo '</td>' . "\n";
|
94 |
/**/
|
95 |
echo '</tr>' . "\n";
|
108 |
/**/
|
109 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-notifications-section">' . "\n";
|
110 |
echo '<h3>Registration Notification URLs ( optional )</h3>' . "\n";
|
111 |
+
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a new Member is created, you\'ll want to read this section. This is marked `Registration`, because the URLs that you list below, will be notified each time a Member registers a Username. This is usually triggered right after a `Signup` Notification; at the point in which a new Member successfully completes the Registration form, and they are assigned a Username. However, this is ALSO triggered whenever you create a new User inside your WordPress® Dashboard. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Registration Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
|
112 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_registration_notifications", get_defined_vars ());
|
113 |
/**/
|
114 |
echo '<table class="form-table">' . "\n";
|
130 |
echo 'Registration Notifications take place silently behind-the-scene, using an HTTP connection. Each URL will be notified every time a new user registers a Username.<br /><br />' . "\n";
|
131 |
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
|
132 |
echo '<ul>' . "\n";
|
133 |
+
echo '<li><code>%%role%%</code> = The Role ID <code>( subscriber, s2member_level[1-4], administrator, editor, author, contributor )</code>.</li>' . "\n";
|
134 |
+
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";
|
135 |
echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n";
|
136 |
echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n";
|
137 |
echo '<li><code>%%user_full_name%%</code> = The Full Name ( First & Last ) of the Member who registered their Username.</li>' . "\n";
|
140 |
echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n";
|
141 |
echo '<li><code>%%user_id%%</code> = A unique WordPress® User ID generated during registration.</li>' . "\n";
|
142 |
echo '</ul>' . "\n";
|
143 |
+
/**/
|
144 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
145 |
+
{
|
146 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
147 |
+
echo '<ul>' . "\n";
|
148 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
149 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
150 |
+
echo '</ul>' . "\n";
|
151 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
152 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
153 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
154 |
+
}
|
155 |
+
/**/
|
156 |
echo '</td>' . "\n";
|
157 |
/**/
|
158 |
echo '</tr>' . "\n";
|
173 |
/**/
|
174 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-payment-notifications-section">' . "\n";
|
175 |
echo '<h3>Payment Notification URLs ( optional )</h3>' . "\n";
|
176 |
+
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever payment transactions take place, and/or for recurring payments, you\'ll want to read this section. This is marked `Payment`, because the URLs that you list below, will be notified each time an actual payment occurs. Depending on your fee structure, this may include a first initial payment that establishes a Subscription. But more importantly, this will be triggered on all future payments that are received for the lifetime of the Subscription. So unlike the `Signup` Notification, `Payment` Notifications take place whenever actual payments are received, instead of just once after signup is completed. If a payment is required during signup ( e.g. no free trial is being offered ), a Signup Notification will be triggered, and a Payment Notification will ALSO be triggered. In other words, a Payment Notification occurs anytime funds are received, no matter what. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Payment Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
|
177 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_payment_notifications", get_defined_vars ());
|
178 |
/**/
|
179 |
echo '<table class="form-table">' . "\n";
|
204 |
echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
205 |
echo '<li><code>%%item_number%%</code> = The Item Number ( colon separated <code><em>level:custom_capabilities:fixed term</em></code> ) that the payment is for.</li>' . "\n";
|
206 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
207 |
+
echo '<li><code>%%subscr_payment%%</code> = This will be ( <code>1</code> or <code>0</code> ). The value <code>1</code> = payment IS associated with a "Subscription", <code>0</code> = Buy Now.</li>' . "\n";
|
208 |
+
echo '<li><code>%%subscr_payment_user_id%%</code> = A unique ID that references this account in the WordPress® database. This is ONLY available if <code>%%subscr_payment%%</code> = 1.</li>' . "\n";
|
209 |
echo '</ul>' . "\n";
|
210 |
+
/**/
|
211 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
212 |
+
{
|
213 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
214 |
+
echo '<ul>' . "\n";
|
215 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
216 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
217 |
+
echo '</ul>' . "\n";
|
218 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
219 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
220 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
221 |
+
}
|
222 |
+
/**/
|
223 |
echo '</td>' . "\n";
|
224 |
/**/
|
225 |
echo '</tr>' . "\n";
|
241 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-eot-deletion-notifications-section">' . "\n";
|
242 |
echo '<h3>EOT/Deletion Notification URLs ( optional )</h3>' . "\n";
|
243 |
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have ended ( and a Member is demoted to a Free Subscriber ), or when an account is deleted from the system, you\'ll want to read this section. This is marked `EOT/Deletion`, because the URLs that you list below, will be notified in both cases. EOT = End Of Term. An EOT is triggered <em>immediately</em> when you refund a Customer, when a Customer forces a chargeback to occur, or when a PayPal® Subscription ends naturally ( i.e. expires ), and the PayPal® IPN service sends s2Member a <code>subscr_eot</code> response. Delayed EOTs occur after a cancellation, either as a result of you cancelling a Customer\'s Subscription, or a Customer cancelling their own Subscription through PayPal®. A cancellation usually results in a delayed EOT, because a cancellation does not always warrant an immediate EOT; there could still be time left on their Subscription.</p>' . "\n";
|
244 |
+
echo '<p>Manual Deletions will trigger an immediate Notification. If you delete an account manually from within your WordPress® Dashboard, your URLs can be notified automatically through this system. So the two events are an EOT and/or a Manual Deletion. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These EOT/Deletion Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
|
245 |
echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s membership privileges when PayPal® sends a <code>subscr_eot</code> notification via the IPN service, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
|
246 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_eot_deletion_notifications", get_defined_vars ());
|
247 |
/**/
|
269 |
echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
|
270 |
echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
|
271 |
echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
|
272 |
+
echo '<li><code>%%user_id%%</code> = A unique WordPress® User ID that references this account in the WordPress® database.</li>' . "\n";
|
273 |
echo '</ul>' . "\n";
|
274 |
+
/**/
|
275 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
276 |
+
{
|
277 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
278 |
+
echo '<ul>' . "\n";
|
279 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
280 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode. like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
281 |
+
echo '</ul>' . "\n";
|
282 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
283 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
284 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
285 |
+
}
|
286 |
+
/**/
|
287 |
echo '</td>' . "\n";
|
288 |
/**/
|
289 |
echo '</tr>' . "\n";
|
305 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-refund-reversal-notifications-section">' . "\n";
|
306 |
echo '<h3>Refund/Reversal Notification URLs ( optional )</h3>' . "\n";
|
307 |
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have been refunded or reversed ( i.e. charged back to you ), you\'ll want to read this section. This is marked `Refund/Reversal`, because the URLs that you list below, will ONLY be notified in those specific cases, as opposed to the EOT Notifications, which are all-inclusive. This is very similar to the EOT/Deletion described above. But, there is an important distinction. EOT includes cancellations, expirations, failed payments, refunds, chargebacks, etc, etc. In other words, ANY time a deletion or End Of Term action takes place.</p>' . "\n";
|
308 |
+
echo '<p>So the distinction is that Refund/Reversal Notifications are ONLY sent under these specific circumstances: 1. You log into your PayPal® account and refund a payment that is associated with a Subscription. 2. The Customer complains to PayPal® and a chargeback occurs, forcing a Reversal. In both of these cases, an EOT/Deletion Notification will be sent ( as described above ), but since EOT is a more broad Notification, the Refund/Reversal Notification is here so you can nail down specific back-office operations in these two specific scenarios. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Refund/Reversal Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
|
309 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_refund_reversal_notifications", get_defined_vars ());
|
310 |
/**/
|
311 |
echo '<table class="form-table">' . "\n";
|
330 |
echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remained constant throughout the lifetime of the membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase.\\n\\nPayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime & Fixed-Term Subscriptions are NOT recurring ( i.e. there was only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
|
331 |
echo '<li><code>%%parent_txn_id%%</code> = The PayPal® Transaction ID, associated with the original payment that is being refunded/reversed.</li>' . "\n";
|
332 |
echo '<li><code>%%-amount%%</code> = The Negative Amount of the payment, that was refunded or reversed back to the Customer.</li>' . "\n";
|
333 |
+
echo '<li><code>%%-fee%%</code> = The Negative PayPal® fee, that was refunded back to you as the Merchant/Seller.</li>' . "\n";
|
334 |
echo '<li><code>%%first_name%%</code> = The First Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
335 |
echo '<li><code>%%last_name%%</code> = The Last Name of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
336 |
echo '<li><code>%%full_name%%</code> = The Full Name ( First & Last ) of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
337 |
echo '<li><code>%%payer_email%%</code> = The Email Address of the Customer who purchased the Membership Subscription.</li>' . "\n";
|
338 |
echo '<li><code>%%item_number%%</code> = The Item Number ( colon separated <em>level:custom_capabilities:fixed term</em> ) that the payment was for.</li>' . "\n";
|
339 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
340 |
+
echo '<li><code>%%user_id%%</code> = A unique WordPress® User ID that references this account in the WordPress® database.</li>' . "\n";
|
341 |
echo '</ul>' . "\n";
|
342 |
+
/**/
|
343 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
344 |
+
{
|
345 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
346 |
+
echo '<ul>' . "\n";
|
347 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
348 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
349 |
+
echo '</ul>' . "\n";
|
350 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
351 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
352 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
353 |
+
}
|
354 |
+
/**/
|
355 |
echo '</td>' . "\n";
|
356 |
/**/
|
357 |
echo '</tr>' . "\n";
|
372 |
/**/
|
373 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-notifications-section">' . "\n";
|
374 |
echo '<h3>Specific Post/Page Access Notification URLs ( optional )</h3>' . "\n";
|
375 |
+
echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Specific Post/Page transactions take place, you\'ll want to read this section. This is marked `Specific Post/Page`, because the URLs that you list below, will be notified each time a payment occurs, for access to a Specific Post/Page sale. This is the only Notification that is sent for Specific Post/Page Access. All of the other API Notifications are designed for Membership Level Access. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Payment Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
|
376 |
do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_sp_notifications", get_defined_vars ());
|
377 |
/**/
|
378 |
echo '<table class="form-table">' . "\n";
|
405 |
echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> ( translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code> ).</li>' . "\n";
|
406 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
407 |
echo '</ul>' . "\n";
|
408 |
+
/**/
|
409 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
410 |
+
{
|
411 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
412 |
+
echo '<ul>' . "\n";
|
413 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
414 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
415 |
+
echo '</ul>' . "\n";
|
416 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
417 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
418 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
419 |
+
}
|
420 |
+
/**/
|
421 |
echo '</td>' . "\n";
|
422 |
/**/
|
423 |
echo '</tr>' . "\n";
|
445 |
do_action ("ws_plugin__s2member_during_api_ops_page_before_right_sections", get_defined_vars ());
|
446 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
447 |
/**/
|
448 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
449 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
450 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
451 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/bridges.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
API Scripting page.
|
18 |
*/
|
@@ -95,7 +95,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
95 |
do_action ("ws_plugin__s2member_during_bridges_page_before_right_sections", get_defined_vars ());
|
96 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
97 |
/**/
|
98 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
99 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
100 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
101 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
API Scripting page.
|
18 |
*/
|
95 |
do_action ("ws_plugin__s2member_during_bridges_page_before_right_sections", get_defined_vars ());
|
96 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
97 |
/**/
|
98 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
99 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
100 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
101 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/code-samples/mms-patch-load.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
// Modified for full plugin compatiblity.
|
2 |
+
//if ( empty( $active_plugins ) || defined( 'WP_INSTALLING' ) )
|
3 |
+
if ( empty( $active_plugins ) || ( defined( 'WP_INSTALLING' ) && !preg_match("/\/wp-activate\.php/", $_SERVER["REQUEST_URI"]) ) )
|
4 |
+
return $plugins;
|
includes/menu-pages/code-samples/mms-patch-user-new.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
// Modified for full plugin compatiblity.
|
2 |
+
//wpmu_signup_user( $new_user_login, $_REQUEST[ 'email' ], array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST[ 'role' ] ) );
|
3 |
+
wpmu_signup_user( $new_user_login, $_REQUEST[ 'email' ], apply_filters( 'add_signup_meta', array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST[ 'role' ] ) ) );
|
includes/menu-pages/code-samples/mms-patch-wp-login.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
case 'register' :
|
2 |
+
if ( is_multisite() ) {
|
3 |
+
// Multisite uses wp-signup.php
|
4 |
+
// Modified for full plugin compatiblity.
|
5 |
+
//wp_redirect( apply_filters( 'wp_signup_location', get_bloginfo('wpurl') . '/wp-signup.php' ) );
|
6 |
+
//exit;
|
7 |
+
}
|
includes/menu-pages/down-ops.inc.php
CHANGED
@@ -48,7 +48,7 @@ if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_section
|
|
48 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
49 |
/**/
|
50 |
echo '<p><strong>Upload restricted files to this security-enabled directory:</strong><br /><code>' . preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]) . '</code></p>' . "\n";
|
51 |
-
echo '<p>- Now, you can link to any protected file, using this special format:<br /> <code>' . get_bloginfo ("
|
52 |
/**/
|
53 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
54 |
/**/
|
@@ -206,7 +206,7 @@ if (apply_filters ("ws_plugin__s2member_during_down_ops_page_during_left_section
|
|
206 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-restrictions-section">' . "\n";
|
207 |
echo '<h3>Advanced Download Restrictions ( optional, for greater flexibility )</h3>' . "\n";
|
208 |
echo '<p>By default, s2Member uses your Basic Download Restrictions - as configured above. However, you can force s2Member to allow file downloads, using an extra query string parameter ( <code>s2member_file_download_key</code> ). A file download `Key` is passed through this parameter, and it tells s2Member to allow the download of this particular file, regardless of Membership Level; and WITHOUT checking any Basic Restrictions, that you may, or may not, have configured above.</p>' . "\n";
|
209 |
-
echo '<p>' . get_bloginfo ("
|
210 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_advanced_restrictions", get_defined_vars ());
|
211 |
/**/
|
212 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
@@ -281,7 +281,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
281 |
do_action ("ws_plugin__s2member_during_down_ops_page_before_right_sections", get_defined_vars ());
|
282 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
283 |
/**/
|
284 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
285 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
286 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
287 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
48 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
49 |
/**/
|
50 |
echo '<p><strong>Upload restricted files to this security-enabled directory:</strong><br /><code>' . preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]) . '</code></p>' . "\n";
|
51 |
+
echo '<p>- Now, you can link to any protected file, using this special format:<br /> <code>' . get_bloginfo ("wpurl") . '/?s2member_file_download=example-file.zip</code><br /> <small><em><strong>s2member_file_download</strong> = location of the file, relative to the /' . esc_html (basename ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/ directory. In other words, just the file name.</em></small></p>' . "\n";
|
52 |
/**/
|
53 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
54 |
/**/
|
206 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-restrictions-section">' . "\n";
|
207 |
echo '<h3>Advanced Download Restrictions ( optional, for greater flexibility )</h3>' . "\n";
|
208 |
echo '<p>By default, s2Member uses your Basic Download Restrictions - as configured above. However, you can force s2Member to allow file downloads, using an extra query string parameter ( <code>s2member_file_download_key</code> ). A file download `Key` is passed through this parameter, and it tells s2Member to allow the download of this particular file, regardless of Membership Level; and WITHOUT checking any Basic Restrictions, that you may, or may not, have configured above.</p>' . "\n";
|
209 |
+
echo '<p>' . get_bloginfo ("wpurl") . '/?s2member_file_download=example-file.zip<code>&s2member_file_download_key=<?php echo s2member_file_download_key("example-file.zip"); ?></code><br /> <small><em><strong>s2member_file_download_key</strong> = <?php echo s2member_file_download_key("location of the file, relative to the /' . esc_html (basename ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/ directory"); ?></em></small></p>' . "\n";
|
210 |
do_action ("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_advanced_restrictions", get_defined_vars ());
|
211 |
/**/
|
212 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
281 |
do_action ("ws_plugin__s2member_during_down_ops_page_before_right_sections", get_defined_vars ());
|
282 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
283 |
/**/
|
284 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
285 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
286 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
287 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/els-ops.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
PayPal® Options page.
|
18 |
*/
|
@@ -340,7 +340,7 @@ if (apply_filters ("ws_plugin__s2member_during_els_ops_page_during_left_sections
|
|
340 |
/**/
|
341 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-other-methods-section">' . "\n";
|
342 |
echo '<h3>Other List Server Integrations ( there\'s always a way )</h3>' . "\n";
|
343 |
-
echo '<p>Check the s2Member API Notifications panel. You\'ll find additional layers of automation available through the use of the `Signup`, `Registration`, `Payment`, `EOT/Deletion`, `Refund/Reversal`, and `Specific Post/Page`
|
344 |
do_action ("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_other_methods", get_defined_vars ());
|
345 |
echo '</div>' . "\n";
|
346 |
/**/
|
@@ -364,7 +364,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
364 |
do_action ("ws_plugin__s2member_during_els_ops_page_before_right_sections", get_defined_vars ());
|
365 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
366 |
/**/
|
367 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
368 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
369 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
370 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
PayPal® Options page.
|
18 |
*/
|
340 |
/**/
|
341 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-other-methods-section">' . "\n";
|
342 |
echo '<h3>Other List Server Integrations ( there\'s always a way )</h3>' . "\n";
|
343 |
+
echo '<p>Check the s2Member API Notifications panel. You\'ll find additional layers of automation available through the use of the `Signup`, `Registration`, `Payment`, `EOT/Deletion`, `Refund/Reversal`, and `Specific Post/Page` Notifications that are available to you through the s2Member API. These make it possible to integrate with 3rd party applications; like list servers, affiliate programs, and other back-office routines; in more advanced ways. You will probably need to get help from a web developer though. s2Member API Notifications require some light PHP scripting by someone familiar with web service connections.</p>' . "\n";
|
344 |
do_action ("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_other_methods", get_defined_vars ());
|
345 |
echo '</div>' . "\n";
|
346 |
/**/
|
364 |
do_action ("ws_plugin__s2member_during_els_ops_page_before_right_sections", get_defined_vars ());
|
365 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
366 |
/**/
|
367 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
368 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
369 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
370 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/info.inc.php
CHANGED
@@ -55,7 +55,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
55 |
do_action ("ws_plugin__s2member_during_info_page_before_right_sections", get_defined_vars ());
|
56 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
57 |
/**/
|
58 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
59 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
60 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
61 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
55 |
do_action ("ws_plugin__s2member_during_info_page_before_right_sections", get_defined_vars ());
|
56 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
57 |
/**/
|
58 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
59 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
60 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
61 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/menu-pages-s-min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(b){var a=esc_html=function(c){return String(c).replace(/"/g,""").replace(/\</g,"<").replace(/\>/g,">")};if(location.href.match(/page\=ws-plugin--s2member-options/)){ws_plugin__s2member_generateSecurityKey=function(){var f=function(h,g){h=(arguments.length<1)?0:h;g=(arguments.length<2)?2147483647:g;return Math.floor(Math.random()*(g-h+1))+h};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";for(var d=0,c="";d<56;d++){c+=e.substr(f(0,e.length-1),1)}b("input#ws-plugin--s2member-sec-encryption-key").val(c);return false};ws_plugin__s2member_enableSecurityKey=function(){if(confirm("Edit Key? Are you sure?\nThis could break your installation!\n\n*Note* If you've been testing s2Member, feel free to change this Key before you go live. Just don't go live, and then change it. You'll have some very unhappy Customers. Data corruption WILL occur!\n\nFor your safety, s2Member keeps a history of the last 10 Keys that you've used. If you get yourself into a real situation, s2Member will let you revert back to a previous Key.")){b("input#ws-plugin--s2member-sec-encryption-key").attr("disabled",false)}return false};ws_plugin__s2member_securityKeyHistory=function(){b("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false}}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){b("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var d=b(this),e=d.val();var c=b("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(e==2){c.show()}else{c.hide()}})}else{if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){b("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var e=b(this),f=e.val();var d=b("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var c=b("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(f<=0){d.css("display","none"),c.attr("src",c.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}else{if(f==1){d.css("display",""),c.attr("src",c.attr("src").replace(/\/unchecked\.png$/,"/checked.png"))}else{if(f==2){d.css("display",""),c.attr("src",c.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}}}})}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){b("select#ws-plugin--s2member-level1-term, select#ws-plugin--s2member-level2-term, select#ws-plugin--s2member-level3-term, select#ws-plugin--s2member-level4-term, select#ws-plugin--s2member-modification-term").change(function(){var d=this.id.replace(/^ws-plugin--s2member-(.+?)-term$/g,"$1");var c=(b(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;b("p#ws-plugin--s2member-"+d+"-trial-line").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-trial-then").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-20p-rule").css("display",(c?"none":""));(c)?b("input#ws-plugin--s2member-"+form+"-trial-period").val(0):null});b("input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps").keyup(function(){this.value=b.trim(b.trim(this.value).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase())});ws_plugin__s2member_paypalButtonGenerate=function(f){var c='[s2Member-PayPal-Button %%attrs%% image="default" /]',q="",t={};t.level0='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]); ?>';t.level1='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]); ?>';t.level2='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]); ?>';t.level3='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]); ?>';t.level4='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]); ?>';var o=b("input#ws-plugin--s2member-"+f+"-shortcode");var g=b("textarea#ws-plugin--s2member-"+f+"-button");var k=b("select#ws-plugin--s2member-modification-level");var h=(f==="modification")?k.val().split(":",2)[1]:f.replace(/^level/,"");var l=t["level"+h].replace(/"/g,"");var d=b("input#ws-plugin--s2member-"+f+"-trial-period").val().replace(/[^0-9]/g,"");var j=b("select#ws-plugin--s2member-"+f+"-trial-term").val().replace(/[^A-Z]/g,"");var m=b("input#ws-plugin--s2member-"+f+"-amount").val().replace(/[^0-9\.]/g,"");var s=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var u=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var r=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var e=b.trim(b("input#ws-plugin--s2member-"+f+"-page-style").val().replace(/"/g,""));var i=b("select#ws-plugin--s2member-"+f+"-currency").val().replace(/[^A-Z]/g,"");var n=b.trim(b.trim(b("input#ws-plugin--s2member-"+f+"-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase());d=(r==="BN")?"0":d;var p=(r==="BN"&&u!=="L")?h+":"+n+":"+s+" "+u:h+":"+n;p=p.replace(/\:+$/g,"");if(j==="D"&&d>7){alert("Oops, a slight problem:\n\nMaximum Free Days is: 7.\nIf you want to offer more than 7 days free, please choose Weeks or Months from the drop-down.");return false}else{if(j==="W"&&d>52){alert("Oops, a slight problem:\n\nMaximum Free Weeks is: 52.\nIf you want to offer more than 52 weeks free, please choose Months from the drop-down.");return false}else{if(j==="M"&&d>12){alert("Oops, a slight problem:\n\nMaximum Free Months is: 12.\nIf you want to offer more than 12 months free, please choose Years from the drop-down.");return false}else{if(j==="Y"&&d>1){alert("Oops, a slight problem:\n\nMax Trial Period Years is: 1. *This is a PayPal® limitation.");return false}else{if(!m||isNaN(m)||m<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(m>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}}}}}}g.val(g.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(d)<=0)?g.val(g.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(r==="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(r==="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="(src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(r!=="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(r!=="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;q+='level="'+a(h)+'" ccaps="'+a(n)+'" desc="'+a(l)+'" ps="'+a(e)+'" cc="'+a(i)+'" custom="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"';q+=' tp="'+a(d)+'" tt="'+a(j)+'" ra="'+a(m)+'" rp="'+a(s)+'" rt="'+a(u)+'" rr="'+a(r)+'"';q+=(f==="modification")?' modify="1"':"";o.val(c.replace(/%%attrs%%/,q));g.val(g.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(l)+'"'));g.val(g.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(p)+'"'));g.val(g.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(e)+'"'));g.val(g.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(i)+'"'));g.val(g.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"'));g.val(g.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((f==="modification")?"1":"0")+'"'));g.val(g.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(m)+'"'));g.val(g.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+a(r)+'"'));g.val(g.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+a(d)+'"'));g.val(g.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+a(j)+'"'));g.val(g.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+a(m)+'"'));g.val(g.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+a(s)+'"'));g.val(g.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+a(u)+'"'));b("div#ws-plugin--s2member-"+f+"-button-prev").html(g.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0); \?\>/g,""));(f==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");o.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var q='[s2Member-PayPal-Button %%attrs%% image="default" /]',p="";var n=b("input#ws-plugin--s2member-sp-shortcode");var e=b("textarea#ws-plugin--s2member-sp-button");var f=b("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-additional-ids").val()||[];var o=b("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var k=b("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var j=b.trim(b("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var m=b.trim(b("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var d=b("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!f){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}else{if(!k||isNaN(k)||k<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(k>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}else{if(!j){alert("Oops, a slight problem:\n\nPlease type a Description for this Button.");return false}}}}for(var g=0,c=f;g<h.length;g++){if(h[g]&&h[g]!==f){c+=","+h[g]}}var l="sp:"+c+":"+o;p+='ids="'+a(c)+'" exp="'+a(o)+'" desc="'+a(j)+'" ps="'+a(m)+'" cc="'+a(d)+'"';p+=' custom="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>" ra="'+a(k)+'" sp="1"';n.val(q.replace(/%%attrs%%/,p));e.val(e.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(j)+'"'));e.val(e.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(l)+'"'));e.val(e.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(m)+'"'));e.val(e.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(d)+'"'));e.val(e.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"'));e.val(e.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(k)+'"'));b("div#ws-plugin--s2member-sp-button-prev").html(e.val().replace(/\<form/,'<form target="_blank"'));alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");n.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var j=b("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var c=b("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var d=b("p#ws-plugin--s2member-sp-link"),g=b("img#ws-plugin--s2member-sp-link-loading");if(!j){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}for(var e=0,f=j;e<h.length;e++){if(h[e]&&h[e]!==j){f+=","+h[e]}}d.hide(),g.show(),b.post(ajaxurl,{action:"s2member_sp_access_link",s2member_sp_access_link:'<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link")); ?>',s2member_sp_access_link_ids:f,s2member_sp_access_link_hours:c},function(i){d.show().html('<a href="'+a(i)+'" target="_blank" rel="external">'+esc_html(i)+"</a>"),g.hide()});return false}}}}}});
|
1 |
+
jQuery(document).ready(function(b){var a=esc_html=function(c){return String(c).replace(/"/g,""").replace(/\</g,"<").replace(/\>/g,">")};if(location.href.match(/page\=ws-plugin--s2member-mms-options/)){b("select#ws-plugin--s2member-mms-registration-file").change(function(){if(b(this).val()==="wp-signup"){b("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").show(),b("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").hide(),b("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").show()}else{if(b(this).val()==="wp-login"){b("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").hide(),b("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").show(),b("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").hide()}}b("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0")[((b("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"show":"hide")](),b("input#ws-plugin--s2member-mms-registration-blogs-level0").val(((b("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"1":"0"))}).trigger("change");b("select#ws-plugin--s2member-mms-registration-grants").change(function(){b("select#ws-plugin--s2member-mms-registration-file").trigger("change")})}else{if(location.href.match(/page\=ws-plugin--s2member-options/)){ws_plugin__s2member_generateSecurityKey=function(){var f=function(h,g){h=(arguments.length<1)?0:h;g=(arguments.length<2)?2147483647:g;return Math.floor(Math.random()*(g-h+1))+h};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";for(var d=0,c="";d<56;d++){c+=e.substr(f(0,e.length-1),1)}b("input#ws-plugin--s2member-sec-encryption-key").val(c);return false};ws_plugin__s2member_enableSecurityKey=function(){if(confirm("Edit Key? Are you sure?\nThis could break your installation!\n\n*Note* If you've been testing s2Member, feel free to change this Key before you go live. Just don't go live, and then change it. You'll have some very unhappy Customers. Data corruption WILL occur!\n\nFor your safety, s2Member keeps a history of the last 10 Keys that you've used. If you get yourself into a real situation, s2Member will let you revert back to a previous Key.")){b("input#ws-plugin--s2member-sec-encryption-key").attr("disabled",false)}return false};ws_plugin__s2member_securityKeyHistory=function(){b("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false}}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){b("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var d=b(this),e=d.val();var c=b("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(e==2){c.show()}else{c.hide()}})}else{if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){b("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var e=b(this),f=e.val();var d=b("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var c=b("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(f<=0){d.css("display","none"),c.attr("src",c.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}else{if(f==1){d.css("display",""),c.attr("src",c.attr("src").replace(/\/unchecked\.png$/,"/checked.png"))}else{if(f==2){d.css("display",""),c.attr("src",c.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}}}})}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){b("select#ws-plugin--s2member-level1-term, select#ws-plugin--s2member-level2-term, select#ws-plugin--s2member-level3-term, select#ws-plugin--s2member-level4-term, select#ws-plugin--s2member-modification-term").change(function(){var d=this.id.replace(/^ws-plugin--s2member-(.+?)-term$/g,"$1");var c=(b(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;b("p#ws-plugin--s2member-"+d+"-trial-line").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-trial-then").css("display",(c?"none":""));b("span#ws-plugin--s2member-"+d+"-20p-rule").css("display",(c?"none":""));(c)?b("input#ws-plugin--s2member-"+form+"-trial-period").val(0):null});b("input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps").keyup(function(){if(this.value.match(/[^a-z_0-9,]/)){this.value=b.trim(b.trim(this.value).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase())}});ws_plugin__s2member_paypalButtonGenerate=function(f){var c='[s2Member-PayPal-Button %%attrs%% image="default" /]',q="",t={};t.level0='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]); ?>';t.level1='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]); ?>';t.level2='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]); ?>';t.level3='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]); ?>';t.level4='<?php echo ws_plugin__s2member_esc_sq ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]); ?>';var o=b("input#ws-plugin--s2member-"+f+"-shortcode");var g=b("textarea#ws-plugin--s2member-"+f+"-button");var k=b("select#ws-plugin--s2member-modification-level");var h=(f==="modification")?k.val().split(":",2)[1]:f.replace(/^level/,"");var l=t["level"+h].replace(/"/g,"");var d=b("input#ws-plugin--s2member-"+f+"-trial-period").val().replace(/[^0-9]/g,"");var j=b("select#ws-plugin--s2member-"+f+"-trial-term").val().replace(/[^A-Z]/g,"");var m=b("input#ws-plugin--s2member-"+f+"-amount").val().replace(/[^0-9\.]/g,"");var s=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var u=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var r=b("select#ws-plugin--s2member-"+f+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var e=b.trim(b("input#ws-plugin--s2member-"+f+"-page-style").val().replace(/"/g,""));var i=b("select#ws-plugin--s2member-"+f+"-currency").val().replace(/[^A-Z]/g,"");var n=b.trim(b.trim(b("input#ws-plugin--s2member-"+f+"-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase());d=(r==="BN")?"0":d;var p=(r==="BN"&&u!=="L")?h+":"+n+":"+s+" "+u:h+":"+n;p=p.replace(/\:+$/g,"");if(j==="D"&&d>7){alert("Oops, a slight problem:\n\nMaximum Free Days is: 7.\nIf you want to offer more than 7 days free, please choose Weeks or Months from the drop-down.");return false}else{if(j==="W"&&d>52){alert("Oops, a slight problem:\n\nMaximum Free Weeks is: 52.\nIf you want to offer more than 52 weeks free, please choose Months from the drop-down.");return false}else{if(j==="M"&&d>12){alert("Oops, a slight problem:\n\nMaximum Free Months is: 12.\nIf you want to offer more than 12 months free, please choose Years from the drop-down.");return false}else{if(j==="Y"&&d>1){alert("Oops, a slight problem:\n\nMax Trial Period Years is: 1. *This is a PayPal® limitation.");return false}else{if(!m||isNaN(m)||m<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(m>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}}}}}}g.val(g.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(d)<=0)?g.val(g.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(r==="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(r==="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="(src|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(r!=="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(r!=="BN")?g.val(g.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;q+='level="'+a(h)+'" ccaps="'+a(n)+'" desc="'+a(l)+'" ps="'+a(e)+'" cc="'+a(i)+'" custom="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"';q+=' tp="'+a(d)+'" tt="'+a(j)+'" ra="'+a(m)+'" rp="'+a(s)+'" rt="'+a(u)+'" rr="'+a(r)+'"';q+=(f==="modification")?' modify="1"':"";o.val(c.replace(/%%attrs%%/,q));g.val(g.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(l)+'"'));g.val(g.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(p)+'"'));g.val(g.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(e)+'"'));g.val(g.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(i)+'"'));g.val(g.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"'));g.val(g.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((f==="modification")?"1":"0")+'"'));g.val(g.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(m)+'"'));g.val(g.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+a(r)+'"'));g.val(g.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+a(d)+'"'));g.val(g.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+a(j)+'"'));g.val(g.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+a(m)+'"'));g.val(g.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+a(s)+'"'));g.val(g.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+a(u)+'"'));b("div#ws-plugin--s2member-"+f+"-button-prev").html(g.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0); \?\>/g,""));(f==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");o.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var q='[s2Member-PayPal-Button %%attrs%% image="default" /]',p="";var n=b("input#ws-plugin--s2member-sp-shortcode");var e=b("textarea#ws-plugin--s2member-sp-button");var f=b("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-additional-ids").val()||[];var o=b("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var k=b("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var j=b.trim(b("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var m=b.trim(b("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var d=b("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!f){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}else{if(!k||isNaN(k)||k<0.01){alert("Oops, a slight problem:\n\nAmount must be >= 0.01");return false}else{if(k>10000){alert("Oops, a slight problem:\n\nMaximum amount is: 10000.00");return false}else{if(!j){alert("Oops, a slight problem:\n\nPlease type a Description for this Button.");return false}}}}for(var g=0,c=f;g<h.length;g++){if(h[g]&&h[g]!==f){c+=","+h[g]}}var l="sp:"+c+":"+o;p+='ids="'+a(c)+'" exp="'+a(o)+'" desc="'+a(j)+'" ps="'+a(m)+'" cc="'+a(d)+'"';p+=' custom="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>" ra="'+a(k)+'" sp="1"';n.val(q.replace(/%%attrs%%/,p));e.val(e.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+a(j)+'"'));e.val(e.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+a(l)+'"'));e.val(e.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+a(m)+'"'));e.val(e.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+a(d)+'"'));e.val(e.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo esc_attr ($_SERVER["HTTP_HOST"]); ?>"'));e.val(e.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+a(k)+'"'));b("div#ws-plugin--s2member-sp-button-prev").html(e.val().replace(/\<form/,'<form target="_blank"'));alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");n.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var j=b("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var h=b("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var c=b("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var d=b("p#ws-plugin--s2member-sp-link"),g=b("img#ws-plugin--s2member-sp-link-loading");if(!j){alert("Oops, a slight problem:\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.");return false}for(var e=0,f=j;e<h.length;e++){if(h[e]&&h[e]!==j){f+=","+h[e]}}d.hide(),g.show(),b.post(ajaxurl,{action:"s2member_sp_access_link",s2member_sp_access_link:'<?php echo ws_plugin__s2member_esc_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link")); ?>',s2member_sp_access_link_ids:f,s2member_sp_access_link_hours:c},function(i){d.show().html('<a href="'+a(i)+'" target="_blank" rel="external">'+esc_html(i)+"</a>"),g.hide()});return false}}}}}}});
|
includes/menu-pages/menu-pages-s.js
CHANGED
@@ -17,7 +17,30 @@ jQuery (document).ready (function($)
|
|
17 |
return String (str).replace (/"/g, '"').replace (/\</g, '<').replace (/\>/g, '>');
|
18 |
};
|
19 |
/**/
|
20 |
-
if (location.href.match (/page\=ws-plugin--s2member-options/))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
ws_plugin__s2member_generateSecurityKey = function() /* Generates a unique Security Key. */
|
23 |
{
|
@@ -100,7 +123,8 @@ jQuery (document).ready (function($)
|
|
100 |
/**/
|
101 |
$ ('input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps').keyup (function()
|
102 |
{
|
103 |
-
|
|
|
104 |
});
|
105 |
/**/
|
106 |
ws_plugin__s2member_paypalButtonGenerate = function(button) /* Handles PayPal® Button Generation. */
|
17 |
return String (str).replace (/"/g, '"').replace (/\</g, '<').replace (/\>/g, '>');
|
18 |
};
|
19 |
/**/
|
20 |
+
if (location.href.match (/page\=ws-plugin--s2member-mms-options/))
|
21 |
+
{
|
22 |
+
$ ('select#ws-plugin--s2member-mms-registration-file').change (function()
|
23 |
+
{
|
24 |
+
if ($ (this).val () === 'wp-signup') /* Expand/collapse relevant options; based on file selection. */
|
25 |
+
{
|
26 |
+
$ ('div#ws-plugin--s2member-mms-registration-support-package-details-wrapper').show (), $ ('div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login').hide (), $ ('div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup').show ();
|
27 |
+
}
|
28 |
+
else if ($ (this).val () === 'wp-login') /* Expand/collapse relevant options. */
|
29 |
+
{
|
30 |
+
$ ('div#ws-plugin--s2member-mms-registration-support-package-details-wrapper').hide (), $ ('div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login').show (), $ ('div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup').hide ();
|
31 |
+
}
|
32 |
+
/**/
|
33 |
+
$ ('div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0')[ ( ($ ('select#ws-plugin--s2member-mms-registration-grants').val () === 'all') ? 'show' : 'hide')] (), $ ('input#ws-plugin--s2member-mms-registration-blogs-level0').val ( ( ($ ('select#ws-plugin--s2member-mms-registration-grants').val () === 'all') ? '1' : '0'));
|
34 |
+
/**/
|
35 |
+
}).trigger ('change'); /* Fire on ready too. */
|
36 |
+
/**/
|
37 |
+
$ ('select#ws-plugin--s2member-mms-registration-grants').change (function()
|
38 |
+
{
|
39 |
+
$ ('select#ws-plugin--s2member-mms-registration-file').trigger ('change');
|
40 |
+
});
|
41 |
+
}
|
42 |
+
/**/
|
43 |
+
else if (location.href.match (/page\=ws-plugin--s2member-options/))
|
44 |
{
|
45 |
ws_plugin__s2member_generateSecurityKey = function() /* Generates a unique Security Key. */
|
46 |
{
|
123 |
/**/
|
124 |
$ ('input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps').keyup (function()
|
125 |
{
|
126 |
+
if (this.value.match (/[^a-z_0-9,]/)) /* Only if there is a problem; because this causes interruption. */
|
127 |
+
this.value = $.trim ($.trim (this.value).replace (/[ \-]/g, '_').replace (/[^A-Z_0-9,]/gi, '').toLowerCase ());
|
128 |
});
|
129 |
/**/
|
130 |
ws_plugin__s2member_paypalButtonGenerate = function(button) /* Handles PayPal® Button Generation. */
|
includes/menu-pages/mms-options.inc.php
ADDED
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
4 |
+
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
5 |
+
|
6 |
+
Released under the terms of the GNU General Public License.
|
7 |
+
You should have received a copy of the GNU General Public License,
|
8 |
+
along with this software. In the main directory, see: /licensing/
|
9 |
+
If not, see: <http://www.gnu.org/licenses/>.
|
10 |
+
*/
|
11 |
+
/*
|
12 |
+
Direct access denial.
|
13 |
+
*/
|
14 |
+
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
+
/*
|
17 |
+
General Options page.
|
18 |
+
*/
|
19 |
+
echo '<div class="wrap ws-menu-page">' . "\n";
|
20 |
+
/**/
|
21 |
+
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
22 |
+
echo '<h2><div>Developed by <a href="' . ws_plugin__s2member_parse_readme_value ("Plugin URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-light.png" alt="." /></a></div>s2Member Multisite ( Configuration )</h2>' . "\n";
|
23 |
+
/**/
|
24 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
25 |
+
/**/
|
26 |
+
echo '<table class="ws-menu-page-table">' . "\n";
|
27 |
+
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
28 |
+
echo '<tr class="ws-menu-page-table-tr">' . "\n";
|
29 |
+
echo '<td class="ws-menu-page-table-l">' . "\n";
|
30 |
+
/**/
|
31 |
+
if (is_multisite () && is_main_site ()) /* These panels will ONLY be available on the Main Site; with Multisite Networking. */
|
32 |
+
{
|
33 |
+
echo '<form method="post" name="ws_plugin__s2member_options_form" id="ws-plugin--s2member-options-form">' . "\n";
|
34 |
+
echo '<input type="hidden" name="ws_plugin__s2member_options_save" id="ws-plugin--s2member-options-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-options-save")) . '" />' . "\n";
|
35 |
+
echo '<input type="hidden" name="ws_plugin__s2member_configured" id="ws-plugin--s2member-configured" value="1" />' . "\n";
|
36 |
+
/**/
|
37 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_before_left_sections", get_defined_vars ());
|
38 |
+
/**/
|
39 |
+
if (apply_filters ("ws_plugin__s2member_during_mms_options_page_during_left_sections_display_mms_patches", true, get_defined_vars ()))
|
40 |
+
{
|
41 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_during_left_sections_before_mms_patches", get_defined_vars ());
|
42 |
+
/**/
|
43 |
+
echo '<div class="ws-menu-page-group" title="Multisite WordPress® Patches ( required )" default-state="open">' . "\n";
|
44 |
+
/**/
|
45 |
+
echo '<div class="ws-menu-page-section ws-plugin--s2member-mms-patches-section">' . "\n";
|
46 |
+
echo '<img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/large-icon.png" title="s2Member ( a Membership management system for WordPress® )" alt="" style="float:right; margin:0 0 0 25px; border:0;" />' . "\n";
|
47 |
+
echo '<h3>Multisite WordPress® Patches ( required for compatiblity )</h3>' . "\n";
|
48 |
+
echo '<p>In order for s2Member to function properly in a Multisite environment, you MUST implement three patches. One goes into your /wp-login.php file, one into /wp-includes/load.php, another into /wp-admin/user-new.php. We have TRAC tickets into WordPress® for these changes. However, until the official release of WordPress® includes these updates, you can just use the automatic patcher below. All you do is check the box & click Save. s2Member will handle everything automatically for you. You\'ll want to do this again, after every WordPress® upgrade you perform.</p>' . "\n";
|
49 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_during_left_sections_during_mms_patches", get_defined_vars ());
|
50 |
+
echo '<div id="ws-plugin--s2member-mms-patches-details-wrapper">' . "\n";
|
51 |
+
echo '<h3>Rather Do It Yourself? ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-mms-patches-details\').toggle(); return false;" class="ws-dotted-link">manual instructions</a> )</h3>' . "\n";
|
52 |
+
echo '<div id="ws-plugin--s2member-mms-patches-details" style="display:none;">' . "\n";
|
53 |
+
echo '<p><strong>Patch #1</strong> ( /wp-login.php )</p>' . "\n";
|
54 |
+
echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/mms-patch-wp-login.php"), true) . '</p>' . "\n";
|
55 |
+
echo '<p><strong>Patch #2</strong> ( /wp-includes/load.php )</p>' . "\n";
|
56 |
+
echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/mms-patch-load.php"), true) . '</p>' . "\n";
|
57 |
+
echo '<p><strong>Patch #3</strong> ( /wp-admin/user-new.php )</p>' . "\n";
|
58 |
+
echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/mms-patch-user-new.php"), true) . '</p>' . "\n";
|
59 |
+
echo '</div>' . "\n";
|
60 |
+
echo '</div>' . "\n";
|
61 |
+
/**/
|
62 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
63 |
+
/**/
|
64 |
+
echo '<table class="form-table" style="margin:0;">' . "\n";
|
65 |
+
echo '<tbody>' . "\n";
|
66 |
+
echo '<tr>' . "\n";
|
67 |
+
/**/
|
68 |
+
echo '<th style="padding-top:0;">' . "\n";
|
69 |
+
echo '<label for="ws-plugin--s2member-mms-options-patch-files">' . "\n";
|
70 |
+
echo 'Automatically Patch Files? ( the easiest way )' . "\n";
|
71 |
+
echo '</label>' . "\n";
|
72 |
+
echo '</th>' . "\n";
|
73 |
+
/**/
|
74 |
+
echo '</tr>' . "\n";
|
75 |
+
echo '<tr>' . "\n";
|
76 |
+
/**/
|
77 |
+
echo '<td>' . "\n";
|
78 |
+
echo '<label><strong>Yes</strong> <input type="checkbox" name="ws_plugin__s2member_mms_options_patch_files" id="ws-plugin--s2member-mms-options-patch-files" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-mms-options-patch-files")) . '" /> ( automatically patch WordPress® for me )</label>' . "\n";
|
79 |
+
echo '</td>' . "\n";
|
80 |
+
/**/
|
81 |
+
echo '</tr>' . "\n";
|
82 |
+
echo '</tbody>' . "\n";
|
83 |
+
echo '</table>' . "\n";
|
84 |
+
echo '</div>' . "\n";
|
85 |
+
/**/
|
86 |
+
echo '</div>' . "\n";
|
87 |
+
/**/
|
88 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_during_left_sections_after_mms_patches", get_defined_vars ());
|
89 |
+
}
|
90 |
+
/**/
|
91 |
+
if (apply_filters ("ws_plugin__s2member_during_mms_options_page_during_left_sections_display_mms_registration", true, get_defined_vars ()))
|
92 |
+
{
|
93 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_during_left_sections_before_mms_registration", get_defined_vars ());
|
94 |
+
/**/
|
95 |
+
echo '<div class="ws-menu-page-group" title="Multisite Registration Configuration" default-state="open">' . "\n";
|
96 |
+
/**/
|
97 |
+
echo '<div class="ws-menu-page-section ws-plugin--s2member-mms-registration-section">' . "\n";
|
98 |
+
echo '<img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/large-icon.png" title="s2Member ( a Membership management system for WordPress® )" alt="" style="float:right; margin:0 0 0 25px; border:0;" />' . "\n";
|
99 |
+
echo '<h3>Multisite Registration ( Main Site Configuration )</h3>' . "\n";
|
100 |
+
echo '<p>s2Member supports Free Subscribers ( at Level #0 ), along with four Primary Levels [1-4] of paid Membership. If you want your visitors to be capable of registering absolutely free, you will want to "allow" Open Registration. Whenever a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0. <strong>With Multisite Networking enabled</strong>, your ( Main Site ) could ALSO offer a Customer access to create a Blog of their own, where a Customer becomes a "Member" of your ( Main Site ), and also a Blog Owner/Administrator. With s2Member installed ( network wide ), each of your Blog Owners could offer Membership too, using a single copy of the s2Member plugin ( which is a great selling point<em>!</em> ). We refer to this as a Multisite Blog Farm.</p>' . "\n";
|
101 |
+
echo '<p>Multisite Networking also makes a new Registration Form available ( driven by your theme ); which we refer to as ( <code>wp-signup.php</code> ). If you\'re planning to offer Blogs, you MUST use <a href="' . apply_filters ("wp_signup_location", get_bloginfo ("wpurl") . "/wp-signup.php") . '" target="_blank" rel="external">wp-signup.php</a>, instead of using the Standard Login/Registration Form. In a Multisite installation, we refer to the Standard Login/Registration Form, as ( <code>wp-login.php?action=register</code> ). If you\'re planning to offer Membership Access only, and NOT Blogs, you can just use the <a href="' . add_query_arg ("action", "register", wp_login_url ()) . '" target="_blank" rel="external">Standard Login/Registration Form</a>, which is easily customized through <code>s2Member -> General Options -> Login/Registration Design</code>.</p>' . "\n";
|
102 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_during_left_sections_during_mms_registration", get_defined_vars ());
|
103 |
+
echo '<div id="ws-plugin--s2member-mms-registration-support-package-details-wrapper">' . "\n";
|
104 |
+
echo '<h3>Running a Multisite Blog Farm? ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-mms-registration-support-package-details\').toggle(); return false;" class="ws-dotted-link">please read</a> )</h3>' . "\n";
|
105 |
+
echo '<div id="ws-plugin--s2member-mms-registration-support-package-details" style="display:none;">' . "\n";
|
106 |
+
echo '<p>( <em>Highly recommended!</em> ) <strong>Before you go live</strong>, please contact <a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank" rel="external">s2Member.com</a> for full documentation. There is some additional functionality that can be enabled for security on a Blog Farm installation; and also some menus/documentation/functionality that can be disabled. NOTE ~ You will be asked to make a <a href="' . ws_plugin__s2member_parse_readme_value ("Donate link") . '" target="_blank" rel="external">donation</a>, or to purchase a <a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank" rel="external">Support Package</a> for s2Member.</p>' . "\n";
|
107 |
+
echo '</div>' . "\n";
|
108 |
+
echo '</div>' . "\n";
|
109 |
+
/**/
|
110 |
+
echo '<table class="form-table">' . "\n";
|
111 |
+
echo '<tbody>' . "\n";
|
112 |
+
echo '<tr>' . "\n";
|
113 |
+
/**/
|
114 |
+
echo '<th>' . "\n";
|
115 |
+
echo '<label for="ws-plugin--s2member-mms-registration-file">' . "\n";
|
116 |
+
echo 'What Do You Plan To Offer? ( please choose one )' . "\n";
|
117 |
+
echo '</label>' . "\n";
|
118 |
+
echo '</th>' . "\n";
|
119 |
+
/**/
|
120 |
+
echo '</tr>' . "\n";
|
121 |
+
echo '<tr>' . "\n";
|
122 |
+
/**/
|
123 |
+
echo '<td>' . "\n";
|
124 |
+
/**/
|
125 |
+
if (defined ("MULTISITE_FARM") && MULTISITE_FARM) /* Lock this down if a config option is set in /wp-config.php. */
|
126 |
+
{
|
127 |
+
echo '<select name="ws_plugin__s2member_mms_registration_file" id="ws-plugin--s2member-mms-registration-file" disabled="disabled">' . "\n";
|
128 |
+
echo '<option value="wp-signup" selected="selected">Blog Farm ( I plan to offer both Membership & Blog creation )</option>' . "\n";
|
129 |
+
echo '</select><br />' . "\n";
|
130 |
+
echo 'This is now locked. Your /wp-config.php file says: <code>MULTISITE_FARM = true</code>.' . "\n";
|
131 |
+
}
|
132 |
+
else
|
133 |
+
{
|
134 |
+
echo '<select name="ws_plugin__s2member_mms_registration_file" id="ws-plugin--s2member-mms-registration-file">' . "\n";
|
135 |
+
echo '<option value="wp-login"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_file"] === "wp-login") ? ' selected="selected"' : '') . '>Membership Only ( I\'m NOT offering Blogs )</option>' . "\n";
|
136 |
+
echo '<option value="wp-signup"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_file"] === "wp-signup") ? ' selected="selected"' : '') . '>Blog Farm ( I plan to offer both Membership & Blog creation )</option>' . "\n";
|
137 |
+
echo '</select><br />' . "\n";
|
138 |
+
echo 'Depending on your selection, the options below may change.' . "\n";
|
139 |
+
}
|
140 |
+
/**/
|
141 |
+
echo '</td>' . "\n";
|
142 |
+
/**/
|
143 |
+
echo '</tr>' . "\n";
|
144 |
+
echo '</tbody>' . "\n";
|
145 |
+
echo '</table>' . "\n";
|
146 |
+
/**/
|
147 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
148 |
+
/**/
|
149 |
+
echo '<table class="form-table ws-plugin--s2member-mms-registration-wp-login" style="margin:0;">' . "\n";
|
150 |
+
echo '<tbody>' . "\n";
|
151 |
+
echo '<tr>' . "\n";
|
152 |
+
/**/
|
153 |
+
echo '<th style="padding-top:0;">' . "\n";
|
154 |
+
echo '<label for="ws-plugin--s2member-allow-subscribers-in">' . "\n";
|
155 |
+
echo 'Your Main Site / Allow Open Registration? ( via <code>wp-login.php?action=register</code> )' . "\n";
|
156 |
+
echo '</label>' . "\n";
|
157 |
+
echo '</th>' . "\n";
|
158 |
+
/**/
|
159 |
+
echo '</tr>' . "\n";
|
160 |
+
echo '<tr>' . "\n";
|
161 |
+
/**/
|
162 |
+
echo '<td>' . "\n";
|
163 |
+
echo '<select name="ws_plugin__s2member_allow_subscribers_in" id="ws-plugin--s2member-allow-subscribers-in">' . "\n";
|
164 |
+
echo '<option value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"]) ? ' selected="selected"' : '') . '>No ( do NOT allow Open Registration )</option>' . "\n";
|
165 |
+
echo '<option value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"]) ? ' selected="selected"' : '') . '>Yes ( allow Open Registration; Free Subscribers at Level #0 )</option>' . "\n";
|
166 |
+
echo '</select><br />' . "\n";
|
167 |
+
echo 'If you set this to <code>Yes</code>, you\'re unlocking <a href="' . add_query_arg ("action", "register", wp_login_url ()) . '" target="_blank" rel="external">wp-login.php?action=register</a> ( on your Main Site ). When a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0. The s2Member software reserves Level #0; to be used ONLY for Free Subscribers. All other Membership Levels [1-4] require payment.' . "\n";
|
168 |
+
echo '</td>' . "\n";
|
169 |
+
/**/
|
170 |
+
echo '</tr>' . "\n";
|
171 |
+
echo '</tbody>' . "\n";
|
172 |
+
echo '</table>' . "\n";
|
173 |
+
/**/
|
174 |
+
echo '<table class="form-table ws-plugin--s2member-mms-registration-wp-signup" style="margin:0;">' . "\n";
|
175 |
+
echo '<tbody>' . "\n";
|
176 |
+
echo '<tr>' . "\n";
|
177 |
+
/**/
|
178 |
+
echo '<th style="padding-top:0;">' . "\n";
|
179 |
+
echo '<label for="ws-plugin--s2member-mms-registration-grants">' . "\n";
|
180 |
+
echo 'Your Main Site / Allow Open Registration? ( via <code>wp-signup.php</code> )' . "\n";
|
181 |
+
echo '</label>' . "\n";
|
182 |
+
echo '</th>' . "\n";
|
183 |
+
/**/
|
184 |
+
echo '</tr>' . "\n";
|
185 |
+
echo '<tr>' . "\n";
|
186 |
+
/**/
|
187 |
+
echo '<td style="padding-bottom:0;">' . "\n";
|
188 |
+
echo '<select name="ws_plugin__s2member_mms_registration_grants" id="ws-plugin--s2member-mms-registration-grants">' . "\n";
|
189 |
+
echo '<option value="none"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_grants"] === "none") ? ' selected="selected"' : '') . '>No ( do NOT allow Open Registration )</option>' . "\n";
|
190 |
+
echo '<option value="user"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_grants"] === "user") ? ' selected="selected"' : '') . '>Yes ( allow Open Registration; Free Subscribers at Level #0 )</option>' . "\n";
|
191 |
+
echo '<option value="all"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_grants"] === "all") ? ' selected="selected"' : '') . '>Yes ( allow Open Registration; Free Subscribers, with a free Blog too )</option>' . "\n";
|
192 |
+
echo '</select><br />' . "\n";
|
193 |
+
echo 'If you set this to <code>Yes</code>, you\'re unlocking <a href="' . apply_filters ("wp_signup_location", get_bloginfo ("wpurl") . "/wp-signup.php") . '" target="_blank" rel="external">wp-signup.php</a> ( on your Main Site ).' . "\n";
|
194 |
+
echo '</td>' . "\n";
|
195 |
+
/**/
|
196 |
+
echo '</tr>' . "\n";
|
197 |
+
echo '</tbody>' . "\n";
|
198 |
+
echo '</table>' . "\n";
|
199 |
+
/**/
|
200 |
+
echo '<table class="form-table ws-plugin--s2member-mms-registration-wp-signup ws-plugin--s2member-mms-registration-wp-signup-blogs-level0">' . "\n";
|
201 |
+
echo '<tbody>' . "\n";
|
202 |
+
echo '<tr>' . "\n";
|
203 |
+
/**/
|
204 |
+
echo '<th>' . "\n";
|
205 |
+
echo '<label for="ws-plugin--s2member-mms-registration-blogs-level0">' . "\n";
|
206 |
+
echo 'Level #0 ( Free Subscribers ):' . "\n";
|
207 |
+
echo '</label>' . "\n";
|
208 |
+
echo '</th>' . "\n";
|
209 |
+
/**/
|
210 |
+
echo '</tr>' . "\n";
|
211 |
+
echo '<tr>' . "\n";
|
212 |
+
/**/
|
213 |
+
echo '<td style="padding-bottom:0;">' . "\n";
|
214 |
+
echo '<input type="text" name="ws_plugin__s2member_mms_registration_blogs_level0" id="ws-plugin--s2member-mms-registration-blogs-level0" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level0"]) . '" /><br />' . "\n";
|
215 |
+
echo 'How many blogs can a Free Subscriber create?' . "\n";
|
216 |
+
echo '</td>' . "\n";
|
217 |
+
/**/
|
218 |
+
echo '</tr>' . "\n";
|
219 |
+
echo '</tbody>' . "\n";
|
220 |
+
echo '</table>' . "\n";
|
221 |
+
/**/
|
222 |
+
echo '<div class="ws-menu-page-hr ws-plugin--s2member-mms-registration-wp-signup"></div>' . "\n";
|
223 |
+
/**/
|
224 |
+
echo '<table class="form-table ws-plugin--s2member-mms-registration-wp-signup" style="margin:0;">' . "\n";
|
225 |
+
echo '<tbody>' . "\n";
|
226 |
+
echo '<tr>' . "\n";
|
227 |
+
/**/
|
228 |
+
echo '<th style="padding-top:0;">' . "\n";
|
229 |
+
echo '<label for="ws-plugin--s2member-mms-registration-blogs-level1">' . "\n";
|
230 |
+
echo 'Membership Level #1 / Maximum Blogs Allowed:' . "\n";
|
231 |
+
echo '</label>' . "\n";
|
232 |
+
echo '</th>' . "\n";
|
233 |
+
/**/
|
234 |
+
echo '</tr>' . "\n";
|
235 |
+
echo '<tr>' . "\n";
|
236 |
+
/**/
|
237 |
+
echo '<td>' . "\n";
|
238 |
+
echo '<input type="text" name="ws_plugin__s2member_mms_registration_blogs_level1" id="ws-plugin--s2member-mms-registration-blogs-level1" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level1"]) . '" /><br />' . "\n";
|
239 |
+
echo 'How many blogs can a Member ( at Level #1 ) create?' . "\n";
|
240 |
+
echo '</td>' . "\n";
|
241 |
+
/**/
|
242 |
+
echo '</tr>' . "\n";
|
243 |
+
echo '<tr>' . "\n";
|
244 |
+
/**/
|
245 |
+
echo '<th>' . "\n";
|
246 |
+
echo '<label for="ws-plugin--s2member-mms-registration-blogs-level2">' . "\n";
|
247 |
+
echo 'Membership Level #2 / Maximum Blogs Allowed:' . "\n";
|
248 |
+
echo '</label>' . "\n";
|
249 |
+
echo '</th>' . "\n";
|
250 |
+
/**/
|
251 |
+
echo '</tr>' . "\n";
|
252 |
+
echo '<tr>' . "\n";
|
253 |
+
/**/
|
254 |
+
echo '<td>' . "\n";
|
255 |
+
echo '<input type="text" name="ws_plugin__s2member_mms_registration_blogs_level2" id="ws-plugin--s2member-mms-registration-blogs-level2" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level2"]) . '" /><br />' . "\n";
|
256 |
+
echo 'How many blogs can a Member ( at Level #2 ) create?' . "\n";
|
257 |
+
echo '</td>' . "\n";
|
258 |
+
/**/
|
259 |
+
echo '</tr>' . "\n";
|
260 |
+
echo '<tr>' . "\n";
|
261 |
+
/**/
|
262 |
+
echo '<th>' . "\n";
|
263 |
+
echo '<label for="ws-plugin--s2member-mms-registration-blogs-level3">' . "\n";
|
264 |
+
echo 'Membership Level #3 / Maximum Blogs Allowed:' . "\n";
|
265 |
+
echo '</label>' . "\n";
|
266 |
+
echo '</th>' . "\n";
|
267 |
+
/**/
|
268 |
+
echo '</tr>' . "\n";
|
269 |
+
echo '<tr>' . "\n";
|
270 |
+
/**/
|
271 |
+
echo '<td>' . "\n";
|
272 |
+
echo '<input type="text" name="ws_plugin__s2member_mms_registration_blogs_level3" id="ws-plugin--s2member-mms-registration-blogs-level3" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level3"]) . '" /><br />' . "\n";
|
273 |
+
echo 'How many blogs can a Member ( at Level #3 ) create?' . "\n";
|
274 |
+
echo '</td>' . "\n";
|
275 |
+
/**/
|
276 |
+
echo '</tr>' . "\n";
|
277 |
+
echo '<tr>' . "\n";
|
278 |
+
/**/
|
279 |
+
echo '<th>' . "\n";
|
280 |
+
echo '<label for="ws-plugin--s2member-mms-registration-blogs-level4">' . "\n";
|
281 |
+
echo 'Membership Level #4 / Maximum Blogs Allowed:' . "\n";
|
282 |
+
echo '</label>' . "\n";
|
283 |
+
echo '</th>' . "\n";
|
284 |
+
/**/
|
285 |
+
echo '</tr>' . "\n";
|
286 |
+
echo '<tr>' . "\n";
|
287 |
+
/**/
|
288 |
+
echo '<td>' . "\n";
|
289 |
+
echo '<input type="text" name="ws_plugin__s2member_mms_registration_blogs_level4" id="ws-plugin--s2member-mms-registration-blogs-level4" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level4"]) . '" /><br />' . "\n";
|
290 |
+
echo 'How many blogs can a Member ( at Level #4 ) create?' . "\n";
|
291 |
+
echo '</td>' . "\n";
|
292 |
+
/**/
|
293 |
+
echo '</tr>' . "\n";
|
294 |
+
echo '</tbody>' . "\n";
|
295 |
+
echo '</table>' . "\n";
|
296 |
+
echo '</div>' . "\n";
|
297 |
+
/**/
|
298 |
+
echo '</div>' . "\n";
|
299 |
+
/**/
|
300 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_during_left_sections_after_mms_registration", get_defined_vars ());
|
301 |
+
}
|
302 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_after_left_sections", get_defined_vars ());
|
303 |
+
/**/
|
304 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
305 |
+
/**/
|
306 |
+
echo '<p class="submit"><input type="submit" class="button-primary" value="Save Changes" /></p>' . "\n";
|
307 |
+
/**/
|
308 |
+
echo '</form>' . "\n";
|
309 |
+
}
|
310 |
+
else /* Otherwise, we can display a simple notation; leading into Multisite Networking. */
|
311 |
+
{
|
312 |
+
echo '<p style="margin-top:0;"><span class="ws-menu-page-hilite">Your WordPress® installation does not have Multisite Networking enabled.<br />Which is perfectly OK :-) Multisite Networking is 100% completely optional.</span></p>' . "\n";
|
313 |
+
echo '<img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/large-icon.png" title="s2Member ( a Membership management system for WordPress® )" alt="" style="float:right; margin:0 0 0 25px; border:0;" />' . "\n";
|
314 |
+
/**/
|
315 |
+
if (file_exists ($ws_plugin__s2member_temp = dirname (dirname (dirname (__FILE__))) . "/ms.txt"))
|
316 |
+
{
|
317 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
318 |
+
/**/
|
319 |
+
if (!function_exists ("NC_Markdown"))
|
320 |
+
include_once dirname (dirname (__FILE__)) . "/markdown/nc-markdown.inc.php";
|
321 |
+
/**/
|
322 |
+
$ws_plugin__s2member_temp = file_get_contents ($ws_plugin__s2member_temp);
|
323 |
+
$ws_plugin__s2member_temp = preg_replace ("/(\=)( )(.+?)( )(\=)/", "<h3>$3</h3>", $ws_plugin__s2member_temp);
|
324 |
+
$ws_plugin__s2member_temp = NC_Markdown ($ws_plugin__s2member_temp);
|
325 |
+
/**/
|
326 |
+
echo preg_replace ("/(\<a)( href)/i", "$1" . ' target="_blank" rel="nofollow external"' . "$2", $ws_plugin__s2member_temp);
|
327 |
+
}
|
328 |
+
}
|
329 |
+
/**/
|
330 |
+
echo '</td>' . "\n";
|
331 |
+
/**/
|
332 |
+
echo '<td class="ws-menu-page-table-r">' . "\n";
|
333 |
+
/**/
|
334 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_before_right_sections", get_defined_vars ());
|
335 |
+
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
336 |
+
/**/
|
337 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
338 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
339 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
340 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
341 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["donations"]) ? '<div class="ws-menu-page-donations"><a href="' . ws_plugin__s2member_parse_readme_value ("Donate link") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-donations.jpg" alt="." /></a></div>' . "\n" : '';
|
342 |
+
/**/
|
343 |
+
do_action ("ws_plugin__s2member_during_menu_pages_after_right_sections", get_defined_vars ());
|
344 |
+
do_action ("ws_plugin__s2member_during_mms_options_page_after_right_sections", get_defined_vars ());
|
345 |
+
/**/
|
346 |
+
echo '</td>' . "\n";
|
347 |
+
/**/
|
348 |
+
echo '</tr>' . "\n";
|
349 |
+
echo '</tbody>' . "\n";
|
350 |
+
echo '</table>' . "\n";
|
351 |
+
/**/
|
352 |
+
echo '</div>' . "\n";
|
353 |
+
?>
|
includes/menu-pages/options.inc.php
CHANGED
@@ -41,6 +41,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
41 |
echo '<div class="ws-menu-page-group" title="Security Encryption Key">' . "\n";
|
42 |
/**/
|
43 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-security-section">' . "\n";
|
|
|
44 |
echo '<h3>Security Encryption Key ( optional, for tighter security )</h3>' . "\n";
|
45 |
echo '<p>Just like WordPress®, s2Member is open-source software. Which is wonderful. However, this also makes it possible for anyone to grab a copy of the software, and try to learn their way around its security measures. In order to keep your installation of s2Member unique/secure, you should configure a Security Encryption Key. s2Member will use your Security Encryption Key to protect itself against hackers. It does this by encrypting all sensitive information with your Key. A Security Encryption Key is unique to your installation.</p>' . "\n";
|
46 |
echo '<p>Once you configure this, you do NOT want to change it; not ever. In fact, it is a VERY good idea to keep this backed up in a safe place, just in case you need to move your site, or re-install s2Member in the future. Some of the sensitive data that s2Member stores, will be encrypted with this Key. If you change it, that data can no longer be read, even by s2Member itself. In other words, don\'t use s2Member for six months, then decide to change your Key. That would break your installation. You configure this once, for each installation of s2Member; and you NEVER change it.</p>' . "\n";
|
@@ -131,6 +132,156 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
131 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_email_config", get_defined_vars ());
|
132 |
}
|
133 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_login_registration", true, get_defined_vars ()))
|
135 |
{
|
136 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_login_registration", get_defined_vars ());
|
@@ -139,7 +290,8 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
139 |
/**/
|
140 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-login-registration-section">' . "\n";
|
141 |
echo '<h3>Login/Registration Page Customization ( required )</h3>' . "\n";
|
142 |
-
echo '<p>These settings allow you to customize the user interface for your Login / Registration Pages:<br />( <a href="' . wp_login_url () . '" target="_blank" rel="external">' . esc_html (wp_login_url ()) . '</a> )</p>' . "\n";
|
|
|
143 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_login_registration", get_defined_vars ());
|
144 |
/**/
|
145 |
echo '<table class="form-table">' . "\n";
|
@@ -173,7 +325,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
173 |
/**/
|
174 |
echo '<th>' . "\n";
|
175 |
echo '<label for="ws-plugin--s2member-login-reg-background-image">' . "\n";
|
176 |
-
echo '
|
177 |
echo '</label>' . "\n";
|
178 |
echo '</th>' . "\n";
|
179 |
/**/
|
@@ -191,6 +343,28 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
191 |
echo '<tr>' . "\n";
|
192 |
/**/
|
193 |
echo '<th>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
echo '<label for="ws-plugin--s2member-login-reg-background-text-color">' . "\n";
|
195 |
echo 'Color of Text on top of your Background:' . "\n";
|
196 |
echo '</label>' . "\n";
|
@@ -352,9 +526,10 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
352 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-reg-fields-section">' . "\n";
|
353 |
echo '<h3>Custom Registration Fields ( optional, for further customization )</h3>' . "\n";
|
354 |
/**/
|
355 |
-
echo '<p>This allows you to customize the Fields in your Registration Form:<br />( <a href="' . add_query_arg ("action", "register", wp_login_url ()) . '" target="_blank" rel="external">' . esc_html (add_query_arg ("action", "register", wp_login_url ())) . '</a> )</p>' . "\n";
|
|
|
356 |
/**/
|
357 |
-
echo '<p>This is a comma delimited list of additional form fields to collect during registration. By default, all of your Custom Fields will remain optional to the User. That is, the User will NOT be required to enter any of these values. If you want specific fields to be *required*, wrap those Custom Fields inside *asterisks*. Some fields are already built-in by default. The defaults are: <code>*Username*, *Email*, *First Name*, *Last Name*</code>. If you need to add other Custom Fields, in addition to these defaults, you can do that here.</p>' . "\n";
|
358 |
/**/
|
359 |
if (defined ("BP_VERSION"))
|
360 |
echo '<p><em class="ws-menu-page-hilite">* With BuddyPress installed, Custom Registration Fields are NOT applicable. BuddyPress themes usually come with their own Registration Form ( i.e. BuddyPress redirects you away from the default Registration Form, over to a special <code>/register</code> page ); BuddyPress also has its own Profile Field Configuration Tool, under <code>BuddyPress -> Profile Field Setup</code>. When BuddyPress is installed, the use of s2Member\'s Custom Fields is not advised; that is... UNLESS you\'re using the s2Member Pro Module. With the s2Member Pro Module, Custom Fields <strong>will</strong> be included in all PayPal® Pro Forms, including even Free Registration Forms generated by the s2Member Pro Module.</em></p>' . "\n";
|
@@ -362,6 +537,9 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
362 |
if (!function_exists ("ws_plugin__s2member_generate_password"))
|
363 |
echo '<p><em class="ws-menu-page-error">* Custom Passwords CANNOT be used with your installation of s2Member. This is due to a minor conflict with another plugin that is using <code>wp_generate_password()</code>. If you really want to allow Custom Passwords during registration, please disable some of your other plugins until this warning goes away.</em></p>' . "\n";
|
364 |
/**/
|
|
|
|
|
|
|
365 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_custom_reg_fields", get_defined_vars ());
|
366 |
/**/
|
367 |
echo '<table class="form-table">' . "\n";
|
@@ -379,7 +557,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
379 |
/**/
|
380 |
echo '<td>' . "\n";
|
381 |
echo '<input type="text" name="ws_plugin__s2member_custom_reg_fields" id="ws-plugin--s2member-custom-reg-fields" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) . '" /><br />' . "\n";
|
382 |
-
echo 'Comma delimited please. <em>Ex
|
383 |
echo '</td>' . "\n";
|
384 |
/**/
|
385 |
echo '</tr>' . "\n";
|
@@ -395,7 +573,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
395 |
echo '<tr>' . "\n";
|
396 |
/**/
|
397 |
echo '<td>' . "\n";
|
398 |
-
echo '<select name="ws_plugin__s2member_custom_reg_password" id="ws-plugin--s2member-custom-reg-password">' . "\n";
|
399 |
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";
|
400 |
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";
|
401 |
echo '</select><br />' . "\n";
|
@@ -443,7 +621,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
443 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && $ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) ? ' selected="selected"' : '') . '>' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
444 |
echo '</select><br />' . "\n";
|
445 |
echo 'Please choose a Page to be used as the first page Members will see after logging in. This Page can contain anything you like. We recommend the following title: <code>Welcome To Our Members Area</code>.<br /><br />' . "\n";
|
446 |
-
echo '↓ Or, you may configure a Special Redirection URL, if you prefer. You\'ll need to type in the full URL, starting with: <code>http://</code>. <em>A few <a href="#" onclick="alert(\'Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n\\nFor example, if you\\\'re using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: ' . get_bloginfo ("
|
447 |
echo '<input type="text" name="ws_plugin__s2member_login_redirection_override" id="ws-plugin--s2member-login-redirection-override" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) . '" /><br />' . "\n";
|
448 |
echo '</td>' . "\n";
|
449 |
/**/
|
@@ -465,7 +643,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
465 |
/**/
|
466 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-membership-options-page-section">' . "\n";
|
467 |
echo '<h3>Membership Options Page ( required, please customize this )</h3>' . "\n";
|
468 |
-
echo '<p>Please create and/or choose an existing Page that showcases your
|
469 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_membership_options_page", get_defined_vars ());
|
470 |
/**/
|
471 |
echo '<table class="form-table">' . "\n";
|
@@ -487,7 +665,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
487 |
foreach (($ws_plugin__s2member_temp_a = array_merge ((array)get_pages ())) as $ws_plugin__s2member_temp_o)
|
488 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '"' . (($ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]) ? ' selected="selected"' : '') . '>' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
489 |
echo '</select><br />' . "\n";
|
490 |
-
echo 'Please choose a Page that provides Users a way to signup for
|
491 |
echo '</td>' . "\n";
|
492 |
/**/
|
493 |
echo '</tr>' . "\n";
|
@@ -500,156 +678,6 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
500 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_membership_options_page", get_defined_vars ());
|
501 |
}
|
502 |
/**/
|
503 |
-
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_free_subscribers", true, get_defined_vars ()))
|
504 |
-
{
|
505 |
-
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_free_subscribers", get_defined_vars ());
|
506 |
-
/**/
|
507 |
-
echo '<div class="ws-menu-page-group" title="Open Registration / Free Subscribers">' . "\n";
|
508 |
-
/**/
|
509 |
-
echo '<div class="ws-menu-page-section ws-plugin--s2member-free-subscribers-section">' . "\n";
|
510 |
-
echo '<h3>Open Registration / Free Subscribers ( optional )</h3>' . "\n";
|
511 |
-
echo '<p>s2Member supports Free Subscribers ( at Level #0 ), along with four Primary Levels [1-4] of paid membership. If you want visitors to be capable of registering absolutely free, you will want to "allow" Open Registration. Whenever a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0.</p>' . "\n";
|
512 |
-
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_free_subscribers", get_defined_vars ());
|
513 |
-
/**/
|
514 |
-
echo '<table class="form-table">' . "\n";
|
515 |
-
echo '<tbody>' . "\n";
|
516 |
-
echo '<tr>' . "\n";
|
517 |
-
/**/
|
518 |
-
echo '<th>' . "\n";
|
519 |
-
echo '<label for="ws-plugin--s2member-allow-subscribers-in">' . "\n";
|
520 |
-
echo 'Allow Open Registration? ( Free Subscribers )' . "\n";
|
521 |
-
echo '</label>' . "\n";
|
522 |
-
echo '</th>' . "\n";
|
523 |
-
/**/
|
524 |
-
echo '</tr>' . "\n";
|
525 |
-
echo '<tr>' . "\n";
|
526 |
-
/**/
|
527 |
-
echo '<td>' . "\n";
|
528 |
-
echo '<select name="ws_plugin__s2member_allow_subscribers_in" id="ws-plugin--s2member-allow-subscribers-in">' . "\n";
|
529 |
-
echo '<option value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"]) ? ' selected="selected"' : '') . '>No ( do NOT allow Open Registration )</option>' . "\n";
|
530 |
-
echo '<option value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"]) ? ' selected="selected"' : '') . '>Yes ( allow Open Registration; Free Subscribers at Level #0 )</option>' . "\n";
|
531 |
-
echo '</select><br />' . "\n";
|
532 |
-
echo 'If you set this to <code>Yes</code>, you\'re unlocking <a href="' . add_query_arg ("action", "register", wp_login_url ()) . '" target="_blank" rel="external">registration</a>. When a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0. The s2Member software reserves Level #0; to be used ONLY used for Free Subscribers. All other Membership Levels [1-4] require payment. Starting with s2Member v3.0.5+, you can set Post, Page, Tag, Category, and even URI restrictions for Level #0 as well. So this is a very powerful new feature.' . "\n";
|
533 |
-
echo '</td>' . "\n";
|
534 |
-
/**/
|
535 |
-
echo '</tr>' . "\n";
|
536 |
-
echo '</tbody>' . "\n";
|
537 |
-
echo '</table>' . "\n";
|
538 |
-
echo '</div>' . "\n";
|
539 |
-
/**/
|
540 |
-
echo '</div>' . "\n";
|
541 |
-
/**/
|
542 |
-
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_free_subscribers", get_defined_vars ());
|
543 |
-
}
|
544 |
-
/**/
|
545 |
-
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_membership_levels", true, get_defined_vars ()))
|
546 |
-
{
|
547 |
-
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_membership_levels", get_defined_vars ());
|
548 |
-
/**/
|
549 |
-
echo '<div class="ws-menu-page-group" title="Membership Levels/Labels">' . "\n";
|
550 |
-
/**/
|
551 |
-
echo '<div class="ws-menu-page-section ws-plugin--s2member-membership-levels-section">' . "\n";
|
552 |
-
echo '<h3>Membership Levels ( required, please customize these )</h3>' . "\n";
|
553 |
-
echo '<p>The default Membership Levels are labeled generically; feel free to modify them as needed. s2Member supports Free Subscribers ( at Level #0 ), along with four Primary Levels [1-4] of paid membership; plus unlimited Custom Capability packages. That being said, you don\'t have to use all of the Membership Levels if you don\'t want to. To use only 1 or 2 of these Levels, just create and/or modify your Membership Options Page, so that it only includes PayPal® Subscription Buttons for the Levels you wish to use.</p>' . "\n";
|
554 |
-
echo '<p><em>Support for Custom Capabilities is available. If you\'re an advanced site owner, a theme designer, or a web developer integrating s2Member for a client, please see: <code>s2Member -> API Scripting -> Custom Capabilities</code></em></p>' . "\n";
|
555 |
-
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_membership_levels", get_defined_vars ());
|
556 |
-
/**/
|
557 |
-
echo '<table class="form-table">' . "\n";
|
558 |
-
echo '<tbody>' . "\n";
|
559 |
-
echo '<tr>' . "\n";
|
560 |
-
/**/
|
561 |
-
echo '<th>' . "\n";
|
562 |
-
echo '<label for="ws-plugin--s2member-level0-label">' . "\n";
|
563 |
-
echo 'Level #0 ( Free Subscribers ):' . "\n";
|
564 |
-
echo '</label>' . "\n";
|
565 |
-
echo '</th>' . "\n";
|
566 |
-
/**/
|
567 |
-
echo '</tr>' . "\n";
|
568 |
-
echo '<tr>' . "\n";
|
569 |
-
/**/
|
570 |
-
echo '<td>' . "\n";
|
571 |
-
echo '<input type="text" name="ws_plugin__s2member_level0_label" id="ws-plugin--s2member-level0-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]) . '" /><br />' . "\n";
|
572 |
-
echo 'This is the Label for Level 0 ( reserved for Free Subscribers ).<br />' . "\n";
|
573 |
-
echo '</td>' . "\n";
|
574 |
-
/**/
|
575 |
-
echo '</tr>' . "\n";
|
576 |
-
echo '<tr>' . "\n";
|
577 |
-
/**/
|
578 |
-
echo '<th>' . "\n";
|
579 |
-
echo '<label for="ws-plugin--s2member-level1-label">' . "\n";
|
580 |
-
echo 'Membership Level #1 Label:' . "\n";
|
581 |
-
echo '</label>' . "\n";
|
582 |
-
echo '</th>' . "\n";
|
583 |
-
/**/
|
584 |
-
echo '</tr>' . "\n";
|
585 |
-
echo '<tr>' . "\n";
|
586 |
-
/**/
|
587 |
-
echo '<td>' . "\n";
|
588 |
-
echo '<input type="text" name="ws_plugin__s2member_level1_label" id="ws-plugin--s2member-level1-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]) . '" /><br />' . "\n";
|
589 |
-
echo 'This is the Label for Membership Level 1.<br />' . "\n";
|
590 |
-
echo '</td>' . "\n";
|
591 |
-
/**/
|
592 |
-
echo '</tr>' . "\n";
|
593 |
-
echo '<tr>' . "\n";
|
594 |
-
/**/
|
595 |
-
echo '<th>' . "\n";
|
596 |
-
echo '<label for="ws-plugin--s2member-level2-label">' . "\n";
|
597 |
-
echo 'Membership Level #2 Label:' . "\n";
|
598 |
-
echo '</label>' . "\n";
|
599 |
-
echo '</th>' . "\n";
|
600 |
-
/**/
|
601 |
-
echo '</tr>' . "\n";
|
602 |
-
echo '<tr>' . "\n";
|
603 |
-
/**/
|
604 |
-
echo '<td>' . "\n";
|
605 |
-
echo '<input type="text" name="ws_plugin__s2member_level2_label" id="ws-plugin--s2member-level2-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]) . '" /><br />' . "\n";
|
606 |
-
echo 'This is the Label for Membership Level 2.<br />' . "\n";
|
607 |
-
echo '</td>' . "\n";
|
608 |
-
/**/
|
609 |
-
echo '</tr>' . "\n";
|
610 |
-
echo '<tr>' . "\n";
|
611 |
-
/**/
|
612 |
-
echo '<th>' . "\n";
|
613 |
-
echo '<label for="ws-plugin--s2member-level3-label">' . "\n";
|
614 |
-
echo 'Membership Level #3 Label:' . "\n";
|
615 |
-
echo '</label>' . "\n";
|
616 |
-
echo '</th>' . "\n";
|
617 |
-
/**/
|
618 |
-
echo '</tr>' . "\n";
|
619 |
-
echo '<tr>' . "\n";
|
620 |
-
/**/
|
621 |
-
echo '<td>' . "\n";
|
622 |
-
echo '<input type="text" name="ws_plugin__s2member_level3_label" id="ws-plugin--s2member-level3-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]) . '" /><br />' . "\n";
|
623 |
-
echo 'This is the Label for Membership Level 3.<br />' . "\n";
|
624 |
-
echo '</td>' . "\n";
|
625 |
-
/**/
|
626 |
-
echo '</tr>' . "\n";
|
627 |
-
echo '<tr>' . "\n";
|
628 |
-
/**/
|
629 |
-
echo '<th>' . "\n";
|
630 |
-
echo '<label for="ws-plugin--s2member-level4-label">' . "\n";
|
631 |
-
echo 'Membership Level #4 Label:' . "\n";
|
632 |
-
echo '</label>' . "\n";
|
633 |
-
echo '</th>' . "\n";
|
634 |
-
/**/
|
635 |
-
echo '</tr>' . "\n";
|
636 |
-
echo '<tr>' . "\n";
|
637 |
-
/**/
|
638 |
-
echo '<td>' . "\n";
|
639 |
-
echo '<input type="text" name="ws_plugin__s2member_level4_label" id="ws-plugin--s2member-level4-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]) . '" /><br />' . "\n";
|
640 |
-
echo 'This is the Label for Membership Level 4.<br />' . "\n";
|
641 |
-
echo '</td>' . "\n";
|
642 |
-
/**/
|
643 |
-
echo '</tr>' . "\n";
|
644 |
-
echo '</tbody>' . "\n";
|
645 |
-
echo '</table>' . "\n";
|
646 |
-
echo '</div>' . "\n";
|
647 |
-
/**/
|
648 |
-
echo '</div>' . "\n";
|
649 |
-
/**/
|
650 |
-
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_membership_levels", get_defined_vars ());
|
651 |
-
}
|
652 |
-
/**/
|
653 |
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_post_level_access", true, get_defined_vars ()))
|
654 |
{
|
655 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_post_level_access", get_defined_vars ());
|
@@ -659,7 +687,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
659 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-post-level-access-section">' . "\n";
|
660 |
echo '<h3>Post Level Access Restrictions ( optional )</h3>' . "\n";
|
661 |
echo '<p>Here you can specify Posts that are restricted to certain Membership Access Levels. These fields also support Custom Post Types, which were first introduced in WordPress® 3.0. If you have a theme/plugin installed that has enabled Custom Post Types ( i.e. Music/Videos/etc ), you can put the IDs for those Posts here.</p>' . "\n";
|
662 |
-
echo (!$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Post IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
|
663 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_post_level_access", get_defined_vars ());
|
664 |
/**/
|
665 |
echo '<table class="form-table">' . "\n";
|
@@ -767,7 +795,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
767 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-page-level-access-section">' . "\n";
|
768 |
echo '<h3>Page Level Access Restrictions ( optional )</h3>' . "\n";
|
769 |
echo '<p>Here you can specify Pages that are restricted to certain Membership Access Levels.</p>' . "\n";
|
770 |
-
echo (!$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Page IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
|
771 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_page_level_access", get_defined_vars ());
|
772 |
/**/
|
773 |
echo '<table class="form-table">' . "\n";
|
@@ -982,7 +1010,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
982 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-category-level-access-section">' . "\n";
|
983 |
echo '<h3>Category Level Access Restrictions ( optional )</h3>' . "\n";
|
984 |
echo '<p>Here you can specify Categories that are restricted to certain Membership Access Levels. Category restrictions are a bit more complex. When you restrict access to a Category, it also restricts access to any child Categories it may have ( aka: sub-Categories ). In other words, restricting a Category protects that Category Archive, all of its child Category Archives, and any Posts contained within the Category, or its child Categories.</p>' . "\n";
|
985 |
-
echo (!$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Category IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
|
986 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_category_level_access", get_defined_vars ());
|
987 |
/**/
|
988 |
echo '<table class="form-table">' . "\n";
|
@@ -1090,7 +1118,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
1090 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-uri-level-access-section">' . "\n";
|
1091 |
echo '<h3>URI Level Access Restrictions ( optional )</h3>' . "\n";
|
1092 |
echo '<p>Here you can specify URIs ( or word fragments found in URIs ) that are restricted to certain Membership Access Levels. Control over URIs is a little more complex. This section is intended for advanced webmasters only. That being said, here are the basics... A REQUEST_URI, is the portion of the URL that comes after the domain. This is a URL <code>http://www.example.com/path/to/file.php</code>, and this is the URI: <code>/path/to/file.php</code>.</p>' . "\n";
|
1093 |
-
echo '<p>In the fields below, you can provide a list ( one per line ) of URIs on your site that should be off-limits based on Membership Level. You can also use word fragments instead of a full URI. If a word fragment is found anywhere in the URI, it will be protected. Wildcards and other regex patterns are not supported here, and therefore you don\'t need to escape special characters or anything. Please note, these ARE caSe sensitive. You must be specific with respect to case sensitivity. The word fragment <code>some-path/</code> would NOT match a URI that contains <code>some-Path/</code>. <em>A few <a href="#" onclick="alert(\'URI Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n\\nFor example, if you\\\'re using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: /members/%%current_user_login%%/groups
|
1094 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_uri_level_access", get_defined_vars ());
|
1095 |
/**/
|
1096 |
echo '<table class="form-table">' . "\n";
|
@@ -1201,7 +1229,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
1201 |
echo '<p>In other words, Customers will NOT need to login, just to receive access to the Specific Post/Page they purchased access to. s2Member will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link ( see: <code>s2Member -> PayPal® Options -> Specific Post/Page Email</code> ). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n";
|
1202 |
echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress®. A Specific Post/Page that is protected by s2Member, might contain a download link for your eBook, access to file & music downloads, access to additional support services, and the list goes on and on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress® Post/Page that you\'ve created.</p>' . "\n";
|
1203 |
echo '<p>Very simple. All you do is protect the Specific Post/Page IDs that are being sold on your site. Then, you can go to <code>s2Member -> PayPal® Buttons -> Specific Post/Page</code> to generate "Buy Now" Buttons that you can insert into your WordPress® Editor, and make available on your site. The Button Generator for s2Member, will even let you Package Additional Posts/Pages together into one transaction.</p>' . "\n";
|
1204 |
-
echo (!$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Post/Page IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
|
1205 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_sp_access", get_defined_vars ());
|
1206 |
/**/
|
1207 |
echo '<table class="form-table">' . "\n";
|
@@ -1240,7 +1268,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
1240 |
/**/
|
1241 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-ip-restrictions-section">' . "\n";
|
1242 |
echo '<h3>Unique IP Access Restrictions ( prevents username/link sharing )</h3>' . "\n";
|
1243 |
-
echo '<p>As with any
|
1244 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_ip_restrictions", get_defined_vars ());
|
1245 |
/**/
|
1246 |
echo '<table class="form-table">' . "\n";
|
@@ -1262,13 +1290,13 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
1262 |
echo '<option value="3"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 3) ? ' selected="selected"' : '') . '>Allow up to 3 different IPs per Customer</option>' . "\n";
|
1263 |
echo '<option value="4"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 4) ? ' selected="selected"' : '') . '>Allow up to 4 different IPs per Customer</option>' . "\n";
|
1264 |
echo '<option value="5"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 5) ? ' selected="selected"' : '') . '>Allow up to 5 different IPs per Customer</option>' . "\n";
|
1265 |
-
echo '<option value="10"' . ((
|
1266 |
-
echo '<option value="20"' . ((
|
1267 |
-
echo '<option value="30"' . ((
|
1268 |
-
echo '<option value="40"' . ((
|
1269 |
-
echo '<option value="50"' . ((
|
1270 |
-
echo '<option value="75"' . ((
|
1271 |
-
echo '<option value="100"' . ((
|
1272 |
echo '</select><br />' . "\n";
|
1273 |
echo '</td>' . "\n";
|
1274 |
/**/
|
@@ -1321,24 +1349,24 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
1321 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-profile-modifications-section">' . "\n";
|
1322 |
echo '<h3>Giving Members The Ability To Modify Their Profile</h3>' . "\n";
|
1323 |
echo '<p>s2Member can be configured to redirect Members away from the <a href="profile.php" target="_blank" rel="external">default Profile Editing Panel</a> that is built into WordPress®. When/if a Member attempts to access the default Profile Editing Panel, they\'ll instead, be redirected to the Login Welcome Page that you\'ve configured through s2Member. <strong>Why would I redirect?</strong> Unless you\'ve made some drastic modifications to your WordPress® installation, the default Profile Editing Panel that ships with WordPress®, is NOT really suited for public access, even by a Member.</p>' . "\n";
|
1324 |
-
echo '<p>So instead of using this default Profile Editing Panel; s2Member creates an added layer of functionality, on top of WordPress®. It does this by providing you ( as the site owner ), with the ability to send your Members to a <a href="' . get_bloginfo ("
|
1325 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_profile_modifications", get_defined_vars ());
|
1326 |
/**/
|
1327 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
1328 |
/**/
|
1329 |
echo '<p>Stand-Alone page where Members can modify their Profile:<br />' . "\n";
|
1330 |
-
echo '<code><a href="' . get_bloginfo ("
|
1331 |
/**/
|
1332 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
1333 |
/**/
|
1334 |
echo '<p><strong>Code Sample #1</strong> ( standard link tag ):</p>' . "\n";
|
1335 |
-
echo '<p>' . highlight_string (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("
|
1336 |
/**/
|
1337 |
echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
|
1338 |
-
echo '<p>' . highlight_string (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("
|
1339 |
/**/
|
1340 |
echo '<p><strong>Code Sample #3</strong> ( embed the form into a Post/Page using an IFRAME tag ):</p>' . "\n";
|
1341 |
-
echo '<p>' . highlight_string (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("
|
1342 |
echo '<table class="form-table">' . "\n";
|
1343 |
echo '<tbody>' . "\n";
|
1344 |
echo '<tr>' . "\n";
|
@@ -1371,7 +1399,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
1371 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_profile_modifications", get_defined_vars ());
|
1372 |
}
|
1373 |
/**/
|
1374 |
-
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_deactivation",
|
1375 |
{
|
1376 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_deactivation", get_defined_vars ());
|
1377 |
/**/
|
@@ -1379,7 +1407,7 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
|
|
1379 |
/**/
|
1380 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-deactivation-section">' . "\n";
|
1381 |
echo '<h3>Deactivation Safeguards ( optional, recommended )</h3>' . "\n";
|
1382 |
-
echo '<p>By default, s2Member will cleanup ( erase ) all of it\'s Roles, Capabilities, and your Configuration Options when/if you deactivate it from the Plugins Menu in WordPress®. If you would like to Safeguard all of this information, in case s2Member is deactivated inadvertently, please choose Yes ( safeguard all s2Member data/options ).</p>' . "\n";
|
1383 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_deactivation", get_defined_vars ());
|
1384 |
/**/
|
1385 |
echo '<table class="form-table">' . "\n";
|
@@ -1428,7 +1456,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
1428 |
do_action ("ws_plugin__s2member_during_options_page_before_right_sections", get_defined_vars ());
|
1429 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
1430 |
/**/
|
1431 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
1432 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
1433 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
1434 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
41 |
echo '<div class="ws-menu-page-group" title="Security Encryption Key">' . "\n";
|
42 |
/**/
|
43 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-security-section">' . "\n";
|
44 |
+
echo '<img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/large-icon.png" title="s2Member ( a Membership management system for WordPress® )" alt="" style="float:right; margin:0 0 0 25px; border:0;" />' . "\n";
|
45 |
echo '<h3>Security Encryption Key ( optional, for tighter security )</h3>' . "\n";
|
46 |
echo '<p>Just like WordPress®, s2Member is open-source software. Which is wonderful. However, this also makes it possible for anyone to grab a copy of the software, and try to learn their way around its security measures. In order to keep your installation of s2Member unique/secure, you should configure a Security Encryption Key. s2Member will use your Security Encryption Key to protect itself against hackers. It does this by encrypting all sensitive information with your Key. A Security Encryption Key is unique to your installation.</p>' . "\n";
|
47 |
echo '<p>Once you configure this, you do NOT want to change it; not ever. In fact, it is a VERY good idea to keep this backed up in a safe place, just in case you need to move your site, or re-install s2Member in the future. Some of the sensitive data that s2Member stores, will be encrypted with this Key. If you change it, that data can no longer be read, even by s2Member itself. In other words, don\'t use s2Member for six months, then decide to change your Key. That would break your installation. You configure this once, for each installation of s2Member; and you NEVER change it.</p>' . "\n";
|
132 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_email_config", get_defined_vars ());
|
133 |
}
|
134 |
/**/
|
135 |
+
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_open_registration", (!is_multisite () || !is_main_site ()), get_defined_vars ()))
|
136 |
+
{
|
137 |
+
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_open_registration", get_defined_vars ());
|
138 |
+
/**/
|
139 |
+
echo '<div class="ws-menu-page-group" title="Open Registration / Free Subscribers">' . "\n";
|
140 |
+
/**/
|
141 |
+
echo '<div class="ws-menu-page-section ws-plugin--s2member-open-registration-section">' . "\n";
|
142 |
+
echo '<h3>Open Registration / Free Subscribers ( optional )</h3>' . "\n";
|
143 |
+
echo '<p>s2Member supports Free Subscribers ( at Level #0 ), along with four Primary Levels [1-4] of paid Membership. If you want your visitors to be capable of registering absolutely free, you will want to "allow" Open Registration. Whenever a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0.</p>' . "\n";
|
144 |
+
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_open_registration", get_defined_vars ());
|
145 |
+
/**/
|
146 |
+
echo '<table class="form-table">' . "\n";
|
147 |
+
echo '<tbody>' . "\n";
|
148 |
+
echo '<tr>' . "\n";
|
149 |
+
/**/
|
150 |
+
echo '<th>' . "\n";
|
151 |
+
echo '<label for="ws-plugin--s2member-allow-subscribers-in">' . "\n";
|
152 |
+
echo 'Allow Open Registration? ( Free Subscribers )' . "\n";
|
153 |
+
echo '</label>' . "\n";
|
154 |
+
echo '</th>' . "\n";
|
155 |
+
/**/
|
156 |
+
echo '</tr>' . "\n";
|
157 |
+
echo '<tr>' . "\n";
|
158 |
+
/**/
|
159 |
+
echo '<td>' . "\n";
|
160 |
+
echo '<select name="ws_plugin__s2member_allow_subscribers_in" id="ws-plugin--s2member-allow-subscribers-in">' . "\n";
|
161 |
+
echo '<option value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"]) ? ' selected="selected"' : '') . '>No ( do NOT allow Open Registration )</option>' . "\n";
|
162 |
+
echo '<option value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"]) ? ' selected="selected"' : '') . '>Yes ( allow Open Registration; Free Subscribers at Level #0 )</option>' . "\n";
|
163 |
+
echo '</select><br />' . "\n";
|
164 |
+
echo 'If you set this to <code>Yes</code>, you\'re unlocking <a href="' . add_query_arg ("action", "register", wp_login_url ()) . '" target="_blank" rel="external">wp-login.php?action=register</a>. When a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0. The s2Member software reserves Level #0; to be used ONLY for Free Subscribers. All other Membership Levels [1-4] require payment.' . "\n";
|
165 |
+
echo '</td>' . "\n";
|
166 |
+
/**/
|
167 |
+
echo '</tr>' . "\n";
|
168 |
+
echo '</tbody>' . "\n";
|
169 |
+
echo '</table>' . "\n";
|
170 |
+
echo '</div>' . "\n";
|
171 |
+
/**/
|
172 |
+
echo '</div>' . "\n";
|
173 |
+
/**/
|
174 |
+
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_open_registration", get_defined_vars ());
|
175 |
+
}
|
176 |
+
/**/
|
177 |
+
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_membership_levels", true, get_defined_vars ()))
|
178 |
+
{
|
179 |
+
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_membership_levels", get_defined_vars ());
|
180 |
+
/**/
|
181 |
+
echo '<div class="ws-menu-page-group" title="Membership Levels/Labels">' . "\n";
|
182 |
+
/**/
|
183 |
+
echo '<div class="ws-menu-page-section ws-plugin--s2member-membership-levels-section">' . "\n";
|
184 |
+
echo '<h3>Membership Levels ( required, please customize these )</h3>' . "\n";
|
185 |
+
echo '<p>The default Membership Levels are labeled generically; feel free to modify them as needed. s2Member supports Free Subscribers ( at Level #0 ), along with four Primary Levels [1-4] of paid Membership; plus unlimited Custom Capability packages. That being said, you don\'t have to use all of the Membership Levels if you don\'t want to. To use only 1 or 2 of these Levels, just create and/or modify your Membership Options Page, so that it only includes PayPal® Subscription Buttons for the Levels you wish to use.</p>' . "\n";
|
186 |
+
echo (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()) ? '<p><em>Support for Custom Capabilities is available. If you\'re an advanced site owner, a theme designer, or a web developer integrating s2Member for a client, please see: <code>s2Member -> API Scripting -> Custom Capabilities</code></em></p>' . "\n" : '';
|
187 |
+
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_membership_levels", get_defined_vars ());
|
188 |
+
/**/
|
189 |
+
echo '<table class="form-table">' . "\n";
|
190 |
+
echo '<tbody>' . "\n";
|
191 |
+
echo '<tr>' . "\n";
|
192 |
+
/**/
|
193 |
+
echo '<th>' . "\n";
|
194 |
+
echo '<label for="ws-plugin--s2member-level0-label">' . "\n";
|
195 |
+
echo 'Level #0 ( Free Subscribers ):' . "\n";
|
196 |
+
echo '</label>' . "\n";
|
197 |
+
echo '</th>' . "\n";
|
198 |
+
/**/
|
199 |
+
echo '</tr>' . "\n";
|
200 |
+
echo '<tr>' . "\n";
|
201 |
+
/**/
|
202 |
+
echo '<td>' . "\n";
|
203 |
+
echo '<input type="text" name="ws_plugin__s2member_level0_label" id="ws-plugin--s2member-level0-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]) . '" /><br />' . "\n";
|
204 |
+
echo 'This is the Label for Level 0 ( reserved for Free Subscribers ).<br />' . "\n";
|
205 |
+
echo '</td>' . "\n";
|
206 |
+
/**/
|
207 |
+
echo '</tr>' . "\n";
|
208 |
+
echo '<tr>' . "\n";
|
209 |
+
/**/
|
210 |
+
echo '<th>' . "\n";
|
211 |
+
echo '<label for="ws-plugin--s2member-level1-label">' . "\n";
|
212 |
+
echo 'Membership Level #1 Label:' . "\n";
|
213 |
+
echo '</label>' . "\n";
|
214 |
+
echo '</th>' . "\n";
|
215 |
+
/**/
|
216 |
+
echo '</tr>' . "\n";
|
217 |
+
echo '<tr>' . "\n";
|
218 |
+
/**/
|
219 |
+
echo '<td>' . "\n";
|
220 |
+
echo '<input type="text" name="ws_plugin__s2member_level1_label" id="ws-plugin--s2member-level1-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]) . '" /><br />' . "\n";
|
221 |
+
echo 'This is the Label for Membership Level 1.<br />' . "\n";
|
222 |
+
echo '</td>' . "\n";
|
223 |
+
/**/
|
224 |
+
echo '</tr>' . "\n";
|
225 |
+
echo '<tr>' . "\n";
|
226 |
+
/**/
|
227 |
+
echo '<th>' . "\n";
|
228 |
+
echo '<label for="ws-plugin--s2member-level2-label">' . "\n";
|
229 |
+
echo 'Membership Level #2 Label:' . "\n";
|
230 |
+
echo '</label>' . "\n";
|
231 |
+
echo '</th>' . "\n";
|
232 |
+
/**/
|
233 |
+
echo '</tr>' . "\n";
|
234 |
+
echo '<tr>' . "\n";
|
235 |
+
/**/
|
236 |
+
echo '<td>' . "\n";
|
237 |
+
echo '<input type="text" name="ws_plugin__s2member_level2_label" id="ws-plugin--s2member-level2-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]) . '" /><br />' . "\n";
|
238 |
+
echo 'This is the Label for Membership Level 2.<br />' . "\n";
|
239 |
+
echo '</td>' . "\n";
|
240 |
+
/**/
|
241 |
+
echo '</tr>' . "\n";
|
242 |
+
echo '<tr>' . "\n";
|
243 |
+
/**/
|
244 |
+
echo '<th>' . "\n";
|
245 |
+
echo '<label for="ws-plugin--s2member-level3-label">' . "\n";
|
246 |
+
echo 'Membership Level #3 Label:' . "\n";
|
247 |
+
echo '</label>' . "\n";
|
248 |
+
echo '</th>' . "\n";
|
249 |
+
/**/
|
250 |
+
echo '</tr>' . "\n";
|
251 |
+
echo '<tr>' . "\n";
|
252 |
+
/**/
|
253 |
+
echo '<td>' . "\n";
|
254 |
+
echo '<input type="text" name="ws_plugin__s2member_level3_label" id="ws-plugin--s2member-level3-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]) . '" /><br />' . "\n";
|
255 |
+
echo 'This is the Label for Membership Level 3.<br />' . "\n";
|
256 |
+
echo '</td>' . "\n";
|
257 |
+
/**/
|
258 |
+
echo '</tr>' . "\n";
|
259 |
+
echo '<tr>' . "\n";
|
260 |
+
/**/
|
261 |
+
echo '<th>' . "\n";
|
262 |
+
echo '<label for="ws-plugin--s2member-level4-label">' . "\n";
|
263 |
+
echo 'Membership Level #4 Label:' . "\n";
|
264 |
+
echo '</label>' . "\n";
|
265 |
+
echo '</th>' . "\n";
|
266 |
+
/**/
|
267 |
+
echo '</tr>' . "\n";
|
268 |
+
echo '<tr>' . "\n";
|
269 |
+
/**/
|
270 |
+
echo '<td>' . "\n";
|
271 |
+
echo '<input type="text" name="ws_plugin__s2member_level4_label" id="ws-plugin--s2member-level4-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]) . '" /><br />' . "\n";
|
272 |
+
echo 'This is the Label for Membership Level 4.<br />' . "\n";
|
273 |
+
echo '</td>' . "\n";
|
274 |
+
/**/
|
275 |
+
echo '</tr>' . "\n";
|
276 |
+
echo '</tbody>' . "\n";
|
277 |
+
echo '</table>' . "\n";
|
278 |
+
echo '</div>' . "\n";
|
279 |
+
/**/
|
280 |
+
echo '</div>' . "\n";
|
281 |
+
/**/
|
282 |
+
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_membership_levels", get_defined_vars ());
|
283 |
+
}
|
284 |
+
/**/
|
285 |
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_login_registration", true, get_defined_vars ()))
|
286 |
{
|
287 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_login_registration", get_defined_vars ());
|
290 |
/**/
|
291 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-login-registration-section">' . "\n";
|
292 |
echo '<h3>Login/Registration Page Customization ( required )</h3>' . "\n";
|
293 |
+
echo '<p>These settings allow you to customize the user interface for your Login / Registration Pages:<br />( <a href="' . add_query_arg ("action", "register", wp_login_url ()) . '" target="_blank" rel="external">' . esc_html (add_query_arg ("action", "register", wp_login_url ())) . '</a> )</p>' . "\n";
|
294 |
+
echo (is_multisite () && ws_plugin__s2member_is_multisite_farm () && is_main_site ()) ? '<p><em>A Multisite Blog Farm uses this Form instead, powered by your theme.<br />( <a href="' . apply_filters ("wp_signup_location", get_bloginfo ("wpurl") . "/wp-signup.php") . '" target="_blank" rel="external">' . esc_html (apply_filters ("wp_signup_location", get_bloginfo ("wpurl") . "/wp-signup.php")) . '</a> )</em></p>' . "\n" : '';
|
295 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_login_registration", get_defined_vars ());
|
296 |
/**/
|
297 |
echo '<table class="form-table">' . "\n";
|
325 |
/**/
|
326 |
echo '<th>' . "\n";
|
327 |
echo '<label for="ws-plugin--s2member-login-reg-background-image">' . "\n";
|
328 |
+
echo 'Background Image:' . "\n";
|
329 |
echo '</label>' . "\n";
|
330 |
echo '</th>' . "\n";
|
331 |
/**/
|
343 |
echo '<tr>' . "\n";
|
344 |
/**/
|
345 |
echo '<th>' . "\n";
|
346 |
+
echo '<label for="ws-plugin--s2member-login-reg-background-image-repeat">' . "\n";
|
347 |
+
echo 'Background Image Tile:' . "\n";
|
348 |
+
echo '</label>' . "\n";
|
349 |
+
echo '</th>' . "\n";
|
350 |
+
/**/
|
351 |
+
echo '</tr>' . "\n";
|
352 |
+
echo '<tr>' . "\n";
|
353 |
+
/**/
|
354 |
+
echo '<td>' . "\n";
|
355 |
+
echo '<select name="ws_plugin__s2member_login_reg_background_image_repeat" id="ws-plugin--s2member-login-reg-background-image-repeat">' . "\n";
|
356 |
+
echo '<option value="repeat"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] === "repeat") ? ' selected="selected"' : '') . '>Seamless Tile ( background-repeat: repeat; )</option>' . "\n";
|
357 |
+
echo '<option value="repeat-x"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] === "repeat-x") ? ' selected="selected"' : '') . '>Tile Horizontally ( background-repeat: repeat-x; )</option>' . "\n";
|
358 |
+
echo '<option value="repeat-y"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] === "repeat-y") ? ' selected="selected"' : '') . '>Tile Vertically ( background-repeat: repeat-y; )</option>' . "\n";
|
359 |
+
echo '<option value="no-repeat"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_image_repeat"] === "no-repeat") ? ' selected="selected"' : '') . '>No Tiles ( background-repeat: no-repeat; )</option>' . "\n";
|
360 |
+
echo '</select><br />' . "\n";
|
361 |
+
echo 'This controls the way your Background Image is styled with CSS. [ <a href="http://www.w3schools.com/css/pr_background-repeat.asp" target="_blank" rel="external">learn more</a> ]' . "\n";
|
362 |
+
echo '</td>' . "\n";
|
363 |
+
/**/
|
364 |
+
echo '</tr>' . "\n";
|
365 |
+
echo '<tr>' . "\n";
|
366 |
+
/**/
|
367 |
+
echo '<th>' . "\n";
|
368 |
echo '<label for="ws-plugin--s2member-login-reg-background-text-color">' . "\n";
|
369 |
echo 'Color of Text on top of your Background:' . "\n";
|
370 |
echo '</label>' . "\n";
|
526 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-reg-fields-section">' . "\n";
|
527 |
echo '<h3>Custom Registration Fields ( optional, for further customization )</h3>' . "\n";
|
528 |
/**/
|
529 |
+
echo '<p>This allows you to customize the Fields in your Standard Registration Form:<br />( <a href="' . add_query_arg ("action", "register", wp_login_url ()) . '" target="_blank" rel="external">' . esc_html (add_query_arg ("action", "register", wp_login_url ())) . '</a> )</p>' . "\n";
|
530 |
+
echo (is_multisite () && ws_plugin__s2member_is_multisite_farm () && is_main_site ()) ? '<p><em>A Multisite Blog Farm uses this Form instead. It supports Custom Fields too.<br />( <a href="' . apply_filters ("wp_signup_location", get_bloginfo ("wpurl") . "/wp-signup.php") . '" target="_blank" rel="external">' . esc_html (apply_filters ("wp_signup_location", get_bloginfo ("wpurl") . "/wp-signup.php")) . '</a> )</em></p>' . "\n" : '';
|
531 |
/**/
|
532 |
+
echo '<p>This is a comma delimited list of additional form fields to collect during registration. By default, all of your Custom Fields will remain optional to the User. That is, the User will NOT be required to enter any of these values. If you want specific fields to be *required*, wrap those Custom Fields inside *asterisks*. If you want specific fields to be ^uneditable^, you can wrap those Custom Fields inside ^carets^. Some fields are already built-in by default. The defaults are: <code>*Username*, *Email*, *First Name*, *Last Name*</code>. If you need to add other Custom Fields, in addition to these defaults, you can do that here.</p>' . "\n";
|
533 |
/**/
|
534 |
if (defined ("BP_VERSION"))
|
535 |
echo '<p><em class="ws-menu-page-hilite">* With BuddyPress installed, Custom Registration Fields are NOT applicable. BuddyPress themes usually come with their own Registration Form ( i.e. BuddyPress redirects you away from the default Registration Form, over to a special <code>/register</code> page ); BuddyPress also has its own Profile Field Configuration Tool, under <code>BuddyPress -> Profile Field Setup</code>. When BuddyPress is installed, the use of s2Member\'s Custom Fields is not advised; that is... UNLESS you\'re using the s2Member Pro Module. With the s2Member Pro Module, Custom Fields <strong>will</strong> be included in all PayPal® Pro Forms, including even Free Registration Forms generated by the s2Member Pro Module.</em></p>' . "\n";
|
537 |
if (!function_exists ("ws_plugin__s2member_generate_password"))
|
538 |
echo '<p><em class="ws-menu-page-error">* Custom Passwords CANNOT be used with your installation of s2Member. This is due to a minor conflict with another plugin that is using <code>wp_generate_password()</code>. If you really want to allow Custom Passwords during registration, please disable some of your other plugins until this warning goes away.</em></p>' . "\n";
|
539 |
/**/
|
540 |
+
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && is_main_site () && !$GLOBALS["WS_PLUGIN__"]["s2member_pro"])
|
541 |
+
echo '<p><em>* 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 <code>/wp-signup.php</code>. 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. * NOTE: s2Member (Pro) removes this limitation. If you install the s2Member Pro Module, you WILL be able to allow Custom Passwords; even on a Multisite Blog Farm.</em></p>' . "\n";
|
542 |
+
/**/
|
543 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_custom_reg_fields", get_defined_vars ());
|
544 |
/**/
|
545 |
echo '<table class="form-table">' . "\n";
|
557 |
/**/
|
558 |
echo '<td>' . "\n";
|
559 |
echo '<input type="text" name="ws_plugin__s2member_custom_reg_fields" id="ws-plugin--s2member-custom-reg-fields" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) . '" /><br />' . "\n";
|
560 |
+
echo 'Comma delimited please. <em>Ex:</em> <code>*Company*, ^*Primary Domain*^, Street Address, City, State, Zip Code, Phone</code>' . "\n";
|
561 |
echo '</td>' . "\n";
|
562 |
/**/
|
563 |
echo '</tr>' . "\n";
|
573 |
echo '<tr>' . "\n";
|
574 |
/**/
|
575 |
echo '<td>' . "\n";
|
576 |
+
echo '<select name="ws_plugin__s2member_custom_reg_password" id="ws-plugin--s2member-custom-reg-password"' . ((!function_exists ("ws_plugin__s2member_generate_password") || (is_multisite () && ws_plugin__s2member_is_multisite_farm () && is_main_site () && !$GLOBALS["WS_PLUGIN__"]["s2member_pro"])) ? ' disabled="disabled"' : '') . '>' . "\n";
|
577 |
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";
|
578 |
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";
|
579 |
echo '</select><br />' . "\n";
|
621 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && $ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) ? ' selected="selected"' : '') . '>' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
622 |
echo '</select><br />' . "\n";
|
623 |
echo 'Please choose a Page to be used as the first page Members will see after logging in. This Page can contain anything you like. We recommend the following title: <code>Welcome To Our Members Area</code>.<br /><br />' . "\n";
|
624 |
+
echo '↓ Or, you may configure a Special Redirection URL, if you prefer. You\'ll need to type in the full URL, starting with: <code>http://</code>. <em>A few <a href="#" onclick="alert(\'Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n\\nFor example, if you\\\'re using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: ' . get_bloginfo ("wpurl") . '/members/%%current_user_login%%/profile/\\n\\nOr ... using %%current_user_level%%, you could have a separate Login Welcome Page for each Membership Level that you plan to offer. BuddyPress not required.\'); return false;">Replacement Codes</a> are also supported here.</em>' . "\n";
|
625 |
echo '<input type="text" name="ws_plugin__s2member_login_redirection_override" id="ws-plugin--s2member-login-redirection-override" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) . '" /><br />' . "\n";
|
626 |
echo '</td>' . "\n";
|
627 |
/**/
|
643 |
/**/
|
644 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-membership-options-page-section">' . "\n";
|
645 |
echo '<h3>Membership Options Page ( required, please customize this )</h3>' . "\n";
|
646 |
+
echo '<p>Please create and/or choose an existing Page that showcases your Membership subscription options. This special Page is where you will insert the PayPal® Subscription Buttons generated for you by s2Member. This Page serves as your signup page. It should detail all of the features that come with Membership to your site, and provide a PayPal® Subscription Button for each Level of access you plan to offer. This is also the page that Users will be redirected to, should they attempt to access an area of your site that requires Membership.</p>' . "\n";
|
647 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_membership_options_page", get_defined_vars ());
|
648 |
/**/
|
649 |
echo '<table class="form-table">' . "\n";
|
665 |
foreach (($ws_plugin__s2member_temp_a = array_merge ((array)get_pages ())) as $ws_plugin__s2member_temp_o)
|
666 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '"' . (($ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]) ? ' selected="selected"' : '') . '>' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
667 |
echo '</select><br />' . "\n";
|
668 |
+
echo 'Please choose a Page that provides Users a way to signup for Membership. This Page should also contain your PayPal® Subscription button(s). We recommend the following title: <code>Membership Signup</code>.' . "\n";
|
669 |
echo '</td>' . "\n";
|
670 |
/**/
|
671 |
echo '</tr>' . "\n";
|
678 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_membership_options_page", get_defined_vars ());
|
679 |
}
|
680 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_post_level_access", true, get_defined_vars ()))
|
682 |
{
|
683 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_post_level_access", get_defined_vars ());
|
687 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-post-level-access-section">' . "\n";
|
688 |
echo '<h3>Post Level Access Restrictions ( optional )</h3>' . "\n";
|
689 |
echo '<p>Here you can specify Posts that are restricted to certain Membership Access Levels. These fields also support Custom Post Types, which were first introduced in WordPress® 3.0. If you have a theme/plugin installed that has enabled Custom Post Types ( i.e. Music/Videos/etc ), you can put the IDs for those Posts here.</p>' . "\n";
|
690 |
+
echo ((!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()) && !$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Post IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
|
691 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_post_level_access", get_defined_vars ());
|
692 |
/**/
|
693 |
echo '<table class="form-table">' . "\n";
|
795 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-page-level-access-section">' . "\n";
|
796 |
echo '<h3>Page Level Access Restrictions ( optional )</h3>' . "\n";
|
797 |
echo '<p>Here you can specify Pages that are restricted to certain Membership Access Levels.</p>' . "\n";
|
798 |
+
echo ((!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()) && !$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Page IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
|
799 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_page_level_access", get_defined_vars ());
|
800 |
/**/
|
801 |
echo '<table class="form-table">' . "\n";
|
1010 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-category-level-access-section">' . "\n";
|
1011 |
echo '<h3>Category Level Access Restrictions ( optional )</h3>' . "\n";
|
1012 |
echo '<p>Here you can specify Categories that are restricted to certain Membership Access Levels. Category restrictions are a bit more complex. When you restrict access to a Category, it also restricts access to any child Categories it may have ( aka: sub-Categories ). In other words, restricting a Category protects that Category Archive, all of its child Category Archives, and any Posts contained within the Category, or its child Categories.</p>' . "\n";
|
1013 |
+
echo ((!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()) && !$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Category IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
|
1014 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_category_level_access", get_defined_vars ());
|
1015 |
/**/
|
1016 |
echo '<table class="form-table">' . "\n";
|
1118 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-uri-level-access-section">' . "\n";
|
1119 |
echo '<h3>URI Level Access Restrictions ( optional )</h3>' . "\n";
|
1120 |
echo '<p>Here you can specify URIs ( or word fragments found in URIs ) that are restricted to certain Membership Access Levels. Control over URIs is a little more complex. This section is intended for advanced webmasters only. That being said, here are the basics... A REQUEST_URI, is the portion of the URL that comes after the domain. This is a URL <code>http://www.example.com/path/to/file.php</code>, and this is the URI: <code>/path/to/file.php</code>.</p>' . "\n";
|
1121 |
+
echo '<p>In the fields below, you can provide a list ( one per line ) of URIs on your site that should be off-limits based on Membership Level. You can also use word fragments instead of a full URI. If a word fragment is found anywhere in the URI, it will be protected. Wildcards and other regex patterns are not supported here, and therefore you don\'t need to escape special characters or anything. Please note, these ARE caSe sensitive. You must be specific with respect to case sensitivity. The word fragment <code>some-path/</code> would NOT match a URI that contains <code>some-Path/</code>. <em>A few <a href="#" onclick="alert(\'URI Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n\\nFor example, if you\\\'re using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: /members/%%current_user_login%%/groups/\'); return false;">Replacement Codes</a> are also supported here.</em></p>' . "\n";
|
1122 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_uri_level_access", get_defined_vars ());
|
1123 |
/**/
|
1124 |
echo '<table class="form-table">' . "\n";
|
1229 |
echo '<p>In other words, Customers will NOT need to login, just to receive access to the Specific Post/Page they purchased access to. s2Member will immediately redirect the Customer to the Specific Post/Page after checkout is completed successfully. An email is also sent to the Customer with a link ( see: <code>s2Member -> PayPal® Options -> Specific Post/Page Email</code> ). Authentication is handled automatically through self-expiring links, good for 72 hours by default.</p>' . "\n";
|
1230 |
echo '<p>Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress®. A Specific Post/Page that is protected by s2Member, might contain a download link for your eBook, access to file & music downloads, access to additional support services, and the list goes on and on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress® Post/Page that you\'ve created.</p>' . "\n";
|
1231 |
echo '<p>Very simple. All you do is protect the Specific Post/Page IDs that are being sold on your site. Then, you can go to <code>s2Member -> PayPal® Buttons -> Specific Post/Page</code> to generate "Buy Now" Buttons that you can insert into your WordPress® Editor, and make available on your site. The Button Generator for s2Member, will even let you Package Additional Posts/Pages together into one transaction.</p>' . "\n";
|
1232 |
+
echo ((!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()) && !$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Post/Page IDs? Get <a href="http://www.primothemes.com/post/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
|
1233 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_sp_access", get_defined_vars ());
|
1234 |
/**/
|
1235 |
echo '<table class="form-table">' . "\n";
|
1268 |
/**/
|
1269 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-ip-restrictions-section">' . "\n";
|
1270 |
echo '<h3>Unique IP Access Restrictions ( prevents username/link sharing )</h3>' . "\n";
|
1271 |
+
echo '<p>As with any Membership system, it is possible for one Member to signup, and then share their Username with someone else; or even post it online for the whole world to see. This is known as Link Sharing ( aka: Username Sharing ). It is not likely that you\'ll be attacked in this way, but it\'s still a good idea to protect your system; just in case somebody tries this. s2Member\'s IP Restrictions, work for both Membership Level Access ( account logins ), and also for Specific Post/Page Access. In both cases, the rules are simple. A single Username, and/or Access Link is only valid for a certain number of unique IP addresses. Once that limit is reached, s2Member assumes there has been a security breach. At that time, s2Member will place a temporary ban ( preventing access ) to a Specific Post/Page, or to an account associated with a particular Username. This temporary ban, will ONLY affect the offending Link and/or Username associated with the security breach.</p>' . "\n";
|
1272 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_ip_restrictions", get_defined_vars ());
|
1273 |
/**/
|
1274 |
echo '<table class="form-table">' . "\n";
|
1290 |
echo '<option value="3"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 3) ? ' selected="selected"' : '') . '>Allow up to 3 different IPs per Customer</option>' . "\n";
|
1291 |
echo '<option value="4"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 4) ? ' selected="selected"' : '') . '>Allow up to 4 different IPs per Customer</option>' . "\n";
|
1292 |
echo '<option value="5"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 5) ? ' selected="selected"' : '') . '>Allow up to 5 different IPs per Customer</option>' . "\n";
|
1293 |
+
echo '<option value="10"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 10) ? ' selected="selected"' : '') . '>Allow up to 10 different IPs per Customer</option>' . "\n";
|
1294 |
+
echo '<option value="20"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 20) ? ' selected="selected"' : '') . '>Allow up to 20 different IPs per Customer</option>' . "\n";
|
1295 |
+
echo '<option value="30"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 30) ? ' selected="selected"' : '') . '>Allow up to 30 different IPs per Customer</option>' . "\n";
|
1296 |
+
echo '<option value="40"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 40) ? ' selected="selected"' : '') . '>Allow up to 40 different IPs per Customer</option>' . "\n";
|
1297 |
+
echo '<option value="50"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 50) ? ' selected="selected"' : '') . '>Allow up to 50 different IPs per Customer</option>' . "\n";
|
1298 |
+
echo '<option value="75"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 75) ? ' selected="selected"' : '') . '>Allow up to 75 different IPs per Customer</option>' . "\n";
|
1299 |
+
echo '<option value="100"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"] == 100) ? ' selected="selected"' : '') . '>Allow up to 100 different IPs per Customer</option>' . "\n";
|
1300 |
echo '</select><br />' . "\n";
|
1301 |
echo '</td>' . "\n";
|
1302 |
/**/
|
1349 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-profile-modifications-section">' . "\n";
|
1350 |
echo '<h3>Giving Members The Ability To Modify Their Profile</h3>' . "\n";
|
1351 |
echo '<p>s2Member can be configured to redirect Members away from the <a href="profile.php" target="_blank" rel="external">default Profile Editing Panel</a> that is built into WordPress®. When/if a Member attempts to access the default Profile Editing Panel, they\'ll instead, be redirected to the Login Welcome Page that you\'ve configured through s2Member. <strong>Why would I redirect?</strong> Unless you\'ve made some drastic modifications to your WordPress® installation, the default Profile Editing Panel that ships with WordPress®, is NOT really suited for public access, even by a Member.</p>' . "\n";
|
1352 |
+
echo '<p>So instead of using this default Profile Editing Panel; s2Member creates an added layer of functionality, on top of WordPress®. It does this by providing you ( as the site owner ), with the ability to send your Members to a <a href="' . get_bloginfo ("wpurl") . '/?s2member_profile=1" target="_blank" rel="external">special Stand-Alone page</a>, where your Members can modify their entire Profile, including all Custom Fields, and their Password. This special Stand-Alone Editing Panel, has been designed ( with a bare-bones format ), intentionally. This makes it possible for you to <a href="#" onclick="if(!window.open(\'' . get_bloginfo ("wpurl") . '/?s2member_profile=1\', \'_popup\', \'height=350,width=400,left=100,screenX=100,top=100,screenY=100, location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1\')) alert(\'Please disable popup blockers and try again!\'); return false;" rel="external">open it up in a popup window</a>, or embed it into your Login Welcome Page using an IFRAME. Code samples are provided below.</p>' . "\n";
|
1353 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_profile_modifications", get_defined_vars ());
|
1354 |
/**/
|
1355 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
1356 |
/**/
|
1357 |
echo '<p>Stand-Alone page where Members can modify their Profile:<br />' . "\n";
|
1358 |
+
echo '<code><a href="' . get_bloginfo ("wpurl") . '/?s2member_profile=1" target="_blank" rel="external">' . get_bloginfo ("wpurl") . '/?s2member_profile=1</a></code></p>' . "\n";
|
1359 |
/**/
|
1360 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
1361 |
/**/
|
1362 |
echo '<p><strong>Code Sample #1</strong> ( standard link tag ):</p>' . "\n";
|
1363 |
+
echo '<p>' . highlight_string (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("wpurl") . "/?s2member_profile=1"), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.php")), true) . '</p>' . "\n";
|
1364 |
/**/
|
1365 |
echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
|
1366 |
+
echo '<p>' . highlight_string (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("wpurl") . "/?s2member_profile=1"), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2.php")), true) . '</p>' . "\n";
|
1367 |
/**/
|
1368 |
echo '<p><strong>Code Sample #3</strong> ( embed the form into a Post/Page using an IFRAME tag ):</p>' . "\n";
|
1369 |
+
echo '<p>' . highlight_string (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("wpurl") . "/?s2member_profile=1"), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-3.php")), true) . '</p>' . "\n";
|
1370 |
echo '<table class="form-table">' . "\n";
|
1371 |
echo '<tbody>' . "\n";
|
1372 |
echo '<tr>' . "\n";
|
1399 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_after_profile_modifications", get_defined_vars ());
|
1400 |
}
|
1401 |
/**/
|
1402 |
+
if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections_display_deactivation", (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site () || is_super_admin ()), get_defined_vars ()))
|
1403 |
{
|
1404 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_before_deactivation", get_defined_vars ());
|
1405 |
/**/
|
1407 |
/**/
|
1408 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-deactivation-section">' . "\n";
|
1409 |
echo '<h3>Deactivation Safeguards ( optional, recommended )</h3>' . "\n";
|
1410 |
+
echo (is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site () && is_super_admin ()) ? '<p><em class="ws-menu-page-hilite">On a Multisite Blog Farm, this panel is ONLY visible to YOU, as a Super Administrator. s2Member automatically Safeguards everything on a Multisite Blog Farm. However, as the Super Administrator, you may turn this off; on a per-Blog basis. For example, if you\'re going to de-activate s2Member on this particular Blog, you can turn OFF the Safeguards below, so that s2Member will completely erase itself.</em></p>' . "\n" : '<p>By default, s2Member will cleanup ( erase ) all of it\'s Roles, Capabilities, and your Configuration Options when/if you deactivate it from the Plugins Menu in WordPress®. If you would like to Safeguard all of this information, in case s2Member is deactivated inadvertently, please choose Yes ( safeguard all s2Member data/options ).</p>' . "\n";
|
1411 |
do_action ("ws_plugin__s2member_during_options_page_during_left_sections_during_deactivation", get_defined_vars ());
|
1412 |
/**/
|
1413 |
echo '<table class="form-table">' . "\n";
|
1456 |
do_action ("ws_plugin__s2member_during_options_page_before_right_sections", get_defined_vars ());
|
1457 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
1458 |
/**/
|
1459 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
1460 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
1461 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
1462 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/paypal-buttons.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
PayPal® Button Generating page.
|
18 |
*/
|
@@ -57,8 +57,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
57 |
echo '<form onsubmit="return false;">' . "\n";
|
58 |
echo '<p id="ws-plugin--s2member-level1-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level1-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level1-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
59 |
echo '<p><span id="ws-plugin--s2member-level1-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level1-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level1-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
60 |
-
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level1-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level1-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level1\');" class="button-primary" /></p>' . "\n";
|
61 |
-
echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level1-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
62 |
echo '</form>' . "\n";
|
63 |
echo '</td>' . "\n";
|
64 |
/**/
|
@@ -73,7 +73,9 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
73 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
74 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("1")), $ws_plugin__s2member_temp_s);
|
75 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
|
76 |
-
echo '<input id="ws-plugin--s2member-level1-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;"
|
|
|
|
|
77 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
78 |
echo '<textarea id="ws-plugin--s2member-level1-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
79 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
@@ -81,13 +83,15 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
81 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
82 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
|
83 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
84 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
85 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
86 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
87 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("1")), $ws_plugin__s2member_temp_s);
|
88 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
89 |
echo '</textarea><br />' . "\n";
|
90 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
|
|
|
|
91 |
echo '</form>' . "\n";
|
92 |
echo '</td>' . "\n";
|
93 |
/**/
|
@@ -128,8 +132,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
128 |
echo '<form onsubmit="return false;">' . "\n";
|
129 |
echo '<p id="ws-plugin--s2member-level2-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level2-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level2-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
130 |
echo '<p><span id="ws-plugin--s2member-level2-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level2-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level2-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
131 |
-
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level2-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level2-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level2\');" class="button-primary" /></p>' . "\n";
|
132 |
-
echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level2-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
133 |
echo '</form>' . "\n";
|
134 |
echo '</td>' . "\n";
|
135 |
/**/
|
@@ -144,7 +148,9 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
144 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
145 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
146 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
147 |
-
echo '<input id="ws-plugin--s2member-level2-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;"
|
|
|
|
|
148 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
149 |
echo '<textarea id="ws-plugin--s2member-level2-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
150 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
@@ -152,13 +158,15 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
152 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
153 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
154 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
155 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
156 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
157 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
158 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
159 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
160 |
echo '</textarea><br />' . "\n";
|
161 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
|
|
|
|
162 |
echo '</form>' . "\n";
|
163 |
echo '</td>' . "\n";
|
164 |
/**/
|
@@ -199,8 +207,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
199 |
echo '<form onsubmit="return false;">' . "\n";
|
200 |
echo '<p id="ws-plugin--s2member-level3-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level3-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level3-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
201 |
echo '<p><span id="ws-plugin--s2member-level3-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level3-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level3-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
202 |
-
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level3-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level3-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level3\');" class="button-primary" /></p>' . "\n";
|
203 |
-
echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level3-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
204 |
echo '</form>' . "\n";
|
205 |
echo '</td>' . "\n";
|
206 |
/**/
|
@@ -215,7 +223,9 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
215 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
216 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("3")), $ws_plugin__s2member_temp_s);
|
217 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"])), $ws_plugin__s2member_temp_s);
|
218 |
-
echo '<input id="ws-plugin--s2member-level3-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;"
|
|
|
|
|
219 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
220 |
echo '<textarea id="ws-plugin--s2member-level3-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
221 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
@@ -223,13 +233,15 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
223 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
224 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"])), $ws_plugin__s2member_temp_s);
|
225 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
226 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
227 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
228 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
229 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("3")), $ws_plugin__s2member_temp_s);
|
230 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
231 |
echo '</textarea><br />' . "\n";
|
232 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
|
|
|
|
233 |
echo '</form>' . "\n";
|
234 |
echo '</td>' . "\n";
|
235 |
/**/
|
@@ -270,8 +282,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
270 |
echo '<form onsubmit="return false;">' . "\n";
|
271 |
echo '<p id="ws-plugin--s2member-level4-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level4-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level4-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
272 |
echo '<p><span id="ws-plugin--s2member-level4-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level4-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level4-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
273 |
-
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level4-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level4-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level4\');" class="button-primary" /></p>' . "\n";
|
274 |
-
echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level4-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
275 |
echo '</form>' . "\n";
|
276 |
echo '</td>' . "\n";
|
277 |
/**/
|
@@ -286,7 +298,9 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
286 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
287 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("4")), $ws_plugin__s2member_temp_s);
|
288 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"])), $ws_plugin__s2member_temp_s);
|
289 |
-
echo '<input id="ws-plugin--s2member-level4-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;"
|
|
|
|
|
290 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
291 |
echo '<textarea id="ws-plugin--s2member-level4-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
292 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
@@ -294,13 +308,15 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
294 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
295 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"])), $ws_plugin__s2member_temp_s);
|
296 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
297 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
298 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
299 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
300 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("4")), $ws_plugin__s2member_temp_s);
|
301 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
302 |
echo '</textarea><br />' . "\n";
|
303 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
|
|
|
|
304 |
echo '</form>' . "\n";
|
305 |
echo '</td>' . "\n";
|
306 |
/**/
|
@@ -345,8 +361,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
345 |
echo '<p>Modification: <select id="ws-plugin--s2member-modification-level">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-modification-levels.html") . '</select></p>' . "\n";
|
346 |
echo '<p id="ws-plugin--s2member-modification-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-modification-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
347 |
echo '<p><span id="ws-plugin--s2member-modification-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-modification-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select><span id="ws-plugin--s2member-modification-20p-rule"><br /><small>** Watch out for <a href="https://www.x.com/thread/41748" target="_blank" rel="external">the 20% rule</a>. Additional details on the 20% rule are <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_WPRecurringPayments#id086530108PM__id08653060UE6" target="_blank" rel="external">documented here</a>.</small></span></p>' . "\n";
|
348 |
-
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-modification-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
|
349 |
-
echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-modification-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
350 |
echo '</form>' . "\n";
|
351 |
echo '</td>' . "\n";
|
352 |
/**/
|
@@ -362,7 +378,9 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
362 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
363 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
364 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
365 |
-
echo '<input id="ws-plugin--s2member-modification-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;"
|
|
|
|
|
366 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
367 |
echo '<textarea id="ws-plugin--s2member-modification-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
368 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
@@ -371,13 +389,15 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
371 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
372 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
373 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
374 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
375 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
376 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
377 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
378 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
379 |
echo '</textarea><br />' . "\n";
|
380 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
|
|
|
|
381 |
echo '</form>' . "\n";
|
382 |
echo '</td>' . "\n";
|
383 |
/**/
|
@@ -433,7 +453,9 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
433 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_cancellation_buttons_before_shortcode", get_defined_vars ());
|
434 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
435 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-cancellation-button-shortcode.html"));
|
436 |
-
echo '<input id="ws-plugin--s2member-cancellation-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;"
|
|
|
|
|
437 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
438 |
echo '<textarea id="ws-plugin--s2member-cancellation-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
439 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-cancellation-button.html"));
|
@@ -442,6 +464,8 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
442 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
443 |
echo '</textarea><br />' . "\n";
|
444 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
|
|
|
|
445 |
echo '</form>' . "\n";
|
446 |
echo '</td>' . "\n";
|
447 |
/**/
|
@@ -498,7 +522,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
498 |
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
499 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
500 |
/**/
|
501 |
-
echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.\'); return false;">[?]</a></p>' . "\n";
|
502 |
/**/
|
503 |
echo '<p><select id="ws-plugin--s2member-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n";
|
504 |
echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n";
|
@@ -512,11 +536,11 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
512 |
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
513 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
514 |
/**/
|
515 |
-
echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.\'); return false;">[?]</a></p>' . "\n";
|
516 |
/**/
|
517 |
echo '<p>I want to charge: $<input type="text" id="ws-plugin--s2member-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-sp-hours">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-sp-hours.html") . '</select></p>' . "\n";
|
518 |
echo '<p>Description: <input type="text" id="ws-plugin--s2member-sp-desc" value="Description and pricing details here." size="68" /></p>' . "\n";
|
519 |
-
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-sp-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-sp-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalSpButtonGenerate();" class="button-primary" /></p>' . "\n";
|
520 |
echo '</form>' . "\n";
|
521 |
echo '</td>' . "\n";
|
522 |
/**/
|
@@ -529,19 +553,23 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
529 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
530 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-button-shortcode.html"));
|
531 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
532 |
-
echo '<input id="ws-plugin--s2member-sp-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;"
|
|
|
|
|
533 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
534 |
echo '<textarea id="ws-plugin--s2member-sp-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
535 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-sp-checkout-button.html"));
|
536 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
537 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
538 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
539 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
540 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("
|
541 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
542 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
543 |
echo '</textarea><br />' . "\n";
|
544 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
|
|
|
|
545 |
echo '</form>' . "\n";
|
546 |
echo '</td>' . "\n";
|
547 |
/**/
|
@@ -591,7 +619,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
591 |
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
592 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
593 |
/**/
|
594 |
-
echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.\'); return false;">[?]</a></p>' . "\n";
|
595 |
/**/
|
596 |
echo '<p><select id="ws-plugin--s2member-sp-link-additional-ids" multiple="multiple" style="height:100px;">' . "\n";
|
597 |
echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n";
|
@@ -605,7 +633,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_s
|
|
605 |
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
606 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
607 |
/**/
|
608 |
-
echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.\'); return false;">[?]</a></p>' . "\n";
|
609 |
/**/
|
610 |
echo '<p><select id="ws-plugin--s2member-sp-link-hours">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-sp-hours.html") . '</select> <input type="button" value="Generate Access Link" onclick="ws_plugin__s2member_paypalSpLinkGenerate();" class="button-primary" /> <img id="ws-plugin--s2member-sp-link-loading" src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
|
611 |
echo '<p id="ws-plugin--s2member-sp-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n";
|
@@ -631,7 +659,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
631 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_before_right_sections", get_defined_vars ());
|
632 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
633 |
/**/
|
634 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
635 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
636 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
637 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
PayPal® Button Generating page.
|
18 |
*/
|
57 |
echo '<form onsubmit="return false;">' . "\n";
|
58 |
echo '<p id="ws-plugin--s2member-level1-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level1-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level1-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
59 |
echo '<p><span id="ws-plugin--s2member-level1-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level1-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level1-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
60 |
+
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-level1-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level1-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level1\');" class="button-primary" /></p>' . "\n";
|
61 |
+
echo '<p' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-level1-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
62 |
echo '</form>' . "\n";
|
63 |
echo '</td>' . "\n";
|
64 |
/**/
|
73 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
74 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("1")), $ws_plugin__s2member_temp_s);
|
75 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
|
76 |
+
echo '<input id="ws-plugin--s2member-level1-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
77 |
+
/**/
|
78 |
+
echo '<div' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
79 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
80 |
echo '<textarea id="ws-plugin--s2member-level1-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
81 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
83 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
84 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
|
85 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
86 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
87 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
88 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
89 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("1")), $ws_plugin__s2member_temp_s);
|
90 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
91 |
echo '</textarea><br />' . "\n";
|
92 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
93 |
+
echo '</div>' . "\n";
|
94 |
+
/**/
|
95 |
echo '</form>' . "\n";
|
96 |
echo '</td>' . "\n";
|
97 |
/**/
|
132 |
echo '<form onsubmit="return false;">' . "\n";
|
133 |
echo '<p id="ws-plugin--s2member-level2-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level2-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level2-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
134 |
echo '<p><span id="ws-plugin--s2member-level2-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level2-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level2-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
135 |
+
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-level2-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level2-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level2\');" class="button-primary" /></p>' . "\n";
|
136 |
+
echo '<p' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-level2-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
137 |
echo '</form>' . "\n";
|
138 |
echo '</td>' . "\n";
|
139 |
/**/
|
148 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
149 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
150 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
151 |
+
echo '<input id="ws-plugin--s2member-level2-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
152 |
+
/**/
|
153 |
+
echo '<div' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
154 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
155 |
echo '<textarea id="ws-plugin--s2member-level2-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
156 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
158 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
159 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
160 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
161 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
162 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
163 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
164 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
165 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
166 |
echo '</textarea><br />' . "\n";
|
167 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
168 |
+
echo '</div>' . "\n";
|
169 |
+
/**/
|
170 |
echo '</form>' . "\n";
|
171 |
echo '</td>' . "\n";
|
172 |
/**/
|
207 |
echo '<form onsubmit="return false;">' . "\n";
|
208 |
echo '<p id="ws-plugin--s2member-level3-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level3-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level3-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
209 |
echo '<p><span id="ws-plugin--s2member-level3-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level3-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level3-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
210 |
+
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-level3-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level3-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level3\');" class="button-primary" /></p>' . "\n";
|
211 |
+
echo '<p' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-level3-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
212 |
echo '</form>' . "\n";
|
213 |
echo '</td>' . "\n";
|
214 |
/**/
|
223 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
224 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("3")), $ws_plugin__s2member_temp_s);
|
225 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"])), $ws_plugin__s2member_temp_s);
|
226 |
+
echo '<input id="ws-plugin--s2member-level3-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
227 |
+
/**/
|
228 |
+
echo '<div' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
229 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
230 |
echo '<textarea id="ws-plugin--s2member-level3-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
231 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
233 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
234 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"])), $ws_plugin__s2member_temp_s);
|
235 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
236 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
237 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
238 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
239 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("3")), $ws_plugin__s2member_temp_s);
|
240 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
241 |
echo '</textarea><br />' . "\n";
|
242 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
243 |
+
echo '</div>' . "\n";
|
244 |
+
/**/
|
245 |
echo '</form>' . "\n";
|
246 |
echo '</td>' . "\n";
|
247 |
/**/
|
282 |
echo '<form onsubmit="return false;">' . "\n";
|
283 |
echo '<p id="ws-plugin--s2member-level4-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level4-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level4-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
284 |
echo '<p><span id="ws-plugin--s2member-level4-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level4-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level4-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
285 |
+
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-level4-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level4-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level4\');" class="button-primary" /></p>' . "\n";
|
286 |
+
echo '<p' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-level4-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
287 |
echo '</form>' . "\n";
|
288 |
echo '</td>' . "\n";
|
289 |
/**/
|
298 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
299 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("4")), $ws_plugin__s2member_temp_s);
|
300 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"])), $ws_plugin__s2member_temp_s);
|
301 |
+
echo '<input id="ws-plugin--s2member-level4-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
302 |
+
/**/
|
303 |
+
echo '<div' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
304 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
305 |
echo '<textarea id="ws-plugin--s2member-level4-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
306 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
308 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
309 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"])), $ws_plugin__s2member_temp_s);
|
310 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
311 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
312 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
313 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
314 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("4")), $ws_plugin__s2member_temp_s);
|
315 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
316 |
echo '</textarea><br />' . "\n";
|
317 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
318 |
+
echo '</div>' . "\n";
|
319 |
+
/**/
|
320 |
echo '</form>' . "\n";
|
321 |
echo '</td>' . "\n";
|
322 |
/**/
|
361 |
echo '<p>Modification: <select id="ws-plugin--s2member-modification-level">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-modification-levels.html") . '</select></p>' . "\n";
|
362 |
echo '<p id="ws-plugin--s2member-modification-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-modification-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> free.</p>' . "\n";
|
363 |
echo '<p><span id="ws-plugin--s2member-modification-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-modification-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select><span id="ws-plugin--s2member-modification-20p-rule"><br /><small>** Watch out for <a href="https://www.x.com/thread/41748" target="_blank" rel="external">the 20% rule</a>. Additional details on the 20% rule are <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_WPRecurringPayments#id086530108PM__id08653060UE6" target="_blank" rel="external">documented here</a>.</small></span></p>' . "\n";
|
364 |
+
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-modification-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
|
365 |
+
echo '<p' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-modification-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
366 |
echo '</form>' . "\n";
|
367 |
echo '</td>' . "\n";
|
368 |
/**/
|
378 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
379 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
380 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
381 |
+
echo '<input id="ws-plugin--s2member-modification-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
382 |
+
/**/
|
383 |
+
echo '<div' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
384 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
385 |
echo '<textarea id="ws-plugin--s2member-modification-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
386 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
389 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
390 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
391 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
392 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
393 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
394 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
395 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", ws_plugin__s2member_esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
396 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
397 |
echo '</textarea><br />' . "\n";
|
398 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
399 |
+
echo '</div>' . "\n";
|
400 |
+
/**/
|
401 |
echo '</form>' . "\n";
|
402 |
echo '</td>' . "\n";
|
403 |
/**/
|
453 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_cancellation_buttons_before_shortcode", get_defined_vars ());
|
454 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
455 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-cancellation-button-shortcode.html"));
|
456 |
+
echo '<input id="ws-plugin--s2member-cancellation-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
457 |
+
/**/
|
458 |
+
echo '<div' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
459 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
460 |
echo '<textarea id="ws-plugin--s2member-cancellation-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
461 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-cancellation-button.html"));
|
464 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
465 |
echo '</textarea><br />' . "\n";
|
466 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
467 |
+
echo '</div>' . "\n";
|
468 |
+
/**/
|
469 |
echo '</form>' . "\n";
|
470 |
echo '</td>' . "\n";
|
471 |
/**/
|
522 |
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
523 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
524 |
/**/
|
525 |
+
echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
526 |
/**/
|
527 |
echo '<p><select id="ws-plugin--s2member-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n";
|
528 |
echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n";
|
536 |
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
537 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
538 |
/**/
|
539 |
+
echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
540 |
/**/
|
541 |
echo '<p>I want to charge: $<input type="text" id="ws-plugin--s2member-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-sp-hours">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-sp-hours.html") . '</select></p>' . "\n";
|
542 |
echo '<p>Description: <input type="text" id="ws-plugin--s2member-sp-desc" value="Description and pricing details here." size="68" /></p>' . "\n";
|
543 |
+
echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-sp-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-sp-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalSpButtonGenerate();" class="button-primary" /></p>' . "\n";
|
544 |
echo '</form>' . "\n";
|
545 |
echo '</td>' . "\n";
|
546 |
/**/
|
553 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
554 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-sp-checkout-button-shortcode.html"));
|
555 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
556 |
+
echo '<input id="ws-plugin--s2member-sp-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
557 |
+
/**/
|
558 |
+
echo '<div' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
559 |
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
560 |
echo '<textarea id="ws-plugin--s2member-sp-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
561 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-sp-checkout-button.html"));
|
562 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", ws_plugin__s2member_esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
563 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", ws_plugin__s2member_esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
564 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("url"))), $ws_plugin__s2member_temp_s);
|
565 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1")), $ws_plugin__s2member_temp_s);
|
566 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", ws_plugin__s2member_esc_ds (esc_attr (get_bloginfo ("wpurl") . "/?s2member_paypal_return=1")), $ws_plugin__s2member_temp_s);
|
567 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", ws_plugin__s2member_esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
568 |
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
569 |
echo '</textarea><br />' . "\n";
|
570 |
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
|
571 |
+
echo '</div>' . "\n";
|
572 |
+
/**/
|
573 |
echo '</form>' . "\n";
|
574 |
echo '</td>' . "\n";
|
575 |
/**/
|
619 |
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
620 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
621 |
/**/
|
622 |
+
echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
623 |
/**/
|
624 |
echo '<p><select id="ws-plugin--s2member-sp-link-additional-ids" multiple="multiple" style="height:100px;">' . "\n";
|
625 |
echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n";
|
633 |
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
634 |
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
635 |
/**/
|
636 |
+
echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> General Options -> Specific Post/Page Access Restrictions.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
637 |
/**/
|
638 |
echo '<p><select id="ws-plugin--s2member-sp-link-hours">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-sp-hours.html") . '</select> <input type="button" value="Generate Access Link" onclick="ws_plugin__s2member_paypalSpLinkGenerate();" class="button-primary" /> <img id="ws-plugin--s2member-sp-link-loading" src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
|
639 |
echo '<p id="ws-plugin--s2member-sp-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n";
|
659 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_before_right_sections", get_defined_vars ());
|
660 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
661 |
/**/
|
662 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
663 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
664 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
665 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/paypal-ops.inc.php
CHANGED
@@ -93,23 +93,28 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
93 |
echo '</td>' . "\n";
|
94 |
/**/
|
95 |
echo '</tr>' . "\n";
|
96 |
-
echo '<tr>' . "\n";
|
97 |
-
/**/
|
98 |
-
echo '<th>' . "\n";
|
99 |
-
echo '<label for="ws-plugin--s2member-paypal-debug">' . "\n";
|
100 |
-
echo 'Enable Logging Routines?' . "\n";
|
101 |
-
echo '</label>' . "\n";
|
102 |
-
echo '</th>' . "\n";
|
103 |
/**/
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
/**/
|
112 |
-
echo '</tr>' . "\n";
|
113 |
echo '</tbody>' . "\n";
|
114 |
echo '</table>' . "\n";
|
115 |
/**/
|
@@ -134,7 +139,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
134 |
echo '<h3>PayPal® IPN / Instant Payment Notifications ( required, please enable )</h3>' . "\n";
|
135 |
echo '<p>Log into your PayPal® account and navigate to this section:<br /><code>Account Profile -> Instant Payment Notification Preferences</code></p>' . "\n";
|
136 |
echo '<p>Edit your IPN settings & turn IPN Notifications: <strong><code>On</code></strong></p>' . "\n";
|
137 |
-
echo '<p>You\'ll need your IPN URL, which is:<br /><code>' . get_bloginfo ("
|
138 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn", get_defined_vars ());
|
139 |
/**/
|
140 |
echo '<h3>More Information ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-ipn-details\').toggle(); return false;" class="ws-dotted-link">click here</a> )</h3>' . "\n";
|
@@ -149,7 +154,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
149 |
echo '<h3>IPN w/ Proxy Key ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-ipn-proxy-details\').toggle(); return false;" class="ws-dotted-link">optional, for 3rd-party integrations</a> )</h3>' . "\n";
|
150 |
echo '<div id="ws-plugin--s2member-paypal-ipn-proxy-details" style="display:none;">' . "\n";
|
151 |
echo '<p>If you\'re using a 3rd-party application that needs to POST simulated IPN transactions to your s2Member installation, you can use this alternate IPN URL, which includes a Proxy Key. This encrypted Proxy Key verifies incoming data being received by s2Member\'s IPN processor. You can change <em>[proxy-reference]</em> to whatever you like. The <em>[proxy-reference]</em> value is required, but it will only be reflected in s2Member\'s IPN log.</p>' . "\n";
|
152 |
-
echo '<input type="text" value="' . format_to_edit (get_bloginfo ("
|
153 |
echo '<p><em>Any 3rd-party application that is sending IPN transactions to your s2Member installation, must ALWAYS include the <code>custom</code> POST variable, and that variable must always start with ( <code>' . esc_html ($_SERVER["HTTP_HOST"]) . '</code> ). In addition, the <code>item_number</code> variable, must always match a format that s2Member looks for. Generally speaking, the <code>item_number</code> should be <code>1, 2, 3, or 4</code>, indicating a specific s2Member Level #. However, s2Member also uses some advanced formats in this field. Just to be sure, we suggest creating a PayPal® Button with the s2Member Button Generator, and then taking a look at the Full Button Code to see how s2Member expects <code>item_number</code> to be formatted.</em></p>' . "\n";
|
154 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_proxy", get_defined_vars ());
|
155 |
echo '</div>' . "\n";
|
@@ -170,7 +175,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
170 |
echo '<h3>PayPal® PDT Identity Token ( required, please enable )</h3>' . "\n";
|
171 |
echo '<p>Log into your PayPal® account and navigate to this section:<br /><code>Account Profile -> Website Payment Preferences</code></p>' . "\n";
|
172 |
echo '<p>Turn the Auto-Return feature: <strong><code>On</code></strong></p>' . "\n";
|
173 |
-
echo '<p>You\'ll need your Auto-Return URL, which is:<br /><code>' . get_bloginfo ("
|
174 |
echo '<p>You MUST also enable PDT ( Payment Data Transfer ): <strong><code>On</code></strong><br /><em>You\'ll be issued an Identity Token that you MUST enter below.</em></p>' . "\n";
|
175 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_pdt", get_defined_vars ());
|
176 |
/**/
|
@@ -291,14 +296,19 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
291 |
echo '<li><code>%%regular_cycle%%</code> = This is the <code>%%regular_term%%</code> from above, converted ( and reduced ) to just a cycle representation, of: <code><em>Daily, Weekly, Monthly, Yearly, or Lifetime</em></code>.</li>' . "\n";
|
292 |
echo '<li><code>%%recurring/regular_cycle%%</code> = Example ( <code>14.95 / Monthly</code> ), or ... ( <code>0 / non-recurring</code> ); depending on the value of <code>%%recurring%%</code>.</li>' . "\n";
|
293 |
echo '</ul>' . "\n";
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
302 |
echo '</td>' . "\n";
|
303 |
/**/
|
304 |
echo '</tr>' . "\n";
|
@@ -386,14 +396,19 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
386 |
echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> ( translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code> ).</li>' . "\n";
|
387 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
388 |
echo '</ul>' . "\n";
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
|
|
|
|
|
|
|
|
|
|
397 |
echo '</td>' . "\n";
|
398 |
/**/
|
399 |
echo '</tr>' . "\n";
|
@@ -417,7 +432,7 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
417 |
echo '<p>EOT = End Of Term. By default, s2Member will demote a paid Member to a Free Subscriber whenever their Subscription term has ended ( i.e. expired ), been cancelled, refunded, charged back to you, etc. s2Member demotes them to a Free Subscriber, so they will no longer have Member Level Access to your site. However, in some cases, you may prefer to have Customer accounts deleted completely, instead of just being demoted. This is where you choose which method works best for your site. If you don\'t want s2Member to take ANY action at all, you can disable s2Member\'s EOT System temporarily, or even completely.</p>' . "\n";
|
418 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_eot_behavior", get_defined_vars ());
|
419 |
/**/
|
420 |
-
echo '<p id="ws-plugin--s2member-auto-eot-system-enabled-via-cron"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? '' : ' style="display:none;"') . '>If you\'d like to run s2Member\'s Auto-EOT System through a more traditional Cron Job; instead of through <code>WP-Cron</code>, you will need to configure a Cron Job through your server control panel; provided by your hosting company. Set the Cron Job to run <code>once about every 10 minutes to an hour</code>. You\'ll want to configure an HTTP Cron Job that loads this URL:<br /><code>' . esc_html (add_query_arg ("s2member_auto_eot_system_via_cron", "1", get_bloginfo ("
|
421 |
/**/
|
422 |
echo '<table class="form-table">' . "\n";
|
423 |
echo '<tbody>' . "\n";
|
@@ -434,9 +449,10 @@ if (apply_filters ("ws_plugin__s2member_during_paypal_ops_page_during_left_secti
|
|
434 |
/**/
|
435 |
echo '<td>' . "\n";
|
436 |
echo '<select name="ws_plugin__s2member_auto_eot_system_enabled" id="ws-plugin--s2member-auto-eot-system-enabled">' . "\n";
|
437 |
-
|
|
|
438 |
echo '<option value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 1 && function_exists ("wp_cron") && wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule")) ? ' selected="selected"' : '') . '>Yes ( enable the Auto-EOT System through WP-Cron )</option>' . "\n";
|
439 |
-
echo '<option value="2"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? ' selected="selected"' : '') . '>Yes ( but, I\'ll run it with my own Cron Job )</option>' . "\n";
|
440 |
echo '<option value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? ' selected="selected"' : '') . '>No ( disable the Auto-EOT System )</option>' . "\n";
|
441 |
echo '</select><br />' . "\n";
|
442 |
echo 'Recommended setting: ( <code>Yes / enable via WP-Cron</code> )' . "\n";
|
@@ -486,7 +502,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
486 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_before_right_sections", get_defined_vars ());
|
487 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
488 |
/**/
|
489 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
490 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
491 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
492 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
93 |
echo '</td>' . "\n";
|
94 |
/**/
|
95 |
echo '</tr>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
/**/
|
97 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
98 |
+
{
|
99 |
+
echo '<tr>' . "\n";
|
100 |
+
/**/
|
101 |
+
echo '<th>' . "\n";
|
102 |
+
echo '<label for="ws-plugin--s2member-paypal-debug">' . "\n";
|
103 |
+
echo 'Enable Logging Routines?' . "\n";
|
104 |
+
echo '</label>' . "\n";
|
105 |
+
echo '</th>' . "\n";
|
106 |
+
/**/
|
107 |
+
echo '</tr>' . "\n";
|
108 |
+
echo '<tr>' . "\n";
|
109 |
+
/**/
|
110 |
+
echo '<td>' . "\n";
|
111 |
+
echo '<input type="radio" name="ws_plugin__s2member_paypal_debug" id="ws-plugin--s2member-paypal-debug-0" value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-debug-0">No</label> <input type="radio" name="ws_plugin__s2member_paypal_debug" id="ws-plugin--s2member-paypal-debug-1" value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_debug"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-debug-1">Yes, enable debugging, with API, IPN & Return Page logging.</label><br />' . "\n";
|
112 |
+
echo '<em>This enables API, IPN and Return Page logging. The log files are stored here:<br /><code>' . preg_replace ("/^" . preg_quote ($_SERVER["DOCUMENT_ROOT"], "/") . "/", "", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"]) . '</code></em>' . "\n";
|
113 |
+
echo '</td>' . "\n";
|
114 |
+
/**/
|
115 |
+
echo '</tr>' . "\n";
|
116 |
+
}
|
117 |
/**/
|
|
|
118 |
echo '</tbody>' . "\n";
|
119 |
echo '</table>' . "\n";
|
120 |
/**/
|
139 |
echo '<h3>PayPal® IPN / Instant Payment Notifications ( required, please enable )</h3>' . "\n";
|
140 |
echo '<p>Log into your PayPal® account and navigate to this section:<br /><code>Account Profile -> Instant Payment Notification Preferences</code></p>' . "\n";
|
141 |
echo '<p>Edit your IPN settings & turn IPN Notifications: <strong><code>On</code></strong></p>' . "\n";
|
142 |
+
echo '<p>You\'ll need your IPN URL, which is:<br /><code>' . get_bloginfo ("wpurl") . '/?s2member_paypal_notify=1</code></p>' . "\n";
|
143 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn", get_defined_vars ());
|
144 |
/**/
|
145 |
echo '<h3>More Information ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-ipn-details\').toggle(); return false;" class="ws-dotted-link">click here</a> )</h3>' . "\n";
|
154 |
echo '<h3>IPN w/ Proxy Key ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-ipn-proxy-details\').toggle(); return false;" class="ws-dotted-link">optional, for 3rd-party integrations</a> )</h3>' . "\n";
|
155 |
echo '<div id="ws-plugin--s2member-paypal-ipn-proxy-details" style="display:none;">' . "\n";
|
156 |
echo '<p>If you\'re using a 3rd-party application that needs to POST simulated IPN transactions to your s2Member installation, you can use this alternate IPN URL, which includes a Proxy Key. This encrypted Proxy Key verifies incoming data being received by s2Member\'s IPN processor. You can change <em>[proxy-reference]</em> to whatever you like. The <em>[proxy-reference]</em> value is required, but it will only be reflected in s2Member\'s IPN log.</p>' . "\n";
|
157 |
+
echo '<input type="text" value="' . format_to_edit (get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1&s2member_paypal_proxy=[proxy-reference]&s2member_paypal_proxy_verification=" . urlencode (ws_plugin__s2member_paypal_proxy_key_gen ())) . '" style="width:99%;" />' . "\n";
|
158 |
echo '<p><em>Any 3rd-party application that is sending IPN transactions to your s2Member installation, must ALWAYS include the <code>custom</code> POST variable, and that variable must always start with ( <code>' . esc_html ($_SERVER["HTTP_HOST"]) . '</code> ). In addition, the <code>item_number</code> variable, must always match a format that s2Member looks for. Generally speaking, the <code>item_number</code> should be <code>1, 2, 3, or 4</code>, indicating a specific s2Member Level #. However, s2Member also uses some advanced formats in this field. Just to be sure, we suggest creating a PayPal® Button with the s2Member Button Generator, and then taking a look at the Full Button Code to see how s2Member expects <code>item_number</code> to be formatted.</em></p>' . "\n";
|
159 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_proxy", get_defined_vars ());
|
160 |
echo '</div>' . "\n";
|
175 |
echo '<h3>PayPal® PDT Identity Token ( required, please enable )</h3>' . "\n";
|
176 |
echo '<p>Log into your PayPal® account and navigate to this section:<br /><code>Account Profile -> Website Payment Preferences</code></p>' . "\n";
|
177 |
echo '<p>Turn the Auto-Return feature: <strong><code>On</code></strong></p>' . "\n";
|
178 |
+
echo '<p>You\'ll need your Auto-Return URL, which is:<br /><code>' . get_bloginfo ("wpurl") . '/?s2member_paypal_return=1</code></p>' . "\n";
|
179 |
echo '<p>You MUST also enable PDT ( Payment Data Transfer ): <strong><code>On</code></strong><br /><em>You\'ll be issued an Identity Token that you MUST enter below.</em></p>' . "\n";
|
180 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_pdt", get_defined_vars ());
|
181 |
/**/
|
296 |
echo '<li><code>%%regular_cycle%%</code> = This is the <code>%%regular_term%%</code> from above, converted ( and reduced ) to just a cycle representation, of: <code><em>Daily, Weekly, Monthly, Yearly, or Lifetime</em></code>.</li>' . "\n";
|
297 |
echo '<li><code>%%recurring/regular_cycle%%</code> = Example ( <code>14.95 / Monthly</code> ), or ... ( <code>0 / non-recurring</code> ); depending on the value of <code>%%recurring%%</code>.</li>' . "\n";
|
298 |
echo '</ul>' . "\n";
|
299 |
+
/**/
|
300 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
301 |
+
{
|
302 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
303 |
+
echo '<ul>' . "\n";
|
304 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
305 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
306 |
+
echo '</ul>' . "\n";
|
307 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
308 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
309 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
310 |
+
}
|
311 |
+
/**/
|
312 |
echo '</td>' . "\n";
|
313 |
/**/
|
314 |
echo '</tr>' . "\n";
|
396 |
echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> ( translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code> ).</li>' . "\n";
|
397 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
398 |
echo '</ul>' . "\n";
|
399 |
+
/**/
|
400 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
401 |
+
{
|
402 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
403 |
+
echo '<ul>' . "\n";
|
404 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
405 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
406 |
+
echo '</ul>' . "\n";
|
407 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
408 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
409 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
410 |
+
}
|
411 |
+
/**/
|
412 |
echo '</td>' . "\n";
|
413 |
/**/
|
414 |
echo '</tr>' . "\n";
|
432 |
echo '<p>EOT = End Of Term. By default, s2Member will demote a paid Member to a Free Subscriber whenever their Subscription term has ended ( i.e. expired ), been cancelled, refunded, charged back to you, etc. s2Member demotes them to a Free Subscriber, so they will no longer have Member Level Access to your site. However, in some cases, you may prefer to have Customer accounts deleted completely, instead of just being demoted. This is where you choose which method works best for your site. If you don\'t want s2Member to take ANY action at all, you can disable s2Member\'s EOT System temporarily, or even completely.</p>' . "\n";
|
433 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_eot_behavior", get_defined_vars ());
|
434 |
/**/
|
435 |
+
echo '<p id="ws-plugin--s2member-auto-eot-system-enabled-via-cron"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? '' : ' style="display:none;"') . '>If you\'d like to run s2Member\'s Auto-EOT System through a more traditional Cron Job; instead of through <code>WP-Cron</code>, you will need to configure a Cron Job through your server control panel; provided by your hosting company. Set the Cron Job to run <code>once about every 10 minutes to an hour</code>. You\'ll want to configure an HTTP Cron Job that loads this URL:<br /><code>' . esc_html (add_query_arg ("s2member_auto_eot_system_via_cron", "1", get_bloginfo ("wpurl") . "/")) . '</code></p>' . "\n";
|
436 |
/**/
|
437 |
echo '<table class="form-table">' . "\n";
|
438 |
echo '<tbody>' . "\n";
|
449 |
/**/
|
450 |
echo '<td>' . "\n";
|
451 |
echo '<select name="ws_plugin__s2member_auto_eot_system_enabled" id="ws-plugin--s2member-auto-eot-system-enabled">' . "\n";
|
452 |
+
/* Very advanced conditionals here. If the Auto-EOT System is NOT running, or NOT fully configured, this will indicate that no option is set - as sort of a built-in warning in the UI panel. */
|
453 |
+
echo (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 1 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) || ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (function_exists ("wp_cron") && wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) || (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] && (function_exists ("wp_cron") && wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule")))) ? '<option value=""></option>' . "\n" : '';
|
454 |
echo '<option value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 1 && function_exists ("wp_cron") && wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule")) ? ' selected="selected"' : '') . '>Yes ( enable the Auto-EOT System through WP-Cron )</option>' . "\n";
|
455 |
+
echo (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()) ? '<option value="2"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] == 2 && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? ' selected="selected"' : '') . '>Yes ( but, I\'ll run it with my own Cron Job )</option>' . "\n" : '';
|
456 |
echo '<option value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"] && (!function_exists ("wp_cron") || !wp_get_schedule ("ws_plugin__s2member_auto_eot_system__schedule"))) ? ' selected="selected"' : '') . '>No ( disable the Auto-EOT System )</option>' . "\n";
|
457 |
echo '</select><br />' . "\n";
|
458 |
echo 'Recommended setting: ( <code>Yes / enable via WP-Cron</code> )' . "\n";
|
502 |
do_action ("ws_plugin__s2member_during_paypal_ops_page_before_right_sections", get_defined_vars ());
|
503 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
504 |
/**/
|
505 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
506 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
507 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
508 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/scripting.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit
|
16 |
/*
|
17 |
API Scripting page.
|
18 |
*/
|
@@ -82,13 +82,15 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
|
|
82 |
{
|
83 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_custom_capabilities", get_defined_vars ());
|
84 |
/**/
|
85 |
-
echo '<div class="ws-menu-page-group" title="Custom
|
86 |
/**/
|
87 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-capabilities-section">' . "\n";
|
88 |
echo '<h3>Packaging Together Custom Capabilities w/ Membership</h3>' . "\n";
|
89 |
echo '<p>Using the PayPal® Button Generator for s2Member, you can add Custom Capabilities in comma delimited format. s2Member builds upon existing functionality offered by WordPress® Roles/Capabilities. s2Member supports Free Subscribers ( at Level #0 ), and up to four Primary Roles ( i.e. s2Member Levels 1-4 ). Each s2Member Level provides <code>current_user_can("access_s2member_level0"), 1, 2, 3, 4</code>. These are the default Capabilities that come with each Membership Level. Now... If you\'d like to package together some variations of each Membership Level that you\'re selling, you can! All you do is add some Custom Capabilities whenever you create your PayPal® Button Code ( <em>there is a field in the Button Generator where you can enter Custom Capabilities</em> ). You can sell membership packages that come with Custom Capabilities, and even with custom prices.</p>' . "\n";
|
90 |
echo '<p>Custom Capabilities are an extension to a feature that already exists in WordPress®. The <code>current_user_can()</code> function, can be used to test for these additional Capabilities that you allow. Whenever a Member completes the checkout process, after having purchased a Membership from you ( one that included Custom Capabilities ), s2Member will add those Custom Capabilities to the account for that specific Member.</p>' . "\n";
|
91 |
echo '<p>Custom Capabilities are always prepended with <code>access_s2member_ccap_</code>. You fill in the last part, with ONLY lowercase alpha-numerics and/or underscores. For example, let\'s say you want to sell Membership Level #1, as is. But, you also want to sell a slight variation of Membership Level #1, that includes the ability to access the Music & Video sections of your site. So, instead of selling this additional access under a whole new Membership Level, you could just sell a modified version of Membership Level #1. Add the the Custom Capabilities: <code>music,videos</code>. Once a Member has these Capabilities, you can test for these Capabilities using <code>current_user_can("access_s2member_ccap_music")</code> and <code>current_user_can("access_s2member_ccap_videos")</code>.</p>' . "\n";
|
|
|
|
|
92 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_custom_capabilities", get_defined_vars ());
|
93 |
/**/
|
94 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
@@ -98,9 +100,6 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
|
|
98 |
/**/
|
99 |
echo '<p><strong>Custom Capabilities:</strong> ( ebooks,reports,tips ):</p>' . "\n";
|
100 |
echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-ccaps-2.php"), true) . '</p>' . "\n";
|
101 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
102 |
-
/**/
|
103 |
-
echo '<p>The important thing to realize, is that Custom Capabilities, are just that. They\'re custom. s2Member only deals with the default Capabilities that it uses. If you start using Custom Capabilities, you MUST use Advanced Conditionals ( <em>i.e. the <code>current_user_can()</code> function</em> ) to test for them. Either in your theme files, or in Posts/Pages using the <a href="http://wordpress.org/extend/plugins/exec-php/" target="_blank" rel="external">Exec-PHP</a> plugin.</p>' . "\n";
|
104 |
echo '</div>' . "\n";
|
105 |
/**/
|
106 |
echo '</div>' . "\n";
|
@@ -172,7 +171,7 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
|
|
172 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-profile-modifications-section">' . "\n";
|
173 |
echo '<h3>Giving Members The Ability To Modify Their Profile</h3>' . "\n";
|
174 |
echo '<p>s2Member can be configured to redirect Members away from the <a href="profile.php" target="_blank" rel="external">default Profile Editing Panel</a> that is built into WordPress®. <em>See: <code>s2Member -> General Options -> Profile Modifications</code>.</em> When/if a Member attempts to access the default Profile Editing Panel, they\'ll instead, be redirected to the Login Welcome Page that you\'ve configured through s2Member. <strong>Why would I redirect?</strong> Unless you\'ve made some drastic modifications to your WordPress® installation, the default Profile Editing Panel that ships with WordPress®, is NOT really suited for public access, even by a Member.</p>' . "\n";
|
175 |
-
echo '<p>So instead of using this default Profile Editing Panel; s2Member creates an added layer of functionality, on top of WordPress®. It does this by providing you ( as the site owner ), with the ability to send your Members to a <a href="' . get_bloginfo ("
|
176 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_profile_modifications", get_defined_vars ());
|
177 |
/**/
|
178 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
@@ -539,7 +538,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
539 |
do_action ("ws_plugin__s2member_during_scripting_page_before_right_sections", get_defined_vars ());
|
540 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
541 |
/**/
|
542 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
543 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
544 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
545 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
API Scripting page.
|
18 |
*/
|
82 |
{
|
83 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_custom_capabilities", get_defined_vars ());
|
84 |
/**/
|
85 |
+
echo '<div class="ws-menu-page-group" title="Custom Capabilities ( Packages )">' . "\n";
|
86 |
/**/
|
87 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-capabilities-section">' . "\n";
|
88 |
echo '<h3>Packaging Together Custom Capabilities w/ Membership</h3>' . "\n";
|
89 |
echo '<p>Using the PayPal® Button Generator for s2Member, you can add Custom Capabilities in comma delimited format. s2Member builds upon existing functionality offered by WordPress® Roles/Capabilities. s2Member supports Free Subscribers ( at Level #0 ), and up to four Primary Roles ( i.e. s2Member Levels 1-4 ). Each s2Member Level provides <code>current_user_can("access_s2member_level0"), 1, 2, 3, 4</code>. These are the default Capabilities that come with each Membership Level. Now... If you\'d like to package together some variations of each Membership Level that you\'re selling, you can! All you do is add some Custom Capabilities whenever you create your PayPal® Button Code ( <em>there is a field in the Button Generator where you can enter Custom Capabilities</em> ). You can sell membership packages that come with Custom Capabilities, and even with custom prices.</p>' . "\n";
|
90 |
echo '<p>Custom Capabilities are an extension to a feature that already exists in WordPress®. The <code>current_user_can()</code> function, can be used to test for these additional Capabilities that you allow. Whenever a Member completes the checkout process, after having purchased a Membership from you ( one that included Custom Capabilities ), s2Member will add those Custom Capabilities to the account for that specific Member.</p>' . "\n";
|
91 |
echo '<p>Custom Capabilities are always prepended with <code>access_s2member_ccap_</code>. You fill in the last part, with ONLY lowercase alpha-numerics and/or underscores. For example, let\'s say you want to sell Membership Level #1, as is. But, you also want to sell a slight variation of Membership Level #1, that includes the ability to access the Music & Video sections of your site. So, instead of selling this additional access under a whole new Membership Level, you could just sell a modified version of Membership Level #1. Add the the Custom Capabilities: <code>music,videos</code>. Once a Member has these Capabilities, you can test for these Capabilities using <code>current_user_can("access_s2member_ccap_music")</code> and <code>current_user_can("access_s2member_ccap_videos")</code>.</p>' . "\n";
|
92 |
+
echo '<p>The important thing to realize, is that Custom Capabilities, are just that. They\'re custom. s2Member only deals with the default Capabilities that it uses. If you start using Custom Capabilities, you MUST use Advanced Conditionals ( <em>i.e. the <code>current_user_can()</code> function</em> ) to test for them. Either in your theme files, or in Posts/Pages using the <a href="http://wordpress.org/extend/plugins/exec-php/" target="_blank" rel="external">Exec-PHP</a> plugin.</p>' . "\n";
|
93 |
+
echo '<p><em class="ws-menu-page-hilite"><strong>*Tip*</strong> Starting with s2Member v3.2+, you can now tell s2Member to require Custom Capabilities on a per Post/Page basis. So now, s2Member ( if you prefer ) can handle Custom Capabilities for you! Whenever you edit a Post/Page, you can tell s2Member to require certain Custom Capabilities that you type in, using comma delimited format. In other words, you will need to type in some of the trigger words that you used whenever you created your PayPal® Pro Forms and/or PayPal® Buttons. This way your Members will have the proper Capabilities to view different kinds of content that you offer.</em></p>' . "\n";
|
94 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_custom_capabilities", get_defined_vars ());
|
95 |
/**/
|
96 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
100 |
/**/
|
101 |
echo '<p><strong>Custom Capabilities:</strong> ( ebooks,reports,tips ):</p>' . "\n";
|
102 |
echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-ccaps-2.php"), true) . '</p>' . "\n";
|
|
|
|
|
|
|
103 |
echo '</div>' . "\n";
|
104 |
/**/
|
105 |
echo '</div>' . "\n";
|
171 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-profile-modifications-section">' . "\n";
|
172 |
echo '<h3>Giving Members The Ability To Modify Their Profile</h3>' . "\n";
|
173 |
echo '<p>s2Member can be configured to redirect Members away from the <a href="profile.php" target="_blank" rel="external">default Profile Editing Panel</a> that is built into WordPress®. <em>See: <code>s2Member -> General Options -> Profile Modifications</code>.</em> When/if a Member attempts to access the default Profile Editing Panel, they\'ll instead, be redirected to the Login Welcome Page that you\'ve configured through s2Member. <strong>Why would I redirect?</strong> Unless you\'ve made some drastic modifications to your WordPress® installation, the default Profile Editing Panel that ships with WordPress®, is NOT really suited for public access, even by a Member.</p>' . "\n";
|
174 |
+
echo '<p>So instead of using this default Profile Editing Panel; s2Member creates an added layer of functionality, on top of WordPress®. It does this by providing you ( as the site owner ), with the ability to send your Members to a <a href="' . get_bloginfo ("wpurl") . '/?s2member_profile=1" target="_blank" rel="external">special Stand-Alone page</a>, where your Members can modify their entire Profile, including all Custom Fields, and their Password. This special Stand-Alone Editing Panel, has been designed ( with a bare-bones format ), intentionally. This makes it possible for you to <a href="#" onclick="if(!window.open(\'' . get_bloginfo ("wpurl") . '/?s2member_profile=1\', \'_popup\', \'height=350,width=400,left=100,screenX=100,top=100,screenY=100, location=0,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1\')) alert(\'Please disable popup blockers and try again!\'); return false;" rel="external">open it up in a popup window</a>, or embed it into your Login Welcome Page using an IFRAME. Code samples are provided below.</p>' . "\n";
|
175 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_profile_modifications", get_defined_vars ());
|
176 |
/**/
|
177 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
538 |
do_action ("ws_plugin__s2member_during_scripting_page_before_right_sections", get_defined_vars ());
|
539 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
540 |
/**/
|
541 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
542 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
543 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
544 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/start.inc.php
CHANGED
@@ -34,13 +34,14 @@ if (apply_filters ("ws_plugin__s2member_during_start_page_during_left_sections_d
|
|
34 |
{
|
35 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_before_registration_process", get_defined_vars ());
|
36 |
/**/
|
37 |
-
echo '<div class="ws-menu-page-group" title="The Registration Process"
|
38 |
/**/
|
39 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-process-section">' . "\n";
|
40 |
echo '<h3>The Subscription Signup/Registration Process</h3>' . "\n";
|
41 |
echo '<p>1. Internet Users will go to your Membership Options Page ( which you\'ll need to configure on the s2Member General Options panel ). On this Membership Options Page, that YOU will create in WordPress®, you\'ll insert the PayPal® Subscription Buttons that were generated for you by s2Member.</p>' . "\n";
|
42 |
-
echo '<p>2. An Internet User will click on a PayPal® Subscription Button from your Membership Options Page. They will be transferred over to PayPal® in order to agree to your membership terms and pricing. You can customize the Checkout Page Style, Pricing, Payment Periods, and more whenever you generate your PayPal® Buttons through s2Member.</p>' . "\n";
|
43 |
-
echo '<p>3. Once a User has completed the Subscription Signup Process at PayPal®, they\'ll be returned to your site, where they\'ll be activated by s2Member instantly, and given the opportunity to register a Username & Password for their membership. ( Note: they\'ll be allowed to register a Username & Password, even if you\'ve set \'Anyone Can Register\' to `Off` in your General WordPress® options; because s2Member identifies the User as having paid for membership access through PayPal® )
|
|
|
44 |
echo '<p>4. Once a User has completed checkout and registered a Username & Password, they\'ll be able to login. The first page they\'ll see after logging in, will be your Login Welcome Page ( which you\'ll need to configure on the s2Member General Options panel ). Your Login Welcome Page can contain whatever you like. You\'ll need to design this Page in WordPress®, and be creative!</p>' . "\n";
|
45 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_registration_process", get_defined_vars ());
|
46 |
echo '</div>' . "\n";
|
@@ -58,8 +59,8 @@ if (apply_filters ("ws_plugin__s2member_during_start_page_during_left_sections_d
|
|
58 |
/**/
|
59 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-login-reg-form-section">' . "\n";
|
60 |
echo '<h3>Your Login/Registration Form ( already built-in )</h3>' . "\n";
|
61 |
-
echo '<p>s2Member uses the existing WordPress® Login/Registration system. This is the same Login/Registration Form that you use to access your WP® Dashboard. However, with s2Member installed, your Login/Registration
|
62 |
-
echo '<p>Since s2Member uses the default Login/Registration system for WordPress®, s2Member is also compatible with themes, and other plugins ( such as BuddyPress ). If your theme has a
|
63 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_log_reg_form", get_defined_vars ());
|
64 |
echo '</div>' . "\n";
|
65 |
/**/
|
@@ -112,7 +113,7 @@ if (apply_filters ("ws_plugin__s2member_during_start_page_during_left_sections_d
|
|
112 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-general-options-section">' . "\n";
|
113 |
echo '<h3>Your s2Member -> General Options ( basic configuration )</h3>' . "\n";
|
114 |
echo '<p>Once you have a Login Welcome Page, and a Membership Options Page. Go to: <code>s2Member -> General Options</code>.</p>' . "\n";
|
115 |
-
echo '<p>From your s2Member General Options Panel, you may restrict access to certain Posts, Pages, Tags, Categories, and/or URIs based on a Member\'s Level. The s2Member Options Panel makes it easy for you. All you do is type in the basics of what you want to restrict access to, and those sections of your site will be off limits to non-Members. That being said, there are times when you might need to have greater control over which portions of your site can be viewed by non-Members, or Members at different Levels. This is where API Scripting with Advanced Conditionals comes in. <em>For more information, see: <code>s2Member -> API Scripting</code></em
|
116 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_general_options", get_defined_vars ());
|
117 |
echo '</div>' . "\n";
|
118 |
/**/
|
@@ -132,7 +133,6 @@ if (apply_filters ("ws_plugin__s2member_during_start_page_during_left_sections_d
|
|
132 |
echo '<p>You\'ll be happy to know that s2Member handles cancellations, expirations, failed payments, terminations ( e.g. refunds & chargebacks ) for you automatically. If you log into your PayPal® account and cancel a Member\'s Subscription, or, if the Member logs into their PayPal® account and cancels their own Subscription, s2Member will be notified of these important changes and react accordingly through the PayPal® IPN service that runs silently behind-the-scene.</p>' . "\n";
|
133 |
echo '<p>The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds & chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</p>' . "\n";
|
134 |
echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s membership privileges when PayPal® sends a <code>subscr_eot</code> notification via the IPN service, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
|
135 |
-
echo '<p><em><strong>*2010 PayPal® Accounts*</strong> s2Member has been updated to support newer PayPal® accounts ( those opened after Oct 15th, 2009 ). Newer PayPal® accounts do NOT send an <strong>IPN</strong>/<code>subscr_eot</code> in all cases. s2Member deals with this gracefully, by keeping a record of payments/periods/changes, and monitoring other signals sent by PayPal® over an extended period. This allows s2Member to take control of the situation at the appropriate time, using s2Member\'s built-in Auto-EOT System. The communication from PayPal® -> s2Member is seamless; even in PayPal® accounts created after October 15th, 2009. You can learn more about <code>subscr_eot</code> changes <a href="https://www.x.com/search.jspa?q=subscr+eot" target="_blank" rel="external">here</a>.</em></p>' . "\n";
|
136 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_automation_process", get_defined_vars ());
|
137 |
echo '</div>' . "\n";
|
138 |
/**/
|
@@ -149,7 +149,7 @@ if (apply_filters ("ws_plugin__s2member_during_start_page_during_left_sections_d
|
|
149 |
/**/
|
150 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-upgrading-downgrading-section">' . "\n";
|
151 |
echo '<h3>Upgrading And/Or Downgrading User Accounts</h3>' . "\n";
|
152 |
-
echo '<p>s2Member builds upon existing functionality offered through WordPress® Roles and Capabilities. From your WordPress® Dashboard, go to: <code>Users -> Authors & Users</code>. You can use
|
153 |
echo '<p>All financial details, such as pricing, trial periods, subscription lengths, refunds, and other Customer service issues; should be handled by YOU, through your PayPal® account, and NOT through WordPress®. Feel free to modify your Members\' Subscriptions via PayPal® as often as you like. s2Member will be notified through the PayPal® IPN service behind-the-scene automatically. For example... If you log into PayPal® and cancel a Members\'s paid Subscription, s2Member will be notified by PayPal® behind-the-scene, and s2Member will remove their membership privileges at the correct point in time.</p>' . "\n";
|
154 |
echo '<p>That being said, if you log into your WordPress® Dashboard and delete a Member\'s account, you will still need to log into PayPal® and cancel billing for the account you deleted. In other words, s2Member can be notified automatically about actions you take inside PayPal\'s interface, but PayPal® CANNOT be notified of actions you take inside your WordPress® Dashboard. At least, not in an automated fashion, as that would create a security issue for PayPal®. So... automation works seamlessly from PayPal® -> to s2Member, but NOT the other way around.</p>' . "\n";
|
155 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_upgrading_downgrading", get_defined_vars ());
|
@@ -160,20 +160,12 @@ if (apply_filters ("ws_plugin__s2member_during_start_page_during_left_sections_d
|
|
160 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-subscription-modification-section">' . "\n";
|
161 |
echo '<h3>Giving Members The Ability To Modify Their Own Subscription</h3>' . "\n";
|
162 |
echo '<p>If you\'d like to give your Members ( and/or your Free Subscribers ) the ability to modify their billing plan, by switching to a more expensive option, or a less expensive option; generate a new PayPal® Modification Button, using the s2Member PayPal® Button Generator. Configure the updated Level, pricing, terms, etc. Then, make that new Modification Button available to Members who are logged into their existing account with you. For example, you might want to insert a "Level #2" Upgrade Button into your Login Welcome Page, which would up-sell existing Level #1 Members to a more expensive plan that you offer.</p>' . "\n";
|
163 |
-
echo '<p><em><strong>*Modification Process*</strong> When you send a Member to PayPal® using a Subscription Modification Button, PayPal® will ask them to login. Once they\'re logged in, instead of being able to signup for a new membership, PayPal® will provide them with the ability to upgrade and/or downgrade their existing membership with you, by allowing them to switch to the Membership Plan that was specified in the Subscription Modification Button. PayPal® handles this nicely, and you\'ll be happy to know that s2Member has been pre-configured to deal with this scenario as well, so that everything remains automated. Their Membership Access Level will either be promoted, or demoted, based on the actions they took at PayPal® during the modification process. Once an existing Member completes their Subscription Modification at PayPal®, they\'ll be brought back to their Login Welcome Page, instead of
|
164 |
echo '<p><em><strong>*Also Works For Free Subscribers*</strong> Although a Free Subscriber does not have an existing PayPal® Subscription, s2Member is capable of adapting to this scenario gracefully. Just make sure that your existing Free Subscribers ( the ones who wish to upgrade ) pay for their Membership through a Modification Button generated by s2Member. That will allow them to continue using their existing account with you. In other words, they can keep their existing Username ( and anything already associated with that Username ), rather than being forced to re-register after checkout.</em></p>' . "\n";
|
165 |
echo '<p><em><strong>*Make It More User-Friendly*</strong> You can make the Subscription Modification Process, more user-friendly, by setting up a <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can tell s2Member to use that Page Style whenever you generate your Button Code. See: s2Member® -> PayPal Buttons.\'); return false;">Custom Page Style at PayPal®</a>, specifically for Subscription Modification Buttons. Use a custom header image, with a brief explanation to the Customer. Something like, "Log into PayPal®", "You can Modify your Subscription!".</em></p>' . "\n";
|
166 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_before_upgrading_downgrading_modifications", get_defined_vars ());
|
167 |
echo '</div>' . "\n";
|
168 |
/**/
|
169 |
-
echo '<div class="ws-menu-page-hr ws-plugin--s2member-subscription-modification-section-hr"></div>' . "\n";
|
170 |
-
/**/
|
171 |
-
echo '<div class="ws-menu-page-section ws-plugin--s2member-subscription-modification-section">' . "\n";
|
172 |
-
echo '<h3>Upgrading Free Subscribers To Paid Members ( same technique )</h3>' . "\n";
|
173 |
-
echo '<p>Same technique as above. This also works for Free Subscribers. Although a Free Subscriber does not have an existing PayPal® Subscription, s2Member is capable of adapting to this scenario gracefully. Just make sure that your existing Free Subscribers ( the ones who wish to upgrade ) pay for their Membership through a Modification Button generated by s2Member. That will allow them to continue using their existing account with you. In other words, they can keep their existing Username ( and anything already associated with that Username ), rather than being forced to re-register after checkout.</p>' . "\n";
|
174 |
-
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_before_upgrading_downgrading_free_modifications", get_defined_vars ());
|
175 |
-
echo '</div>' . "\n";
|
176 |
-
/**/
|
177 |
echo '</div>' . "\n";
|
178 |
/**/
|
179 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_after_upgrading_downgrading", get_defined_vars ());
|
@@ -188,7 +180,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
188 |
do_action ("ws_plugin__s2member_during_start_page_before_right_sections", get_defined_vars ());
|
189 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
190 |
/**/
|
191 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
192 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
193 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
194 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
34 |
{
|
35 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_before_registration_process", get_defined_vars ());
|
36 |
/**/
|
37 |
+
echo '<div class="ws-menu-page-group" title="The Registration Process">' . "\n";
|
38 |
/**/
|
39 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-process-section">' . "\n";
|
40 |
echo '<h3>The Subscription Signup/Registration Process</h3>' . "\n";
|
41 |
echo '<p>1. Internet Users will go to your Membership Options Page ( which you\'ll need to configure on the s2Member General Options panel ). On this Membership Options Page, that YOU will create in WordPress®, you\'ll insert the PayPal® Subscription Buttons that were generated for you by s2Member.</p>' . "\n";
|
42 |
+
echo '<p>2. An Internet User will click on a PayPal® Subscription Button from your Membership Options Page. They will be transferred over to PayPal® in order to agree to your membership terms and pricing. You can customize the Checkout Page Style, Pricing, Payment Periods, and more - whenever you generate your PayPal® Buttons through s2Member.</p>' . "\n";
|
43 |
+
echo '<p>3. Once a User has completed the Subscription Signup Process at PayPal®, they\'ll be returned to your site, where they\'ll be activated by s2Member instantly, and given the opportunity to register a Username & Password for their membership. ( Note: they\'ll be allowed to register a Username & Password, even if you\'ve set \'Anyone Can Register\' to `Off` in your General WordPress® options; because s2Member identifies the User as having paid for membership access through PayPal® ).</p>' . "\n";
|
44 |
+
echo '<p>s2Member will also send the User an email with instructions on how to register their Username & Password, just in case they missed the instructions after checkout. That email will be sent to their PayPal® email address. Much of this is handled through the PayPal® IPN service behind-the-scene, where PayPal® and s2Member communicate with each other.</p>' . "\n";
|
45 |
echo '<p>4. Once a User has completed checkout and registered a Username & Password, they\'ll be able to login. The first page they\'ll see after logging in, will be your Login Welcome Page ( which you\'ll need to configure on the s2Member General Options panel ). Your Login Welcome Page can contain whatever you like. You\'ll need to design this Page in WordPress®, and be creative!</p>' . "\n";
|
46 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_registration_process", get_defined_vars ());
|
47 |
echo '</div>' . "\n";
|
59 |
/**/
|
60 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-login-reg-form-section">' . "\n";
|
61 |
echo '<h3>Your Login/Registration Form ( already built-in )</h3>' . "\n";
|
62 |
+
echo '<p>s2Member uses the existing WordPress® Login/Registration system. This is the same Login/Registration Form that you use to access your WP® Dashboard. However, with s2Member installed, your Login/Registration Forms can be customized <em>( re-branded )</em>. <em>See: <code>s2Member -> General Options -> Login/Registration Design</code>.</em> You can make the default Login/Registration Forms match your WordPress® theme design; by changing the background color/image, your logo image, add Custom Fields, and more<em>!</em></p>' . "\n";
|
63 |
+
echo '<p>Since s2Member uses the default Login/Registration system for WordPress®, s2Member is also compatible with themes, and other plugins ( such as BuddyPress ). If your theme has a login form built-in already, chances are, it\'s perfectly compatible with s2Member. There are also many plugins available that are designed to place login forms into your Sidebar; and many of those are also compatible with s2Member\'s integration.</p>' . "\n";
|
64 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_log_reg_form", get_defined_vars ());
|
65 |
echo '</div>' . "\n";
|
66 |
/**/
|
113 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-general-options-section">' . "\n";
|
114 |
echo '<h3>Your s2Member -> General Options ( basic configuration )</h3>' . "\n";
|
115 |
echo '<p>Once you have a Login Welcome Page, and a Membership Options Page. Go to: <code>s2Member -> General Options</code>.</p>' . "\n";
|
116 |
+
echo '<p>From your s2Member General Options Panel, you may restrict access to certain Posts, Pages, Tags, Categories, and/or URIs based on a Member\'s Level. The s2Member Options Panel makes it easy for you. All you do is type in the basics of what you want to restrict access to, and those sections of your site will be off limits to non-Members.' . ((!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ()) ? ' That being said, there are times when you might need to have greater control over which portions of your site can be viewed by non-Members, or Members at different Levels. This is where API Scripting with Advanced Conditionals comes in. <em>For more information, see: <code>s2Member -> API Scripting</code></em>.' : '') . '</p>' . "\n";
|
117 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_general_options", get_defined_vars ());
|
118 |
echo '</div>' . "\n";
|
119 |
/**/
|
133 |
echo '<p>You\'ll be happy to know that s2Member handles cancellations, expirations, failed payments, terminations ( e.g. refunds & chargebacks ) for you automatically. If you log into your PayPal® account and cancel a Member\'s Subscription, or, if the Member logs into their PayPal® account and cancels their own Subscription, s2Member will be notified of these important changes and react accordingly through the PayPal® IPN service that runs silently behind-the-scene.</p>' . "\n";
|
134 |
echo '<p>The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds & chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</p>' . "\n";
|
135 |
echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s membership privileges when PayPal® sends a <code>subscr_eot</code> notification via the IPN service, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
|
|
|
136 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_automation_process", get_defined_vars ());
|
137 |
echo '</div>' . "\n";
|
138 |
/**/
|
149 |
/**/
|
150 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-upgrading-downgrading-section">' . "\n";
|
151 |
echo '<h3>Upgrading And/Or Downgrading User Accounts</h3>' . "\n";
|
152 |
+
echo '<p>s2Member builds upon existing functionality offered through WordPress® Roles and Capabilities. From your WordPress® Dashboard, go to: <code>Users -> Authors & Users</code>. You can use bulk actions to modify Member Access Levels all at once, or click on an individual Member account to modify only their specific Access Level. If you want to temporarily demote a Member so they cannot access membership privileges, set their Role to Subscriber. When you\'re ready to give them their membership privileges back, change their Role back to one of the s2Member Levels.</p>' . "\n";
|
153 |
echo '<p>All financial details, such as pricing, trial periods, subscription lengths, refunds, and other Customer service issues; should be handled by YOU, through your PayPal® account, and NOT through WordPress®. Feel free to modify your Members\' Subscriptions via PayPal® as often as you like. s2Member will be notified through the PayPal® IPN service behind-the-scene automatically. For example... If you log into PayPal® and cancel a Members\'s paid Subscription, s2Member will be notified by PayPal® behind-the-scene, and s2Member will remove their membership privileges at the correct point in time.</p>' . "\n";
|
154 |
echo '<p>That being said, if you log into your WordPress® Dashboard and delete a Member\'s account, you will still need to log into PayPal® and cancel billing for the account you deleted. In other words, s2Member can be notified automatically about actions you take inside PayPal\'s interface, but PayPal® CANNOT be notified of actions you take inside your WordPress® Dashboard. At least, not in an automated fashion, as that would create a security issue for PayPal®. So... automation works seamlessly from PayPal® -> to s2Member, but NOT the other way around.</p>' . "\n";
|
155 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_upgrading_downgrading", get_defined_vars ());
|
160 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-subscription-modification-section">' . "\n";
|
161 |
echo '<h3>Giving Members The Ability To Modify Their Own Subscription</h3>' . "\n";
|
162 |
echo '<p>If you\'d like to give your Members ( and/or your Free Subscribers ) the ability to modify their billing plan, by switching to a more expensive option, or a less expensive option; generate a new PayPal® Modification Button, using the s2Member PayPal® Button Generator. Configure the updated Level, pricing, terms, etc. Then, make that new Modification Button available to Members who are logged into their existing account with you. For example, you might want to insert a "Level #2" Upgrade Button into your Login Welcome Page, which would up-sell existing Level #1 Members to a more expensive plan that you offer.</p>' . "\n";
|
163 |
+
echo '<p><em><strong>*Modification Process*</strong> When you send a Member to PayPal® using a Subscription Modification Button, PayPal® will ask them to login. Once they\'re logged in, instead of being able to signup for a new membership, PayPal® will provide them with the ability to upgrade and/or downgrade their existing membership with you, by allowing them to switch to the Membership Plan that was specified in the Subscription Modification Button. PayPal® handles this nicely, and you\'ll be happy to know that s2Member has been pre-configured to deal with this scenario as well, so that everything remains automated. Their Membership Access Level will either be promoted, or demoted, based on the actions they took at PayPal® during the modification process. Once an existing Member completes their Subscription Modification at PayPal®, they\'ll be brought back to their Login Welcome Page, instead of sending them to a registration screen.</em></p>' . "\n";
|
164 |
echo '<p><em><strong>*Also Works For Free Subscribers*</strong> Although a Free Subscriber does not have an existing PayPal® Subscription, s2Member is capable of adapting to this scenario gracefully. Just make sure that your existing Free Subscribers ( the ones who wish to upgrade ) pay for their Membership through a Modification Button generated by s2Member. That will allow them to continue using their existing account with you. In other words, they can keep their existing Username ( and anything already associated with that Username ), rather than being forced to re-register after checkout.</em></p>' . "\n";
|
165 |
echo '<p><em><strong>*Make It More User-Friendly*</strong> You can make the Subscription Modification Process, more user-friendly, by setting up a <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can tell s2Member to use that Page Style whenever you generate your Button Code. See: s2Member® -> PayPal Buttons.\'); return false;">Custom Page Style at PayPal®</a>, specifically for Subscription Modification Buttons. Use a custom header image, with a brief explanation to the Customer. Something like, "Log into PayPal®", "You can Modify your Subscription!".</em></p>' . "\n";
|
166 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_before_upgrading_downgrading_modifications", get_defined_vars ());
|
167 |
echo '</div>' . "\n";
|
168 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
echo '</div>' . "\n";
|
170 |
/**/
|
171 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_after_upgrading_downgrading", get_defined_vars ());
|
180 |
do_action ("ws_plugin__s2member_during_start_page_before_right_sections", get_defined_vars ());
|
181 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
182 |
/**/
|
183 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
184 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
185 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
186 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/menu-pages/trk-ops.inc.php
CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
-
exit("Do not access this file directly.");
|
16 |
/*
|
17 |
API Tracking page.
|
18 |
*/
|
@@ -42,7 +42,7 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
|
|
42 |
/**/
|
43 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-tracking-section">' . "\n";
|
44 |
echo '<h3>Membership Signup Tracking Codes ( optional )</h3>' . "\n";
|
45 |
-
echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . ((ws_plugin__s2member_is_multisite_farm ()) ? '' : ' and/or PHP') . ' code that you enter below, will be loaded up in a web browser, after a Customer returns from a successful Signup through PayPal®. Tracking Codes are only displayed/processed one time for each Customer. s2Member will display your Tracking Codes in one of three possible locations... <strong>1.</strong> If possible, on the Registration Form, after returning from PayPal®. <strong>2.</strong> Otherwise, if possible, on the Login Form after Registration is completed. <strong>3.</strong> Otherwise, in the footer of your WordPress® theme, after the Customer\'s very first Login.</p>' . "\n";
|
46 |
echo '<p>Signup Tracking Codes are displayed for all types of Membership Level Access. Including: Recurring Subscriptions ( with or without a free trial period ), Non-Recurring Subscriptions ( with or without a free trial period ), Lifetime Subscriptions, and even Fixed-Term Subscriptions. All of these are supported by s2Member\'s Button/Form Generators, and all of these are supported here.</p>' . "\n";
|
47 |
do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_signup_tracking", get_defined_vars ());
|
48 |
/**/
|
@@ -61,7 +61,7 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
|
|
61 |
/**/
|
62 |
echo '<td>' . "\n";
|
63 |
echo '<textarea name="ws_plugin__s2member_signup_tracking_codes" id="ws-plugin--s2member-signup-tracking-codes" rows="8" wrap="off" spellcheck="false" style="font-family:Consolas, monospace;">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"]) . '</textarea><br />' . "\n";
|
64 |
-
echo 'Any valid XHTML / JavaScript' . ((ws_plugin__s2member_is_multisite_farm ()) ? '' : ' ( or even PHP )') . ' code will work just fine here. Just try not to put anything here that would actually be visible to the Customer. Things like 1x1 pixel images that load up silently and/or JavaScript tracking routines will be fine. Google® Analytics code works just fine, AdSense® performance tracking, as well as Yahoo® tracking and other affiliate network codes are all OK here.<br /><br />' . "\n";
|
65 |
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
|
66 |
echo '<ul>' . "\n";
|
67 |
echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remains constant throughout any & all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase.\\n\\nPayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime & Fixed-Term Subscriptions are NOT recurring ( i.e. there is only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
|
@@ -77,14 +77,19 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
|
|
77 |
echo '<li><code>%%initial_term%%</code> = This is the term length of the initial period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D ( this means 1 Day )\\n%%initial_term%% = 1 W ( this means 1 Week )\\n%%initial_term%% = 1 M ( this means 1 Month )\\n%%initial_term%% = 1 Y ( this means 1 Year )\\n\\nThe initial period never recurs, so this only lasts for the term length specified, then it is over. If no initial period was even offered, the value of %%initial_term%% will just be: 0 D, meaning zero days.\'); return false;">?</a> ]</li>' . "\n";
|
78 |
echo '<li><code>%%regular_term%%</code> = This is the term length of the regular period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D ( this means 1 Day )\\n%%regular_term%% = 1 W ( this means 1 Week )\\n%%regular_term%% = 1 M ( this means 1 Month )\\n%%regular_term%% = 1 Y ( this means 1 Year )\\n%%regular_term%% = 1 L ( this means 1 Lifetime )\\n\\nThe regular term is usually recurring. So the regular term value represents the period ( or duration ) of each recurring period. If %%recurring%% = 0, then the regular term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their membership privileges are going to last after the %%initial_term%% has expired, if there was an initial term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
|
79 |
echo '</ul>' . "\n";
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
88 |
echo '</td>' . "\n";
|
89 |
/**/
|
90 |
echo '</tr>' . "\n";
|
@@ -105,7 +110,7 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
|
|
105 |
/**/
|
106 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-tracking-section">' . "\n";
|
107 |
echo '<h3>Tracking Codes For Specific Post/Page Access ( optional )</h3>' . "\n";
|
108 |
-
echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . ((ws_plugin__s2member_is_multisite_farm ()) ? '' : ' and/or PHP') . ' code that you enter below, will be loaded up in a web browser, after a Customer returns from a successful transaction at PayPal®; specifically for Post/Page Access. These Codes are NOT injected for any type of Member Level Access. These are only for Specific Post/Page transactions. The Tracking Codes that you enter below, will be displayed in the footer section of your WordPress® theme, after a Customer returns from PayPal®.</p>' . "\n";
|
109 |
do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_sp_tracking", get_defined_vars ());
|
110 |
/**/
|
111 |
echo '<table class="form-table">' . "\n";
|
@@ -123,7 +128,7 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
|
|
123 |
/**/
|
124 |
echo '<td>' . "\n";
|
125 |
echo '<textarea name="ws_plugin__s2member_sp_tracking_codes" id="ws-plugin--s2member-sp-tracking-codes" rows="8" wrap="off" spellcheck="false" style="font-family:Consolas, monospace;">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_tracking_codes"]) . '</textarea><br />' . "\n";
|
126 |
-
echo 'Any valid XHTML / JavaScript' . ((ws_plugin__s2member_is_multisite_farm ()) ? '' : ' ( or even PHP )') . ' code will work just fine here. Just try not to put anything here that would actually be visible to the Customer. Things like 1x1 pixel images that load up silently and/or JavaScript tracking routines will be fine. Google® Analytics code works just fine, AdSense® performance tracking, as well as Yahoo® tracking and other affiliate network codes are all OK here.<br /><br />' . "\n";
|
127 |
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
|
128 |
echo '<ul>' . "\n";
|
129 |
echo '<li><code>%%txn_id%%</code> = The PayPal® Transaction ID. PayPal® assigns a unique identifier for every purchase.</li>' . "\n";
|
@@ -135,14 +140,19 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
|
|
135 |
echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> ( translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code> ).</li>' . "\n";
|
136 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
137 |
echo '</ul>' . "\n";
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
146 |
echo '</td>' . "\n";
|
147 |
/**/
|
148 |
echo '</tr>' . "\n";
|
@@ -215,7 +225,7 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
|
|
215 |
/**/
|
216 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-other-methods-section">' . "\n";
|
217 |
echo '<h3>Other Tracking Methods Are Available ( there\'s always a way )</h3>' . "\n";
|
218 |
-
echo '<p>Check the s2Member API Notifications panel. You\'ll find additional layers of automation available through the use of the `Signup`, `Registration`, `Payment`, `EOT/Deletion`, `Refund/Reversal`, and `Specific Post/Page`
|
219 |
do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_other_methods", get_defined_vars ());
|
220 |
echo '</div>' . "\n";
|
221 |
/**/
|
@@ -239,7 +249,7 @@ echo '<td class="ws-menu-page-table-r">' . "\n";
|
|
239 |
do_action ("ws_plugin__s2member_during_trk_ops_page_before_right_sections", get_defined_vars ());
|
240 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
241 |
/**/
|
242 |
-
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module /
|
243 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
244 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
245 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
12 |
Direct access denial.
|
13 |
*/
|
14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
15 |
+
exit ("Do not access this file directly.");
|
16 |
/*
|
17 |
API Tracking page.
|
18 |
*/
|
42 |
/**/
|
43 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-tracking-section">' . "\n";
|
44 |
echo '<h3>Membership Signup Tracking Codes ( optional )</h3>' . "\n";
|
45 |
+
echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? '' : ' and/or PHP') . ' code that you enter below, will be loaded up in a web browser, after a Customer returns from a successful Signup through PayPal®. Tracking Codes are only displayed/processed one time for each Customer. s2Member will display your Tracking Codes in one of three possible locations... <strong>1.</strong> If possible, on the Registration Form, after returning from PayPal®. <strong>2.</strong> Otherwise, if possible, on the Login Form after Registration is completed. <strong>3.</strong> Otherwise, in the footer of your WordPress® theme, after the Customer\'s very first Login.</p>' . "\n";
|
46 |
echo '<p>Signup Tracking Codes are displayed for all types of Membership Level Access. Including: Recurring Subscriptions ( with or without a free trial period ), Non-Recurring Subscriptions ( with or without a free trial period ), Lifetime Subscriptions, and even Fixed-Term Subscriptions. All of these are supported by s2Member\'s Button/Form Generators, and all of these are supported here.</p>' . "\n";
|
47 |
do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_signup_tracking", get_defined_vars ());
|
48 |
/**/
|
61 |
/**/
|
62 |
echo '<td>' . "\n";
|
63 |
echo '<textarea name="ws_plugin__s2member_signup_tracking_codes" id="ws-plugin--s2member-signup-tracking-codes" rows="8" wrap="off" spellcheck="false" style="font-family:Consolas, monospace;">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"]) . '</textarea><br />' . "\n";
|
64 |
+
echo 'Any valid XHTML / JavaScript' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? '' : ' ( or even PHP )') . ' code will work just fine here. Just try not to put anything here that would actually be visible to the Customer. Things like 1x1 pixel images that load up silently and/or JavaScript tracking routines will be fine. Google® Analytics code works just fine, AdSense® performance tracking, as well as Yahoo® tracking and other affiliate network codes are all OK here.<br /><br />' . "\n";
|
65 |
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
|
66 |
echo '<ul>' . "\n";
|
67 |
echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remains constant throughout any & all future payments. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the Transaction ID for the purchase.\\n\\nPayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime & Fixed-Term Subscriptions are NOT recurring ( i.e. there is only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
|
77 |
echo '<li><code>%%initial_term%%</code> = This is the term length of the initial period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D ( this means 1 Day )\\n%%initial_term%% = 1 W ( this means 1 Week )\\n%%initial_term%% = 1 M ( this means 1 Month )\\n%%initial_term%% = 1 Y ( this means 1 Year )\\n\\nThe initial period never recurs, so this only lasts for the term length specified, then it is over. If no initial period was even offered, the value of %%initial_term%% will just be: 0 D, meaning zero days.\'); return false;">?</a> ]</li>' . "\n";
|
78 |
echo '<li><code>%%regular_term%%</code> = This is the term length of the regular period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D ( this means 1 Day )\\n%%regular_term%% = 1 W ( this means 1 Week )\\n%%regular_term%% = 1 M ( this means 1 Month )\\n%%regular_term%% = 1 Y ( this means 1 Year )\\n%%regular_term%% = 1 L ( this means 1 Lifetime )\\n\\nThe regular term is usually recurring. So the regular term value represents the period ( or duration ) of each recurring period. If %%recurring%% = 0, then the regular term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their membership privileges are going to last after the %%initial_term%% has expired, if there was an initial term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
|
79 |
echo '</ul>' . "\n";
|
80 |
+
/**/
|
81 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
82 |
+
{
|
83 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
84 |
+
echo '<ul>' . "\n";
|
85 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
86 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
87 |
+
echo '</ul>' . "\n";
|
88 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
89 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
90 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
91 |
+
}
|
92 |
+
/**/
|
93 |
echo '</td>' . "\n";
|
94 |
/**/
|
95 |
echo '</tr>' . "\n";
|
110 |
/**/
|
111 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-tracking-section">' . "\n";
|
112 |
echo '<h3>Tracking Codes For Specific Post/Page Access ( optional )</h3>' . "\n";
|
113 |
+
echo '<p>If you use affiliate software, a list server, tracking codes from advertising networks, or the like; you\'ll want to read this section. The HTML' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? '' : ' and/or PHP') . ' code that you enter below, will be loaded up in a web browser, after a Customer returns from a successful transaction at PayPal®; specifically for Post/Page Access. These Codes are NOT injected for any type of Member Level Access. These are only for Specific Post/Page transactions. The Tracking Codes that you enter below, will be displayed in the footer section of your WordPress® theme, after a Customer returns from PayPal®.</p>' . "\n";
|
114 |
do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_sp_tracking", get_defined_vars ());
|
115 |
/**/
|
116 |
echo '<table class="form-table">' . "\n";
|
128 |
/**/
|
129 |
echo '<td>' . "\n";
|
130 |
echo '<textarea name="ws_plugin__s2member_sp_tracking_codes" id="ws-plugin--s2member-sp-tracking-codes" rows="8" wrap="off" spellcheck="false" style="font-family:Consolas, monospace;">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_tracking_codes"]) . '</textarea><br />' . "\n";
|
131 |
+
echo 'Any valid XHTML / JavaScript' . ((is_multisite () && ws_plugin__s2member_is_multisite_farm () && !is_main_site ()) ? '' : ' ( or even PHP )') . ' code will work just fine here. Just try not to put anything here that would actually be visible to the Customer. Things like 1x1 pixel images that load up silently and/or JavaScript tracking routines will be fine. Google® Analytics code works just fine, AdSense® performance tracking, as well as Yahoo® tracking and other affiliate network codes are all OK here.<br /><br />' . "\n";
|
132 |
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
|
133 |
echo '<ul>' . "\n";
|
134 |
echo '<li><code>%%txn_id%%</code> = The PayPal® Transaction ID. PayPal® assigns a unique identifier for every purchase.</li>' . "\n";
|
140 |
echo '<li><code>%%item_number%%</code> = The Item Number. Ex: <code><em>sp:13,24,36:72</em></code> ( translates to: <code><em>sp:comma-delimited IDs:expiration hours</em></code> ).</li>' . "\n";
|
141 |
echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
|
142 |
echo '</ul>' . "\n";
|
143 |
+
/**/
|
144 |
+
if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
|
145 |
+
{
|
146 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
147 |
+
echo '<ul>' . "\n";
|
148 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
149 |
+
echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
|
150 |
+
echo '</ul>' . "\n";
|
151 |
+
echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
|
152 |
+
echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
153 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"</code>' . "\n";
|
154 |
+
}
|
155 |
+
/**/
|
156 |
echo '</td>' . "\n";
|
157 |
/**/
|
158 |
echo '</tr>' . "\n";
|
225 |
/**/
|
226 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-other-methods-section">' . "\n";
|
227 |
echo '<h3>Other Tracking Methods Are Available ( there\'s always a way )</h3>' . "\n";
|
228 |
+
echo '<p>Check the s2Member API Notifications panel. You\'ll find additional layers of automation available through the use of the `Signup`, `Registration`, `Payment`, `EOT/Deletion`, `Refund/Reversal`, and `Specific Post/Page` Notifications that are available to you through the s2Member API. The s2Member API Notifications make it possible to integrate with 3rd party applications; like list servers, affiliate programs, and other back-office routines; in more advanced ways. Since the s2Member API Notifications operate silently on the back-end, in conjunction with the PayPal® IPN system, they tend to be more reliable and also more versatile. That being said, nothing replaces the simplicity of Tracking Codes. The more advanced API Notifications are NOT always the best tool for the job. For instance, API Notifications will NOT work with Google® Analytics, or 1 pixel <img> tags. They operate silently behind-the-scene, using HTTP connections, as opposed to being loaded in a browser.</p>' . "\n";
|
229 |
do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_other_methods", get_defined_vars ());
|
230 |
echo '</div>' . "\n";
|
231 |
/**/
|
249 |
do_action ("ws_plugin__s2member_during_trk_ops_page_before_right_sections", get_defined_vars ());
|
250 |
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
|
251 |
/**/
|
252 |
+
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"]) ? '<div class="ws-menu-page-others"><a href="' . ws_plugin__s2member_parse_readme_value ("Pro Module / Prices") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-upsell-pro.png" alt="." /></a></div>' . "\n" : '';
|
253 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"]) ? '<div class="ws-menu-page-installation"><a href="' . ws_plugin__s2member_parse_readme_value ("Professional Installation URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-installation.png" alt="." /></a></div>' . "\n" : '';
|
254 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"]) ? '<div class="ws-menu-page-tools"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-tools.png" alt="." /></div>' . "\n" : '';
|
255 |
echo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"]) ? '<div class="ws-menu-page-support"><a href="' . ws_plugin__s2member_parse_readme_value ("Forum URI") . '" target="_blank"><img src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/brand-support.png" alt="." /></a></div>' . "\n" : '';
|
includes/profile.inc.php
CHANGED
@@ -27,7 +27,7 @@ echo '<html xmlns="http://www.w3.org/1999/xhtml">' . "\n";
|
|
27 |
echo '<head>' . "\n";
|
28 |
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
|
29 |
echo '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>' . "\n";
|
30 |
-
echo '<script type="text/javascript" src="' . get_bloginfo ("
|
31 |
/**/
|
32 |
echo '<title>My Profile</title>' . "\n";
|
33 |
echo '</head>' . "\n";
|
@@ -85,7 +85,7 @@ if (apply_filters ("ws_plugin__s2member_during_profile_during_fields_display_fir
|
|
85 |
echo '<td>' . "\n";
|
86 |
echo '<label>' . "\n";
|
87 |
echo '<strong>First Name *</strong><br />' . "\n";
|
88 |
-
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_profile_first_name" id="ws-plugin--s2member-profile-first-name" style="width:99%;" value="' . format_to_edit ($current_user->
|
89 |
echo '</label>' . "\n";
|
90 |
echo '</td>' . "\n";
|
91 |
echo '</tr>' . "\n";
|
@@ -101,7 +101,23 @@ if (apply_filters ("ws_plugin__s2member_during_profile_during_fields_display_las
|
|
101 |
echo '<td>' . "\n";
|
102 |
echo '<label>' . "\n";
|
103 |
echo '<strong>Last Name *</strong><br />' . "\n";
|
104 |
-
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_profile_last_name" id="ws-plugin--s2member-profile-last-name" style="width:99%;" value="' . format_to_edit ($current_user->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
echo '</label>' . "\n";
|
106 |
echo '</td>' . "\n";
|
107 |
echo '</tr>' . "\n";
|
@@ -111,16 +127,19 @@ if (apply_filters ("ws_plugin__s2member_during_profile_during_fields_display_las
|
|
111 |
/**/
|
112 |
if (apply_filters ("ws_plugin__s2member_during_profile_during_fields_display_custom_fields", true, get_defined_vars ()))
|
113 |
{
|
114 |
-
$fields =
|
115 |
/**/
|
116 |
do_action ("ws_plugin__s2member_during_profile_during_fields_before_custom_fields", get_defined_vars ());
|
117 |
/**/
|
118 |
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
119 |
{
|
|
|
|
|
|
|
120 |
$req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
|
121 |
$req = ($req) ? ' aria-required="true"' : ''; /* Has JavaScript validation applied. */
|
122 |
/**/
|
123 |
-
if ($field = trim ($field, "
|
124 |
{
|
125 |
do_action ("ws_plugin__s2member_during_profile_during_fields_during_custom_fields_before", get_defined_vars ());
|
126 |
/**/
|
@@ -133,7 +152,7 @@ if (apply_filters ("ws_plugin__s2member_during_profile_during_fields_display_cus
|
|
133 |
echo '<td>' . "\n";
|
134 |
echo '<label>' . "\n";
|
135 |
echo '<strong>' . esc_html ($field) . (($req) ? " *" : "") . '</strong><br />' . "\n";
|
136 |
-
echo '<input' . $req . ' type="text" maxlength="100" name="ws_plugin__s2member_profile_' . $field_var . '" id="ws-plugin--s2member-profile-' . $field_id_class . '" style="width:99%;" value="' . format_to_edit ($fields[$field_var]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
|
137 |
echo '</label>' . "\n";
|
138 |
echo '</td>' . "\n";
|
139 |
echo '</tr>' . "\n";
|
@@ -152,10 +171,16 @@ if (apply_filters ("ws_plugin__s2member_during_profile_during_fields_display_pas
|
|
152 |
/**/
|
153 |
echo '<tr>' . "\n";
|
154 |
echo '<td>' . "\n";
|
155 |
-
|
|
|
156 |
echo '<strong>New Password</strong> ( only if you want to change it )<br />' . "\n";
|
157 |
echo '<input type="password" maxlength="100" autocomplete="off" name="ws_plugin__s2member_profile_password" id="ws-plugin--s2member-profile-password" style="width:99%;" value="" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '"' . (($current_user->user_login === "demo") ? ' disabled="disabled"' : '') . ' />' . "\n";
|
158 |
echo '</label>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
159 |
echo '</td>' . "\n";
|
160 |
echo '</tr>' . "\n";
|
161 |
/**/
|
27 |
echo '<head>' . "\n";
|
28 |
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
|
29 |
echo '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>' . "\n";
|
30 |
+
echo '<script type="text/javascript" src="' . get_bloginfo ("wpurl") . '/?ws_plugin__s2member_js_w_globals=1&no-cache=' . urlencode (md5 (mt_rand ())) . '"></script>' . "\n";
|
31 |
/**/
|
32 |
echo '<title>My Profile</title>' . "\n";
|
33 |
echo '</head>' . "\n";
|
85 |
echo '<td>' . "\n";
|
86 |
echo '<label>' . "\n";
|
87 |
echo '<strong>First Name *</strong><br />' . "\n";
|
88 |
+
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_profile_first_name" id="ws-plugin--s2member-profile-first-name" style="width:99%;" value="' . format_to_edit ($current_user->first_name) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
|
89 |
echo '</label>' . "\n";
|
90 |
echo '</td>' . "\n";
|
91 |
echo '</tr>' . "\n";
|
101 |
echo '<td>' . "\n";
|
102 |
echo '<label>' . "\n";
|
103 |
echo '<strong>Last Name *</strong><br />' . "\n";
|
104 |
+
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_profile_last_name" id="ws-plugin--s2member-profile-last-name" style="width:99%;" value="' . format_to_edit ($current_user->last_name) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
|
105 |
+
echo '</label>' . "\n";
|
106 |
+
echo '</td>' . "\n";
|
107 |
+
echo '</tr>' . "\n";
|
108 |
+
/**/
|
109 |
+
do_action ("ws_plugin__s2member_during_profile_during_fields_after_last_name", get_defined_vars ());
|
110 |
+
}
|
111 |
+
/**/
|
112 |
+
if (apply_filters ("ws_plugin__s2member_during_profile_during_fields_display_display_name", true, get_defined_vars ()))
|
113 |
+
{
|
114 |
+
do_action ("ws_plugin__s2member_during_profile_during_fields_before_display_name", get_defined_vars ());
|
115 |
+
/**/
|
116 |
+
echo '<tr>' . "\n";
|
117 |
+
echo '<td>' . "\n";
|
118 |
+
echo '<label>' . "\n";
|
119 |
+
echo '<strong>Display Name *</strong><br />' . "\n";
|
120 |
+
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_profile_display_name" id="ws-plugin--s2member-profile-display-name" style="width:99%;" value="' . format_to_edit ($current_user->display_name) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
|
121 |
echo '</label>' . "\n";
|
122 |
echo '</td>' . "\n";
|
123 |
echo '</tr>' . "\n";
|
127 |
/**/
|
128 |
if (apply_filters ("ws_plugin__s2member_during_profile_during_fields_display_custom_fields", true, get_defined_vars ()))
|
129 |
{
|
130 |
+
$fields = get_user_option ("s2member_custom_fields", $current_user->ID);
|
131 |
/**/
|
132 |
do_action ("ws_plugin__s2member_during_profile_during_fields_before_custom_fields", get_defined_vars ());
|
133 |
/**/
|
134 |
foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
|
135 |
{
|
136 |
+
$une = preg_match ("/\^/", $field); /* Uneditable fields should be wrapped inside carets. */
|
137 |
+
$une = ($une) ? ' disabled="disabled"' : ''; /* Preventing this field from being edited. */
|
138 |
+
/**/
|
139 |
$req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
|
140 |
$req = ($req) ? ' aria-required="true"' : ''; /* Has JavaScript validation applied. */
|
141 |
/**/
|
142 |
+
if ($field = trim ($field, "^* \t\n\r\0\x0B")) /* Don't process empty fields. */
|
143 |
{
|
144 |
do_action ("ws_plugin__s2member_during_profile_during_fields_during_custom_fields_before", get_defined_vars ());
|
145 |
/**/
|
152 |
echo '<td>' . "\n";
|
153 |
echo '<label>' . "\n";
|
154 |
echo '<strong>' . esc_html ($field) . (($req) ? " *" : "") . '</strong><br />' . "\n";
|
155 |
+
echo '<input' . $une . $req . ' type="text" maxlength="100" name="ws_plugin__s2member_profile_' . $field_var . '" id="ws-plugin--s2member-profile-' . $field_id_class . '" style="width:99%;" value="' . format_to_edit ($fields[$field_var]) . '" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '" />' . "\n";
|
156 |
echo '</label>' . "\n";
|
157 |
echo '</td>' . "\n";
|
158 |
echo '</tr>' . "\n";
|
171 |
/**/
|
172 |
echo '<tr>' . "\n";
|
173 |
echo '<td>' . "\n";
|
174 |
+
/**/
|
175 |
+
echo '<label title="Please type your Password twice to confirm.">' . "\n";
|
176 |
echo '<strong>New Password</strong> ( only if you want to change it )<br />' . "\n";
|
177 |
echo '<input type="password" maxlength="100" autocomplete="off" name="ws_plugin__s2member_profile_password" id="ws-plugin--s2member-profile-password" style="width:99%;" value="" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '"' . (($current_user->user_login === "demo") ? ' disabled="disabled"' : '') . ' />' . "\n";
|
178 |
echo '</label>' . "\n";
|
179 |
+
/**/
|
180 |
+
echo '<label title="Please type your Password twice to confirm.">' . "\n";
|
181 |
+
echo '<input type="password" maxlength="100" autocomplete="off" id="ws-plugin--s2member-profile-password-confirmation" style="width:99%;" value="" tabindex="' . esc_attr (($tabindex = $tabindex + 10)) . '"' . (($current_user->user_login === "demo") ? ' disabled="disabled"' : '') . ' />' . "\n";
|
182 |
+
echo '</label>' . "\n";
|
183 |
+
/**/
|
184 |
echo '</td>' . "\n";
|
185 |
echo '</tr>' . "\n";
|
186 |
/**/
|
includes/s2member-min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(a){ws_plugin__s2member_unique_files_downloaded=[];if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN&&S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY<S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED){a("a[href*=s2member_file_download]").click(function(){if(!this.href.match(/file_download_key\=(.+)/)){var b="** Please Confirm This File Download **\n\n";b+="You've downloaded "+S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY+" protected file"+((S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY<1||S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY>1)?"s":"")+" in the last "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" days.\n\n";b+="You're entitled to "+((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)?"UNLIMITED downloads though ( so, no worries ).":S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED+" unique downloads every "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" day period.");if(confirm(b)){if(a.inArray(this.href,ws_plugin__s2member_unique_files_downloaded)===-1){ws_plugin__s2member_unique_files_downloaded.push(this.href),S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY++}return true}else{return false}}})}if(location.href.match(/\/wp-login\.php/)){a("div#login > form#registerform").submit(function(){var b="",c="";a(":input[aria-required=true]",this).each(function(){if(!a.trim(a(this).val())&&(c=a.trim(a.trim(a(this).parent("label").html()).split(/[\r\n\t\<]+/,1)[0].replace(/\*/,"")))){b+="• "+c+"\n"}});if(b=a.trim(b)){alert("Oops, you missed something:\n\n"+b);return false}return true})}if(location.href.match(/\/\?s2member_profile\=1/)){a("form#ws-plugin--s2member-profile").submit(function(){var b="",c="";a(":input[aria-required=true]",this).each(function(){if(!a.trim(a(this).val())&&(
|
1 |
+
jQuery(document).ready(function(a){ws_plugin__s2member_unique_files_downloaded=[];if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN&&S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY<S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED){a("a[href*=s2member_file_download]").click(function(){if(!this.href.match(/file_download_key\=(.+)/)){var b="** Please Confirm This File Download **\n\n";b+="You've downloaded "+S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY+" protected file"+((S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY<1||S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY>1)?"s":"")+" in the last "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" days.\n\n";b+="You're entitled to "+((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)?"UNLIMITED downloads though ( so, no worries ).":S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED+" unique downloads every "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" day period.");if(confirm(b)){if(a.inArray(this.href,ws_plugin__s2member_unique_files_downloaded)===-1){ws_plugin__s2member_unique_files_downloaded.push(this.href),S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY++}return true}else{return false}}})}if(location.href.match(/\/wp-signup\.php/)){a("div#content > div.mu_register > form#setupform").submit(function(){var b="",c="";a("input#user_name",this).add("input#user_email",this).add("input#blogname",this).add("input#blog_title",this).add(":input[aria-required=true]",this).each(function(){if(!a.trim(a(this).val())&&(c=a.trim(a.trim(a(this).prev("label").html()).split(/[\r\n\t\<]+/,1)[0].replace(/\*/,"")))){b+="• "+c+"\n"}else{if(!a.trim(a(this).val())&&(c=a.trim(a.trim(a(this).prev("span.prefix_address").prev("label").html()).split(/[\r\n\t\<]+/,1)[0].replace(/\*/,"")))){b+="• "+c+"\n"}}});if(b=a.trim(b)){alert("Oops, you missed something:\n\n"+b);return false}return true})}if(location.href.match(/\/wp-login\.php/)){a("div#login > form#registerform").submit(function(){var b="",c="";a("input#user_login",this).add("input#user_email",this).add(":input[aria-required=true]",this).each(function(){if(!a.trim(a(this).val())&&(c=a.trim(a.trim(a(this).parent("label").html()).split(/[\r\n\t\<]+/,1)[0].replace(/\*/,"")))){b+="• "+c+"\n"}});if(b=a.trim(b)){alert("Oops, you missed something:\n\n"+b);return false}return true})}if(location.href.match(/\/\?s2member_profile\=1/)){a("form#ws-plugin--s2member-profile").submit(function(){var b="",d="";var c=a("input#ws-plugin--s2member-profile-password");var e=a("input#ws-plugin--s2member-profile-password-confirmation");a(":input[aria-required=true]",this).each(function(){if(!a.trim(a(this).val())&&(d=a.trim(a.trim(a("strong",a(this).parent("label")).html()).split(/[\r\n\t\<]+/,1)[0].replace(/\*/,"")))){b+="• "+d+"\n"}});if(b=a.trim(b)){alert("Oops, you missed something:\n\n"+b);return false}else{if(a.trim(c.val())&&a.trim(c.val())!==a.trim(e.val())){alert("Oops, you missed something:\n\nPasswords do not match up. Please try again.");return false}}return true})}});
|
includes/s2member.css
CHANGED
@@ -8,5 +8,22 @@ along with this software. In the main directory, see: /licensing/
|
|
8 |
If not, see: <http://www.gnu.org/licenses/>.
|
9 |
*/
|
10 |
/*
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
If not, see: <http://www.gnu.org/licenses/>.
|
9 |
*/
|
10 |
/*
|
11 |
+
s2Member / Multisite Integration Forms.
|
12 |
+
|
13 |
+
These are basic CSS rules. You can override any of these
|
14 |
+
through the style.css file for your WordPress® theme.
|
15 |
+
|
16 |
+
If you're using a `PriMo Theme`, you can use:
|
17 |
+
PriMoTheme Options -> Custom CSS
|
18 |
+
See: http://www.primothemes.com/
|
19 |
+
*/
|
20 |
+
div#content > div.mu_register > form#setupform input.ws-plugin--s2member-custom-reg-field
|
21 |
+
{
|
22 |
+
width: 100%;
|
23 |
+
font-size: 24px;
|
24 |
+
margin: 5px 0;
|
25 |
+
}
|
26 |
+
div#content > div.mu_register > div.mu_alert
|
27 |
+
{
|
28 |
+
display: none;
|
29 |
+
}
|
includes/s2member.js
CHANGED
@@ -43,7 +43,33 @@ jQuery (document).ready (function($)
|
|
43 |
});
|
44 |
}
|
45 |
/*
|
46 |
-
Attach form submission handler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
*/
|
48 |
if (location.href.match (/\/wp-login\.php/))
|
49 |
/**/
|
@@ -51,7 +77,7 @@ jQuery (document).ready (function($)
|
|
51 |
{
|
52 |
var fieldErrors = '', fieldLabel = '';
|
53 |
/**/
|
54 |
-
$ (':input[aria-required=true]', this).each (function()
|
55 |
{
|
56 |
if (!$.trim ($ (this).val ()) && (fieldLabel = $.trim ($.trim ($ (this).parent ('label').html ()).split (/[\r\n\t\<]+/, 1)[0].replace (/\*/, ''))))
|
57 |
fieldErrors += '• ' + fieldLabel + '\n'; /* Required fields. */
|
@@ -73,6 +99,8 @@ jQuery (document).ready (function($)
|
|
73 |
$ ('form#ws-plugin--s2member-profile').submit (function()
|
74 |
{
|
75 |
var fieldErrors = '', fieldLabel = '';
|
|
|
|
|
76 |
/**/
|
77 |
$ (':input[aria-required=true]', this).each (function()
|
78 |
{
|
@@ -86,6 +114,12 @@ jQuery (document).ready (function($)
|
|
86 |
return false;
|
87 |
}
|
88 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
return true;
|
90 |
});
|
91 |
});
|
43 |
});
|
44 |
}
|
45 |
/*
|
46 |
+
Attach form submission handler to wp-signup.php.
|
47 |
+
*/
|
48 |
+
if (location.href.match (/\/wp-signup\.php/))
|
49 |
+
/**/
|
50 |
+
$ ('div#content > div.mu_register > form#setupform').submit (function()
|
51 |
+
{
|
52 |
+
var fieldErrors = '', fieldLabel = '';
|
53 |
+
/**/
|
54 |
+
$ ('input#user_name', this).add ('input#user_email', this).add ('input#blogname', this).add ('input#blog_title', this).add (':input[aria-required=true]', this).each (function()
|
55 |
+
{
|
56 |
+
if (!$.trim ($ (this).val ()) && (fieldLabel = $.trim ($.trim ($ (this).prev ('label').html ()).split (/[\r\n\t\<]+/, 1)[0].replace (/\*/, ''))))
|
57 |
+
fieldErrors += '• ' + fieldLabel + '\n'; /* Required fields. */
|
58 |
+
/**/
|
59 |
+
else if (!$.trim ($ (this).val ()) && (fieldLabel = $.trim ($.trim ($ (this).prev ('span.prefix_address').prev ('label').html ()).split (/[\r\n\t\<]+/, 1)[0].replace (/\*/, ''))))
|
60 |
+
fieldErrors += '• ' + fieldLabel + '\n'; /* Required fields. */
|
61 |
+
});
|
62 |
+
/**/
|
63 |
+
if (fieldErrors = $.trim (fieldErrors))
|
64 |
+
{
|
65 |
+
alert ('Oops, you missed something:\n\n' + fieldErrors);
|
66 |
+
return false;
|
67 |
+
}
|
68 |
+
/**/
|
69 |
+
return true;
|
70 |
+
});
|
71 |
+
/*
|
72 |
+
Attach form submission handler to wp-login.php?action=register.
|
73 |
*/
|
74 |
if (location.href.match (/\/wp-login\.php/))
|
75 |
/**/
|
77 |
{
|
78 |
var fieldErrors = '', fieldLabel = '';
|
79 |
/**/
|
80 |
+
$ ('input#user_login', this).add ('input#user_email', this).add (':input[aria-required=true]', this).each (function()
|
81 |
{
|
82 |
if (!$.trim ($ (this).val ()) && (fieldLabel = $.trim ($.trim ($ (this).parent ('label').html ()).split (/[\r\n\t\<]+/, 1)[0].replace (/\*/, ''))))
|
83 |
fieldErrors += '• ' + fieldLabel + '\n'; /* Required fields. */
|
99 |
$ ('form#ws-plugin--s2member-profile').submit (function()
|
100 |
{
|
101 |
var fieldErrors = '', fieldLabel = '';
|
102 |
+
var $password = $ ('input#ws-plugin--s2member-profile-password');
|
103 |
+
var $passwordConfirmation = $ ('input#ws-plugin--s2member-profile-password-confirmation');
|
104 |
/**/
|
105 |
$ (':input[aria-required=true]', this).each (function()
|
106 |
{
|
114 |
return false;
|
115 |
}
|
116 |
/**/
|
117 |
+
else if ($.trim ($password.val ()) && $.trim ($password.val ()) !== $.trim ($passwordConfirmation.val ()))
|
118 |
+
{
|
119 |
+
alert ('Oops, you missed something:\n\nPasswords do not match up. Please try again.');
|
120 |
+
return false;
|
121 |
+
}
|
122 |
+
/**/
|
123 |
return true;
|
124 |
});
|
125 |
});
|
includes/syscon.inc.php
CHANGED
@@ -50,6 +50,7 @@ Configure & validate all of the plugin options; and set their defaults.
|
|
50 |
*/
|
51 |
function ws_plugin__s2member_configure_options_and_their_defaults ($options = FALSE)
|
52 |
{
|
|
|
53 |
/* Here we build the default options array, which will be merged with the user options.
|
54 |
It is important to note that sometimes default options may not or should not be pre-filled on an options form.
|
55 |
These defaults are for the system to use in various ways, we may choose not to pre-fill certain fields.
|
@@ -72,6 +73,13 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
|
|
72 |
"custom_reg_opt_in_label" => "Yes, I want to receive updates via email.", /* Label. */
|
73 |
/**/
|
74 |
"allow_subscribers_in" => "0", /* Allow Subscribers to register for absolutely free access? */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
"force_admin_lockouts" => "0", /* Redirects admin Pages/Profile to the Login Welcome Page. */
|
76 |
/**/
|
77 |
"login_welcome_page" => "", /* Defaults to the Home Page. */
|
@@ -80,6 +88,7 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
|
|
80 |
/**/
|
81 |
"login_reg_background_color" => "FFFFFF", /* Defaults to white, and the bg.png is also white. */
|
82 |
"login_reg_background_image" => $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/bg.png",/**/
|
|
|
83 |
"login_reg_background_text_color" => "000000", /* Defaults to black, which is high contrast on white. */
|
84 |
"login_reg_background_text_shadow_color" => "CCCCCC", /* Defaults to gray, which is slightly visible. */
|
85 |
"login_reg_background_box_shadow_color" => "CCCCCC", /* Defaults to gray, which is slightly visible. */
|
@@ -184,24 +193,14 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
|
|
184 |
"membership_eot_behavior" => "demote", /* Demote or delete Members? */
|
185 |
"auto_eot_system_enabled" => "1")); /* 0|1|2. 1 = WP-Cron, 2 = Cron tab. */
|
186 |
/*
|
187 |
-
|
188 |
-
*/
|
189 |
-
$GLOBALS["WS_PLUGIN__"]["s2member"]["o"] = array_merge ($default_options, (($options !== false) ? (array)$options : (array)get_option ("ws_plugin__s2member_options")));
|
190 |
-
/*
|
191 |
-
Backward compatibility for `single_page_email_subject`, which was renamed to `sp_email_subject` in v3.0.
|
192 |
*/
|
193 |
-
if (
|
194 |
-
$
|
195 |
/*
|
196 |
-
|
197 |
-
*/
|
198 |
-
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["single_page_email_message"]) /* Also corrects a typo in the original default for this option. Should be %%sp_access_url%%. */
|
199 |
-
$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_email_message"] = preg_replace ("/%%access_url%%/", "%%sp_access_url%%", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["single_page_email_message"]);
|
200 |
-
/*
|
201 |
-
Backward compatibility for `single_pages`, which was renamed to `specific_ids` in v3.0.
|
202 |
*/
|
203 |
-
|
204 |
-
$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["single_pages"];
|
205 |
/*
|
206 |
Validate each option, possibly reverting back to the default value if invalid.
|
207 |
Also check if options were passed in on some of these, in case empty values are to be allowed.
|
@@ -250,6 +249,15 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
|
|
250 |
else if ($key === "allow_subscribers_in" && (!is_string ($value) || !is_numeric ($value)))
|
251 |
$value = $default_options[$key];
|
252 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
else if ($key === "force_admin_lockouts" && (!is_string ($value) || !is_numeric ($value)))
|
254 |
$value = $default_options[$key];
|
255 |
/**/
|
@@ -268,6 +276,9 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
|
|
268 |
else if ($key === "login_reg_background_image" && !is_string ($value)) /* This is optional. */
|
269 |
$value = $default_options[$key];
|
270 |
/**/
|
|
|
|
|
|
|
271 |
else if ($key === "login_reg_logo_src" && (!is_string ($value) || !strlen ($value)))
|
272 |
$value = $default_options[$key];
|
273 |
/**/
|
@@ -370,19 +381,19 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
|
|
370 |
else if (preg_match ("/^level[0-4]_ruris$/", $key) && (!is_string ($value) || !strlen ($value)))
|
371 |
$value = $default_options[$key];
|
372 |
/**/
|
373 |
-
else if (preg_match ("/^level[0-4]_catgs$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : preg_replace ("/[^0-9,]/", "", $value)))))
|
374 |
$value = $default_options[$key];
|
375 |
/**/
|
376 |
else if (preg_match ("/^level[0-4]_ptags$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : strtolower (preg_replace ("/( +)/", " ", trim (preg_replace ("/( *),( *)/", ",", $value))))))))
|
377 |
$value = $default_options[$key];
|
378 |
/**/
|
379 |
-
else if (preg_match ("/^level[0-4]_posts$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : preg_replace ("/[^0-9,]/", "", $value)))))
|
380 |
$value = $default_options[$key];
|
381 |
/**/
|
382 |
-
else if (preg_match ("/^level[0-4]_pages$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : preg_replace ("/[^0-9,]/", "", $value)))))
|
383 |
$value = $default_options[$key];
|
384 |
/**/
|
385 |
-
else if ($key === "specific_ids" && (!is_string ($value) || !($value = preg_replace ("/[^0-9,]/", "", $value))))
|
386 |
$value = $default_options[$key];
|
387 |
/**/
|
388 |
else if ($key === "membership_eot_behavior" && (!is_string ($value) || !preg_match ("/^(demote|delete)$/", $value)))
|
50 |
*/
|
51 |
function ws_plugin__s2member_configure_options_and_their_defaults ($options = FALSE)
|
52 |
{
|
53 |
+
global $current_site, $current_blog; /* Multisite Networking compatiblity. */
|
54 |
/* Here we build the default options array, which will be merged with the user options.
|
55 |
It is important to note that sometimes default options may not or should not be pre-filled on an options form.
|
56 |
These defaults are for the system to use in various ways, we may choose not to pre-fill certain fields.
|
73 |
"custom_reg_opt_in_label" => "Yes, I want to receive updates via email.", /* Label. */
|
74 |
/**/
|
75 |
"allow_subscribers_in" => "0", /* Allow Subscribers to register for absolutely free access? */
|
76 |
+
"mms_registration_file" => "wp-login", /* A Multisite registration ( on the main site ) uses which file? */
|
77 |
+
"mms_registration_grants" => "none", /* A public visitor, on a Multisite Blog Farm can register what? */
|
78 |
+
"mms_registration_blogs_level0" => "0", /* A Visitor on a Multisite Farm, can create how many Blogs? */
|
79 |
+
"mms_registration_blogs_level1" => "1", /* A Customer on a Multisite Farm can create how many Blogs? */
|
80 |
+
"mms_registration_blogs_level2" => "5", /* A Customer on a Multisite Farm can create how many Blogs? */
|
81 |
+
"mms_registration_blogs_level3" => "25", /* A Customer on a Multisite Farm can create how many Blogs? */
|
82 |
+
"mms_registration_blogs_level4" => "100", /* A Customer on a Multisite Farm can create how many Blogs? */
|
83 |
"force_admin_lockouts" => "0", /* Redirects admin Pages/Profile to the Login Welcome Page. */
|
84 |
/**/
|
85 |
"login_welcome_page" => "", /* Defaults to the Home Page. */
|
88 |
/**/
|
89 |
"login_reg_background_color" => "FFFFFF", /* Defaults to white, and the bg.png is also white. */
|
90 |
"login_reg_background_image" => $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/bg.png",/**/
|
91 |
+
"login_reg_background_image_repeat" => "repeat", /* How should the background image repeat? repeat[-x|y]*/
|
92 |
"login_reg_background_text_color" => "000000", /* Defaults to black, which is high contrast on white. */
|
93 |
"login_reg_background_text_shadow_color" => "CCCCCC", /* Defaults to gray, which is slightly visible. */
|
94 |
"login_reg_background_box_shadow_color" => "CCCCCC", /* Defaults to gray, which is slightly visible. */
|
193 |
"membership_eot_behavior" => "demote", /* Demote or delete Members? */
|
194 |
"auto_eot_system_enabled" => "1")); /* 0|1|2. 1 = WP-Cron, 2 = Cron tab. */
|
195 |
/*
|
196 |
+
Disable de-activation routines ( by default ) on a Multisite Blog Farm installation; excluding the Main Site ( Dashboard Blog ).
|
|
|
|
|
|
|
|
|
197 |
*/
|
198 |
+
if (is_multisite () && !is_main_site () && defined ("MULTISITE_FARM") && MULTISITE_FARM) /* Auto-protects Blog Owners. */
|
199 |
+
$default_options["run_deactivation_routines"] = "0"; /* By default, disable all de-activation routines in this case. */
|
200 |
/*
|
201 |
+
Here they are merged. User options will overwrite some or all default values.
|
|
|
|
|
|
|
|
|
|
|
202 |
*/
|
203 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["o"] = array_merge ($default_options, (($options !== false) ? (array)$options : (array)get_option ("ws_plugin__s2member_options")));
|
|
|
204 |
/*
|
205 |
Validate each option, possibly reverting back to the default value if invalid.
|
206 |
Also check if options were passed in on some of these, in case empty values are to be allowed.
|
249 |
else if ($key === "allow_subscribers_in" && (!is_string ($value) || !is_numeric ($value)))
|
250 |
$value = $default_options[$key];
|
251 |
/**/
|
252 |
+
else if ($key === "mms_registration_file" && (!is_string ($value) || !preg_match ("/^(wp-login|wp-signup)$/", $value)))
|
253 |
+
$value = $default_options[$key];
|
254 |
+
/**/
|
255 |
+
else if ($key === "mms_registration_grants" && (!is_string ($value) || !preg_match ("/^(none|user|all)$/", $value)))
|
256 |
+
$value = $default_options[$key];
|
257 |
+
/**/
|
258 |
+
else if (preg_match ("/^mms_registration_blogs_level[0-4]$/", $key) && (!is_string ($value) || !is_numeric ($value) || $value < 0))
|
259 |
+
$value = $default_options[$key];
|
260 |
+
/**/
|
261 |
else if ($key === "force_admin_lockouts" && (!is_string ($value) || !is_numeric ($value)))
|
262 |
$value = $default_options[$key];
|
263 |
/**/
|
276 |
else if ($key === "login_reg_background_image" && !is_string ($value)) /* This is optional. */
|
277 |
$value = $default_options[$key];
|
278 |
/**/
|
279 |
+
else if ($key === "login_reg_background_image_repeat" && (!is_string ($value) || !preg_match ("/^(repeat|repeat-x|repeat-y|no-repeat)$/", $value)))
|
280 |
+
$value = $default_options[$key];
|
281 |
+
/**/
|
282 |
else if ($key === "login_reg_logo_src" && (!is_string ($value) || !strlen ($value)))
|
283 |
$value = $default_options[$key];
|
284 |
/**/
|
381 |
else if (preg_match ("/^level[0-4]_ruris$/", $key) && (!is_string ($value) || !strlen ($value)))
|
382 |
$value = $default_options[$key];
|
383 |
/**/
|
384 |
+
else if (preg_match ("/^level[0-4]_catgs$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
|
385 |
$value = $default_options[$key];
|
386 |
/**/
|
387 |
else if (preg_match ("/^level[0-4]_ptags$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : strtolower (preg_replace ("/( +)/", " ", trim (preg_replace ("/( *),( *)/", ",", $value))))))))
|
388 |
$value = $default_options[$key];
|
389 |
/**/
|
390 |
+
else if (preg_match ("/^level[0-4]_posts$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
|
391 |
$value = $default_options[$key];
|
392 |
/**/
|
393 |
+
else if (preg_match ("/^level[0-4]_pages$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
|
394 |
$value = $default_options[$key];
|
395 |
/**/
|
396 |
+
else if ($key === "specific_ids" && (!is_string ($value) || !($value = trim (preg_replace ("/[^0-9,]/", "", $value), ","))))
|
397 |
$value = $default_options[$key];
|
398 |
/**/
|
399 |
else if ($key === "membership_eot_behavior" && (!is_string ($value) || !preg_match ("/^(demote|delete)$/", $value)))
|
ms.txt
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
= Is s2Member compatible with WordPress® 3.0+ Multisite Networking ? =
|
2 |
+
Yes. s2Member v3.2+, and also s2Member Pro, are BOTH compatible with Multisite Networking enabled. After you enable Multisite Networking, install the s2Member plugin. Then navigate to `s2Member -> Multisite ( Config )` in the Dashboard on your ( Main Site ). You can get started now, by turning on [Multisite Networking](http://codex.wordpress.org/Create_A_Network) inside your installation of WordPress®.
|
3 |
+
|
4 |
+
= What about Multisite Networking ( WPMU ), used on a Blog Farm? =
|
5 |
+
Yes, preliminary ( experimental ) support for Multisite Blog Farms has also been implemented. If you're running a Multisite Blog Farm ( i.e. you offer Blogs ), please contact s2Member.com for further details. With Multisite Networking enabled, your site could ALSO offer a Customer access to create a Blog of their own, where a Customer becomes a "Member" of your ( Main Site ), and also a Blog Owner/Administrator. With s2Member installed ( network wide ), each of your Blog Owners could offer Membership too, using a single installation of the s2Member plugin ( which is a great selling point! ). We refer to this as a Multisite Blog Farm.
|
6 |
+
|
7 |
+
You can get started now, by turning on [Multisite Networking](http://codex.wordpress.org/Create_A_Network) inside your installation of WordPress®. Then, install the s2Member plugin ( network wide ). In the Dashboard for your Main Site, see: `s2Member -> Multisite ( Config )`. Before you go live, please contact [s2Member.com](http://www.s2member.com/contact/) for full documentation on Multisite Blog Farms. There is some additional functionality that can be enabled for security on a Blog Farm installation; and also some menus/documentation/functionality that can be disabled. NOTE ~ You will be asked to make a donation, or to purchase a Support Package for s2Member.
|
readme.txt
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
=== s2Member ( Membership w/ PayPal® Integration )
|
2 |
|
3 |
-
Version: 3.
|
4 |
-
Stable tag: 3.
|
5 |
Framework: WS-P-3.0
|
6 |
|
7 |
SSL Compatible: yes
|
8 |
bbPress Compatible: yes
|
9 |
WordPress Compatible: yes
|
10 |
BuddyPress Compatible: yes
|
11 |
-
WP Multisite Compatible:
|
12 |
-
Multisite Blog Farm Compatible:
|
13 |
|
14 |
-
Tested up to: 3.0
|
15 |
Requires at least: 3.0
|
16 |
Requires: WordPress® 3.0+, PHP 5.2+
|
17 |
|
@@ -23,14 +23,15 @@ Author: PriMoThemes.com / WebSharks, Inc.
|
|
23 |
Donate link: http://www.primothemes.com/donate/
|
24 |
|
25 |
Plugin Name: s2Member
|
26 |
-
Pro Module /
|
27 |
Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
|
28 |
Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
|
|
|
29 |
Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
|
30 |
-
Description: Empowers WordPress® with membership capabilities. Integrates seamlessly with PayPal®. Also compatible with
|
31 |
Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, includes extensive documentation, highly extensible
|
32 |
|
33 |
-
s2Member is an extremely powerful ( and free ) membership management system for WordPress®. It empowers WordPress® with membership capabilities, integrating seamlessly with PayPal®.
|
34 |
|
35 |
== Installation ==
|
36 |
|
@@ -42,6 +43,14 @@ s2Member is an extremely powerful ( and free ) membership management system for
|
|
42 |
= Auto-installing through WordPress® ( memory errors? ) =
|
43 |
This depends on your hosting provider and/or server configuration. Some web hosting companies impose very low limits on the amount of memory available to WordPress® during the execution of a single script. Since s2Member is a larger plugin, WordPress® may exceed conservative limits set forth by shared hosting companies. Don't feel bad, it's a very common problem. The solution is to install manually, using the instructions above. Memory limits only affect the WordPress® auto-installation routine, not the actual functionality of WordPress® or s2Member.
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
== Upgrading To The Latest Version ==
|
46 |
|
47 |
You can either (upgrade automatically) by going to `WordPress® -> Plugins` and clicking "upgrade automatically". If that fails with memory errors, you can upgrade manually by following these instructions:
|
@@ -59,17 +68,17 @@ This depends on your hosting provider and/or server configuration. Some web host
|
|
59 |
|
60 |
== Description ==
|
61 |
|
62 |
-
s2Member is an extremely powerful ( and free ) membership management system for WordPress®. The s2Member Framework ( free ) integrates seamlessly with PayPal® ( very easy ), and fully supports recurring billing, with the ability to track affiliate commissions on a recurring basis. s2Member supports custom Pages for registration ( including Custom Registration Fields ), account access, and a whole lot more.
|
63 |
|
64 |
s2Member supports Free Subscribers ( at Level #0 ), and up to four Primary Membership Levels, [1-4]; plus unlimited Custom Capability Packages. Custom Capabilities allow you to create an unlimited number of Membership Packages, all with different Capabilities and prices. You can label your Membership Levels anything you like. The defaults are Free, Bronze, Silver, Gold, and Platinum.
|
65 |
|
66 |
s2Member allows you to protect Pages, Posts, Tags, Categories, URIs, URI word fragments, URI Replacement Codes for BuddyPress, Specific Post/Page "Buy Now" Access, and even portions of content within Posts/Pages/themes/plugins. Everything is configurable through the s2Member Options Panel. This makes s2Member VERY easy to integrate into any WordPress®-powered site. With s2Member, you can also protect downloadable files, using special restrictions on how many downloads can occur within a certain amount of time; all based on Membership Level.
|
67 |
|
68 |
-
Each Membership Level can have different restrictions, and you could even integrate Conditionals within your content based on Member Level. Advanced code samples are provided under `s2Member -> API Scripting -> Advanced Conditionals`. s2Member has been fully integrated with the Roles & Capabilities that are already built into WordPress®. No new tables :-) It is designed to be completely seamless, without code bloat. We've carefully structured the entire framework, in order to maximize s2Member's ability to operate with other plugins installed.
|
69 |
|
70 |
You can also sell Specific Post/Page Access ( membership not required ), using "Buy Now" buttons. You can even package multiple Posts/Pages together into one "Buy Now" transaction. Further details are provided under `s2Member -> PayPal® Buttons -> Special Posts/Pages`.
|
71 |
|
72 |
-
New! - [s2Member Pro](http://www.s2member.com/) is an add-on module for the free version of s2Member. [s2Member Pro](http://www.s2member.com/) adds [PayPal® Pro integration](
|
73 |
|
74 |
== Screenshots ==
|
75 |
|
@@ -86,11 +95,14 @@ New! - [s2Member Pro](http://www.s2member.com/) is an add-on module for the free
|
|
86 |
|
87 |
== Frequently Asked Questions ==
|
88 |
|
|
|
|
|
|
|
89 |
= Is there a discussion forum for s2Member? =
|
90 |
Yes. The [Support Forum](http://www.primothemes.com/forums/viewforum.php?f=4) for s2Member is available [here](http://www.primothemes.com/forums/viewforum.php?f=4).
|
91 |
|
92 |
= Does s2Member install any new database tables? =
|
93 |
-
No, s2Member has been fully integrated with the Roles & Capabilities that are already built into WordPress®. It is designed to be completely seamless, without code bloat. We've carefully structured the entire framework, in order to maximize s2Member's ability to operate with other plugins installed. For instance, s2Member is compatible with BuddyPress
|
94 |
|
95 |
= Does the PayPal integration work right-out-of-the-box? =
|
96 |
Yes, it can even generate your PayPal® Subscription Buttons for you. Everything is fully integrated. You even get to create your own Pages within WordPress® to handle Membership Options, the Login Welcome Page, etc. For advanced webmasters, there are scripting techniques that are documented as well. These will help you further develop your site and tailor it to meet your specific needs. s2Member API Scripting is NOT required however.
|
@@ -113,6 +125,14 @@ Yes, s2Member provides many *Advanced Scripting* techniques that are fully docum
|
|
113 |
= Is s2Member compatible with Quick Cache or WP Super Cache? =
|
114 |
Yes, there were some bugs in the beginning, but they have been fixed now. Both Quick Cache and WP Super Cache will remain compatible with s2Member. We have integrated two internal Constants that prevent these plugins from caching important Members Only areas of your site, no matter what your cache configuration might be. The two Constants are: `DONOTCACHEPAGE` and `QUICK_CACHE_ALLOWED = false`. We recommend Quick Cache over WP Super Cache though; simply because we actually developed Quick Cache, and we've done more extensive testing with the s2Member/Quick-Cache combination.
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
= Is s2Member compatible with the BuddyPress plugin for WordPress? =
|
117 |
Yes it is. In fact, we must say... the s2Member/BuddyPress combination is just awesome. These two plugins running together make all sorts of things possible.
|
118 |
|
@@ -141,21 +161,56 @@ Yes, without a doubt. The free version of s2Member ( aka: the s2Member Framework
|
|
141 |
We get this type of question a lot. The answer is most definitely **yes**. The entire s2Member Framework is extremely versatile. For instance, the s2Member Pro Module is built on top of the free s2Member Framework; on top of the worlds' most powerful publishing platform ( WordPress® ). That being said, you WILL need be familiar with PHP, and/or WordPress® Hooks/Filters in order to accomplish advanced customizations. We suggest hiring a freelance developer at Elance.com, or hiring Jason Caldwell ( our own Lead Developer ) @ PriMoThemes.com / WebSharks, Inc. [Jason Caldwell](http://www.primothemes.com/post/author/websharksinc-jason/) is the Lead Developer behind the s2Member plugin, and also the s2Member Pro Module.
|
142 |
|
143 |
= Can s2Member be used with ClickBank® or Google® Checkout? =
|
144 |
-
Not yet. This is coming soon though. It will be included in a future release of the s2Member Pro Module, which already works with PayPal® Pro; using direct ( on-site ) credit card processing for Visa®, MasterCard®, American Express®, Discover®, Maestro®, Solo®, and PayPal® Express Checkout. [s2Member Pro](http://www.s2member.com/) is an add-on module for the [free version](http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/) of s2Member. s2Member Pro adds full PayPal® Pro integration, a PayPal® Pro Form Generator, User Import/Export tools
|
145 |
|
146 |
== Upgrade Notice ==
|
147 |
|
148 |
-
= 3.
|
149 |
-
* Upgrade recommended.
|
150 |
-
|
151 |
-
= 3.0.6 =
|
152 |
-
* Upgrade highly recommended. Fixes a bug in v3.0.5.
|
153 |
-
|
154 |
-
= 3.0.5 =
|
155 |
-
* Several bug fixes, improvements, and some new features.
|
156 |
|
157 |
== Changelog ==
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
= 3.1.5 =
|
160 |
* Bug fix. The Replacment Code ( `%%current_user_level%%` ); which works in conjunction with a Login Welcome Page URL, and also with URI Level Access was always returning `-1`. This has been corrected in v3.1.5+.
|
161 |
* General cleanup and improved routines inside `/includes/file-download-access.inc.php`. No functionality changes, just subtle improvements in the logic behind s2Member's File Download Restrictions.
|
@@ -306,7 +361,7 @@ Not yet. This is coming soon though. It will be included in a future release of
|
|
306 |
* New feature. A couple of Replacement Codes are now supported in the s2Member URI Level Access Restrictions. See: `s2Member -> General Options -> URI Level Access` for further details. This can be useful if you're running BuddyPress. For example, if you're using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: `/members/%%current_user_login%%/groups/`
|
307 |
* New feature. For protected File Downloads, you may now specify a list of file extensions that should be displayed Inline ( in your browser ) as opposed to being downloaded as an attachment. See: `s2Member -> Download Options -> Inline Extensions`. A new API Constant was also added, which reflects the value of this option: `S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS`.
|
308 |
* Documentation change. This is only relevant if you've been using the `s2member_xencrypt()` function to provide free access to specific files. The documentation for this has been changed. You should now use `s2member_free_file_download_key=<?php echo md5(s2member_xencrypt("file")); ?>`, instead of just `s2member_xencrypt()` by itself ( which is now deprecated ). The addition of the MD5 hash improves the security of s2Member on a whole, and also makes your links shorter. Please update your links. In future versions of s2Member, the older method will no longer be supported.
|
309 |
-
*
|
310 |
* New feature. A couple of Replacement Codes are now supported in the s2Member Login Redirection URL. See: `s2Member -> General Options -> Login Welcome Page -> Special Redirection` for further details. This can be useful if you'd like to redirect Members to their BuddyPress Profile, if/when BuddyPress is installed together with s2Member. For example, if you're using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: `http://www.example.com/members/%%current_user_login%%/profile/`
|
311 |
* Please note. BuddyPress is NOT required to use s2Member. However, the combination of BuddyPress + s2Member is a popular choice among site owners.
|
312 |
|
1 |
+
=== s2Member ( Membership w/ PayPal® Integration ) ~ now Multisite compatible! ===
|
2 |
|
3 |
+
Version: 3.2
|
4 |
+
Stable tag: 3.2
|
5 |
Framework: WS-P-3.0
|
6 |
|
7 |
SSL Compatible: yes
|
8 |
bbPress Compatible: yes
|
9 |
WordPress Compatible: yes
|
10 |
BuddyPress Compatible: yes
|
11 |
+
WP Multisite Compatible: yes
|
12 |
+
Multisite Blog Farm Compatible: yes
|
13 |
|
14 |
+
Tested up to: 3.0.1
|
15 |
Requires at least: 3.0
|
16 |
Requires: WordPress® 3.0+, PHP 5.2+
|
17 |
|
23 |
Donate link: http://www.primothemes.com/donate/
|
24 |
|
25 |
Plugin Name: s2Member
|
26 |
+
Pro Module / Prices: http://www.s2member.com/prices/
|
27 |
Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
|
28 |
Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
|
29 |
+
PayPal Pro Integration: http://www.primothemes.com/forums/viewtopic.php?f=4&t=304
|
30 |
Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
|
31 |
+
Description: Empowers WordPress® with membership capabilities. Integrates seamlessly with PayPal®. Also compatible with Multisite Networking, and even with BuddyPress if you like.
|
32 |
Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, includes extensive documentation, highly extensible
|
33 |
|
34 |
+
s2Member is an extremely powerful ( and free ) membership management system for WordPress®. It empowers WordPress® with membership capabilities, integrating seamlessly with PayPal®. Also compatible with Multisite Networking, and even with BuddyPress if you like.
|
35 |
|
36 |
== Installation ==
|
37 |
|
43 |
= Auto-installing through WordPress® ( memory errors? ) =
|
44 |
This depends on your hosting provider and/or server configuration. Some web hosting companies impose very low limits on the amount of memory available to WordPress® during the execution of a single script. Since s2Member is a larger plugin, WordPress® may exceed conservative limits set forth by shared hosting companies. Don't feel bad, it's a very common problem. The solution is to install manually, using the instructions above. Memory limits only affect the WordPress® auto-installation routine, not the actual functionality of WordPress® or s2Member.
|
45 |
|
46 |
+
= Is s2Member compatible with WordPress® 3.0+ Multisite Networking ? =
|
47 |
+
Yes. s2Member v3.2+, and also s2Member Pro, are BOTH compatible with Multisite Networking enabled. After you enable Multisite Networking, install the s2Member plugin. Then navigate to `s2Member -> Multisite ( Config )` in the Dashboard on your ( Main Site ).
|
48 |
+
|
49 |
+
= What about Multisite Networking ( WPMU ), used on a Blog Farm? =
|
50 |
+
Yes, preliminary ( experimental ) support for Multisite Blog Farms has also been implemented. If you're running a Multisite Blog Farm ( i.e. you offer Blogs ), please contact s2Member.com for further details. With Multisite Networking enabled, your site could ALSO offer a Customer access to create a Blog of their own, where a Customer becomes a "Member" of your ( Main Site ), and also a Blog Owner/Administrator. With s2Member installed ( network wide ), each of your Blog Owners could offer Membership too, using a single installation of the s2Member plugin ( which is a great selling point! ). We refer to this as a Multisite Blog Farm.
|
51 |
+
|
52 |
+
You can get started now, by turning on [Multisite Networking](http://codex.wordpress.org/Create_A_Network) inside your installation of WordPress®. Then, install the s2Member plugin ( network wide ). In the Dashboard for your Main Site, see: `s2Member -> Multisite ( Config )`. Before you go live, please contact [s2Member.com](http://www.s2member.com/contact/) for full documentation on Multisite Blog Farms. There is some additional functionality that can be enabled for security on a Blog Farm installation; and also some menus/documentation/functionality that can be disabled. NOTE ~ You will be asked to make a donation, or to purchase a Support Package for s2Member.
|
53 |
+
|
54 |
== Upgrading To The Latest Version ==
|
55 |
|
56 |
You can either (upgrade automatically) by going to `WordPress® -> Plugins` and clicking "upgrade automatically". If that fails with memory errors, you can upgrade manually by following these instructions:
|
68 |
|
69 |
== Description ==
|
70 |
|
71 |
+
s2Member is an extremely powerful ( and free ) membership management system for WordPress®. The s2Member Framework ( free ) integrates seamlessly with PayPal® ( very easy ), and fully supports recurring billing, with the ability to track affiliate commissions on a recurring basis. s2Member supports custom Pages for registration ( including Custom Registration Fields ), account access, and a whole lot more. Now compatible with Multisite Networking too, and even with BuddyPress if you like!
|
72 |
|
73 |
s2Member supports Free Subscribers ( at Level #0 ), and up to four Primary Membership Levels, [1-4]; plus unlimited Custom Capability Packages. Custom Capabilities allow you to create an unlimited number of Membership Packages, all with different Capabilities and prices. You can label your Membership Levels anything you like. The defaults are Free, Bronze, Silver, Gold, and Platinum.
|
74 |
|
75 |
s2Member allows you to protect Pages, Posts, Tags, Categories, URIs, URI word fragments, URI Replacement Codes for BuddyPress, Specific Post/Page "Buy Now" Access, and even portions of content within Posts/Pages/themes/plugins. Everything is configurable through the s2Member Options Panel. This makes s2Member VERY easy to integrate into any WordPress®-powered site. With s2Member, you can also protect downloadable files, using special restrictions on how many downloads can occur within a certain amount of time; all based on Membership Level.
|
76 |
|
77 |
+
Each Membership Level can have different restrictions, and you could even integrate Conditionals within your content based on Member Level. Advanced code samples are provided under `s2Member -> API Scripting -> Advanced Conditionals`. s2Member has been fully integrated with the Roles & Capabilities that are already built into WordPress®. No new tables :-) It is designed to be completely seamless, without code bloat. We've carefully structured the entire framework, in order to maximize s2Member's ability to operate with other plugins installed.
|
78 |
|
79 |
You can also sell Specific Post/Page Access ( membership not required ), using "Buy Now" buttons. You can even package multiple Posts/Pages together into one "Buy Now" transaction. Further details are provided under `s2Member -> PayPal® Buttons -> Special Posts/Pages`.
|
80 |
|
81 |
+
New! - [s2Member Pro](http://www.s2member.com/) is an add-on module for the free version of s2Member. [s2Member Pro](http://www.s2member.com/) adds [PayPal® Pro integration](http://www.primothemes.com/forums/viewtopic.php?f=4&t=304), a PayPal® Pro Form Generator, advanced User Import/Export tools, support for Coupon Codes, and more. Your purchase of s2Member Pro includes free lifetime upgrades; along with full access to our [video tutorial library](http://www.s2member.com/videos/).
|
82 |
|
83 |
== Screenshots ==
|
84 |
|
95 |
|
96 |
== Frequently Asked Questions ==
|
97 |
|
98 |
+
= Are video tutorials available for s2Member? =
|
99 |
+
Yes. [Video Tutorials](http://www.s2member.com/videos/) for s2Member are available [here](http://www.s2member.com/videos/).
|
100 |
+
|
101 |
= Is there a discussion forum for s2Member? =
|
102 |
Yes. The [Support Forum](http://www.primothemes.com/forums/viewforum.php?f=4) for s2Member is available [here](http://www.primothemes.com/forums/viewforum.php?f=4).
|
103 |
|
104 |
= Does s2Member install any new database tables? =
|
105 |
+
No, s2Member has been fully integrated with the Roles & Capabilities that are already built into WordPress®. It is designed to be completely seamless, without code bloat. We've carefully structured the entire framework, in order to maximize s2Member's ability to operate with other plugins installed. For instance, s2Member is also compatible with BuddyPress.
|
106 |
|
107 |
= Does the PayPal integration work right-out-of-the-box? =
|
108 |
Yes, it can even generate your PayPal® Subscription Buttons for you. Everything is fully integrated. You even get to create your own Pages within WordPress® to handle Membership Options, the Login Welcome Page, etc. For advanced webmasters, there are scripting techniques that are documented as well. These will help you further develop your site and tailor it to meet your specific needs. s2Member API Scripting is NOT required however.
|
125 |
= Is s2Member compatible with Quick Cache or WP Super Cache? =
|
126 |
Yes, there were some bugs in the beginning, but they have been fixed now. Both Quick Cache and WP Super Cache will remain compatible with s2Member. We have integrated two internal Constants that prevent these plugins from caching important Members Only areas of your site, no matter what your cache configuration might be. The two Constants are: `DONOTCACHEPAGE` and `QUICK_CACHE_ALLOWED = false`. We recommend Quick Cache over WP Super Cache though; simply because we actually developed Quick Cache, and we've done more extensive testing with the s2Member/Quick-Cache combination.
|
127 |
|
128 |
+
= Is s2Member compatible with WordPress® 3.0+ Multisite Networking ? =
|
129 |
+
Yes. s2Member v3.2+, and also s2Member Pro, are BOTH compatible with Multisite Networking enabled. After you enable Multisite Networking, install the s2Member plugin. Then navigate to `s2Member -> Multisite ( Config )` in the Dashboard on your ( Main Site ).
|
130 |
+
|
131 |
+
= What about Multisite Networking ( WPMU ), used on a Blog Farm? =
|
132 |
+
Yes, preliminary ( experimental ) support for Multisite Blog Farms has also been implemented. If you're running a Multisite Blog Farm ( i.e. you offer Blogs ), please contact s2Member.com for further details. With Multisite Networking enabled, your site could ALSO offer a Customer access to create a Blog of their own, where a Customer becomes a "Member" of your ( Main Site ), and also a Blog Owner/Administrator. With s2Member installed ( network wide ), each of your Blog Owners could offer Membership too, using a single installation of the s2Member plugin ( which is a great selling point! ). We refer to this as a Multisite Blog Farm.
|
133 |
+
|
134 |
+
You can get started now, by turning on [Multisite Networking](http://codex.wordpress.org/Create_A_Network) inside your installation of WordPress®. Then, install the s2Member plugin ( network wide ). In the Dashboard for your Main Site, see: `s2Member -> Multisite ( Config )`. Before you go live, please contact [s2Member.com](http://www.s2member.com/contact/) for full documentation on Multisite Blog Farms. There is some additional functionality that can be enabled for security on a Blog Farm installation; and also some menus/documentation/functionality that can be disabled. NOTE ~ You will be asked to make a donation, or to purchase a Support Package for s2Member.
|
135 |
+
|
136 |
= Is s2Member compatible with the BuddyPress plugin for WordPress? =
|
137 |
Yes it is. In fact, we must say... the s2Member/BuddyPress combination is just awesome. These two plugins running together make all sorts of things possible.
|
138 |
|
161 |
We get this type of question a lot. The answer is most definitely **yes**. The entire s2Member Framework is extremely versatile. For instance, the s2Member Pro Module is built on top of the free s2Member Framework; on top of the worlds' most powerful publishing platform ( WordPress® ). That being said, you WILL need be familiar with PHP, and/or WordPress® Hooks/Filters in order to accomplish advanced customizations. We suggest hiring a freelance developer at Elance.com, or hiring Jason Caldwell ( our own Lead Developer ) @ PriMoThemes.com / WebSharks, Inc. [Jason Caldwell](http://www.primothemes.com/post/author/websharksinc-jason/) is the Lead Developer behind the s2Member plugin, and also the s2Member Pro Module.
|
162 |
|
163 |
= Can s2Member be used with ClickBank® or Google® Checkout? =
|
164 |
+
Not yet. This is coming soon though. It will be included in a future release of the s2Member Pro Module, which already works with PayPal® Pro; using direct ( on-site ) credit card processing for Visa®, MasterCard®, American Express®, Discover®, Maestro®, Solo®, and PayPal® Express Checkout. [s2Member Pro](http://www.s2member.com/) is an add-on module for the [free version](http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/) of s2Member. s2Member Pro adds full PayPal® Pro integration, a PayPal® Pro Form Generator, User Import/Export tools; along with full access to our [video tutorial library](http://www.s2member.com/videos/).
|
165 |
|
166 |
== Upgrade Notice ==
|
167 |
|
168 |
+
= 3.2+ =
|
169 |
+
* Upgrade highly recommended. New features, Multisite Networking, and several bug fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
|
171 |
== Changelog ==
|
172 |
|
173 |
+
= 3.2 =
|
174 |
+
* New Feature. s2Member now provides a small panel ( aka: `meta box` ) inside your Post/Page editing stations. This new panel makes it possible for you to restrict access to a Post/Page, or even a Custom Post Type ( on-the-fly ) without having to go back to your General Options panel all the time. Starting with s2Member v3.2+, you can also tell s2Member to require Custom Capabilities on a per Post/Page basis. So now, s2Member ( if you prefer ) can handle Custom Capabilities for you! Whenever you edit a Post/Page, you can tell s2Member to require certain Custom Capabilities that you type in, using comma delimited format. In other words, you will need to type in some of the trigger words that you used whenever you created your PayPal® Pro Forms and/or Standard PayPal® Buttons. This way your Members will have the proper Capabilities to view different kinds of content that you offer. All of this is optional.
|
175 |
+
* Compatibility. s2Member, and also the s2Member Pro Module; have both been tested under WordPress® 3.0.1. Everything looks good - no conflicts.
|
176 |
+
* Multisite Networking. s2Member, and also the s2Member Pro Module; are now compatible with WordPress® 3.0+ Multisite Networking, formerly known as WPMU. In addition, preliminary ( experimental ) support for Multisite Blog Farms has also been implemented. If you\'re running a Multisite Blog Farm ( i.e. you offer Blogs ), please contact s2Member.com for further details.
|
177 |
+
* A new panel is made available under `s2Member -> Multisite ( Config )`, whenever [Multisite Networking](http://codex.wordpress.org/Create_A_Network) is enabled. This is where a Super Administrator ( operating on the Main Site ) can decide to offer Membership only, or Membership with Blog creation as well. In other words, your site could ALSO offer a Customer access to create a Blog of their own, where a Customer becomes a "Member" of your ( Main Site ), and also a Blog Owner/Administrator. With s2Member installed ( network wide ), each of your Customers could offer Membership too, using a single installation of the s2Member plugin ( which is a great selling point! ). We refer to this as a Multisite Blog Farm.
|
178 |
+
* Bug fix. The s2Member Framework has been updated to fully support installations of WordPress® that have two different URLs configured in their `WP Settings -> General` section. This bug was related to `bloginfo("url")` vs. `bloginfo("wpurl")`. In previous versions of s2Member, a major symptom of this bug was an unexpected redirection to the Home Page after checkout, instead of a formal response to the Customer. This bug was only affecting installations of WordPress® that were using a different Site Address URL, inside their `Settings -> General` panel. This has been resolved in s2Member v3.2+.
|
179 |
+
* Bug fix. An issue related to protected File Downloads, where a site owner was using sub-directories to guard specific files from specific Levels, was sometimes resulting in an invalid redirection to the Membership Options Page, with a query string indicating `21`, ( i.e. `s2member_level_req=21` ). This bug has been corrected in s2Member v3.2+.
|
180 |
+
* Videos. Over six hours of detailed [Video Tutorials](http://www.s2member.com/videos/) are now available for s2Member. Additional videos will be released over the coming days and weeks ahead; covering more advanced topics, marketing tips, and an in-depth look at the [s2Member Pro Module](http://www.s2member.com/prices/), plus Multisite Networking; which is also evolving rapidly.
|
181 |
+
* API Behavior. s2Member's API Notification for EOT/Deletions, has been changed slightly. In previous versions, the EOT/Deletion notification was only processed for a ( paid ) Member, who reached the end of their term, OR ... if a ( paid ) Member was manually deleted by an Administrator through the Dashboard. Starting with s2Member v3.2+, an EOT/Deletion Notification will be processed, EVEN if the account is NOT currently associated with a ( paid ) Member. In other words, starting with s2Member v3.2, if you delete an account manually ( through your WP Dashboard ) this will ALWAYS trigger s2Member's EOT/Deletion Notification; no matter what. For further details, check your Dashboard: `s2Member -> API Notifications -> EOT/Deletion`.
|
182 |
+
* Bug fix. Login message filter ( `login_messages` ) applied to registrations with a custom password entered during the registration process. `Registration complete. Please log in.` This Hook/Filter was renamed to just ( `login_message` ) with the release of WordPress® 3.0.1. Very minor issue, but this has been corrected with s2Member v3.2+ - in support of WordPress® 3.0.1+.
|
183 |
+
* Feature. Custom Registration Fields for s2Member, now support an Un-editable Mode ( in other words, if you want specific fields to be un-editable after registration ), you can wrap those Custom Fields inside ^carets^. In your WP Dashboard, see: `s2Member -> General Options -> Custom Fields` for additional documentation and examples.
|
184 |
+
* Profile Editing Panel. The Stand-Alone Profile Modification Page ( provided by s2Member ); now includes a password confirmation field ( in other words, a NEW password must be typed in twice as a confirmation ).
|
185 |
+
* BuddyPress/MailChimp. The first/last name fields were NOT being populated into the MailChimp® integration with BuddyPress installed. This has been resolved with s2Member v3.2+.
|
186 |
+
* Logging routines. s2Member's logging routines have been updated to support Multisite Networking. When Multisite Networking is enabled, s2Member will keep separate log files for each domain/path.
|
187 |
+
* Validation. The JavaScript validation routine for the `wp-login.php` file, now includes the Username/Email Address to help Customers avoid confusion.
|
188 |
+
* Feature. Integration of Custom Fields into the `Users -> Add New` panel. An account can now be created manually, with all details included initially. As opposed to the old way, where you had to go back and Edit the account manually, after the initial creation.
|
189 |
+
* Feature. s2Member now exposes its `s2member_custom` field inside the admin panel. You can go to your `Dashboard -> Users` panel, and click Edit next to a Member. The Custom String is now editable. You're NOT likely to need this, but s2Member makes it editable anyway. Possibly for advanced usage by a developer.
|
190 |
+
* Feature. Integration of Custom Fields into `/wp-signup.php` has been completed. This is only for Multisite Networking; where s2Member is being used in a Blog Farm environment.
|
191 |
+
* PayPal®. In the admin panel, a few subtle references to "PayPal®" have been changed to just "Paid"; leaving room for additional gateway integration possibilities that are coming soon.
|
192 |
+
* Feature. In the admin panel, there is now a shortcut link inside the s2Member menu panel; which leads a Site Administrator to `Add A Member` using manual entry.
|
193 |
+
* Compatibility. On a Multisite Network; s2Member is NOT compatible with configurations that use a different Dashboard Blog; other than the Main Site. This is NOT a good idea to try this with s2Member; it opens the door for all sorts of issues. s2Member now forces your Dashboard Blog to the Main Site for sanity/compatibility/security.
|
194 |
+
* Compatibility. Added support for this Conditional Tag `current_user_can_for_blog( $blog_id, $capability )` in support of Multisite Networking integration. As well as `$user->for_blog( $blog_id )`.
|
195 |
+
* Compatibility. Updated function calls with `usermeta` to `user_option`; including `get_user_option()`, `update_user_option()`, `delete_user_option()`. The `usermeta` functions were deprecated as of WP 3.0. The new `get_user_option()` function is also Multisite compatible. If you're a developer, you can take a look at s2Member's source code for examples. Or read [this article](http://codex.wordpress.org/Function_Reference/get_user_option).
|
196 |
+
* Important Database Change. In previous versions of s2Member, data about each Member was stored inside the `wp_usermeta` table automatically; and it STILL is. However, the `meta_key` names are now prefixed with `$wpdb->prefix`, which on most installations of WordPress® this translates to `wp_` ( e.g. `wp_s2member_subscr_id`, `wp_s2member_custom`, etc, etc. ). s2Member will automatically update your database tables upon re-activation. However, if you're a developer, and you've been using `get_usermeta($user_id, "s2member_subscr_id")`, you should now use `get_user_option("s2member_subscr_id", $user_id)` instead. No need to specify the `wp_` prefix in that function, it's handled internally by WordPress® through the `get_user_option()` call. For more information, please read [this article](http://codex.wordpress.org/Function_Reference/get_user_option).
|
197 |
+
* Bug fix. s2Member's PayPal® IPN processor was logging `Skipping Auto-EOT for now ...`, with Refund/reversal IPNs; when a particular Member already had an EOT-Time set. This was NOT the intended behavior in this scenario. In this release, s2Member has been updated to ignore existing Auto-EOT Times under this one special circumstance ( Refund/Reversal ). A Refund/Reversal will ALWAYS trigger an immediate EOT now.
|
198 |
+
* IPN Proxy Keys. s2Member's implementation of the optional Proxy Key for simulated IPN responses, has been updated to support Multisite Networking; through a new PayPal® utility function `ws_plugin__s2member_paypal_proxy_key_gen ()`. For further details, check your Dashboard under `s2Member -> PayPal® Options -> IPN Integration -> Proxy Key`.
|
199 |
+
* UI Improvement. The tabindex property for [?] icons in the admin panel have been set to `tabindex="-1"` to prevent an annoyance.
|
200 |
+
* Compatibility. On a Windows® server, the cURL extension is usually NOT compatible with SSL communications. s2Member now signals to the WP_Http class, that it should temporarily disable the cURL transport when a remote URL is being processed with an `https://` prefix. This allows the WP_Http class to recover gracefully (automatically) and fall back on the FOPEN method. If you're running WordPress® on a Windows® server, you should make sure that you have this inside your php.ini file. ( `allow_url_fopen = on` ). A symptom of this bug, was to see an error in your paypal-ipn.log file, with something like: `Unable to verify _POST vars...`.
|
201 |
+
* Compatibility. s2Member's menu inside WordPress® now requires the `create_users` capability, instead of the more restrictive `edit_plugins`. This provides improved compatibility across various installations/configurations.
|
202 |
+
* API Notifications. s2Member's API Notification for Refund/Reversals, now includes a negative `%%-fee%%` Replacement Code; referencing the `mc_fee` variable sent through PayPal® IPN responses.
|
203 |
+
* General Maintenance. A full review of s2Member's source code was completed in this release. Including, but not limited to: general maintenance, code cleanup, optimizations.
|
204 |
+
* Login/Registration Design. Inside the General Options panel for s2Member, under `Login/Registration Design` there is a new option that allows you to configure the type of `Background Tiling` you prefer.
|
205 |
+
* Compatibility. The s2Member routine that responds to the `delete_user` Hook for WordPress®, has been safeguarded against duplicate processing via plugins ( or even WordPress® itself ).
|
206 |
+
* Improvement. s2Member now makes your Custom Fields available to a User/Member on the default Profile Editing Panel; the one inside WordPress®. Using this panel is still optional though; because s2Member includes a stand-alone panel as well ( see: `Profile Modifications, inside your s2Member -> General Options` ).
|
207 |
+
* API Notifications. s2Member's API Notification for Registration events, now (ALSO) includes ANY type of account that is created inside your Dashboard, under the `Users -> Add New` panel. In previous versions, the API Notification was NOT triggered for new accounts that were assigned a Role of Administrator/Editor/Author/Contributor in the Dashboard. Starting with s2Member v3.2+, they do! In conjunction with this change, comes a new Replacement Code `%%role%%` indicating the Role ID ( e.g. `subscriber, s2member_level[1-4], administrator, editor, author, contributor` ) associated with the new User. The Replacement Code `%%level%%` has been deprecated, please use `%%role%%` instead.
|
208 |
+
* Security Relaxation. In previous versions, s2Member has always prevented its processing routines from running on accounts with an Administrator/Editor/Author/Contributor Role. However, starting with v3.2+, s2Member WILL now process its routines for Editors/Authors/Contributors. Administrators will still NOT be processed under ANY circumstance though. The reason for this security relaxation, is to provide developers ( using Hooks/Filters ), with the ability to integrate s2Member in even more creative ways.
|
209 |
+
* Function removed. The function `ws_plugin__s2member_has_wp_role()` has been removed. It is no longer necessary. If you're a developer, and you've been using this function in previous versions... we suggest switching over to `current_user_can("[role name or capability])` instead. For more information, you can read [this article](http://codex.wordpress.org/Roles_and_Capabilities).
|
210 |
+
* Security hardening. s2Member's routines for analyzing and authenticating the validity of the three encrypted Cookies that it grants to a paying Customer - has been improved with s2Member v3.2.
|
211 |
+
* Replacement Codes. The `%%user_id%%` Replacement Code has been added to several other API Notifications now. Also, there are two new Replacement Codes for Payment Notifications ( `%%subscr_payment%%`, `%%subscr_payment_user_id%%` ). For further details, see: `s2Member -> API Notifications` in your Dashboard.
|
212 |
+
* Bug fix. The Default Password Nag that is built into WordPress® was not being suppressed whenever you allow Custom Passwords during registration. This has been resolved with s2Member v3.2+.
|
213 |
+
|
214 |
= 3.1.5 =
|
215 |
* Bug fix. The Replacment Code ( `%%current_user_level%%` ); which works in conjunction with a Login Welcome Page URL, and also with URI Level Access was always returning `-1`. This has been corrected in v3.1.5+.
|
216 |
* General cleanup and improved routines inside `/includes/file-download-access.inc.php`. No functionality changes, just subtle improvements in the logic behind s2Member's File Download Restrictions.
|
361 |
* New feature. A couple of Replacement Codes are now supported in the s2Member URI Level Access Restrictions. See: `s2Member -> General Options -> URI Level Access` for further details. This can be useful if you're running BuddyPress. For example, if you're using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: `/members/%%current_user_login%%/groups/`
|
362 |
* New feature. For protected File Downloads, you may now specify a list of file extensions that should be displayed Inline ( in your browser ) as opposed to being downloaded as an attachment. See: `s2Member -> Download Options -> Inline Extensions`. A new API Constant was also added, which reflects the value of this option: `S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS`.
|
363 |
* Documentation change. This is only relevant if you've been using the `s2member_xencrypt()` function to provide free access to specific files. The documentation for this has been changed. You should now use `s2member_free_file_download_key=<?php echo md5(s2member_xencrypt("file")); ?>`, instead of just `s2member_xencrypt()` by itself ( which is now deprecated ). The addition of the MD5 hash improves the security of s2Member on a whole, and also makes your links shorter. Please update your links. In future versions of s2Member, the older method will no longer be supported.
|
364 |
+
* Compatibility fix. Calls to the PHP `mail()` function have been modified to exclude additional flag parameters. This makes s2Member more compatible with a variety of MTAs across different hosting providers.
|
365 |
* New feature. A couple of Replacement Codes are now supported in the s2Member Login Redirection URL. See: `s2Member -> General Options -> Login Welcome Page -> Special Redirection` for further details. This can be useful if you'd like to redirect Members to their BuddyPress Profile, if/when BuddyPress is installed together with s2Member. For example, if you're using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: `http://www.example.com/members/%%current_user_login%%/profile/`
|
366 |
* Please note. BuddyPress is NOT required to use s2Member. However, the combination of BuddyPress + s2Member is a popular choice among site owners.
|
367 |
|
s2member.php
CHANGED
@@ -9,18 +9,18 @@ along with this software. In the main directory, see: /licensing/
|
|
9 |
If not, see: <http://www.gnu.org/licenses/>.
|
10 |
*/
|
11 |
/*
|
12 |
-
Version: 3.
|
13 |
-
Stable tag: 3.
|
14 |
Framework: WS-P-3.0
|
15 |
|
16 |
SSL Compatible: yes
|
17 |
bbPress Compatible: yes
|
18 |
WordPress Compatible: yes
|
19 |
BuddyPress Compatible: yes
|
20 |
-
WP Multisite Compatible:
|
21 |
-
Multisite Blog Farm Compatible:
|
22 |
|
23 |
-
Tested up to: 3.0
|
24 |
Requires at least: 3.0
|
25 |
Requires: WordPress® 3.0+, PHP 5.2+
|
26 |
|
@@ -32,25 +32,26 @@ Author: PriMoThemes.com / WebSharks, Inc.
|
|
32 |
Donate link: http://www.primothemes.com/donate/
|
33 |
|
34 |
Plugin Name: s2Member
|
35 |
-
Pro Module /
|
36 |
Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
|
37 |
Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
|
|
|
38 |
Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
|
39 |
-
Description: Empowers WordPress® with membership capabilities. Integrates seamlessly with PayPal®. Also compatible with
|
40 |
-
Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code,
|
41 |
*/
|
42 |
/*
|
43 |
Direct access denial.
|
44 |
*/
|
45 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
46 |
-
exit("Do not access this file directly.");
|
47 |
/*
|
48 |
Define versions.
|
49 |
*/
|
50 |
-
define ("WS_PLUGIN__S2MEMBER_VERSION", "3.
|
51 |
define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
|
52 |
define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "3.0");
|
53 |
-
define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.
|
54 |
/*
|
55 |
Compatibility checks.
|
56 |
*/
|
@@ -60,7 +61,7 @@ if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") &&
|
|
60 |
/*
|
61 |
Hook before loaded.
|
62 |
*/
|
63 |
-
do_action("ws_plugin__s2member_before_loaded");
|
64 |
/*
|
65 |
System configuraton.
|
66 |
*/
|
@@ -72,7 +73,7 @@ if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") &&
|
|
72 |
/*
|
73 |
Hook after system config & hooks are loaded.
|
74 |
*/
|
75 |
-
do_action("ws_plugin__s2member_config_hooks_loaded");
|
76 |
/*
|
77 |
Load a possible Pro module, if/when available.
|
78 |
*/
|
@@ -88,7 +89,7 @@ if (version_compare (PHP_VERSION, WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION, ">=") &&
|
|
88 |
/*
|
89 |
Hook after loaded.
|
90 |
*/
|
91 |
-
do_action("ws_plugin__s2member_after_loaded");
|
92 |
}
|
93 |
else if (is_admin ()) /* Admin compatibility errors. */
|
94 |
{
|
9 |
If not, see: <http://www.gnu.org/licenses/>.
|
10 |
*/
|
11 |
/*
|
12 |
+
Version: 3.2
|
13 |
+
Stable tag: 3.2
|
14 |
Framework: WS-P-3.0
|
15 |
|
16 |
SSL Compatible: yes
|
17 |
bbPress Compatible: yes
|
18 |
WordPress Compatible: yes
|
19 |
BuddyPress Compatible: yes
|
20 |
+
WP Multisite Compatible: yes
|
21 |
+
Multisite Blog Farm Compatible: yes
|
22 |
|
23 |
+
Tested up to: 3.0.1
|
24 |
Requires at least: 3.0
|
25 |
Requires: WordPress® 3.0+, PHP 5.2+
|
26 |
|
32 |
Donate link: http://www.primothemes.com/donate/
|
33 |
|
34 |
Plugin Name: s2Member
|
35 |
+
Pro Module / Prices: http://www.s2member.com/prices/
|
36 |
Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
|
37 |
Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
|
38 |
+
PayPal Pro Integration: http://www.primothemes.com/forums/viewtopic.php?f=4&t=304
|
39 |
Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
|
40 |
+
Description: Empowers WordPress® with membership capabilities. Integrates seamlessly with PayPal®. Also compatible with Multisite Networking, and even with BuddyPress if you like.
|
41 |
+
Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, includes extensive documentation, highly extensible
|
42 |
*/
|
43 |
/*
|
44 |
Direct access denial.
|
45 |
*/
|
46 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
47 |
+
exit ("Do not access this file directly.");
|
48 |
/*
|
49 |
Define versions.
|
50 |
*/
|
51 |
+
define ("WS_PLUGIN__S2MEMBER_VERSION", "3.2");
|
52 |
define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
|
53 |
define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "3.0");
|
54 |
+
define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.2");
|
55 |
/*
|
56 |
Compatibility checks.
|
57 |
*/
|
61 |
/*
|
62 |
Hook before loaded.
|
63 |
*/
|
64 |
+
do_action ("ws_plugin__s2member_before_loaded");
|
65 |
/*
|
66 |
System configuraton.
|
67 |
*/
|
73 |
/*
|
74 |
Hook after system config & hooks are loaded.
|
75 |
*/
|
76 |
+
do_action ("ws_plugin__s2member_config_hooks_loaded");
|
77 |
/*
|
78 |
Load a possible Pro module, if/when available.
|
79 |
*/
|
89 |
/*
|
90 |
Hook after loaded.
|
91 |
*/
|
92 |
+
do_action ("ws_plugin__s2member_after_loaded");
|
93 |
}
|
94 |
else if (is_admin ()) /* Admin compatibility errors. */
|
95 |
{
|