Skip to content

Commit 6de0aab

Browse files
committed
- Improved support for multiple PHP versions. Additional PHP versions have now their own form and database table.
1 parent c0f39a4 commit 6de0aab

29 files changed

+718
-62
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1+
CREATE TABLE `server_php` (
2+
`server_php_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
3+
`sys_userid` int(11) unsigned NOT NULL DEFAULT '0',
4+
`sys_groupid` int(11) unsigned NOT NULL DEFAULT '0',
5+
`sys_perm_user` varchar(5) DEFAULT NULL,
6+
`sys_perm_group` varchar(5) DEFAULT NULL,
7+
`sys_perm_other` varchar(5) DEFAULT NULL,
8+
`server_id` int(11) unsigned NOT NULL DEFAULT '0',
9+
`client_id` int(11) unsigned NOT NULL DEFAULT '0',
10+
`name` varchar(255) DEFAULT NULL,
11+
`php_fastcgi_binary` varchar(255) DEFAULT NULL,
12+
`php_fastcgi_ini_dir` varchar(255) DEFAULT NULL,
13+
`php_fpm_init_script` varchar(255) DEFAULT NULL,
14+
`php_fpm_ini_dir` varchar(255) DEFAULT NULL,
15+
`php_fpm_pool_dir` varchar(255) DEFAULT NULL,
16+
PRIMARY KEY (`server_php_id`)
17+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
118
ALTER TABLE `web_domain` ADD `fastcgi_php_version` VARCHAR( 255 ) NULL DEFAULT NULL;

install/sql/ispconfig3.sql

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,31 @@ CREATE TABLE `server_ip` (
10101010

10111011
-- --------------------------------------------------------
10121012

1013+
1014+
--
1015+
-- Table structure for table `server_php`
1016+
--
1017+
1018+
CREATE TABLE `server_php` (
1019+
`server_php_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
1020+
`sys_userid` int(11) unsigned NOT NULL DEFAULT '0',
1021+
`sys_groupid` int(11) unsigned NOT NULL DEFAULT '0',
1022+
`sys_perm_user` varchar(5) DEFAULT NULL,
1023+
`sys_perm_group` varchar(5) DEFAULT NULL,
1024+
`sys_perm_other` varchar(5) DEFAULT NULL,
1025+
`server_id` int(11) unsigned NOT NULL DEFAULT '0',
1026+
`client_id` int(11) unsigned NOT NULL DEFAULT '0',
1027+
`name` varchar(255) DEFAULT NULL,
1028+
`php_fastcgi_binary` varchar(255) DEFAULT NULL,
1029+
`php_fastcgi_ini_dir` varchar(255) DEFAULT NULL,
1030+
`php_fpm_init_script` varchar(255) DEFAULT NULL,
1031+
`php_fpm_ini_dir` varchar(255) DEFAULT NULL,
1032+
`php_fpm_pool_dir` varchar(255) DEFAULT NULL,
1033+
PRIMARY KEY (`server_php_id`)
1034+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1035+
1036+
-- --------------------------------------------------------
1037+
10131038
--
10141039
-- Table structure for table `shell_user`
10151040
--

install/tpl/server.ini.master

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ fastcgi_children=8
9090
fastcgi_max_requests=5000
9191
fastcgi_bin=/usr/bin/php-cgi
9292
fastcgi_config_syntax=1
93-
fastcgi_additional_php_versions=
9493

9594
[jailkit]
9695
jailkit_chroot_home=/home/[username]

interface/web/admin/form/server_config.tform.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -867,14 +867,6 @@
867867
'width' => '40',
868868
'maxlength' => '255'
869869
),
870-
'fastcgi_additional_php_versions' => array (
871-
'datatype' => 'VARCHAR',
872-
'formtype' => 'TEXT',
873-
'default' => '',
874-
'value' => '',
875-
'width' => '30',
876-
'maxlength' => '255'
877-
),
878870
##################################
879871
# ENDE Datatable fields
880872
##################################
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
/*
32+
Form Definition
33+
34+
Tabellendefinition
35+
36+
Datentypen:
37+
- INTEGER (Wandelt Ausdrücke in Int um)
38+
- DOUBLE
39+
- CURRENCY (Formatiert Zahlen nach Währungsnotation)
40+
- VARCHAR (kein weiterer Format Check)
41+
- TEXT (kein weiterer Format Check)
42+
- DATE (Datumsformat, Timestamp Umwandlung)
43+
44+
Formtype:
45+
- TEXT (normales Textfeld)
46+
- TEXTAREA (normales Textfeld)
47+
- PASSWORD (Feldinhalt wird nicht angezeigt)
48+
- SELECT (Gibt Werte als option Feld aus)
49+
- RADIO
50+
- CHECKBOX
51+
- FILE
52+
53+
VALUE:
54+
- Wert oder Array
55+
56+
Hinweis:
57+
Das ID-Feld ist nicht bei den Table Values einzufügen.
58+
59+
60+
*/
61+
62+
$form["title"] = "Additional PHP Versions";
63+
$form["description"] = "Form to edit additional PHP versions";
64+
$form["name"] = "server_php";
65+
$form["action"] = "server_php_edit.php";
66+
$form["db_table"] = "server_php";
67+
$form["db_table_idx"] = "server_php_id";
68+
$form["db_history"] = "yes";
69+
$form["tab_default"] = "php_name";
70+
$form["list_default"] = "server_php_list.php";
71+
$form["auth"] = 'yes';
72+
73+
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
74+
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
75+
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
76+
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
77+
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
78+
79+
$form["tabs"]['php_name'] = array (
80+
'title' => "Name",
81+
'width' => 80,
82+
'template' => "templates/server_php_name_edit.htm",
83+
'fields' => array (
84+
##################################
85+
# Beginn Datenbankfelder
86+
##################################
87+
'server_id' => array (
88+
'datatype' => 'INTEGER',
89+
'formtype' => 'SELECT',
90+
'default' => '',
91+
'datasource' => array ( 'type' => 'SQL',
92+
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
93+
'keyfield'=> 'server_id',
94+
'valuefield'=> 'server_name'
95+
),
96+
'value' => ''
97+
),
98+
'client_id' => array (
99+
'datatype' => 'INTEGER',
100+
'formtype' => 'SELECT',
101+
'default' => '',
102+
'datasource' => array ( 'type' => 'SQL',
103+
'querystring' => "SELECT client_id,CONCAT(contact_name,' :: ',username) as name FROM client WHERE {AUTHSQL} ORDER BY contact_name",
104+
'keyfield'=> 'client_id',
105+
'valuefield'=> 'name'
106+
),
107+
'value' => array(0 => ' ')
108+
),
109+
'name' => array (
110+
'datatype' => 'VARCHAR',
111+
'formtype' => 'TEXT',
112+
'validators' => array(0 => array('type' => 'NOTEMPTY',
113+
'errmsg' => 'server_php_name_error_empty'),
114+
),
115+
'default' => '',
116+
'value' => '',
117+
'separator' => '',
118+
'width' => '40',
119+
'maxlength' => '255'
120+
),
121+
##################################
122+
# ENDE Datenbankfelder
123+
##################################
124+
)
125+
);
126+
127+
$form["tabs"]['php_fastcgi'] = array(
128+
'title' => "FastCGI Settings",
129+
'width' => 80,
130+
'template' => "templates/server_php_fastcgi_edit.htm",
131+
'fields' => array(
132+
##################################
133+
# Begin Datatable fields
134+
##################################
135+
'php_fastcgi_binary' => array(
136+
'datatype' => 'VARCHAR',
137+
'formtype' => 'TEXT',
138+
'default' => '',
139+
'value' => '',
140+
'width' => '40',
141+
'maxlength' => '255'
142+
),
143+
'php_fastcgi_ini_dir' => array(
144+
'datatype' => 'VARCHAR',
145+
'formtype' => 'TEXT',
146+
'default' => '',
147+
'value' => '',
148+
'width' => '40',
149+
'maxlength' => '255'
150+
),
151+
##################################
152+
# ENDE Datatable fields
153+
##################################
154+
)
155+
);
156+
157+
$form["tabs"]['php_fpm'] = array(
158+
'title' => "PHP-FPM Settings",
159+
'width' => 80,
160+
'template' => "templates/server_php_fpm_edit.htm",
161+
'fields' => array(
162+
##################################
163+
# Begin Datatable fields
164+
##################################
165+
'php_fpm_init_script' => array(
166+
'datatype' => 'VARCHAR',
167+
'formtype' => 'TEXT',
168+
'default' => '',
169+
'value' => '',
170+
'width' => '40',
171+
'maxlength' => '255'
172+
),
173+
'php_fpm_ini_dir' => array(
174+
'datatype' => 'VARCHAR',
175+
'formtype' => 'TEXT',
176+
'default' => '',
177+
'value' => '',
178+
'width' => '40',
179+
'maxlength' => '255'
180+
),
181+
'php_fpm_pool_dir' => array(
182+
'datatype' => 'VARCHAR',
183+
'formtype' => 'TEXT',
184+
'default' => '',
185+
'value' => '',
186+
'width' => '40',
187+
'maxlength' => '255'
188+
),
189+
##################################
190+
# ENDE Datatable fields
191+
##################################
192+
)
193+
);
194+
?>

