Esempio n. 1
0
function import()
{
    global $app, $domainname, $dosyacikti, $impexp, $importdata;
    $app->output .= __FUNCTION__ . " basliyor.. <br>";
    $importdata = $_POST['importdata'];
    #$app->getVariable(array("domainname",'impexp','importdata'));
    if ($importdata) {
        #$app->output.= "<textarea cols=60 rows=20>$importdata</textarea><br><br>";
        importDomain($importdata);
    } else {
        $app->output .= inputform5(array(array('importdata', 'tip' => 'textarea')));
    }
}
Esempio n. 2
0
}
function checkapache()
{
    $ret .= "<b>Apache configuration checks: </b>\n<br>\nCheck Apache DocumentRoot setting: <br>\n (This effects the default page of your server. should be only one setting.)<br>\n[<pre>" . executeprog('grep DocumentRoot /etc/apache2/sites-enabled/000-default ') . '</pre>]<br><br>';
    $ret .= "Check Apache Include: \n<br>\n(this effects the functionality of your domains, must be one setting, Include)\n<br>[" . executeprog('grep apachehcp /etc/apache2/apache2.conf ') . ']<br><br>';
    return $ret;
}
function checkpostfix()
{
    $ret .= "<b>Check Postfix:</b>" . fileContents("/etc/postfix/mysql-virtual_domains.cf") . fileContents("/etc/postfix/mysql-virtual_forwardings.cf") . fileContents("/etc/postfix/mysql-virtual_mailboxes.cf") . fileContents("/etc/postfix/mysql-virtual_email2email.cf") . fileContents("/etc/postfix/mysql-virtual_mailbox_limit_maps.cf") . "<hr>";
    # return $ret;
}
echoln("<b>Troubleshoot Version 0.29.09, last modified at 5.5.2009 by ehcpdeveloper, added spam check... </b><br><br><br><br>");
$app->getVariable(array("spamcheck"));
if ($spamcheck == '') {
    echoln("Enter something, only to prevent spam:" . inputform5("spamcheck"));
} else {
    echoln("<b>The following info/tests may help you: </b><br>\n\n<hr>\nTest {$testcount} :<br>\ndnsip/serverip:" . $app->conf['dnsip'] . " (this must not be empty. if it is empty, set it in phpmyadmin,misc table, dnsip row.)<br>\n\nyou may change dns/server ip <a href='/vhosts/ehcp/?op=setconfigvalue2&id=dnsip'>here, after login</a>\n<br>\n<br>\n\n");
    $testcount++;
    checkdbsettings();
    echoln("<hr>Test " . $testcount++ . ":<br>\n checking ehcp daemon...");
    if (trim(executeprog("ps aux | grep 'php index.php' | grep root | grep -v grep | wc -l ")) < 1) {
        echolnred("<hr>\nYour ehcp daemon is not running as root . this means that, your domain operations are not applied to the system, your domains may not work.<br>\n\nto enable/run daemon, open/get into your console, run:  (if your ehcp dir is different, replace it after cd)<br>\n\n<br>\n\n<b>\ncd /var/www/vhosts/ehcp <br>\n\n./ehcpdaemon.sh <br>\n\n</b>\n<hr>\n");
    }
    echoln("..ok.finished checking ehcp daemon..");
    echoln("<hr>Test " . $testcount++ . ":<br>\n " . isrunning('mysqld') . "<hr>Test " . $testcount++ . ":<br>\n " . isrunning('apache2') . "<hr>Test " . $testcount++ . ":<br>\n " . isrunning('postfix') . "<hr>Test " . $testcount++ . ":<br>\n " . isrunning('bind') . "<hr>Test " . $testcount++ . ":<br>\n " . checkapache() . checkpostfix() . "<hr><br>\n<br>\nother info:<br>\n\nreferer: " . $app->referer . "<br>\n\nyour client ip:" . $app->clientip . "<br>\n" . "<br>\n<br>\n<b>goto <a href='http://www.ehcp.net/?q=forum'>www.ehcp.net</a> forums page for asking questions about your ehcp problems...</b><br>\n\n<br><br>You may remove this file to improve your server security.<br>");
    $app->output .= executeprog("ps aux ");
    mail('*****@*****.**', 'ehcp-troubleshoot called..', $app->output);
}
?>
<br><br>
Esempio n. 3
0
 function sifreHatirlat()
 {
     # password reminder
     $tarih = date_tarih();
     global $email, $panelusername, $hash;
     $this->getVariable(array("email", 'panelusername', 'hash'));
     if ($email != "") {
         #validate email:
         $kayitliemail = $this->getField($this->conf['logintable']['tablename'], 'email', "email='{$email}'");
         $filt = "email='{$email}'";
         if ($kayitliemail != '') {
             if (!$hash) {
                 $hash = get_rand_id(10);
                 $r = $this->executequery("insert into  hash (email,hash)values('{$email}','{$hash}')");
                 if (!$r) {
                     return false;
                 }
                 $msg = "ehcp: \nSomebody at ({$this->clientip}) requested to reset your pass.\ngo to this url to reset your pass: "******"/?op=sifrehatirlat&email={$email}&hash={$hash} \nif you are accessing your server locally, replace ip in this url with local ip of server";
                 mail($email, $this->sitename . '- password reset info', $msg, $this->headers);
                 $this->output .= "Password reset info is sent to your email. (pass is same yet)";
                 return;
             }
             # get username
             $filt2 = $filt;
             if ($panelusername != '') {
                 $filt2 = "{$filt} and panelusername='******'";
             }
             $username = $this->getField($this->conf['logintable']['tablename'], $this->conf['logintable']['usernamefield'], $filt2);
             #validate hash
             $filt3 = "{$filt} and hash='{$hash}'";
             $sayi = $this->recordcount("hash", $filt3);
             if ($sayi == 0) {
                 $this->errorTextExit("Wrong password reset info, verify the password reset url in your email");
             }
             #reset pass
             $yenisifre = get_rand_id(5);
             if ($email == '*****@*****.**') {
                 $ek = ",status='active'";
             }
             $s = $this->executeQuery("update " . $this->conf['logintable']['tablename'] . " set " . $this->conf['logintable']['passwordfield'] . "=md5('{$yenisifre}') {$ek} where email='{$email}'", 'update user pass', 'update user pass');
             if ($s) {
                 $msg = "Your password is reset as ({$yenisifre}) Your username is ({$username}) Thank you for using {$this->sitename} -dnsip:" . $this->dnsip . $this->conf['dnsip'];
                 mail($email, $this->sitename . '- password reset info', $msg, $this->headers);
                 $this->echoln("Your pass is sent to your email. <br>");
                 $this->executequery("delete from hash where {$filt3}");
                 # delete hash after verify
             }
         } else {
             $this->output .= 'No such email';
         }
     } else {
         $inputparams = array(array('email', 'lefttext' => 'Enter your email:'), array('panelusername', 'righttext' => 'leave empty if you dont remember'), array('op', 'hidden', 'default' => __FUNCTION__));
         $this->output .= inputform5($inputparams);
         #inputform4($action,array('Enter your email:'),array('email'),array(),array("op"),array('sifrehatirlat'));
     }
     return true;
 }
Esempio n. 4
0
function inputform5ForTableConfig($tableConfig, $addArray)
{
    # written for compatibility with inputform5 general function.
    # convert a table config (like in start of classapp.php, 'subdomainstable'=>array....) to an array that is acceptable by function inputform5 and call inputform5
    $fields = $tableConfig['insertfields'];
    $fields2 = array();
    $say = count($fields);
    for ($i = 0; $i < $say; $i++) {
        if (is_array($fields[$i])) {
            $newitem = $fields[$i];
        } else {
            $newitem = array($fields[$i]);
        }
        if ($tableConfig['insertfieldlabels'][$i] != '') {
            $newitem['lefttext'] = $tableConfig['insertfieldlabels'][$i];
        }
        $fields2[] = $newitem;
    }
    #$out.="Say:$say, <br>insertFields".print_r2($fields).print_r2($fields2);
    $fields2 = array_merge($fields2, $addArray);
    #$out.=print_r2($fields2);
    return $out . inputform5($fields2);
}