Example #1
0
function drawAdminTools_SSH($domain, $adm_path)
{
    global $adm_login;
    global $adm_pass;
    global $edit_domain;
    global $edssh_account;
    global $addrlink;
    global $conf_hide_password;
    global $conf_domain_based_ssh_logins;
    global $pro_mysql_ssh_table;
    $txt = "";
    // Build the popup values and display values arrays
    $path_popup_vals = array();
    $path_popup_disp = array();
    $path_popup_vals[] = "{$adm_path}";
    $path_popup_disp[] = "/ [ uses www ]";
    $path_popup_vals[] = "{$adm_path}/{$edit_domain}";
    $path_popup_disp[] = "/{$edit_domain} [ uses www ]";
    $nbr_subdomains = sizeof($domain["subdomains"]);
    for ($i = 0; $i < $nbr_subdomains; $i++) {
        $sub_name = $domain["subdomains"][$i]["name"];
        $path_popup_vals[] = "{$adm_path}/{$edit_domain}/subdomains/{$sub_name}";
        $path_popup_disp[] = "/{$edit_domain}/subdomains/{$sub_name}";
    }
    $dsc = array("title" => _("List of your SSH accounts:"), "new_item_title" => _("New SSH account:"), "new_item_link" => _("new SSH account"), "edit_item_title" => _("SSH account configuration:"), "table_name" => $pro_mysql_ssh_table, "action" => "ssh_access_editor", "forward" => array("adm_login", "adm_pass", "addrlink"), "id_fld" => "id", "list_fld_show" => "login", "max_item" => $domain["max_ssh"], "num_item_txt" => _("Number of active ssh accounts:"), "create_item_callback" => "sshAccountsCallback", "where_list" => array("hostname" => $domain["name"]), "check_unique" => array("login"), "check_unique_msg" => _("There is already a ssh login by that name"), "check_unique_use_where_list" => "no", "order_by" => "login", "cols" => array("id" => array("type" => "id", "display" => "no", "legend" => "id"), "login" => array("type" => "text", "check" => "dtc_login_or_email", "legend" => _("Login:"******"password" => array("type" => "password", "check" => "dtc_pass", "cryptfield" => "crypt", "legend" => _("Password:"******"homedir" => array("type" => "popup", "values" => $path_popup_vals, "display_replace" => $path_popup_disp, "legend" => _("Path:"))));
    if ($conf_domain_based_ssh_logins == "yes") {
        $dsc["cols"]["login"]["happen_domain"] = "@" . $domain["name"];
    }
    $txt .= dtcListItemsEdit($dsc);
    $txt .= helpLink("PmWiki/Ssh-Accounts");
    return $txt;
}
Example #2
0
function productManager()
{
    global $pro_mysql_product_table;
    global $secpayconf_currency_symbol;
    if (!isset($secpayconf_currency_symbol)) {
        get_secpay_conf();
    }
    $dsc = array("table_name" => $pro_mysql_product_table, "title" => _("Product list editor") . _(" (shared)"), "action" => "hosting_product_list_shared", "forward" => array("rub"), "where_condition" => "heb_type='shared'", "cols" => array("id" => array("type" => "id", "display" => "yes", "legend" => "Id"), "name" => array("type" => "text", "legend" => _("Product name"), "size" => "30"), "period" => array("type" => "text", "help" => _("Period for the product with format YYYY-MM-DD. For example, if you want a product that will last 1 year, 2 months, and 3 days, write 0001-02-03. "), "legend" => _("Period"), "size" => "10"), "price_dollar" => array("type" => "text", "legend" => _("Price"), "size" => "4"), "setup_fee" => array("type" => "text", "legend" => _("Setup fee"), "size" => "4"), "affiliate_kickback" => array("type" => "text", "help" => _("This is the amount of money that you will give back to the affiliate account that made the sell possible."), "legend" => _("Commission") . " " . $secpayconf_currency_symbol, "size" => "4"), "quota_disk" => array("type" => "text", "help" => _("Hard drive space in MBytes."), "legend" => _("Disk"), "size" => "4"), "nbr_email" => array("type" => "text", "legend" => _("Max email"), "size" => "2"), "nbr_database" => array("type" => "text", "legend" => _("Max database"), "size" => "2"), "bandwidth" => array("type" => "text", "legend" => _("Traffic"), "size" => "5"), "allow_add_domain" => array("type" => "popup", "legend" => _("Add domain"), "help" => _("If set to yes, the the admin can add a domain, if set to check, then it will go through moderation, set to no, no domain addition to account is possible by the admin."), "values" => array("check", "no", "yes"), "display_replace" => array(_("check"), _("no"), _("yes"))), "max_domain" => array("type" => "text", "legend" => _("Max domain"), "help" => _("Maximum number of domain a customer can add by himself on his shared account. Setting a value of zero will mean no limit."), "size" => "3"), "allow_dns_and_mx_change" => array("type" => "checkbox", "legend" => _("DNS & MX"), "help" => _("If set to no, users wont be able to edit the DNS and MX pointer of their domains."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "no"), "ftp_login_flag" => array("type" => "checkbox", "legend" => _("FTP"), "help" => _("If set to no, users wont be able to add/remove/edit FTP accounts."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "yes"), "restricted_ftp_path" => array("type" => "checkbox", "legend" => _("Restricted FTP"), "help" => _("If set to no, users will only be able to create FTP accounts with a path in the html folder of each vhosts."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "no"), "allow_mailing_list_edit" => array("type" => "checkbox", "legend" => _("Lists"), "help" => _("If set to no, users wont be able to add/remove/edit mailing lists and mail alias groups."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "yes"), "allow_subdomain_edit" => array("type" => "checkbox", "legend" => _("Subdomains"), "help" => _("If set to no, users wont be able to add/remove/edit subdomains."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "yes"), "pkg_install_flag" => array("type" => "checkbox", "legend" => _("Subdomains"), "help" => _("If set to no, users wont be able to use the package installer."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "yes"), "private" => array("type" => "checkbox", "legend" => _("Private"), "help" => _("If the private flag is set, then this product wont appear in the registration form."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "no")));
    $out = dtcDatagrid($dsc);
    // Build the product ID popup
    $qp = "SELECT id,name FROM {$pro_mysql_product_table} WHERE renew_prod_id='0' AND heb_type='vps'";
    $rp = mysql_query($qp) or die("Cannot query \"{$qp}\" !!! line: " . __LINE__ . " file: " . __FILE__ . " sql said: " . mysql_error());
    $np = mysql_num_rows($rp);
    $renew_id_popup = array();
    $renew_id_popup[] = 0;
    $renew_id_replace = array();
    $renew_id_replace[] = _("Not a renewal product");
    for ($j = 0; $j < $np; $j++) {
        $ap = mysql_fetch_array($rp);
        $renew_id_popup[] = $ap["id"];
        if (strlen($ap["name"]) > 20) {
            $renew_id_replace[] = $ap["id"] . ": " . substr($ap["name"], 0, 17) . "...";
        } else {
            $renew_id_replace[] = $ap["id"] . ": " . $ap["name"];
        }
    }
    $dsc = array("table_name" => $pro_mysql_product_table, "title" => _("Product list editor") . _(" (VPS)"), "action" => "hosting_product_list_vps", "forward" => array("rub"), "where_condition" => "heb_type='vps'", "cols" => array("id" => array("type" => "id", "display" => "yes", "legend" => "Id"), "renew_prod_id" => array("type" => "popup", "help" => _("If you set the renewal ID, then this entry will be considered as a renewal product for the matching ID."), "legend" => _("Renewal-ID"), "values" => $renew_id_popup, "display_replace" => $renew_id_replace), "name" => array("type" => "text", "legend" => _("Name"), "size" => "30"), "period" => array("type" => "text", "help" => _("Period for the product with format YYYY-MM-DD. For example, if you want a product that will last 1 year, 2 months, and 3 days, write 0001-02-03. "), "legend" => _("Period"), "size" => "10"), "price_dollar" => array("type" => "text", "legend" => _("Price"), "size" => "4"), "setup_fee" => array("type" => "text", "legend" => _("Setup fee"), "size" => "4"), "affiliate_kickback" => array("type" => "text", "help" => _("This is the amount of money that you will give back to the affiliate account that made the sell possible."), "legend" => _("Commission") . " " . $secpayconf_currency_symbol, "size" => "4"), "quota_disk" => array("type" => "text", "help" => _("Hard drive space in MBytes."), "legend" => _("Disk"), "size" => "4"), "memory_size" => array("type" => "text", "help" => _("Memory size in MBytes."), "legend" => _("RAM"), "size" => "4"), "bandwidth" => array("type" => "text", "help" => _("Bandwidth per month in MBytes."), "legend" => _("Traffic"), "size" => "5"), "private" => array("type" => "checkbox", "legend" => _("Private"), "help" => _("If the private flag is set, then this product wont appear in the registration form."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "no")));
    $out .= dtcDatagrid($dsc);
    // Build the product ID popup
    $qp = "SELECT id,name FROM {$pro_mysql_product_table} WHERE renew_prod_id='0' AND heb_type='server'";
    $rp = mysql_query($qp) or die("Cannot query \"{$qp}\" !!! line: " . __LINE__ . " file: " . __FILE__ . " sql said: " . mysql_error());
    $np = mysql_num_rows($rp);
    $renew_id_popup = array();
    $renew_id_popup[] = 0;
    $renew_id_replace = array();
    $renew_id_replace[] = _("Not a renewal product");
    for ($j = 0; $j < $np; $j++) {
        $ap = mysql_fetch_array($rp);
        $renew_id_popup[] = $ap["id"];
        if (strlen($ap["name"]) > 20) {
            $renew_id_replace[] = $ap["id"] . ": " . substr($ap["name"], 0, 17) . "...";
        } else {
            $renew_id_replace[] = $ap["id"] . ": " . $ap["name"];
        }
    }
    $dsc = array("table_name" => $pro_mysql_product_table, "title" => _("Product list editor") . _(" (Dedicated servers)"), "action" => "hosting_product_list_dedicated", "forward" => array("rub"), "where_condition" => "heb_type='server'", "cols" => array("id" => array("type" => "id", "display" => "yes", "legend" => "Id"), "renew_prod_id" => array("type" => "popup", "help" => _("If you set the renewal ID, then this entry will be considered as a renewal product for the matching ID."), "legend" => _("Renewal-ID"), "values" => $renew_id_popup, "display_replace" => $renew_id_replace), "name" => array("type" => "text", "legend" => _("Name"), "size" => "30"), "period" => array("type" => "text", "help" => _("Period for the product with format YYYY-MM-DD. For example, if you want a product that will last 1 year, 2 months, and 3 days, write 0001-02-03. "), "legend" => _("Period"), "size" => "10"), "price_dollar" => array("type" => "text", "legend" => _("Price"), "size" => "4"), "setup_fee" => array("type" => "text", "legend" => _("Setup fee"), "size" => "4"), "affiliate_kickback" => array("type" => "text", "help" => _("This is the amount of money that you will give back to the affiliate account that made the sell possible."), "legend" => _("Commission") . " " . $secpayconf_currency_symbol, "size" => "4"), "quota_disk" => array("type" => "text", "help" => _("Hard drive space in MBytes."), "legend" => _("Disk"), "size" => "4"), "memory_size" => array("type" => "text", "help" => _("Memory size in MBytes."), "legend" => "RAM", "size" => "4"), "bandwidth" => array("type" => "text", "help" => _("Bandwidth per month in GBytes."), "legend" => _("Traffic"), "size" => "5"), "use_radius" => array("type" => "checkbox", "legend" => _("Use Radius"), "help" => _("If the Use Radius flag is set this service is used to check a radius user."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "no"), "private" => array("type" => "checkbox", "legend" => _("Private"), "help" => _("If the private flag is set, then this product wont appear in the registration form."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "no")));
    $out .= dtcDatagrid($dsc);
    $dsc = array("table_name" => $pro_mysql_product_table, "title" => _("Product list editor") . _(" (SSL IPs)"), "action" => "hosting_product_list_ssl", "forward" => array("rub"), "where_condition" => "heb_type='ssl'", "cols" => array("id" => array("type" => "id", "display" => "yes", "legend" => "Id"), "renew_prod_id" => array("type" => "popup", "legend" => _("Renewal-ID"), "help" => _("There must be ONLY ONE SSL product at any time, with only ONE renewal product."), "values" => $renew_id_popup, "display_replace" => array(_("No-renew"))), "name" => array("type" => "text", "legend" => _("Name"), "size" => "30"), "period" => array("type" => "text", "help" => _("Period for the product with format YYYY-MM-DD. For example, if you want a product that will last 1 year, 2 months, and 3 days, write 0001-02-03. "), "legend" => _("Period"), "size" => "10"), "price_dollar" => array("type" => "text", "legend" => _("Price"), "size" => "4"), "setup_fee" => array("type" => "text", "legend" => _("Setup fee"), "size" => "4"), "affiliate_kickback" => array("type" => "text", "help" => _("This is the amount of money that you will give back to the affiliate account that made the sell possible."), "legend" => _("Commission") . " " . $secpayconf_currency_symbol, "size" => "4"), "private" => array("type" => "checkbox", "legend" => _("Private"), "help" => _("If the private flag is set, then this product wont appear in the registration form."), "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "default" => "no")));
    $out .= dtcDatagrid($dsc);
    $out .= helpLink("PmWiki/HostingProductManager");
    return $out;
}
Example #3
0
function drawAdminTools_Aliases($domain)
{
    global $adm_login;
    global $adm_pass;
    global $edit_domain;
    global $edit_mailbox;
    global $addrlink;
    global $pro_mysql_pop_table;
    global $pro_mysql_mailaliasgroup_table;
    checkLoginPassAndDomain($adm_login, $adm_pass, $domain["name"]);
    $out = "";
    $dsc = array("title" => _("List of your mail groups"), "new_item_title" => _("Create New Mail Group"), "new_item_link" => _("Create Mail Group"), "edit_item_title" => _("Edit Mail Group"), "table_name" => $pro_mysql_mailaliasgroup_table, "action" => "aliasgroup", "forward" => array("adm_login", "adm_pass", "addrlink"), "id_fld" => "autoinc", "list_fld_show" => "id", "max_item" => $domain["max_email"], "num_item_txt" => _("Number of active mailboxes:"), "create_item_callback" => "emailAliasesCreateCallback", "delete_item_callback" => "emailAliasesDeleteCallback", "edit_item_callback" => "emailAliasesEditCallback", "order_by" => "id", "where_list" => array("domain_parent" => $domain["name"]), "cols" => array("autoinc" => array("type" => "id", "display" => "no", "legend" => _("Login:"******"id" => array("type" => "text", "check" => "dtc_login_or_email", "disable_edit" => "yes", "happen" => "@" . $domain["name"], "legend" => _("Email:")), "delivery_group" => array("type" => "textarea", "check" => "mail_alias_group", "legend" => _("Delivery Group:"), "cols" => "40", "rows" => "7")), "check_unique" => array("id"), "check_unique_msg" => _("Email address is already in use!"));
    $list_items = dtcListItemsEdit($dsc);
    // We have to query again, in case something has changed
    $q = "SELECT id FROM {$pro_mysql_mailaliasgroup_table} WHERE domain_parent='" . $domain["name"] . "';";
    $r = mysql_query($q) or die("Cannot query {$q} line: " . __LINE__ . " file " . __FILE__ . " sql said:" . mysql_error());
    $n = mysql_num_rows($r);
    $out .= $list_items;
    $out .= helpLink("PmWiki/Email-Accounts");
    return $out;
}
**
**    ACH is distributed in the hope that it will be useful,
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**    GNU General Public License for more details.
**
**    You should have received a copy of the GNU General Public License
**    along with Open Source ACH. If not, see <http://www.gnu.org/licenses/>.
//////////////////////////////////////////////////////////////////////////////// */
if (in_array($active_user->id, $active_project->users)) {
    ?>



<h3>Enter Hypotheses <?php 
    helpLink('howto_hypotheses.php');
    ?>
</h3>



<p class="evidenceSubmenu"><b>Single</b> <a href="<?php 
    echo $base_URL;
    ?>
project/<?php 
    echo $active_project->id;
    ?>
/hypothesis/new/multiple">Multiple</a></p>

<p>Quick tips:
	<ul><li>All of your hypotheses should be mutually exclusive: if one is correct, all others must be false.</li>
Example #5
0
 for ($i = 0; $i < sizeof($result); $i++) {
     if (substr($result[$i]['name'], 0, 7) != "sqlite_" && $result[$i]['name'] != "") {
         echo "<option value='" . htmlencode($result[$i]['name']) . "' selected='selected'>" . htmlencode($result[$i]['name']) . "</option>";
     }
 }
 echo "</select>";
 echo "<br/><br/>";
 echo "<label><input type='radio' name='export_type' checked='checked' value='sql' onclick='toggleExports(\"sql\");'/> " . $lang['sql'] . "</label>";
 echo "<br/><label><input type='radio' name='export_type' value='csv' onclick='toggleExports(\"csv\");'/> " . $lang['csv'] . "</label>";
 echo "</fieldset>";
 echo "<fieldset style='float:left; max-width:350px;' id='exportoptions_sql'><legend><b>" . $lang['options'] . "</b></legend>";
 echo "<label><input type='checkbox' checked='checked' name='structure'/> " . $lang['export_struct'] . "</label> " . helpLink($lang['help5']) . "<br/>";
 echo "<label><input type='checkbox' checked='checked' name='data'/> " . $lang['export_data'] . "</label> " . helpLink($lang['help6']) . "<br/>";
 echo "<label><input type='checkbox' name='drop'/> " . $lang['add_drop'] . "</label> " . helpLink($lang['help7']) . "<br/>";
 echo "<label><input type='checkbox' checked='checked' name='transaction'/> " . $lang['add_transact'] . "</label> " . helpLink($lang['help8']) . "<br/>";
 echo "<label><input type='checkbox' checked='checked' name='comments'/> " . $lang['comments'] . "</label> " . helpLink($lang['help9']) . "<br/>";
 echo "</fieldset>";
 echo "<fieldset style='float:left; max-width:350px; display:none;' id='exportoptions_csv'><legend><b>" . $lang['options'] . "</b></legend>";
 echo "<div style='float:left;'>" . $lang['fld_terminated'] . "</div>";
 echo "<input type='text' value=';' name='export_csv_fieldsterminated' style='float:right;'/>";
 echo "<div style='clear:both;'>";
 echo "<div style='float:left;'>" . $lang['fld_enclosed'] . "</div>";
 echo "<input type='text' value='\"' name='export_csv_fieldsenclosed' style='float:right;'/>";
 echo "<div style='clear:both;'>";
 echo "<div style='float:left;'>" . $lang['fld_escaped'] . "</div>";
 echo "<input type='text' value='\\' name='export_csv_fieldsescaped' style='float:right;'/>";
 echo "<div style='clear:both;'>";
 echo "<div style='float:left;'>" . $lang['rep_null'] . "</div>";
 echo "<input type='text' value='NULL' name='export_csv_replacenull' style='float:right;'/>";
 echo "<div style='clear:both;'>";
 echo "<label><input type='checkbox' name='export_csv_crlf'/> " . $lang['rem_crlf'] . "</label><br/>";
  <option value="none">---</option>
  <option value="credible">Credible</option>
  <option value="suspect">Suspect</option>
</select></p>

<h4>Date/Time <?php 
    helpLink('howto_evidence.php#datetime');
    ?>
</h4>

<p><i>Format: YYYY-MM-DD HH:MM:SS. You may enter a date only, but not time only.</i></p>

<p><input type="text" name="date_of_source" value="" size="20" /></p>

<h4>Code <?php 
    helpLink('howto_evidence.php#code');
    ?>
</h4>

<p><input type="text" name="code" value="" size="20" /></p>

<h4>Flagged</h4>

<p><select name="flag">
  <option value="n">No</option>
  <option value="y">Yes</option>
</select></p>

<p class="submit"><input class="button" type="submit" value="Save" /></p>

</form>


<div class="sortTools" id="sortTools_show_data_columns" style="display: none;">



<p><b>Show Data Columns:</b>

<input type="checkbox" id="dateAdded" onclick="dccDateAdded = 1; if(document.getElementById('dateAdded').checked == true) { setStyleByClass('td','dclDateAdded','display',''); setStyleByClass('td','dcDateAdded','display',''); } else { setStyleByClass('td','dclDateAdded','display','none'); setStyleByClass('td','dcDateAdded','display','none'); }">Order Added 
<input type="checkbox" id="dateOfSource" onclick="dccDateOfSource = 1; if(document.getElementById('dateOfSource').checked == true) { setStyleByClass('td','dclDateOfSource','display',''); setStyleByClass('td','dcDateOfSource','display',''); } else { setStyleByClass('td','dclDateOfSource','display','none'); setStyleByClass('td','dcDateOfSource','display','none'); }">Date/Time 
<input type="checkbox" id="type" onclick="dccType = 1; if(document.getElementById('type').checked == true) { setStyleByClass('td','dclType','display',''); setStyleByClass('td','dcType','display',''); } else { setStyleByClass('td','dclType','display','none'); setStyleByClass('td','dcType','display','none'); }">Type 
<input type="checkbox" id="code" onclick="dccCode = 1; if(document.getElementById('code').checked == true) { setStyleByClass('td','dclCode','display',''); setStyleByClass('td','dcCode','display',''); } else { setStyleByClass('td','dclCode','display','none'); setStyleByClass('td','dcCode','display','none'); }">Code 
<input type="checkbox" id="flag" onclick="dccFlag = 1; if(document.getElementById('flag').checked == true) { setStyleByClass('td','dclFlag','display',''); setStyleByClass('td','dcFlag','display',''); } else { setStyleByClass('td','dclFlag','display','none'); setStyleByClass('td','dcFlag','display','none'); }">Flag 
<input type="checkbox" id="cred_weight" onclick="dccCredWeight = 1; if(document.getElementById('cred_weight').checked == true) { setStyleByClass('td','dclCredWeight','display',''); setStyleByClass('td','dcCredWeight','display',''); } else { setStyleByClass('td','dclCredWeight','display','none'); setStyleByClass('td','dcCredWeight','display','none'); }">Cred Weight<?php 
helpLink('rate_consistency.php#credWeight');
?>
<!--<span class="help"><sup>?</sup></span>-->
<!--<input type="checkbox" id="diag" onclick="dccDiag = 1; if(document.getElementById('diag').checked == true) { setStyleByClass('td','dclDiag','display',''); setStyleByClass('td','dcDiag','display',''); } else { setStyleByClass('td','dclDiag','display','none'); setStyleByClass('td','dcDiag','display','none'); }">Diagnosticity</p> -->



</div>



<div class="sortTools" id="sortTools_sort_hypotheses" style="display: none;">



<p><b>Sort Hypotheses Columns:</b>
Example #8
0
 for ($i = 0; $i < sizeof($result); $i++) {
     if (substr($result[$i]['name'], 0, 7) != "sqlite_" && $result[$i]['name'] != "") {
         echo "<option value='" . $result[$i]['name'] . "' selected='selected'>" . $result[$i]['name'] . "</option>";
     }
 }
 echo "</select>";
 echo "<br/><br/>";
 echo "<input type='radio' name='export_type' checked='checked' value='sql' onclick='toggleExports(\"sql\");'/> SQL";
 echo "<br/><input type='radio' name='export_type' value='csv' onclick='toggleExports(\"csv\");'/> CSV";
 echo "</fieldset>";
 echo "<fieldset style='float:left; max-width:350px;' id='exportoptions_sql'><legend><b>Options</b></legend>";
 echo "<input type='checkbox' checked='checked' name='structure'/> Export with structure " . helpLink("Export Structure to SQL File") . "<br/>";
 echo "<input type='checkbox' checked='checked' name='data'/> Export with data " . helpLink("Export Data to SQL File") . "<br/>";
 echo "<input type='checkbox' name='drop'/> Add DROP TABLE " . helpLink("Add Drop Table to Exported SQL File") . "<br/>";
 echo "<input type='checkbox' checked='checked' name='transaction'/> Add TRANSACTION " . helpLink("Add Transaction to Exported SQL File") . "<br/>";
 echo "<input type='checkbox' checked='checked' name='comments'/> Comments " . helpLink("Add Comments to Exported SQL File") . "<br/>";
 echo "</fieldset>";
 echo "<fieldset style='float:left; max-width:350px; display:none;' id='exportoptions_csv'><legend><b>Options</b></legend>";
 echo "<div style='float:left;'>Fields terminated by</div>";
 echo "<input type='text' value=';' name='export_csv_fieldsterminated' style='float:right;'/>";
 echo "<div style='clear:both;'>";
 echo "<div style='float:left;'>Fields enclosed by</div>";
 echo "<input type='text' value='\"' name='export_csv_fieldsenclosed' style='float:right;'/>";
 echo "<div style='clear:both;'>";
 echo "<div style='float:left;'>Fields escaped by</div>";
 echo "<input type='text' value='\\' name='export_csv_fieldsescaped' style='float:right;'/>";
 echo "<div style='clear:both;'>";
 echo "<div style='float:left;'>Lines terminated by</div>";
 echo "<input type='text' value='AUTO' name='export_csv_linesterminated' style='float:right;'/>";
 echo "<div style='clear:both;'>";
 echo "<div style='float:left;'>Replace NULL by</div>";
Example #9
0
function drawAdminTools_DomainInfo($admin, $eddomain)
{
    global $adm_login;
    global $adm_pass;
    global $addrlink;
    global $dtcshared_path;
    global $conf_administrative_site;
    global $pro_mysql_domain_table;
    global $pro_mysql_whois_table;
    global $renew_return;
    global $secpayconf_currency_letters;
    $out = "";
    $webname = $eddomain["name"];
    get_secpay_conf();
    // Domain registration API stuffs
    $out .= "<br><h3>" . _("Registration:") . "</h3>";
    if ($eddomain["whois"] == "away") {
        $out .= _("Your domain is not registered here.");
    } else {
        $q = "SELECT * FROM {$pro_mysql_domain_table} WHERE name='{$webname}';";
        $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) {
            $out .= _("Cannot find your domain name registration information in the database.");
        } else {
            $a = mysql_fetch_array($r);
            // Domain renewals
            if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "renew_domain") {
                $out .= dtcFormTableAttrs();
                $out .= dtcFormLineDraw(_("Money on your account: "), $admin["client"]["dollar"] . " {$secpayconf_currency_letters}", 1);
                $tld = find_domain_extension($webname);
                $out .= dtcFormLineDraw(_("Type of extension: "), $tld, 0);
                $out .= dtcFormLineDraw(_("Renewal for how many years: "), $_REQUEST["num_years"], 1);
                $price = find_domain_price($tld);
                if ($price === FALSE) {
                    $out .= dtcFormLineDraw("", "<font color=\"red\">" . _("Price for the domain not found!") . "</font>", 0);
                    $out .= "</table>";
                } else {
                    $price = $_REQUEST["num_years"] * $price;
                    $out .= dtcFormLineDraw(_("Total price: "), $price . " {$secpayconf_currency_letters}", 0);
                    $remaining = $admin["client"]["dollar"] - $price;
                    $out .= dtcFormLineDraw(_("Balance after transaction: "), $remaining . " {$secpayconf_currency_letters}", 1);
                    if ($remaining < 0) {
                        $out .= dtcFormLineDraw("", "<font color=\"red\">" . _("Insufisant balance for the transaction, please go to \"My account\" and add money.") . "</font>", 0);
                        $out .= "</table>";
                    } else {
                        $out .= dtcFormLineDraw("", "<form action=\"" . $_SERVER["PHP_SELF"] . "\"><input type=\"hidden\" name=\"adm_login\" value=\"{$adm_login}\">\n<input type=\"hidden\" name=\"addrlink\" value=\"" . $_REQUEST["addrlink"] . "\">\n<input type=\"hidden\" name=\"edit_domain\" value=\"" . $webname . "\">\n<input type=\"hidden\" name=\"adm_pass\" value=\"{$adm_pass}\">\n<input type=\"hidden\" name=\"action\" value=\"registry_renew_domain\">\n<input type=\"hidden\" name=\"num_years\" value=\"" . $_REQUEST["num_years"] . "\">\n" . submitButtonStart() . _("Renew domain") . submitButtonEnd() . "</form>", 0);
                        $out .= "</table>";
                    }
                }
            } elseif (isset($_REQUEST["action"]) && $_REQUEST["action"] == "registry_renew_domain") {
                $out .= $renew_return["response_text"];
            } else {
                $out .= dtcFormTableAttrs();
                // Domain auth code
                $authcode = registry_get_auth_code($webname);
                if ($authcode === FALSE || $authcode["is_success"] != 1) {
                    $txt = _("Auth code retrival failed.");
                } else {
                    $txt = $authcode["response_text"];
                }
                $frm = "<form action=\"" . $_SERVER["PHP_SELF"] . "\"><input type=\"hidden\" name=\"adm_login\" value=\"{$adm_login}\">\n<input type=\"hidden\" name=\"addrlink\" value=\"" . $_REQUEST["addrlink"] . "\">\n<input type=\"hidden\" name=\"edit_domain\" value=\"" . $_REQUEST["addrlink"] . "\">\n<input type=\"hidden\" name=\"adm_pass\" value=\"{$adm_pass}\">\n<input type=\"hidden\" name=\"action\" value=\"renew_domain\">";
                $out .= dtcFormLineDraw(_("Registrar: ") . $frm, $a["registrar"], 1);
                $out .= dtcFormLineDraw(_("Creation date: "), $a["creation_date"], 0);
                $out .= dtcFormLineDraw(_("Last modification date: "), $a["modification_date"], 1);
                $out .= dtcFormLineDraw(_("Expiration date: "), $a["expiration_date"], 0);
                $out .= dtcFormLineDraw(_("Domain auth code: "), $txt, 1);
                $out .= dtcFormLineDraw("<select name=\"num_years\">\n<option value=\"1\">1</option>\n<option value=\"2\">2</option>\n<option value=\"3\">3</option>\n<option value=\"4\">4</option>\n<option value=\"5\">5</option>\n<option value=\"6\">6</option>\n<option value=\"7\">7</option>\n<option value=\"8\">8</option>\n<option value=\"9\">9</option>\n</select>" . _("year(s)"), submitButtonStart() . _("Renew domain") . submitButtonEnd() . "</form>", 0);
                $out .= "</table>";
            }
            // Domain protection
            if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "change_domain_protection") {
                switch ($_REQUEST["protection"]) {
                    case "unlocked":
                        $sel = "unlocked";
                        break;
                    case "transferprot":
                        $sel = "transferprot";
                        break;
                    default:
                    case "locked":
                        $sel = "locked";
                        break;
                }
                $ret = registry_set_domain_protection($webname, $sel);
                if ($ret != FALSE && $ret["is_success"] == 1) {
                    $q = "UPDATE {$pro_mysql_whois_table} SET protection='{$sel}' WHERE domain_name='{$webname}';";
                    $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . "sql said: " . mysql_error());
                    $a["protection"] = $sel;
                }
            }
            $frm = "<form action=\"" . $_SERVER["PHP_SELF"] . "\"><input type=\"hidden\" name=\"adm_login\" value=\"{$adm_login}\">\n<input type=\"hidden\" name=\"addrlink\" value=\"" . $_REQUEST["addrlink"] . "\">\n<input type=\"hidden\" name=\"edit_domain\" value=\"" . $_REQUEST["addrlink"] . "\">\n<input type=\"hidden\" name=\"adm_pass\" value=\"{$adm_pass}\">\n<input type=\"hidden\" name=\"action\" value=\"change_domain_protection\">";
            $out .= dtcFormTableAttrs();
            $unlck_sel = "";
            $trans_sel = "";
            $lockd_sel = "";
            switch ($a["protection"]) {
                case "unlocked":
                    $unlck_sel = " selected ";
                    break;
                case "transferprot":
                    $trans_sel = " selected ";
                    break;
                default:
                case "locked":
                    $lockd_sel = " selected ";
                    break;
            }
            $out .= dtcFormLineDraw(_("Domain protection: ") . $frm, "<select name=\"protection\">\n<option value=\"unlocked\" {$unlck_sel}>" . _("Domain name unlocked") . "</option>\n<option value=\"transferprot\" {$trans_sel}>" . _("Domain name transfer protected") . "</option>\n<option value=\"locked\" {$lockd_sel}>" . _("Domain name protected") . "</option>\n</select>", 1);
            $out .= dtcFormLineDraw("", submitButtonStart() . _("Set protection") . submitButtonEnd(), 0);
            $out .= "</form></table>";
        }
    }
    // End of domain registration API code
    // Retrive domain config
    $quota = $eddomain["quota"];
    $max_email = $eddomain["max_email"];
    $max_ftp = $eddomain["max_ftp"];
    $max_subdomain = $eddomain["max_subdomain"];
    $domain_parking = $eddomain["domain_parking"];
    $domain_parking_type = $eddomain["domain_parking_type"];
    $adm_path = $admin["info"]["path"];
    // Retrive disk usage
    //	$du_string = exec("du -sm $adm_path/$webname --exclude=access.log",$retval);
    //	$du_state = explode("\t",$du_string);
    //	$du = $du_state[0];
    // The upper version might be too slow and give a bad feeling to the user. This one should be a lot better:
    $du_stat = $eddomain["du_stat"];
    $du = $du_stat;
    // Retrive number of mailbox
    if (isset($eddomain["emails"])) {
        $email_nbr = sizeof($eddomain["emails"]);
    } else {
        $email_nbr = 0;
    }
    // Retrive number of ftp account
    if (isset($eddomain["ftps"])) {
        $ftp_nbr = sizeof($eddomain["ftps"]);
    } else {
        $ftp_nbr = 0;
    }
    // Retrive number of ftp account
    $subdomain_nbr = sizeof($eddomain["subdomains"]);
    $total_http_transfer = fetchHTTPInfo($webname);
    $total_ftp_transfer = fetchFTPInfo($webname);
    $total_pop_transfer = fetchPOPInfo($webname);
    $total_imap_transfer = fetchIMAPInfo($webname);
    $total_smtp_transfer = fetchSMTPInfo($webname);
    $total_transfer = smartByte($total_http_transfer + $total_ftp_transfer + $total_smtp_transfer + $total_pop_transfer + $total_imap_transfer);
    $out .= "<br><h3>" . _("Your domain usage and quota:") . "</h3>\n\t" . _("Total transfered bytes this month:") . " {$total_transfer}<br>\n\t" . _("Your area disk usage:") . " " . smartByte($du) . " / {$quota} MBytes<br>\n\t" . _("Mailboxes:") . " {$email_nbr} / {$max_email}<br>\n\t" . _("FTP accounts:") . " {$ftp_nbr} / {$max_ftp}<br>\n\t" . _("Subdomains:") . " {$subdomain_nbr} / {$max_subdomain}<br><br>";
    $out .= "<h3>" . _("Preview URL:") . "</h3>\n\t" . _("Use") . " http(s)://" . $conf_administrative_site . "/www." . $_REQUEST["addrlink"] . " " . _("aliasing") . ":";
    if ($eddomain["gen_unresolved_domain_alias"] == "yes") {
        $radio_yes = " checked";
        $radio_no = "";
    } else {
        $radio_no = " checked";
        $radio_yes = "";
    }
    $out .= "<form action=\"" . $_SERVER["PHP_SELF"] . "\"><input type=\"hidden\" name=\"adm_login\" value=\"{$adm_login}\">\n<input type=\"hidden\" name=\"addrlink\" value=\"" . $_REQUEST["addrlink"] . "\">\n<input type=\"hidden\" name=\"edit_domain\" value=\"" . $_REQUEST["addrlink"] . "\">\n<input type=\"hidden\" name=\"adm_pass\" value=\"{$adm_pass}\">\n<input type=\"radio\" name=\"domain_gen_unresolv_alias\" value=\"yes\"{$radio_yes}>" . _("Yes") . "\n<input type=\"radio\" name=\"domain_gen_unresolv_alias\" value=\"no\"{$radio_no}>" . _("No") . "\n<input type=\"hidden\" name=\"change_unresolv_alias\" value=\"Ok\"><br>" . submitButtonStart() . _("Ok") . submitButtonEnd() . "</form><br><br>";
    $out .= "<h3>" . _("Domain parking:") . "</h3>";
    $out .= _("This domain will be the alias of the following domain (domain parking):");
    $out .= "<form action=\"" . $_SERVER["PHP_SELF"] . "\"><input type=\"hidden\" name=\"adm_login\" value=\"{$adm_login}\">\n<input type=\"hidden\" name=\"addrlink\" value=\"" . $_REQUEST["addrlink"] . "\">\n<input type=\"hidden\" name=\"edit_domain\" value=\"" . $_REQUEST["addrlink"] . "\">\n<input type=\"hidden\" name=\"adm_pass\" value=\"{$adm_pass}\">\n<input type=\"hidden\" name=\"set_domain_parcking\" value=\"Ok\">\n<select name=\"domain_parking_value\">\n<option value=\"no-parking\">" . _("No parking") . "</option>\n";
    $q = "SELECT name FROM {$pro_mysql_domain_table} WHERE owner='{$adm_login}' AND domain_parking='no-parking' AND name NOT LIKE '" . $_REQUEST["addrlink"] . "';";
    $r = mysql_query($q) or die("Cannot query \"{$q}\" line " . __LINE__ . " in file " . __FILE__ . " sql said: " . mysql_error());
    $n = mysql_num_rows($r);
    for ($i = 0; $i < $n; $i++) {
        $a = mysql_fetch_array($r);
        if ($domain_parking == $a["name"]) {
            $checked = " selected ";
        } else {
            $checked = "";
        }
        $out .= "<option value=\"" . $a["name"] . "\"{$checked}>" . $a["name"] . "</option>";
    }
    $out .= "</select><br>";
    $redirect_selected = " ";
    $same_docroot_selected = " ";
    $serveralias_selected = " ";
    switch ($domain_parking_type) {
        case "redirect":
            $redirect_selected = " checked ";
            break;
        case "same_docroot":
            $same_docroot_selected = " checked ";
            break;
        case "serveralias":
            $serveralias_selected = " checked ";
            break;
    }
    $out .= "<input type=\"radio\" name=\"domain_parking_type\" value=\"redirect\" {$redirect_selected}>" . _("Redirection") . " ";
    $out .= "<input type=\"radio\" name=\"domain_parking_type\" value=\"same_docroot\" {$same_docroot_selected}>" . _("Same DocumentRoot") . " ";
    $out .= "<input type=\"radio\" name=\"domain_parking_type\" value=\"serveralias\" {$serveralias_selected}>" . _("ServerAlias") . " ";
    $out .= "<br>" . submitButtonStart() . _("Ok") . submitButtonEnd() . "</form><br><br>";
    $out .= "<h3>" . _("Domain configuration backup:") . "</h3>";
    $out .= "<a href=\"?adm_login={$adm_login}&adm_pass={$adm_pass}&action=export_domain&addrlink=" . $_REQUEST["addrlink"] . "\" target=\"_blank\">" . _("Export this domain to a file") . "</a>";
    $out .= "<br><br>" . helpLink("UserDoc/Domain-General-Config");
    return $out;
}
if ($active_project->classification == 'S') {
    echo 'selected';
}
?>
 >Secret</option>
	<option value="TS" <?php 
if ($active_project->classification == 'TS') {
    echo 'selected';
}
?>
 >Top Secret</option>
</select></p>
<br/>
<div class="privacySettings">
<h3>Project Privacy <?php 
helpLink('howto_project_management.php#project_privacy');
?>
</h3>
<br />
<p class="formNote">Note: The below options enable you to decide whether your project 
is listed in your organization's directory of ACH projects, and, if so, the 
circumstances under which others may view or join your project. The 
directory provides a basic description of the project and lists its participants.</p><br />

<input type="radio" name="directory" value="n" onClick="Disab(1)" <?php 
if ($active_project->directory == 'n') {
    echo 'checked';
}
?>
 /><strong>Private Project</strong>
<p class="formNote">This project will not be listed in the directory. You will select and communicate directly with any individuals whom you 
Example #11
0
function drawAdminTools_Emails($domain)
{
    global $adm_login;
    global $adm_pass;
    global $edit_domain;
    global $edit_mailbox;
    global $addrlink;
    global $cyrus_used;
    global $cyrus_default_quota;
    global $CYRUS;
    global $conf_hide_password;
    global $pro_mysql_pop_table;
    checkLoginPassAndDomain($adm_login, $adm_pass, $domain["name"]);
    $out = "";
    $dsc = array("title" => _("List of your mailboxes:"), "new_item_title" => _("New mailbox"), "new_item_link" => _("new mailbox"), "edit_item_title" => _("Mailbox configuration:"), "table_name" => $pro_mysql_pop_table, "action" => "pop_access_editor", "forward" => array("adm_login", "adm_pass", "addrlink"), "id_fld" => "autoinc", "list_fld_show" => "id", "max_item" => $domain["max_email"], "num_item_txt" => _("Number of active mailboxes:"), "create_item_callback" => "emailAccountsCreateCallback", "delete_item_callback" => "emailAccountsDeleteCallback", "edit_item_callback" => "emailAccountsEditCallback", "where_list" => array("mbox_host" => $domain["name"]), "check_unique" => array("id"), "check_unique_msg" => _("There is already a mailbox by that name"), "order_by" => "id", "cols" => array("autoinc" => array("type" => "id", "display" => "no", "legend" => _("Login:"******"id" => array("type" => "text", "disable_edit" => "yes", "check" => "dtc_login_or_email", "happen" => "@" . $domain["name"], "legend" => _("Login:"******"memo" => array("type" => "text", "help" => _("This text is just a memo for yourself, and will not really be used."), "legend" => _("Name:")), "passwd" => array("type" => "password", "check" => "dtc_pass", "legend" => _("Password:"******"spam_mailbox_enable" => array("type" => "checkbox", "help" => _("If selected, spams will be sent in a SPAM folder and wont reach your inbox. Later you can check this folder with the webmail or using IMAP."), "values" => array("yes", "no"), "legend" => _("Enable SPAM filtering: ")), "spam_mailbox" => array("type" => "text", "help" => _("Name of the SPAM folder to receive the spam (the above option has to be activated)."), "default" => "SPAM", "legend" => _("SPAM mailbox destination: "))));
    if ($cyrus_used) {
        $dsc["cols"]["quota_size"] = array("type" => "text", "check" => "number", "default" => "{$cyrus_default_quota}", "legend" => _("Mailbox quota: "));
        $dsc["cols"]["quota_used"] = array("type" => "readonly", "hide_create" => "yes", "callback" => "getCyrusUsedQuota", "happen" => _("MBytes"), "legend" => _("Used quota: "));
    } else {
        $dsc["cols"]["quota_size"] = array("type" => "text", "check" => "max_value_2096", "default" => "10", "happen" => _("MBytes"), "help" => _("Setting BOTH the number of files and overall mailbox size to zero will disable quota."), "legend" => _("Mailbox quota: "));
        $dsc["cols"]["quota_files"] = array("type" => "text", "check" => "number", "default" => "1024", "happen" => _("files"), "legend" => _("Mailbox max files quota: "));
        $dsc["cols"]["redirect1"] = array("type" => "text", "check" => "email", "can_be_empty" => "yes", "empty_makes_sql_null" => "yes", "legend" => _("Redirection 1: "));
        $dsc["cols"]["redirect2"] = array("type" => "text", "check" => "email", "can_be_empty" => "yes", "empty_makes_sql_null" => "yes", "legend" => _("Redirection 2: "));
        $dsc["cols"]["localdeliver"] = array("type" => "checkbox", "values" => array("yes", "no"), "legend" => _("Deliver messages locally in INBOX: "));
        $dsc["cols"]["vacation_flag"] = array("type" => "checkbox", "values" => array("yes", "no"), "default" => "no", "legend" => _("Check to send a bounce message (vacation): "));
        $dsc["cols"]["vacation_text"] = array("type" => "textarea", "legend" => _("Bounce message content: "), "cols" => "40", "rows" => "7");
    }
    $list_items = dtcListItemsEdit($dsc);
    // We have to query again, in case something has changed
    $q = "SELECT id FROM {$pro_mysql_pop_table} WHERE mbox_host='" . $domain["name"] . "';";
    $r = mysql_query($q) or die("Cannot query {$q} line: " . __LINE__ . " file " . __FILE__ . " sql said:" . mysql_error());
    $n = mysql_num_rows($r);
    $catch_popup = "<option value=\"no-mail-account\">" . _("No catch-all") . "</option>";
    for ($i = 0; $i < $n; $i++) {
        $a = mysql_fetch_array($r);
        if ($a["id"] == $domain["catchall_email"]) {
            $selected = " selected ";
        } else {
            $selected = " ";
        }
        $catch_popup .= "<option value=\"" . $a["id"] . "\" {$selected}>" . $a["id"] . "</option>";
    }
    $out .= "<b><u>" . _("Catch-all email set to deliver to") . ":</u></b><br>";
    $out .= "<form action=\"" . $_SERVER["PHP_SELF"] . "\">\n\t<input type=\"hidden\" name=\"adm_login\" value=\"{$adm_login}\">\n\t<input type=\"hidden\" name=\"adm_pass\" value=\"{$adm_pass}\">\n\t<input type=\"hidden\" name=\"addrlink\" value=\"{$addrlink}\">\n\t<input type=\"hidden\" name=\"edit_domain\" value=\"{$edit_domain}\">\n\tCatchall: <input type=\"hidden\" name=\"action\" value=\"set_catchall_account\">\n\t<select name=\"catchall_popup\">{$catch_popup}</select><input type=\"image\" src=\"gfx/stock_apply_20.png\">\n</form>";
    $out .= $list_items;
    $out .= helpLink("PmWiki/Email-Accounts");
    return $out;
}
Example #12
0
function help($topic)
{
    return helpLink($topic);
}
Example #13
0
function drawAdminTools_Subdomain($admin, $domain)
{
    global $adm_login;
    global $adm_pass;
    global $edit_domain;
    global $addrlink;
    global $conf_administrative_site;
    global $conf_hide_password;
    global $edit_a_subdomain;
    global $dtcshared_path;
    global $pro_mysql_nameservers_table;
    global $pro_mysql_subdomain_table;
    global $pro_mysql_ssl_ips_table;
    $txt = "";
    checkLoginPassAndDomain($adm_login, $adm_pass, $domain["name"]);
    $nbr_subdomain = sizeof($domain["subdomains"]);
    $max_subdomain = $domain["max_subdomain"];
    // Let's start a form !
    $frm = "<form action=\"?\" methode=\"post\">\n<input type=\"hidden\" name=\"adm_login\" value=\"{$adm_login}\">\n<input type=\"hidden\" name=\"adm_login\" value=\"{$adm_login}\">\n<input type=\"hidden\" name=\"adm_pass\" value=\"{$adm_pass}\">\n<input type=\"hidden\" name=\"addrlink\" value=\"{$addrlink}\">\n<input type=\"hidden\" name=\"edit_domain\" value=\"{$edit_domain}\">\n<input type=\"hidden\" name=\"whatdoiedit\" value=\"subdomains\">";
    $txt .= $frm;
    // Popup for choosing default subdomain.
    $subdomains = $domain["subdomains"];
    $txt .= "<table><tr><td align=\"right\">";
    $txt .= _("Default subdomain: ") . "</td><td><select name=\"subdomaindefault_name\">";
    for ($i = 0; $i < $nbr_subdomain; $i++) {
        $sub = $subdomains[$i]["name"];
        if ($domain["default_subdomain"] == "{$sub}") {
            $txt .= "<option value=\"{$sub}\" selected>{$sub}</option>";
        } else {
            $txt .= "<option value=\"{$sub}\">{$sub}</option>";
        }
    }
    $txt .= "</select></td></tr>";
    // Radio to choose wildcard or not
    if ($domain["wildcard_dns"] == "yes") {
        $yes_flag = " checked ";
        $no_flag = " ";
    } else {
        $yes_flag = " ";
        $no_flag = " checked ";
    }
    $txt .= "<tr><td align=\"right\">" . _("Use as wildcard for the domain:") . " </td><td><input type=\"radio\" name=\"wildcard_dns\" value=\"yes\"{$yes_flag}>" . _("Yes") . "<input type=\"radio\" name=\"wildcard_dns\" value=\"no\"{$no_flag}>" . _("No") . "</td></tr>";
    // Radio to activate the ServerAlias on the default subdomain
    if ($domain["default_sub_server_alias"] == "yes") {
        $yes_flag = " checked ";
        $no_flag = " ";
    } else {
        $yes_flag = " ";
        $no_flag = " checked ";
    }
    $txt .= "<tr><td align=\"right\">" . _("Generate a ServerAlias for the root of the domain:") . " </td><td><input type=\"radio\" name=\"default_sub_server_alias\" value=\"yes\"{$yes_flag}>" . _("Yes") . "<input type=\"radio\" name=\"default_sub_server_alias\" value=\"no\"{$no_flag}>" . _("No") . "</td></tr>";
    // Apply button
    $txt .= "<tr><td></td><td><input type=\"hidden\" name=\"subdomaindefault\" value=\"Ok\"><input type=\"image\" src=\"gfx/stock_apply_20.png\"></td></tr></table></form>";
    $txt .= $frm . "";
    $dsc = array("title" => _("List of your subdomains: "), "new_item_title" => _("Create a subdomain: "), "new_item_link" => _("New subdomain"), "edit_item_title" => _("Edit one of your subdomains"), "table_name" => $pro_mysql_subdomain_table, "action" => "subdomain_editor", "forward" => array("adm_login", "adm_pass", "addrlink"), "id_fld" => "id", "list_fld_show" => "subdomain_name", "max_item" => $max_subdomain, "num_item_txt" => _("Number of active subdomains:"), "create_item_callback" => "subdomainCreateDirsCallBack", "delete_item_callback" => "subdomainDeleteDirsCallBack", "edit_item_callback" => "subdomainEditCallBack", "order_by" => "subdomain_name", "where_list" => array("domain_name" => $domain["name"]), "cols" => array("id" => array("type" => "id", "display" => "no", "legend" => "id"), "subdomain_name" => array("type" => "text", "check" => "subdomain", "disable_edit" => "yes", "legend" => _("Subdomain name: ")), "ip" => array("type" => "text", "check" => "subdomain_or_ip", "can_be_empty" => "yes", "empty_makes_default" => "yes", "legend" => _("IP address or CNAME: ")), "ip6" => array("type" => "text", "check" => "ip6", "can_be_empty" => "yes", "empty_makes_default" => "yes", "legend" => _("IPv6 address: ")), "generate_vhost" => array("type" => "radio", "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "legend" => _("Generate a vhost entry for this subdomain:")), "add_default_charset" => array("type" => "popup", "values" => array("dtc-wont-add", "Off", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-11", "ISO-8859-12", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "ISO-8859-16", "ISO-2022-JP", "ISO-2022-KR", "ISO-2022-CN", "Big5", "cn-Big5", "WINDOWS-1251", "CP866", "KOI8", "KOI8-E", "KOI8-r", "KOI8-U", "KOI8-ru", "ISO-10646-UCS-2", "ISO-10646-UCS-4", "UTF-7", "UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE", "UTF-32", "UTF-32BE", "UTF-32LE", "euc-cn", "euc-gb", "euc-jp", "euc-kr", "EUC-TW", "gb2312", "iso-10646-ucs-2", "iso-10646-ucs-4", "shift_jis"), "legend" => "AddDefaultCharset"), "srv_record" => array("type" => "text", "can_be_empty" => "yes", "legend" => _("This subdomain is a service (SRV)<br>entry for the following port: ")), "srv_record_protocol" => array("type" => "radio", "values" => array("tcp", "udp", "sctp"), "default" => "tcp", "legend" => _("SRV protocol: ")), "register_globals" => array("type" => "radio", "values" => array("yes", "no"), "default" => "no", "display_replace" => array(_("Yes"), _("No")), "legend" => _("Use register_globals=1: ")), "associated_txt_record" => array("type" => "text", "legend" => _("TXT field of the subdomain: ")), "nameserver_for" => array("type" => "text", "check" => "domain_or_ip", "can_be_empty" => "yes", "legend" => _("This subdomain is a nameserver (NS)<br>entry for the following subdomain: "))));
    if ($domain["safe_mode"] == "no") {
        $dsc["cols"]["safe_mode"] = array("type" => "radio", "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "legend" => "PHP safe mode: ");
    }
    if ($domain["sbox_protect"] == "no") {
        $dsc["cols"]["sbox_protect"] = array("type" => "radio", "values" => array("yes", "no"), "display_replace" => array(_("Yes"), _("No")), "legend" => _("Sbox cgi-bin protection: "));
    }
    // Get all SSL IPs asigned to this customer
    $q = "SELECT * FROM {$pro_mysql_ssl_ips_table} WHERE adm_login='******' AND available='no';";
    $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
    $n = mysql_num_rows($r);
    if ($n != 0) {
        $ssl_ips = array();
        $ssl_ips[] = "none";
        // Check if some SSL certs are free, or used by current subdomain
        for ($i = 0; $i < $n; $i++) {
            $a = mysql_fetch_array($r);
            $nbr_domains = sizeof($admin["data"]);
            $used_by = "none";
            for ($j = 0; $j < $nbr_domains; $j++) {
                $nbr_subdomains = sizeof($admin["data"][$j]["subdomains"]);
                for ($k = 0; $k < $nbr_subdomains; $k++) {
                    if ($admin["data"][$j]["subdomains"][$k]["ssl_ip"] == $a["ip_addr"]) {
                        // The cert is used by current subdomain
                        if (isset($_REQUEST["item"]) && isset($_REQUEST["subaction"]) && $_REQUEST["subaction"] == "subdomain_editor_edit_item" && $_REQUEST["item"] == $admin["data"][$j]["subdomains"][$k]["id"]) {
                            $ssl_ips[] = $a["ip_addr"];
                            // The cert is used by another subdomain, don't show it...
                        } else {
                            $used_by = $admin["data"][$j]["name"] . $admin["data"][$j]["subdomains"][$k]["name"];
                        }
                    }
                }
            }
            if ($used_by == "none") {
                $ssl_ips[] = $a["ip_addr"];
            }
        }
        $dsc["cols"]["ssl_ip"] = array("type" => "popup", "values" => $ssl_ips, "legend" => _("Use an SSL vhost using this IP: "));
    }
    // Check to see if there is some SSL IPs for that customer
    $q = "SELECT * FROM {$pro_mysql_ssl_ips_table} WHERE adm_login='******' AND available='no';";
    $r = mysql_query($q) or die("Cannot query \"{$q}\" line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
    $dsc["cols"]["login"] = array("type" => "text", "check" => "dtc_login", "empty_makes_sql_null" => "yes", "can_be_empty" => "yes", "legend" => _("Dynamic IP update login: "******"cols"]["pass"] = array("type" => "password", "check" => "dtc_pass", "empty_makes_sql_null" => "yes", "can_be_empty" => "yes", "legend" => _("Dynamic IP update password: "******"<br>" . _("Windows users (and UNIX users running WINE) can update their IP address dynamically by downloading and installing the following open source DTC client:") . "<br>" . "<a href=\"http://www.gplhost.com/DTC-Dynamic_IP_updater.exe\">DTC-Dynamic_IP_updater.exe</a><br>" . _("For unix users, a simple wget command in a cron joe like below will do. Something like this:") . "<br>" . htmlspecialchars("wget https://" . $conf_administrative_site . "/dtc/dynip.php?login=MYLOGIN&pass=MYPASS&domain=" . $domain["name"] . "&ip=1.2.3.4") . "<br>";
    $txt .= helpLink("PmWiki/Subdomains");
    return $txt;
}
Example #14
0
function drawAdminTools_VPSInstallation($admin, $vps)
{
    global $vps_name;
    global $vps_node;
    global $adm_login;
    global $adm_pass;
    global $rub;
    global $addrlink;
    global $vps_soap_err;
    global $pro_mysql_product_table;
    global $pro_mysql_vps_ip_table;
    global $pro_mysql_vps_stats_table;
    global $secpayconf_currency_letters;
    global $panel_type;
    global $submit_err;
    $reinstall_os = 1;
    get_secpay_conf();
    $out = "<font color=\"red\">{$submit_err} {$vps_soap_err}</font>";
    $checker = checkVPSAdmin($adm_login, $adm_pass, $vps_node, $vps_name);
    if ($checker != true) {
        return _("Credential not correct: can't display in file ") . __FILE__ . " line " . __LINE__;
    }
    $vps_out = "";
    // Calculate last month dates
    $cur_year = date("Y");
    $cur_month = date("m");
    $last_month = $cur_month - 1;
    if ($last_month == 0) {
        $last_month_year = $cur_year - 1;
        $last_month = 12;
    } else {
        $last_month_year = $cur_year;
    }
    $tow_month_ago = $last_month - 1;
    if ($tow_month_ago == 0) {
        $tow_month_ago = 12;
        $tow_month_ago_year = $last_month_year - 1;
    } else {
        $tow_month_ago_year = $last_month_year;
    }
    // Check if the VPS has expired or not
    $ar = explode("-", $vps["expire_date"]);
    if (date("Y") > $ar[0] || date("Y") == $ar[0] && date("m") > $ar[1] || date("Y") == $ar[0] && date("m") == $ar[1] && date("d") > $ar[2]) {
        $expired = "yes";
    } else {
        $expired = "no";
    }
    // VPS (remote SOAP) Status
    $soap_client = connectToVPSServer($vps_node);
    if ($soap_client != false) {
        $vps_remote_info = getVPSInfo($vps_node, $vps_name, $soap_client);
        if ($vps_remote_info == false) {
            if (strstr($vps_soap_err, _("Method getVPSState failed"))) {
                $vps_out .= _("Could not get remote status (Method getVPSState() failed). Maybe the VPS is not running?") . "<br><br>";
            } else {
                if (strstr($vps_soap_err, _("couldn't connect to host"))) {
                    $vps_out .= _("Could not get remote status: could not connect to the SOAP server (HTTP error).") . "<br><br>";
                } else {
                    $vps_out .= _("Could not get remote status. Unkown error: ") . "{$vps_soap_err}<br><br>";
                }
            }
        } else {
            if ($vps_remote_info == "fsck") {
                $vps_out .= _("Checking filesystem...") . "<br><br>";
            } else {
                if ($vps_remote_info == "mkos") {
                    $vps_out .= _("Reinstalling operating system...") . "<br><br>";
                } else {
                    if (isset($vps_remote_info["id"])) {
                        $vps_out .= _("VM id: ") . $vps_remote_info["id"] . "<br>";
                    }
                    if (isset($vps_remote_info["name"])) {
                        $vps_out .= _("Name: ") . $vps_remote_info["name"] . "<br>";
                    }
                    if (isset($vps_remote_info["memory"])) {
                        $vps_out .= _("Memory: ") . $vps_remote_info["memory"] . "<br>";
                    }
                    if (isset($vps_remote_info["maxmem"])) {
                        $vps_out .= _("Max memory: ") . $vps_remote_info["maxmem"] . "<br>";
                    } else {
                        $vps_out .= _("Maxmem: cannot fetch (maybe boot in progress?)") . "<br>";
                    }
                    if (isset($vps_remote_info["cpu"])) {
                        $vps_out .= _("Number of CPU: ") . $vps_remote_info["cpu"] . "<br>";
                    } else {
                        $vps_out .= _("Number of CPU: cannot fetch (maybe boot in progress?)") . "<br>";
                    }
                    if (isset($vps_remote_info["state"])) {
                        $vps_out .= _("VPS State: ") . $vps_remote_info["state"] . "<br>";
                    } else {
                        $vps_out .= _("State: cannot fetch (maybe boot in progress?)") . "<br>";
                    }
                    if ($vps_remote_info["xen_type"] == 2 && isset($vps_remote_info["up_time"])) {
                        $uptime = substr($vps_remote_info["up_time"], 0, strpos($vps_remote_info["up_time"], "."));
                        $uptime_s = $uptime % 60;
                        $uptime_m = round($uptime / 60) % 60;
                        $uptime_h = round($uptime / 3600) % 24;
                        $uptime_j = round($uptime / 86400);
                        if ($uptime_s > 1) {
                            $upt_s_s = "s";
                        } else {
                            $upt_s_s = "";
                        }
                        if ($uptime_m > 1) {
                            $upt_s_m = "s";
                        } else {
                            $upt_s_m = "";
                        }
                        if ($uptime_h > 1) {
                            $upt_s_h = "s";
                        } else {
                            $upt_s_h = "";
                        }
                        if ($uptime_j > 1) {
                            $upt_s_j = "s";
                        } else {
                            $upt_s_j = "";
                        }
                        $vps_out .= _("Up time: ") . "{$uptime_j} day{$upt_s_j} {$uptime_h} hour{$upt_s_h} {$uptime_m} minute{$upt_s_m} {$uptime_s} seconde{$upt_s_s}<br>";
                        $vps_out .= _("Last boot date: ") . date("Y-m-d H:i:s", substr($vps_remote_info["start_time"], 0, strlen($vps_remote_info["start_time"]) - 2)) . "<br>";
                    }
                    $vps_out .= "<br>";
                }
            }
        }
    } else {
        $vps_out .= _("Could not connect to the VPS SOAP Server.");
    }
    $frm_start = "<form action=\"?\">\n<input type=\"hidden\" name=\"adm_login\" value=\"{$adm_login}\">\n<input type=\"hidden\" name=\"adm_pass\" value=\"{$adm_pass}\">\n<input type=\"hidden\" name=\"addrlink\" value=\"{$addrlink}\">";
    // The ip address(es)
    $vps_ips = $vps["ip_addr"];
    $n = sizeof($vps_ips);
    if ($n > 1) {
        $ip_title = _("IP addresses: ");
    } else {
        $ip_title = _("IP address: ");
    }
    $out .= "<br><h3>" . $ip_title . "</h3>";
    $out .= dtcFormTableAttrs();
    for ($i = 0; $i < $n; $i++) {
        if ($i % 2) {
            $alt_color = 0;
        } else {
            $alt_color = 1;
        }
        $q = "SELECT * FROM {$pro_mysql_vps_ip_table} WHERE ip_addr='" . $vps_ips[$i] . "';";
        $r = mysql_query($q) or die("Cannot query {$q} line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error());
        $n2 = mysql_num_rows($r);
        if ($n2 != 1) {
            $out .= _("Error line " . __LINE__ . " file " . __FILE__);
        } else {
            $a = mysql_fetch_array($r);
            $out .= dtcFormLineDraw($vps_ips[$i], "{$frm_start}<input type=\"hidden\" name=\"action\" value=\"set_ip_reverse_dns\">\n\t<input type=\"hidden\" name=\"ip_addr\" value=\"" . $vps_ips[$i] . "\">\n\t<input type=\"text\" name=\"rdns\" value=\"" . $a["rdns_addr"] . "\">\n</td><td><div class=\"input_btn_container\" onMouseOver=\"this.className='input_btn_container-hover';\"\nonMouseOut=\"this.className='input_btn_container';\">\n <div class=\"input_btn_left\"></div>\n <div class=\"input_btn_mid\"><input class=\"input_btn\" type=\"submit\" value=\"" . _("Change RDNS") . "\"></div>\n <div class=\"input_btn_right\"></div>\n</div></form>", $alt_color);
        }
    }
    $out .= "</table><br><br>";
    // VPS status
    $out .= "<h3>" . _("Current VPS status:") . "</h3><br>";
    $out .= $vps_out;
    // Start / stop VPS
    $out .= "<h3>" . _("Start and stop of your VPS:") . "</h3><br>";
    if ($vps_remote_info == "fsck") {
        $out .= _("Please wait until file system check is finished first.") . "<br><br>";
    } else {
        if ($vps_remote_info == "mkos") {
            $out .= _("Please wait until operating system reinstallation has completed.") . "<br><br>";
            $reinstall_os = 1;
        } else {
            if ($vps_remote_info == true) {
                $out .= $frm_start . "<input type=\"hidden\" name=\"action\" value=\"shutdown_vps\">\n" . submitButtonStart() . _("Gracefully shutdown (xm shutdown)") . submitButtonEnd() . "\n</form><br><br>";
                $out .= $frm_start . "<input type=\"hidden\" name=\"action\" value=\"destroy_vps\">\n" . submitButtonStart() . _("Immediate kill (xm destroy)") . submitButtonEnd() . "\n</form><br><br>";
                $out .= _("To do a file system check or an operating system reinstallation, you need to shutdown or destroy your server first.") . "<br><br>";
            } else {
                if ($expired == "yes") {
                    $out .= _("You cannot start your VPS if it has expired. Please renew it if you want the boot up (xm start) button to appear here.");
                } else {
                    $out .= $frm_start . "<input type=\"hidden\" name=\"action\" value=\"start_vps\">" . submitButtonStart() . _("Boot up (xm start)") . submitButtonEnd() . "<br><br></form>";
                }
                // FSCK
                $out .= "<h3>" . _("File-system check:") . "</h3><br>";
                $out .= $frm_start . "<input type=\"hidden\" name=\"action\" value=\"fsck_vps\">" . submitButtonStart() . _("File system check (fsck)") . submitButtonEnd() . "\n<br><br></form>";
                // OS reinstall
                $out .= "<h3>" . _("Reinstall operating system:") . "</h3><br>";
                $out .= _("Currently installed operating system: ") . $vps["operatingsystem"] . "<br>";
                $deb_selected = " ";
                $debdtc_selected = " ";
                $cent_selected = " ";
                $gen_selected = " ";
                $bsd_selected = " ";
                $xenhvm_selected = " ";
                switch ($vps["operatingsystem"]) {
                    case "debian":
                        $deb_selected = " selected ";
                        break;
                    case "debian-dtc":
                        $debdtc_selected = " selected ";
                        break;
                    case "centos":
                        $cent_selected = " selected ";
                        break;
                    case "netbsd":
                        $bsd_selected = " selected ";
                        break;
                    case "xenhvm":
                        $xenhvm_selected = " selected ";
                        break;
                    default:
                        break;
                }
                // Operating system selection popup and reinstallation button
                $out .= $frm_start . "<table><tr><td>" . _("Operating system:") . " </td><td><select name=\"os_type\">\n<option value=\"debian\" {$deb_selected}>Debian (" . _("network install with debootstrap") . ")</option>\n<option value=\"debian-dtc\" {$debdtc_selected}>Debian with DTC panel (" . _("network install with debootstrap") . ")</option>\n<option value=\"centos\" {$cent_selected}>CentOS (" . _("network install with yum") . ")</option>\n<option value=\"netbsd\" {$bsd_selected}>NetBSD (" . _("network setup with install kernel") . ")</option>\n<option value=\"xenhvm\" {$xenhvm_selected}>Xen HVM (" . _("boot on your own .iso image") . ")</option>";
                $installable_os = getInstallableOS($soap_client);
                $nbr_os = sizeof($installable_os);
                for ($i = 0; $i < $nbr_os; $i++) {
                    $os_name = $installable_os[$i];
                    if ($vps["operatingsystem"] == $os_name) {
                        $selected = " selected ";
                    } else {
                        $selected = "";
                    }
                    $out .= "<option value=\"{$os_name}\" {$selected}>{$os_name} (" . _("operating system image") . ")</option>";
                }
                $installable_app = getInstallableAPP($soap_client);
                $nbr_app = sizeof($installable_app);
                for ($i = 0; $i < $nbr_app; $i++) {
                    $app_name = $installable_app[$i];
                    if ($vps["operatingsystem"] == $os_name) {
                        $selected = " selected ";
                    } else {
                        $selected = "";
                    }
                    $out .= "<option value=\"{$app_name}\" {$selected}>{$app_name} (" . _("applicance builder") . ")</option>";
                }
                $out .= "</select></td></tr>\n<tr><td>" . "VPS root password:"******" </td><td><input type=\"password\" name=\"root_password\"><input type=\"hidden\" name=\"action\" value=\"reinstall_os\"></td></tr>\n<tr><td></td><td>" . submitButtonStart() . _("Reinstall operating system") . submitButtonEnd() . "\n</td></tr></table></form>";
                //		}
                // BSD kernel change popup
                if ($vps["operatingsystem"] == "netbsd") {
                    if ($vps["bsdkernel"] == "install") {
                        $normal_selected = " ";
                        $install_selected = " selected ";
                    } else {
                        $normal_selected = " selected ";
                        $install_selected = " ";
                    }
                    $out .= $frm_start . "<select name=\"bsdkernel\">\n    <option value=\"normal\" {$normal_selected}>Normal</option>\n    <option value=\"install\" {$install_selected}>Install</option>\n    </select><input type=\"hidden\" name=\"action\" value=\"change_bsd_kernel_type\">\n    " . submitButtonStart() . _("Change NetBSD kernel") . submitButtonEnd() . "\n    </form>";
                }
                if ($vps["operatingsystem"] == "xenhvm") {
                    $vps_xenhvm_iso = getVPSIso($vps_node, $vps_name, $soap_client);
                    $out .= "<br><br>" . _("To upload .iso files so they appear below and you can boot on them, you can upload them using ftp, ") . "xen{$vps_name}@{$vps_node}" . _(" using the password of your physical console.") . "<br><br>";
                    $boot_device_selector = "<select name=\"xenhvm_iso\">\n<option value=\"hdd\">" . _("Boot on hard drive") . "</option>";
                    $n_iso = sizeof($vps_xenhvm_iso);
                    if (is_array($vps_xenhvm_iso)) {
                        for ($i = 0; $i < $n_iso; $i++) {
                            $iso = $vps_xenhvm_iso[$i];
                            if ($vps["howtoboot"] == $iso) {
                                $selected = " selected ";
                            } else {
                                $selected = " ";
                            }
                            $boot_device_selector .= "<option value=\"" . htmlspecialchars($iso) . "\" {$selected}>" . htmlspecialchars($iso) . "</option>";
                        }
                    }
                    $boot_device_selector .= "</select>";
                    if ($vps["vncpassword"] == "no_vnc") {
                        $vncons_act_yes_selected = " ";
                        $vncons_act_no_selected = " checked ";
                    } else {
                        $vncons_act_yes_selected = " ";
                        $vncons_act_no_selected = " checked ";
                    }
                    $out .= dtcFormTableAttrs();
                    $out .= dtcFormLineDraw($frm_start . _("Boot device: "), "<input type=\"hidden\" name=\"action\" value=\"change_xenhvm_boot_iso\">" . $boot_device_selector, 1);
                    $out .= dtcFormLineDraw(_("VNC console password: "******"<input type=\"text\" name=\"vnc_console_pass\" value=\"\">", 0);
                    $out .= dtcFormLineDraw(_("VNC console activation: "), "<input type=\"radio\" name=\"vnc_console_activate\" value=\"yes\" {$vncons_act_yes_selected}>" . _("yes") . " <input type=\"radio\" name=\"vnc_console_activate\" value=\"no\" {$vncons_act_no_selected}>" . _("no"), 1);
                    $out .= dtcFormLineDraw("", submitButtonStart() . _("Write parameters") . submitButtonEnd(), 0);
                    $out .= "</table></form>";
                }
            }
        }
    }
    $out .= "<br><br>";
    // SSH Physical console password changing
    $out .= "<h3>" . _("Physical console last display and ssh access:") . "</h3><br>";
    $out .= "Once your VPS is installed, ssh to the physical console to use it for the first time." . "<br><br>";
    $out .= dtcFormTableAttrs();
    $out .= dtcFormLineDraw($frm_start . "<input type=\"hidden\" name=\"action\" value=\"change_xm_console_ssh_passwd\">" . _("New SSH password: "******"<input size=\"40\" type=\"text\" name=\"new_password\" value=\"\"></td><td>" . submitButtonStart() . _("Ok") . submitButtonEnd() . "</form>", 1);
    $out .= dtcFormLineDraw($frm_start . "<input type=\"hidden\" name=\"action\" value=\"change_xm_console_ssh_key\">" . _("New SSH key: "), "<input size=\"40\" type=\"text\" name=\"new_key\" value=\"\"></td><td>" . submitButtonStart() . _("Ok") . submitButtonEnd() . "</form>", 0);
    $out .= "</table>";
    $out .= "<br><br>" . _("To access to your console, first enter a ssh password or key above, and then ssh to:") . "<br>xen" . $vps_name . "@" . $vps_node . "<br><br>";
    $out .= "<br>" . _("You should then install sshd in your VPS and use the physical console only for debugging purposes.");
    $out .= "<br>" . helpLink("PmWiki/Setup-A-VPS-Once-DTC-Xen-Installed-It");
    /* FIXME probably don't need any of this stuff'
    
    	if($reinstall_os == 1){
    		if($panel_type == "admin"){
    			$path_url = "/dtcadmin";
    		}else{
    			$path_url = "/dtc";
    		}
    		$ajax_url = "https://".$_SERVER["SERVER_NAME"].$path_url."/xanjaxPushlet.php?";
    		$ajax_auth = "adm_login="******"&adm_pass="******"&vps_node=".$vps_node."&vps_name=".$vps_name;
    		$r = "";
    	}else{
    		$r = $soap_client->call("getVPSInstallLog",array("vpsname" => $vps_name,"numlines" => "20"),"","","");
    		$err = $soap_client->getError();
    		if($err){
    			$r = _("Could not get VPS install log. Error: ").$err._(" maybe there are no logs yet?");
    		}
    		// print_r($r);
    		$r = str_replace("\n\n","\n",$r);
    	}
    */
    // tested AJAX stuff starts here
    $out .= "<script language=\"javascript\" src=\"xanjaxXHR.js\"></script>";
    $out .= "<h3>" . _("Installation log (last 20 lines):") . "</h3><br>";
    $out .= "<table cellspacing=\"0\" cellpadding=\"0\" border=\"1\">\n<tr><td bgcolor=\"black\"><font color=\"white\">{$vps_node}:{$vps_name}</font></td>\n<tr><td bgcolor=\"black\"><font color=\"white\"><pre id=\"reinstall_os_log\" class=\"reinstall_os_log\"><font color=\"red\">dtc-xen</font>@<font color=\"blue\">{$vps_node}</font>&gt;_ #<br>...</pre></font></td>\n</table>";
    $out .= "\n\t\t<script type=\"text/javascript\">\n\t\t\txanGet(logPushlet,\"logPushlet.php?vps_node=" . $vps_node . "&vps_name=" . $vps_name . "\");\n\t\t</script>";
    return $out;
}