tbrehm
2008-04-22 94411b6a3f96ada75478b35ebfa6472abe725374
- The Server ini is now loaded from a file templet
- Fixed a bug were DNS SOA records could not be deleted.
3 files modified
2 files added
111 ■■■■■ changed files
install/install.php 9 ●●●● patch | view | raw | blame | history
install/lib/installer_base.lib.php 11 ●●●●● patch | view | raw | blame | history
install/sql/ispconfig3.sql 3 ●●●●● patch | view | raw | blame | history
install/tpl/server.ini.master 34 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_soa_del.php 54 ●●●●● patch | view | raw | blame | history
install/install.php
@@ -124,6 +124,9 @@
    
    //* Create the mysql database
    $inst->configure_database();
    //* Insert the Server record into the database
    $inst->add_database_server_record();
    //* Configure postfix
    $inst->configure_postfix();
@@ -191,12 +194,16 @@
}else{
    //** Get Server ID
    $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1');
    // $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1');
    // Server ID is an autoInc value of the mysql database now
    
    if(strtolower($inst->simple_query('Create Database',array('y','n'),'y')) == 'y') {
        //* Create the mysql database
        $inst->configure_database();
        system('/etc/init.d/mysql restart');
        //* Insert the Server record into the database
        $inst->add_database_server_record();
    }
    
    if(strtolower($inst->simple_query('Configure Mail', array('y','n') ,'y') ) == 'y') {
install/lib/installer_base.lib.php
@@ -153,6 +153,17 @@
        }
    }
    
    //** Create a recors in the
    public function add_database_server_record() {
        $server_ini = rf("tpl/server.ini.master");
        $server_ini = addslashes($server_ini_content);
        $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);";
        $this->db->query($sql);
        $this->conf['server_id'] = $this->db->insertID();
    }
    //** writes postfix configuration files
    private function process_postfix_config($configfile)
install/sql/ispconfig3.sql
@@ -493,9 +493,6 @@
-- Daten für Tabelle `server`
-- 
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
(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);
-- --------------------------------------------------------
-- 
install/tpl/server.ini.master
New file
@@ -0,0 +1,34 @@
[global]
webserver=apache
mailserver=postfix
dnsserver=mydns
[server]
ip_address=192.168.0.105
netmask=255.255.255.0
gateway=192.168.0.1
hostname=server1.example.com
nameservers=193.174.32.18,145.253.2.75
[mail]
module=postfix_mysql
maildir_path=/home/vmail/[domain]/[localpart]/
homedir_path=/home/vmail/
mailuser_uid=5000
mailuser_gid=5000
mailuser_name=vmail
mailuser_group=vmail
relayhost=
relayhost_user=
relayhost_password=
mailbox_size_limit=0
message_size_limit=0
[getmail]
getmail_config_dir=/etc/getmail
[web]
website_path=/var/clients/client[client_id]/web[website_id]
website_symlinks=/var/www/[website_domain]/:/var/clients/client[client_id]/[website_domain]/
vhost_conf_dir=/etc/apache2/sites-available
vhost_conf_enabled_dir=/etc/apache2/sites-enabled
interface/web/dns/dns_soa_del.php
New file
@@ -0,0 +1,54 @@
<?php
/*
Copyright (c) 2008, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of ISPConfig nor the names of its contributors
      may be used to endorse or promote products derived from this software without
      specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/dns_soa.list.php";
$tform_def_file = "form/dns_soa.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checke Berechtigungen für Modul
if(!stristr($_SESSION["s"]["user"]["modules"],'dns')) {
    header("Location: ../index.php");
    exit;
}
$app->uses("tform_actions");
$app->tform_actions->onDelete();
?>