Example #1
0
$cutOffMsg = installer_t('This server is effectively cut off from the internet.');
$firewallMsg = installer_t('This is likely because the server is behind a firewall that is preventing outbound HTTP/HTTPS requests.');
// Defaults and presets:
$tryCurl = !$requirements['environment']['allow_url_fopen'];
$requirements['environment']['updates_connection'] = 0;
$requirements['environment']['outbound_connection'] = 0;
// Full network diagnosis:
if ($tryAccess) {
    // There exists one remote access method, so it's worth trying.
    //
    // Check outbound connection:
    if ($requirements['environment']['outbound_connection'] = checkDNS('google.com')) {
        // At least DNS is working, and at least for google.
        if ($requirements['environment']['outbound_connection'] = tryGetRemote('http://www.google.com')) {
            // Can connect to Google OK. Can connect to the updates server?
            if ($requirements['environment']['updates_connection'] = checkDNS('x2planet.com')) {
                if (!($requirements['environment']['updates_connection'] = tryGetRemote('https://x2planet.com/installs/registry/reqCheck'))) {
                    //
                    $reqMessages[2][] = installer_t('Could not reach the updates server from this web server.') . ' ' . $firewallMsg . ' ' . $updateMethodMsg . ' ' . $tmpProblemMsg;
                }
            } else {
                // No DNS for update server.
                $reqMessages[2][] = installer_t('The DNS record associated with the updates server is not available on this web server.') . ' ' . $updateMethodMsg . ' ' . $tmpProblemMsg;
            }
        } else {
            // Can resolve DNS but can't make web request.
            $reqMessages[2][] = $cutOffMsg . ' ' . $firewallMsg . ' ' . installer_t('It is also posible that no outbound network route exists.') . ' ' . $updateMethodMsg . ' ' . $googleIntegrationMsg;
        }
    } else {
        // DNS failed for Google! There's no outbound connection period
        $reqMessages[2][] = $cutOffMsg . ' ' . installer_t('This is due to local DNS resolution failing.') . ' ' . $updateMethodMsg . ' ' . $googleIntegrationMsg;
     } else {
         if ($addedby == 1) {
             $query2 = $sql->prepare("SELECT `ip`,`bitversion` FROM `rserverdata` WHERE `id`=? AND `resellerid`=? LIMIT 1");
             $query2->execute(array($row['rootid'], $resellerToUse));
             while ($row2 = $query2->fetch(PDO::FETCH_ASSOC)) {
                 $queryip = $row2['ip'];
                 $bitversion = $row2['bitversion'];
             }
         }
     }
 }
 if (!isset($masteractive) or !isset($usedns) or $masteractive == 'N') {
     $template_file = 'userpanel_404.tpl';
 } else {
     $dns = strtolower($ui->domain('dns', 'post'));
     $dnsCheck = checkDNS($dns, $id, $user_id, $type = 'server');
     if ($usedns == 'Y' and $dns != $olddns and $dns != '' and $dnsCheck !== false) {
         if (isset($tsdnsServerID) and isid($tsdnsServerID, 10) and isset($resellerToUse)) {
             $query = $sql->prepare("SELECT *,AES_DECRYPT(`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(`ssh2password`,:aeskey) AS `decryptedssh2password` FROM `voice_tsdns` WHERE `active`='Y' AND `id`=:id AND `resellerid`=:reseller_id LIMIT 1");
             $query->execute(array(':aeskey' => $aeskey, ':id' => $tsdnsServerID, ':reseller_id' => $resellerToUse));
             while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
                 $publickey = $row['publickey'];
                 $queryip = $row['ssh2ip'];
                 $ssh2port = $row['decryptedssh2port'];
                 $ssh2user = $row['decryptedssh2user'];
                 $ssh2password = $row['decryptedssh2password'];
                 $serverdir = $row['serverdir'];
                 $keyname = $row['keyname'];
                 $bit = $row['bitversion'];
                 $bitversion = $row['bitversion'];
             }
Example #3
0
function drawServerStatus()
{
    global $errTxt;
    if (checkPOP3()) {
        $pop3_status = '<font color="#00FF00">' . _("Running ok") . '</font>';
    } else {
        $pop3_status = '<font color="#FF0000">' . _("ERROR!") . $errTxt . '</font>';
    }
    if (checkSMTP()) {
        $smtp_status = '<font color="#00FF00">' . _("Running ok") . '</font>';
    } else {
        $smtp_status = '<font color="#FF0000">' . _("ERROR!") . $errTxt . '</font>';
    }
    if (checkDNS()) {
        $dns_status = '<font color="#00FF00">' . _("Running ok") . '</font>';
    } else {
        $dns_status = '<font color="#FF0000">' . _("ERROR!") . $errTxt . '</font>';
    }
    if (checkFTP()) {
        $ftp_status = '<font color="#00FF00">' . _("Running ok") . '</font>';
    } else {
        $ftp_status = '<font color="#FF0000">' . _("ERROR!") . $errTxt . '</font>';
    }
    $out = "<br><table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"1\">\n<tr>\n\t<td width=\"25%\" align=\"center\"><font color=\"#FFFFFF\">SMTP</font></td>\n\t<td width=\"25%\" align=\"center\"><font color=\"#FFFFFF\">POP3</font></td>\n\t<td width=\"25%\" align=\"center\"><font color=\"#FFFFFF\">DNS</font></td>\n\t<td width=\"25%\" align=\"center\"><font color=\"#FFFFFF\">FTP</font></td>\n</tr><tr>\n\t<td align=\"center\">{$smtp_status}</td>\n\t<td align=\"center\">{$pop3_status}</td>\n\t<td align=\"center\">{$dns_status}</td>\n\t<td align=\"center\">{$ftp_status}</td>\n</tr></table>";
    return $out;
}
     $error[] = "IP";
 }
 if ($ui->port('port', 'post')) {
     $port = $ui->port('port', 'post');
 } else {
     $error[] = "Port";
 }
 if ($ui->domain('dns', 'post')) {
     $dns = strtolower($ui->domain('dns', 'post'));
 } else {
     $error[] = "DNS";
 }
 if (count($error) == 0 and $ip == $oldip and $dns == $olddns and $port == $oldport) {
     $error[] = $spracheResponse->error_table;
 } else {
     if (count($error) == 0 and checkDNS($dns, $id, $user_id, 'dns') === false) {
         $error[] = "DNS";
     }
 }
 if (count($error) > 0) {
     $template_file = 'Error: ' . implode('<br />', $error);
 } else {
     include EASYWIDIR . '/stuff/keyphrasefile.php';
     $query = $sql->prepare("SELECT *,AES_DECRYPT(`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(`ssh2password`,:aeskey) AS `decryptedssh2password` FROM `voice_tsdns` WHERE `active`='Y' AND `id`=:id AND `resellerid`=:reseller_id LIMIT 1");
     $query->execute(array(':aeskey' => $aeskey, ':id' => $tsdnsID, ':reseller_id' => $reseller_id));
     while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
         $publickey = $row['publickey'];
         $queryip = $row['ssh2ip'];
         $ssh2port = $row['decryptedssh2port'];
         $ssh2user = $row['decryptedssh2user'];
         $ssh2password = $row['decryptedssh2password'];
Example #5
0
    <td height="20" bgcolor="#FFFFFF">ZEND Optimizer2.5.7以上 </td>
    <td height="20" bgcolor="#FFFFFF"><?php 
echo $OptimizerVersion_show;
?>
</td>
    <td height="20" bgcolor="#FFFFFF"><?php 
echo version_compare($OptimizerVersion, '2.5.7') >= 0 ? $pass : $fail;
?>
</td>
  </tr>
  
  <tr>
    <td height="20" bgcolor="#FFFFFF">DNS配置完成,本机上能通过域名访问网络</td>
    <td height="20" bgcolor="#FFFFFF">&nbsp;</td>
    <td height="20" bgcolor="#FFFFFF"><?php 
echo checkDNS() ? $pass : $fail;
?>
</td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="3" bgcolor="#FF9900">
  <tr>
    <td height="20" colspan="3" bgcolor="#CCCCCC">PHP配置检测</td>
  </tr>
  <tr>
    <td width="70%" height="20" align="center" bgcolor="#FFFFFF">要求</td>
    <td width="17%" height="20" align="center" bgcolor="#FFFFFF">实测</td>
    <td width="13%" align="center" bgcolor="#FFFFFF">结果</td>
  </tr>
  <tr>
    <td height="20" bgcolor="#FFFFFF">Mysql支持</td>
Example #6
0
 $doms = @mb_split("\r\n", $domains);
 while (list($k, $dom) = @each($doms)) {
     if ($dom) {
         $domain = GetDomainByDomain($dom);
         $zone = GetZoneByDomainOrderId($domain->id);
         print "<tr><td>{$dom}</td><td width=10 align=center>&nbsp;:&nbsp;</td><td>";
         if ($domain->uid == $_SESSION["userId"]) {
             if ($domain->lastDNSchangeTime) {
                 $minutes = (time() - $domain->lastDNSchangeTime) / 60;
             } else {
                 $minutes = 0;
             }
             if ($minutes and $changeDNStimeout and $minutes <= $changeDNStimeout) {
                 print $_lang[DomainsErrorDNSTimeout] . " (" . round($minutes, 2) . "/{$changeDNStimeout})";
             } else {
                 if ($zone->enableCheckNS and !checkDNS($domain->domain, $zone->id, $ns1, $ns2, $ns3, $ns4)) {
                     print $GLOBALerror;
                 } else {
                     if ($domain->todate == "0000-00-00" or $domain->status != "1" or $domain->leftdays < 0) {
                         print $_lang[DomainsErrorInactive];
                     } else {
                         if ($domain->autoregby) {
                             if (updateNS($domain->id, $ns1, $ns2, $ns3, $ns4)) {
                                 @mysql_query("update orders_domains set lastDNSchangeTime=" . time() . ",ns1='{$ns1}',ns2='{$ns2}',ns3='{$ns3}',ns4='{$ns4}',ns1ip='',ns2ip='',ns3ip='',ns4ip='' where id='{$domain->id}'") or die("File: " . __FILE__ . "<BR>Line: " . __LINE__ . "<BR>MySQL Error: " . mysql_error());
                                 print $_lang[DomainsChangeDNSSuccess];
                             } else {
                                 print $_lang[DomainsErrorChangeDNS] . " " . $GLOBALerror . "";
                             }
                         } else {
                             $nsss = "NS1: {$ns1}\nNS2: {$ns2}";
                             if ($ns3) {