Exemple #1
0
function navigate_capture($params)
{
    $params['clientdetails']['firstname'] = preg_replace('/[^(\\x20-\\x7F)]*/', '', $params['clientdetails']['firstname']);
    $params['clientdetails']['lastname'] = preg_replace('/[^(\\x20-\\x7F)]*/', '', $params['clientdetails']['lastname']);
    $params['clientdetails']['address1'] = preg_replace('/[^(\\x20-\\x7F)]*/', '', $params['clientdetails']['address1']);
    $params['clientdetails']['city'] = preg_replace('/[^(\\x20-\\x7F)]*/', '', $params['clientdetails']['city']);
    $params['clientdetails']['state'] = preg_replace('/[^(\\x20-\\x7F)]*/', '', $params['clientdetails']['state']);
    $params['clientdetails']['postcode'] = preg_replace('/[^(\\x20-\\x7F)]*/', '', $params['clientdetails']['postcode']);
    $auth = new navigate_class();
    $gateway_url = "https://gateway.merchantplus.com/cgi-bin/PAWebClient.cgi";
    $auth->seturl($gateway_url);
    $auth->add_field("x_login", $params['loginid']);
    $auth->add_field("x_tran_key", $params['transkey']);
    $auth->add_field("x_version", "3.1");
    $auth->add_field("x_type", "AUTH_CAPTURE");
    if ($params['testmode'] == "on") {
        $auth->add_field("x_test_request", "TRUE");
    }
    $auth->add_field("x_relay_response", "FALSE");
    $auth->add_field("x_delim_data", "TRUE");
    $auth->add_field("x_delim_char", "|");
    $auth->add_field("x_encap_char", "");
    $auth->add_field("x_invoice_num", $params['invoiceid']);
    $auth->add_field("x_description", "Invoice #" . $params['invoiceid']);
    $auth->add_field("x_first_name", foreignChrReplace($params['clientdetails']['firstname']));
    $auth->add_field("x_last_name", foreignChrReplace($params['clientdetails']['lastname']));
    $auth->add_field("x_address", foreignChrReplace($params['clientdetails']['address1']));
    $auth->add_field("x_city", foreignChrReplace($params['clientdetails']['city']));
    $auth->add_field("x_state", foreignChrReplace($params['clientdetails']['state']));
    $auth->add_field("x_zip", foreignChrReplace($params['clientdetails']['postcode']));
    $auth->add_field("x_country", $params['clientdetails']['country']);
    $auth->add_field("x_phone", $params['clientdetails']['phonenumber']);
    $auth->add_field("x_method", "CC");
    $auth->add_field("x_card_num", $params['cardnum']);
    $auth->add_field("x_amount", $params['amount']);
    $auth->add_field("x_exp_date", $params['cardexp']);
    $auth->add_field("x_card_code", $params['cccvv']);
    $desc = "Action => Auth_Capture\nClient => " . $params['clientdetails']['firstname'] . " " . $params['clientdetails']['lastname'] . "\n";
    switch ($auth->process()) {
        case 1:
            array("status" => "success", "transid" => $auth->response["Transaction ID"], "rawdata" => $auth->dump_response());
    }
    return;
}
Exemple #2
0
function resellerclub_addCustomer($params)
{
    global $CONFIG;
    require ROOTDIR . "/includes/countriescallingcodes.php";
    if (!function_exists("getClientsDetails")) {
        require ROOTDIR . "/includes/clientfunctions.php";
    }
    $clientdetails = foreignChrReplace(getClientsDetails($params['userid']));
    $language = $clientdetails['language'] ? $clientdetails['language'] : $CONFIG['Language'];
    $language = resellerclub_Language($language);
    $postfields['auth-userid'] = $params['ResellerID'];
    $postfields['api-key'] = $params['APIKey'];
    $postfields['username'] = $clientdetails['email'];
    $postfields['passwd'] = resellerclub_genLBRandomPW();
    $postfields['name'] = $clientdetails['firstname'] . " " . $clientdetails['lastname'];
    $companyname = $clientdetails['companyname'];
    if (!$companyname) {
        $companyname = "N/A";
    }
    $postfields['company'] = $companyname;
    $postfields['address-line-1'] = substr($clientdetails['address1'], 0, 64);
    if (64 < $clientdetails['address1']) {
        $postfields['address-line-2'] = substr($clientdetails['address1'] . ", " . $clientdetails['address2'], 64, 128);
    } else {
        $postfields['address-line-2'] = substr($clientdetails['address2'], 0, 64);
    }
    $postfields['city'] = $clientdetails['city'];
    if ($params['country'] != "US") {
        $postfields['state'] = $clientdetails['state'];
    } else {
        $postfields['state'] = convertStateToCode($clientdetails['state'], $clientdetails['country']);
    }
    $postfields['zipcode'] = $clientdetails['postcode'];
    $postfields['country'] = $clientdetails['country'];
    $phonenumber = $clientdetails['phonenumber'];
    $phonenumber = preg_replace("/[^0-9]/", "", $phonenumber);
    $countrycode = $clientdetails['country'];
    $countrycode = $countrycallingcodes[$countrycode];
    $postfields['phone-cc'] = $countrycode;
    $postfields['phone'] = $phonenumber;
    $postfields['lang-pref'] = "" . $language;
    $result = resellerclub_SendCommand("signup", "customers", $postfields, $params, "POST");
    unset($postfields);
    if (strtoupper($result['status']) == "ERROR") {
        if (!$result['message']) {
            $result['message'] = $result['error'];
        }
        return array("error" => $result['message']);
    }
    $customerid = $result;
    return $customerid;
}
function ModuleBuildParams($id)
{
    $result = select_query("tblhosting", "", array("id" => $id));
    $data = mysql_fetch_array($result);
    $func_id = $id = $data['id'];
    $userid = $data['userid'];
    $domain = $data['domain'];
    $username = $data['username'];
    $password = html_entity_decode(decrypt($data['password']));
    $pid = $data['packageid'];
    $server = $data['server'];
    $params['accountid'] = $id;
    $params['serviceid'] = $id;
    $params['domain'] = $domain;
    $params['username'] = $username;
    $params['password'] = $password;
    $params['packageid'] = $pid;
    $params['pid'] = $pid;
    $params['serverid'] = $server;
    $result = select_query("tblproducts", "", array("id" => $pid));
    $data = mysql_fetch_array($result);
    $params['type'] = $data['type'];
    $params['producttype'] = $data['type'];
    $params['moduletype'] = $data['servertype'];
    if (!$params['moduletype']) {
        return false;
    }
    if (!isValidforPath($params['moduletype'])) {
        exit("Invalid Server Module Name");
    }
    $counter = 1;
    while ($counter <= 12) {
        $params["configoption" . $counter] = $data["configoption" . $counter];
        $counter += 1;
    }
    $customfields = array();
    $result = full_query("SELECT tblcustomfields.fieldname,tblcustomfieldsvalues.value FROM tblcustomfields,tblcustomfieldsvalues WHERE tblcustomfields.id=tblcustomfieldsvalues.fieldid AND tblcustomfieldsvalues.relid=" . (int) $id . " AND tblcustomfields.relid=" . (int) $pid);
    while ($data = mysql_fetch_array($result)) {
        $customfieldname = $data[0];
        $customfieldvalue = $data[1];
        if (strpos($customfieldname, "|")) {
            $customfieldname = explode("|", $customfieldname);
            $customfieldname = trim($customfieldname[0]);
        }
        if (strpos($customfieldvalue, "|")) {
            $customfieldvalue = explode("|", $customfieldvalue);
            $customfieldvalue = trim($customfieldvalue[0]);
        }
        $customfields[$customfieldname] = $customfieldvalue;
    }
    $params['customfields'] = $customfields;
    $configoptions = array();
    $result = full_query("SELECT tblproductconfigoptions.optionname,tblproductconfigoptions.optiontype,tblproductconfigoptionssub.optionname,tblhostingconfigoptions.qty FROM tblproductconfigoptions,tblproductconfigoptionssub,tblhostingconfigoptions,tblproductconfiglinks WHERE tblhostingconfigoptions.configid=tblproductconfigoptions.id AND tblhostingconfigoptions.optionid=tblproductconfigoptionssub.id AND tblhostingconfigoptions.relid=" . (int) $id . " AND tblproductconfiglinks.gid=tblproductconfigoptions.gid AND tblproductconfiglinks.pid=" . (int) $pid);
    while ($data = mysql_fetch_array($result)) {
        $configoptionname = $data[0];
        $configoptiontype = $data[1];
        $configoptionvalue = $data[2];
        $configoptionqty = $data[3];
        if (strpos($configoptionname, "|")) {
            $configoptionname = explode("|", $configoptionname);
            $configoptionname = trim($configoptionname[0]);
        }
        if (strpos($configoptionvalue, "|")) {
            $configoptionvalue = explode("|", $configoptionvalue);
            $configoptionvalue = trim($configoptionvalue[0]);
        }
        if ($configoptiontype == "3" || $configoptiontype == "4") {
            $configoptionvalue = $configoptionqty;
        }
        $configoptions[$configoptionname] = $configoptionvalue;
    }
    $params['configoptions'] = $configoptions;
    if (!function_exists("getClientsDetails")) {
        require dirname(__FILE__) . "/clientfunctions.php";
    }
    $clientsdetails = getClientsDetails($userid);
    $clientsdetails['fullstate'] = $clientsdetails['state'];
    $clientsdetails['state'] = convertStateToCode($clientsdetails['state'], $clientsdetails['country']);
    $clientsdetails = foreignChrReplace($clientsdetails);
    $params['clientsdetails'] = $clientsdetails;
    if ($server) {
        $result = select_query("tblservers", "", array("id" => $server));
        $data = mysql_fetch_array($result);
        $params['server'] = true;
        $params['serverip'] = $data['ipaddress'];
        $params['serverhostname'] = $data['hostname'];
        $params['serverusername'] = html_entity_decode($data['username']);
        $params['serverpassword'] = html_entity_decode(decrypt($data['password']));
        $params['serveraccesshash'] = html_entity_decode($data['accesshash']);
        $params['serversecure'] = $data['secure'];
    } else {
        $params['server'] = false;
        $params['serverip'] = $params['serverhostname'] = $params['serverusername'] = $params['serverpassword'] = $params['serveraccesshash'] = $params['serversecure'] = "";
    }
    if (!function_exists($params['moduletype'] . "_ConfigOptions")) {
        $modulepath = ROOTDIR . "/modules/servers/" . $params['moduletype'] . "/" . $params['moduletype'] . ".php";
        if (file_exists($modulepath)) {
            require $modulepath;
        } else {
            logActivity("Required Product Module '" . $params['moduletype'] . "' Missing");
        }
    }
    $GLOBALS['moduleparams'] = $params;
    return $params;
}
Exemple #4
0
 function getModRewriteFriendlyString($title)
 {
     $title = foreignChrReplace($title);
     $title = str_replace("#", "sharp", $title);
     $title = str_replace("&quot;", "", $title);
     $title = str_replace("/", "or", $title);
     $title = str_replace("&amp;", "and", $title);
     $title = str_replace("&", "and", $title);
     $title = str_replace("+", "plus", $title);
     $title = str_replace("=", "equals", $title);
     $title = str_replace("@", "at", $title);
     $title = str_replace(" ", "-", $title);
     $title = preg_replace("/[^0-9a-zA-Z-]/i", "", $title);
     return $title;
 }