interface/web/admin/lib/lang/de.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ $wb['Do OS-Update'] = 'Do OS-Update';
4040
$wb['Do ISPConfig-Update'] = 'Do ISPConfig-Update';
4141
$wb['1001'] = 'Username or password is empty.';
4242
$wb['1002'] = 'Username or password is wrong.';
43+
$wb['Additional PHP Versions'] = 'Zusätzliche PHP-Versionen';
4344
?>

interface/web/admin/lib/lang/de_server_config.lng

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,4 @@ $wb['set_folder_permissions_on_update_txt'] = 'Set folder permissions on update'
153153
$wb['add_web_users_to_sshusers_group_txt'] = 'Add web users to -sshusers- group';
154154
$wb['connect_userid_to_webid_txt'] = 'Connect Linux userid to webid';
155155
$wb['connect_userid_to_webid_start_txt'] = 'Start ID for userid/webid connect';
156-
$wb["fastcgi_additional_php_versions_txt"] = 'Zusätzliche PHP-Versionen';
157-
$wb["fastcgi_additional_php_versions_hint_txt"] = 'Format:<br>&lt;name&gt;;&lt;path_to_executable&gt;;&lt;path_to_php.ini_dir&gt;<br>z.B.:<br>PHP 5.2.17;/opt/php52/bin/php-cgi;/opt/php52/etc/';
158156
?>

