Esempio n. 1
0
function fetchmail_generate()
{
    global $conf_generated_file_path;
    global $console;
    $filename = $conf_generated_file_path . '/fetchmailrc';
    $console .= "Generating {$filename} : ";
    if (touch($filename)) {
        $console .= "Done!\n";
    } else {
        $console .= "Failed!";
        return false;
    }
    $result = mysql_query("SELECT * FROM fetchmail");
    $num = 0;
    $fetchline = "";
    while ($row = mysql_fetch_assoc($result)) {
        /* Yes, only pop3 yet. Must specify it, auto is *sloooow* */
        $fetchline .= "poll {$row['pop3_server']} proto POP3\n";
        $fetchline .= "qvirtual \"MFY\"\n";
        $fetchline .= "envelope \"Delivered-To\"\n";
        /* Unfortunately there is no such option in fetchmail to keep mails for X days, or something, so it must be done with
        		other tools. I think its safer to keep messages on remote server by default */
        $fetchline .= "user {$row['pop3_login']} with password {$row['pop3_pass']} to {$row['domain_user']}@{$row['domain_name']}\n";
        $fetchline .= "keep\n";
        $num++;
    }
    file_put_contents($filename, $fetchline);
    $console .= "Number of fetchmailrc entries generated: " . $num . "\n";
    updateUsingCron("gen_fetchmail='no'");
}
Esempio n. 2
0
                    $submit_err = _("Access not granted line ") . __LINE__ . _(" file ") . __FILE__;
                } else {
                    $q = "UPDATE {$pro_mysql_vps_ip_table} SET rdns_addr='" . $_REQUEST["rdns"] . "',rdns_regen='yes' WHERE ip_addr='" . $_REQUEST["ip_addr"] . "';";
                    $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
                    $q = "SELECT {$pro_mysql_ip_pool_table}.zone_type\n\t\t\t\t\tFROM {$pro_mysql_vps_ip_table},{$pro_mysql_ip_pool_table}\n\t\t\t\t\tWHERE {$pro_mysql_vps_ip_table}.ip_addr='" . $_REQUEST["ip_addr"] . "'\n\t\t\t\t\tAND {$pro_mysql_ip_pool_table}.id={$pro_mysql_vps_ip_table}.ip_pool_id;";
                    $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
                    $n = mysql_num_rows($r);
                    if ($n != 1) {
                        $submit_err = _("Could not find the corresponding IP pool");
                    } else {
                        $a = mysql_fetch_array($r);
                        if ($a["zone_type"] == "support_ticket") {
                            $submit_err = _("This IP pool can't be changed automatically, because our upstream network provider doesn't support it. Please open a support ticket to request this RDNS request.");
                        }
                    }
                    updateUsingCron("gen_named='yes',gen_reverse='yes',reload_named='yes'");
                }
            }
        }
    } else {
        $submit_err = _("Access not granted line ") . __LINE__ . _(" file ") . __FILE__;
    }
}
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "change_xm_console_ssh_passwd") {
    if (!isDTCPassword($_REQUEST["new_password"])) {
        $submit_err = _("The password you have submited is not a valid password");
        $commit_flag = "no";
    }
    if (checkVPSAdmin($adm_login, $adm_pass, $vps_node, $vps_name) != true) {
        $submit_err = _("Access not granted line ") . __LINE__ . _(" file ") . __FILE__;
        $commit_flag = "no";
Esempio n. 3
0
<?php

if (isset($_REQUEST["subdomaindefault"]) && $_REQUEST["subdomaindefault"] == "Ok") {
    checkLoginPassAndDomain($adm_login, $adm_pass, $edit_domain);
    if (!checkSubdomainFormat($_REQUEST["subdomaindefault_name"])) {
        $submit_err .= _("Incorrect sub-domain format.");
        $commit_flag = "no";
    }
    if ($commit_flag == "yes") {
        if ($_REQUEST["wildcard_dns"] == "yes") {
            $wild = ",wildcard_dns='yes'";
        } else {
            $wild = ",wildcard_dns='no'";
        }
        if ($_REQUEST["default_sub_server_alias"] == "yes") {
            $srvalias = ",default_sub_server_alias='yes'";
        } else {
            $srvalias = ",default_sub_server_alias='no'";
        }
        $adm_query = "UPDATE {$pro_mysql_domain_table} SET default_subdomain='" . $_REQUEST["subdomaindefault_name"] . "'" . $wild . $srvalias . " WHERE name='{$edit_domain}' LIMIT 1;";
        mysql_query($adm_query) or die("Cannot execute query \"{$adm_query}\"");
        updateUsingCron("gen_vhosts='yes',restart_apache='yes',gen_named='yes',reload_named='yes'");
    }
}
Esempio n. 4
0
            $new_mx_2 .= "|" . $new_mx_3;
        }
        if (isset($new_mx_4) && $new_mx_4 != "") {
            $new_mx_2 .= "|" . $new_mx_4;
        }
        if (isset($new_mx_5) && $new_mx_5 != "") {
            $new_mx_2 .= "|" . $new_mx_5;
        }
        if (isset($new_mx_6) && $new_mx_6 != "") {
            $new_mx_2 .= "|" . $new_mx_6;
        }
    }
    // If domain whois is hosted here, change the whois value using a registry call.
    if (file_exists($dtcshared_path . "/dtcrm")) {
        $query = "SELECT * FROM {$pro_mysql_domain_table} WHERE name='{$edit_domain}';";
        $result = mysql_query($query) or die("Cannot execute query \"{$query}\" !!!" . mysql_error());
        $row = mysql_fetch_array($result);
        if ($row["whois"] == "here") {
            $regz = registry_update_whois_dns($adm_login, $adm_pass, $edit_domain, "{$new_dns_1}|{$new_dns_2}");
            if ($regz["is_success"] != 1) {
                die("<font color=\"red\"><b>Whois update failed</b></font><br>\nServer said: <i>" . $regz["response_text"] . "</i>");
            }
        }
    }
    $query = "UPDATE {$pro_mysql_domain_table} SET primary_dns='{$new_dns_1}',other_dns='{$new_dns_2}',primary_mx='{$new_mx_1}',other_mx='{$new_mx_2}',txt_root_entry='" . addslashes($_REQUEST["txt_root_entry"]) . "',txt_root_entry2='" . addslashes($_REQUEST["txt_root_entry2"]) . "' WHERE owner='{$adm_login}' AND name='{$edit_domain}';";
    mysql_query($query) or die("Cannot execute query \"{$query}\" !!!" . mysql_error());
    $domupdate_query = "UPDATE {$pro_mysql_domain_table} SET generate_flag='yes' WHERE name='{$edit_domain}' LIMIT 1;";
    $domupdate_result = mysql_query($domupdate_query) or die("Cannot execute query \"{$domupdate_query}\"");
    updateUsingCron("gen_vhosts='yes',restart_apache='yes',gen_named='yes',reload_named ='yes',restart_qmail='yes',qmail_newu='yes',gen_qmail='yes',gen_fetchmail='yes'");
    triggerDomainListUpdate();
}
Esempio n. 5
0
function emailAccountsDeleteCallback($id)
{
    global $cyrus_used;
    global $pro_mysql_pop_table;
    global $pro_mysql_fetchmail_table;
    triggerMXListUpdate();
    updateUsingCron("gen_qmail='yes', qmail_newu='yes'");
    $q = "SELECT id, mbox_host, home FROM {$pro_mysql_pop_table} WHERE autoinc='{$id}';";
    $r = mysql_query($q) or die("Cannot query {$q} line: " . __LINE__ . " file " . __FILE__ . " sql said:" . mysql_error());
    $n = mysql_num_rows($r);
    if ($n != 1) {
        die("Cannot find created email line " . __LINE__ . " file " . __FILE__);
    }
    $v = mysql_fetch_array($r);
    if ($cyrus_used) {
        # login to cyradm
        $cyr_conn = new cyradm();
        $error = $cyr_conn->imap_login();
        if ($error != 0) {
            die("imap_login Error {$error}");
        }
        $result = $cyr_conn->deletemb("user/" . $v["id"] . "@" . $v["mbox_host"]);
    }
    $cmd = "rm -rf " . $v["home"];
    exec($cmd, $exec_out, $return_val);
    $q = "DELETE FROM {$pro_mysql_fetchmail_table} WHERE domain_user='******' AND domain_name='" . $v["mbox_host"] . "';";
    $r = mysql_query($q) or die("Cannot query {$q} line: " . __LINE__ . " file " . __FILE__ . " sql said:" . mysql_error());
    updateUsingCron("qmail_newu='yes',restart_qmail='yes',gen_qmail='yes'");
    return "";
}
Esempio n. 6
0
function emailAliasesDeleteCallback($id)
{
    global $pro_mysql_mailaliasgroup_table;
    triggerMXListUpdate();
    updateUsingCron("gen_qmail='yes', qmail_newu='yes'");
    $q = "DELETE FROM {$pro_mysql_mailaliasgroup_table} WHERE autoinc='{$id}';";
    $r = mysql_query($q) or die("Cannot query {$q} line: " . __LINE__ . " file " . __FILE__ . " sql said:" . mysql_error());
    if ($r != true) {
        die("Cannot find created email line " . __LINE__ . " file " . __FILE__);
    }
    triggerMXListUpdate();
    updateUsingCron("gen_qmail='yes', qmail_newu='yes'");
    return "";
}
Esempio n. 7
0
            }
        }
    }
    if ($commit_flag == "yes") {
        $q = "DELETE FROM mysql.db WHERE Db='" . $_REQUEST["dbname"] . "';";
        $r = mysql_query($q) or die("Cannot execute query \"{$q}\" line " . __LINE__ . " file " . __FILE__ . " sql said " . mysql_error());
        $q = "DROP DATABASE IF EXISTS `" . $_REQUEST["dbname"] . "`;";
        $r = mysql_query($q) or die("Cannot execute query \"{$q}\" line " . __LINE__ . " file " . __FILE__ . " sql said " . mysql_error());
        $q = "FLUSH PRIVILEGES;";
        $r = mysql_query($q) or die("Cannot execute query \"{$q}\" line " . __LINE__ . " file " . __FILE__ . " sql said " . mysql_error());
    }
    if ($conf_user_mysql_type == "distant") {
        mysql_close($newid) or die("Cannot disconnect to user database");
        connect2base();
    }
    updateUsingCron("gen_backup='yes'");
}
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "change_db_owner") {
    checkLoginPass($adm_login, $adm_pass);
    if ($conf_user_mysql_type == "distant") {
        $newid = mysql_connect($conf_user_mysql_host, $conf_user_mysql_root_login, $conf_user_mysql_root_pass) or die("Cannot connect to user SQL host");
    }
    // action=change_db_owner&dbname=clem&dbuser=zigo
    if (!isFtpLogin($_REQUEST["dbuser"])) {
        $submit_err .= _("Incorrect MySQL login format: please enter another login and try again.") . "<br>\n";
        $commit_flag = "no";
    }
    if (!isDatabase($_REQUEST["dbname"])) {
        $submit_err .= _("Incorrect MySQL db name format: please enter another and try again.") . "<br>\n";
        $commit_flag = "no";
    } else {
Esempio n. 8
0
if (isset($_REQUEST["dellist"]) && $_REQUEST["dellist"] == "Del") {
    checkLoginPassAndDomain($adm_login, $adm_pass, $edit_domain);
    // Verify strings given
    if (!isMailbox($_REQUEST["edit_mailbox"])) {
        die($_REQUEST["edit_mailbox"] . _(" does not look like a mailbox login..."));
    }
    //Some vars
    $name = $_REQUEST["edit_mailbox"];
    $admin_path = getAdminPath($adm_login);
    $folder_name = $edit_domain . "_" . $name;
    $list_full_path = $admin_path . "/" . $edit_domain . "/lists/" . $folder_name;
    //I delete all files of this mailing list
    $del_spool = "rm /var/spool/mlmmj/" . $folder_name;
    exec($del_spool);
    $del_etc = "rm -rf /etc/mlmmj/lists/" . $folder_name;
    exec($del_etc);
    $del_ml = "rm -rf " . $list_full_path;
    exec($del_ml);
    // i need to add the postfix's aliases deletion
    // very important!!!
    // Delete list from sql database
    $adm_query = "DELETE FROM {$pro_mysql_list_table} WHERE domain='{$edit_domain}' AND name='{$name}' LIMIT 1";
    unset($edit_mailbox);
    mysql_query($adm_query) or die("Cannot execute query \"{$adm_query}\"");
    if ($edit_domain == $conf_main_domain) {
        $adm_query = "DELETE FROM {$pro_mysql_vps_server_lists_table} WHERE list_name='{$name}';";
        mysql_query($adm_query) or die("Cannot execute query \"{$adm_query}\" line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
    }
    triggerMXListUpdate();
    updateUsingCron("gen_qmail='yes', qmail_newu='yes'");
}
Esempio n. 9
0
    mysql_query($adm_query) or die("Cannot execute query \"{$adm_query}\"");
    updateUsingCron("gen_ssh='yes'");
}
// $edssh_account $edit_domain $edssh_pass
if (isset($_REQUEST["update_ssh_account"]) && $_REQUEST["update_ssh_account"] == "Ok") {
    checkLoginPassAndDomain($adm_login, $adm_pass, $edit_domain);
    $adm_path = getAdminPath($adm_login);
    if (!hasSSHLoginFlag($adm_login)) {
        $submit_err .= "You don't have the SSH login flag!";
        $commit_flag = "no";
    }
    if (0 != strncmp($adm_path, $_REQUEST["edssh_path"], strlen($adm_path) - 1) || strstr($_REQUEST["edssh_path"], '..') || strstr($_REQUEST["edssh_path"], "'") || strstr($_REQUEST["edssh_path"], "\\")) {
        $submit_err .= _("Your path is restricted to ") . "&quot;{$adm_path}/{$edit_domain}/subdomains&quot;<br>\n";
        $commit_flag = "no";
    }
    $new_path = $_REQUEST["edssh_path"];
    if (!isFtpLogin($_REQUEST["edssh_account"])) {
        $submit_err .= _("Incorrect ssh login : this is not a good string for a ssh login, please enter a new one.");
        $commit_flag = "no";
    }
    if (!isDTCPassword($_REQUEST["edssh_pass"])) {
        $submit_err .= _("Incorrect SSH password: from 6 to 16 chars, a-z A-Z 0-9");
        $commit_flag = "no";
    }
    $crypt_ssh_password = crypt($_REQUEST["edssh_pass"], dtc_makesalt());
    if ($commit_flag == "yes") {
        $adm_query = "UPDATE {$pro_mysql_ssh_table} SET homedir='" . addslashes($new_path) . "', crypt='" . $crypt_ssh_password . "', password='******' WHERE login ='******' AND hostname='{$edit_domain}' LIMIT 1;";
        mysql_query($adm_query) or die("Cannot execute query \"{$adm_query}\"");
    }
    updateUsingCron("gen_ssh='yes'");
}
Esempio n. 10
0
function addVPSToUser($adm_login, $vps_server_hostname, $product_id, $operating_system = "debian")
{
    global $pro_mysql_product_table;
    global $pro_mysql_vps_ip_table;
    global $pro_mysql_vps_table;
    $q = "SELECT * FROM {$pro_mysql_product_table} WHERE id='{$product_id}';";
    $r = mysql_query($q) or die("Cannot query : \"{$q}\" line " . __LINE__ . " file " . __FILE__ . " sql said " . mysql_error());
    $n = mysql_num_rows($r);
    if ($n != 1) {
        die("Cannot find product line " . __LINE__ . " file " . __FILE__);
    }
    $product = mysql_fetch_array($r);
    $q = "SELECT * FROM {$pro_mysql_vps_ip_table} WHERE available='yes' AND vps_server_hostname='{$vps_server_hostname}' LIMIT 1;";
    $r = mysql_query($q) or die("Cannot query : \"{$q}\" line " . __LINE__ . " file " . __FILE__ . " sql said " . mysql_error());
    $n = mysql_num_rows($r);
    if ($n != 1) {
        die("Cannot find available IP and Xen name in {$vps_server_hostname} line " . __LINE__ . " file " . __FILE__);
    }
    $vps_ip = mysql_fetch_array($r);
    $q = "UPDATE {$pro_mysql_vps_ip_table} SET available='no',rdns_addr='mx.xen" . $vps_ip["vps_xen_name"] . "." . $vps_ip["vps_server_hostname"] . "' WHERE vps_xen_name='" . $vps_ip["vps_xen_name"] . "' AND vps_server_hostname='" . $vps_ip["vps_server_hostname"] . "';";
    $r = mysql_query($q) or die("Cannot query : \"{$q}\" line " . __LINE__ . " file " . __FILE__ . " sql said " . mysql_error());
    $exp_date = calculateExpirationDate(date("Y-m-d"), $product["period"]);
    $q = "INSERT INTO {$pro_mysql_vps_table} (id,owner,vps_server_hostname,vps_xen_name,start_date,expire_date,hddsize,ramsize,product_id,bandwidth_per_month_gb,operatingsystem)\n\tVALUES('','{$adm_login}','" . $vps_ip["vps_server_hostname"] . "','" . $vps_ip["vps_xen_name"] . "','" . date("Y-m-d") . "','{$exp_date}','" . $product["quota_disk"] . "','" . $product["memory_size"] . "','{$product_id}','" . $product["bandwidth"] . "','{$operating_system}');";
    $r = mysql_query($q) or die("Cannot query : \"{$q}\" line " . __LINE__ . " file " . __FILE__ . " sql said " . mysql_error());
    updateUsingCron("gen_named='yes',reload_named ='yes'");
    // Subscribe user to the lists of the VPS
    VPS_Server_Subscribe_To_Lists($vps_server_hostname);
    return $vps_ip["vps_xen_name"];
}
Esempio n. 11
0
function subdomainEditCallBack($id)
{
    setZoneToGenerate($id);
    updateUsingCron("gen_vhosts='yes',restart_apache='yes',gen_named='yes',reload_named ='yes'");
}
Esempio n. 12
0
function drawDomainConfig($admin)
{
    global $rub;
    global $cc_code_array;
    global $pro_mysql_product_table;
    global $pro_mysql_domain_table;
    global $pro_mysql_product_table;
    global $pro_mysql_vps_table;
    global $pro_mysql_dedicated_table;
    global $pro_mysql_subdomain_table;
    global $conf_site_addrs;
    global $conf_use_shared_ssl;
    $site_addrs = explode("|", $conf_site_addrs);
    global $adm_login;
    global $adm_pass;
    $ret = "";
    if (isset($admin["data"])) {
        $domains = $admin["data"];
        $nbr_domain = sizeof($domains);
    } else {
        $nbr_domain = 0;
    }
    // Shared hosting domain configuration
    if ($nbr_domain > 0) {
        if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "change_domain_config_edit") {
            $q = "UPDATE {$pro_mysql_domain_table} SET generate_flag='yes' WHERE name='" . $_REQUEST["name"] . "';";
            $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
            updateUsingCron("gen_vhosts='yes',restart_apache='yes',gen_named='yes',reload_named ='yes'");
        }
        $dsc = array("table_name" => $pro_mysql_domain_table, "title" => _("Configuration of the domains"), "action" => "change_domain_config", "forward" => array("rub", "adm_login", "adm_pass"), "skip_deletion" => "yes", "skip_creation" => "yes", "where_condition" => "owner='{$adm_login}'", "cols" => array("name" => array("type" => "id", "display" => "yes", "legend" => _("Domain name")), "edithost" => array("type" => "hyperlink", "legend" => _("Vhost"), "text" => _("Customize")), "safe_mode" => array("type" => "checkbox", "help" => _("This will add a new subdomain switch yes/no in the client interface of this domain. Unticking this checkbox is NOT ENOUGH to disable the safe mode. Please go in the subdomains section of this domain name to finish the setup."), "legend" => _("PHP safe_mode"), "values" => array("yes", "no"), "display_replace" => array(_("No"), _("Yes"))), "sbox_protect" => array("type" => "checkbox", "help" => _("This will add a new subdomain switch yes/no in the client interface of this domain. Unticking this checkbox is NOT ENOUGH to disable the sbox CGI-BIN protection. Please go in the subdomains section of this domain name to finish the setup."), "legend" => _("CGI-BIN protection"), "values" => array("yes", "no"), "display_replace" => array(_("No"), _("Yes"))), "quota" => array("type" => "text", "help" => _("Quota disk in MBytes"), "legend" => _("Disk quota"), "size" => "6"), "max_email" => array("type" => "text", "legend" => _("Email max"), "size" => "3"), "max_lists" => array("type" => "text", "legend" => _("Lists max"), "size" => "3"), "max_ftp" => array("type" => "text", "legend" => _("Max FTP"), "size" => "3"), "max_subdomain" => array("type" => "text", "legend" => _("Subdomain max"), "size" => "3"), "max_ssh" => array("type" => "text", "legend" => _("Max SSH"), "size" => "3"), "ip_addr" => array("type" => "popup", "legend" => _("IP address"), "values" => $site_addrs), "backup_ip_addr" => array("type" => "text", "legend" => _("Backup Vhost IP address"), "size" => "14")));
        $ret .= dtcDatagrid($dsc);
        if (isset($_REQUEST["edithost"]) && isHostname($_REQUEST["edithost"])) {
            $ret .= "<h3>" . _("Custom Apache directives for") . " " . $_REQUEST["edithost"] . "</h3>";
            $q = "SELECT subdomain_name FROM {$pro_mysql_subdomain_table} WHERE domain_name='" . $_REQUEST["edithost"] . "';";
            $r = mysql_query($q) or die("Cannot execute query \"{$q}\" ! line: " . __LINE__ . " file: " . __FILE__ . " sql said: " . mysql_error());
            $n = mysql_num_rows($r);
            for ($j = 0; $j < $n; $j++) {
                $a = mysql_fetch_array($r);
                if ($j != 0) {
                    $ret .= " - ";
                }
                $subname = $a["subdomain_name"];
                $ret .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?adm_login={$adm_login}&adm_pass={$adm_pass}&rub={$rub}&edithost=" . $_REQUEST["edithost"] . "&subdomain={$subname}\">{$subname}</a>";
            }
            $ret .= "<br><br>";
            if (isset($_REQUEST["subdomain"]) && isHostname($_REQUEST["subdomain"])) {
                $ret .= "<u>" . _("Subdomain") . ": " . $_REQUEST["subdomain"] . ":</u><br>";
                $ret .= _("Take care: no syntax checkings are done on your custom directives, doing a mistake here could lead to your web server not being able to restart!") . "<br>";
                $q = "SELECT customize_vhost FROM {$pro_mysql_subdomain_table} WHERE subdomain_name='" . $_REQUEST["subdomain"] . "' AND domain_name='" . $_REQUEST["edithost"] . "';";
                $r = mysql_query($q) or die("Cannot execute query \"{$q}\" ! line: " . __LINE__ . " file: " . __FILE__ . " sql said: " . mysql_error());
                $n = mysql_num_rows($r);
                if ($n != 1) {
                    die("Domain name not found line " . __LINE__ . " file " . __FILE__);
                }
                $ze_dom = mysql_fetch_array($r);
                $customization = $ze_dom["customize_vhost"];
                /*$ret .= "<form action=\"".$_SERVER["PHP_SELF"]."\">
                				<input type=\"hidden\" name=\"rub\" value=\"$rub\">
                				<input type=\"hidden\" name=\"adm_login\" value=\"$adm_login\">
                				<input type=\"hidden\" name=\"adm_pass\" value=\"$adm_pass\">
                				<input type=\"hidden\" name=\"edithost\" value=\"".$_REQUEST["edithost"]."\">
                				<input type=\"hidden\" name=\"subdomain\" value=\"".$_REQUEST["subdomain"]."\">
                				<input type=\"hidden\" name=\"action\" value=\"set_vhost_custom_directives\">
                				<textarea cols=\"120\" rows=\"10\" name=\"custom_directives\">$customization</textarea><br>
                <div class=\"input_btn_container\" onMouseOver=\"this.className='input_btn_container-hover';\" onMouseOut=\"this.className='input_btn_container';\">
                 <div class=\"input_btn_left\"></div>
                 <div class=\"input_btn_mid\"><input class=\"input_btn\" type=\"submit\" value=\"Ok\"></div>
                 <div class=\"input_btn_right\"></div>
                </div>
                				</form><br><br><br>";*/
                $cols = array("id" => array("type" => "id", "display" => "no", "legend" => _("ID")), "customize_vhost" => array("type" => "textarea", "help" => _("Custom apache directives. There is *no* syntax checking on this field!"), "cols" => "40", "rows" => "70", "legend" => _("Custom apache directives")), "redirect_url" => array("type" => "text", "help" => _("Redirect URL"), "size" => 50, "legend" => _("Redirect to:")), "php_memory_limit" => array("type" => "text", "help" => _("Maximum memory used by PHP session"), "size" => 3, "legend" => _("PHP memory limit")), "php_max_execution_time" => array("type" => "text", "help" => _("Maximum time a PHP script can execute"), "size" => 3, "legend" => _("Execution time")), "php_upload_max_filesize" => array("type" => "text", "help" => _("Maximum allowed size of uploaded file"), "size" => 2, "legend" => _("Max upload file size")), "php_post_max_size" => array("type" => "text", "help" => _("Maximum allowed size of POST"), "size" => 2, "legend" => _("Max POST file size")), "php_session_auto_start" => array("type" => "checkbox", "help" => _("Auto start of php sessions"), "size" => 2, "legend" => _("Session autostart"), "values" => array("yes", "no"), "display_replace" => array(_("No"), _("Yes"))), "php_allow_url_fopen" => array("type" => "checkbox", "help" => _("Allows to open URLs with PHP's fopen() function."), "size" => 2, "legend" => _("Allow URL fOpen()"), "values" => array("yes", "no"), "display_replace" => array(_("No"), _("Yes"))));
                if ($conf_use_shared_ssl == "yes") {
                    $cols["use_shared_ssl"] = array("type" => "checkbox", "help" => _("Use a shared SSL certificate for this subdomain."), "size" => 2, "legend" => _("SSL"), "values" => array("yes", "no"), "display_replace" => array(_("No"), _("Yes")));
                }
                $dsc = array("table_name" => $pro_mysql_subdomain_table, "title" => _("Configuration of the subdomain"), "action" => "change_domain_config", "forward" => array("subdomain", "edithost", "rub", "adm_login", "adm_pass"), "skip_deletion" => "yes", "skip_creation" => "yes", "where_condition" => "subdomain_name='" . $_REQUEST["subdomain"] . "' AND domain_name='" . $_REQUEST["edithost"] . "'", "cols" => $cols);
                $ret .= dtcDatagrid($dsc);
            }
        }
    }
    // VPS configuration
    if (isset($admin["vps"])) {
        $vpses = $admin["vps"];
        $nbr_vps = sizeof($vpses);
    } else {
        $nbr_vps = 0;
    }
    if ($nbr_vps > 0) {
        $q = "SELECT id,name FROM {$pro_mysql_product_table} WHERE heb_type='vps' AND renew_prod_id='0';";
        $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
        $n = mysql_num_rows($r);
        $prod_name = array();
        $prod_id = array();
        for ($i = 0; $i < $n; $i++) {
            $a = mysql_fetch_array($r);
            $prod_name[] = $a["name"];
            $prod_id[] = $a["id"];
        }
        $dsc = array("table_name" => $pro_mysql_vps_table, "title" => _("Configuration of the VPSes"), "action" => "change_vps_config", "forward" => array("rub", "adm_login", "adm_pass"), "skip_deletion" => "yes", "skip_creation" => "yes", "where_condition" => "owner='{$adm_login}'", "order_by" => "vps_server_hostname,vps_xen_name", "cols" => array("id" => array("type" => "id", "display" => "no", "legend" => "id"), "vps_server_hostname" => array("type" => "info", "legend" => _("VPS Server")), "vps_xen_name" => array("type" => "info", "legend" => _("VPS Name")), "start_date" => array("type" => "text", "size" => "10", "help" => _("Format: YYYY-MM-DD."), "legend" => _("Registration")), "expire_date" => array("type" => "text", "help" => _("Format: YYYY-MM-DD."), "size" => "10", "legend" => _("Expiration")), "hddsize" => array("type" => "text", "help" => _("Hard drive space in MBytes. You will need to manually do a lvresize on the dom0 of your VPS server to activate the changes."), "size" => "5", "legend" => "HDD"), "ramsize" => array("type" => "text", "help" => _("Memory size in MBytes. You will need to manually change the RAM size in the /etc/xen/xenXX startup configuration file and reboot the VPS to activate the changes."), "size" => "5", "legend" => "RAM"), "bandwidth_per_month_gb" => array("type" => "text", "size" => "5", "help" => _("Bandwidth per month in MBytes."), "legend" => _("Bandwidth")), "product_id" => array("type" => "popup", "legend" => _("Product ID"), "values" => $prod_id, "display_replace" => $prod_name)));
        $ret .= dtcDatagrid($dsc);
    }
    // Dedicated servers configuration
    if (isset($admin["dedicated"])) {
        $servers = $admin["dedicated"];
        $nbr_server = sizeof($servers);
    } else {
        $nbr_server = 0;
    }
    if ($nbr_server > 0) {
        $q = "SELECT id,name FROM {$pro_mysql_product_table} WHERE heb_type='server' AND renew_prod_id='0';";
        $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
        $n = mysql_num_rows($r);
        $prod_name = array();
        $prod_id = array();
        for ($i = 0; $i < $n; $i++) {
            $a = mysql_fetch_array($r);
            $prod_name[] = $a["name"];
            $prod_id[] = $a["id"];
        }
        $dsc = array("table_name" => $pro_mysql_dedicated_table, "title" => "", "action" => _("Configuration of the dedicated servers"), "forward" => array("rub", "adm_login", "adm_pass"), "skip_deletion" => "yes", "skip_creation" => "yes", "where_condition" => "owner='{$adm_login}'", "cols" => array("id" => array("type" => "id", "display" => "no", "legend" => "id"), "server_hostname" => array("type" => "text", "legend" => _("Server name")), "start_date" => array("type" => "text", "help" => _("Format: YYYY-MM-DD."), "size" => "10", "legend" => _("Registration")), "expire_date" => array("type" => "text", "help" => _("Format: YYYY-MM-DD."), "size" => "10", "legend" => _("Expiration")), "hddsize" => array("type" => "text", "help" => _("Hard drive size in MBytes."), "size" => "5", "legend" => "HDD"), "ramsize" => array("type" => "text", "help" => _("Memory size in MBytes."), "size" => "5", "legend" => "RAM"), "bandwidth_per_month_gb" => array("type" => "text", "help" => _("Bandwidth per month in GBytes."), "size" => "5", "legend" => _("Bandwidth per month")), "country_code" => array("type" => "popup", "legend" => _("Country"), "values" => array_keys($cc_code_array), "display_replace" => array_values($cc_code_array)), "product_id" => array("type" => "popup", "legend" => _("Product"), "values" => $prod_id, "display_replace" => $prod_name)));
        $ret .= dtcDatagrid($dsc);
    }
    return $ret;
}
Esempio n. 13
0
    checkLoginPass($adm_login, $adm_pass);
    if (!isIP($_REQUEST["ip_addr"])) {
        $submit_err = _("This is not a correct IP line ") . __LINE__ . _(" file ") . __FILE__;
    } else {
        if (!isHostnameOrIP($_REQUEST["rdns"])) {
            $submit_err = _("This is not a correct hostname or IP line ") . __LINE__ . _(" file ") . __FILE__;
        } else {
            $q = "SELECT {$pro_mysql_dedicated_ips_table}.ip_addr\n\t\t\tFROM {$pro_mysql_dedicated_ips_table},{$pro_mysql_dedicated_table}\n\t\t\tWHERE {$pro_mysql_dedicated_ips_table}.ip_addr='" . $_REQUEST["ip_addr"] . "'\n\t\t\tAND {$pro_mysql_dedicated_ips_table}.dedicated_server_hostname={$pro_mysql_dedicated_table}.server_hostname\n\t\t\tAND {$pro_mysql_dedicated_table}.owner='" . $adm_login . "';";
            $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
            $n = mysql_num_rows($r);
            if ($n != 1) {
                $submit_err = _("This IP doesn't bellong to you, you can't change it's RDNS entry!");
            } else {
                $q = "UPDATE {$pro_mysql_dedicated_ips_table} SET rdns_addr='" . $_REQUEST["rdns"] . "',rdns_regen='yes' WHERE ip_addr='" . $_REQUEST["ip_addr"] . "';";
                $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
                updateUsingCron("gen_named='yes',reload_named='yes'");
                $q = "SELECT {$pro_mysql_ip_pool_table}.zone_type\n\t\t\t\tFROM {$pro_mysql_dedicated_ips_table},{$pro_mysql_ip_pool_table}\n\t\t\t\tWHERE {$pro_mysql_dedicated_ips_table}.ip_addr='" . $_REQUEST["ip_addr"] . "'\n\t\t\t\tAND {$pro_mysql_ip_pool_table}.id={$pro_mysql_dedicated_ips_table}.ip_pool_id;";
                $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
                $n = mysql_num_rows($r);
                if ($n != 1) {
                    $submit_err = _("Could not find the corresponding IP pool");
                } else {
                    $a = mysql_fetch_array($r);
                    if ($a["zone_type"] == "support_ticket") {
                        $submit_err = _("This IP pool can't be changed automatically, because our upstream network provider doesn't support it. Please open a support ticket to request this RDNS request.");
                    }
                }
            }
        }
    }
}
Esempio n. 14
0
        $set_to = "no-parking";
    }
    switch ($_REQUEST["domain_parking_type"]) {
        case "same_docroot":
            $domain_parking_type = "same_docroot";
            break;
        case "serveralias":
            $domain_parking_type = "serveralias";
            break;
        default:
            // redirect is the sql default
            $domain_parking_type = "redirect";
    }
    // Update the flag so we regenerate the serial for bind
    $domupdate_query = "UPDATE {$pro_mysql_domain_table} SET domain_parking='{$set_to}', gen_unresolved_domain_alias='no',domain_parking_type='{$domain_parking_type}' WHERE name='{$edit_domain}' LIMIT 1;";
    $domupdate_result = mysql_query($domupdate_query) or die("Cannot execute query \"{$domupdate_query}\"");
    updateUsingCron("gen_vhosts='yes',restart_apache='yes'");
}
// http://dtc.iglobalwall.com/dtc/index.php?adm_login=dtc&addrlink=test.net&adm_pass=root99&domain_gen_unresolv_alias=yes&
if (isset($_REQUEST["change_unresolv_alias"]) && $_REQUEST["change_unresolv_alias"] == "Ok") {
    checkLoginPassAndDomain($adm_login, $adm_pass, $edit_domain);
    if ($_REQUEST["domain_gen_unresolv_alias"] == "yes") {
        $flag = "yes";
    } else {
        $flag = "no";
    }
    // Update the flag so we regenerate the serial for bind
    $domupdate_query = "UPDATE {$pro_mysql_domain_table} SET gen_unresolved_domain_alias='{$flag}' WHERE name='{$edit_domain}' LIMIT 1;";
    $domupdate_result = mysql_query($domupdate_query) or die("Cannot execute query \"{$domupdate_query}\"");
    updateUsingCron("gen_vhosts='yes',restart_apache='yes'");
}