Ejemplo n.º 1
0
function install_vsftpd_server()
{
    global $app, $ehcpinstalldir, $ip, $user_email, $user_name, $ehcpmysqlpass, $rootpass, $newrootpass, $ehcpadminpass;
    passthru("apt-get remove proftpd");
    aptget(array('vsftpd'));
    passthru("useradd --home " . $app->conf['vhosts'] . " --gid " . $app->ftpgroup . " -m --shell /bin/false " . $app->ftpuser);
    passthru("cp /etc/vsftpd.conf /etc/vsftpd.conf_orig");
    vsftpd_configuration(array('ehcppass' => $ehcpmysqlpass));
}
Ejemplo n.º 2
0
 function fixMailConfiguration()
 {
     # this re-runs function mailconfiguration,configurepamsmtp, configureauthmysql, that is, mail related functions in install_lib.php
     # purpose: in case mail/ehcp configuration is corrupted, or ehcp mysql db pass changed, update system configuration accordingly
     # this function was for mail configuration at start, became whole ehcp configuration later.. included vsftpd, net2ftp... and so on..
     include_once "install_lib.php";
     $this->write_file_if_not_exists('/etc/mailname', 'mail.myserver.com');
     # on some systems, this is deleted somehow.
     if (!file_exists('/etc/postfix/main.cf')) {
         passthru2("cp " . $this->ehcpdir . "/etc/postfix/main.cf.sample /etc/postfix/main.cf");
     }
     # on some systems, this is deleted somehow.
     $params = array('ehcppass' => $this->dbpass);
     $params2 = array_merge($params, array('ehcpinstalldir' => $this->conf['ehcpdir']));
     global $ip, $ehcpmysqlpass, $ehcpinstalldir;
     include 'config.php';
     $ip = $this->miscconfig['dnsip'];
     $ehcpmysqlpass = $dbpass;
     $ehcpinstalldir = $this->conf['ehcpdir'];
     $this->adjust_webmail_dirs();
     mailconfiguration($params);
     passthru2('newaliases');
     vsftpd_configuration($params);
     # reset vsftpd conf too, this is added later than vers 0.29.09
     net2ftp_configuration($params2);
     $this->syncDns();
     $this->syncDomains();
     passthru2("chmod a+w " . $this->ehcpdir . "/webmail/data");
     passthru2("chmod a+w " . $this->ehcpdir . "/net2ftp/temp");
     passthru2("/etc/init.d/vsftpd restart");
     passthru2("/etc/init.d/postfix restart");
     return True;
 }
Ejemplo n.º 3
0
 function fixMailConfiguration()
 {
     /*
     Şöyle birşey yapılabilir:
     arayüzden bir komut ile, sunucuda bazı kontroller yapılıp bir rapor hazırlanabilir, bu rapor, gerek soru sorarken, gerekse problemleri teşhis ederken işe yarayabilir. 
     rapor daemon tarafından hazırlanır, hazır olunca da gui'de bir ikaz görünebilir.
     Mesela, /etc/postfix/main.cf içinde "dovecot" geçiyorsa, birşeyler ters gidebilir. 
     /var/spool/postfix/  sahipliği doğru değilse, sıkıntı olabilir gibi.. 
     */
     # this re-runs function mailconfiguration,configurepamsmtp, configureauthmysql, that is, mail related functions in install_lib.php
     # purpose: in case mail/ehcp configuration is corrupted, or ehcp mysql db pass changed, update system configuration accordingly
     # this function was for mail configuration at start, became whole ehcp configuration later.. included vsftpd, net2ftp... and so on..
     include_once "install_lib.php";
     $this->write_file_if_not_exists('/etc/mailname', 'mail.myserver.com');
     # on some systems, this is deleted somehow.
     if (!file_exists('/etc/postfix/main.cf')) {
         passthru2("cp " . $this->ehcpdir . "/etc/postfix/main.cf.sample /etc/postfix/main.cf");
     }
     # on some systems, this is deleted somehow.
     $params = array('ehcppass' => $this->dbpass);
     $params2 = array_merge($params, array('ehcpinstalldir' => $this->conf['ehcpdir']));
     global $ip, $ehcpmysqlpass, $ehcpinstalldir;
     include 'config.php';
     $ip = $this->miscconfig['dnsip'];
     $ehcpmysqlpass = $dbpass;
     $ehcpinstalldir = $this->conf['ehcpdir'];
     $this->adjust_webmail_dirs();
     mailconfiguration($params);
     passthru2('newaliases');
     vsftpd_configuration($params);
     # reset vsftpd conf too, this is added later than vers 0.29.09
     net2ftp_configuration($params2);
     $this->syncDns();
     $this->syncDomains();
     passthru2("chmod a+w " . $this->ehcpdir . "/webmail/data");
     passthru2("chmod a+w " . $this->ehcpdir . "/net2ftp/temp");
     passthru2("/etc/init.d/vsftpd restart");
     passthru2("/etc/init.d/postfix restart");
     return True;
 }