@@ -226,11 +226,10 @@ public function configure_database() {
226226
227227 //* check sql-mode
228228 $ check_sql_mode = $ this ->db ->queryOneRecord ("SELECT @@sql_mode " );
229-
230- if ($ check_sql_mode ['@@sql_mode ' ] != '' && $ check_sql_mode ['@@sql_mode ' ] != 'NO_ENGINE_SUBSTITUTION ' ) {
229+ if ($ check_sql_mode ['@@sql_mode ' ] != '' && strpos ($ check_sql_mode ['@@sql_mode ' ],'NO_ENGINE_SUBSTITUTION ' )===false ) {
231230 echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add \n\n" ;
232231 echo " sql-mode= \"NO_ENGINE_SUBSTITUTION \"\n\n" ;
233- echo "to the mysqld-section in your mysql-config and restart mysqld afterwards \n" ;
232+ echo "to the mysqld-section in your mysql-config on the server \n" ;
234233 die ();
235234 }
236235
@@ -1534,11 +1533,6 @@ public function configure_pureftpd() {
15341533 chmod ($ config_dir .'/ ' .$ configfile , 0600 );
15351534 chown ($ config_dir .'/ ' .$ configfile , 'root ' );
15361535 chgrp ($ config_dir .'/ ' .$ configfile , 'root ' );
1537- // **enable chrooting
1538- //exec('mkdir -p '.$config_dir.'/conf/ChrootEveryone');
1539- exec ('echo "yes" > ' .$ config_dir .'/conf/ChrootEveryone ' );
1540- exec ('echo "yes" > ' .$ config_dir .'/conf/BrokenClientsCompatibility ' );
1541- exec ('echo "yes" > ' .$ config_dir .'/conf/DisplayDotFiles ' );
15421536
15431537 if (is_file ('/etc/default/pure-ftpd-common ' )) {
15441538 replaceLine ('/etc/default/pure-ftpd-common ' , 'STANDALONE_OR_INETD=inetd ' , 'STANDALONE_OR_INETD=standalone ' , 1 , 0 );
@@ -1551,10 +1545,36 @@ public function configure_pureftpd() {
15511545 //if(is_file($conf['init_scripts'].'/'.'openbsd-inetd')) exec($conf['init_scripts'].'/'.'openbsd-inetd restart');
15521546 }
15531547
1554- if (!is_file ('/etc/pure-ftpd/conf/DontResolve ' )) exec ('echo "yes" > /etc/pure-ftpd/conf/DontResolve ' );
1555-
1556- if (!is_file ('/etc/pure-ftpd/welcome.msg ' )) exec ('echo "FTP managed by ISPConfig" > /etc/pure-ftpd/welcome.msg ' );
1557- if (!is_file ('/etc/pure-ftpd/conf/FortunesFile ' )) exec ('echo "/etc/pure-ftpd/welcome.msg" > /etc/pure-ftpd/conf/FortunesFile ' );
1548+ if (!$ this ->is_update ) {
1549+ //* backup old settings
1550+ exec ("for i in $ config_dir/conf/*; do printf \$i\ ; cat \$i; printf ' \n'; done 2>&1 > $ config_dir/conf/.backup~ " );
1551+ //* clean common unused settings
1552+ exec ("rm $ config_dir/conf/MinUID $ config_dir/conf/PAMAuthentication $ config_dir/conf/PureDB $ config_dir/conf/UnixAuthentication 2> /dev/null " );
1553+ //* improves client compatibility
1554+ file_put_contents ("$ config_dir/conf/BrokenClientsCompatibility " ,"yes " );
1555+ //* needed for ispconfig implementation
1556+ file_put_contents ("$ config_dir/conf/ChrootEveryone " ,"yes " );
1557+ //* improves client compatibility
1558+ file_put_contents ("$ config_dir/conf/DisplayDotFiles " ,"yes " );
1559+ //* improves performance
1560+ file_put_contents ("$ config_dir/conf/DontResolve " ,"yes " );
1561+ //* complies with RFC2640
1562+ file_put_contents ("$ config_dir/conf/FSCharset " ,"UTF-8 " );
1563+ //* provides welcome message
1564+ file_put_contents ("$ config_dir/conf/FortunesFile " ,"$ config_dir/welcome.msg " );
1565+ //* increases the clients limit from 50 (default) to 1024
1566+ file_put_contents ("$ config_dir/conf/MaxClientsNumber " ,"1024 " );
1567+ //* prevents DoS attack from the same IP address
1568+ file_put_contents ("$ config_dir/conf/MaxClientsPerIP " ,"64 " );
1569+ //* needed for ispconfig implementation
1570+ file_put_contents ("$ config_dir/conf/MySQLConfigFile " ,"$ config_dir/db/mysql.conf " );
1571+ //* recommended for ispconfig implementation
1572+ file_put_contents ("$ config_dir/conf/NoAnonymous " ,"yes " );
1573+ //* grade A encryption
1574+ file_put_contents ("$ config_dir/conf/TLSCipherSuite " ,"ECDHE:AES256-SHA:AES128-SHA:DES-CBC3-SHA:!RC4 " );
1575+ //* hides implementation details
1576+ file_put_contents ("$ config_dir/welcome.msg " ,"Welcome " );
1577+ }
15581578 }
15591579
15601580 public function configure_mydns () {
0 commit comments