本文整理汇总了PHP中c_ws_plugin__s2member_utils_encryption类的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utils_encryption类的具体用法?PHP c_ws_plugin__s2member_utils_encryption怎么用?PHP c_ws_plugin__s2member_utils_encryption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了c_ws_plugin__s2member_utils_encryption类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: register
/**
* 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"])) {
eval('while (@ob_end_clean ());');
/* First we end/clean any output buffers that may exist already. */
/**/
$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") {
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"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[1]);
$_COOKIE["s2member_subscr_id"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[2]);
$_COOKIE["s2member_custom"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[3]);
$_COOKIE["s2member_item_number"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[4]);
/**/
if (($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
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());
}
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:70,代码来源:register-in.inc.php
示例2: sc_google_button
/**
* Shortcode `[s2Member-Pro-Google-Button /]`.
*
* @package s2Member\Google
* @since 1.5
*
* @attaches-to ``add_shortcode("s2Member-Pro-Google-Button");``
*
* @param array $attr An array of Attributes.
* @param string $content Content inside the Shortcode.
* @param string $shortcode The actual Shortcode name itself.
* @return string The resulting Google Button Code; HTML markup.
*/
public static function sc_google_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
$jwt_attr = c_ws_plugin__s2member_utils_encryption::encrypt(serialize($attr));
$attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "rrt" => "", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "anchor", "success" => "", "failure" => ""), $attr);
if ($attr["modify"] || $attr["cancel"]) {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-edit-button.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-cancellation-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
$code = $url = c_ws_plugin__s2member_utils_urls::n_amps($href);
}
unset($href, $url, $m);
} else {
if ($attr["sp"]) {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-wallet-co.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-sp-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$code = preg_replace("/%%jwt_attr%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($jwt_attr)), $code);
$code = preg_replace(array("/%%success%%/", "/%%failure%%/"), array($attr["success"], $attr["failure"]), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
} else {
if ($attr["level"] === "*") {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-wallet-co.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-ccaps-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$code = preg_replace("/%%jwt_attr%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($jwt_attr)), $code);
$code = preg_replace(array("/%%success%%/", "/%%failure%%/"), array($attr["success"], $attr["failure"]), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
} else {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-wallet-co.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$code = preg_replace("/%%jwt_attr%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($jwt_attr)), $code);
$code = preg_replace(array("/%%success%%/", "/%%failure%%/"), array($attr["success"], $attr["failure"]), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
}
}
}
return $code;
}
开发者ID:codeforest,项目名称:s2member-pro,代码行数:61,代码来源:google-button-in.inc.php
示例3: stripe_update
/**
* Handles processing of Pro-Form billing updates.
*
* @package s2Member\Stripe
* @since 140617
*
* @attaches-to ``add_action('init');``
*/
public static function stripe_update()
{
if (!empty($_POST['s2member_pro_stripe_update']['nonce']) && ($nonce = $_POST['s2member_pro_stripe_update']['nonce']) && wp_verify_nonce($nonce, 's2member-pro-stripe-update')) {
$GLOBALS['ws_plugin__s2member_pro_stripe_update_response'] = array();
// This holds the global response details.
$global_response =& $GLOBALS['ws_plugin__s2member_pro_stripe_update_response'];
$post_vars = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST['s2member_pro_stripe_update']));
$post_vars['attr'] = !empty($post_vars['attr']) ? (array) unserialize(c_ws_plugin__s2member_utils_encryption::decrypt($post_vars['attr'])) : array();
$post_vars['attr'] = apply_filters('ws_plugin__s2member_pro_stripe_update_post_attr', $post_vars['attr'], get_defined_vars());
$post_vars = c_ws_plugin__s2member_utils_captchas::recaptcha_post_vars($post_vars);
// Collect reCAPTCHA™ post vars.
if (!c_ws_plugin__s2member_pro_stripe_responses::stripe_form_attr_validation_errors($post_vars['attr'])) {
if (!($form_submission_validation_errors = c_ws_plugin__s2member_pro_stripe_responses::stripe_form_submission_validation_errors('update', $post_vars))) {
if (is_user_logged_in() && ($user = wp_get_current_user()) && ($user_id = $user->ID)) {
if (($cur__subscr_cid = get_user_option('s2member_subscr_cid')) && ($cur__subscr_id = get_user_option('s2member_subscr_id'))) {
if (is_object($stripe_subscription = c_ws_plugin__s2member_pro_stripe_utilities::get_customer_subscription($cur__subscr_cid, $cur__subscr_id)) && !preg_match('/^canceled$/i', $stripe_subscription->status) && !$stripe_subscription->cancel_at_period_end) {
unset($_POST['s2member_pro_stripe_update']['source_token']);
// These are good one-time only.
unset($_POST['s2member_pro_stripe_update']['source_token_summary']);
if (is_object($set_customer_source = c_ws_plugin__s2member_pro_stripe_utilities::set_customer_source($cur__subscr_cid, $post_vars['source_token'], $post_vars, $post_vars['attr']['reject_prepaid']))) {
$global_response = array('response' => _x('<strong>Confirmed.</strong> Your billing information has been updated.', 's2member-front', 's2member'));
if ($post_vars['attr']['success'] && ($custom_success_url = str_ireplace(array('%%s_response%%', '%%response%%'), array(urlencode(c_ws_plugin__s2member_utils_encryption::encrypt($global_response['response'])), urlencode($global_response['response'])), $post_vars['attr']['success'])) && ($custom_success_url = trim(preg_replace('/%%(.+?)%%/i', '', $custom_success_url)))) {
wp_redirect(c_ws_plugin__s2member_utils_urls::add_s2member_sig($custom_success_url, 's2p-v')) . exit;
}
} else {
$global_response = array('response' => $set_customer_source, 'error' => TRUE);
}
} else {
$global_response = array('response' => _x('<strong>Unable to update.</strong> You have NO recurring fees. Or, your billing profile is no longer active. Please contact Support if you need assistance.', 's2member-front', 's2member'), 'error' => TRUE);
}
} else {
$global_response = array('response' => _x('<strong>Oops.</strong> No Customer|Subscr. ID. Please contact Support for assistance.', 's2member-front', 's2member'), 'error' => TRUE);
}
} else {
$global_response = array('response' => _x('You\'re <strong>NOT</strong> logged in.', 's2member-front', 's2member'), 'error' => TRUE);
}
} else {
// Input form field validation errors.
$global_response = $form_submission_validation_errors;
}
}
}
}
开发者ID:SollyNZ,项目名称:damn-plugins,代码行数:51,代码来源:stripe-update-in.inc.php
示例4: sp_checkout
/**
* Handles processing of Pro-Forms for Specific Post/Page checkout.
*
* @package s2Member\PayPal
* @since 1.5
*
* @attaches-to ``add_action("init");``
*
* @return null Or exits script execution after a custom URL redirection; or upon Express Checkout redirection.
*/
public static function sp_checkout()
{
if (!empty($_POST["s2member_pro_paypal_sp_checkout"]["nonce"]) && ($nonce = $_POST["s2member_pro_paypal_sp_checkout"]["nonce"]) && wp_verify_nonce($nonce, "s2member-pro-paypal-sp-checkout") || !empty($_GET["s2member_paypal_xco"]) && $_GET["s2member_paypal_xco"] === "s2member_pro_paypal_sp_checkout_return" && !empty($_GET["token"]) && ($_GET["token"] = esc_html($_GET["token"])) && (empty($_GET["PayerID"]) || ($_GET["PayerID"] = esc_html($_GET["PayerID"]))) && ($xco_post_vars = get_transient("s2m_" . md5("s2member_transient_express_checkout_" . $_GET["token"])))) {
$GLOBALS["ws_plugin__s2member_pro_paypal_sp_checkout_response"] = array();
// This holds the global response details.
$global_response =& $GLOBALS["ws_plugin__s2member_pro_paypal_sp_checkout_response"];
// This is a shorter reference.
if (!empty($xco_post_vars)) {
// A customer is returning from Express Checkout @ PayPal?
$_POST = $xco_post_vars;
}
// POST vars from submission prior to Express Checkout.
$post_vars = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST["s2member_pro_paypal_sp_checkout"]));
$post_vars["attr"] = !empty($post_vars["attr"]) ? (array) unserialize(c_ws_plugin__s2member_utils_encryption::decrypt($post_vars["attr"])) : array();
$post_vars["attr"] = apply_filters("ws_plugin__s2member_pro_paypal_sp_checkout_post_attr", $post_vars["attr"], get_defined_vars());
if (!empty($xco_post_vars)) {
$post_vars["attr"]["captcha"] = "0";
}
// No need to revalidate captcha in this case.
$post_vars["name"] = trim($post_vars["first_name"] . " " . $post_vars["last_name"]);
$post_vars["email"] = apply_filters("user_registration_email", sanitize_email($post_vars["email"]), get_defined_vars());
if (empty($post_vars["card_expiration"]) && isset($post_vars["card_expiration_month"], $post_vars["card_expiration_year"])) {
$post_vars["card_expiration"] = $post_vars["card_expiration_month"] . "/" . $post_vars["card_expiration_year"];
}
$post_vars = c_ws_plugin__s2member_utils_captchas::recaptcha_post_vars($post_vars);
// Collect reCAPTCHA™ post vars.
!empty($_GET["token"]) ? delete_transient("s2m_" . md5("s2member_transient_express_checkout_" . $_GET["token"])) : null;
if (!c_ws_plugin__s2member_pro_paypal_responses::paypal_form_attr_validation_errors($post_vars["attr"])) {
if (!($error = c_ws_plugin__s2member_pro_paypal_responses::paypal_form_submission_validation_errors("sp-checkout", $post_vars))) {
$cp_attr = c_ws_plugin__s2member_pro_paypal_utilities::paypal_apply_coupon($post_vars["attr"], $post_vars["coupon"], "attr", array("affiliates-silent-post"));
$cp_2gbp_attr = c_ws_plugin__s2member_pro_paypal_utilities::paypal_maestro_solo_2gbp($cp_attr, $post_vars["card_type"]);
$cost_calculations = c_ws_plugin__s2member_pro_paypal_utilities::paypal_cost(null, $cp_2gbp_attr["ra"], $post_vars["state"], $post_vars["country"], $post_vars["zip"], $cp_2gbp_attr["cc"], $cp_2gbp_attr["desc"]);
if (empty($_GET["s2member_paypal_xco"]) && $post_vars["card_type"] === "PayPal" && $cost_calculations["total"] > 0) {
$return_url = $cancel_url = is_ssl() ? "https://" : "http://";
$return_url = $cancel_url = ($return_url = $cancel_url) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
$return_url = $cancel_url = remove_query_arg(array("token", "PayerID"), $return_url = $cancel_url);
$return_url = add_query_arg("s2member_paypal_xco", urlencode("s2member_pro_paypal_sp_checkout_return"), $return_url);
$cancel_url = add_query_arg("s2member_paypal_xco", urlencode("s2member_pro_paypal_sp_checkout_cancel"), $cancel_url);
$user = is_user_logged_in() && is_object($user = wp_get_current_user()) && ($user_id = $user->ID) ? $user : false;
$post_vars["attr"]["invoice"] = uniqid() . "~" . $_SERVER["REMOTE_ADDR"];
// Unique invoice w/ IP address too.
if (!($paypal_set_xco = array())) {
$paypal_set_xco["METHOD"] = "SetExpressCheckout";
$paypal_set_xco["RETURNURL"] = $return_url;
$paypal_set_xco["CANCELURL"] = $cancel_url;
$paypal_set_xco["PAGESTYLE"] = $post_vars["attr"]["ps"];
$paypal_set_xco["LOCALECODE"] = $post_vars["attr"]["lc"];
$paypal_set_xco["NOSHIPPING"] = $post_vars["attr"]["ns"];
$paypal_set_xco["SOLUTIONTYPE"] = "Sole";
$paypal_set_xco["LANDINGPAGE"] = "Billing";
$paypal_set_xco["ALLOWNOTE"] = "0";
$paypal_set_xco["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale";
$paypal_set_xco["MAXAMT"] = $cost_calculations["total"];
$paypal_set_xco["PAYMENTREQUEST_0_DESC"] = $cost_calculations["desc"];
$paypal_set_xco["PAYMENTREQUEST_0_CUSTOM"] = $post_vars["attr"]["custom"];
$paypal_set_xco["PAYMENTREQUEST_0_INVNUM"] = $post_vars["attr"]["invoice"];
$paypal_set_xco["PAYMENTREQUEST_0_CURRENCYCODE"] = $cost_calculations["cur"];
$paypal_set_xco["PAYMENTREQUEST_0_ITEMAMT"] = $cost_calculations["sub_total"];
$paypal_set_xco["PAYMENTREQUEST_0_TAXAMT"] = $cost_calculations["tax"];
$paypal_set_xco["PAYMENTREQUEST_0_AMT"] = $cost_calculations["total"];
$paypal_set_xco["L_PAYMENTREQUEST_0_QTY0"] = "1";
// Always (1).
$paypal_set_xco["L_PAYMENTREQUEST_0_NAME0"] = $cost_calculations["desc"];
$paypal_set_xco["L_PAYMENTREQUEST_0_NUMBER0"] = $post_vars["attr"]["sp_ids_exp"];
$paypal_set_xco["L_PAYMENTREQUEST_0_AMT0"] = $cost_calculations["sub_total"];
$paypal_set_xco["PAYMENTREQUEST_0_SHIPTONAME"] = $post_vars["name"];
$paypal_set_xco["PAYMENTREQUEST_0_SHIPTOSTREET"] = $post_vars["street"];
$paypal_set_xco["PAYMENTREQUEST_0_SHIPTOCITY"] = $post_vars["city"];
$paypal_set_xco["PAYMENTREQUEST_0_SHIPTOSTATE"] = $post_vars["state"];
$paypal_set_xco["PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE"] = $post_vars["country"];
$paypal_set_xco["PAYMENTREQUEST_0_SHIPTOZIP"] = $post_vars["zip"];
$paypal_set_xco["EMAIL"] = $post_vars["email"];
}
if (($paypal_set_xco = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($paypal_set_xco)) && empty($paypal_set_xco["__error"])) {
set_transient("s2m_" . md5("s2member_transient_express_checkout_" . $paypal_set_xco["TOKEN"]), $_POST, 10800);
$endpoint = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com";
wp_redirect(add_query_arg("token", urlencode($paypal_set_xco["TOKEN"]), "https://" . $endpoint . "/cgi-bin/webscr?cmd=_express-checkout"));
exit;
// Clean exit.
} else {
$global_response = array("response" => $paypal_set_xco["__error"], "error" => true);
}
} else {
if (empty($post_vars["attr"]["invoice"])) {
// Only if it's empty.
$post_vars["attr"]["invoice"] = uniqid() . "~" . $_SERVER["REMOTE_ADDR"];
}
if (!($paypal = array())) {
if (!empty($_GET["s2member_paypal_xco"]) && $_GET["s2member_paypal_xco"] === "s2member_pro_paypal_sp_checkout_return" && !empty($_GET["token"]) && ($paypal_xco_details = array("METHOD" => "GetExpressCheckoutDetails", "TOKEN" => $_GET["token"])) && ($paypal_xco_details = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($paypal_xco_details)) && empty($paypal_xco_details["__error"])) {
$paypal["METHOD"] = "DoExpressCheckoutPayment";
//.........这里部分代码省略.........
开发者ID:codeforest,项目名称:s2member-pro,代码行数:101,代码来源:paypal-sp-checkout-in.inc.php
示例5: paypal_registration
/**
* Handles processing of Pro Form registrations.
*
* @package s2Member\PayPal
* @since 1.5
*
* @attaches-to ``add_action("init");``
*
* @return null Or exits script execution after a custom URL redirection.
*/
public static function paypal_registration()
{
if (!empty($_POST["s2member_pro_paypal_registration"]["nonce"]) && ($nonce = $_POST["s2member_pro_paypal_registration"]["nonce"]) && wp_verify_nonce($nonce, "s2member-pro-paypal-registration")) {
$GLOBALS["ws_plugin__s2member_pro_paypal_registration_response"] = array();
// This holds the global response details.
$global_response =& $GLOBALS["ws_plugin__s2member_pro_paypal_registration_response"];
// This is a shorter reference.
$post_vars = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST["s2member_pro_paypal_registration"]));
$post_vars["attr"] = !empty($post_vars["attr"]) ? (array) unserialize(c_ws_plugin__s2member_utils_encryption::decrypt($post_vars["attr"])) : array();
$post_vars["attr"] = apply_filters("ws_plugin__s2member_pro_paypal_registration_post_attr", $post_vars["attr"], get_defined_vars());
$post_vars["recaptcha_challenge_field"] = isset($_POST["recaptcha_challenge_field"]) ? trim(stripslashes($_POST["recaptcha_challenge_field"])) : "";
$post_vars["recaptcha_response_field"] = isset($_POST["recaptcha_response_field"]) ? trim(stripslashes($_POST["recaptcha_response_field"])) : "";
$post_vars["name"] = trim($post_vars["first_name"] . " " . $post_vars["last_name"]);
$post_vars["email"] = apply_filters("user_registration_email", sanitize_email($post_vars["email"]), get_defined_vars());
$post_vars["username"] = is_multisite() ? strtolower($post_vars["username"]) : $post_vars["username"];
// Force lowercase.
$post_vars["username"] = preg_replace("/\\s+/", "", sanitize_user($post_vars["_o_username"] = $post_vars["username"], is_multisite()));
if (!c_ws_plugin__s2member_pro_paypal_responses::paypal_form_attr_validation_errors($post_vars["attr"])) {
if (!($error = c_ws_plugin__s2member_pro_paypal_responses::paypal_form_submission_validation_errors("registration", $post_vars))) {
if (!($create_user = array())) {
$_POST["ws_plugin__s2member_custom_reg_field_user_pass1"] = $post_vars["password1"];
// Fake this for registration configuration.
$_POST["ws_plugin__s2member_custom_reg_field_first_name"] = $post_vars["first_name"];
// Fake this for registration configuration.
$_POST["ws_plugin__s2member_custom_reg_field_last_name"] = $post_vars["last_name"];
// Fake this for registration configuration.
$_POST["ws_plugin__s2member_custom_reg_field_opt_in"] = $post_vars["custom_fields"]["opt_in"];
// Fake this too.
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) {
foreach (json_decode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field) {
$field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
$field_id_class = preg_replace("/_/", "-", $field_var);
if (isset($post_vars["custom_fields"][$field_var])) {
$_POST["ws_plugin__s2member_custom_reg_field_" . $field_var] = $post_vars["custom_fields"][$field_var];
}
}
}
$GLOBALS["ws_plugin__s2member_registration_vars"]["ws_plugin__s2member_custom_reg_field_s2member_level"] = $post_vars["attr"]["level"];
$GLOBALS["ws_plugin__s2member_registration_vars"]["ws_plugin__s2member_custom_reg_field_s2member_ccaps"] = $post_vars["attr"]["ccaps"];
$GLOBALS["ws_plugin__s2member_registration_vars"]["ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time"] = $post_vars["attr"]["tp"] . " " . $post_vars["attr"]["tt"];
$_EOT_ =& $GLOBALS["ws_plugin__s2member_registration_vars"]["ws_plugin__s2member_custom_reg_field_s2member_auto_eot_time"];
// Quick/shorter reference to this var.
$_EOT_ = $post_vars["attr"]["tp"] && $post_vars["attr"]["tt"] ? date("Y-m-d H:i:s", c_ws_plugin__s2member_utils_time::auto_eot_time("", "", "", $_EOT_)) : "";
$GLOBALS["ws_plugin__s2member_registration_vars"]["ws_plugin__s2member_custom_reg_field_s2member_custom"] = $post_vars["attr"]["custom"];
unset($_EOT_);
// We can unset this shorter/reference variable now.
$GLOBALS["ws_plugin__s2member_registration_return_url"] = $post_vars["attr"]["success"];
// Custom success return.
$create_user["user_login"] = $post_vars["username"];
// Copy this into a separate array for `wp_create_user()`.
$create_user["user_pass"] = wp_generate_password();
// Which may fire `c_ws_plugin__s2member_registrations::generate_password()`.
$create_user["user_email"] = $post_vars["email"];
// Copy this into a separate array for `wp_create_user()`.
}
if ($post_vars["password1"] && $post_vars["password1"] === $create_user["user_pass"]) {
if ((is_multisite() && ($new__user_id = c_ws_plugin__s2member_registrations::ms_create_existing_user($create_user["user_login"], $create_user["user_email"], $create_user["user_pass"])) || ($new__user_id = wp_create_user($create_user["user_login"], $create_user["user_pass"], $create_user["user_email"]))) && !is_wp_error($new__user_id)) {
update_user_option($new__user_id, "default_password_nag", false, true);
wp_new_user_notification($new__user_id, $create_user["user_pass"]);
$global_response = array("response" => sprintf(_x('<strong>Thank you.</strong> Please <a href="%s" rel="nofollow">login</a>.', "s2member-front", "s2member"), esc_attr(wp_login_url())));
if ($post_vars["attr"]["success"] && substr($GLOBALS["ws_plugin__s2member_registration_return_url"], 0, 2) === substr($post_vars["attr"]["success"], 0, 2) && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__s2member_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $GLOBALS["ws_plugin__s2member_registration_return_url"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
wp_redirect(c_ws_plugin__s2member_utils_urls::add_s2member_sig($custom_success_url, "s2p-v")) . exit;
}
} else {
$global_response = array("response" => _x('<strong>Oops.</strong> A slight problem. Please contact Support for assistance.', "s2member-front", "s2member"), "error" => true);
}
} else {
if ((is_multisite() && ($new__user_id = c_ws_plugin__s2member_registrations::ms_create_existing_user($create_user["user_login"], $create_user["user_email"], $create_user["user_pass"])) || ($new__user_id = wp_create_user($create_user["user_login"], $create_user["user_pass"], $create_user["user_email"]))) && !is_wp_error($new__user_id)) {
update_user_option($new__user_id, "default_password_nag", true, true);
wp_new_user_notification($new__user_id, $create_user["user_pass"]);
$global_response = array("response" => _x('<strong>Thank you.</strong> You\'ll receive an email momentarily.', "s2member-front", "s2member"));
if ($post_vars["attr"]["success"] && substr($GLOBALS["ws_plugin__s2member_registration_return_url"], 0, 2) === substr($post_vars["attr"]["success"], 0, 2) && ($custom_success_url = str_ireplace(array("%%s_response%%", "%%response%%"), array(urlencode(c_ws_plugin__s2member_utils_encryption::encrypt($global_response["response"])), urlencode($global_response["response"])), $GLOBALS["ws_plugin__s2member_registration_return_url"])) && ($custom_success_url = trim(preg_replace("/%%(.+?)%%/i", "", $custom_success_url)))) {
wp_redirect(c_ws_plugin__s2member_utils_urls::add_s2member_sig($custom_success_url, "s2p-v")) . exit;
}
} else {
$global_response = array("response" => _x('<strong>Oops.</strong> A slight problem. Please contact Support for assistance.', "s2member-front", "s2member"), "error" => true);
}
}
} else {
$global_response = $error;
}
}
}
}
开发者ID:donwea,项目名称:nhap.org,代码行数:94,代码来源:paypal-registration-in.inc.php
示例6: paypal_proxy_key_gen
/**
* Generates a PayPal Proxy Key, for simulated IPN responses.
*
* @package s2Member\PayPal
* @since 3.5
*
* @return string A Proxy Key. It's an MD5 Hash, 32 chars, URL-safe.
*/
public static function paypal_proxy_key_gen()
{
global $current_site, $current_blog;
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_paypal_proxy_key_gen", get_defined_vars());
unset($__refs, $__v);
if (is_multisite() && !is_main_site()) {
$key = md5(c_ws_plugin__s2member_utils_encryption::xencrypt($current_blog->domain . $current_blog->path, false, false));
} else {
// Else it's a standard Proxy Key; not on a Multisite Network, or not on the Main Site anyway.
$key = md5(c_ws_plugin__s2member_utils_encryption::xencrypt(preg_replace("/\\:[0-9]+\$/", "", $_SERVER["HTTP_HOST"]), false, false));
}
return apply_filters("ws_plugin__s2member_paypal_proxy_key_gen", $key, get_defined_vars());
}
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:24,代码来源:paypal-utilities.inc.php
示例7: xdecrypt
/**
* XOR two-way encryption/decryption, with a base64 wrapper.
*
* @package s2Member\Utilities
* @since 3.5
*
* @param str $base64 A string of data to decrypt. Should still be base64 encoded.
* @param str $key Optional. Key used originally for encryption. Defaults to the one configured for s2Member. Short of that, defaults to: ``wp_salt()``.
* @return str Decrypted string.
*/
public static function xdecrypt($base64 = FALSE, $key = FALSE)
{
$base64 = is_string($base64) ? $base64 : "";
$e = strlen($base64) ? c_ws_plugin__s2member_utils_strings::base64_url_safe_decode($base64) : "";
if (strlen($e) && preg_match("/^~xe(?:\\:([a-zA-Z0-9]+))?\\|(.*?)\$/s", $e, $md5_e)) {
$key = c_ws_plugin__s2member_utils_encryption::key($key);
if (strlen($md5_e[2]) && (!$md5_e[1] || $md5_e[1] === md5($md5_e[2]))) {
for ($i = 1, $d = ""; $i <= strlen($md5_e[2]); $i++) {
$char = substr($md5_e[2], $i - 1, 1);
$keychar = substr($key, $i % strlen($key) - 1, 1);
$d .= chr(ord($char) - ord($keychar));
}
}
if (isset($d) && is_string($d) && strlen($d)) {
if (strlen($d = preg_replace("/^~xe\\|/", "", $d, 1, $xe)) && $xe) {
$d = $d;
} else {
// Else we need to empty this out.
$d = "";
}
}
return isset($d) && is_string($d) && strlen($d) ? $string = $d : "";
} else {
// Otherwise we must fail here with an empty string value.
return "";
}
}
开发者ID:donwea,项目名称:nhap.org,代码行数:37,代码来源:utils-encryption.inc.php
示例8: sc_authnet_form
//.........这里部分代码省略.........
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts", get_defined_vars());
unset($__refs, $__v);
if ($attr["cancel"]) {
$_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST));
/*
Obtain a possible response and/or validation error.
*/
$response = c_ws_plugin__s2member_pro_authnet_responses::authnet_cancellation_response($attr);
/*
Empty post vars on successful response.
*/
$_p = $response["response"] && !$response["error"] ? array() : $_p;
/*
Build the reCaptcha box via JavaScript.
*/
if ($attr["captcha"]) {
$captcha = '<div id="s2member-pro-authnet-cancellation-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-cancellation-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-cancellation-form-captcha-section">' . "\n";
$captcha .= '<div id="s2member-pro-authnet-cancellation-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-cancellation-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-cancellation-form-captcha-section-title">' . "\n";
$captcha .= _x("Security Verification", "s2member-front", "s2member") . "\n";
$captcha .= '</div>' . "\n";
$captcha .= '<div id="s2member-pro-authnet-cancellation-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-cancellation-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-cancellation-form-captcha-div">' . "\n";
$captcha .= '<label id="s2member-pro-authnet-cancellation-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-cancellation-form-captcha-label">' . "\n";
$captcha .= c_ws_plugin__s2member_utils_captchas::recaptcha_script_tag($attr["captcha"], 10) . "\n";
$captcha .= '</label>' . "\n";
$captcha .= '</div>' . "\n";
$captcha .= '</div>' . "\n";
}
/*
Build the hidden input variables.
*/
$hidden_inputs = '<input type="hidden" name="s2member_pro_authnet_cancellation[nonce]" id="s2member-pro-authnet-cancellation-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-cancellation")) . '" />';
$hidden_inputs .= '<input type="hidden" name="s2member_pro_authnet_cancellation[attr]" id="s2member-pro-authnet-cancellation-attr" value="' . esc_attr(c_ws_plugin__s2member_utils_encryption::encrypt(serialize($attr))) . '" />';
$hidden_inputs .= '<input type="hidden" name="s2p-option" value="' . esc_attr((string) @$_REQUEST['s2p-option']) . '" />';
/*
Get the form template.
*/
$custom_template = is_file(TEMPLATEPATH . "/authnet-cancellation-form.php") ? TEMPLATEPATH . "/authnet-cancellation-form.php" : '';
$custom_template = is_file(get_stylesheet_directory() . "/authnet-cancellation-form.php") ? get_stylesheet_directory() . "/authnet-cancellation-form.php" : $custom_template;
$custom_template = $attr["template"] && is_file(TEMPLATEPATH . "/" . $attr["template"]) ? TEMPLATEPATH . "/" . $attr["template"] : $custom_template;
$custom_template = $attr["template"] && is_file(get_stylesheet_directory() . "/" . $attr["template"]) ? get_stylesheet_directory() . "/" . $attr["template"] : $custom_template;
$custom_template = $attr["template"] && is_file(WP_CONTENT_DIR . "/" . $attr["template"]) ? WP_CONTENT_DIR . "/" . $attr["template"] : $custom_template;
$code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/forms/authnet-cancellation-form.php"));
$code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code);
/*
Fill in the action.
*/
$code = preg_replace("/%%action%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($_SERVER["REQUEST_URI"])), $code);
/*
Fill in the response.
*/
$code = preg_replace("/%%response%%/", c_ws_plugin__s2member_utils_strings::esc_refs($response["response"]), $code);
/*
Fill in the description.
*/
$code = preg_replace("/%%description%%/", c_ws_plugin__s2member_utils_strings::esc_refs($attr["desc"]), $code);
/*
Fill the captcha section.
*/
$code = preg_replace("/%%captcha%%/", c_ws_plugin__s2member_utils_strings::esc_refs(@$captcha), $code);
/*
Fill hidden inputs.
*/
$code = preg_replace("/%%hidden_inputs%%/", c_ws_plugin__s2member_utils_strings::esc_refs($hidden_inputs), $code);
foreach (array_keys(get_defined_vars()) as $__v) {
开发者ID:SollyNZ,项目名称:damn-plugins,代码行数:67,代码来源:authnet-form-in.inc.php
示例9: google_jwt
/**
* Google JWT generator.
*
* @package s2Member\Google
* @since 131123
*
* @param array $attr An array of Attributes.
* @param str $content Content inside the Shortcode.
* @param str $shortcode The actual Shortcode name itself.
* @return str The resulting Google Button Code, HTML markup.
*/
public static function google_jwt()
{
if (empty($_GET["s2member_pro_google_jwt"])) {
return;
}
// Nothing to do.
status_header(200);
// Send a 200 OK status header.
header("Content-Type: text/plain");
// Google expects text/plain here.
while (@ob_end_clean()) {
}
// Clean any existing output buffers.
$current_user = wp_get_current_user();
if (!empty($_REQUEST["s2member_pro_google_jwt_vars"]["email"])) {
$em = stripslashes((string) $_REQUEST["s2member_pro_google_jwt_vars"]["email"]);
} else {
if ($current_user && !empty($current_user->user_email)) {
$em = $current_user->user_email;
} else {
exit;
}
}
// Not possible.
if (!empty($_REQUEST["s2member_pro_google_jwt_vars"]["fname"])) {
$fn = stripslashes((string) $_REQUEST["s2member_pro_google_jwt_vars"]["fname"]);
} else {
if ($current_user && !empty($current_user->first_name)) {
$fn = $current_user->first_name;
} else {
if ($current_user && !empty($current_user->display_name)) {
$fn = $current_user->display_name;
} else {
$fn = $em;
}
}
}
if (!empty($_REQUEST["s2member_pro_google_jwt_vars"]["lname"])) {
$ln = stripslashes((string) $_REQUEST["s2member_pro_google_jwt_vars"]["lname"]);
} else {
if ($current_user && !empty($current_user->last_name)) {
$ln = $current_user->last_name;
} else {
$ln = "";
}
}
// No last name available.
if (empty($_REQUEST["s2member_pro_google_jwt_vars"]["attr"])) {
exit;
}
$attr = stripslashes((string) $_REQUEST["s2member_pro_google_jwt_vars"]["attr"]);
$attr = (array) unserialize(c_ws_plugin__s2member_utils_encryption::decrypt($attr));
$at
|
请发表评论