Ejemplo n.º 1
0
/**
* FUNCTION kwspamexperts_CreateAccount
* Create Account
* @param array $params
* @return string
*/
function kwspamexperts_CreateAccount($params)
{
    $api = new kwspamexperts_api($params);
    $domain = !empty($params["customfields"]["Domain"]) ? $params["customfields"]["Domain"] : $params['domain'];
    $password = !empty($params['password']) ? $params["password"] : createServerPassword();
    $email = !empty($params["customfields"]["Email"]) ? $params["customfields"]["Email"] : $params['clientsdetails']['email'];
    $archiving = (int) (!empty($params["configoptions"]["archiving"]) && $params["configoptions"]["archiving"]);
    // update password
    update_query("tblhosting", array("password" => encrypt($password)), array("id" => $params['serviceid']));
    // add domain
    if (empty($domain)) {
        return "Domain cannot be empty. Please enter domain name in Domain field.";
    }
    $api->call("domain/add/domain/" . $domain . "/");
    if ($api->isError()) {
        return $api->error();
    }
    // add email
    $api->call("domainuser/add/domain/" . $domain . "/password/" . $password . "/email/" . $email . "/");
    if ($api->isError()) {
        return $api->error();
    }
    $outgoing = $params["configoption1"] != 'Incoming' ? 1 : 0;
    $incoming = $params["configoption1"] != 'Outgoing' ? 1 : 0;
    $api->call("domain/setproducts/domain/" . $domain . "/incoming/" . $incoming . "/outgoing/" . $outgoing . "/archiving/{$archiving}/");
    if ($api->isError()) {
        return $api->error();
    }
    $res = kwspamexperts_ChangePackage($params);
    if (!$res) {
        return $res;
    }
    return "success";
}
Ejemplo n.º 2
0
/**
* FUNCTION spamexpertsreseller_CreateAccount
* Create Reseller Account
* @param array $params
* @return string
*/
function spamexpertsreseller_CreateAccount($params)
{
    include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'class.connection.php';
    $api = new spamexperts_api($params);
    $domain = !empty($params["customfields"]["Domain"]) ? $params["customfields"]["Domain"] : $params['domain'];
    $password = !empty($params['password']) ? $params["password"] : createServerPassword();
    $email = !empty($params["customfields"]["Email"]) ? $params["customfields"]["Email"] : $params['clientsdetails']['email'];
    $username = !empty($params['username']) ? $params['username'] : uniqid();
    $api->call('/reseller/add/username/' . $username . '/password/' . $password . '/email/' . urlencode($email) . '/domainslimit/' . $params['configoption4'] . '/api_usage/' . ($params['configoption5'] == 'on' ? 1 : 0));
    if ($api->isSuccess()) {
        // update password & username
        update_query("tblhosting", array("password" => encrypt($password), "username" => $username), array("id" => $params['serviceid']));
        return "success";
    } else {
        return $api->error();
    }
}
Ejemplo n.º 3
0
 $domain = $data['domain'];
 $billingcycle = $data['billingcycle'];
 $hostingstatus = $data['domainstatus'];
 $firstpaymentamount = formatCurrency($data['firstpaymentamount']);
 $recurringamount = $data['amount'];
 $packageid = $data['packageid'];
 $server = $data['server'];
 $regdate = $data['regdate'];
 $nextduedate = $data['nextduedate'];
 $serverusername = $data['username'];
 $serverpassword = decrypt($data['password']);
 if (!$serverusername) {
     $serverusername = createServerUsername($domain);
 }
 if (!$serverpassword) {
     $serverpassword = createServerPassword();
 }
 $result2 = select_query("tblproducts", "tblproducts.name,tblproducts.type,tblproducts.welcomeemail,tblproducts.autosetup,tblproducts.servertype,tblproductgroups.name AS groupname", array("tblproducts.id" => $packageid), "", "", "", "tblproductgroups ON tblproducts.gid=tblproductgroups.id");
 $data = mysql_fetch_array($result2);
 $groupname = $data['groupname'];
 $productname = $data['name'];
 $producttype = $data['type'];
 $welcomeemail = $data['welcomeemail'];
 $autosetup = $data['autosetup'];
 $servertype = $data['servertype'];
 if ($domain && $producttype != "other") {
     $domain .= "<br />(<a href=\"http://" . $domain . "\" target=\"_blank\" style=\"color:#cc0000\">www</a> <a href=\"#\" onclick=\"\$('#frmWhoisDomain').val('" . addslashes($domain) . "');\$('#frmWhois').submit();return false\">" . $aInt->lang("domains", "whois") . "</a> <a href=\"http://www.intodns.com/" . $domain . "\" target=\"_blank\" style=\"color:#006633\">intoDNS</a>)";
 }
 echo "<tr><td align=\"center\"><a href=\"clientsservices.php?userid=" . $userid . "&id=" . $hostingid . "\"><b>";
 if ($producttype == "hostingaccount") {
     echo $aInt->lang("orders", "sharedhosting");
Ejemplo n.º 4
0
function ServerCreateAccount($func_id)
{
    $params = ModuleBuildParams($func_id);
    $params['action'] = "create";
    if (!$params['username']) {
        $params['username'] = createServerUsername($params['domain']);
        update_query("tblhosting", array("username" => $params['username']), array("id" => $func_id));
    }
    if (!$params['password']) {
        $params['password'] = createServerPassword();
        update_query("tblhosting", array("password" => encrypt($params['password'])), array("id" => $func_id));
    }
    $hookresults = run_hook("PreModuleCreate", array("params" => $params));
    $hookabort = false;
    foreach ($hookresults as $hookvals) {
        foreach ($hookvals as $k => $v) {
            if ($k == "abortcmd" && $v == true) {
                $hookabort = true;
                continue;
            }
        }
    }
    if (!$hookabort && function_exists($params['moduletype'] . "_CreateAccount")) {
        $result = call_user_func($params['moduletype'] . "_CreateAccount", $params);
        if ($result == "success") {
            logActivity("Module Create Successful - Service ID: " . $func_id, $params['clientsdetails']['userid']);
            update_query("tblhosting", array("domainstatus" => "Active"), array("id" => $func_id));
            run_hook("AfterModuleCreate", array("params" => $params));
            return $result;
        }
    } else {
        $result = "Function Not Supported by Module";
        if ($hookabort) {
            $result = "Function Aborted by Action Hook Code";
        }
    }
    logActivity("Module Create Failed - Service ID: " . $func_id . " - Error: " . $result, $params['clientsdetails']['userid']);
    return $result;
}
Ejemplo n.º 5
0
function scpanel_CreateAccount($params)
{
    $sAuth = base64_encode($params['serverusername'] . ":" . $params['serverpassword']);
    if ($params['configoption15']) {
        $params['domain'] = $params['configoption5'] . $params['configoption15'];
        $params['username'] = "******" . $params['domain'];
        $params['username'] = str_replace(".", "", $params['username']);
        $params['username'] = str_replace("-", "", $params['username']);
        $params['username'] = substr($params['username'], 0, 8);
    }
    update_query("tblhosting", array("domain" => $params['domain'], "username" => $params['username']), array("id" => (int) $params['serviceid']));
    $cpanelpassword = createServerPassword();
    $sHTTP = "GET /scripts/wwwacct?domain=" . urlencode($params['domain']) . "&username="******"&password="******"&plan=" . urlencode($params['configoption12']) . ("&x=\n HTTP/1.0\nAuthorization: Basic " . $sAuth . "\n" . "\n");
    $ch = curl_init("http://" . $params['serverip'] . ":2086/xml-api/createacct?username="******"&plan=" . urlencode($params['configoption12']) . "&password="******"&domain=" . urlencode($params['domain']));
    $header = array("Authorization: Basic " . $sAuth);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    $output = curl_exec($ch);
    curl_close($ch);
    $output = simplexml_load_string($output);
    if ($output->result->status == 1) {
        $result = "success";
    } else {
        $result = $output->result->statusmsg;
    }
    if ($result == "success") {
        if ($params['configoption7'] == "on") {
            $params['configoption7'] = "yes";
        } else {
            $params['configoption7'] = "no";
        }
        if ($params['configoption9'] == "on") {
            $params['configoption9'] = "yes";
        } else {
            $params['configoption9'] = "no";
        }
        if ($params['configoption10'] == "on") {
            $params['configoption10'] = "yes";
        } else {
            $params['configoption10'] = "no";
        }
        if ($params['configoption11'] == "on") {
            $params['configoption11'] = "yes";
        } else {
            $params['configoption11'] = "no";
        }
        if ($params['configoption13']) {
            $params->configoption13 .= "M";
        }
        if ($params['configoption14']) {
            $params->configoption14 .= "M";
        }
        $access_url = $params['serverip'] . "/~" . $params['username'];
        $url = "http://" . $access_url . "/install.php";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        $url = "http://" . $access_url . "/scp/index.php";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        $url = "http://" . $access_url . "/scp/install/api/1.php?user="******"&pass="******"&os=" . $params['configoption3'];
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/2.php?user="******"&pass="******"&os=" . $params['configoption3'] . "&maxuser="******"&password="******"&portbase=" . $params['configoption5'] . "&destip=" . $params['serverip'];
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/3.php?user="******"&pass="******"&server_host=" . $params['serverip'] . "&server_port=" . $params['configoption5'];
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/4.php?user="******"&pass="******"&maxtraffic=" . $params['configoption6'] . "&trafficabuse=" . $params['configoption7'] . "&maxbitrate=" . $params['configoption8'] . "&bitrateabuse=" . $params['configoption9'] . "&intro_backup_max_size=" . $params['configoption13'] . "&ondemand_max_size=" . $params['configoption14'] . "&ondemand=" . $params['configoption10'] . "&proxy=" . $params['configoption11'];
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/5.php?user="******"&pass="******"&username="******"&password="******"&name=" . urlencode($params['clientsdetails']['firstname'] . " " . $params['clientsdetails']['lastname']) . "&user_mail=" . urlencode($params['clientsdetails']['email']) . "&allow_admin_mail=ON&allow_user_mail=OFF";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
            return $result;
        }
        $url = "http://" . $access_url . "/scp/install/api/6.php?user="******"&pass="******"&action=start";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
        }
        $url = "http://" . $access_url . "/scp/install/api/7.php?user="******"&pass="******"&action=cleanup";
        $data = file_get_contents($url);
        logModuleCall("scpanel", "", $url, $data);
        if ($data != "OK" && $result == "success") {
            $result = titleCase($data);
        }
        $query = "UPDATE tblproducts SET configoption5=configoption5+2 WHERE id=" . (int) $params['packageid'];
        $result = full_query($query);
    }
    return $result;
}