Statistics: Posted by webass — January 17th, 2012, 4:51 am
Statistics: Posted by Raam Dev — January 17th, 2012, 12:22 am
Statistics: Posted by angelazou — January 17th, 2012, 12:20 am
Statistics: Posted by Raam Dev — January 17th, 2012, 12:14 am
Statistics: Posted by angelazou — January 16th, 2012, 11:26 pm
Statistics: Posted by angelazou — January 16th, 2012, 10:50 pm
Statistics: Posted by Raam Dev — January 16th, 2012, 10:42 pm
Statistics: Posted by angelazou — January 14th, 2012, 11:15 pm
Statistics: Posted by Raam Dev — January 14th, 2012, 10:24 pm
Statistics: Posted by angelazou — January 13th, 2012, 10:38 pm
Statistics: Posted by Raam Dev — January 13th, 2012, 7:27 pm
<?php
$nextYear = time() + (60 * 60 * 24 * 365);
$whm_user = "don'tpeekhere";
$whm_pass = "don'tpeekhere";
$whm_host = $_SERVER['HTTP_HOST'];
global $wpdb;
$table = $wpdb->prefix . "Orders";
$cid = $_REQUEST["cid"];
$result = $wpdb->get_results( "SELECT user_name, user_email, user_domain, user_plan, gateway FROM {$table} WHERE cust_id = {$cid} LIMIT 1;" );
$op["op"] = "create_user";
$op["api_key"] = "55676d6e246a4ae18037c40087d67e86";
$op["data"] = array (
"user_login" => "{$result->user_email}",
"user_email" => "{$result->user_email}",
"user_pass" => "{$result->user_pass}",
"s2member_level" => "1",
"s2member_ccaps" => "",
"s2member_registration_ip" => "",
"s2member_subscr_gateway" => "{$result->gateway}",
"s2member_subscr_id" => "",
"s2member_custom" => "93hosting.com",
"s2member_auto_eot_time" => "$nextYear", /* Optional. Can be any value that PHP's ``strtotime()`` function will understand ( i.e. YYYY-MM-DD ). */
"opt_in" => "1", /* Optional. A non-zero value tells s2Member to attempt to process List Servers that you've configured in the Dashboard area. */
"custom_fields" => array ("cust_id" => $cid), /* Optional. An array of Custom Registration Field ID's, with associative values. */
"s2member_notes" => "Administrative notation. Created this User via API call.",
"notification" => "1", /* Optional. A non-zero value tells s2Member to email the new User/Member their Username/Password. */
/* The "notification" parameter also tells s2Member to notify the site Administrator about this new account. */
);
if (!empty($user_name)) {
$script = "http://{$whm_user}:{$whm_pass}@{$whm_host}:2086/scripts/wwwacct";
$params = "?plan={$result->user_plan}&domain={$result->user_domain}&username={$result->user_email}&password={$result->user_email}&contactemail={$result->user_email}";
$result1 = file_get_contents($script.$params);
}
$result2 = trim (file_get_contents ("http://93hosting.com/?s2member_pro_remote_op=1", false, stream_context_create (array ("http" => array ("method" => "POST", "header" => "Content-type: application/x-www-form-urlencoded", "content" => "s2member_pro_remote_op=" . urlencode (serialize ($op)))))));
if (!empty ($result2) && !preg_match ("/^Error\:/i", $result2) && is_array ($user = @unserialize ($result2)) && $result1 == !preg_match ("/^Error\:/i", $result1))
{ header("Location: http://93hosting.com/welcome/"); }
else
echo "API error: " . $result1 . "\n\n" . $result2;
?>
Statistics: Posted by angelazou — January 12th, 2012, 10:42 pm
Pro API For Remote Operations ( some scripting required )
With s2Member Pro installed, you have access to the s2Member Pro API For Remote Operations. This is made available for developers that wish to create User/Member accounts dynamically through custom scripts of their own. s2Member's Remote Operations API requires a secret API Key in order to POST authenticated requests to your installation of s2Member. Here is the API Key for this installation domain:
...
Experimental: The Remote Operations API is currently in an experimental state. The only Operation that is currently possible, is the create_user Operation, which is shown in the code sample below. In a future release of s2Member Pro, we will add further documentation and some additional Remote Operations to this API. Thanks for your patience.
Statistics: Posted by Raam Dev — January 12th, 2012, 6:03 pm
Statistics: Posted by angelazou — January 11th, 2012, 11:37 pm
Statistics: Posted by Raam Dev — January 11th, 2012, 11:49 am
Statistics: Posted by angelazou — January 10th, 2012, 8:33 am
Statistics: Posted by webass — January 10th, 2012, 6:41 am
Statistics: Posted by angelazou — January 10th, 2012, 4:55 am
Statistics: Posted by angelazou — January 9th, 2012, 9:33 am
Statistics: Posted by angelazou — January 8th, 2012, 4:48 am
Statistics: Posted by angelazou — January 6th, 2012, 9:38 am