interface/web/admin/lib/lang/de_server_ip.lng

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ $wb['ip_address_txt'] = 'IP Adresse';
44
$wb['virtualhost_txt'] = 'HTTP NameVirtualHost';
55
$wb['ip_error_wrong'] = 'Das IP Adresse ist ungültig';
66
$wb['ip_error_unique'] = 'Das IP Adresse müss einzigartig sein';
7-
$wb['client_id_txt'] = 'Client';
8-
$wb['ip_type_txt'] = 'Type';
7+
$wb['client_id_txt'] = 'Kunde';
8+
$wb['ip_type_txt'] = 'Typ';
99
$wb['virtualhost_port_txt'] = 'HTTP Ports';
10-
$wb['error_port_syntax'] = 'Invalid chars in port field, please enter only comma separated numbers. Example: 80,443';
10+
$wb['error_port_syntax'] = 'Ungültige Zeichen im Ports-Feld. Bitte geben Sie nur komma-separierte Nummern an. Beispiel: 80,443';
1111
?>

interface/web/admin/lib/lang/de_server_ip_list.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $wb['list_head_txt'] = 'IP Adressen';
33
$wb['server_id_txt'] = 'Server';
44
$wb['ip_address_txt'] = 'IP Adresse';
55
$wb['add_new_record_txt'] = 'Neue IP Adresse hinzufügen';
6-
$wb['client_id_txt'] = 'Client';
6+
$wb['client_id_txt'] = 'Kunde';
77
$wb['virtualhost_txt'] = 'HTTP Vhost';
88
$wb['virtualhost_port_txt'] = 'HTTP Ports';
99
$wb['ip_type_txt'] = 'Type';
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
$wb['server_id_txt'] = 'Server';
3+
$wb['client_id_txt'] = 'Kunde';
4+
$wb['name_txt'] = 'PHP-Name';
5+
$wb['Name'] = 'Name';
6+
$wb['FastCGI Settings'] = 'FastCGI-Einstellungen';
7+
$wb['PHP-FPM Settings'] = 'PHP-FPM-Einstellungen';
8+
$wb['Additional PHP Versions'] = 'Zusätzliche PHP-Versionen';
9+
$wb['Form to edit additional PHP versions'] = 'Formular, um zusätzliche PHP-Versionen hinzuzufügen';
10+
$wb['server_php_name_error_empty'] = 'Das Name-Feld darf nicht leer sein.';
11+
$wb['php_fastcgi_binary_txt'] = 'Pfad zum PHP-FastCGI-Binary';
12+
$wb['php_fastcgi_ini_dir_txt'] = 'Pfad zum php.ini-Verzeichnis';
13+
$wb['php_fpm_init_script_txt'] = 'Pfad zum PHP-FPM-Init-Skript';
14+
$wb['php_fpm_ini_dir_txt'] = 'Pfad zum php.ini-Verzeichnis';
15+
$wb['php_fpm_pool_dir_txt'] = 'Pfad zum PHP-FPM-Pool-Verzeichnis';
16+
?>

0 commit comments

Comments
 (0)