Skip to content

Commit 94411b6

Browse files
committed
- The Server ini is now loaded from a file templet
- Fixed a bug were DNS SOA records could not be deleted.
1 parent 430a0fa commit 94411b6

File tree

5 files changed

+107
-4
lines changed

5 files changed

+107
-4
lines changed

install/install.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@
124124

125125
//* Create the mysql database
126126
$inst->configure_database();
127+
128+
//* Insert the Server record into the database
129+
$inst->add_database_server_record();
127130

128131
//* Configure postfix
129132
$inst->configure_postfix();
@@ -191,12 +194,16 @@
191194
}else{
192195

193196
//** Get Server ID
194-
$conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1');
197+
// $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1');
198+
// Server ID is an autoInc value of the mysql database now
195199

196200
if(strtolower($inst->simple_query('Create Database',array('y','n'),'y')) == 'y') {
197201
//* Create the mysql database
198202
$inst->configure_database();
199203
system('/etc/init.d/mysql restart');
204+
205+
//* Insert the Server record into the database
206+
$inst->add_database_server_record();
200207
}
201208

202209
if(strtolower($inst->simple_query('Configure Mail', array('y','n') ,'y') ) == 'y') {

install/lib/installer_base.lib.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,17 @@ public function configure_database()
153153
}
154154
}
155155

156+
//** Create a recors in the
157+
public function add_database_server_record() {
158+
159+
$server_ini = rf("tpl/server.ini.master");
160+
$server_ini = addslashes($server_ini_content);
161+
162+
$sql = "INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`) VALUES (1, 1, 'riud', 'riud', 'r', 'Server 1', 1, 1, 1, 1, 1, 1, '$server_ini_content', 0, 1);";
163+
$this->db->query($sql);
164+
$this->conf['server_id'] = $this->db->insertID();
165+
}
166+
156167

157168
//** writes postfix configuration files
158169
private function process_postfix_config($configfile)

install/sql/ispconfig3.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,6 @@ CREATE TABLE `server` (
493493
-- Daten für Tabelle `server`
494494
--
495495

496-
INSERT INTO `server` (`server_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`) VALUES
497-
(1, 1, 1, 'riud', 'riud', 'r', 'Server 1', 1, 1, 1, 1, 1, 1, '[global]\nwebserver=apache\nmailserver=postfix\ndnsserver=mydns\n\n[server]\nip_address=192.168.0.105\nnetmask=255.255.255.0\ngateway=192.168.0.1\nhostname=server1.example.com\nnameservers=193.174.32.18,145.253.2.75\n\n[mail]\nmodule=postfix_mysql\nmaildir_path=/home/vmail/[domain]/[localpart]/\nhomedir_path=/home/vmail/\nmailuser_uid=5000\nmailuser_gid=5000\nmailuser_name=vmail\nmailuser_group=vmail\nrelayhost=\nrelayhost_user=\nrelayhost_password=\nmailbox_size_limit=0\nmessage_size_limit=0\n\n[getmail]\ngetmail_config_dir=/etc/getmail\n\n[web]\nwebsite_path=/var/clients/client[client_id]/web[website_id]\nwebsite_symlinks=/var/www/[website_domain]/:/var/clients/client[client_id]/[website_domain]/\nvhost_conf_dir=/etc/apache2/sites-available\nvhost_conf_enabled_dir=/etc/apache2/sites-enabled\n\n', 0, 1);
498-
499496
-- --------------------------------------------------------
500497

501498
--

install/tpl/server.ini.master

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[global]
2+
webserver=apache
3+
mailserver=postfix
4+
dnsserver=mydns
5+
6+
[server]
7+
ip_address=192.168.0.105
8+
netmask=255.255.255.0
9+
gateway=192.168.0.1
10+
hostname=server1.example.com
11+
nameservers=193.174.32.18,145.253.2.75
12+
13+
[mail]
14+
module=postfix_mysql
15+
maildir_path=/home/vmail/[domain]/[localpart]/
16+
homedir_path=/home/vmail/
17+
mailuser_uid=5000
18+
mailuser_gid=5000
19+
mailuser_name=vmail
20+
mailuser_group=vmail
21+
relayhost=
22+
relayhost_user=
23+
relayhost_password=
24+
mailbox_size_limit=0
25+
message_size_limit=0
26+
27+
[getmail]
28+
getmail_config_dir=/etc/getmail
29+
30+
[web]
31+
website_path=/var/clients/client[client_id]/web[website_id]
32+
website_symlinks=/var/www/[website_domain]/:/var/clients/client[client_id]/[website_domain]/
33+
vhost_conf_dir=/etc/apache2/sites-available
34+
vhost_conf_enabled_dir=/etc/apache2/sites-enabled

interface/web/dns/dns_soa_del.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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/dns_soa.list.php";
36+
$tform_def_file = "form/dns_soa.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+
// Checke Berechtigungen für Modul
46+
if(!stristr($_SESSION["s"]["user"]["modules"],'dns')) {
47+
header("Location: ../index.php");
48+
exit;
49+
}
50+
51+
$app->uses("tform_actions");
52+
$app->tform_actions->onDelete();
53+
54+
?>

0 commit comments

Comments
 (0)