Exemple #5
0
 public function buildParams($vars = "")
 {
     if (count($this->moduleparams)) {
         $params = $this->moduleparams;
         if (is_array($vars)) {
             $params = array_merge($params, $vars);
         }
         return $params;
     }
     $params = array();
     $params['accountid'] = $this->getData("id");
     $params['serviceid'] = $this->getData("id");
     $params['domain'] = $this->getData("domain");
     $params['username'] = $this->getData("username");
     $params['password'] = html_entity_decode($this->getData("password"));
     $params['packageid'] = $this->getData("pid");
     $params['pid'] = $this->getData("pid");
     $params['serverid'] = $this->getData("server");
     $params['type'] = $this->getData("type");
     $params['producttype'] = $this->getData("type");
     $params['moduletype'] = $this->getModule();
     $fields = array();
     $counter = 1;
     while ($counter <= 10) {
         $fields[] = "configoption" . $counter;
         $counter += 1;
     }
     $moduleconfigops = get_query_vals("tblproducts", implode(",", $fields), array("id" => $this->getData("pid")));
     foreach ($fields as $field) {
         $params[$field] = $moduleconfigops[$field];
     }
     $customfields = array();
     $result = full_query("SELECT tblcustomfields.fieldname,tblcustomfieldsvalues.value FROM tblcustomfields,tblcustomfieldsvalues WHERE tblcustomfields.id=tblcustomfieldsvalues.fieldid AND tblcustomfieldsvalues.relid='" . (int) $this->getData("id") . "' AND tblcustomfields.relid='" . (int) $this->getData("pid") . "'");
     while ($data = mysql_fetch_array($result)) {
         $customfieldname = $data[0];
         $customfieldvalue = $data[1];
         if (strpos($customfieldname, "|")) {
             $customfieldname = explode("|", $customfieldname);
             $customfieldname = trim($customfieldname[0]);
         }
         if (strpos($customfieldvalue, "|")) {
             $customfieldvalue = explode("|", $customfieldvalue);
             $customfieldvalue = trim($customfieldvalue[0]);
         }
         $customfields[$customfieldname] = $customfieldvalue;
     }
     $params['customfields'] = $customfields;
     $configoptions = array();
     $result = full_query("SELECT tblproductconfigoptions.optionname,tblproductconfigoptions.optiontype,tblproductconfigoptionssub.optionname,tblhostingconfigoptions.qty FROM tblproductconfigoptions,tblproductconfigoptionssub,tblhostingconfigoptions,tblproductconfiglinks WHERE tblhostingconfigoptions.configid=tblproductconfigoptions.id AND tblhostingconfigoptions.optionid=tblproductconfigoptionssub.id AND tblhostingconfigoptions.relid='" . (int) $this->getData("id") . "' AND tblproductconfiglinks.gid=tblproductconfigoptions.gid AND tblproductconfiglinks.pid='" . (int) $this->getData("pid") . "'");
     while ($data = mysql_fetch_array($result)) {
         $configoptionname = $data[0];
         $configoptiontype = $data[1];
         $configoptionvalue = $data[2];
         $configoptionqty = $data[3];
         if (strpos($configoptionname, "|")) {
             $configoptionname = explode("|", $configoptionname);
             $configoptionname = trim($configoptionname[0]);
         }
         if (strpos($configoptionvalue, "|")) {
             $configoptionvalue = explode("|", $configoptionvalue);
             $configoptionvalue = trim($configoptionvalue[0]);
         }
         if ($configoptiontype == "3" || $configoptiontype == "4") {
             $configoptionvalue = $configoptionqty;
         }
         $configoptions[$configoptionname] = $configoptionvalue;
     }
     $params['configoptions'] = $configoptions;
     if (!function_exists("getClientsDetails")) {
         require dirname(__FILE__) . "/clientfunctions.php";
     }
     $clientsdetails = getClientsDetails($this->getData("userid"));
     $clientsdetails['fullstate'] = $clientsdetails['state'];
     $clientsdetails['state'] = convertStateToCode($clientsdetails['state'], $clientsdetails['country']);
     $clientsdetails = foreignChrReplace($clientsdetails);
     $params['clientsdetails'] = $clientsdetails;
     $data = $this->getServerInfo();
     if (count($data)) {
         $params['server'] = true;
         $params['serverip'] = $data['ipaddress'];
         $params['serverhostname'] = $data['hostname'];
         $params['serverusername'] = html_entity_decode($data['username']);
         $params['serverpassword'] = html_entity_decode(decrypt($data['password']));
         $params['serveraccesshash'] = html_entity_decode($data['accesshash']);
         $params['serversecure'] = $data['secure'];
     } else {
         $params['server'] = false;
         $params['serverip'] = "";
         $params['serverhostname'] = "";
         $params['serverusername'] = "";
         $params['serverpassword'] = "";
         $params['serveraccesshash'] = "";
         $params['serversecure'] = "";
     }
     $this->moduleparams = $params;
     if (is_array($vars)) {
         $params = array_merge($params, $vars);
     }
     return $params;
 }
function RegSaveContactDetails($params)
{
    $result = select_query("tbldomains", "id", array("domain" => $params['sld'] . "." . $params['tld']));
    $result = mysql_fetch_array($result);
    $domainid = $data['id'];
    $result = select_query("tbldomainsadditionalfields", "", array("domainid" => $domainid));
    while ($data = mysql_fetch_array($result)) {
        $field_name = $data['name'];
        $field_value = $data['value'];
        $params['additionalfields'][$field_name] = $field_value;
    }
    $originaldetails = $params;
    $params = foreignChrReplace($params);
    $params['original'] = $originaldetails;
    $values = RegCallFunction($params, "SaveContactDetails");
    if (!$values) {
        return false;
    }
    $result = select_query("tbldomains", "userid", array("id" => $params['domainid']));
    $data = mysql_fetch_array($result);
    $userid = $data[0];
    if ($values['error']) {
        logActivity("Domain Registrar Command: Update Contact Details - Failed: " . $values['error'] . " - Domain ID: " . $params['domainid'], $userid);
    } else {
        logActivity("Domain Registrar Command: Update Contact Details - Successful", $userid);
    }
    return $values;
}