Version Description
= v140725 =
(Maintenance Release) Upgrade immediately.
Download this release
Release Info
Developer | JasWSInc |
Plugin | ![]() |
Version | 140725 |
Comparing to | |
See all releases |
Code changes from version 140614 to 140725
- checksum.txt +1 -1
- images/trans-bg.png +0 -0
- includes/classes/admin-css-js-in.inc.php +109 -109
- includes/classes/admin-css-js.inc.php +51 -59
- includes/classes/admin-lockouts.inc.php +129 -132
- includes/classes/auto-eots.inc.php +35 -35
- includes/classes/check-activation.inc.php +43 -51
- includes/classes/cron-jobs-in.inc.php +65 -67
- includes/classes/cron-jobs.inc.php +54 -57
- includes/classes/css-js-in.inc.php +181 -182
- includes/classes/css-js-themes.inc.php +127 -136
- includes/classes/css-js.inc.php +51 -59
- includes/classes/email-configs.inc.php +75 -75
- includes/classes/installation.inc.php +218 -211
- includes/classes/list-servers.inc.php +487 -445
- includes/classes/login-checks.inc.php +207 -204
- includes/classes/login-customizations.inc.php +214 -216
- includes/classes/login-redirects.inc.php +6 -6
- includes/classes/paypal-notify-in-billing-agreement-signup.inc.php +2 -5
- includes/classes/paypal-notify-in-cart.inc.php +1 -3
- includes/classes/paypal-notify-in-express-checkout.inc.php +2 -5
- includes/classes/paypal-notify-in-merch-pmt.inc.php +2 -5
- includes/classes/paypal-notify-in-rec-profile-creation-w-level.inc.php +5 -6
- includes/classes/paypal-notify-in-send-money.inc.php +2 -5
- includes/classes/paypal-notify-in-sp-refund-reversal.inc.php +27 -29
- includes/classes/paypal-notify-in-subscr-modify-w-level.inc.php +159 -158
- includes/classes/paypal-notify-in-subscr-or-rp-cancellation-w-level.inc.php +46 -50
- includes/classes/paypal-notify-in-subscr-or-rp-eots-w-level.inc.php +87 -86
- includes/classes/paypal-notify-in-subscr-or-rp-payment-failed-w-level.inc.php +5 -6
- includes/classes/paypal-notify-in-subscr-or-rp-payment-w-level.inc.php +56 -59
- includes/classes/paypal-notify-in-subscr-or-wa-w-level.inc.php +763 -740
- includes/classes/paypal-notify-in-virtual-terminal.inc.php +2 -5
- includes/classes/paypal-notify-in-wa-ccaps-wo-level.inc.php +183 -179
- includes/classes/paypal-notify-in-web-accept-sp.inc.php +111 -112
- includes/classes/paypal-notify-in.inc.php +202 -208
- includes/classes/paypal-notify.inc.php +38 -43
- includes/classes/paypal-return-in-no-tx-data.inc.php +1 -2
- includes/classes/paypal-return-in-proxy-ty-email.inc.php +1 -2
- includes/classes/paypal-return-in-proxy-x-preview.inc.php +1 -2
- includes/classes/paypal-return-in-subscr-modify-w-level.inc.php +33 -37
- includes/classes/paypal-return-in-subscr-or-wa-w-level.inc.php +49 -49
- includes/classes/paypal-return-in-wa-ccaps-wo-level.inc.php +32 -32
- includes/classes/paypal-return-in-web-accept-sp.inc.php +16 -17
- includes/classes/paypal-return-in.inc.php +4 -6
- includes/classes/paypal-return.inc.php +38 -43
- includes/classes/paypal-utilities.inc.php +2 -2
- includes/classes/profile-mods-4bp-in.inc.php +5 -4
- includes/classes/profile-mods-in.inc.php +4 -3
- includes/classes/registrations.inc.php +56 -43
- includes/classes/return-templates.inc.php +6 -6
- includes/classes/ruris.inc.php +6 -6
- includes/classes/sc-paypal-button-e.inc.php +1 -1
- includes/classes/sc-paypal-button-in.inc.php +88 -88
- includes/classes/tracking-codes.inc.php +203 -230
- includes/classes/tracking-cookies-in.inc.php +89 -95
- includes/classes/tracking-cookies.inc.php +51 -59
- includes/classes/translations.inc.php +151 -157
- includes/classes/user-access.inc.php +4 -4
- includes/classes/user-deletions.inc.php +214 -219
- includes/classes/user-securities.inc.php +133 -127
- includes/classes/users-list-in.inc.php +18 -2
- includes/classes/utils-logs.inc.php +218 -212
- includes/classes/utils-strings.inc.php +2 -2
- includes/classes/utils-users.inc.php +373 -345
- includes/hooks.inc.php +2 -1
- includes/menu-pages/api-ops.inc.php +42 -28
- includes/menu-pages/down-ops.inc.php +3 -3
- includes/menu-pages/gen-ops.inc.php +13 -13
- includes/menu-pages/logs.inc.php +1 -1
- includes/menu-pages/menu-pages-min.js +1 -1
- includes/menu-pages/menu-pages-s-min.js +1 -1
- includes/menu-pages/menu-pages-s.js +7 -4
- includes/menu-pages/menu-pages.css +73 -35
- includes/menu-pages/menu-pages.js +162 -168
- includes/menu-pages/paypal-buttons.inc.php +59 -59
- includes/menu-pages/paypal-ops.inc.php +47 -11
- includes/menu-pages/scripting.inc.php +3 -3
- includes/menu-pages/start.inc.php +1 -1
- includes/menu-pages/trk-ops.inc.php +22 -15
- includes/menu-pages/updates.inc.php +0 -12
- includes/s2member-min.js +1 -1
- includes/s2member.js +484 -493
- includes/syscon.inc.php +438 -433
- includes/translations/s2member.pot +969 -459
- readme.txt +56 -6
- s2member.php +4 -4
checksum.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
|
1 |
+
a5a97b396b6173a3fb461b92da759019
|
images/trans-bg.png
ADDED
Binary file
|
includes/classes/admin-css-js-in.inc.php
CHANGED
@@ -1,120 +1,120 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Administrative CSS/JS for menu pages (inner processing routines).
|
4 |
-
*
|
5 |
-
* Copyright: © 2009-2011
|
6 |
-
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
-
* (coded in the USA)
|
8 |
-
*
|
9 |
-
* Released under the terms of the GNU General Public License.
|
10 |
-
* You should have received a copy of the GNU General Public License,
|
11 |
-
* along with this software. In the main directory, see: /licensing/
|
12 |
-
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
-
*
|
14 |
-
* @package s2Member\Admin_CSS_JS
|
15 |
-
* @since 3.5
|
16 |
-
*/
|
17 |
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
|
18 |
exit("Do not access this file directly.");
|
19 |
|
20 |
if(!class_exists("c_ws_plugin__s2member_admin_css_js_in"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
/**
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
{
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
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 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images";
|
101 |
-
|
102 |
-
for($n = 0, $labels = ""; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
103 |
-
$labels .= "labels['level".$n."'] = '".((!empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level".$n."_label"])) ? str_replace('"', "", c_ws_plugin__s2member_utils_strings::esc_js_sq($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level".$n."_label"], 3)) : "")."';";
|
104 |
-
unset($n);
|
105 |
-
|
106 |
-
include_once dirname(dirname(__FILE__))."/menu-pages/menu-pages-min.js";
|
107 |
-
|
108 |
-
echo /* Add a line break before inclusion of this file. */"\n";
|
109 |
-
|
110 |
-
@include_once dirname(dirname(__FILE__))."/menu-pages/menu-pages-s-min.js";
|
111 |
-
|
112 |
-
do_action("ws_plugin__s2member_during_menu_pages_js", get_defined_vars());
|
113 |
-
|
114 |
-
exit /* Clean exit. */();
|
115 |
-
}
|
116 |
-
do_action("ws_plugin__s2member_after_menu_pages_js", get_defined_vars());
|
117 |
-
}
|
118 |
}
|
|
|
|
|
119 |
}
|
120 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Administrative CSS/JS for menu pages (inner processing routines).
|
4 |
+
*
|
5 |
+
* Copyright: © 2009-2011
|
6 |
+
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
+
* (coded in the USA)
|
8 |
+
*
|
9 |
+
* Released under the terms of the GNU General Public License.
|
10 |
+
* You should have received a copy of the GNU General Public License,
|
11 |
+
* along with this software. In the main directory, see: /licensing/
|
12 |
+
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
+
*
|
14 |
+
* @package s2Member\Admin_CSS_JS
|
15 |
+
* @since 3.5
|
16 |
+
*/
|
17 |
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
|
18 |
exit("Do not access this file directly.");
|
19 |
|
20 |
if(!class_exists("c_ws_plugin__s2member_admin_css_js_in"))
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Administrative CSS/JS for menu pages (inner processing routines).
|
24 |
+
*
|
25 |
+
* @package s2Member\Admin_CSS_JS
|
26 |
+
* @since 3.5
|
27 |
+
*/
|
28 |
+
class c_ws_plugin__s2member_admin_css_js_in
|
29 |
{
|
30 |
/**
|
31 |
+
* Outputs the CSS for administrative menu pages.
|
32 |
+
*
|
33 |
+
* @package s2Member\Admin_CSS_JS
|
34 |
+
* @since 3.5
|
35 |
+
*
|
36 |
+
* @attaches-to ``add_action("init");``
|
37 |
+
*
|
38 |
+
* @return null Or exits script execution after loading CSS.
|
39 |
+
*/
|
40 |
+
public static function menu_pages_css()
|
41 |
+
{
|
42 |
+
do_action("ws_plugin__s2member_before_menu_pages_css", get_defined_vars());
|
43 |
+
|
44 |
+
if(!empty($_GET["ws_plugin__s2member_menu_pages_css"]) && is_user_logged_in() && current_user_can("create_users"))
|
45 |
{
|
46 |
+
status_header(200); // 200 OK status header.
|
47 |
+
|
48 |
+
header("Content-Type: text/css; charset=UTF-8");
|
49 |
+
header("Expires: ".gmdate("D, d M Y H:i:s", strtotime("-1 week"))." GMT");
|
50 |
+
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
51 |
+
header("Cache-Control: no-cache, must-revalidate, max-age=0");
|
52 |
+
header("Pragma: no-cache");
|
53 |
+
|
54 |
+
while(@ob_end_clean()) ; // Clean any existing output buffers.
|
55 |
+
|
56 |
+
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
57 |
+
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images";
|
58 |
+
|
59 |
+
ob_start("c_ws_plugin__s2member_utils_css::compress_css");
|
60 |
+
|
61 |
+
include_once dirname(dirname(__FILE__))."/menu-pages/menu-pages.css";
|
62 |
+
|
63 |
+
echo "\n"; // Add a line break before inclusion of this file.
|
64 |
+
|
65 |
+
@include_once dirname(dirname(__FILE__))."/menu-pages/menu-pages-s.css";
|
66 |
+
|
67 |
+
do_action("ws_plugin__s2member_during_menu_pages_css", get_defined_vars());
|
68 |
+
|
69 |
+
exit(); // Clean exit.
|
70 |
+
}
|
71 |
+
do_action("ws_plugin__s2member_after_menu_pages_css", get_defined_vars());
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Outputs the JS for administrative menu pages.
|
76 |
+
*
|
77 |
+
* @package s2Member\Admin_CSS_JS
|
78 |
+
* @since 3.5
|
79 |
+
*
|
80 |
+
* @attaches-to ``add_action("init");``
|
81 |
+
*
|
82 |
+
* @return null Or exits script execution after loading JS.
|
83 |
+
*/
|
84 |
+
public static function menu_pages_js()
|
85 |
+
{
|
86 |
+
do_action("ws_plugin__s2member_before_menu_pages_js", get_defined_vars());
|
87 |
+
|
88 |
+
if(!empty($_GET["ws_plugin__s2member_menu_pages_js"]) && is_user_logged_in() && current_user_can("create_users"))
|
89 |
+
{
|
90 |
+
status_header(200); // 200 OK status header.
|
91 |
+
|
92 |
+
header("Content-Type: application/x-javascript; charset=UTF-8");
|
93 |
+
header("Expires: ".gmdate("D, d M Y H:i:s", strtotime("-1 week"))." GMT");
|
94 |
+
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
95 |
+
header("Cache-Control: no-cache, must-revalidate, max-age=0");
|
96 |
+
header("Pragma: no-cache");
|
97 |
+
|
98 |
+
while(@ob_end_clean()) ; // Clean any existing output buffers.
|
99 |
+
|
100 |
+
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
101 |
+
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images";
|
102 |
+
|
103 |
+
for($n = 0, $labels = ""; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
104 |
+
$labels .= "labels['level".$n."'] = '".((!empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level".$n."_label"])) ? str_replace('"', "", c_ws_plugin__s2member_utils_strings::esc_js_sq($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level".$n."_label"], 3)) : "")."';";
|
105 |
+
unset($n);
|
106 |
+
|
107 |
+
include_once dirname(dirname(__FILE__))."/menu-pages/menu-pages-min.js";
|
108 |
+
|
109 |
+
echo "\n"; // Add a line break before inclusion of this file.
|
110 |
+
|
111 |
+
@include_once dirname(dirname(__FILE__))."/menu-pages/menu-pages-s-min.js";
|
112 |
+
|
113 |
+
do_action("ws_plugin__s2member_during_menu_pages_js", get_defined_vars());
|
114 |
+
|
115 |
+
exit(); // Clean exit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
+
do_action("ws_plugin__s2member_after_menu_pages_js", get_defined_vars());
|
118 |
+
}
|
119 |
}
|
120 |
+
}
|
includes/classes/admin-css-js.inc.php
CHANGED
@@ -1,66 +1,58 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Administrative CSS/JS for menu pages.
|
4 |
-
*
|
5 |
-
* Copyright: © 2009-2011
|
6 |
-
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
-
* (coded in the USA)
|
8 |
-
*
|
9 |
-
* Released under the terms of the GNU General Public License.
|
10 |
-
* You should have received a copy of the GNU General Public License,
|
11 |
-
* along with this software. In the main directory, see: /licensing/
|
12 |
-
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
-
*
|
14 |
-
* @package s2Member\Admin_CSS_JS
|
15 |
-
* @since 3.5
|
16 |
-
*/
|
17 |
-
if
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
/**
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
*
|
50 |
-
* @package s2Member\Admin_CSS_JS
|
51 |
-
* @since 3.5
|
52 |
-
*
|
53 |
-
* @attaches-to ``add_action("init");``
|
54 |
-
*
|
55 |
-
* @return null|inner Return-value of inner routine.
|
56 |
-
*/
|
57 |
-
public static function menu_pages_js ()
|
58 |
-
{
|
59 |
-
if (!empty($_GET["ws_plugin__s2member_menu_pages_js"]))
|
60 |
-
{
|
61 |
-
return c_ws_plugin__s2member_admin_css_js_in::menu_pages_js ();
|
62 |
-
}
|
63 |
-
}
|
64 |
-
}
|
65 |
}
|
66 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Administrative CSS/JS for menu pages.
|
4 |
+
*
|
5 |
+
* Copyright: © 2009-2011
|
6 |
+
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
+
* (coded in the USA)
|
8 |
+
*
|
9 |
+
* Released under the terms of the GNU General Public License.
|
10 |
+
* You should have received a copy of the GNU General Public License,
|
11 |
+
* along with this software. In the main directory, see: /licensing/
|
12 |
+
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
+
*
|
14 |
+
* @package s2Member\Admin_CSS_JS
|
15 |
+
* @since 3.5
|
16 |
+
*/
|
17 |
+
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
+
if(!class_exists("c_ws_plugin__s2member_admin_css_js"))
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Administrative CSS/JS for menu pages.
|
24 |
+
*
|
25 |
+
* @package s2Member\Admin_CSS_JS
|
26 |
+
* @since 3.5
|
27 |
+
*/
|
28 |
+
class c_ws_plugin__s2member_admin_css_js
|
29 |
{
|
30 |
/**
|
31 |
+
* Outputs the CSS for administrative menu pages.
|
32 |
+
*
|
33 |
+
* @package s2Member\Admin_CSS_JS
|
34 |
+
* @since 3.5
|
35 |
+
*
|
36 |
+
* @attaches-to ``add_action("init");``
|
37 |
+
*/
|
38 |
+
public static function menu_pages_css()
|
39 |
+
{
|
40 |
+
if(!empty($_GET["ws_plugin__s2member_menu_pages_css"]))
|
41 |
+
c_ws_plugin__s2member_admin_css_js_in::menu_pages_css();
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Outputs the JS for administrative menu pages.
|
46 |
+
*
|
47 |
+
* @package s2Member\Admin_CSS_JS
|
48 |
+
* @since 3.5
|
49 |
+
*
|
50 |
+
* @attaches-to ``add_action("init");``
|
51 |
+
*/
|
52 |
+
public static function menu_pages_js()
|
53 |
+
{
|
54 |
+
if(!empty($_GET["ws_plugin__s2member_menu_pages_js"]))
|
55 |
+
c_ws_plugin__s2member_admin_css_js_in::menu_pages_js();
|
56 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
+
}
|
includes/classes/admin-lockouts.inc.php
CHANGED
@@ -1,139 +1,136 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Locks Users/Members out of admin panels.
|
4 |
-
*
|
5 |
-
* Copyright: © 2009-2011
|
6 |
-
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
-
* (coded in the USA)
|
8 |
-
*
|
9 |
-
* Released under the terms of the GNU General Public License.
|
10 |
-
* You should have received a copy of the GNU General Public License,
|
11 |
-
* along with this software. In the main directory, see: /licensing/
|
12 |
-
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
-
*
|
14 |
-
* @package s2Member\Admin_Lockouts
|
15 |
-
* @since 3.5
|
16 |
-
*/
|
17 |
-
if
|
18 |
-
exit
|
19 |
-
|
20 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
/**
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
{
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
do_action("ws_plugin__s2member_after_admin_lockouts", get_defined_vars ());
|
54 |
-
|
55 |
-
return /* Return for uniformity. */;
|
56 |
-
}
|
57 |
-
/**
|
58 |
-
* Filters administrative menu bar for Users/Members.
|
59 |
-
*
|
60 |
-
* @package s2Member\Admin_Lockouts
|
61 |
-
* @since 3.5
|
62 |
-
*
|
63 |
-
* @attaches-to ``add_action("admin_bar_menu");``
|
64 |
-
*
|
65 |
-
* @param object $wp_admin_bar Expects the ``$wp_admin_bar``, by reference; passed in by the Action Hook.
|
66 |
-
* @return null After modifying ``$wp_admin_var``.
|
67 |
-
*/
|
68 |
-
public static function filter_admin_menu_bar (&$wp_admin_bar = FALSE)
|
69 |
-
{
|
70 |
-
do_action("ws_plugin__s2member_before_filter_admin_menu_bar", get_defined_vars ());
|
71 |
-
|
72 |
-
$uses_nodes = (version_compare (get_bloginfo ("version"), "3.3-RC1", ">=")) ? true : false;
|
73 |
-
|
74 |
-
if (is_object ($wp_admin_bar) && !current_user_can ("edit_posts") /* Always for Users/Members. */)
|
75 |
-
{
|
76 |
-
if ($uses_nodes && $wp_admin_bar->get_node /* We have this node? */ ("site-name"))
|
77 |
-
{
|
78 |
-
$id = /* Give this a special/unique ID. */ "s2-site-name";
|
79 |
-
$title = wp_html_excerpt /* A brief excerpt. */ (get_bloginfo ("name"), 42);
|
80 |
-
$title = ($title !== get_bloginfo ("name")) ? trim ($title) . "…" : $title;
|
81 |
-
$href = /* Change to front page. */ site_url ("/");
|
82 |
-
|
83 |
-
$wp_admin_bar->add_node (array("id" => $id, "title" => $title, "href" => $href));
|
84 |
-
$wp_admin_bar->remove_node /* Ditch now, replacing this. */ ("site-name");
|
85 |
-
|
86 |
-
unset /* A little housekeeping. */ ($id, $title, $href);
|
87 |
-
}
|
88 |
-
if ($uses_nodes && $wp_admin_bar->get_node /* We have this node? */ ("wp-logo"))
|
89 |
-
$wp_admin_bar->remove_node /* Ditch this node. */ ("wp-logo");
|
90 |
-
// -------
|
91 |
-
if (!$uses_nodes && isset /* Have this item? */ ($wp_admin_bar->menu->{"dashboard"}))
|
92 |
-
unset /* Ditch this item. */ ($wp_admin_bar->menu->{"dashboard"});
|
93 |
-
|
94 |
-
if (!$uses_nodes && isset /* Have this item? */ ($wp_admin_bar->menu->{"my-blogs"}))
|
95 |
-
unset /* Ditch this item. */ ($wp_admin_bar->menu->{"my-blogs"});
|
96 |
-
// -------
|
97 |
-
if ($uses_nodes && $wp_admin_bar->get_node /* We have this node? */ ("my-sites"))
|
98 |
-
$wp_admin_bar->remove_node /* Ditch this node. */ ("my-sites");
|
99 |
-
}
|
100 |
-
if (is_object ($wp_admin_bar) && !current_user_can ("edit_posts") /* If locking Users/Members out of `/wp-admin/` areas. */)
|
101 |
-
if (apply_filters("ws_plugin__s2member_admin_lockout", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"], get_defined_vars ()))
|
102 |
-
{
|
103 |
-
$lwp = c_ws_plugin__s2member_login_redirects::login_redirection_url ();
|
104 |
-
$lwp = (!$lwp) ? get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) : $lwp;
|
105 |
-
|
106 |
-
if ($uses_nodes && $wp_admin_bar->get_node /* We have this node? */ ("my-account"))
|
107 |
-
$wp_admin_bar->add_node /* Update this node. */ (array("id" => "my-account", "href" => $lwp));
|
108 |
-
|
109 |
-
if ($uses_nodes && $wp_admin_bar->get_node /* We have this node? */ ("user-info"))
|
110 |
-
$wp_admin_bar->add_node /* Update this node. */ (array("id" => "user-info", "href" => $lwp));
|
111 |
-
|
112 |
-
if ($uses_nodes && $wp_admin_bar->get_node /* We have this node? */ ("edit-profile"))
|
113 |
-
$wp_admin_bar->add_node /* Update this node. */ (array("id" => "edit-profile", "href" => $lwp));
|
114 |
-
// -------
|
115 |
-
if (!$uses_nodes && isset /* Have this item? */ ($wp_admin_bar->menu->{"my-account"}["href"]))
|
116 |
-
$wp_admin_bar->menu->{"my-account"}["href"] = /* Update this item. */ $lwp;
|
117 |
-
|
118 |
-
if (!$uses_nodes && isset /* Have this item? */ ($wp_admin_bar->menu->{"my-account"}["children"]->{"edit-profile"}["href"]))
|
119 |
-
$wp_admin_bar->menu->{"my-account"}["children"]->{"edit-profile"}["href"] = /* Update this item. */ $lwp;
|
120 |
-
|
121 |
-
if (!$uses_nodes && isset /* Have this item? */ ($wp_admin_bar->menu->{"my-account"}["children"]->{"user-info"}["href"]))
|
122 |
-
$wp_admin_bar->menu->{"my-account"}["children"]->{"user-info"}["href"] = /* Update this item. */ $lwp;
|
123 |
-
// -------
|
124 |
-
if (!$uses_nodes && isset /* Have this item? */ ($wp_admin_bar->menu->{"my-account-with-avatar"}["href"]))
|
125 |
-
$wp_admin_bar->menu->{"my-account-with-avatar"}["href"] = /* Update this item. */ $lwp;
|
126 |
-
|
127 |
-
if (!$uses_nodes && isset /* Have this item? */ ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"user-info"}["href"]))
|
128 |
-
$wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"user-info"}["href"] = /* Update this item. */ $lwp;
|
129 |
-
|
130 |
-
if (!$uses_nodes && isset /* Have this item? */ ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"]))
|
131 |
-
$wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"] = /* Update this item. */ $lwp;
|
132 |
-
}
|
133 |
-
do_action("ws_plugin__s2member_after_filter_admin_menu_bar", get_defined_vars ());
|
134 |
-
|
135 |
-
return /* Return for uniformity. */;
|
136 |
-
}
|
137 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
}
|
139 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Locks Users/Members out of admin panels.
|
4 |
+
*
|
5 |
+
* Copyright: © 2009-2011
|
6 |
+
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
+
* (coded in the USA)
|
8 |
+
*
|
9 |
+
* Released under the terms of the GNU General Public License.
|
10 |
+
* You should have received a copy of the GNU General Public License,
|
11 |
+
* along with this software. In the main directory, see: /licensing/
|
12 |
+
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
+
*
|
14 |
+
* @package s2Member\Admin_Lockouts
|
15 |
+
* @since 3.5
|
16 |
+
*/
|
17 |
+
if(realpath(__FILE__) === realpath($_SERVER['SCRIPT_FILENAME']))
|
18 |
+
exit ('Do not access this file directly.');
|
19 |
+
|
20 |
+
if(!class_exists('c_ws_plugin__s2member_admin_lockouts'))
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Locks Users/Members out of admin panels.
|
24 |
+
*
|
25 |
+
* @package s2Member\Admin_Lockouts
|
26 |
+
* @since 3.5
|
27 |
+
*/
|
28 |
+
class c_ws_plugin__s2member_admin_lockouts
|
29 |
{
|
30 |
/**
|
31 |
+
* Locks Users/Members out of admin panels.
|
32 |
+
*
|
33 |
+
* @package s2Member\Admin_Lockouts
|
34 |
+
* @since 3.5
|
35 |
+
*
|
36 |
+
* @attaches-to ``add_action('admin_init');``
|
37 |
+
*
|
38 |
+
* @return null Or exits script execution after redirection.
|
39 |
+
*/
|
40 |
+
public static function admin_lockout()
|
41 |
+
{
|
42 |
+
do_action('ws_plugin__s2member_before_admin_lockouts', get_defined_vars());
|
43 |
+
|
44 |
+
if(is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX) && !current_user_can('edit_posts') /* Give Filters a chance here too. */)
|
45 |
+
if(apply_filters('ws_plugin__s2member_admin_lockout', $GLOBALS['WS_PLUGIN__']['s2member']['o']['force_admin_lockouts'], get_defined_vars()))
|
46 |
+
{
|
47 |
+
if($redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url())
|
48 |
+
wp_redirect($redirection_url).exit ( /* Special Redirection. */);
|
49 |
+
|
50 |
+
else // Else we use the Login Welcome Page configured for s2Member.
|
51 |
+
wp_redirect(get_page_link($GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page'])).exit ();
|
52 |
+
}
|
53 |
+
do_action('ws_plugin__s2member_after_admin_lockouts', get_defined_vars());
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Filters administrative menu bar for Users/Members.
|
58 |
+
*
|
59 |
+
* @package s2Member\Admin_Lockouts
|
60 |
+
* @since 3.5
|
61 |
+
*
|
62 |
+
* @attaches-to ``add_action('admin_bar_menu');``
|
63 |
+
*
|
64 |
+
* @param WP_Admin_Bar $wp_admin_bar Expects the ``$wp_admin_bar``, by reference; passed in by the Action Hook.
|
65 |
+
*
|
66 |
+
* @return null After modifying ``$wp_admin_var``.
|
67 |
+
*/
|
68 |
+
public static function filter_admin_menu_bar(&$wp_admin_bar)
|
69 |
+
{
|
70 |
+
do_action('ws_plugin__s2member_before_filter_admin_menu_bar', get_defined_vars());
|
71 |
+
|
72 |
+
$uses_nodes = (version_compare(get_bloginfo('version'), '3.3-RC1', '>=')) ? TRUE : FALSE;
|
73 |
+
|
74 |
+
if(is_object($wp_admin_bar) && !current_user_can('edit_posts') /* Always for Users/Members. */)
|
75 |
{
|
76 |
+
if($uses_nodes && $wp_admin_bar->get_node('site-name'))
|
77 |
+
{
|
78 |
+
$id = 's2-site-name'; // Give this a special/unique ID.
|
79 |
+
$title = wp_html_excerpt(get_bloginfo('name'), 42); // A brief excerpt.
|
80 |
+
$title = ($title !== get_bloginfo('name')) ? trim($title).'…' : $title;
|
81 |
+
$href = site_url('/'); // Change to front page.
|
82 |
+
|
83 |
+
$wp_admin_bar->add_node(array('id' => $id, 'title' => $title, 'href' => $href));
|
84 |
+
$wp_admin_bar->remove_node('site-name');
|
85 |
+
|
86 |
+
unset($id, $title, $href); // Housekeeping.
|
87 |
+
}
|
88 |
+
if($uses_nodes && $wp_admin_bar->get_node('wp-logo'))
|
89 |
+
$wp_admin_bar->remove_node('wp-logo');
|
90 |
+
// -------
|
91 |
+
if(!$uses_nodes && isset ($wp_admin_bar->menu->{'dashboard'}))
|
92 |
+
unset ($wp_admin_bar->menu->{'dashboard'});
|
93 |
+
|
94 |
+
if(!$uses_nodes && isset ($wp_admin_bar->menu->{'my-blogs'}))
|
95 |
+
unset ($wp_admin_bar->menu->{'my-blogs'});
|
96 |
+
// -------
|
97 |
+
if($uses_nodes && $wp_admin_bar->get_node('my-sites'))
|
98 |
+
$wp_admin_bar->remove_node('my-sites');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
+
if(is_object($wp_admin_bar) && !current_user_can('edit_posts') /* If locking Users/Members out of `/wp-admin/` areas. */)
|
101 |
+
if(apply_filters('ws_plugin__s2member_admin_lockout', $GLOBALS['WS_PLUGIN__']['s2member']['o']['force_admin_lockouts'], get_defined_vars()))
|
102 |
+
{
|
103 |
+
$lwp = c_ws_plugin__s2member_login_redirects::login_redirection_url();
|
104 |
+
$lwp = (!$lwp) ? get_page_link($GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page']) : $lwp;
|
105 |
+
|
106 |
+
if($uses_nodes && $wp_admin_bar->get_node('my-account'))
|
107 |
+
$wp_admin_bar->add_node(array('id' => 'my-account', 'href' => $lwp));
|
108 |
+
|
109 |
+
if($uses_nodes && $wp_admin_bar->get_node('user-info'))
|
110 |
+
$wp_admin_bar->add_node(array('id' => 'user-info', 'href' => $lwp));
|
111 |
+
|
112 |
+
if($uses_nodes && $wp_admin_bar->get_node('edit-profile'))
|
113 |
+
$wp_admin_bar->add_node(array('id' => 'edit-profile', 'href' => $lwp));
|
114 |
+
// -------
|
115 |
+
if(!$uses_nodes && isset ($wp_admin_bar->menu->{'my-account'}['href']))
|
116 |
+
$wp_admin_bar->menu->{'my-account'}['href'] = $lwp;
|
117 |
+
|
118 |
+
if(!$uses_nodes && isset ($wp_admin_bar->menu->{'my-account'}['children']->{'edit-profile'}['href']))
|
119 |
+
$wp_admin_bar->menu->{'my-account'}['children']->{'edit-profile'}['href'] = $lwp;
|
120 |
+
|
121 |
+
if(!$uses_nodes && isset ($wp_admin_bar->menu->{'my-account'}['children']->{'user-info'}['href']))
|
122 |
+
$wp_admin_bar->menu->{'my-account'}['children']->{'user-info'}['href'] = $lwp;
|
123 |
+
// -------
|
124 |
+
if(!$uses_nodes && isset ($wp_admin_bar->menu->{'my-account-with-avatar'}['href']))
|
125 |
+
$wp_admin_bar->menu->{'my-account-with-avatar'}['href'] = $lwp;
|
126 |
+
|
127 |
+
if(!$uses_nodes && isset ($wp_admin_bar->menu->{'my-account-with-avatar'}['children']->{'user-info'}['href']))
|
128 |
+
$wp_admin_bar->menu->{'my-account-with-avatar'}['children']->{'user-info'}['href'] = $lwp;
|
129 |
+
|
130 |
+
if(!$uses_nodes && isset ($wp_admin_bar->menu->{'my-account-with-avatar'}['children']->{'edit-profile'}['href']))
|
131 |
+
$wp_admin_bar->menu->{'my-account-with-avatar'}['children']->{'edit-profile'}['href'] = $lwp;
|
132 |
+
}
|
133 |
+
do_action('ws_plugin__s2member_after_filter_admin_menu_bar', get_defined_vars());
|
134 |
+
}
|
135 |
}
|
136 |
+
}
|
includes/classes/auto-eots.inc.php
CHANGED
@@ -131,6 +131,7 @@ if (!class_exists ("c_ws_plugin__s2member_auto_eots"))
|
|
131 |
$subscr_gateway = get_user_option ("s2member_subscr_gateway", $user_id);
|
132 |
$subscr_id = get_user_option ("s2member_subscr_id", $user_id);
|
133 |
$subscr_baid = get_user_option ("s2member_subscr_baid", $user_id);
|
|
|
134 |
$fields = get_user_option ("s2member_custom_fields", $user_id);
|
135 |
$user_reg_ip = get_user_option ("s2member_registration_ip", $user_id);
|
136 |
|
@@ -153,9 +154,10 @@ if (!class_exists ("c_ws_plugin__s2member_auto_eots"))
|
|
153 |
$user->remove_cap ($ccap = $cap);
|
154 |
|
155 |
delete_user_option ($user_id, "s2member_custom");
|
|
|
156 |
delete_user_option ($user_id, "s2member_subscr_id");
|
157 |
delete_user_option ($user_id, "s2member_subscr_baid");
|
158 |
-
delete_user_option ($user_id, "
|
159 |
|
160 |
delete_user_option ($user_id, "s2member_ipn_signup_vars");
|
161 |
if (!apply_filters("ws_plugin__s2member_preserve_paid_registration_times", true, get_defined_vars ()))
|
@@ -177,17 +179,17 @@ if (!class_exists ("c_ws_plugin__s2member_auto_eots"))
|
|
177 |
{
|
178 |
foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) // Handle EOT Notifications.
|
179 |
|
180 |
-
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim(@$cv[$1]))', $url)) && ($url = preg_replace ("/%%eot_del_type%%/i", c_ws_plugin__s2member_utils_strings::
|
181 |
-
if (($url = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::
|
182 |
-
if (($url = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::
|
183 |
-
if (($url = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::
|
184 |
-
if (($url = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::
|
185 |
-
if (($url = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::
|
186 |
-
if (($url = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::
|
187 |
{
|
188 |
if (is_array($fields) && !empty($fields))
|
189 |
foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
|
190 |
-
if (!($url = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::
|
191 |
break;
|
192 |
|
193 |
if (($url = trim (preg_replace ("/%%(.+?)%%/i", "", $url))))
|
@@ -204,6 +206,8 @@ if (!class_exists ("c_ws_plugin__s2member_auto_eots"))
|
|
204 |
|
205 |
$msg .= "eot_del_type: %%eot_del_type%%\n";
|
206 |
$msg .= "subscr_id: %%subscr_id%%\n";
|
|
|
|
|
207 |
$msg .= "user_first_name: %%user_first_name%%\n";
|
208 |
$msg .= "user_last_name: %%user_last_name%%\n";
|
209 |
$msg .= "user_full_name: %%user_full_name%%\n";
|
@@ -227,26 +231,26 @@ if (!class_exists ("c_ws_plugin__s2member_auto_eots"))
|
|
227 |
$msg .= "cv8: %%cv8%%\n";
|
228 |
$msg .= "cv9: %%cv9%%";
|
229 |
|
230 |
-
if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim
|
231 |
-
if (($msg = preg_replace ("/%%
|
232 |
-
if (($msg = preg_replace ("/%%
|
233 |
-
if (($msg = preg_replace ("/%%
|
234 |
-
if (($msg = preg_replace ("/%%
|
235 |
-
if (($msg = preg_replace ("/%%
|
236 |
-
if (($msg = preg_replace ("/%%
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
}
|
251 |
foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;
|
252 |
do_action("ws_plugin__s2member_during_auto_eot_system_during_demote", get_defined_vars ());
|
@@ -283,15 +287,11 @@ if (!class_exists ("c_ws_plugin__s2member_auto_eots"))
|
|
283 |
}
|
284 |
}
|
285 |
}
|
286 |
-
|
287 |
-
c_ws_plugin__s2member_utils_logs::cleanup_expired_s2m_transients /* Cleanup. */ ();
|
288 |
|
289 |
foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;
|
290 |
do_action("ws_plugin__s2member_after_auto_eot_system", get_defined_vars ());
|
291 |
unset($__refs, $__v);
|
292 |
-
|
293 |
-
return /* Return for uniformity. */;
|
294 |
}
|
295 |
}
|
296 |
-
}
|
297 |
-
?>
|
131 |
$subscr_gateway = get_user_option ("s2member_subscr_gateway", $user_id);
|
132 |
$subscr_id = get_user_option ("s2member_subscr_id", $user_id);
|
133 |
$subscr_baid = get_user_option ("s2member_subscr_baid", $user_id);
|
134 |
+
$subscr_cid = get_user_option ("s2member_subscr_cid", $user_id);
|
135 |
$fields = get_user_option ("s2member_custom_fields", $user_id);
|
136 |
$user_reg_ip = get_user_option ("s2member_registration_ip", $user_id);
|
137 |
|
154 |
$user->remove_cap ($ccap = $cap);
|
155 |
|
156 |
delete_user_option ($user_id, "s2member_custom");
|
157 |
+
delete_user_option ($user_id, "s2member_subscr_gateway");
|
158 |
delete_user_option ($user_id, "s2member_subscr_id");
|
159 |
delete_user_option ($user_id, "s2member_subscr_baid");
|
160 |
+
delete_user_option ($user_id, "s2member_subscr_cid");
|
161 |
|
162 |
delete_user_option ($user_id, "s2member_ipn_signup_vars");
|
163 |
if (!apply_filters("ws_plugin__s2member_preserve_paid_registration_times", true, get_defined_vars ()))
|
179 |
{
|
180 |
foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) // Handle EOT Notifications.
|
181 |
|
182 |
+
if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim(@$cv[$1]))', $url)) && ($url = preg_replace ("/%%eot_del_type%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode ("auto-eot-cancellation-expiration-demotion")), $url)) && ($url = preg_replace ("/%%subscr_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode ($subscr_id)), $url)))
|
183 |
+
if (($url = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode ($user->last_name)), $url)))
|
184 |
+
if (($url = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
|
185 |
+
if (($url = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode ($user->user_email)), $url)))
|
186 |
+
if (($url = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode ($user->user_login)), $url)))
|
187 |
+
if (($url = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode ($user_reg_ip)), $url)))
|
188 |
+
if (($url = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode ($user_id)), $url)))
|
189 |
{
|
190 |
if (is_array($fields) && !empty($fields))
|
191 |
foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
|
192 |
+
if (!($url = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (urlencode (maybe_serialize ($val))), $url)))
|
193 |
break;
|
194 |
|
195 |
if (($url = trim (preg_replace ("/%%(.+?)%%/i", "", $url))))
|
206 |
|
207 |
$msg .= "eot_del_type: %%eot_del_type%%\n";
|
208 |
$msg .= "subscr_id: %%subscr_id%%\n";
|
209 |
+
$msg .= "subscr_baid: %%subscr_baid%%\n";
|
210 |
+
$msg .= "subscr_cid: %%subscr_cid%%\n";
|
211 |
$msg .= "user_first_name: %%user_first_name%%\n";
|
212 |
$msg .= "user_last_name: %%user_last_name%%\n";
|
213 |
$msg .= "user_full_name: %%user_full_name%%\n";
|
231 |
$msg .= "cv8: %%cv8%%\n";
|
232 |
$msg .= "cv9: %%cv9%%";
|
233 |
|
234 |
+
if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim(@$cv[$1])', $msg)) && ($msg = preg_replace ("/%%eot_del_type%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ("auto-eot-cancellation-expiration-demotion"), $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($subscr_id), $msg)))
|
235 |
+
if (($msg = preg_replace ("/%%subscr_baid%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($subscr_baid), $msg)) && ($msg = preg_replace ("/%%subscr_cid%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($subscr_cid), $msg)))
|
236 |
+
if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $msg)) && ($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $msg)))
|
237 |
+
if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (trim ($user->first_name . " " . $user->last_name)), $msg)))
|
238 |
+
if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $msg)))
|
239 |
+
if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $msg)))
|
240 |
+
if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_reg_ip), $msg)))
|
241 |
+
if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $msg)))
|
242 |
+
{
|
243 |
+
if (is_array($fields) && !empty($fields))
|
244 |
+
foreach /* Custom Registration/Profile Fields. */($fields as $var => $val)
|
245 |
+
if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $msg)))
|
246 |
+
break;
|
247 |
+
|
248 |
+
if /* Still have a ``$sbj`` and a ``$msg``? */ ($sbj && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg))))
|
249 |
+
|
250 |
+
foreach (c_ws_plugin__s2member_utils_strings::parse_emails ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"]) as $recipient)
|
251 |
+
wp_mail ($recipient, apply_filters("ws_plugin__s2member_eot_del_notification_email_sbj", $sbj, get_defined_vars ()), apply_filters("ws_plugin__s2member_eot_del_notification_email_msg", $msg, get_defined_vars ()), "Content-Type: text/plain; charset=UTF-8");
|
252 |
+
}
|
253 |
+
if($email_configs_were_on) c_ws_plugin__s2member_email_configs::email_config ();
|
254 |
}
|
255 |
foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;
|
256 |
do_action("ws_plugin__s2member_during_auto_eot_system_during_demote", get_defined_vars ());
|
287 |
}
|
288 |
}
|
289 |
}
|
290 |
+
c_ws_plugin__s2member_utils_logs::cleanup_expired_s2m_transients();
|
|
|
291 |
|
292 |
foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;
|
293 |
do_action("ws_plugin__s2member_after_auto_eot_system", get_defined_vars ());
|
294 |
unset($__refs, $__v);
|
|
|
|
|
295 |
}
|
296 |
}
|
297 |
+
}
|
|
includes/classes/check-activation.inc.php
CHANGED
@@ -1,58 +1,50 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* s2Member's self re-activation routines.
|
4 |
-
*
|
5 |
-
* Copyright: © 2009-2011
|
6 |
-
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
-
* (coded in the USA)
|
8 |
-
*
|
9 |
-
* Released under the terms of the GNU General Public License.
|
10 |
-
* You should have received a copy of the GNU General Public License,
|
11 |
-
* along with this software. In the main directory, see: /licensing/
|
12 |
-
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
-
*
|
14 |
-
* @package s2Member\Installation
|
15 |
-
* @since 3.5
|
16 |
-
*/
|
17 |
-
if
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
/**
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
{
|
42 |
-
if (!($v = get_option ("ws_plugin__s2member_activated_version")) || !version_compare ($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
|
43 |
-
{
|
44 |
-
c_ws_plugin__s2member_installation::activate ("version");
|
45 |
-
}
|
46 |
-
else if (is_multisite () && is_main_site () && (!($mms_v = get_option ("ws_plugin__s2member_activated_mms_version")) || !version_compare ($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">=")))
|
47 |
-
{
|
48 |
-
c_ws_plugin__s2member_installation::activate ("mms_version");
|
49 |
-
}
|
50 |
-
else if (!($l = (int)get_option ("ws_plugin__s2member_activated_levels")) || $l !== $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])
|
51 |
-
{
|
52 |
-
c_ws_plugin__s2member_installation::activate ("levels");
|
53 |
-
}
|
54 |
-
return /* Return for uniformity. */;
|
55 |
-
}
|
56 |
-
}
|
57 |
}
|
58 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
+
* s2Member's self re-activation routines.
|
4 |
+
*
|
5 |
+
* Copyright: © 2009-2011
|
6 |
+
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
+
* (coded in the USA)
|
8 |
+
*
|
9 |
+
* Released under the terms of the GNU General Public License.
|
10 |
+
* You should have received a copy of the GNU General Public License,
|
11 |
+
* along with this software. In the main directory, see: /licensing/
|
12 |
+
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
+
*
|
14 |
+
* @package s2Member\Installation
|
15 |
+
* @since 3.5
|
16 |
+
*/
|
17 |
+
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
+
if(!class_exists("c_ws_plugin__s2member_check_activation"))
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* s2Member's self re-activation routines.
|
24 |
+
*
|
25 |
+
* @package s2Member\Installation
|
26 |
+
* @since 3.5
|
27 |
+
*/
|
28 |
+
class c_ws_plugin__s2member_check_activation
|
29 |
{
|
30 |
/**
|
31 |
+
* Checks for existing installs that are NOT yet re-activated.
|
32 |
+
*
|
33 |
+
* @package s2Member\Installation
|
34 |
+
* @since 3.5
|
35 |
+
*
|
36 |
+
* @attaches-to ``add_action("admin_init");``
|
37 |
+
*/
|
38 |
+
public static function check()
|
39 |
+
{
|
40 |
+
if(!($v = get_option("ws_plugin__s2member_activated_version")) || !version_compare($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
|
41 |
+
c_ws_plugin__s2member_installation::activate("version");
|
42 |
+
|
43 |
+
else if(is_multisite() && is_main_site() && (!($mms_v = get_option("ws_plugin__s2member_activated_mms_version")) || !version_compare($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">=")))
|
44 |
+
c_ws_plugin__s2member_installation::activate("mms_version");
|
45 |
+
|
46 |
+
else if(!($l = (int)get_option("ws_plugin__s2member_activated_levels")) || $l !== $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])
|
47 |
+
c_ws_plugin__s2member_installation::activate("levels");
|
48 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
+
}
|
includes/classes/cron-jobs-in.inc.php
CHANGED
@@ -1,79 +1,77 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Cron routines handled by s2Member (inner processing routines).
|
4 |
-
*
|
5 |
-
* Copyright: © 2009-2011
|
6 |
-
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
-
* (coded in the USA)
|
8 |
-
*
|
9 |
-
* Released under the terms of the GNU General Public License.
|
10 |
-
* You should have received a copy of the GNU General Public License,
|
11 |
-
* along with this software. In the main directory, see: /licensing/
|
12 |
-
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
-
*
|
14 |
-
* @package s2Member\Cron_Jobs
|
15 |
-
* @since 3.5
|
16 |
-
*/
|
17 |
-
if
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
/**
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
* @return array Array of WP_Cron schedules after having added a 10 minute cycle.
|
40 |
-
*/
|
41 |
-
public static function extend_cron_schedules ($schedules = array())
|
42 |
-
{
|
43 |
-
foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;
|
44 |
-
do_action("ws_plugin__s2member_before_extend_cron_schedules", get_defined_vars ());
|
45 |
-
unset($__refs, $__v);
|
46 |
|
47 |
-
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Allows the Auto-EOT Sytem to be processed through a server-side Cron Job.
|
53 |
-
*
|
54 |
-
* @package s2Member\Cron_Jobs
|
55 |
-
* @since 3.5
|
56 |
-
*
|
57 |
-
* @attaches-to ``add_action("init");``
|
58 |
-
*
|
59 |
-
* @return null Or exits script execution after task completed.
|
60 |
-
*/
|
61 |
-
public static function auto_eot_system_via_cron ()
|
62 |
-
{
|
63 |
-
do_action("ws_plugin__s2member_before_auto_eot_system_via_cron", get_defined_vars ());
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
77 |
}
|
|
|
|
|
78 |
}
|
79 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Cron routines handled by s2Member (inner processing routines).
|
4 |
+
*
|
5 |
+
* Copyright: © 2009-2011
|
6 |
+
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
+
* (coded in the USA)
|
8 |
+
*
|
9 |
+
* Released under the terms of the GNU General Public License.
|
10 |
+
* You should have received a copy of the GNU General Public License,
|
11 |
+
* along with this software. In the main directory, see: /licensing/
|
12 |
+
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
+
*
|
14 |
+
* @package s2Member\Cron_Jobs
|
15 |
+
* @since 3.5
|
16 |
+
*/
|
17 |
+
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
+
if(!class_exists("c_ws_plugin__s2member_cron_jobs_in"))
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Cron routines handled by s2Member (inner processing routines).
|
24 |
+
*
|
25 |
+
* @package s2Member\Cron_Jobs
|
26 |
+
* @since 3.5
|
27 |
+
*/
|
28 |
+
class c_ws_plugin__s2member_cron_jobs_in
|
29 |
{
|
30 |
/**
|
31 |
+
* Extends WP-Cron schedules to support 10 minute intervals.
|
32 |
+
*
|
33 |
+
* @package s2Member\Cron_Jobs
|
34 |
+
* @since 3.5
|
35 |
+
*
|
36 |
+
* @attaches-to ``add_filter("cron_schedules");``
|
37 |
+
*
|
38 |
+
* @param array $schedules Expects an array of WP_Cron schedules passed in by the Filter.
|
39 |
+
*
|
40 |
+
* @return array Array of WP_Cron schedules after having added a 10 minute cycle.
|
41 |
+
*/
|
42 |
+
public static function extend_cron_schedules($schedules = array())
|
43 |
+
{
|
44 |
+
foreach(array_keys(get_defined_vars()) as $__v) $__refs[$__v] =& $__v;
|
45 |
+
do_action("ws_plugin__s2member_before_extend_cron_schedules", get_defined_vars());
|
46 |
+
unset($__refs, $__v);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
$array = array("every10m" => array("interval" => 600, "display" => "Every 10 Minutes"));
|
49 |
|
50 |
+
return apply_filters("ws_plugin__s2member_extend_cron_schedules", array_merge($array, $schedules), get_defined_vars());
|
51 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
+
/**
|
54 |
+
* Allows the Auto-EOT Sytem to be processed through a server-side Cron Job.
|
55 |
+
*
|
56 |
+
* @package s2Member\Cron_Jobs
|
57 |
+
* @since 3.5
|
58 |
+
*
|
59 |
+
* @attaches-to ``add_action("init");``
|
60 |
+
*/
|
61 |
+
public static function auto_eot_system_via_cron()
|
62 |
+
{
|
63 |
+
do_action("ws_plugin__s2member_before_auto_eot_system_via_cron", get_defined_vars());
|
64 |
|
65 |
+
if(!empty($_GET["s2member_auto_eot_system_via_cron"]))
|
66 |
+
{
|
67 |
+
if($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["auto_eot_system_enabled"])
|
68 |
+
{
|
69 |
+
c_ws_plugin__s2member_auto_eots::auto_eot_system(); // Process.
|
70 |
+
do_action("ws_plugin__s2member_during_auto_eot_system_via_cron", get_defined_vars());
|
71 |
+
}
|
72 |
+
exit(); // Clean exit.
|
73 |
}
|
74 |
+
do_action("ws_plugin__s2member_after_auto_eot_system_via_cron", get_defined_vars());
|
75 |
+
}
|
76 |
}
|
77 |
+
}
|
includes/classes/cron-jobs.inc.php
CHANGED
@@ -1,64 +1,61 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Cron routines handled by s2Member.
|
4 |
-
*
|
5 |
-
* Copyright: © 2009-2011
|
6 |
-
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
-
* (coded in the USA)
|
8 |
-
*
|
9 |
-
* Released under the terms of the GNU General Public License.
|
10 |
-
* You should have received a copy of the GNU General Public License,
|
11 |
-
* along with this software. In the main directory, see: /licensing/
|
12 |
-
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
-
*
|
14 |
-
* @package s2Member\Cron_Jobs
|
15 |
-
* @since 3.5
|
16 |
-
*/
|
17 |
-
if
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
/**
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
*
|
53 |
-
* @return null|inner Return-value of inner routine.
|
54 |
-
*/
|
55 |
-
public static function auto_eot_system_via_cron ()
|
56 |
-
{
|
57 |
-
if (!empty($_GET["s2member_auto_eot_system_via_cron"]))
|
58 |
-
{
|
59 |
-
return c_ws_plugin__s2member_cron_jobs_in::auto_eot_system_via_cron ();
|
60 |
-
}
|
61 |
-
}
|
62 |
-
}
|
63 |
}
|
64 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Cron routines handled by s2Member.
|
4 |
+
*
|
5 |
+
* Copyright: © 2009-2011
|
6 |
+
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
+
* (coded in the USA)
|
8 |
+
*
|
9 |
+
* Released under the terms of the GNU General Public License.
|
10 |
+
* You should have received a copy of the GNU General Public License,
|
11 |
+
* along with this software. In the main directory, see: /licensing/
|
12 |
+
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
+
*
|
14 |
+
* @package s2Member\Cron_Jobs
|
15 |
+
* @since 3.5
|
16 |
+
*/
|
17 |
+
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
+
if(!class_exists("c_ws_plugin__s2member_cron_jobs"))
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Cron routines handled by s2Member.
|
24 |
+
*
|
25 |
+
* @package s2Member\Cron_Jobs
|
26 |
+
* @since 3.5
|
27 |
+
*/
|
28 |
+
class c_ws_plugin__s2member_cron_jobs
|
29 |
{
|
30 |
/**
|
31 |
+
* Extends WP-Cron schedules to support 10 minute intervals.
|
32 |
+
*
|
33 |
+
* @package s2Member\Cron_Jobs
|
34 |
+
* @since 3.5
|
35 |
+
*
|
36 |
+
* @attaches-to ``add_filter("cron_schedules");``
|
37 |
+
*
|
38 |
+
* @param array $schedules Expects an array of WP_Cron schedules passed in by the Filter.
|
39 |
+
*
|
40 |
+
* @return array Return-value of inner routine.
|
41 |
+
*/
|
42 |
+
public static function extend_cron_schedules($schedules = array())
|
43 |
+
{
|
44 |
+
return c_ws_plugin__s2member_cron_jobs_in::extend_cron_schedules($schedules);
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Allows the Auto-EOT Sytem to be processed through a server-side Cron Job.
|
49 |
+
*
|
50 |
+
* @package s2Member\Cron_Jobs
|
51 |
+
* @since 3.5
|
52 |
+
*
|
53 |
+
* @attaches-to ``add_action("init");``
|
54 |
+
*/
|
55 |
+
public static function auto_eot_system_via_cron()
|
56 |
+
{
|
57 |
+
if(!empty($_GET["s2member_auto_eot_system_via_cron"]))
|
58 |
+
c_ws_plugin__s2member_cron_jobs_in::auto_eot_system_via_cron();
|
59 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
+
}
|
includes/classes/css-js-in.inc.php
CHANGED
@@ -1,201 +1,200 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* CSS/JS loading handlers for s2Member (inner processing routines).
|
4 |
-
*
|
5 |
-
* Copyright: © 2009-2011
|
6 |
-
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
-
* (coded in the USA)
|
8 |
-
*
|
9 |
-
* Released under the terms of the GNU General Public License.
|
10 |
-
* You should have received a copy of the GNU General Public License,
|
11 |
-
* along with this software. In the main directory, see: /licensing/
|
12 |
-
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
-
*
|
14 |
-
* @package s2Member\CSS_JS
|
15 |
-
* @since 3.5
|
16 |
-
*/
|
17 |
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
|
18 |
exit("Do not access this file directly.");
|
19 |
|
20 |
if(!class_exists("c_ws_plugin__s2member_css_js_in"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
/**
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
{
|
30 |
-
|
31 |
-
* Outputs CSS for theme integration.
|
32 |
-
*
|
33 |
-
* @package s2Member\CSS_JS
|
34 |
-
* @since 3.5
|
35 |
-
*
|
36 |
-
* @attaches-to ``add_action("init");``
|
37 |
-
*
|
38 |
-
* @return null Or exits script execution after loading CSS.
|
39 |
-
*/
|
40 |
-
public static function css()
|
41 |
-
{
|
42 |
-
do_action("ws_plugin__s2member_before_css", get_defined_vars());
|
43 |
-
|
44 |
-
if(!empty($_GET["ws_plugin__s2member_css"]))
|
45 |
-
{
|
46 |
-
status_header /* 200 OK status. */(200);
|
47 |
-
|
48 |
-
header("Content-Type: text/css; charset=UTF-8");
|
49 |
-
header("Expires: ".gmdate("D, d M Y H:i:s", strtotime("+1 week"))." GMT");
|
50 |
-
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
51 |
-
header("Cache-Control: max-age=604800");
|
52 |
-
header("Pragma: public");
|
53 |
-
|
54 |
-
while (@ob_end_clean ()); // Clean any existing output buffers.
|
55 |
-
|
56 |
-
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
57 |
-
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images";
|
58 |
-
|
59 |
-
ob_start("c_ws_plugin__s2member_utils_css::compress_css");
|
60 |
-
|
61 |
-
include_once dirname(dirname(__FILE__))."/s2member.css";
|
62 |
-
|
63 |
-
do_action("ws_plugin__s2member_during_css", get_defined_vars());
|
64 |
-
|
65 |
-
exit /* Clean exit. */();
|
66 |
-
}
|
67 |
-
do_action("ws_plugin__s2member_after_css", get_defined_vars());
|
68 |
-
}
|
69 |
-
/**
|
70 |
-
* Outputs JS for theme integration.
|
71 |
-
*
|
72 |
-
* Be sure s2Member's API Constants are already defined before firing this.
|
73 |
-
*
|
74 |
-
* @package s2Member\CSS_JS
|
75 |
-
* @since 3.5
|
76 |
-
*
|
77 |
-
* @attaches-to ``add_action("init");``
|
78 |
-
*
|
79 |
-
* @return null Or exits script execution after loading JS w/Globals.
|
80 |
-
*/
|
81 |
-
public static function js_w_globals()
|
82 |
-
{
|
83 |
-
do_action("ws_plugin__s2member_before_js_w_globals", get_defined_vars());
|
84 |
-
|
85 |
-
if(!empty($_GET["ws_plugin__s2member_js_w_globals"]))
|
86 |
-
{
|
87 |
-
status_header /* 200 OK status header. */(200);
|
88 |
-
|
89 |
-
header("Content-Type: application/x-javascript; charset=UTF-8");
|
90 |
-
header("Expires: ".gmdate("D, d M Y H:i:s", strtotime("+1 week"))." GMT");
|
91 |
-
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
92 |
-
header("Cache-Control: max-age=604800");
|
93 |
-
header("Pragma: public");
|
94 |
-
|
95 |
-
while (@ob_end_clean ()); // Clean any existing output buffers.
|
96 |
-
|
97 |
-
include_once dirname(dirname(__FILE__))."/jquery/jquery.sprintf/jquery.sprintf-min.js";
|
98 |
-
|
99 |
-
echo /* Add a line break before writing JavaScript Globals to file. */ "\n";
|
100 |
-
|
101 |
-
echo "var S2MEMBER_VERSION = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_VERSION)."',";
|
102 |
-
|
103 |
-
echo "S2MEMBER_CURRENT_USER_LOGIN_COUNTER = ".S2MEMBER_CURRENT_USER_LOGIN_COUNTER.",";
|
104 |
-
|
105 |
-
echo "S2MEMBER_CURRENT_USER_IS_LOGGED_IN = ".((S2MEMBER_CURRENT_USER_IS_LOGGED_IN) ? "true" : "false").",";
|
106 |
-
echo "S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER = ".((S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER) ? "true" : "false").",";
|
107 |
-
|
108 |
-
echo "S2MEMBER_CURRENT_USER_ACCESS_LEVEL = ".S2MEMBER_CURRENT_USER_ACCESS_LEVEL.",";
|
109 |
-
echo "S2MEMBER_CURRENT_USER_ACCESS_LABEL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_ACCESS_LABEL)."',";
|
110 |
-
|
111 |
-
echo "S2MEMBER_CURRENT_USER_SUBSCR_ID = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_SUBSCR_ID)."',";
|
112 |
-
echo "S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID)."',";
|
113 |
-
echo "S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY)."',";
|
114 |
-
echo "S2MEMBER_CURRENT_USER_CUSTOM = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_CUSTOM)."',";
|
115 |
-
|
116 |
-
echo "S2MEMBER_CURRENT_USER_REGISTRATION_TIME = ".S2MEMBER_CURRENT_USER_REGISTRATION_TIME.",";
|
117 |
-
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME = ".S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME.",";
|
118 |
-
|
119 |
-
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS = ".S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS.",";
|
120 |
-
echo "S2MEMBER_CURRENT_USER_REGISTRATION_DAYS = ".S2MEMBER_CURRENT_USER_REGISTRATION_DAYS.",";
|
121 |
-
|
122 |
-
echo "S2MEMBER_CURRENT_USER_DISPLAY_NAME = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_DISPLAY_NAME)."',";
|
123 |
-
echo "S2MEMBER_CURRENT_USER_FIRST_NAME = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_FIRST_NAME)."',";
|
124 |
-
echo "S2MEMBER_CURRENT_USER_LAST_NAME = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_LAST_NAME)."',";
|
125 |
-
|
126 |
-
echo "S2MEMBER_CURRENT_USER_LOGIN = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_LOGIN)."',";
|
127 |
-
echo "S2MEMBER_CURRENT_USER_EMAIL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_EMAIL)."',";
|
128 |
-
echo "S2MEMBER_CURRENT_USER_IP = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_IP)."',";
|
129 |
-
echo "S2MEMBER_CURRENT_USER_REGISTRATION_IP = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_REGISTRATION_IP)."',";
|
130 |
-
|
131 |
-
echo "S2MEMBER_CURRENT_USER_ID = ".S2MEMBER_CURRENT_USER_ID.",";
|
132 |
-
echo "S2MEMBER_CURRENT_USER_FIELDS = ".S2MEMBER_CURRENT_USER_FIELDS.",";
|
133 |
-
|
134 |
-
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED = ".S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED.",";
|
135 |
-
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED = ".((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED) ? "true" : "false").",";
|
136 |
-
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY = ".S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY.",";
|
137 |
-
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS = ".S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS.",";
|
138 |
-
|
139 |
-
echo "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID = ".S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID.",";
|
140 |
-
echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID = ".S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID.",";
|
141 |
-
echo "S2MEMBER_LOGIN_WELCOME_PAGE_ID = ".S2MEMBER_LOGIN_WELCOME_PAGE_ID.",";
|
142 |
-
|
143 |
-
echo "S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL)."',";
|
144 |
-
echo "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL)."',";
|
145 |
-
echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL)."',";
|
146 |
-
echo "S2MEMBER_LOGIN_WELCOME_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_LOGIN_WELCOME_PAGE_URL)."',";
|
147 |
-
echo "S2MEMBER_LOGOUT_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_LOGOUT_PAGE_URL)."',";
|
148 |
-
echo "S2MEMBER_LOGIN_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_LOGIN_PAGE_URL)."',";
|
149 |
-
|
150 |
-
for($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
151 |
-
{
|
152 |
-
if(defined(($S2MEMBER_LEVELn_LABEL = "S2MEMBER_LEVEL".$n."_LABEL")))
|
153 |
-
echo $S2MEMBER_LEVELn_LABEL." = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(constant($S2MEMBER_LEVELn_LABEL))."',";
|
154 |
-
}
|
155 |
-
for($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
156 |
-
{
|
157 |
-
if(defined(($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED = "S2MEMBER_LEVEL".$n."_FILE_DOWNLOADS_ALLOWED")))
|
158 |
-
echo $S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED." = ".constant($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED).",";
|
159 |
-
}
|
160 |
-
for($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
161 |
-
{
|
162 |
-
if(defined(($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS = "S2MEMBER_LEVEL".$n."_FILE_DOWNLOADS_ALLOWED_DAYS")))
|
163 |
-
echo $S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS." = ".constant($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS).",";
|
164 |
-
}
|
165 |
-
echo "S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS)."',";
|
166 |
-
|
167 |
-
echo "S2MEMBER_REG_EMAIL_FROM_NAME = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_REG_EMAIL_FROM_NAME)."',";
|
168 |
-
echo "S2MEMBER_REG_EMAIL_FROM_EMAIL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_REG_EMAIL_FROM_EMAIL)."',";
|
169 |
-
|
170 |
-
echo "S2MEMBER_PAYPAL_NOTIFY_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_NOTIFY_URL)."',";
|
171 |
-
echo "S2MEMBER_PAYPAL_RETURN_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_RETURN_URL)."',";
|
172 |
-
|
173 |
-
echo "S2MEMBER_PAYPAL_BUSINESS = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_BUSINESS)."',";
|
174 |
-
echo "S2MEMBER_PAYPAL_ENDPOINT = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_ENDPOINT)."',";
|
175 |
-
echo "S2MEMBER_PAYPAL_API_ENDPOINT = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_API_ENDPOINT)."',";
|
176 |
|
177 |
-
|
178 |
-
|
|
|
|
|
|
|
179 |
|
180 |
-
|
181 |
-
echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0)."',";
|
182 |
|
183 |
-
|
184 |
-
|
185 |
|
186 |
-
|
187 |
-
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images";
|
188 |
|
189 |
-
|
190 |
|
191 |
-
|
192 |
|
193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
|
195 |
-
|
196 |
-
}
|
197 |
-
do_action("ws_plugin__s2member_after_js_w_globals", get_defined_vars());
|
198 |
-
}
|
199 |
}
|
|
|
|
|
200 |
}
|
201 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
+
* CSS/JS loading handlers for s2Member (inner processing routines).
|
4 |
+
*
|
5 |
+
* Copyright: © 2009-2011
|
6 |
+
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
+
* (coded in the USA)
|
8 |
+
*
|
9 |
+
* Released under the terms of the GNU General Public License.
|
10 |
+
* You should have received a copy of the GNU General Public License,
|
11 |
+
* along with this software. In the main directory, see: /licensing/
|
12 |
+
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
+
*
|
14 |
+
* @package s2Member\CSS_JS
|
15 |
+
* @since 3.5
|
16 |
+
*/
|
17 |
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
|
18 |
exit("Do not access this file directly.");
|
19 |
|
20 |
if(!class_exists("c_ws_plugin__s2member_css_js_in"))
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* CSS/JS loading handlers for s2Member (inner processing routines).
|
24 |
+
*
|
25 |
+
* @package s2Member\CSS_JS
|
26 |
+
* @since 3.5
|
27 |
+
*/
|
28 |
+
class c_ws_plugin__s2member_css_js_in
|
29 |
{
|
30 |
/**
|
31 |
+
* Outputs CSS for theme integration.
|
32 |
+
*
|
33 |
+
* @package s2Member\CSS_JS
|
34 |
+
* @since 3.5
|
35 |
+
*
|
36 |
+
* @attaches-to ``add_action("init");``
|
37 |
+
*
|
38 |
+
* @return null Or exits script execution after loading CSS.
|
39 |
+
*/
|
40 |
+
public static function css()
|
41 |
+
{
|
42 |
+
do_action("ws_plugin__s2member_before_css", get_defined_vars());
|
43 |
+
|
44 |
+
if(!empty($_GET["ws_plugin__s2member_css"]))
|
45 |
{
|
46 |
+
status_header(200); // 200 OK status header.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
+
header("Content-Type: text/css; charset=UTF-8");
|
49 |
+
header("Expires: ".gmdate("D, d M Y H:i:s", strtotime("+1 week"))." GMT");
|
50 |
+
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
51 |
+
header("Cache-Control: max-age=604800");
|
52 |
+
header("Pragma: public");
|
53 |
|
54 |
+
while(@ob_end_clean()) ; // Clean output buffers.
|
|
|
55 |
|
56 |
+
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
57 |
+
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images";
|
58 |
|
59 |
+
ob_start("c_ws_plugin__s2member_utils_css::compress_css");
|
|
|
60 |
|
61 |
+
include_once dirname(dirname(__FILE__))."/s2member.css";
|
62 |
|
63 |
+
do_action("ws_plugin__s2member_during_css", get_defined_vars());
|
64 |
|
65 |
+
exit(); // Clean exit.
|
66 |
+
}
|
67 |
+
do_action("ws_plugin__s2member_after_css", get_defined_vars());
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Outputs JS for theme integration.
|
72 |
+
*
|
73 |
+
* Be sure s2Member's API Constants are already defined before firing this.
|
74 |
+
*
|
75 |
+
* @package s2Member\CSS_JS
|
76 |
+
* @since 3.5
|
77 |
+
*
|
78 |
+
* @attaches-to ``add_action("init");``
|
79 |
+
*
|
80 |
+
* @return null Or exits script execution after loading JS w/Globals.
|
81 |
+
*/
|
82 |
+
public static function js_w_globals()
|
83 |
+
{
|
84 |
+
do_action("ws_plugin__s2member_before_js_w_globals", get_defined_vars());
|
85 |
+
|
86 |
+
if(!empty($_GET["ws_plugin__s2member_js_w_globals"]))
|
87 |
+
{
|
88 |
+
status_header(200); // 200 OK status header.
|
89 |
+
|
90 |
+
header("Content-Type: application/x-javascript; charset=UTF-8");
|
91 |
+
header("Expires: ".gmdate("D, d M Y H:i:s", strtotime("+1 week"))." GMT");
|
92 |
+
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
93 |
+
header("Cache-Control: max-age=604800");
|
94 |
+
header("Pragma: public");
|
95 |
+
|
96 |
+
while(@ob_end_clean()) ; // Clean output buffers.
|
97 |
+
|
98 |
+
include_once dirname(dirname(__FILE__))."/jquery/jquery.sprintf/jquery.sprintf-min.js";
|
99 |
+
|
100 |
+
echo "\n"; // Add a line break before writing JavaScript Globals to file.
|
101 |
+
|
102 |
+
echo "var S2MEMBER_VERSION = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_VERSION)."',";
|
103 |
+
|
104 |
+
echo "S2MEMBER_CURRENT_USER_LOGIN_COUNTER = ".S2MEMBER_CURRENT_USER_LOGIN_COUNTER.",";
|
105 |
+
|
106 |
+
echo "S2MEMBER_CURRENT_USER_IS_LOGGED_IN = ".((S2MEMBER_CURRENT_USER_IS_LOGGED_IN) ? "true" : "false").",";
|
107 |
+
echo "S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER = ".((S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER) ? "true" : "false").",";
|
108 |
+
|
109 |
+
echo "S2MEMBER_CURRENT_USER_ACCESS_LEVEL = ".S2MEMBER_CURRENT_USER_ACCESS_LEVEL.",";
|
110 |
+
echo "S2MEMBER_CURRENT_USER_ACCESS_LABEL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_ACCESS_LABEL)."',";
|
111 |
+
|
112 |
+
echo "S2MEMBER_CURRENT_USER_SUBSCR_ID = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_SUBSCR_ID)."',";
|
113 |
+
echo "S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID)."',";
|
114 |
+
echo "S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY)."',";
|
115 |
+
echo "S2MEMBER_CURRENT_USER_CUSTOM = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_CUSTOM)."',";
|
116 |
+
|
117 |
+
echo "S2MEMBER_CURRENT_USER_REGISTRATION_TIME = ".S2MEMBER_CURRENT_USER_REGISTRATION_TIME.",";
|
118 |
+
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME = ".S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME.",";
|
119 |
+
|
120 |
+
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS = ".S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS.",";
|
121 |
+
echo "S2MEMBER_CURRENT_USER_REGISTRATION_DAYS = ".S2MEMBER_CURRENT_USER_REGISTRATION_DAYS.",";
|
122 |
+
|
123 |
+
echo "S2MEMBER_CURRENT_USER_DISPLAY_NAME = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_DISPLAY_NAME)."',";
|
124 |
+
echo "S2MEMBER_CURRENT_USER_FIRST_NAME = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_FIRST_NAME)."',";
|
125 |
+
echo "S2MEMBER_CURRENT_USER_LAST_NAME = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_LAST_NAME)."',";
|
126 |
+
|
127 |
+
echo "S2MEMBER_CURRENT_USER_LOGIN = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_LOGIN)."',";
|
128 |
+
echo "S2MEMBER_CURRENT_USER_EMAIL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_EMAIL)."',";
|
129 |
+
echo "S2MEMBER_CURRENT_USER_IP = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_IP)."',";
|
130 |
+
echo "S2MEMBER_CURRENT_USER_REGISTRATION_IP = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_REGISTRATION_IP)."',";
|
131 |
+
|
132 |
+
echo "S2MEMBER_CURRENT_USER_ID = ".S2MEMBER_CURRENT_USER_ID.",";
|
133 |
+
echo "S2MEMBER_CURRENT_USER_FIELDS = ".S2MEMBER_CURRENT_USER_FIELDS.",";
|
134 |
+
|
135 |
+
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED = ".S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED.",";
|
136 |
+
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED = ".((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED) ? "true" : "false").",";
|
137 |
+
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY = ".S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY.",";
|
138 |
+
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS = ".S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS.",";
|
139 |
+
|
140 |
+
echo "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID = ".S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID.",";
|
141 |
+
echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID = ".S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID.",";
|
142 |
+
echo "S2MEMBER_LOGIN_WELCOME_PAGE_ID = ".S2MEMBER_LOGIN_WELCOME_PAGE_ID.",";
|
143 |
+
|
144 |
+
echo "S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL)."',";
|
145 |
+
echo "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL)."',";
|
146 |
+
echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL)."',";
|
147 |
+
echo "S2MEMBER_LOGIN_WELCOME_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_LOGIN_WELCOME_PAGE_URL)."',";
|
148 |
+
echo "S2MEMBER_LOGOUT_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_LOGOUT_PAGE_URL)."',";
|
149 |
+
echo "S2MEMBER_LOGIN_PAGE_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_LOGIN_PAGE_URL)."',";
|
150 |
+
|
151 |
+
for($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
152 |
+
{
|
153 |
+
if(defined(($S2MEMBER_LEVELn_LABEL = "S2MEMBER_LEVEL".$n."_LABEL")))
|
154 |
+
echo $S2MEMBER_LEVELn_LABEL." = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(constant($S2MEMBER_LEVELn_LABEL))."',";
|
155 |
+
}
|
156 |
+
for($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
157 |
+
{
|
158 |
+
if(defined(($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED = "S2MEMBER_LEVEL".$n."_FILE_DOWNLOADS_ALLOWED")))
|
159 |
+
echo $S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED." = ".constant($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED).",";
|
160 |
+
}
|
161 |
+
for($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
162 |
+
{
|
163 |
+
if(defined(($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS = "S2MEMBER_LEVEL".$n."_FILE_DOWNLOADS_ALLOWED_DAYS")))
|
164 |
+
echo $S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS." = ".constant($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS).",";
|
165 |
+
}
|
166 |
+
echo "S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS)."',";
|
167 |
+
|
168 |
+
echo "S2MEMBER_REG_EMAIL_FROM_NAME = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_REG_EMAIL_FROM_NAME)."',";
|
169 |
+
echo "S2MEMBER_REG_EMAIL_FROM_EMAIL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_REG_EMAIL_FROM_EMAIL)."',";
|
170 |
+
|
171 |
+
echo "S2MEMBER_PAYPAL_NOTIFY_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_NOTIFY_URL)."',";
|
172 |
+
echo "S2MEMBER_PAYPAL_RETURN_URL = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_RETURN_URL)."',";
|
173 |
+
|
174 |
+
echo "S2MEMBER_PAYPAL_BUSINESS = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_BUSINESS)."',";
|
175 |
+
echo "S2MEMBER_PAYPAL_ENDPOINT = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_ENDPOINT)."',";
|
176 |
+
echo "S2MEMBER_PAYPAL_API_ENDPOINT = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_PAYPAL_API_ENDPOINT)."',";
|
177 |
+
|
178 |
+
echo "S2MEMBER_VALUE_FOR_PP_INV = Math.round (new Date ().getTime ()) + '~".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_IP)."',";
|
179 |
+
echo "S2MEMBER_VALUE_FOR_PP_INV_GEN = s2member_value_for_pp_inv_gen = function(){ var invoice = '', formatSeed = function(seed, reqWidth) { seed = parseInt(seed, 10).toString (16); if (reqWidth < seed.length) return seed.slice (seed.length - reqWidth); else if (reqWidth > seed.length) return Array(1 + (reqWidth - seed.length)).join ('0') + seed; return seed; }; if (typeof S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED === 'undefined') S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED = Math.floor (Math.random () * 0x75bcd15); S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED++; invoice = formatSeed(parseInt(new Date ().getTime () / 1000, 10), 8); invoice += formatSeed(S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED, 5); invoice += '~' + S2MEMBER_CURRENT_USER_IP; return invoice; },";
|
180 |
+
|
181 |
+
echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0 = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0)."',";
|
182 |
+
echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0)."',";
|
183 |
+
|
184 |
+
echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1 = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1)."',";
|
185 |
+
echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1 = '".c_ws_plugin__s2member_utils_strings::esc_js_sq(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1)."';";
|
186 |
+
|
187 |
+
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
|
188 |
+
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images";
|
189 |
+
|
190 |
+
echo "\n"; // Add a line break before inclusion.
|
191 |
+
include_once dirname(dirname(__FILE__))."/s2member-min.js";
|
192 |
+
|
193 |
+
do_action("ws_plugin__s2member_during_js_w_globals", get_defined_vars());
|
194 |
|
195 |
+
exit(); // Clean exit.
|
|
|
|
|
|
|
196 |
}
|
197 |
+
do_action("ws_plugin__s2member_after_js_w_globals", get_defined_vars());
|
198 |
+
}
|
199 |
}
|
200 |
+
}
|
includes/classes/css-js-themes.inc.php
CHANGED
@@ -1,143 +1,134 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* CSS/JS integrations with theme.
|
4 |
-
*
|
5 |
-
* Copyright: © 2009-2011
|
6 |
-
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
-
* (coded in the USA)
|
8 |
-
*
|
9 |
-
* Released under the terms of the GNU General Public License.
|
10 |
-
* You should have received a copy of the GNU General Public License,
|
11 |
-
* along with this software. In the main directory, see: /licensing/
|
12 |
-
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
-
*
|
14 |
-
* @package s2Member\CSS_JS
|
15 |
-
* @since 3.5
|
16 |
-
*/
|
17 |
-
if
|
18 |
-
exit
|
19 |
-
|
20 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
/**
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
{
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
$null = NULL; // Needed below in earlier versions of WP.
|
45 |
-
|
46 |
-
if(!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["lazy_load_css_js"])
|
47 |
-
$load = TRUE;
|
48 |
-
|
49 |
-
else if(c_ws_plugin__s2member_systematics::is_s2_systematic_use_page())
|
50 |
-
$load = TRUE;
|
51 |
-
|
52 |
-
else if(!empty($_GET[apply_filters("ws_plugin__s2member_check_force_ssl_get_var_name", "s2-ssl", array())]))
|
53 |
-
$load = TRUE;
|
54 |
-
|
55 |
-
else if(c_ws_plugin__s2member_utils_conds::bp_is_installed()
|
56 |
-
&& (bp_is_register_page() || bp_is_activation_page() || bp_is_user_profile()))
|
57 |
-
$load = TRUE;
|
58 |
-
|
59 |
-
else if(is_singular() && ($post = get_post($null))
|
60 |
-
&& (stripos($post->post_content, "s2member") !== FALSE
|
61 |
-
|| stripos($post->post_content, "[s2") !== FALSE))
|
62 |
-
$load = TRUE;
|
63 |
-
|
64 |
-
else if(preg_match("/\/wp\-signup\.php".
|
65 |
-
"|\/wp\-login\.php".
|
66 |
-
"|\/wp\-admin\/(?:user\/)?profile\.php".
|
67 |
-
"|[?&]s2member/", $_SERVER["REQUEST_URI"]))
|
68 |
-
$load = TRUE;
|
69 |
-
|
70 |
-
if(!isset($load)) $load = FALSE; // Make sure it's set; always.
|
71 |
-
|
72 |
-
return ($load = apply_filters("ws_plugin__s2member_lazy_load_css_js", $load));
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Enqueues CSS file for theme integration.
|
77 |
-
*
|
78 |
-
* @package s2Member\CSS_JS
|
79 |
-
* @since 3.5
|
80 |
-
*
|
81 |
-
* @attaches-to ``add_action("wp_print_styles");``
|
82 |
-
*
|
83 |
-
* @return null After enqueuing CSS for theme integration.
|
84 |
-
*/
|
85 |
-
public static function add_css ()
|
86 |
-
{
|
87 |
-
do_action("ws_plugin__s2member_before_add_css", get_defined_vars ());
|
88 |
-
|
89 |
-
if(!is_admin () && c_ws_plugin__s2member_css_js_themes::lazy_load_css_js())
|
90 |
-
{
|
91 |
-
$s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"];
|
92 |
-
|
93 |
-
wp_enqueue_style ("ws-plugin--s2member", $s2o . "?ws_plugin__s2member_css=1&qcABC=1", array(), c_ws_plugin__s2member_utilities::ver_checksum (), "all");
|
94 |
-
|
95 |
-
do_action("ws_plugin__s2member_during_add_css", get_defined_vars ());
|
96 |
-
}
|
97 |
-
do_action("ws_plugin__s2member_after_add_css", get_defined_vars ());
|
98 |
-
|
99 |
-
return /* Return for uniformity. */;
|
100 |
-
}
|
101 |
-
/**
|
102 |
-
* Enqueues JS file for theme integration.
|
103 |
-
*
|
104 |
-
* Be sure s2Member's API Constants are already defined before firing this.
|
105 |
-
*
|
106 |
-
* @package s2Member\CSS_JS
|
107 |
-
* @since 3.5
|
108 |
-
*
|
109 |
-
* @attaches-to ``add_action("wp_print_scripts");``
|
110 |
-
*
|
111 |
-
* @return null After enqueuing JS for theme integration.
|
112 |
-
*/
|
113 |
-
public static function add_js_w_globals ()
|
114 |
-
{
|
115 |
-
global /* Need this for comparisons. */ $pagenow;
|
116 |
-
|
117 |
-
do_action("ws_plugin__s2member_before_add_js_w_globals", get_defined_vars ());
|
118 |
-
|
119 |
-
if ((!is_admin() && c_ws_plugin__s2member_css_js_themes::lazy_load_css_js())
|
120 |
-
|| (is_user_admin () && $pagenow === "profile.php" && !current_user_can ("edit_users")))
|
121 |
-
{
|
122 |
-
$s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"];
|
123 |
-
|
124 |
-
if /* Separate version for logged-in Users/Members. */ (is_user_logged_in ())
|
125 |
-
{
|
126 |
-
$md5 = /* An MD5 hash based on global key => values. */ WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5;
|
127 |
-
// The MD5 hash allows the script to be cached in the browser until the globals happen to change.
|
128 |
-
// For instance, the global variables may change when a User who is logged-in changes their Profile.
|
129 |
-
wp_enqueue_script ("ws-plugin--s2member", $s2o . "?ws_plugin__s2member_js_w_globals=" . urlencode ($md5) . "&qcABC=1", array("jquery"), c_ws_plugin__s2member_utilities::ver_checksum (), TRUE);
|
130 |
-
}
|
131 |
-
else // Else if they are not logged in, we distinguish the JavaScript file by NOT including $md5.
|
132 |
-
{ // This essentially creates 2 versions of the script. One while logged in & another when not.
|
133 |
-
wp_enqueue_script ("ws-plugin--s2member", $s2o . "?ws_plugin__s2member_js_w_globals=1&qcABC=1", array("jquery"), c_ws_plugin__s2member_utilities::ver_checksum (), TRUE);
|
134 |
-
}
|
135 |
-
do_action("ws_plugin__s2member_during_add_js_w_globals", get_defined_vars ());
|
136 |
-
}
|
137 |
-
do_action("ws_plugin__s2member_after_add_js_w_globals", get_defined_vars ());
|
138 |
-
|
139 |
-
return /* Return for uniformity. */;
|
140 |
-
}
|
141 |
}
|
|
|
|
|
142 |
}
|
143 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
+
* CSS/JS integrations with theme.
|
4 |
+
*
|
5 |
+
* Copyright: © 2009-2011
|
6 |
+
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
+
* (coded in the USA)
|
8 |
+
*
|
9 |
+
* Released under the terms of the GNU General Public License.
|
10 |
+
* You should have received a copy of the GNU General Public License,
|
11 |
+
* along with this software. In the main directory, see: /licensing/
|
12 |
+
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
+
*
|
14 |
+
* @package s2Member\CSS_JS
|
15 |
+
* @since 3.5
|
16 |
+
*/
|
17 |
+
if(realpath(__FILE__) === realpath($_SERVER['SCRIPT_FILENAME']))
|
18 |
+
exit ('Do not access this file directly.');
|
19 |
+
|
20 |
+
if(!class_exists('c_ws_plugin__s2member_css_js_themes'))
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* CSS/JS integrations with theme.
|
24 |
+
*
|
25 |
+
* @package s2Member\CSS_JS
|
26 |
+
* @since 3.5
|
27 |
+
*/
|
28 |
+
class c_ws_plugin__s2member_css_js_themes
|
29 |
{
|
30 |
/**
|
31 |
+
* Lazy load CSS/JS files?
|
32 |
+
*
|
33 |
+
* @package s2Member\CSS_JS
|
34 |
+
* @since 131028
|
35 |
+
*
|
36 |
+
* @return boolean TRUE if we should load; else FALSE.
|
37 |
+
*/
|
38 |
+
public static function lazy_load_css_js()
|
39 |
+
{
|
40 |
+
static $load; // Static cache var.
|
41 |
+
|
42 |
+
if(isset($load)) return $load;
|
43 |
+
|
44 |
+
$null = NULL; // Needed below in earlier versions of WP.
|
45 |
+
|
46 |
+
if(!$GLOBALS['WS_PLUGIN__']['s2member']['o']['lazy_load_css_js'])
|
47 |
+
$load = TRUE;
|
48 |
+
|
49 |
+
else if(c_ws_plugin__s2member_systematics::is_s2_systematic_use_page())
|
50 |
+
$load = TRUE;
|
51 |
+
|
52 |
+
else if(!empty($_GET[apply_filters('ws_plugin__s2member_check_force_ssl_get_var_name', 's2-ssl', array())]))
|
53 |
+
$load = TRUE;
|
54 |
+
|
55 |
+
else if(c_ws_plugin__s2member_utils_conds::bp_is_installed()
|
56 |
+
&& (bp_is_register_page() || bp_is_activation_page() || bp_is_user_profile())
|
57 |
+
) $load = TRUE;
|
58 |
+
|
59 |
+
else if(is_singular() && ($post = get_post($null))
|
60 |
+
&& (stripos($post->post_content, 's2member') !== FALSE || stripos($post->post_content, '[s2') !== FALSE)
|
61 |
+
) $load = TRUE;
|
62 |
+
|
63 |
+
else if(preg_match('/\/wp\-signup\.php|\/wp\-login\.php|\/wp\-admin\/(?:user\/)?profile\.php|[?&]s2member/', $_SERVER['REQUEST_URI']))
|
64 |
+
$load = TRUE;
|
65 |
+
|
66 |
+
if(!isset($load)) $load = FALSE; // Make sure it's set; always.
|
67 |
+
|
68 |
+
return ($load = apply_filters('ws_plugin__s2member_lazy_load_css_js', $load));
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Enqueues CSS file for theme integration.
|
73 |
+
*
|
74 |
+
* @package s2Member\CSS_JS
|
75 |
+
* @since 3.5
|
76 |
+
*
|
77 |
+
* @attaches-to ``add_action('wp_print_styles');``
|
78 |
+
*
|
79 |
+
* @return null After enqueuing CSS for theme integration.
|
80 |
+
*/
|
81 |
+
public static function add_css()
|
82 |
+
{
|
83 |
+
do_action('ws_plugin__s2member_before_add_css', get_defined_vars());
|
84 |
+
|
85 |
+
if(!is_admin() && c_ws_plugin__s2member_css_js_themes::lazy_load_css_js())
|
86 |
+
{
|
87 |
+
$s2o = $GLOBALS['WS_PLUGIN__']['s2member']['c']['s2o_url'];
|
88 |
+
|
89 |
+
wp_enqueue_style('ws-plugin--s2member', $s2o.'?ws_plugin__s2member_css=1&qcABC=1', array(), c_ws_plugin__s2member_utilities::ver_checksum(), 'all');
|
90 |
+
|
91 |
+
do_action('ws_plugin__s2member_during_add_css', get_defined_vars());
|
92 |
+
}
|
93 |
+
do_action('ws_plugin__s2member_after_add_css', get_defined_vars());
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Enqueues JS file for theme integration.
|
98 |
+
*
|
99 |
+
* Be sure s2Member's API Constants are already defined before firing this.
|
100 |
+
*
|
101 |
+
* @package s2Member\CSS_JS
|
102 |
+
* @since 3.5
|
103 |
+
*
|
104 |
+
* @attaches-to ``add_action('wp_print_scripts');``
|
105 |
+
*
|
106 |
+
* @return null After enqueuing JS for theme integration.
|
107 |
+
*/
|
108 |
+
public static function add_js_w_globals()
|
109 |
+
{
|
110 |
+
global $pagenow; // Need this for comparisons.
|
111 |
+
|
112 |
+
do_action('ws_plugin__s2member_before_add_js_w_globals', get_defined_vars());
|
113 |
+
|
114 |
+
if((!is_admin() && c_ws_plugin__s2member_css_js_themes::lazy_load_css_js()) || (is_user_admin() && $pagenow === 'profile.php' && !current_user_can('edit_users')))
|
115 |
{
|
116 |
+
$s2o = $GLOBALS['WS_PLUGIN__']['s2member']['c']['s2o_url'];
|
117 |
+
|
118 |
+
if(is_user_logged_in()) // Separate version for logged-in Users/Members.
|
119 |
+
{
|
120 |
+
$md5 = WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5; // An MD5 hash based on global key => values.
|
121 |
+
// The MD5 hash allows the script to be cached in the browser until the globals happen to change.
|
122 |
+
// For instance, the global variables may change when a User who is logged-in changes their Profile.
|
123 |
+
wp_enqueue_script('ws-plugin--s2member', $s2o.'?ws_plugin__s2member_js_w_globals='.urlencode($md5).'&qcABC=1', array('jquery'), c_ws_plugin__s2member_utilities::ver_checksum(), TRUE);
|
124 |
+
}
|
125 |
+
else // Else if they are not logged in, we distinguish the JavaScript file by NOT including $md5.
|
126 |
+
{ // This essentially creates 2 versions of the script. One while logged in & another when not.
|
127 |
+
wp_enqueue_script('ws-plugin--s2member', $s2o.'?ws_plugin__s2member_js_w_globals=1&qcABC=1', array('jquery'), c_ws_plugin__s2member_utilities::ver_checksum(), TRUE);
|
128 |
+
}
|
129 |
+
do_action('ws_plugin__s2member_during_add_js_w_globals', get_defined_vars());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
}
|
131 |
+
do_action('ws_plugin__s2member_after_add_js_w_globals', get_defined_vars());
|
132 |
+
}
|
133 |
}
|
134 |
+
}
|
includes/classes/css-js.inc.php
CHANGED
@@ -1,66 +1,58 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* CSS/JS loading handlers for s2Member.
|
4 |
-
*
|
5 |
-
* Copyright: © 2009-2011
|
6 |
-
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
-
* (coded in the USA)
|
8 |
-
*
|
9 |
-
* Released under the terms of the GNU General Public License.
|
10 |
-
* You should have received a copy of the GNU General Public License,
|
11 |
-
* along with this software. In the main directory, see: /licensing/
|
12 |
-
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
-
*
|
14 |
-
* @package s2Member\CSS_JS
|
15 |
-
* @since 3.5
|
16 |
-
*/
|
17 |
-
if
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
{
|
22 |
/**
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
*
|
50 |
-
* @package s2Member\CSS_JS
|
51 |
-
* @since 3.5
|
52 |
-
*
|
53 |
-
* @attaches-to ``add_action("init");``
|
54 |
-
*
|
55 |
-
* @return null|inner Return-value of inner routine.
|
56 |
-
*/
|
57 |
-
public static function js_w_globals ()
|
58 |
-
{
|
59 |
-
if (!empty($_GET["ws_plugin__s2member_js_w_globals"]))
|
60 |
-
{
|
61 |
-
return c_ws_plugin__s2member_css_js_in::js_w_globals ();
|
62 |
-
}
|
63 |
-
}
|
64 |
-
}
|
65 |
}
|
66 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
+
* CSS/JS loading handlers for s2Member.
|
4 |
+
*
|
5 |
+
* Copyright: © 2009-2011
|
6 |
+
* {@link http://www.websharks-inc.com/ WebSharks, Inc.}
|
7 |
+
* (coded in the USA)
|
8 |
+
*
|
9 |
+
* Released under the terms of the GNU General Public License.
|
10 |
+
* You should have received a copy of the GNU General Public License,
|
11 |
+
* along with this software. In the main directory, see: /licensing/
|
12 |
+
* If not, see: {@link http://www.gnu.org/licenses/}.
|
13 |
+
*
|
14 |
+
* @package s2Member\CSS_JS
|
15 |
+
* @since 3.5
|
16 |
+
*/
|
17 |
+
if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
|
18 |
exit ("Do not access this file directly.");
|
19 |
|
20 |
+
if(!class_exists("c_ws_plugin__s2member_css_js"))
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* CSS/JS loading handlers for s2Member.
|
24 |
+
*
|
25 |
+
* @package s2Member\CSS_JS
|
26 |
+
* @since 3.5
|
27 |
+
*/
|
28 |
+
class c_ws_plugin__s2member_css_js
|
29 |
{
|
30 |
/**
|
31 |
+
* Outputs CSS for theme integration.
|
32 |
+
*
|
33 |
+
* @package s2Member\CSS_JS
|
34 |
+
* @since 3.5
|
35 |
+
*
|
36 |
+
* @attaches-to ``add_action("init");``
|
37 |
+
*/
|
38 |
+
public static function css()
|
39 |
+
{
|
40 |
+
if(!empty($_GET["ws_plugin__s2member_css"]))
|
41 |
+
c_ws_plugin__s2member_css_js_in::css();
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Outputs JS for theme integration.
|
46 |
+
*
|
47 |
+
* @package s2Member\CSS_JS
|
48 |
+
* @since 3.5
|
49 |
+
*
|
50 |
+
* @attaches-to ``add_action("init");``
|
51 |
+
*/
|
52 |
+
public static function js_w_globals()
|
53 |
+
{
|
54 |
+
if(!empty($_GET["ws_plugin__s2member_js_w_globals"]))
|
55 |
+
c_ws_plugin__s2member_css_js_in::js_w_globals();
|
56 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
+
}
|
includes/classes/email-configs.inc.php
CHANGED
@@ -242,45 +242,45 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
|
|
242 |
$user_ip = $_SERVER["REMOTE_ADDR"];
|
243 |
|
244 |
if (($sbj = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_subject"]))
|
245 |
-
if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim
|
246 |
-
if (($sbj = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::
|
247 |
-
if (($sbj = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::
|
248 |
-
if (($sbj = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::
|
249 |
-
if (($sbj = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::
|
250 |
-
if (($sbj = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::
|
251 |
-
if (($sbj = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::
|
252 |
-
if (($sbj = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::
|
253 |
-
if (($sbj = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::
|
254 |
-
if (($sbj = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::
|
255 |
-
if (($sbj = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::
|
256 |
-
if (($sbj = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::
|
257 |
-
if (($sbj = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::
|
258 |
-
if (($sbj = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::
|
259 |
{
|
260 |
if (is_array($fields) && !empty($fields))
|
261 |
foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
|
262 |
-
if (!($sbj = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::
|
263 |
break;
|
264 |
|
265 |
if (($msg = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]))
|
266 |
-
if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim
|
267 |
-
if (($msg = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::
|
268 |
-
if (($msg = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::
|
269 |
-
if (($msg = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::
|
270 |
-
if (($msg = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::
|
271 |
-
if (($msg = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::
|
272 |
-
if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::
|
273 |
-
if (($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::
|
274 |
-
if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::
|
275 |
-
if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::
|
276 |
-
if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::
|
277 |
-
if (($msg = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::
|
278 |
-
if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::
|
279 |
-
if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::
|
280 |
{
|
281 |
if (is_array($fields) && !empty($fields))
|
282 |
foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
|
283 |
-
if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::
|
284 |
break;
|
285 |
|
286 |
if (($sbj = trim (preg_replace ("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg)))) // Still have a ``$sbj`` and a ``$msg``?
|
@@ -312,66 +312,66 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
|
|
312 |
$user_ip = $_SERVER["REMOTE_ADDR"];
|
313 |
|
314 |
if (($rec = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_recipients"]))
|
315 |
-
if (($rec = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim
|
316 |
-
if (($rec = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::
|
317 |
-
if (($rec = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::
|
318 |
-
if (($rec = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::
|
319 |
-
if (($rec = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::
|
320 |
-
if (($rec = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::
|
321 |
-
if (($rec = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::
|
322 |
-
if (($rec = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::
|
323 |
-
if (($rec = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::
|
324 |
-
if (($rec = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::
|
325 |
-
if (($rec = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::
|
326 |
-
if (($rec = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::
|
327 |
-
if (($rec = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::
|
328 |
-
if (($rec = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::
|
329 |
{
|
330 |
if (is_array($fields) && !empty($fields))
|
331 |
foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
|
332 |
-
if (!($rec = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::
|
333 |
break;
|
334 |
|
335 |
if (($sbj = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_subject"]))
|
336 |
-
if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim
|
337 |
-
if (($sbj = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::
|
338 |
-
if (($sbj = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::
|
339 |
-
if (($sbj = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::
|
340 |
-
if (($sbj = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::
|
341 |
-
if (($sbj = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::
|
342 |
-
if (($sbj = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::
|
343 |
-
if (($sbj = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::
|
344 |
-
if (($sbj = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::
|
345 |
-
if (($sbj = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::
|
346 |
-
if (($sbj = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::
|
347 |
-
if (($sbj = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::
|
348 |
-
if (($sbj = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::
|
349 |
-
if (($sbj = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::
|
350 |
{
|
351 |
if (is_array($fields) && !empty($fields))
|
352 |
foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
|
353 |
-
if (!($sbj = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::
|
354 |
break;
|
355 |
|
356 |
if (($msg = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_message"]))
|
357 |
-
if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim
|
358 |
-
if (($msg = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::
|
359 |
-
if (($msg = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::
|
360 |
-
if (($msg = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::
|
361 |
-
if (($msg = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::
|
362 |
-
if (($msg = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::
|
363 |
-
if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::
|
364 |
-
if (($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::
|
365 |
-
if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::
|
366 |
-
if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::
|
367 |
-
if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::
|
368 |
-
if (($msg = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::
|
369 |
-
if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::
|
370 |
-
if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::
|
371 |
{
|
372 |
if (is_array($fields) && !empty($fields))
|
373 |
foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
|
374 |
-
if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::
|
375 |
break;
|
376 |
|
377 |
if (($rec = trim (preg_replace ("/%%(.+?)%%/i", "", $rec))) && ($sbj = trim (preg_replace ("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg))))
|
242 |
$user_ip = $_SERVER["REMOTE_ADDR"];
|
243 |
|
244 |
if (($sbj = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_subject"]))
|
245 |
+
if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim(@$cv[$1])', $sbj)))
|
246 |
+
if (($sbj = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $sbj)))
|
247 |
+
if (($sbj = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($role), $sbj)))
|
248 |
+
if (($sbj = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($label), $sbj)))
|
249 |
+
if (($sbj = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($level), $sbj)))
|
250 |
+
if (($sbj = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $sbj)))
|
251 |
+
if (($sbj = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $sbj)))
|
252 |
+
if (($sbj = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $sbj)))
|
253 |
+
if (($sbj = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $sbj)))
|
254 |
+
if (($sbj = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $sbj)))
|
255 |
+
if (($sbj = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $sbj)))
|
256 |
+
if (($sbj = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $sbj)))
|
257 |
+
if (($sbj = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $sbj)))
|
258 |
+
if (($sbj = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $sbj)))
|
259 |
{
|
260 |
if (is_array($fields) && !empty($fields))
|
261 |
foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
|
262 |
+
if (!($sbj = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $sbj)))
|
263 |
break;
|
264 |
|
265 |
if (($msg = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]))
|
266 |
+
if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim(@$cv[$1])', $msg)))
|
267 |
+
if (($msg = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $msg)))
|
268 |
+
if (($msg = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($role), $msg)))
|
269 |
+
if (($msg = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($label), $msg)))
|
270 |
+
if (($msg = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($level), $msg)))
|
271 |
+
if (($msg = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $msg)))
|
272 |
+
if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name), $msg)))
|
273 |
+
if (($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name), $msg)))
|
274 |
+
if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name), $msg)))
|
275 |
+
if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $msg)))
|
276 |
+
if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $msg)))
|
277 |
+
if (($msg = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $msg)))
|
278 |
+
if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $msg)))
|
279 |
+
if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_id), $msg)))
|
280 |
{
|
281 |
if (is_array($fields) && !empty($fields))
|
282 |
foreach /* Custom Registration/Profile Fields. */ ($fields as $var => $val)
|
283 |
+
if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (maybe_serialize ($val)), $msg)))
|
284 |
break;
|
285 |
|
286 |
if (($sbj = trim (preg_replace ("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg)))) // Still have a ``$sbj`` and a ``$msg``?
|
312 |
$user_ip = $_SERVER["REMOTE_ADDR"];
|
313 |
|
314 |
if (($rec = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_recipients"]))
|
315 |
+
if (($rec = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim(@$cv[$1])', $rec)))
|
316 |
+
if (($rec = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_refs (wp_login_url ()), $rec)))
|
317 |
+
if (($rec = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($role), $rec)))
|
318 |
+
if (($rec = preg_replace ("/%%label%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($label), $rec)))
|
319 |
+
if (($rec = preg_replace ("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($level), $rec)))
|
320 |
+
if (($rec = preg_replace ("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($ccaps), $rec)))
|
321 |
+
if (($rec = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_refs ($user->first_name)), $rec)))
|
322 |
+
if (($rec = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_refs ($user->last_name)), $rec)))
|
323 |
+
if (($rec = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_refs ($user_full_name)), $rec)))
|
324 |
+
if (($rec = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_email), $rec)))
|
325 |
+
if (($rec = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user->user_login), $rec)))
|
326 |
+
if (($rec = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_pass), $rec)))
|
327 |
+
if (($rec = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_refs ($user_ip), $rec)))
|