| | |
| | | if(!stristr($data['new']['custom_php_ini'],'open_basedir') && $data['new']['php'] == 'suphp') { |
| | | $data['new']['custom_php_ini'] .= "\nopen_basedir = '".$data['new']['php_open_basedir']."'\n"; |
| | | } |
| | | |
| | | if(trim($data['new']['fastcgi_php_version']) != ''){ |
| | | list($custom_fastcgi_php_name, $custom_fastcgi_php_executable, $custom_fastcgi_php_ini_dir) = explode(':', trim($data['new']['fastcgi_php_version'])); |
| | | if(is_file($custom_fastcgi_php_ini_dir)) $custom_fastcgi_php_ini_dir = dirname($custom_fastcgi_php_ini_dir); |
| | | if(substr($custom_fastcgi_php_ini_dir,-1) == '/') $custom_fastcgi_php_ini_dir = substr($custom_fastcgi_php_ini_dir,0,-1); |
| | | } |
| | | |
| | | //* Create custom php.ini |
| | | if(trim($data['new']['custom_php_ini']) != '') { |
| | | $has_custom_php_ini = true; |
| | |
| | | if($data['new']['php'] == 'mod') { |
| | | $master_php_ini_path = $web_config['php_ini_path_apache']; |
| | | } else { |
| | | if($data["new"]['php'] == 'fast-cgi' && file_exists($fastcgi_config["fastcgi_phpini_path"])) { |
| | | $master_php_ini_path = $fastcgi_config["fastcgi_phpini_path"]; |
| | | if($data["new"]['php'] == 'fast-cgi') { |
| | | if(trim($data['new']['fastcgi_php_version']) != '' && file_exists($custom_fastcgi_php_ini_dir)){ |
| | | $master_php_ini_path = $custom_fastcgi_php_ini_dir; |
| | | } elseif(file_exists($fastcgi_config["fastcgi_phpini_path"])){ |
| | | $master_php_ini_path = $fastcgi_config["fastcgi_phpini_path"]; |
| | | } else { |
| | | $master_php_ini_path = $web_config['php_ini_path_cgi']; |
| | | } |
| | | } else { |
| | | $master_php_ini_path = $web_config['php_ini_path_cgi']; |
| | | } |
| | |
| | | // Support for multiple PHP versions (FastCGI) |
| | | if(trim($data['new']['fastcgi_php_version']) != ''){ |
| | | $default_fastcgi_php = false; |
| | | list($custom_fastcgi_php_name, $custom_fastcgi_php_executable, $custom_fastcgi_php_ini_dir) = explode(':', trim($data['new']['fastcgi_php_version'])); |
| | | if(is_file($custom_fastcgi_php_ini_dir)) $custom_fastcgi_php_ini_dir = dirname($custom_fastcgi_php_ini_dir); |
| | | if(substr($custom_fastcgi_php_ini_dir,-1) != '/') $custom_fastcgi_php_ini_dir .= '/'; |
| | | } else { |
| | | $default_fastcgi_php = true; |
| | |
| | | } |
| | | |
| | | //* Create .htaccess and .htpasswd file for website statistics |
| | | if(!is_file($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess') or $data['old']['document_root'] != $data['new']['document_root']) { |
| | | if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdir($data['new']['document_root'].'/' . $web_folder . '/stats'); |
| | | $ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user"; |
| | | $app->system->file_put_contents($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess',$ht_file); |
| | | $app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess',0755); |
| | | unset($ht_file); |
| | | } |
| | | //if(!is_file($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess') or $data['old']['document_root'] != $data['new']['document_root']) { |
| | | if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdir($data['new']['document_root'].'/' . $web_folder . '/stats'); |
| | | $ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user"; |
| | | $app->system->file_put_contents($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess',$ht_file); |
| | | $app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess',0755); |
| | | unset($ht_file); |
| | | //} |
| | | |
| | | if(!is_file($data['new']['document_root'].'/web/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) { |
| | | if(trim($data['new']['stats_password']) != '') { |