- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 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
/**
* Handles Registration Links.
*
* @package s2Member\Registrations
* @since 3.5
*
* @attaches-to ``add_action("init");``
*
* @return null Or exits script execution after redirection.
*/
public static function register ()
{
do_action ("ws_plugin__s2member_before_register", get_defined_vars ());
if (!empty ($_GET["s2member_register"])) // If they're attempting to access the registration system.
{
while (@ob_end_clean ()); // Clean any existing output buffers.
$msg_503 = _x ('<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance.', "s2member-front", "s2member");
if (is_array ($register = preg_split ("/\:\.\:\|\:\.\:/", c_ws_plugin__s2member_utils_encryption::decrypt (trim (stripslashes ((string)$_GET["s2member_register"]))))))
{
if (count ($register) === 6 && $register[0] === "subscr_gateway_subscr_id_custom_item_number_time" /* Does the checksum value match up here? */)
{
if (is_numeric ($register[5]) && $register[5] <= strtotime ("now") && $register[5] >= strtotime ("-" . apply_filters ("ws_plugin__s2member_register_link_exp_time", "2 days", get_defined_vars ())))
{
$_COOKIE["s2member_subscr_gateway"] = /* For ``reg_cookies_ok ()``. */ c_ws_plugin__s2member_utils_encryption::encrypt ($register[1]);
$_COOKIE["s2member_subscr_id"] = /* For ``reg_cookies_ok ()``. */ c_ws_plugin__s2member_utils_encryption::encrypt ($register[2]);
$_COOKIE["s2member_custom"] = /* For ``reg_cookies_ok ()``. */ c_ws_plugin__s2member_utils_encryption::encrypt ($register[3]);
$_COOKIE["s2member_item_number"] = /* For ``reg_cookies_ok ()``. */ c_ws_plugin__s2member_utils_encryption::encrypt ($register[4]);
if (($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok ()) && extract ($reg_cookies) /* Needed? */)
{
status_header(200); // Send a 200 OK status header.
header("Content-Type: text/html; charset=UTF-8"); // Content-Type with UTF-8.
setcookie ("s2member_subscr_gateway", $_COOKIE["s2member_subscr_gateway"], time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie ("s2member_subscr_gateway", $_COOKIE["s2member_subscr_gateway"], time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
setcookie ("s2member_subscr_id", $_COOKIE["s2member_subscr_id"], time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie ("s2member_subscr_id", $_COOKIE["s2member_subscr_id"], time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
setcookie ("s2member_custom", $_COOKIE["s2member_custom"], time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie ("s2member_custom", $_COOKIE["s2member_custom"], time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
setcookie ("s2member_item_number", $_COOKIE["s2member_item_number"], time () + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie ("s2member_item_number", $_COOKIE["s2member_item_number"], time () + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
do_action ("ws_plugin__s2member_during_register", get_defined_vars ());
if (is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && is_main_site () && ($location = c_ws_plugin__s2member_utils_urls::wp_signup_url ()))
{
echo '<script type="text/javascript">' . "\n";
echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq ($location) . "';";
echo '</script>' . "\n";
}
else if (($location = c_ws_plugin__s2member_utils_urls::wp_register_url ()))
{
echo '<script type="text/javascript">' . "\n";
echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq ($location) . "';";
echo '</script>' . "\n";
}
exit (); // Clean exit. The browser will now be redirected to ``$location``.
}
else
status_header(503) . header ("Content-Type: text/html; charset=UTF-8") . exit ($msg_503);
}
else
status_header(503) . header ("Content-Type: text/html; charset=UTF-8") . exit ($msg_503);
}
else
status_header(503) . header ("Content-Type: text/html; charset=UTF-8") . exit ($msg_503);
}
else
status_header(503) . header ("Content-Type: text/html; charset=UTF-8") . exit ($msg_503);
}
do_action ("ws_plugin__s2member_after_register", get_defined_vars ());
}
Концовка особенно захватывающа.
Плагин для Wordpress - s2member, https://www.s2member.com/codex/stable/source/s2member/includes/classes/register-in.inc.php
eth0 20.04.2014 15:55 # +1
kegdan 20.04.2014 16:35 # 0
LispGovno 20.04.2014 16:57 # 0
gost 21.04.2014 09:18 # 0
brutushafens 21.04.2014 10:45 # −2