Commit c7ab115f authored by Florian Schaal's avatar Florian Schaal

Add option to "name" default php-version for websites per server (#5089)

parent b1cfd5bb
......@@ -102,6 +102,7 @@ php_fpm_ini_path=/etc/php5/fpm/php.ini
php_fpm_pool_dir=/etc/php5/fpm/pool.d
php_fpm_start_port=9010
php_fpm_socket_dir=/var/lib/php5-fpm
php_default_name=Default
set_folder_permissions_on_update=n
add_web_users_to_sshusers_group=y
connect_userid_to_webid=n
......
......@@ -1094,6 +1094,16 @@ $form["tabs"]['web'] = array(
'width' => '40',
'maxlength' => '255'
),
'php_default_name' => array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'Default',
'validators' => array( 0 => array('type' => 'NOTEMPTY',
'errmsg' => 'php_default_name_error_empty'),
),
'width' => '40',
'maxlength' => '255'
),
'php_fpm_init_script' => array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
......
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,5 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Beschreibung Standard PHP';
$wb['php_default_name_error_empty'] = 'Beschreibung Standard PHP ist leer.';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -292,4 +292,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -291,4 +291,6 @@ $wb['logging_txt'] = 'Store website access and error logs';
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
$wb['log_retention_txt'] = 'Log retention (days)';
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
?>
......@@ -256,7 +256,10 @@
<div id="collapsePHP" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingPHP">
<div class="panel-body">
<!-- Begin content -->
<div class="form-group apache">
<div class="form-group">
<label for="php_default_name" class="col-sm-3 control-label">{tmpl_var name='php_default_name_txt'}</label>
<div class="col-sm-9"><input type="text" name="php_default_name" id="php_default_name" value="{tmpl_var name='php_default_name'}" class="form-control" /></div></div>
<div class="form-group apache">
<label for="php_ini_path_apache" class="col-sm-3 control-label">{tmpl_var name='php_ini_path_apache_txt'}</label>
<div class="col-sm-9"><input type="text" name="php_ini_path_apache" id="php_ini_path_apache" value="{tmpl_var name='php_ini_path_apache'}" class="form-control" /></div></div>
<div class="form-group apache">
......
......@@ -97,6 +97,8 @@ if($type == 'getphpfastcgi'){
} elseif($php_type == 'fast-cgi'){
$php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = ? AND active = 'y'".$sql_where, $server_id);
}
$php_records[]=array('name' => $web_config['php_default_name']);
uasort($php_records, 'sort_php');
$php_select = "";
if(is_array($php_records) && !empty($php_records)) {
foreach( $php_records as $php_record) {
......@@ -243,4 +245,9 @@ if($type == 'getclientssldata'){
header('Content-type: application/json');
echo $json;
function sort_php($a, $b) {
return strcmp($a['name'], $b['name']);
}
?>
......@@ -444,8 +444,8 @@
function reloadFastcgiPHPVersions(noFormChange) {
jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {server_id : serverId, php_type : jQuery('#php').val(), type : "getphpfastcgi", client_group_id : clientGroupId}, function(data) {
var options = '<option value="">Default</option>';
//var options = '';
//var options = '<option value="">Default</option>';
var options = '';
var phpfastcgiselected = '';
$.each(data, function(key, val) {
<tmpl_if name="id">
......@@ -468,7 +468,7 @@
</tmpl_else>
phpfastcgiselected = '';
</tmpl_if>
options += '<option value=""'+phpfastcgiselected+'>{tmpl_var name="default_php_txt"}</option>';
//options += '<option value=""'+phpfastcgiselected+'>{tmpl_var name="default_php_txt"}</option>';
$('#fastcgi_php_version').html(options).change();
if(noFormChange) ISPConfig.resetFormChanged();
});
......
......@@ -239,6 +239,7 @@ class page_action extends tform_actions {
//PHP Version Selection (FastCGI)
$server_type = 'apache';
//print_r($web_config[$server_id]);exit;
if(!empty($web_config[$server_id]['server_type'])) $server_type = $web_config[$server_id]['server_type'];
if($server_type == 'nginx' && $this->dataRecord['php'] == 'fast-cgi') $this->dataRecord['php'] = 'php-fpm';
......@@ -257,7 +258,7 @@ class page_action extends tform_actions {
$php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = ? AND (client_id = 0 OR client_id=?) AND active = 'y'", $parent_domain['server_id'], $_SESSION['s']['user']['client_id']);
}
}
$php_select = "<option value=''>Default</option>";
$php_select = "<option value=''>".$web_config['php_default_name']."</option>";
if(is_array($php_records) && !empty($php_records)) {
foreach( $php_records as $php_record) {
if($this->dataRecord['php'] == 'php-fpm' || ($this->dataRecord['php'] == 'hhvm' && $server_type == 'nginx')){
......@@ -404,7 +405,7 @@ class page_action extends tform_actions {
$php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = ? AND (client_id = 0 OR client_id=?) AND active = 'y'", $parent_domain['server_id'], $_SESSION['s']['user']['client_id']);
}
}
$php_select = "<option value=''>Default</option>";
$php_select = "<option value=''>".$web_config['php_default_name']."</option>";
if(is_array($php_records) && !empty($php_records)) {
foreach( $php_records as $php_record) {
if($this->dataRecord['php'] == 'php-fpm' || ($this->dataRecord['php'] == 'hhvm' && $server_type == 'nginx')){
......@@ -624,7 +625,7 @@ class page_action extends tform_actions {
$php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = ? AND active = 'y'", $parent_domain['server_id']);
}
}
$php_select = "<option value=''>Default</option>";
$php_select = "<option value=''>".$web_config['php_default_name']."</option>";
if(is_array($php_records) && !empty($php_records)) {
foreach( $php_records as $php_record) {
if($this->dataRecord['php'] == 'php-fpm' || ($this->dataRecord['php'] == 'hhvm' && $server_type == 'nginx')){
......@@ -952,7 +953,7 @@ class page_action extends tform_actions {
function onSubmit() {
global $app, $conf;
//print_r($this->dataRecord);exit;
// Set a few fixed values
$this->dataRecord["vhost_type"] = 'name';
if($this->_vhostdomain_type == 'domain') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment