Skip to content

Commit 7848cef

Browse files
committed
Added editor for the server config ini.
1 parent a882d9a commit 7848cef

15 files changed

+1020
-0
lines changed

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

Lines changed: 484 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
$wb["jailkit_chroot_home_txt"] = 'Jailkit chroot home';
3+
$wb["jailkit_chroot_app_sections_txt"] = 'Jailkit chroot app sections';
4+
$wb["jailkit_chroot_app_programs_txt"] = 'Jailkit chrooted applications';
5+
$wb["btn_save_txt"] = 'Save';
6+
$wb["btn_cancel_txt"] = 'Cancel';
7+
$wb["website_path_txt"] = 'Website path';
8+
$wb["website_symlinks_txt"] = 'Website symlinks';
9+
$wb["vhost_conf_dir_txt"] = 'Vhost config dir';
10+
$wb["vhost_conf_enabled_dir_txt"] = 'Vhost config enabled dir';
11+
$wb["getmail_config_dir_txt"] = 'Getmail config dir';
12+
$wb["fastcgi_starter_path_txt"] = 'FastCGI starter path';
13+
$wb["fastcgi_starter_script_txt"] = 'FastCGI starter script';
14+
$wb["fastcgi_alias_txt"] = 'FastCGI Alias';
15+
$wb["fastcgi_phpini_path_txt"] = 'FastCGI php.ini Path';
16+
$wb["fastcgi_children_txt"] = 'FastCGI Children';
17+
$wb["fastcgi_max_requests_txt"] = 'FastCGI max. Requests';
18+
$wb["fastcgi_bin_txt"] = 'FastCGI Bin';
19+
$wb["module_txt"] = 'Module';
20+
$wb["maildir_path_txt"] = 'Maildir Path';
21+
$wb["homedir_path_txt"] = 'Homedir Path';
22+
$wb["mailuser_uid_txt"] = 'Mailuser UID';
23+
$wb["mailuser_gid_txt"] = 'Mailuser GID';
24+
$wb["mailuser_name_txt"] = 'Mailuser Name';
25+
$wb["mailuser_group_txt"] = 'Mailuser Group';
26+
$wb["relayhost_txt"] = 'Relayhost';
27+
$wb["relayhost_user_txt"] = 'Relayhost User';
28+
$wb["relayhost_password_txt"] = 'Relayhost Password';
29+
$wb["mailbox_size_limit_txt"] = 'Mailbox Size Limit';
30+
$wb["message_size_limit_txt"] = 'Message Size Limit';
31+
$wb["ip_address_txt"] = 'IP Address';
32+
$wb["netmask_txt"] = 'Netmask';
33+
$wb["gateway_txt"] = 'Gateway';
34+
$wb["hostname_txt"] = 'Hostname';
35+
$wb["nameservers_txt"] = 'Nameservers';
36+
?>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
$wb["list_head_txt"] = 'Server Configuration';
3+
$wb["server_name_txt"] = 'Server';
4+
$wb["page_txt"] = 'Page';
5+
$wb["page_of_txt"] = 'of';
6+
$wb["page_next_txt"] = 'Next';
7+
$wb["page_back_txt"] = 'Back';
8+
$wb["delete_txt"] = 'Delete';
9+
$wb["filter_txt"] = 'Filter';
10+
?>

interface/web/admin/lib/module.conf.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
$items[] = array( 'title' => 'Edit server',
5151
'target' => 'content',
5252
'link' => 'admin/server_list.php');
53+
54+
$items[] = array( 'title' => 'Server Config',
55+
'target' => 'content',
56+
'link' => 'admin/server_config_list.php');
57+
5358
/*
5459
$items[] = array( 'title' => 'Add Server IP',
5560
'target' => 'content',
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
/*
4+
Datatypes:
5+
- INTEGER
6+
- DOUBLE
7+
- CURRENCY
8+
- VARCHAR
9+
- TEXT
10+
- DATE
11+
*/
12+
13+
14+
15+
// Name of the list
16+
$liste["name"] = "server_config";
17+
18+
// Database table
19+
$liste["table"] = "server";
20+
21+
// Index index field of the database table
22+
$liste["table_idx"] = "server_id";
23+
24+
// Search Field Prefix
25+
$liste["search_prefix"] = "search_";
26+
27+
// Records per page
28+
$liste["records_per_page"] = 15;
29+
30+
// Script File of the list
31+
$liste["file"] = "server_config_list.php";
32+
33+
// Script file of the edit form
34+
$liste["edit_file"] = "server_config_edit.php";
35+
36+
// Script File of the delete script
37+
$liste["delete_file"] = "server_config_del.php";
38+
39+
// Paging Template
40+
$liste["paging_tpl"] = "templates/paging.tpl.htm";
41+
42+
// Enable auth
43+
$liste["auth"] = "yes";
44+
45+
46+
/*****************************************************
47+
* Suchfelder
48+
*****************************************************/
49+
50+
$liste["item"][] = array( 'field' => "server_name",
51+
'datatype' => "VARCHAR",
52+
'formtype' => "TEXT",
53+
'op' => "like",
54+
'prefix' => "%",
55+
'suffix' => "%",
56+
'width' => "",
57+
'value' => "");
58+
59+
60+
?>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2008, 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+
* Begin Form configuration
33+
******************************************/
34+
35+
$list_def_file = "list/server_config.list.php";
36+
$tform_def_file = "form/server_config.tform.php";
37+
38+
/******************************************
39+
* End Form configuration
40+
******************************************/
41+
42+
require_once('../../lib/config.inc.php');
43+
require_once('../../lib/app.inc.php');
44+
45+
//* Check permissions for module
46+
$app->auth->check_module_permissions('admin');
47+
48+
$app->uses("tform_actions");
49+
$app->tform_actions->onDelete();
50+
51+
?>
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?php
2+
/*
3+
Copyright (c) 2008, Till Brehm, projektfarm Gmbh
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification,
7+
are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
* Neither the name of ISPConfig nor the names of its contributors
15+
may be used to endorse or promote products derived from this software without
16+
specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*/
29+
30+
31+
/******************************************
32+
* Begin Form configuration
33+
******************************************/
34+
35+
$tform_def_file = "form/server_config.tform.php";
36+
37+
/******************************************
38+
* End Form configuration
39+
******************************************/
40+
41+
require_once('../../lib/config.inc.php');
42+
require_once('../../lib/app.inc.php');
43+
44+
//* Check permissions for module
45+
$app->auth->check_module_permissions('admin');
46+
47+
// Loading classes
48+
$app->uses('tpl,tform,tform_actions');
49+
$app->load('tform_actions');
50+
51+
class page_action extends tform_actions {
52+
53+
function onShowEdit() {
54+
global $app, $conf;
55+
56+
if($_SESSION["s"]["user"]["typ"] != 'admin') die('This function needs admin priveliges');
57+
58+
if($app->tform->errorMessage == '') {
59+
$app->uses('ini_parser,getconf');
60+
61+
$section = $this->active_tab;
62+
$server_id = $this->id;
63+
64+
$this->dataRecord = $app->getconf->get_server_config($server_id,$section);
65+
}
66+
67+
$record = $app->tform->getHTML($this->dataRecord, $this->active_tab,'EDIT');
68+
69+
$record['id'] = $this->id;
70+
$app->tpl->setVar($record);
71+
}
72+
73+
function onUpdateSave($sql) {
74+
global $app;
75+
76+
if($_SESSION["s"]["user"]["typ"] != 'admin') die('This function needs admin priveliges');
77+
$app->uses('ini_parser,getconf');
78+
79+
$section = $app->tform->getCurrentTab();
80+
$server_id = $this->id;
81+
82+
$server_config_array = $app->getconf->get_server_config($server_id);
83+
$server_config_array[$section] = $app->tform->encode($this->dataRecord,$section);
84+
$server_config_str = $app->ini_parser->get_ini_string($server_config_array);
85+
86+
$sql = "UPDATE server SET config = '".$app->db->quote($server_config_str)."' WHERE server_id = ".$server_id;
87+
$app->db->query($sql);
88+
}
89+
90+
}
91+
92+
$app->tform_actions = new page_action;
93+
$app->tform_actions->onLoad();
94+
95+
96+
?>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2008, 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+
require_once('../../lib/config.inc.php');
32+
require_once('../../lib/app.inc.php');
33+
34+
/******************************************
35+
* Begin Form configuration
36+
******************************************/
37+
38+
$list_def_file = "list/server_config.list.php";
39+
40+
/******************************************
41+
* End Form configuration
42+
******************************************/
43+
44+
//* Check permissions for module
45+
$app->auth->check_module_permissions('admin');
46+
47+
$app->uses('listform_actions');
48+
//$app->listform_actions->SQLExtWhere = "wb = 'W'";
49+
50+
$app->listform_actions->onLoad();
51+
52+
53+
?>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<table width="500" border="0" cellspacing="0" cellpadding="2">
2+
<tr>
3+
<td class="frmText11">{tmpl_var name='fastcgi_starter_path_txt'}:</td>
4+
<td class="frmText11"><input name="fastcgi_starter_path" type="text" class="text" value="{tmpl_var name='fastcgi_starter_path'}" size="40" maxlength="255"></td>
5+
</tr>
6+
<tr>
7+
<td class="frmText11">{tmpl_var name='fastcgi_starter_script_txt'}:</td>
8+
<td class="frmText11"><input name="fastcgi_starter_script" type="text" class="text" value="{tmpl_var name='fastcgi_starter_script'}" size="40" maxlength="255"></td>
9+
</tr>
10+
<tr>
11+
<td class="frmText11">{tmpl_var name='fastcgi_alias_txt'}:</td>
12+
<td class="frmText11"><input name="fastcgi_alias" type="text" class="text" value="{tmpl_var name='fastcgi_alias'}" size="40" maxlength="255"></td>
13+
</tr>
14+
<tr>
15+
<td class="frmText11">{tmpl_var name='fastcgi_phpini_path_txt'}:</td>
16+
<td class="frmText11"><input name="fastcgi_phpini_path" type="text" class="text" value="{tmpl_var name='fastcgi_phpini_path'}" size="40" maxlength="255"></td>
17+
</tr>
18+
<tr>
19+
<td class="frmText11">{tmpl_var name='fastcgi_children_txt'}:</td>
20+
<td class="frmText11"><input name="fastcgi_children" type="text" class="text" value="{tmpl_var name='fastcgi_children'}" size="40" maxlength="255"></td>
21+
</tr>
22+
<tr>
23+
<td class="frmText11">{tmpl_var name='fastcgi_max_requests_txt'}:</td>
24+
<td class="frmText11"><input name="fastcgi_max_requests" type="text" class="text" value="{tmpl_var name='fastcgi_max_requests'}" size="40" maxlength="255"></td>
25+
</tr>
26+
<tr>
27+
<td class="frmText11">{tmpl_var name='fastcgi_bin_txt'}:</td>
28+
<td class="frmText11"><input name="fastcgi_bin" type="text" class="text" value="{tmpl_var name='fastcgi_bin'}" size="40" maxlength="255"></td>
29+
</tr> <tr>
30+
<td class="frmText11">&nbsp;</td>
31+
<td class="frmText11">&nbsp;</td>
32+
</tr>
33+
<tr>
34+
<td>&nbsp;</td>
35+
<td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/server_config_edit.php');"><div class="buttonEnding"></div>&nbsp;
36+
<input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_config_list.php');"><div class="buttonEnding"></div>
37+
</td>
38+
</tr>
39+
</table>
40+
<input type="hidden" name="id" value="{tmpl_var name='id'}">
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<table width="500" border="0" cellspacing="0" cellpadding="2">
2+
<tr>
3+
<td class="frmText11">{tmpl_var name='getmail_config_dir_txt'}:</td>
4+
<td class="frmText11"><input name="getmail_config_dir" type="text" class="text" value="{tmpl_var name='getmail_config_dir'}" size="40" maxlength="255"></td>
5+
</tr> <tr>
6+
<td class="frmText11">&nbsp;</td>
7+
<td class="frmText11">&nbsp;</td>
8+
</tr>
9+
<tr>
10+
<td>&nbsp;</td>
11+
<td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/server_config_edit.php');"><div class="buttonEnding"></div>&nbsp;
12+
<input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_config_list.php');"><div class="buttonEnding"></div>
13+
</td>
14+
</tr>
15+
</table>
16+
<input type="hidden" name="id" value="{tmpl_var name='id'}">

0 commit comments

Comments
 (0)