@@ -845,12 +845,12 @@ function update($event_name, $data) {
845845
846846 if (isset ($ jailkit_config ['jailkit_hardlinks ' ])) {
847847 if ($ jailkit_config ['jailkit_hardlinks ' ] == 'yes ' ) {
848- $ options = array ( 'hardlink ' , );
848+ $ options = array ('hardlink ' );
849849 } elseif ($ jailkit_config ['jailkit_hardlinks ' ] == 'no ' ) {
850850 $ options = array ();
851851 }
852852 } else {
853- $ options = array ( 'allow_hardlink ' , );
853+ $ options = array ('allow_hardlink ' );
854854 }
855855
856856 $ options [] = 'force ' ;
@@ -1249,6 +1249,7 @@ function update($event_name, $data) {
12491249 //* Create custom php.ini
12501250 if (trim ($ data ['new ' ]['custom_php_ini ' ]) != '' ) {
12511251 $ has_custom_php_ini = true ;
1252+ $ custom_sendmail_path = false ;
12521253 if (!is_dir ($ custom_php_ini_dir )) $ app ->system ->mkdirpath ($ custom_php_ini_dir );
12531254
12541255 $ php_ini_content = $ this ->get_master_php_ini_content ($ data ['new ' ]);
@@ -1273,6 +1274,13 @@ function update($event_name, $data) {
12731274 }
12741275 }
12751276
1277+ $ custom_sendmail_path = false ;
1278+ $ line = strtok ($ php_ini_content , '\n ' );
1279+ while ($ line !== false ) {
1280+ if (strpos ($ line , 'sendmail_path ' ) === 0 ) $ custom_sendmail_path = true ;
1281+ $ line = strtok ('\n ' );
1282+ }
1283+
12761284 $ app ->system ->file_put_contents ($ custom_php_ini_dir .'/php.ini ' , $ php_ini_content );
12771285 } else {
12781286 $ has_custom_php_ini = false ;
@@ -1317,7 +1325,7 @@ function update($event_name, $data) {
13171325 $ trans = array (
13181326 '{DOCROOT} ' => $ vhost_data ['web_document_root_www ' ],
13191327 '{DOCROOT_CLIENT} ' => $ vhost_data ['web_document_root ' ],
1320- '{DOMAIN} ' => $ vhost_data ['domain ' ]
1328+ '{DOMAIN} ' => $ vhost_data ['domain ' ]
13211329 );
13221330 $ vhost_data ['apache_directives ' ] = strtr ($ vhost_data ['apache_directives ' ], $ trans );
13231331
@@ -1382,6 +1390,8 @@ function update($event_name, $data) {
13821390 $ vhost_data ['seo_redirect_enabled ' ] = 0 ;
13831391 }
13841392
1393+ $ vhost_data ['custom_sendmail_path ' ] = (isset ($ custom_sendmail_path ) && $ custom_sendmail_path ) ? 'y ' : 'n ' ;
1394+
13851395 $ tpl ->setVar ($ vhost_data );
13861396 $ tpl ->setVar ('apache_version ' , $ app ->system ->getapacheversion ());
13871397
@@ -1405,13 +1415,13 @@ function update($event_name, $data) {
14051415
14061416 switch ($ data ['new ' ]['subdomain ' ]) {
14071417 case 'www ' :
1408- $ rewrite_rules [] = array ( 'rewrite_domain ' => '^ ' .$ this ->_rewrite_quote ($ data ['new ' ]['domain ' ]),
1418+ $ rewrite_rules [] = array ('rewrite_domain ' => '^ ' .$ this ->_rewrite_quote ($ data ['new ' ]['domain ' ]),
14091419 'rewrite_type ' => ($ data ['new ' ]['redirect_type ' ] == 'no ' )?'' :'[ ' .$ data ['new ' ]['redirect_type ' ].'] ' ,
14101420 'rewrite_target ' => $ rewrite_target ,
14111421 'rewrite_target_ssl ' => $ rewrite_target_ssl ,
14121422 'rewrite_is_url ' => ($ this ->_is_url ($ rewrite_target ) ? 'y ' : 'n ' ),
14131423 'rewrite_add_path ' => (substr ($ rewrite_target , -1 ) == '/ ' ? 'y ' : 'n ' ));
1414- $ rewrite_rules [] = array ( 'rewrite_domain ' => '^ ' . $ this ->_rewrite_quote ('www. ' .$ data ['new ' ]['domain ' ]),
1424+ $ rewrite_rules [] = array ('rewrite_domain ' => '^ ' . $ this ->_rewrite_quote ('www. ' .$ data ['new ' ]['domain ' ]),
14151425 'rewrite_type ' => ($ data ['new ' ]['redirect_type ' ] == 'no ' )?'' :'[ ' .$ data ['new ' ]['redirect_type ' ].'] ' ,
14161426 'rewrite_target ' => $ rewrite_target ,
14171427 'rewrite_target_ssl ' => $ rewrite_target_ssl ,
@@ -3439,6 +3449,7 @@ private function php_fpm_pool_update ($data, $web_config, $pool_dir, $pool_name,
34393449 }
34403450
34413451 $ custom_session_save_path = false ;
3452+ $ custom_sendmail_path = false ;
34423453 if ($ custom_php_ini_settings != '' ){
34433454 // Make sure we only have Unix linebreaks
34443455 $ custom_php_ini_settings = str_replace ("\r\n" , "\n" , $ custom_php_ini_settings );
@@ -3456,6 +3467,7 @@ private function php_fpm_pool_update ($data, $web_config, $pool_dir, $pool_name,
34563467 if ($ value != '' ){
34573468 $ key = trim ($ key );
34583469 if ($ key == 'session.save_path ' ) $ custom_session_save_path = true ;
3470+ if ($ key == 'sendmail_path ' ) $ custom_sendmail_path = true ;
34593471 switch (strtolower ($ value )) {
34603472 case '0 ' :
34613473 // PHP-FPM might complain about invalid boolean value if you use 0
@@ -3478,6 +3490,7 @@ private function php_fpm_pool_update ($data, $web_config, $pool_dir, $pool_name,
34783490 }
34793491
34803492 $ tpl ->setVar ('custom_session_save_path ' , ($ custom_session_save_path ? 'y ' : 'n ' ));
3493+ $ tpl ->setVar ('custom_sendmail_path ' , ($ custom_sendmail_path ? 'y ' : 'n ' ));
34813494
34823495 $ tpl ->setLoop ('custom_php_ini_settings ' , $ final_php_ini_settings );
34833496
@@ -3700,12 +3713,12 @@ function _setup_jailkit_chroot()
37003713
37013714 if (isset ($ this ->jailkit_config ) && isset ($ this ->jailkit_config ['jailkit_hardlinks ' ])) {
37023715 if ($ this ->jailkit_config ['jailkit_hardlinks ' ] == 'yes ' ) {
3703- $ options = array ( 'hardlink ' , );
3716+ $ options = array ( 'hardlink ' );
37043717 } elseif ($ this ->jailkit_config ['jailkit_hardlinks ' ] == 'no ' ) {
37053718 $ options = array ();
37063719 }
37073720 } else {
3708- $ options = array ( 'allow_hardlink ' , );
3721+ $ options = array ( 'allow_hardlink ' );
37093722 }
37103723
37113724 // should move return here if $this->website['new_jailkit_hash'] == $this->website['last_jailkit_hash'] ?
0 commit comments