コード例 #1
0
 function recurly($that)
 {
     require_once $that->pluginDir . '/extlib/WP_RecurlyClient.php';
     $client = new WP_RecurlyClient($that->GetOption('recurlyapikey'));
     if (wlm_arrval($_GET, 'act') == 'reg') {
         $plan_code = $_GET['plan_code'];
         $account_code = $_GET['account_code'];
         $account = $client->get_account($account_code);
         $subscriptions = $client->get_subscriptions($account_code);
         if (empty($account) || empty($subscriptions)) {
             //maybe redirect to cancel url?
             return;
         }
         //check that this subscription is actually in the users subscriptions
         $current_subscription = null;
         $found = false;
         foreach ($subscriptions as $s) {
             if ($s['plan_code'] == $plan_code) {
                 $found = true;
                 $current_subscription = $s;
             }
         }
         if (!$found) {
             //cheatin huh?
             return;
         }
         if ($current_subscription['state'] != 'active') {
             return;
         }
         $plan = $client->get_plan($plan_code);
         $_POST['lastname'] = $account['last_name'];
         $_POST['firstname'] = $account['first_name'];
         $_POST['action'] = 'wpm_register';
         $_POST['wpm_id'] = $plan['accounting_code'];
         $_POST['username'] = $account['email'];
         $_POST['email'] = $account['email'];
         $_POST['password1'] = $_POST['password2'] = 'sldkfjsdlkfj';
         $_POST['sctxnid'] = $current_subscription['uuid'];
         $that->ShoppingCartRegistration();
     } else {
         $listen = array('canceled_subscription_notification', 'expired_subscription_notification', 'renewed_subscription_notification', 'updated_subscription_notification');
         $notif = file_get_contents("php://input");
         $type = $client->get_notification_type($notif);
         if (in_array($type, $listen)) {
             $subscription = $client->get_subscription_from_notif($notif);
             $_POST['sctxnid'] = $subscription['uuid'];
             if ($subscription['state'] == 'active') {
                 $that->ShoppingCartReactivate();
             } else {
                 $that->ShoppingCartDeactivate();
             }
         } else {
             //nothing to do
         }
     }
 }
 function AuthorizeNet($that)
 {
     require_once $that->pluginDir . '/extlib/anet_sdk/AuthorizeNet.php';
     define("AUTHORIZENET_API_LOGIN_ID", $that->GetOption('anloginid'));
     define("AUTHORIZENET_TRANSACTION_KEY", $that->GetOption('antransid'));
     define("AUTHORIZENET_MD5_SETTING", $that->GetOption('anmd5hash'));
     $anetsandbox = $that->GetOption('anetsandbox');
     $request = new AuthorizeNetTD();
     if ((int) $anetsandbox != 1) {
         $request->setSandbox(false);
     }
     $response = $request->getTransactionDetails(wlm_arrval($_GET, 'x_trans_id'));
     // Check if transaction response, transaction_id and authCode if present.
     if (!isset($response->xml->transaction->responseCode) || !isset($response->xml->transaction->authCode) || !isset($response->xml->transaction->transId)) {
         return;
     }
     // Check if transaction code is approved.
     if ($response->xml->transaction->responseCode != 1) {
         return;
     }
     foreach ($response->xml->transaction->lineItems->lineItem as $lineItem) {
         $_POST['wpm_id'] = (string) $lineItem->itemId;
     }
     foreach ($response->xml->transaction->billTo as $billTo) {
         $_POST['lastname'] = (string) $billTo->lastName;
         $_POST['firstname'] = (string) $billTo->firstName;
         $_POST['password1'] = $_POST['password2'] = 'sldkfjsdlkfj';
     }
     foreach ($response->xml->transaction->customer as $customer) {
         $_POST['username'] = (string) $customer->email;
         $_POST['email'] = (string) $customer->email;
     }
     $_POST['action'] = 'wpm_register';
     $_POST['sctxnid'] = (string) $response->xml->transaction->transId;
     $amount = (string) $response->xml->transaction->authAmount;
     $transaction_id = (string) $response->xml->transaction->transId;
     $x_md5_hash = (string) $_GET['x_MD5_Hash'];
     $amount = isset($amount) ? $amount : "0.00";
     // Generate hash for checking with authorize.net submitted hash value.
     $generated_hash = strtoupper(md5(AUTHORIZENET_MD5_SETTING . AUTHORIZENET_API_LOGIN_ID . $transaction_id . $amount));
     // Let's verify is authorize.net and generate hash is valid.
     if ($x_md5_hash === $generated_hash) {
         $that->ShoppingCartRegistration();
     } else {
         $that->ShoppingCartDeactivate();
     }
 }
コード例 #3
0
 function Spreedly($that)
 {
     $this->that = $that;
     $wlmspreedly = new WLMSpreedly($that);
     $wpm_levels = $that->GetOption('wpm_levels');
     $current_user = wp_get_current_user();
     $spreedly_user = "";
     /* LETS END EVERYTHING IF WE CANT CONNECT TO SPREEDLY */
     if (!$wlmspreedly->athenticated) {
         //
         die("Oppss!! Something went wrong.Theres an error connecting to Pin Payments, please try again.");
     }
     /* REDIRECT AFTER REGISTRATION */
     if (isset($_GET['reg_id'])) {
         $plan_id = $_GET['reg_id'];
         $sku = $wlmspreedly->get_plan_sku($plan_id);
         /* Get/Create Spreedly user */
         if (array_key_exists($sku, $wpm_levels)) {
             //make sure that its a correct membership level id
             if ($current_user->ID != 0) {
                 //make sure that the user is logged in
                 $wl_user = new WishListMemberUser($current_user->ID);
                 //get wlm user details
                 $wl_user_levels = $wl_user->Levels;
                 //get user levels
                 //check if he has a for approval membership level using spreedly
                 if (array_key_exists($sku, $wl_user_levels) && $wl_user_levels[$sku]->Pending == "Pin Payments Confirmation") {
                     //get user spreedly account
                     $spreedly_user = $wlmspreedly->get_subscriber($wl_user_levels[$sku]->TxnID);
                     //if no user, lets create
                     if (is_null($spreedly_user)) {
                         $spreedly_user = $wlmspreedly->add_subscriber($wl_user_levels[$sku]->TxnID, $current_user->user_login, $current_user->user_email);
                     }
                 }
             }
         }
         /* Now we have our spreedly user account for this member */
         if (!is_null($spreedly_user) && isset($spreedly_user->customer_id)) {
             $name = explode(" ", $current_user->display_name, 2);
             $user_data = array("id" => $spreedly_user->customer_id, "email" => $current_user->user_email, "first_name" => $name[0], "last_name" => $name[1]);
             /* Redirect to spreedly payment form */
             header('Location:' . $this->generate_subscription_url($wlmspreedly->spreedlyname, $plan_id, $user_data));
             exit(0);
         }
     }
     /* REDIRECT AFTER MEMBER PAYS FROM SPREEDLY AND CLICK "CONTINUE" LINK */
     if (isset($_GET['sku']) && array_key_exists($_GET['sku'], $wpm_levels)) {
         //make sure that its a correct membership level id
         if ($current_user->ID != 0) {
             //make sure that the user is logged in
             //get user membership levels
             $wl_user = new WishListMemberUser($current_user->ID);
             $wl_user_levels = $wl_user->Levels;
             //based on the txnid, get the spreedly user for this member
             $user = $wlmspreedly->get_subscriber($wl_user_levels[wlm_arrval($_GET, 'sku')]->TxnID);
             if (!is_null($user)) {
                 $txn_detail = array("txnid" => $wl_user_levels[wlm_arrval($_GET, 'sku')]->TxnID, "user_id" => $current_user->ID, "level_id" => $_GET['sku']);
                 $this->process_membership($txn_detail, $user);
                 $afterreg = $this->get_after_reg_url($wpm_levels, $_GET['sku']);
                 header('Location:' . $afterreg);
                 exit(0);
             }
         }
     }
     /* SPREEDLY NOTIFICATION FOR CHANGES IN USERS AND THERE TRANSACTIONS */
     if (isset($_POST['subscriber_ids'])) {
         $ids = $_POST['subscriber_ids'];
         $ids = explode(",", $ids);
         foreach ($ids as $id) {
             $user = $wlmspreedly->get_subscriber($id);
             $txn_details = $this->get_txn_details($id);
             foreach ($txn_details as $txn_detail) {
                 $this->process_membership($txn_detail, $user);
             }
         }
     }
 }
