Commit 9664e7fe authored by Marius Cramer's avatar Marius Cramer

Merge branch 'default_php_handler' into 'master'

Default php handler

I added a default php handler setting for server. I want to use PHP-FPM for hostings, so I only enable PHP-FPM on client templates. However, when admin create hosting must remember to change php handler becuase default is FastCGI. With this patch, default php for default server is set.
parents 8a4a1faf 3245aa93
......@@ -880,6 +880,13 @@ $form["tabs"]['web'] = array(
'width' => '10',
'maxlength' => '255'
),
'php_handler' => array(
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => 'fast-cgi',
'value' => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM'),
'searchable' => 2
),
'nginx_cgi_socket' => array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
......
......@@ -200,4 +200,6 @@ $wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
$wb["overquota_db_notify_admin_txt"] = 'Send DB quota warnings to admin';
$wb["overquota_db_notify_client_txt"] = 'Send DB quota warnings to client';
$wb['monitor_system_updates_txt'] = 'Check for Linux updates';
$wb['php_handler_txt'] = "PHP Handler";
$wb['disabled_txt'] = 'Disabled';
?>
......@@ -192,4 +192,6 @@ $wb['munin_url_note_txt'] = 'Marcadores:';
$wb['backup_dir_is_mount_txt'] = '¿El directorio de copias de seguridad es un punto de montaje?';
$wb['backup_dir_mount_cmd_txt'] = 'Comando para montar, si el directorio de copias de seguridad no está montado';
$wb['monitor_system_updates_txt'] = 'Comprobar actualizaciones de linux';
$wb['php_handler_txt'] = "Manejador de PHP";
$wb['disabled_txt'] = "Desactivado";
?>
......@@ -233,6 +233,14 @@
<label for="php_ini_check_minutes">{tmpl_var name='php_ini_check_minutes_txt'}</label>
<input name="php_ini_check_minutes" id="php_ini_check_minutes" value="{tmpl_var name='php_ini_check_minutes'}" size="40" type="text" class="textInput" /> {tmpl_var name='php_ini_check_minutes_info_txt'}
</div>
<div class="ctrlHolder">
<label for="php_handler">{tmpl_var name='php_handler_txt'}</label>
<div class="multiField">
<select name="php_handler" id="php_handler" class="selectInput">
{tmpl_var name='php_handler'}
</select>
</div>
</div>
</div>
<div class="subsectiontoggle"><span></span>{tmpl_var name='apps_vhost_settings_txt'}<em></em></div>
<div style="display:none;">
......
......@@ -113,12 +113,16 @@ class page_action extends tform_actions {
$client_group_id = $_SESSION["s"]["user"]["default_group"];
$client = $app->db->queryOneRecord("SELECT client.web_servers FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
$web_servers = explode(',', $client['web_servers']);
$app->tpl->setVar("server_id_value", $web_servers[0]);
$server_id = $web_servers[0];
$app->tpl->setVar("server_id_value", $server_id);
unset($web_servers);
} else {
$settings = $app->getconf->get_global_config('sites');
$app->tform->formDef['tabs']['domain']['fields']['server_id']['default'] = intval($settings['default_webserver']);
$server_id = intval($settings['default_webserver']);
$app->tform->formDef['tabs']['domain']['fields']['server_id']['default'] = $server_id;
}
$web_config = $app->getconf->get_server_config($server_id, 'web');
$app->tform->formDef['tabs']['domain']['fields']['php']['default'] = $web_config['php_handler'];
$app->tform->formDef['tabs']['domain']['readonly'] = false;
$app->tpl->setVar('vhostdomain_type', $this->_vhostdomain_type);
......
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