コード例 #4
0
         }
     }
     // save API Key
     if (wlm_arrval($_POST, 'spreedlytoken')) {
         $_POST['spreedlytoken'] = trim(wlm_arrval($_POST, 'spreedlytoken'));
         $wpmy = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['spreedlytoken']));
         if ($wpmy == $_POST['spreedlytoken']) {
             $this->SaveOption('spreedlytoken', $spreedlytoken = $wpmy);
             echo "<div class='updated fade'>" . __('<p>API Token Changed.&nbsp; Make sure that your API Token matches the one specified in your Pin Payments site configuration.</p>', 'wishlist-member') . "</div>";
         } else {
             echo "<div class='error fade'>" . __('<p><b>Error:</b> Pin Payments API Token may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
         }
     }
     // save Machine Name
     if (wlm_arrval($_POST, 'spreedlyname')) {
         $_POST['spreedlyname'] = trim(wlm_arrval($_POST, 'spreedlyname'));
         $this->SaveOption('spreedlyname', $_POST['spreedlyname']);
         echo "<div class='updated fade'>" . __('<p>Site Name Changed.</p>', 'wishlist-member') . "</div>";
     }
     $spreedlythankyou_url = $wpm_scregister . $spreedlythankyou;
     $spreedlytoken = $this->GetOption('spreedlytoken');
     $spreedlyname = $this->GetOption('spreedlyname');
     $for_approval_registration = $this->GetOption('wlm_for_approval_registration');
     if (!$for_approval_registration) {
         $for_approval_registration = array();
     } else {
         $for_approval_registration = unserialize($for_approval_registration);
     }
     $regurl = WLMREGISTERURL;
     // END Initialization
 } else {
コード例 #5
0
            $_POST['genericthankyou'] = trim(wlm_arrval($_POST, 'genericthankyou'));
            $wpmx = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['genericthankyou']));
            if ($wpmx == $_POST['genericthankyou']) {
                if ($this->RegURLExists($wpmx, null, 'genericthankyou')) {
                    echo "<div class='error fade'>" . __('<p><b>Error:</b> Post to URL (' . $wpmx . ') is already in use by a Membership Level or another Shopping Cart.  Please try a different one.</p>', 'wishlist-member') . "</div>";
                } else {
                    $this->SaveOption('genericthankyou', $genericthankyou = $wpmx);
                    echo "<div class='updated fade'>" . __('<p>Post To URL Changed.</p>', 'wishlist-member') . "</div>";
                }
            } else {
                echo "<div class='error fade'>" . __('<p><b>Error:</b> Post To URL may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
            }
        }
        // save Secret Key
        if (wlm_arrval($_POST, 'genericsecret')) {
            $_POST['genericsecret'] = trim(wlm_arrval($_POST, 'genericsecret'));
            $wpmy = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['genericsecret']));
            if ($wpmy == $_POST['genericsecret']) {
                $this->SaveOption('genericsecret', $genericsecret = $wpmy);
                echo "<div class='updated fade'>" . __('<p>Secret Key Changed.</p>', 'wishlist-member') . "</div>";
            } else {
                echo "<div class='error fade'>" . __('<p><b>Error:</b> Secret key may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
            }
        }
        $genericthankyou_url = $wpm_scregister . $genericthankyou;
        // END Initialization
    } else {
        // START Interface
        ?>
		<!-- Generic -->
		<p><?php 
コード例 #6
0
 /**
  * Check if the current Registration URL
  * is a Fallback URL
  *
  * A fallback Registration URL allows the user
  * to enter the email address he used for payment
  * to proceed with his incomplete registration
  *
  * @param string $reg value of $_GET['reg']
  */
 function IsFallBackURL($reg)
 {
     $reg = explode('/', $reg, 3);
     $hash = wlm_arrval($reg, 0);
     $time = wlm_arrval($reg, 1);
     $fallback = wlm_arrval($reg, 2);
     if ($fallback == 'fallback') {
         $expire = $time + 3600;
         if ($expire > time()) {
             if ($hash == md5($_SERVER['REMOTE_ADDR'] . '__' . $time . '__' . $this->GetAPIKey())) {
                 return true;
             }
         }
     }
     return false;
 }
 GENERAL PROGRAM NOTES: (This script was based on Mike's Autoresponder integrations.)
 Purpose: This is the UI part of the code. This is displayed as the admin area for Infusionsoft Integration in WLM Dashboard.
 Location: admin/
 Calling program : integration.autoresponder.php
 Logic Flow:
 1. integration.autoresponder.php displays this script (integration.autoresponder.infusionsoft.php)
 and displays current or default settings
 2. on user update, this script submits value to integration.autoresponder.php, which in turn save the value
 3. after saving the values, integration.autoresponder.php call this script again with $wpm_levels contains the membership levels and $data contains the Infusionsoft Integration settings for each membership level.
*/
$__index__ = 'infusionsoft';
$__ar_options__[$__index__] = 'Infusionsoft';
$__ar_videotutorial__[$__index__] = wlm_video_tutorial('integration', 'ar', $__index__);
require_once $this->pluginDir . '/lib/integration.autoresponder.infusionsoft.php';
if ($data['ARProvider'] == $__index__) {
    if (wlm_arrval($_POST, 'update_ifauto')) {
        $tagsSelections = array();
        foreach ((array) $wpm_levels as $sku => $level) {
            $n = 'auto_istag_add_app' . $sku;
            if (isset($_POST[$n])) {
                $tagsSelections[$sku] = $_POST[$n];
            }
        }
        $istags = maybe_serialize($tagsSelections);
        $this->SaveOption('auto_istags_add_app', $istags);
        $tagsSelections = array();
        foreach ((array) $wpm_levels as $sku => $level) {
            $n = 'auto_istag_add_rem' . $sku;
            if (isset($_POST[$n])) {
                $tagsSelections[$sku] = $_POST[$n];
            }
コード例 #8
0
			<?php 
if ($this->GetAllSavedSearch()) {
    ?>
				<select style="width: 130px; vertical-align: top;" id="save-search" onchange="top.location = this.value">
					<option value="">Saved Searches</option>
					<?php 
    foreach ($this->GetAllSavedSearch() as $value) {
        ?>
						<option value="?page=<?php 
        echo $this->MenuID;
        ?>
&wl=members&<?php 
        echo http_build_query($value['value']);
        ?>
" <?php 
        if (wlm_arrval($_GET, 'saved_search') == $value['name']) {
            echo " selected='true'";
        }
        ?>
><?php 
        echo $value['name'];
        ?>
</option>
					<?php 
    }
    ?>
				</select>
			<?php 
}
?>
		</p>
コード例 #9
0
} else {
    if ($this->GetOption('WLM_BroadcastLog') == 1) {
        $log = true;
    } else {
        $log = false;
    }
}
//check if old stat is missing
$isold_missing = $this->IsEmailBroadcastMissingStats();
if ($isold_missing) {
    $this->EmailBroadcastSyncStat();
}
//get the number of emails in queue
$email_queue_count = $this->GetEmailBroadcastQueue(null, false, false, 0, true);
/* variables for page numbers */
$pagenum = isset($_GET['pagenum']) ? absint(wlm_arrval($_GET, 'pagenum')) : 0;
if (empty($pagenum)) {
    $pagenum = 1;
}
$per_page = 20;
$start = $pagenum == '' || $pagenum < 0 ? 0 : ($pagenum - 1) * $per_page;
$broadcast_emails = $this->GetALLEmailbroadcast(false, $start, $per_page);
$emails_count = $this->GetALLEmailbroadcast(true);
/* Prepare pagination */
$num_pages = ceil($emails_count / $per_page);
$page_links = paginate_links(array('base' => add_query_arg('pagenum', '%#%'), 'format' => '', 'prev_text' => __('&laquo;'), 'next_text' => __('&raquo;'), 'total' => $num_pages, 'current' => $pagenum));
?>
<h2>
	<?php 
_e('Members &raquo; Email Broadcast', 'wishlist-member');
?>
コード例 #10
0
     }
     $istags = maybe_serialize($tagsSelections);
     $this->SaveOption('istags_cancelled_app', $istags);
     $tagsSelections = array();
     foreach ((array) $wpm_levels as $sku => $level) {
         $n = 'istag_cancelled_rem' . $sku;
         if (isset($_POST[$n])) {
             $tagsSelections[$sku] = $_POST[$n];
         }
     }
     $istags = maybe_serialize($tagsSelections);
     $this->SaveOption('istags_cancelled_rem', $istags);
     echo "<div class='updated fade'>" . __('<p>Membership Level tag settings updated.</p>', 'wishlist-member') . "</div>";
 }
 //pay per post tag settings
 if (wlm_arrval($_POST, 'update_tags_pp')) {
     $posts = $this->GetPayPerPosts(array('post_title', 'post_type'), false);
     $istagspp_add_app = array();
     $istagspp_add_rem = array();
     $istagspp_remove_app = array();
     $istagspp_remove_rem = array();
     foreach ($posts as $post) {
         $sku = 'payperpost-' . $post->ID;
         $n = 'istagpp_add_app' . $sku;
         if (isset($_POST[$n])) {
             $istagspp_add_app[$sku] = $_POST[$n];
         }
         $n = 'istagpp_add_rem' . $sku;
         if (isset($_POST[$n])) {
             $istagspp_add_rem[$sku] = $_POST[$n];
         }
コード例 #11
0
            $_POST['ultracartthankyou'] = trim(wlm_arrval($_POST, 'ultracartthankyou'));
            $wpmx = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['ultracartthankyou']));
            if ($wpmx == $_POST['ultracartthankyou']) {
                if ($this->RegURLExists($wpmx, null, 'ultracartthankyou')) {
                    echo "<div class='error fade'>" . __('<p><b>Error:</b> Post to URL (' . $wpmx . ') is already in use by a Membership Level or another Shopping Cart.  Please try a different one.</p>', 'wishlist-member') . "</div>";
                } else {
                    $this->SaveOption('ultracartthankyou', $ultracartthankyou = $wpmx);
                    echo "<div class='updated fade'>" . __('<p>Post To URL Changed.</p>', 'wishlist-member') . "</div>";
                }
            } else {
                echo "<div class='error fade'>" . __('<p><b>Error:</b> Post To URL may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
            }
        }
        // save Secret Key
        if (wlm_arrval($_POST, 'ultracartsecret')) {
            $_POST['ultracartsecret'] = trim(wlm_arrval($_POST, 'ultracartsecret'));
            $wpmy = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['ultracartsecret']));
            if ($wpmy == $_POST['ultracartsecret']) {
                $this->SaveOption('ultracartsecret', $ultracartsecret = $wpmy);
                echo "<div class='updated fade'>" . __('<p>Secret Key Changed.</p>', 'wishlist-member') . "</div>";
            } else {
                echo "<div class='error fade'>" . __('<p><b>Error:</b> Secret key may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
            }
        }
        $ultracartthankyou_url = $wpm_scregister . $ultracartthankyou;
        // END Initialization
    } else {
        // START Interface
        ?>
		<!-- UltraCart -->
		<blockquote>
コード例 #12
0
                $date = date("F j, Y, h:i:s A");
                $logfile = ABSPATH . $icID[$key] . ".txt";
                if (file_exists($logfile)) {
                    $logfilehandler = fopen($logfile, 'a');
                } else {
                    $logfilehandler = fopen($logfile, 'w');
                }
                if (!$logfilehandler) {
                    echo "<div class='error fade'>" . __('<p>Error Creating Log File. Please check folder permission or manually create the file ' . ABSPATH . $logfile . '</p>', 'wishlist-member') . "</div>";
                } else {
                    fclose($logfilehandler);
                }
            }
        }
        if (isset($_GET['action']) == 'clear' && isset($_GET['level']) != "" && !isset($_POST['update_icontact'])) {
            $logfile = ABSPATH . $icID[wlm_arrval($_GET, 'level')] . ".txt";
            if (file_exists($logfile)) {
                $logfilehandler = fopen($logfile, 'w');
            }
            if (!$logfilehandler) {
                echo "<div class='error fade'>" . __('<p>Error Clearing Log File. Please check folder permission or manually clear the file ' . ABSPATH . $logfile . '</p>', 'wishlist-member') . "</div>";
            } else {
                echo "<div class='error fade'>" . __('<p>Successfully cleared the file ' . ABSPATH . $logfile . '</p>', 'wishlist-member') . "</div>";
                fclose($logfilehandler);
            }
        }
        ?>
		<form method="post">
			<input type="hidden" name="saveAR" value="saveAR" />
			<h2 class="wlm-integration-steps"><?php 
        _e('Step 1. Create your iContact Integration Password', 'wishlist-member');
 function OneShoppingCart($that)
 {
     if (in_array(strtolower(trim(wlm_arrval($_POST, 'status'))), array('accepted', 'approved', 'authorized', 'pending'))) {
         //accept even PENDING, let checkstatus handle it later
         //				add_filter('rewrite_rules_array',array(&$that,'RewriteRules'));
         //				$GLOBALS['wp_rewrite']->flush_rules();
         if (!trim(wlm_arrval($_POST, 'name'))) {
             $_POST['name'] = 'Firstname Lastname';
         }
         $name = explode(' ', $_POST['name']);
         $_POST['lastname'] = array_pop($name);
         $_POST['firstname'] = implode(' ', $name);
         $_POST['action'] = 'wpm_register';
         $_POST['wpm_id'] = $_POST['sku1'];
         $_POST['username'] = $_POST['email1'];
         $orig_email = $_POST['email'] = $_POST['email1'];
         $_POST['password1'] = $_POST['password2'] = $that->PassGen();
         $address = array();
         $address['company'] = $_POST['shipCompany'];
         $address['address1'] = $_POST['shipAddress1'];
         $address['address2'] = $_POST['shipAddress2'];
         $address['city'] = $_POST['shipCity'];
         $address['state'] = $_POST['shipState'];
         $address['zip'] = $_POST['shipZip'];
         $address['country'] = $_POST['shipCountry'];
         $_POST['sctxnid'] = $_POST['orderID'];
         $_POST['wpm_useraddress'] = $address;
         //cache the order
         $onescmerchantid = trim($that->GetOption('onescmerchantid'));
         $onescapikey = trim($that->GetOption('onescapikey'));
         if ($onescmerchantid && $onescapikey) {
             require_once $that->pluginDir . '/extlib/OneShopAPI.php';
             require_once $that->pluginDir . '/extlib/WLMOneShopAPI.php';
             $api = new WLMOneShopAPI($onescmerchantid, $onescapikey, 'https://www.mcssl.com');
             $order = $api->get_order_by_id($_POST['orderID'], true);
             $that->SaveOption("1scorder_" . $_POST['orderID'], $order);
         }
         // support 1SC upsells
         if (trim($that->GetOption('onesc_include_upsells'))) {
             if (count($order['upsells'])) {
                 $_POST['additional_levels'] = $order['upsells'];
             }
         }
         $that->ShoppingCartRegistration();
     } else {
         $onescmerchantid = trim($that->GetOption('onescmerchantid'));
         $onescapikey = trim($that->GetOption('onescapikey'));
         if ($onescmerchantid && $onescapikey) {
             $raw_post_data = file_get_contents('php://input');
             require_once $that->pluginDir . '/extlib/OneShopAPI.php';
             $API = new OneShopAPI($that->GetOption('onescmerchantid'), $that->GetOption('onescapikey'), 'https://www.mcssl.com');
             $requestBodyXML = new DOMDocument();
             # Load the request body into XML and check that the result has been parsed into XML
             if ($requestBodyXML->loadXML($raw_post_data) == true) {
                 $notificationType = $requestBodyXML->documentElement->nodeName;
                 $tokenNode = $requestBodyXML->getElementsByTagName('Token')->item(0)->nodeValue;
                 switch ($notificationType) {
                     case "NewOrder":
                         $apiResult = $API->GetOrderById($tokenNode);
                         break;
                     default:
                         # May have other types of notifications in the future
                         break;
                 }
                 $apiResultXML = new DOMDocument();
                 if ($apiResultXML->loadXML($apiResult) == true) {
                     # Check if the API returned an error
                     $apiSuccess = $apiResultXML->getElementsByTagName('Response')->item(0)->getAttribute('success');
                     if ($apiSuccess == 'true') {
                         $orderXML =& $apiResultXML;
                         $sku = $orderXML->getElementsByTagName('Sku')->item(0)->nodeValue;
                         $status = strtolower($orderXML->getElementsByTagName('OrderStatusType')->item(0)->nodeValue);
                         $levels = array_keys($that->GetOption('wpm_levels'));
                         $_POST['sctxnid'] = $orderXML->getElementsByTagName('OrderId')->item(0)->nodeValue;
                         if ($status == 'accepted') {
                             $that->ShoppingCartReactivate();
                             // Add hook for Shoppingcart reactivate so that other plugins can hook into this
                             $_POST['sc_type'] = '1ShoppingCart';
                             do_action('wlm_shoppingcart_rebill', $_POST);
                         } else {
                             $that->ShoppingCartDeactivate();
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #14
0
         $this->SaveOption('recurlyapikey', $recurlyapikey);
     }
     if (wlm_arrval($_POST, 'connections')) {
         $connections = $_POST['connections'];
         foreach ($connections as $i => $k) {
             if (!empty($k) && $recurlyconnections[$i] != $k) {
                 //changed so re-integrate
                 $url = $recurlythankyou_url . "?act=reg&amp;account_code={{account_code}}&amp;plan_code={{plan_code}}";
                 $client->update_plan($k, array('success_url' => $url, 'accounting_code' => $i));
             }
         }
         $recurlyconnections = $connections;
         $this->SaveOption('recurlyconnections', $recurlyconnections);
     }
     if (wlm_arrval($_POST, 'recurlythankyou')) {
         $_POST['recurlythankyou'] = trim(wlm_arrval($_POST, 'recurlythankyou'));
         $wpmx = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['recurlythankyou']));
         if ($wpmx == $_POST['recurlythankyou']) {
             if ($this->RegURLExists($wpmx, null, 'recurlythankyou')) {
                 echo "<div class='error fade'>" . __('<p><b>Error:</b> Post to URL (' . $wpmx . ') is already in use by a Membership Level or another Shopping Cart.  Please try a different one.</p>', 'wishlist-member') . "</div>";
             } else {
                 $this->SaveOption('recurlythankyou', $recurlythankyou = $wpmx);
                 echo "<div class='updated fade'>" . __('<p>Post To URL Changed.</p>', 'wishlist-member') . "</div>";
             }
         } else {
             echo "<div class='error fade'>" . __('<p><b>Error:</b> Post To URL may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
         }
     }
     // END Initialization
 } else {
     // START Interface
コード例 #15
0
 function widget($args = array(), $instance = array())
 {
     global $WishListMemberInstance;
     // If $instance is false then this means that the widget is being called directly by other functions
     // We then set the $instance
     $is_active = is_active_widget(false, false, 'wishlistwidget', true);
     if (!$instance) {
         // If there are active WLM widgets, we get the settings of the first one
         if ($is_active) {
             $wlm_widget_settings = get_option('widget_wishlistwidget');
             foreach ((array) $wlm_widget_settings as $setting) {
                 $instance['wpm_widget_hiderss'] = $setting['wpm_widget_hiderss'];
                 $instance['wpm_widget_hideregister'] = $setting['wpm_widget_hideregister'];
                 $instance['wpm_widget_nologinbox'] = $setting['wpm_widget_nologinbox'];
                 $instance['wpm_widget_hidelevels'] = $setting['wpm_widget_hidelevels'];
                 $instance['wpm_widget_fieldwidth'] = $setting['wpm_widget_fieldwidth'];
                 break;
             }
         } else {
             // If no WLM widget active then set default settings.
             $instance['wpm_widget_hiderss'] = 0;
             $instance['wpm_widget_hideregister'] = 0;
             $instance['wpm_widget_nologinbox'] = 0;
             $instance['wpm_widget_hidelevels'] = 0;
             $instance['wpm_widget_fieldwidth'] = 0;
         }
     }
     extract($args);
     $wpm_levels = $WishListMemberInstance->GetOption('wpm_levels');
     $wpm_current_user = wp_get_current_user();
     if ($instance['wpm_widget_nologinbox'] != 1 || $wpm_current_user->ID) {
         if (!wlm_arrval($_GET, 'reg')) {
             $output = '';
             if (!$return) {
                 echo $before_widget . $before_title;
                 if ($wpm_current_user->ID) {
                     if (isset($args["title"])) {
                         echo $args["title"];
                     } else {
                         echo $instance['title'];
                     }
                 } else {
                     if (isset($args["title2"])) {
                         echo $args["title2"];
                     } else {
                         echo $instance['title2'];
                     }
                 }
                 echo $after_title;
                 echo "<div id='wlmember_loginwidget'>";
             }
             if ($wpm_current_user->ID) {
                 $name = $wpm_current_user->first_name;
                 if (!$name) {
                     $name = $wpm_current_user->user_nicename;
                 }
                 if (!$name) {
                     $name = $wpm_current_user->user_login;
                 }
                 $output .= '<p>' . trim(sprintf(__('Welcome %1$s', 'wishlist-member'), $name)) . '</p>';
                 $levels = $WishListMemberInstance->GetMembershipLevels($wpm_current_user->ID, null, null, null, true);
                 $inactivelevels = $WishListMemberInstance->GetMemberInactiveLevels($wpm_current_user->ID);
                 sort($levels);
                 // <- we sort the levels
                 if (!$instance['wpm_widget_hidelevels']) {
                     $clevels = count($levels);
                     if ($clevels) {
                         //	$output.=__("&raquo; Level", "&raquo; Levels", $clevels, 'wishlist-member');
                         if ($clevels == 1) {
                             $output .= __("&raquo; Level", 'wishlist-member');
                         } else {
                             $output .= __("&raquo; Levels", 'wishlist-member');
                         }
                         $output .= ': ';
                         if ($clevels > 1) {
                             $output .= '<br /><div id="" style="margin-left:1em">';
                         }
                         $morelevels = false;
                         $maxmorelevels = $return ? 1000000000 : 2;
                         for ($i = 0; $i < $clevels; $i++) {
                             if ($i > $maxmorelevels && !$morelevels) {
                                 $output .= '<div id="wlm_morelevels" style="display:none">';
                                 $morelevels = true;
                             }
                             if ($clevels > 1) {
                                 $output .= '&middot; ';
                             }
                             $strike = '';
                             if (in_array($levels[$i], $inactivelevels)) {
                                 $output .= '<strike>';
                                 $strike = '</strike>';
                             }
                             $output .= $wpm_levels[$levels[$i]]['name'];
                             $output .= $strike;
                             $output .= '<br />';
                         }
                         if ($morelevels) {
                             $output .= '</div>';
                             $output .= '&middot; <label style="cursor:pointer;" onclick="wlmml=document.getElementById(\'wlm_morelevels\');wlmml.style.display=wlmml.style.display==\'none\'?\'block\':\'none\';this.innerHTML=wlmml.style.display==\'none\'?\'' . __('More levels', 'wishlist-member') . ' <small>&nabla;</small>\':\'' . __('Less levels', 'wishlist-member') . ' <small>&Delta;</small>\';this.blur()">' . __('More levels', 'wishlist-member') . ' <small>&nabla;</small></label>';
                         }
                         if ($clevels > 1) {
                             $output .= '</div>';
                         }
                     }
                 }
                 if ($WishListMemberInstance->GetOption('members_can_update_info')) {
                     $output .= '&raquo; <a href="' . get_bloginfo('wpurl') . '/wp-admin/profile.php">' . __('Membership Details', 'wishlist-member') . '</a><br />';
                 }
                 if ($instance['wpm_widget_hiderss'] != 1) {
                     $output .= '&raquo; <a href="' . get_bloginfo('rss2_url') . '">' . __('RSS Feed', 'wishlist-member') . '</a><br />';
                 }
                 if (function_exists('wp_logout_url')) {
                     // $logout = wp_logout_url(get_bloginfo('url'));
                     $logout = wp_logout_url();
                     if ($WishListMemberInstance->GetOption('enable_logout_redirect_override')) {
                         $logout = wp_nonce_url(site_url('wp-login.php?action=logout', 'login'), 'log-out');
                     }
                 } else {
                     // $logout = wp_nonce_url(site_url('wp-login.php?action=logout&redirect_to=' . urlencode(get_bloginfo('url')), 'login'), 'log-out');
                     $logout = wp_nonce_url(site_url('wp-login.php?action=logout', 'login'), 'log-out');
                 }
                 $output .= '&raquo; <a href="' . $logout . '">' . __('Logout', 'wishlist-member') . '</a><br />';
                 if ($return) {
                     return $output;
                 }
                 echo $output;
             } else {
                 $register = $WishListMemberInstance->GetOption('non_members_error_page_internal');
                 $register = $register ? get_permalink($register) : $WishListMemberInstance->GetOption('non_members_error_page');
                 $widget_fieldwidth = (int) $instance['wpm_widget_fieldwidth'];
                 $login_url = esc_url(site_url('wp-login.php', 'login_post'));
                 if (!$widget_fieldwidth) {
                     $widget_fieldwidth = 15;
                 }
                 echo '<form method="post" action="' . $login_url . '"><p>' . __('You are not currently logged in.', 'wishlist-member') . '</p>';
                 echo '<label>' . __('Username', 'wishlist-member') . ':<br /><input class="wlmember_loginwidget_input_username"  type="text" name="log" size="' . $widget_fieldwidth . '" /></label><br />';
                 echo '<label>' . __('Password', 'wishlist-member') . ':<br /><input class="wlmember_loginwidget_input_password" type="password" name="pwd" size="' . $widget_fieldwidth . '" /></label><br />';
                 echo '<label><input  class="wlmember_loginwidget_input_checkrememberme" type="checkbox" name="rememberme" value="forever" /> ' . __('Remember Me', 'wishlist-member') . '</label><br />';
                 echo '<input class="wlmember_loginwidget_input_submit" type="submit" name="wp-submit" value="' . __('Login', 'wishlist-member') . '" /><br /><br />';
                 if ($instance['wpm_widget_hideregister'] != 1) {
                     echo '&raquo; <a href="' . $register . '">' . __('Register', 'wishlist-member') . '</a><br />';
                 }
                 echo '&raquo; <a href="' . wp_login_url() . '?action=lostpassword">' . __('Lost your Password?', 'wishlist-member') . '</a>';
                 $redirect = !empty($_GET['wlfrom']) ? esc_attr(stripslashes($_GET['wlfrom'])) : 'wishlistmember';
                 echo '<input type="hidden" name="wlm_redirect_to" value="' . $redirect . '" />';
                 echo '<input type="hidden" name="redirect_to" value="' . $redirect . '" /></form>';
             }
             if (!$return) {
                 echo "</div>";
                 echo $after_widget;
             }
         }
     }
 }
コード例 #16
0
}
?>
			<a class="regform-close" href=""></a>
		</div>


		<div class="regform-error">
			<p>
			<?php 
if (isset($_GET['status']) && $_GET['status'] == 'fail') {
    echo __("An error has occured while processing payment, please try again", "wishlist-member");
}
?>
			<?php 
if (!empty($_GET['reason'])) {
    echo '<br/>Reason: ' . strip_tags(wlm_arrval($_GET, 'reason'));
}
?>
			</p>
		</div>
		
		<form action="<?php 
echo $thankyouurl;
?>
" id="myCCForm-<?php 
echo $sku;
?>
" class="regform-logged <?php 
echo $class;
?>
" method="post" onsubmit="return false" >
コード例 #17
0
<?php

/*
 * SamCart Shopping Cart Integration
 * Original Author : Mike Lopez
 * Version: $Id: integration.shoppingcart.samcart.php 2389 2014-10-22 15:59:18Z mike $
 */
$__index__ = 'samcart';
$__sc_options__[$__index__] = 'SamCart';
$__sc_videotutorial__[$__index__] = wlm_video_tutorial('integration', 'sc', $__index__);
if (wlm_arrval($_GET, 'cart') == $__index__) {
    if ($__INTERFACE__) {
        // START Interface
        ?>
		<h2 class="wlm-integration-steps"><?php 
        _e('API Credentials', 'wishlist-member');
        ?>
</h2>
		<p>
			<?php 
        _e('Copy and paste the information below to your SamCart account under<br><strong>Settings &raquo; Membership Portal Integration &raquo; WishList Member</strong>', 'wishlist-member');
        ?>
		</p>
		<h3>Blog URL</h3>
		<blockquote>
		<input type="text" value="<?php 
        echo admin_url();
        ?>
" size="60" readonly="readonly" onclick="this.select()" />
		</blockquote>
 * Version: $Id: integration.shoppingcart.authorize-arb.php 2479 2014-12-06 03:29:04Z mike $
 */
$__index__ = 'authorizenet_arb';
$__sc_options__[$__index__] = 'Authorize.Net - Automatic Recurring Billing';
//$__sc_affiliates__[$__index__] = '#';
$__sc_videotutorial__[$__index__] = wlm_video_tutorial('integration', 'sc', $__index__);
if (wlm_arrval($_GET, 'cart') == $__index__) {
    if (!$__INTERFACE__) {
        // BEGIN Initialization
        $anetarbthankyou = $this->GetOption('anetarbthankyou');
        if (!$anetarbthankyou) {
            $this->SaveOption('anetarbthankyou', $anetarbthankyou = $this->MakeRegURL());
        }
        // save POST URL
        if (wlm_arrval($_POST, 'anetarbthankyou')) {
            $_POST['anetarbthankyou'] = trim(wlm_arrval($_POST, 'anetarbthankyou'));
            $wpmx = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['anetarbthankyou']));
            if ($wpmx == $_POST['anetarbthankyou']) {
                if ($this->RegURLExists($wpmx, null, 'anetarbthankyou')) {
                    echo "<div class='error fade'>" . __('<p><b>Error:</b> authorize.net arb Thank You URL (' . $wpmx . ') is already in use by a Membership Level or another Shopping Cart.  Please try a different one.</p>', 'wishlist-member') . "</div>";
                } else {
                    $this->SaveOption('anetarbthankyou', $anetarbthankyou = $wpmx);
                    echo "<div class='updated fade'>" . __('<p>Thank You URL Changed.&nbsp; Make sure to update authorize.net arb with the same Thank You URL to make it work.</p>', 'wishlist-member') . "</div>";
                }
            } else {
                echo "<div class='error fade'>" . __('<p><b>Error:</b> Thank You URL may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
            }
        }
        if (isset($_POST['anetarbsettings'])) {
            $anetarbsettings = $_POST['anetarbsettings'];
            $this->SaveOption('anetarbsettings', $anetarbsettings);
コード例 #19
0
<?php

$h2text = __('Settings &raquo; Registration Page', 'wishlist-member');
switch (wlm_arrval($_GET, 'mode2')) {
    case 'css':
        printf("<h2>{$h2text} &raquo; %s</h2>", __('Custom CSS', 'wishlist-member'));
        include $this->pluginDir . '/admin/settings.registration.css.php';
        include_once $this->pluginDir . '/admin/tooltips/settings.registration.css.tooltips.php';
        break;
    case 'custom':
        printf("<h2>{$h2text} &raquo; %s</h2>", __('Custom Registration Forms', 'wishlist-member'));
        include $this->pluginDir . '/admin/settings.registration.custom.php';
        include_once $this->pluginDir . '/admin/tooltips/settings.registration.custom.tooltips.php';
        break;
    case 'redbox':
        printf("<h2>{$h2text} &raquo; %s</h2>", __('Signup Text', 'wishlist-member'));
        include $this->pluginDir . '/admin/settings.registration.redbox.php';
        include_once $this->pluginDir . '/admin/tooltips/settings.registration.redbox.tooltips.php';
        break;
    case 'recaptcha':
        printf("<h2>{$h2text} &raquo; %s</h2>", __('reCaptcha Settings', 'wishlist-member'));
        include $this->pluginDir . '/admin/settings.registration.recaptcha.php';
        include_once $this->pluginDir . '/admin/tooltips/settings.registration.recaptcha.tooltips.php';
        break;
    case '':
        printf("<h2>{$h2text} &raquo; %s</h2>", __('Header/Footer', 'wishlist-member'));
        include $this->pluginDir . '/admin/settings.registration.php';
        include_once $this->pluginDir . '/admin/tooltips/settings.registration.tooltips.php';
        break;
}
コード例 #20
0
?>
 value="incomplete"><?php 
_e('Incomplete Registrations', 'wishlist-member');
?>
 (<?php 
echo $incomplete_count;
?>
)</option>
								<?php 
foreach ((array) $wpm_levels as $id => $level) {
    ?>
									<option value="<?php 
    echo $id;
    ?>
" <?php 
    if (wlm_arrval($_GET, 'level') == $id) {
        echo " selected='true'";
    }
    ?>
><?php 
    echo $level['name'];
    ?>
 (<?php 
    echo (int) $level['count'];
    ?>
)</option>
								<?php 
}
?>
								</select>
							</td>
コード例 #21
0
            $_POST['cydecthankyou'] = trim(wlm_arrval($_POST, 'cydecthankyou'));
            $wpmx = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['cydecthankyou']));
            if ($wpmx == $_POST['cydecthankyou']) {
                if ($this->RegURLExists($wpmx, null, 'cydecthankyou')) {
                    echo "<div class='error fade'>" . __('<p><b>Error:</b> Post To URL (' . $wpmx . ') is already in use by a Membership Level or another Shopping Cart.  Please try a different one.</p>', 'wishlist-member') . "</div>";
                } else {
                    $this->SaveOption('cydecthankyou', $cydecthankyou = $wpmx);
                    echo "<div class='updated fade'>" . __('<p>Post To URL Changed.&nbsp; Make sure to update Cydec with the same Post To URL to make it work.</p>', 'wishlist-member') . "</div>";
                }
            } else {
                echo "<div class='error fade'>" . __('<p><b>Error:</b> Post To URL may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
            }
        }
        // save Secret Key
        if (wlm_arrval($_POST, 'cydecsecret')) {
            $_POST['cydecsecret'] = trim(wlm_arrval($_POST, 'cydecsecret'));
            $wpmy = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['cydecsecret']));
            if ($wpmy == $_POST['cydecsecret']) {
                $this->SaveOption('cydecsecret', $cydecsecret = $wpmy);
                echo "<div class='updated fade'>" . __('<p>Secret Key Changed.&nbsp; Make sure to update Cydec with the same Secret key to make it work.</p>', 'wishlist-member') . "</div>";
            } else {
                echo "<div class='error fade'>" . __('<p><b>Error:</b> Secret key may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
            }
        }
        $cydecthankyou_url = $wpm_scregister . $cydecthankyou;
        // END Initialization
    } else {
        // START Interface
        ?>
		<!-- Cydec / Quick Pay Pro -->
		<blockquote>
コード例 #22
0
        public function wlm_stripe_profile($atts)
        {
            global $WishListMemberInstance;
            global $current_user;
            $stripepublishablekey = $WishListMemberInstance->GetOption('stripepublishablekey');
            $stripethankyou = $WishListMemberInstance->GetOption('stripethankyou');
            $wpm_scregister = get_bloginfo('url') . '/index.php/register/';
            $stripethankyou_url = $wpm_scregister . $stripethankyou;
            if (empty($current_user->ID)) {
                return null;
            }
            wp_enqueue_style('wlm-stripe-profile-style', $WishListMemberInstance->pluginURL . '/extlib/wlm_stripe/css/stripe-profile.css', '', $WishListMemberInstance->Version);
            wp_enqueue_style('stripe-paymenttag-style', $WishListMemberInstance->pluginURL . '/extlib/wlm_stripe/css/stripe-paymenttag.css', '', $WishListMemberInstance->Version);
            wp_enqueue_script('stripe-paymenttag', $WishListMemberInstance->pluginURL . '/extlib/wlm_stripe/js/stripe-paymenttag.js', array('jquery'), $WishListMemberInstance->Version, true);
            wp_enqueue_script('leanModal', $WishListMemberInstance->pluginURL . '/extlib/wlm_stripe/js/jquery.leanModal.js', array('jquery'), $WishListMemberInstance->Version, true);
            wp_enqueue_script('wlm-stripe-profile', $WishListMemberInstance->pluginURL . '/extlib/wlm_stripe/js/stripe.wlmprofile.js', array('stripe-paymenttag', 'leanModal'), $WishListMemberInstance->Version, true);
            $levels = $WishListMemberInstance->GetMembershipLevels($current_user->ID, null, null, null, true);
            $wpm_levels = $WishListMemberInstance->GetOption('wpm_levels');
            $user_posts = $WishListMemberInstance->GetUser_PayPerPost("U-" . $current_user->ID);
            $txnids = array();
            foreach ($wpm_levels as $id => $level) {
                $txn = $WishListMemberInstance->GetMembershipLevelsTxnID($current_user->ID, $id);
                if (empty($txn)) {
                    continue;
                }
                $txnids[$id]['txn'] = $txn;
                $txnids[$id]['level'] = $level;
                $txnids[$id]['level_id'] = $id;
                $txnids[$id]['type'] = 'membership';
            }
            foreach ($user_posts as $u) {
                $p = get_post($u->content_id);
                $id = 'payperpost-' . $u->content_id;
                $txn = $WishListMemberInstance->Get_ContentLevelMeta("U-" . $current_user->ID, $u->content_id, 'transaction_id');
                $txnids[$id]['txn'] = $txn;
                $txnids[$id]['level_id'] = $id;
                $txnids[$id]['type'] = 'post';
                $txnids[$id]['level'] = array('name' => $p->post_title);
            }
            $wlm_user = new WishListMemberUser($current_user->ID);
            ob_start();
            ?>
			<?php 
            if (isset($_GET['status'])) {
                ?>
				<?php 
                if (wlm_arrval($_GET, 'status') == 'ok') {
                    ?>
					<p><span class="stripe-success"><?php 
                    echo __("Profile Updated", "wishlist-member");
                    ?>
</span></p>
				<?php 
                } else {
                    ?>
					<span class="stripe-error"><?php 
                    echo __("Unable to update your profile, please try again", "wishlist-member");
                    ?>
</span>
				<?php 
                }
                ?>
			<?php 
            }
            ?>
			<?php 
            include $this->get_view_path('profile');
            $str = ob_get_clean();
            $str = preg_replace('/\\s+/', ' ', $str);
            return $str;
        }
コード例 #23
0
 function JVZoo($that)
 {
     $key = $that->GetOption('jvzoosecret');
     $jvzooproducts = array();
     $jvzooupsells_ttl = $that->GetOption('jvzooupsells_ttl');
     if (empty($jvzooupsells_ttl)) {
         $jvzooupsells_ttl = 60 * 60;
     }
     if ($this->ty_valid_req($key, $_GET)) {
         // check if product ID (item) is in cbproducts
         // if so, return the level for that product ID
         // if not, use $_GET['sku']
         $postedid = $_GET['item'];
         $wpm_levels = (array) $that->GetOption('wpm_levels');
         foreach ((array) $wpm_levels as $sku => $level) {
             if (in_array($postedid, $jvzooproducts[$sku])) {
                 $level_id = $sku;
                 break;
             }
         }
         if (empty($level_id)) {
             $xposts = $that->GetPayPerPosts(array('post_title', 'post_type'));
             foreach ($xposts as $post_type => $posts) {
                 foreach ($posts as $post) {
                     if (in_array($postedid, $jvzooproducts['payperpost-' . $post->ID])) {
                         $level_id = 'payperpost-' . $post->ID;
                         break;
                     }
                 }
             }
         }
         $_POST['wpm_id'] = empty($level_id) ? $_GET['sku'] : $level_id;
         $user_id = $that->GetUserIDFromTxnID(wlm_arrval($_GET, 'cbreceipt'));
         if ($user_id) {
             if (!$that->IsTempUser($user_id)) {
                 header('Location:' . $that->GetRegistrationURL($_POST['wpm_id'], true, $dummy) . '&registered=1');
                 exit;
             }
         }
         if (!trim(wlm_arrval($_GET, 'cname'))) {
             $_GET['cname'] = 'Firstname Lastname';
         }
         $name = explode(' ', $_GET['cname']);
         $_POST['lastname'] = array_pop($name);
         $_POST['firstname'] = implode(' ', $name);
         $_POST['action'] = 'wpm_register';
         $_POST['username'] = $_GET['cemail'];
         $_POST['email'] = $_GET['cemail'];
         $_POST['password1'] = $_POST['password2'] = $that->PassGen();
         $_POST['sctxnid'] = $_GET['cbreceipt'];
         /*
          * send upsells as additional levels
          */
         $receipt = empty($_GET['cupsellreceipt']) ? $_GET['cbreceipt'] : $_GET['cupsellreceipt'];
         $transient_name = 'jvzoo_upsells_' . $receipt;
         $registered_levels = get_transient($transient_name);
         if (!empty($registered_levels)) {
             $_POST['additional_levels'] = $registered_levels;
         }
         $that->ShoppingCartRegistration();
     } else {
         $post_vars = $this->extract_cb_postvars($_POST);
         error_log('status ' . serialize($this->ipn_verified($key, $post_vars)));
         if ($this->ipn_verified($key, $post_vars)) {
             // Is this necessary??
             if ($this->is_v2($post_vars)) {
                 $_POST['lastname'] = $post_vars['ccustlastname'];
                 $_POST['firstname'] = $post_vars['ccustfirstname'];
             } else {
                 if (!trim($post_vars['ccustname'])) {
                     $post_vars['ccustname'] = 'Firstname Lastname';
                 }
                 $name = explode(' ', $_REQUEST['ccustname']);
                 $_POST['lastname'] = array_pop($name);
                 $_POST['firstname'] = implode(' ', $name);
             }
             $_POST['action'] = 'wpm_register';
             // the passed sku...
             $passedparams = parse_str($post_vars['cvendthru']);
             // check if product ID (cproditem) is in cbproducts
             // if so, return the level for that product ID
             // if not, use $passedparams['sku']
             $postedid = $post_vars['cproditem'];
             $wpm_levels = (array) $that->GetOption('wpm_levels');
             foreach ((array) $wpm_levels as $sku => $level) {
                 if (in_array($postedid, $jvzooproducts[$sku])) {
                     $level_id = $sku;
                     break;
                 }
             }
             if (empty($level_id)) {
                 $xposts = $that->GetPayPerPosts(array('post_title', 'post_type'));
                 foreach ($xposts as $post_type => $posts) {
                     foreach ($posts as $post) {
                         if (in_array($postedid, $jvzooproducts['payperpost-' . $post->ID])) {
                             $level_id = 'payperpost-' . $post->ID;
                             break;
                         }
                     }
                 }
             }
             $_POST['wpm_id'] = empty($level_id) ? $passedparams['sku'] : $level_id;
             $_POST['username'] = $post_vars['ccustemail'];
             $_POST['email'] = $post_vars['ccustemail'];
             $_POST['sctxnid'] = $post_vars['ctransreceipt'];
             switch ($post_vars['ctransaction']) {
                 case 'SALE':
                 case 'TEST_SALE':
                     // we only save upsell info on sale in INS
                     $receipt = empty($post_vars['cupsellreceipt']) ? $post_vars['ctransreceipt'] : $post_vars['cupsellreceipt'];
                     $transient_name = 'jvzoo_upsells_' . $receipt;
                     $registered_levels = get_transient($transient_name);
                     if (empty($registered_levels)) {
                         $registered_levels = array();
                     }
                     $registered_levels[] = $_POST['wpm_id'] . "\t" . $post_vars['ctransreceipt'];
                     set_transient($transient_name, $registered_levels, $jvzooupsells_ttl);
                     break;
                 case 'BILL':
                     // we do nothing because registration is handled by the regular thank you url...
                 // we do nothing because registration is handled by the regular thank you url...
                 case 'UNCANCEL-REBILL':
                     $txn = $_POST['sctxnid'];
                     $items = explode("-", $txn);
                     $_POST['sctxnid'] = $items[0];
                     // Add hook for Shoppingcart reactivate so that other plugins can hook into this
                     $_POST['sc_type'] = 'jvzoo';
                     do_action('wlm_shoppingcart_rebill', $_POST);
                     $that->ShoppingCartReactivate();
                     break;
                 case 'RFND':
                 case 'CGBK':
                 case 'INSF':
                 case 'CANCEL-REBILL':
                 case 'CANCEL-TEST-REBILL':
                     $that->ShoppingCartDeactivate();
                     break;
             }
         }
     }
 }
        if (!$pwcapikey) {
            $this->SaveOption('pwcapikey', '');
        }
        if (wlm_arrval($_POST, 'pwcapikey')) {
            $_POST['pwcapikey'] = trim(wlm_arrval($_POST, 'pwcapikey'));
            if ($_POST['pwcapikey'] != $pwcapikey) {
                $this->SaveOption('pwcapikey', $pwcapikey = $_POST['pwcapikey']);
                echo "<div class='updated fade'>" . __('<p>API Key Updated.</p>', 'wishlist-member') . "</div>";
            }
        }
        $pwcmerchantid = $this->GetOption('pwcmerchantid');
        if (!$pwcmerchantid) {
            $this->SaveOption('pwcmerchantid', '');
        }
        if (wlm_arrval($_POST, 'pwcmerchantid')) {
            $_POST['pwcmerchantid'] = trim(wlm_arrval($_POST, 'pwcmerchantid'));
            if ($_POST['pwcmerchantid'] != $pwcmerchantid) {
                $this->SaveOption('pwcmerchantid', $pwcmerchantid = $_POST['pwcmerchantid']);
                echo "<div class='updated fade'>" . __('<p>Merchant ID Updated.</p>', 'wishlist-member') . "</div>";
            }
        }
        $pwcthankyou = $this->GetOption('pwcthankyou');
        if (!$pwcthankyou) {
            $this->SaveOption('pwcthankyou', $pwcthankyou = $this->MakeRegURL());
        }
        $pwcthankyou_url = $wpm_scregister . $pwcthankyou;
        // END Initialization
    } else {
        // START Interface
        ?>
		<!-- Premium Web Cart -->
コード例 #25
0
         }
     }
     // save Secret Key
     if (wlm_arrval($_POST, 'twocosecret')) {
         $_POST['twocosecret'] = trim(wlm_arrval($_POST, 'twocosecret'));
         $wpmy = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['twocosecret']));
         if ($wpmy == $_POST['twocosecret']) {
             $this->SaveOption('twocosecret', $twocosecret = $wpmy);
             echo "<div class='updated fade'>" . __('<p>Secret Key Changed.</p>', 'wishlist-member') . "</div>";
         } else {
             echo "<div class='error fade'>" . __('<p><b>Error:</b> Secret key may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
         }
     }
     // save vendor id
     if (wlm_arrval($_POST, 'twocovendorid')) {
         $_POST['twocovendorid'] = trim(wlm_arrval($_POST, 'twocovendorid'));
         $wpmy = trim(preg_replace('/[^A-Za-z0-9]/', '', $_POST['twocovendorid']));
         if ($wpmy == $_POST['twocovendorid']) {
             $this->SaveOption('twocovendorid', $twocovendorid = $wpmy);
             echo "<div class='updated fade'>" . __('<p>Vendor ID Changed.</p>', 'wishlist-member') . "</div>";
         } else {
             echo "<div class='error fade'>" . __('<p><b>Error:</b> Vendor ID may only contain letters and numbers.</p>', 'wishlist-member') . "</div>";
         }
     }
     // END Standard 2CO Settings
     // ======================================================
     $twocheckoutapisettings = $this->GetOption('twocheckoutapisettings');
     // END Initialization
 } else {
     // START Interface
     ?>
コード例 #26
0
	        .append('<option value="private">Private</option>');
        $('select[name=s_status]').val(wlm_s_status).select2({width:'110px', minimumResultsForSearch: -1, closeOnSelect: false});

        $('p.search-box').prepend('<select class="select2" name="s_level"></select>&nbsp;');
        $('select[name=s_level]').append('<option value="">All Levels</option><optgroup label="Levels"></optgroup>');
        $.each(wlm_levels, function(idx, level){
        	$('select[name=s_level] optgroup').append('<option value="'+level.id+'">'+level.text+'</option>');
        });

        if('<?php 
echo $user_level;
?>
' != '') {
	        if(!wlm_content_type.match(/(folders|categories|attachment)/i)) {
	        	$('select[name=s_level]').append('<optgroup label="Pay Per Post User"><option value="<?php 
echo wlm_arrval($_GET, 's_level');
?>
"><?php 
echo $user_level;
?>
</option></optgroup>');
	        }
        }
        // if(!wlm_content_type.match(/(folders|categories|attachment)/i)) {
        // 	$('select[name=s_level]').append('<optgroup label="Pay Per Post User"><option value="ppp">Choose User</option></optgroup>');
        // }
        // $('select[name=s_level]').change(function() {
        // 	if($(this).val() == 'ppp') {

      		// }
        // });
コード例 #27
0
ファイル: wpm.php プロジェクト: brooklyntri/btc-plugins
 function wlm_unschedule_single()
 {
     $level = wlm_arrval($_POST, 'level');
     $user = wlm_arrval($_POST, 'user');
     switch (wlm_arrval($_POST, 'schedule_type')) {
         case 'remove':
             $this->Delete_UserLevelMeta($user, $level, 'scheduled_remove');
             break;
         case 'cancel':
             $this->Delete_UserLevelMeta($user, $level, 'wlm_schedule_level_cancel');
             break;
         case 'add':
         case 'move':
             $levels = array_diff((array) $this->GetMembershipLevels($user), array($level));
             $this->SetMembershipLevels($user, $levels);
             break;
     }
 }
コード例 #28
0
 $cancellation_settings_msg = false;
 $eotcancel = array();
 if (wlm_arrval($_POST, "eot_cancel")) {
     if (is_array(wlm_arrval($_POST, "eot_cancel"))) {
         $eotcancel = $_POST["eot_cancel"];
     } else {
         $eotcancel = array();
     }
     $this->SaveOption('eotcancel', maybe_serialize($eotcancel));
     $cancellation_settings_msg = true;
 } elseif ($_POST) {
     $this->SaveOption('eotcancel', maybe_serialize(array()));
 }
 $subscr_cancel = array();
 if (wlm_arrval($_POST, "subscr_cancel")) {
     if (is_array(wlm_arrval($_POST, "subscr_cancel"))) {
         $subscr_cancel = $_POST["subscr_cancel"];
     } else {
         $eotcancel = array();
     }
     $this->SaveOption('subscrcancel', maybe_serialize($subscr_cancel));
     $cancellation_settings_msg = true;
 } elseif ($_POST) {
     $this->SaveOption('subscrcancel', maybe_serialize(array()));
 }
 if ($cancellation_settings_msg != "") {
     echo "<div class='updated fade'>" . __('<p>Cancellation Settings saved!.</p>', 'wishlist-member') . "</div>";
 }
 $eotcancel = $this->GetOption('eotcancel');
 if ($eotcancel) {
     $eotcancel = maybe_unserialize($eotcancel);
コード例 #29
0
&mode2=custom&action=edit"><?php 
    _e('Create a New Registration Form', 'wishlist-member');
    ?>
</a>
				</td>
				<td align="left"></td>
			</tr>
			<tr valign="top">
				<th scope="row"><?php 
    _e('HTML Code to insert AFTER the Registration Form', 'wishlist-member');
    ?>
 <?php 
    echo $this->Tooltip("settings-registration-tooltips-HTML-Code-to-insert-AFTER-the-Registration-Form");
    ?>
</th>
				<td width="1"><textarea cols="60" rows="10" name="wlm_regpage_after"><?php 
    echo $regpage_after[wlm_arrval($_GET, 'level')];
    ?>
</textarea></td>
				<td align="left"></td>
			</tr>
		</table>
		<p class="submit">
			<input type="submit" class="button-primary" value="<?php 
    _e('Save Settings', 'wishlist-member');
    ?>
" />
		</p>
	</form>
<?php 
}
コード例 #30
0
		<?php 
    $disabled = false;
    $disabled = !wlm_arrval($_POST, 'subject') || !wlm_arrval($_POST, 'message') || !$addressok ? true : false;
    if (!$disabled) {
        if (wlm_arrval($_POST, 'send_to') == "send_mlevels" && !count(wlm_arrval($_POST, 'send_mlevels'))) {
            $disabled = true;
        } else {
            if (wlm_arrval($_POST, 'send_to') == "send_search" && !wlm_arrval($_POST, 'save_searches')) {
                $disabled = true;
            }
        }
    }
    ?>
		<p class="submit">
			<?php 
    if (wlm_arrval($_POST, 'preview')) {
        ?>
				<input type="hidden" name="WishListMemberAction" value="EmailBroadcast" />
				<input type="hidden" name="EmailBroadcastAction" value="Save" />
				<?php 
        if (!$disabled || $requeue) {
            ?>
					<small><?php 
            _e('<b>Note:</b> This may take several minutes to complete if you have many members.', 'wishlist-member');
            ?>
<br /></small>
					<input type="submit" value="<?php 
            _e('Send Message to Members', 'wishlist-member');
            ?>
" />
				<?php