tbrehm
2007-06-21 18341ee35973a5a825a3ef8852076a1fdca2f149
Added the website management module.
5 files modified
53 files added
3391 ■■■■■ changed files
interface/lib/classes/tform.inc.php 23 ●●●● patch | view | raw | blame | history
interface/web/admin/form/server_ip.tform.php 128 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_server_ip.lng 8 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_server_ip_list.lng 12 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/module.conf.php 10 ●●●●● patch | view | raw | blame | history
interface/web/admin/list/server_ip.list.php 73 ●●●●● patch | view | raw | blame | history
interface/web/admin/server_ip_del.php 54 ●●●●● patch | view | raw | blame | history
interface/web/admin/server_ip_edit.php 56 ●●●●● patch | view | raw | blame | history
interface/web/admin/server_ip_list.php 54 ●●●●● patch | view | raw | blame | history
interface/web/admin/templates/server_ip_edit.htm 29 ●●●●● patch | view | raw | blame | history
interface/web/admin/templates/server_ip_list.htm 25 ●●●●● patch | view | raw | blame | history
interface/web/client/client_edit.php 2 ●●● patch | view | raw | blame | history
interface/web/js/scrigo.js 14 ●●●●● patch | view | raw | blame | history
interface/web/mail/mail_domain_edit.php 2 ●●● patch | view | raw | blame | history
interface/web/sites/ajax_get_ip.php 59 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/ftp_user.tform.php 237 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/web_aliasdomain.tform.php 132 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/web_domain.tform.php 260 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/web_subdomain.tform.php 132 ●●●●● patch | view | raw | blame | history
interface/web/sites/ftp_user_del.php 54 ●●●●● patch | view | raw | blame | history
interface/web/sites/ftp_user_edit.php 62 ●●●●● patch | view | raw | blame | history
interface/web/sites/ftp_user_list.php 58 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/admin.conf.php 2 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_ftp_user.lng 18 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_ftp_user_list.lng 13 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_aliasdomain_list.lng 13 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_domain.lng 23 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_domain_list.lng 13 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_subdomain_list.lng 13 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/module.conf.php 51 ●●●●● patch | view | raw | blame | history
interface/web/sites/list/ftp_user.list.php 99 ●●●●● patch | view | raw | blame | history
interface/web/sites/list/web_aliasdomain.list.php 99 ●●●●● patch | view | raw | blame | history
interface/web/sites/list/web_domain.list.php 85 ●●●●● patch | view | raw | blame | history
interface/web/sites/list/web_subdomain.list.php 99 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/ftp_user_advanced.htm 44 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/ftp_user_edit.htm 44 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/ftp_user_list.htm 31 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_aliasdomain_edit.htm 40 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_aliasdomain_list.htm 31 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_domain_advanced.htm 24 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_domain_edit.htm 100 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_domain_list.htm 28 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_domain_redirect.htm 24 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_subdomain_edit.htm 36 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_subdomain_list.htm 31 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_aliasdomain_del.php 54 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_aliasdomain_edit.php 91 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_aliasdomain_list.php 58 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_domain_del.php 54 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_domain_edit.php 234 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_domain_list.php 58 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_subdomain_del.php 54 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_subdomain_edit.php 89 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_subdomain_list.php 58 ●●●●● patch | view | raw | blame | history
server/conf/apache.conf.master 2 ●●●●● patch | view | raw | blame | history
server/conf/vhost.conf.master 25 ●●●●● patch | view | raw | blame | history
server/mods-enabled/web_module.inc.php 86 ●●●●● patch | view | raw | blame | history
server/plugins-enabled/apache2_plugin.inc.php 83 ●●●●● patch | view | raw | blame | history
interface/lib/classes/tform.inc.php
@@ -760,7 +760,7 @@
                } else {
                        if($primary_id != 0) {
                                $sql_update = substr($sql_update,0,-2);
                                $sql = "UPDATE ".$escape.$this->formDef['db_table'].$escape." SET ".$sql_update." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id;
                                $sql = "UPDATE ".$escape.$this->formDef['db_table'].$escape." SET ".$sql_update." WHERE ".$this->getAuthSQL('u')." AND ".$this->formDef['db_table_idx']." = ".$primary_id;
                                if($sql_ext_where != '') $sql .= " and ".$sql_ext_where;
                        } else {
                                $app->error("Primary ID fehlt!");
@@ -796,20 +796,21 @@
        // definiere Tabs
        foreach( $this->formDef["tabs"] as $key => $tab) {
                        $tab['name'] = $key;
            $tab['name'] = $key;
            if($tab['name'] == $active_tab) {
                                // Wenn Modul gesetzt, dann setzte template pfad relativ zu modul.
                                if($this->module != '') $tab["template"] = "../".$this->module."/".$tab["template"];
                // Wenn Modul gesetzt, dann setzte template pfad relativ zu modul.
                if($this->module != '') $tab["template"] = "../".$this->module."/".$tab["template"];
                                // Ã¼berprüfe, ob das Template existiert, wenn nicht
                                // dann generiere das Template
                                if(!is_file($tab["template"])) {
                                        $app->uses('tform_tpl_generator');
                                        $app->tform_tpl_generator->buildHTML($this->formDef,$tab['name']);
                                }
                // Ã¼berprüfe, ob das Template existiert, wenn nicht
                // dann generiere das Template
                if(!is_file($tab["template"])) {
                     $app->uses('tform_tpl_generator');
                     $app->tform_tpl_generator->buildHTML($this->formDef,$tab['name']);
                }
                    $app->tpl->setInclude('content_tpl',$tab["template"]);
                $app->tpl->setInclude('content_tpl',$tab["template"]);
                $tab["active"] = 1;
                $_SESSION["s"]["form"]["tab"] = $tab['name'];
            } else {
interface/web/admin/form/server_ip.tform.php
New file
@@ -0,0 +1,128 @@
<?php
/*
Copyright (c) 2007, 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.
*/
/*
    Form Definition
    Tabellendefinition
    Datentypen:
    - INTEGER (Wandelt Ausdrücke in Int um)
    - DOUBLE
    - CURRENCY (Formatiert Zahlen nach Währungsnotation)
    - VARCHAR (kein weiterer Format Check)
    - TEXT (kein weiterer Format Check)
    - DATE (Datumsformat, Timestamp Umwandlung)
    Formtype:
    - TEXT (normales Textfeld)
    - TEXTAREA (normales Textfeld)
    - PASSWORD (Feldinhalt wird nicht angezeigt)
    - SELECT (Gibt Werte als option Feld aus)
    - RADIO
    - CHECKBOX
    - FILE
    VALUE:
    - Wert oder Array
    Hinweis:
    Das ID-Feld ist nicht bei den Table Values einzufügen.
*/
$form["title"]             = "IP Addresses";
$form["description"]     = "Form to edit system IP Addresses";
$form["name"]             = "server_ip";
$form["action"]            = "server_ip_edit.php";
$form["db_table"]        = "server_ip";
$form["db_table_idx"]    = "server_ip_id";
$form["db_history"]        = "yes";
$form["tab_default"]    = "server_ip";
$form["list_default"]    = "server_ip_list.php";
$form["auth"]            = 'yes';
$form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['server_ip'] = array (
    'title'     => "IP Address",
    'width'     => 80,
    'template'     => "templates/server_ip_edit.htm",
    'fields'     => array (
    ##################################
    # Beginn Datenbankfelder
    ##################################
        'server_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                        'keyfield'=> 'server_id',
                                        'valuefield'=> 'server_name'
                                     ),
            'value'        => ''
        ),
        'ip_address' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'ip_error_empty'),
                                        1 => array (    'type'    => 'UNIQUE',
                                                        'errmsg'=> 'ip_error_unique'),
                                        2 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^[0-9\.]{7,15}$/',
                                                        'errmsg'=> 'ip_err'),
                                    ),
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '15',
            'maxlength'    => '15',
            'rows'        => '',
            'cols'        => ''
        ),
        'virtualhost' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
            'default'    => 'y',
            'value'        => array(0 => 'n',1 => 'y')
        ),
    ##################################
    # ENDE Datenbankfelder
    ##################################
    )
);
?>
interface/web/admin/lib/lang/en_server_ip.lng
New file
@@ -0,0 +1,8 @@
<?php
$wb["server_id_txt"] = 'Server';
$wb["ip_address_txt"] = 'IP Address';
$wb["virtualhost_txt"] = 'Virtualhost';
$wb["ip_err"] = 'IP address invalid';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
?>
interface/web/admin/lib/lang/en_server_ip_list.lng
New file
@@ -0,0 +1,12 @@
<?php
$wb["list_head_txt"] = 'IP Addresses';
$wb["server_id_txt"] = 'Server';
$wb["ip_address_txt"] = 'IP Address';
$wb["page_txt"] = 'Page';
$wb["page_of_txt"] = 'of';
$wb["page_next_txt"] = 'Next';
$wb["page_back_txt"] = 'Back';
$wb["delete_txt"] = 'Delete';
$wb["filter_txt"] = 'Filter';
$wb["add_new_record_txt"] = 'Add new IP Address';
?>
interface/web/admin/lib/module.conf.php
@@ -49,7 +49,15 @@
                  'target'     => 'content',
                  'link'    => 'admin/server_list.php');
$items[] = array( 'title'     => "Add Server IP",
                  'target'     => 'content',
                  'link'    => 'admin/server_ip_edit.php');
$items[] = array( 'title'     => "Edit Server IP",
                  'target'     => 'content',
                  'link'    => 'admin/server_ip_list.php');
$module["nav"][] = array(    'title'    => 'Servers',
                            'open'     => 1,
                            'items'    => $items);
interface/web/admin/list/server_ip.list.php
New file
@@ -0,0 +1,73 @@
<?php
/*
    Datentypen:
    - INTEGER (Wandelt Ausdrücke in Int um)
    - DOUBLE
    - CURRENCY (Formatiert Zahlen nach Währungsnotation)
    - VARCHAR (kein weiterer Format Check)
    - TEXT (kein weiterer Format Check)
    - DATE (Datumsformat, Timestamp Umwandlung)
*/
// Name der Liste
$liste["name"]                 = "server_ip";
// Datenbank Tabelle
$liste["table"]             = "server_ip";
// Index Feld der datenbank
$liste["table_idx"]            = "server_ip_id";
// Search Field Prefix
$liste["search_prefix"]     = "search_";
// Einträge pro Seite
$liste["records_per_page"]     = 15;
// Script File der Liste
$liste["file"]                = "server_ip_list.php";
// Script File der Liste
$liste["edit_file"]            = "server_ip_edit.php";
// Script File der Liste
$liste["delete_file"]        = "server_ip_del.php";
// Paging Template
$liste["paging_tpl"]        = "templates/paging.tpl.htm";
// Script File der Liste
$liste["auth"]                = "no";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array(    'field'        => "server_id",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'datasource'    => array (     'type'    => 'SQL',
                                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                                        'keyfield'=> 'server_id',
                                                        'valuefield'=> 'server_name'
                                                       ),
                            'width'        => "",
                            'value'        => "");
$liste["item"][] = array(    'field'        => "ip_address",
                            'datatype'    => "VARCHAR",
                            'op'        => "=",
                            'prefix'    => "",
                            'suffix'    => "",
                            'width'        => "");
?>
interface/web/admin/server_ip_del.php
New file
@@ -0,0 +1,54 @@
<?php
/*
Copyright (c) 2007, 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/server_ip.list.php";
$tform_def_file = "form/server_ip.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"],'admin')) {
    header("Location: ../index.php");
    exit;
}
$app->uses("tform_actions");
$app->tform_actions->onDelete();
?>
interface/web/admin/server_ip_edit.php
New file
@@ -0,0 +1,56 @@
<?php
/*
Copyright (c) 2007, 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
******************************************/
$tform_def_file = "form/server_ip.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'admin')) {
    header("Location: ../index.php");
    exit;
}
// Loading classes
$app->uses('tpl,tform,tform_actions');
// let tform_actions handle the page
$app->tform_actions->onLoad();
?>
interface/web/admin/server_ip_list.php
New file
@@ -0,0 +1,54 @@
<?php
/*
Copyright (c) 2007, 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.
*/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/server_ip.list.php";
/******************************************
* End Form configuration
******************************************/
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'admin')) {
    header("Location: ../index.php");
    exit;
}
$app->uses('listform_actions');
$app->listform_actions->onLoad();
?>
interface/web/admin/templates/server_ip_edit.htm
New file
@@ -0,0 +1,29 @@
<table width="500" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td class="frmText11">{tmpl_var name='server_id_txt'}:</td>
    <td class="frmText11">
        <select name="server_id" class="text">
            {tmpl_var name='server_id'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='ip_address_txt'}:</td>
    <td class="frmText11"><input name="ip_address" type="text" class="text" value="{tmpl_var name='ip_address'}" size="15" maxlength="15"></td>
  </tr>
  <tr>
    <td width="126" class="frmText11">{tmpl_var name='virtualhost_txt'}:</td>
    <td width="366" class="frmText11">{tmpl_var name='virtualhost'}</td>
  </tr>
  <tr>
    <td class="frmText11">&nbsp;</td>
    <td class="frmText11">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/server_ip_edit.php');"><div class="buttonEnding"></div>&nbsp;
      <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_ip_list.php');"><div class="buttonEnding"></div>
    </td>
  </tr>
</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
interface/web/admin/templates/server_ip_list.htm
New file
@@ -0,0 +1,25 @@
<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
<input type="button" value="{tmpl_var name="add_new_record_txt"}" class="button" onClick="loadContent('admin/server_ip_edit.php');" /><div class="buttonEnding"></div><br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="listTable">
  <tr>
    <td class="tblHead"><tmpl_var name="server_id_txt"></td>
    <td class="tblHead"><tmpl_var name="ip_address_txt"></td>
    <td class="tblHead">&nbsp;</td>
  </tr>
  <tr>
    <td class="frmText11"><select name="search_server_id" onChange="submitForm('pageForm','admin/server_ip_list.php');">{tmpl_var name='search_server_id'}</select></td>
    <td class="frmText11"><input type="text" name="search_ip_address" value="{tmpl_var name='search_ip_address'}" class="text" /></td>
    <td class="frmText11" align="right"><input name="Filter" type="button" id="Filter" value="{tmpl_var name="filter_txt"}" class="button" onClick="submitForm('pageForm','admin/server_ip_list.php');"><div class="buttonEnding"></div></td>
  </tr>
  <tmpl_loop name="records">
  <tr bgcolor="{tmpl_var name="bgcolor"}">
    <td class="frmText11"><a href="#" onClick="loadContent('admin/server_ip_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="server_id"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('admin/server_ip_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="ip_address"}</a></td>
    <td class="frmText11" align="right">[<a href="javascript: del_record('admin/server_ip_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}');" class="frmText11">{tmpl_var name='delete_txt'}</a>]</td>
  </tr>
  </tmpl_loop>
  <tr>
      <td colspan="3" height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
  </tr>
</table>
interface/web/client/client_edit.php
@@ -66,7 +66,7 @@
        
        $username = addslashes($this->dataRecord["username"]);
        $password = addslashes($this->dataRecord["password"]);
        $modules = 'mail';
        $modules = 'mail,sites';
        $startmodule = 'mail';
        $usertheme = addslashes($this->dataRecord["usertheme"]);
        $type = 'user';
interface/web/js/scrigo.js
@@ -194,4 +194,18 @@
  if(window.confirm("<tmpl_var name='delete_confirmation'>")) {
          loadContent(link);
  }
}
function loadContentInto(elementid,pagename) {
    var itemContentCallback = {
        success: function(o) {
            document.getElementById(elementid).innerHTML = o.responseText;
        },
        failure: function(o) {
            alert('Ajax Request was not successful.');
        }
    }
  var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename, itemContentCallback);
}
interface/web/mail/mail_domain_edit.php
@@ -1,6 +1,6 @@
<?php
/*
Copyright (c) 2005, Till Brehm, projektfarm Gmbh
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
interface/web/sites/ajax_get_ip.php
New file
@@ -0,0 +1,59 @@
<?php
/*
Copyright (c) 2005, 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.
*/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
    header("Location: ../index.php");
    exit;
}
$server_id = intval($_GET["server_id"]);
if($_SESSION["s"]["user"]["typ"] == 'admin') {
    $sql = "SELECT ip_address FROM server_ip WHERE server_id = $server_id";
    $ips = $app->db->queryAllRecords($sql);
    // $ip_select = "<option value=''></option>";
    $ip_select = "";
    if(is_array($ips)) {
        foreach( $ips as $ip) {
            //$selected = ($ip["ip_address"] == $this->dataRecord["ip_address"])?'SELECTED':'';
            $ip_select .= "<option value='$ip[ip_address]'>$ip[ip_address]</option>\r\n";
        }
    }
    unset($tmp);
    unset($ips);
}
echo $ip_select;
?>
interface/web/sites/form/ftp_user.tform.php
New file
@@ -0,0 +1,237 @@
<?php
/*
    Form Definition
    Tabledefinition
    Datatypes:
    - INTEGER (Forces the input to Int)
    - DOUBLE
    - CURRENCY (Formats the values to currency notation)
    - VARCHAR (no format check, maxlength: 255)
    - TEXT (no format check)
    - DATE (Dateformat, automatic conversion to timestamps)
    Formtype:
    - TEXT (Textfield)
    - TEXTAREA (Textarea)
    - PASSWORD (Password textfield, input is not shown when edited)
    - SELECT (Select option field)
    - RADIO
    - CHECKBOX
    - CHECKBOXARRAY
    - FILE
    VALUE:
    - Wert oder Array
    Hint:
    The ID field of the database table is not part of the datafield definition.
    The ID field must be always auto incement (int or bigint).
*/
$form["title"]             = "FTP User";
$form["description"]     = "";
$form["name"]             = "ftp_user";
$form["action"]            = "ftp_user_edit.php";
$form["db_table"]        = "ftp_user";
$form["db_table_idx"]    = "ftp_user_id";
$form["db_history"]        = "yes";
$form["tab_default"]    = "ftp";
$form["list_default"]    = "ftp_user_list.php";
$form["auth"]            = 'yes'; // yes / no
$form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['ftp'] = array (
    'title'     => "FTP User",
    'width'     => 100,
    'template'     => "templates/ftp_user_edit.htm",
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'server_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                        'keyfield'=> 'server_id',
                                        'valuefield'=> 'server_name'
                                     ),
            'value'        => ''
        ),
        'parent_domain_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
                                        'keyfield'=> 'domain_id',
                                        'valuefield'=> 'domain'
                                     ),
            'value'        => ''
        ),
        'username' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'username_error_empty'),
                                        1 => array (    'type'    => 'UNIQUE',
                                                        'errmsg'=> 'username_error_unique'),
                                        2 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^[\w\.\-]{1,64}$/',
                                                        'errmsg'=> 'username_error_regex'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'password' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'PASSWORD',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'quota_size' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'quota_size_error_empty'),
                                    ),
            'default'    => '-1',
            'value'        => '',
            'width'        => '7',
            'maxlength'    => '7'
        ),
        'active' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
            'default'    => 'y',
            'value'        => array(0 => 'n',1 => 'y')
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
if($_SESSION["s"]["user"]["typ"] == 'admin') {
$form["tabs"]['advanced'] = array (
    'title'     => "Options",
    'width'     => 100,
    'template'     => "templates/ftp_user_advanced.htm",
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'uid' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'uid_error_empty'),
                                    ),
            'default'    => '0',
            'value'        => '',
            'width'        => '5',
            'maxlength'    => '5'
        ),
        'gid' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'uid_error_empty'),
                                    ),
            'default'    => '0',
            'value'        => '',
            'width'        => '5',
            'maxlength'    => '5'
        ),
        'dir' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'directory_error_empty'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'quota_files' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'quota_files_error_empty'),
                                    ),
            'default'    => '0',
            'value'        => '',
            'width'        => '7',
            'maxlength'    => '7'
        ),
        'ul_ratio' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'ul_ratio_error_empty'),
                                    ),
            'default'    => '0',
            'value'        => '',
            'width'        => '7',
            'maxlength'    => '7'
        ),
        'dl_ratio' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'qdl_ratio_error_empty'),
                                    ),
            'default'    => '0',
            'value'        => '',
            'width'        => '7',
            'maxlength'    => '7'
        ),
        'ul_bandwidth' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'ul_bandwidth_error_empty'),
                                    ),
            'default'    => '0',
            'value'        => '',
            'width'        => '7',
            'maxlength'    => '7'
        ),
        'dl_bandwidth' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'dl_bandwidth_error_empty'),
                                    ),
            'default'    => '0',
            'value'        => '',
            'width'        => '7',
            'maxlength'    => '7'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
}
?>
interface/web/sites/form/web_aliasdomain.tform.php
New file
@@ -0,0 +1,132 @@
<?php
/*
    Form Definition
    Tabledefinition
    Datatypes:
    - INTEGER (Forces the input to Int)
    - DOUBLE
    - CURRENCY (Formats the values to currency notation)
    - VARCHAR (no format check, maxlength: 255)
    - TEXT (no format check)
    - DATE (Dateformat, automatic conversion to timestamps)
    Formtype:
    - TEXT (Textfield)
    - TEXTAREA (Textarea)
    - PASSWORD (Password textfield, input is not shown when edited)
    - SELECT (Select option field)
    - RADIO
    - CHECKBOX
    - CHECKBOXARRAY
    - FILE
    VALUE:
    - Wert oder Array
    Hint:
    The ID field of the database table is not part of the datafield definition.
    The ID field must be always auto incement (int or bigint).
*/
$form["title"]             = "Web Aliasdomain";
$form["description"]     = "";
$form["name"]             = "web_domain";
$form["action"]            = "web_aliasdomain_edit.php";
$form["db_table"]        = "web_domain";
$form["db_table_idx"]    = "domain_id";
$form["db_history"]        = "yes";
$form["tab_default"]    = "domain";
$form["list_default"]    = "web_aliasdomain_list.php";
$form["auth"]            = 'yes'; // yes / no
$form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['domain'] = array (
    'title'     => "Domain",
    'width'     => 100,
    'template'     => "templates/web_aliasdomain_edit.htm",
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'server_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                        'keyfield'=> 'server_id',
                                        'valuefield'=> 'server_name'
                                     ),
            'value'        => ''
        ),
        'domain' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'domain_error_empty'),
                                        1 => array (    'type'    => 'UNIQUE',
                                                        'errmsg'=> 'domain_error_unique'),
                                        2 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
                                                        'errmsg'=> 'domain_error_regex'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'type' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => 'y',
            'value'        => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain')
        ),
        'parent_domain_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
                                        'keyfield'=> 'domain_id',
                                        'valuefield'=> 'domain'
                                     ),
            'value'        => ''
        ),
        'redirect_type' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => 'y',
            'value'        => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
        ),
        'redirect_path' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'active' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
            'default'    => 'y',
            'value'        => array(0 => 'n',1 => 'y')
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
?>
interface/web/sites/form/web_domain.tform.php
New file
@@ -0,0 +1,260 @@
<?php
/*
    Form Definition
    Tabledefinition
    Datatypes:
    - INTEGER (Forces the input to Int)
    - DOUBLE
    - CURRENCY (Formats the values to currency notation)
    - VARCHAR (no format check, maxlength: 255)
    - TEXT (no format check)
    - DATE (Dateformat, automatic conversion to timestamps)
    Formtype:
    - TEXT (Textfield)
    - TEXTAREA (Textarea)
    - PASSWORD (Password textfield, input is not shown when edited)
    - SELECT (Select option field)
    - RADIO
    - CHECKBOX
    - CHECKBOXARRAY
    - FILE
    VALUE:
    - Wert oder Array
    Hint:
    The ID field of the database table is not part of the datafield definition.
    The ID field must be always auto incement (int or bigint).
*/
$form["title"]             = "Web Domain";
$form["description"]     = "";
$form["name"]             = "web_domain";
$form["action"]            = "web_domain_edit.php";
$form["db_table"]        = "web_domain";
$form["db_table_idx"]    = "domain_id";
$form["db_history"]        = "yes";
$form["tab_default"]    = "domain";
$form["list_default"]    = "web_domain_list.php";
$form["auth"]            = 'yes'; // yes / no
$form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['domain'] = array (
    'title'     => "Domain",
    'width'     => 100,
    'template'     => "templates/web_domain_edit.htm",
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'server_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                        'keyfield'=> 'server_id',
                                        'valuefield'=> 'server_name'
                                     ),
            'value'        => ''
        ),
        'ip_address' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => 'SELECT ip_address,ip_address FROM server_ip WHERE {AUTHSQL} ORDER BY ip_address',
                                        'keyfield'=> 'ip_address',
                                        'valuefield'=> 'ip_address'
                                     ),
            'value'        => ''
        ),
        'domain' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'domain_error_empty'),
                                        1 => array (    'type'    => 'UNIQUE',
                                                        'errmsg'=> 'domain_error_unique'),
                                        2 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
                                                        'errmsg'=> 'domain_error_regex'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'type' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => 'y',
            'value'        => array('vhost' => 'Site', 'alias' => 'Alias')
        ),
        'parent_domain_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'site' AND {AUTHSQL} ORDER BY domain",
                                        'keyfield'=> 'domain_id',
                                        'valuefield'=> 'domain'
                                     ),
            'value'        => ''
        ),
        'vhost_type' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => 'y',
            'value'        => array('name' => 'Namebased', 'ip' => 'IP-Based')
        ),
        'hd_quota' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'hd_quota_error_empty'),
                                    ),
            'default'    => '-1',
            'value'        => '',
            'width'        => '7',
            'maxlength'    => '7'
        ),
        'traffic_quota' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'traffic_quota_error_empty'),
                                    ),
            'default'    => '-1',
            'value'        => '',
            'width'        => '7',
            'maxlength'    => '7'
        ),
        'cgi' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
            'default'    => 'y',
            'value'        => array(0 => 'n',1 => 'y')
        ),
        'ssi' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
            'default'    => 'y',
            'value'        => array(0 => 'n',1 => 'y')
        ),
        'suexec' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
            'default'    => 'y',
            'value'        => array(0 => 'n',1 => 'y')
        ),
        'php' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => 'y',
            'value'        => array('' => 'Disabled', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP')
        ),
        'active' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
            'default'    => 'y',
            'value'        => array(0 => 'n',1 => 'y')
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
$form["tabs"]['redirect'] = array (
    'title'     => "Redirect",
    'width'     => 100,
    'template'     => "templates/web_domain_redirect.htm",
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'redirect_type' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => 'y',
            'value'        => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
        ),
        'redirect_path' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
if($_SESSION["s"]["user"]["typ"] == 'admin') {
$form["tabs"]['advanced'] = array (
    'title'     => "Options",
    'width'     => 100,
    'template'     => "templates/web_domain_advanced.htm",
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'document_root' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'documentroot_error_empty'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'system_user' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'sysuser_error_empty'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'system_group' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'sysgroup_error_empty'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
}
?>
interface/web/sites/form/web_subdomain.tform.php
New file
@@ -0,0 +1,132 @@
<?php
/*
    Form Definition
    Tabledefinition
    Datatypes:
    - INTEGER (Forces the input to Int)
    - DOUBLE
    - CURRENCY (Formats the values to currency notation)
    - VARCHAR (no format check, maxlength: 255)
    - TEXT (no format check)
    - DATE (Dateformat, automatic conversion to timestamps)
    Formtype:
    - TEXT (Textfield)
    - TEXTAREA (Textarea)
    - PASSWORD (Password textfield, input is not shown when edited)
    - SELECT (Select option field)
    - RADIO
    - CHECKBOX
    - CHECKBOXARRAY
    - FILE
    VALUE:
    - Wert oder Array
    Hint:
    The ID field of the database table is not part of the datafield definition.
    The ID field must be always auto incement (int or bigint).
*/
$form["title"]             = "Web Domain";
$form["description"]     = "";
$form["name"]             = "web_domain";
$form["action"]            = "web_subdomain_edit.php";
$form["db_table"]        = "web_domain";
$form["db_table_idx"]    = "domain_id";
$form["db_history"]        = "yes";
$form["tab_default"]    = "domain";
$form["list_default"]    = "web_subdomain_list.php";
$form["auth"]            = 'yes'; // yes / no
$form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['domain'] = array (
    'title'     => "Domain",
    'width'     => 100,
    'template'     => "templates/web_subdomain_edit.htm",
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'server_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                        'keyfield'=> 'server_id',
                                        'valuefield'=> 'server_name'
                                     ),
            'value'        => ''
        ),
        'domain' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'domain_error_empty'),
                                        1 => array (    'type'    => 'UNIQUE',
                                                        'errmsg'=> 'domain_error_unique'),
                                        2 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
                                                        'errmsg'=> 'domain_error_regex'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'type' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => 'y',
            'value'        => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain')
        ),
        'parent_domain_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
                                        'keyfield'=> 'domain_id',
                                        'valuefield'=> 'domain'
                                     ),
            'value'        => ''
        ),
        'redirect_type' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => 'y',
            'value'        => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
        ),
        'redirect_path' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'active' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
            'default'    => 'y',
            'value'        => array(0 => 'n',1 => 'y')
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
?>
interface/web/sites/ftp_user_del.php
New file
@@ -0,0 +1,54 @@
<?php
/*
Copyright (c) 2007, 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/ftp_user.list.php";
$tform_def_file = "form/ftp_user.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"],'sites')) {
    header("Location: ../index.php");
    exit;
}
$app->uses("tform_actions");
$app->tform_actions->onDelete();
?>
interface/web/sites/ftp_user_edit.php
New file
@@ -0,0 +1,62 @@
<?php
/*
Copyright (c) 2007, 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
******************************************/
$tform_def_file = "form/ftp_user.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
    header("Location: ../index.php");
    exit;
}
// Loading classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
}
$page = new page_action;
$page->onLoad();
?>
interface/web/sites/ftp_user_list.php
New file
@@ -0,0 +1,58 @@
<?php
/*
Copyright (c) 2007, 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.
*/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/ftp_user.list.php";
/******************************************
* End Form configuration
******************************************/
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
    header("Location: ../index.php");
    exit;
}
$app->uses('listform_actions');
// Limit the results to alias domains
//$app->listform_actions->SQLExtWhere = "type = 'subdomain'";
$app->listform_actions->onLoad();
?>
interface/web/sites/lib/admin.conf.php
New file
@@ -0,0 +1,2 @@
<?php
?>
interface/web/sites/lib/lang/en_ftp_user.lng
New file
@@ -0,0 +1,18 @@
<?php
$wb["uid_txt"] = 'UID';
$wb["gid_txt"] = 'GID';
$wb["dir_txt"] = 'Directory';
$wb["quota_files_txt"] = 'Filequota';
$wb["ul_ratio_txt"] = 'Uploadratio';
$wb["dl_ratio_txt"] = 'Downloadratio';
$wb["ul_bandwidth_txt"] = 'Uploadbandwidth';
$wb["dl_bandwidth_txt"] = 'Downloadbandwidth';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
$wb["server_id_txt"] = 'Server';
$wb["parent_domain_id_txt"] = 'Website';
$wb["username_txt"] = 'Username';
$wb["password_txt"] = 'Password';
$wb["quota_size_txt"] = 'Harddisk-Quota';
$wb["active_txt"] = 'Active';
?>
interface/web/sites/lib/lang/en_ftp_user_list.lng
New file
@@ -0,0 +1,13 @@
<?php
$wb["list_head_txt"] = 'FTP-User';
$wb["active_txt"] = 'Active';
$wb["server_id_txt"] = 'Server';
$wb["parent_domain_id_txt"] = 'Website';
$wb["username_txt"] = 'Username';
$wb["page_txt"] = 'Page';
$wb["page_of_txt"] = 'of';
$wb["page_next_txt"] = 'Next';
$wb["page_back_txt"] = 'Back';
$wb["delete_txt"] = 'Delete';
$wb["filter_txt"] = 'Filter';
?>
interface/web/sites/lib/lang/en_web_aliasdomain_list.lng
New file
@@ -0,0 +1,13 @@
<?php
$wb["list_head_txt"] = 'Aliasdomain';
$wb["active_txt"] = 'Active';
$wb["server_id_txt"] = 'Server';
$wb["parent_domain_id_txt"] = 'Website';
$wb["domain_txt"] = 'Domain';
$wb["page_txt"] = 'Page';
$wb["page_of_txt"] = 'of';
$wb["page_next_txt"] = 'Next';
$wb["page_back_txt"] = 'Back';
$wb["delete_txt"] = 'Delete';
$wb["filter_txt"] = 'Filter';
?>
interface/web/sites/lib/lang/en_web_domain.lng
New file
@@ -0,0 +1,23 @@
<?php
$wb["server_id_txt"] = 'Server';
$wb["domain_txt"] = 'Domain';
$wb["type_txt"] = 'Type';
$wb["parent_domain_id_txt"] = 'Parent Website';
$wb["redirect_type_txt"] = 'Redirect Type';
$wb["redirect_path_txt"] = 'Redirect Path';
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
$wb["document_root_txt"] = 'Documentroot';
$wb["system_user_txt"] = 'Linux User';
$wb["system_group_txt"] = 'Linux Group';
$wb["ip_address_txt"] = 'IP-Address';
$wb["vhost_type_txt"] = 'VHost Type';
$wb["hd_quota_txt"] = 'Harddisk Quota';
$wb["traffic_quota_txt"] = 'Traffic Quaota';
$wb["cgi_txt"] = 'CGI';
$wb["ssi_txt"] = 'SSI';
$wb["suexec_txt"] = 'SuEXEC';
$wb["php_txt"] = 'PHP';
$wb["client_txt"] = 'Client';
?>
interface/web/sites/lib/lang/en_web_domain_list.lng
New file
@@ -0,0 +1,13 @@
<?php
$wb["list_head_txt"] = 'Websites';
$wb["active_txt"] = 'Active';
$wb["server_id_txt"] = 'Server';
$wb["domain_txt"] = 'Domain';
$wb["page_txt"] = 'Page';
$wb["page_of_txt"] = 'of';
$wb["page_next_txt"] = 'Next';
$wb["page_back_txt"] = 'Back';
$wb["delete_txt"] = 'Delete';
$wb["filter_txt"] = 'Filter';
$wb["add_new_record_txt"] = 'Add new website';
?>
interface/web/sites/lib/lang/en_web_subdomain_list.lng
New file
@@ -0,0 +1,13 @@
<?php
$wb["list_head_txt"] = 'Subdomains';
$wb["active_txt"] = 'Active';
$wb["server_id_txt"] = 'Server';
$wb["parent_domain_id_txt"] = 'Website';
$wb["domain_txt"] = 'Domain';
$wb["page_txt"] = 'Page';
$wb["page_of_txt"] = 'of';
$wb["page_next_txt"] = 'Next';
$wb["page_back_txt"] = 'Back';
$wb["delete_txt"] = 'Delete';
$wb["filter_txt"] = 'Filter';
?>
interface/web/sites/lib/module.conf.php
New file
@@ -0,0 +1,51 @@
<?php
$module["name"]         = "sites";
$module["title"]         = "Sites";
$module["template"]     = "module.tpl.htm";
$module["startpage"]     = "sites/web_domain_list.php";
$module["tab_width"]    = '';
/*
    Websites menu
*/
$items[] = array( 'title'     => "Domain",
                  'target'     => 'content',
                  'link'    => 'sites/web_domain_list.php');
$items[] = array( 'title'     => "Subdomain",
                  'target'     => 'content',
                  'link'    => 'sites/web_subdomain_list.php');
$items[] = array( 'title'     => "Aliasdomain",
                  'target'     => 'content',
                  'link'    => 'sites/web_aliasdomain_list.php');
$module["nav"][] = array(    'title'    => 'Websites',
                            'open'     => 1,
                            'items'    => $items);
// aufräumen
unset($items);
/*
    FTP User menu
*/
$items[] = array( 'title'     => "FTP-User",
                  'target'     => 'content',
                  'link'    => 'sites/ftp_user_list.php');
$module["nav"][] = array(    'title'    => 'FTP',
                            'open'     => 1,
                            'items'    => $items);
// aufräumen
unset($items);
?>
interface/web/sites/list/ftp_user.list.php
New file
@@ -0,0 +1,99 @@
<?php
/*
    Datatypes:
    - INTEGER
    - DOUBLE
    - CURRENCY
    - VARCHAR
    - TEXT
    - DATE
*/
// Name of the list
$liste["name"]                 = "ftp_user";
// Database table
$liste["table"]             = "ftp_user";
// Index index field of the database table
$liste["table_idx"]            = "ftp_user_id";
// Search Field Prefix
$liste["search_prefix"]     = "search_";
// Records per page
$liste["records_per_page"]     = 15;
// Script File of the list
$liste["file"]                = "ftp_user_list.php";
// Script file of the edit form
$liste["edit_file"]            = "ftp_user_edit.php";
// Script File of the delete script
$liste["delete_file"]        = "ftp_user_del.php";
// Paging Template
$liste["paging_tpl"]        = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"]                = "yes";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array(    'field'        => "active",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "=",
                            'prefix'    => "",
                            'suffix'    => "",
                            'width'        => "",
                            'value'        => array('y' => "Yes",'n' => "No"));
$liste["item"][] = array(    'field'        => "server_id",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'datasource'    => array (     'type'    => 'SQL',
                                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                                        'keyfield'=> 'server_id',
                                                        'valuefield'=> 'server_name'
                                                       ),
                            'width'        => "",
                            'value'        => "");
$liste["item"][] = array(    'field'        => "parent_domain_id",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
                                        'keyfield'=> 'domain_id',
                                        'valuefield'=> 'domain'
                                     ),
                            'width'        => "",
                            'value'        => "");
$liste["item"][] = array(    'field'        => "username",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "TEXT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'width'        => "",
                            'value'        => "");
?>
interface/web/sites/list/web_aliasdomain.list.php
New file
@@ -0,0 +1,99 @@
<?php
/*
    Datatypes:
    - INTEGER
    - DOUBLE
    - CURRENCY
    - VARCHAR
    - TEXT
    - DATE
*/
// Name of the list
$liste["name"]                 = "web_aliasdomain";
// Database table
$liste["table"]             = "web_domain";
// Index index field of the database table
$liste["table_idx"]            = "domain_id";
// Search Field Prefix
$liste["search_prefix"]     = "search_";
// Records per page
$liste["records_per_page"]     = 15;
// Script File of the list
$liste["file"]                = "web_aliasdomain_list.php";
// Script file of the edit form
$liste["edit_file"]            = "web_aliasdomain_edit.php";
// Script File of the delete script
$liste["delete_file"]        = "web_aliasdomain_del.php";
// Paging Template
$liste["paging_tpl"]        = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"]                = "yes";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array(    'field'        => "active",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "=",
                            'prefix'    => "",
                            'suffix'    => "",
                            'width'        => "",
                            'value'        => array('y' => "Yes",'n' => "No"));
$liste["item"][] = array(    'field'        => "server_id",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'datasource'    => array (     'type'    => 'SQL',
                                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                                        'keyfield'=> 'server_id',
                                                        'valuefield'=> 'server_name'
                                                       ),
                            'width'        => "",
                            'value'        => "");
$liste["item"][] = array(    'field'        => "parent_domain_id",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
                                        'keyfield'=> 'domain_id',
                                        'valuefield'=> 'domain'
                                     ),
                            'width'        => "",
                            'value'        => "");
$liste["item"][] = array(    'field'        => "domain",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "TEXT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'width'        => "",
                            'value'        => "");
?>
interface/web/sites/list/web_domain.list.php
New file
@@ -0,0 +1,85 @@
<?php
/*
    Datatypes:
    - INTEGER
    - DOUBLE
    - CURRENCY
    - VARCHAR
    - TEXT
    - DATE
*/
// Name of the list
$liste["name"]                 = "web_domain";
// Database table
$liste["table"]             = "web_domain";
// Index index field of the database table
$liste["table_idx"]            = "domain_id";
// Search Field Prefix
$liste["search_prefix"]     = "search_";
// Records per page
$liste["records_per_page"]     = 15;
// Script File of the list
$liste["file"]                = "web_domain_list.php";
// Script file of the edit form
$liste["edit_file"]            = "web_domain_edit.php";
// Script File of the delete script
$liste["delete_file"]        = "web_domain_del.php";
// Paging Template
$liste["paging_tpl"]        = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"]                = "yes";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array(    'field'        => "active",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "=",
                            'prefix'    => "",
                            'suffix'    => "",
                            'width'        => "",
                            'value'        => array('y' => "Yes",'n' => "No"));
$liste["item"][] = array(    'field'        => "server_id",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'datasource'    => array (     'type'    => 'SQL',
                                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                                        'keyfield'=> 'server_id',
                                                        'valuefield'=> 'server_name'
                                                       ),
                            'width'        => "",
                            'value'        => "");
$liste["item"][] = array(    'field'        => "domain",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "TEXT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'width'        => "",
                            'value'        => "");
?>
interface/web/sites/list/web_subdomain.list.php
New file
@@ -0,0 +1,99 @@
<?php
/*
    Datatypes:
    - INTEGER
    - DOUBLE
    - CURRENCY
    - VARCHAR
    - TEXT
    - DATE
*/
// Name of the list
$liste["name"]                 = "web_subdomain";
// Database table
$liste["table"]             = "web_domain";
// Index index field of the database table
$liste["table_idx"]            = "domain_id";
// Search Field Prefix
$liste["search_prefix"]     = "search_";
// Records per page
$liste["records_per_page"]     = 15;
// Script File of the list
$liste["file"]                = "web_subdomain_list.php";
// Script file of the edit form
$liste["edit_file"]            = "web_subdomain_edit.php";
// Script File of the delete script
$liste["delete_file"]        = "web_subdomain_del.php";
// Paging Template
$liste["paging_tpl"]        = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"]                = "yes";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array(    'field'        => "active",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "=",
                            'prefix'    => "",
                            'suffix'    => "",
                            'width'        => "",
                            'value'        => array('y' => "Yes",'n' => "No"));
$liste["item"][] = array(    'field'        => "server_id",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'datasource'    => array (     'type'    => 'SQL',
                                                        'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
                                                        'keyfield'=> 'server_id',
                                                        'valuefield'=> 'server_name'
                                                       ),
                            'width'        => "",
                            'value'        => "");
$liste["item"][] = array(    'field'        => "parent_domain_id",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "SELECT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'datasource'    => array (     'type'    => 'SQL',
                                        'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
                                        'keyfield'=> 'domain_id',
                                        'valuefield'=> 'domain'
                                     ),
                            'width'        => "",
                            'value'        => "");
$liste["item"][] = array(    'field'        => "domain",
                            'datatype'    => "VARCHAR",
                            'formtype'    => "TEXT",
                            'op'        => "like",
                            'prefix'    => "%",
                            'suffix'    => "%",
                            'width'        => "",
                            'value'        => "");
?>
interface/web/sites/templates/ftp_user_advanced.htm
New file
@@ -0,0 +1,44 @@
<table width="500" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td class="frmText11">{tmpl_var name='uid_txt'}:</td>
    <td class="frmText11"><input name="uid" type="text" class="text" value="{tmpl_var name='uid'}" size="5" maxlength="5"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='gid_txt'}:</td>
    <td class="frmText11"><input name="gid" type="text" class="text" value="{tmpl_var name='gid'}" size="5" maxlength="5"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='dir_txt'}:</td>
    <td class="frmText11"><input name="dir" type="text" class="text" value="{tmpl_var name='dir'}" size="30" maxlength="255"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='quota_files_txt'}:</td>
    <td class="frmText11"><input name="quota_files" type="text" class="text" value="{tmpl_var name='quota_files'}" size="7" maxlength="7"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='ul_ratio_txt'}:</td>
    <td class="frmText11"><input name="ul_ratio" type="text" class="text" value="{tmpl_var name='ul_ratio'}" size="7" maxlength="7"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='dl_ratio_txt'}:</td>
    <td class="frmText11"><input name="dl_ratio" type="text" class="text" value="{tmpl_var name='dl_ratio'}" size="7" maxlength="7"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='ul_bandwidth_txt'}:</td>
    <td class="frmText11"><input name="ul_bandwidth" type="text" class="text" value="{tmpl_var name='ul_bandwidth'}" size="7" maxlength="7"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='dl_bandwidth_txt'}:</td>
    <td class="frmText11"><input name="dl_bandwidth" type="text" class="text" value="{tmpl_var name='dl_bandwidth'}" size="7" maxlength="7"></td>
  </tr>  <tr>
    <td class="frmText11">&nbsp;</td>
    <td class="frmText11">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/ftp_user_edit.php');"><div class="buttonEnding"></div>&nbsp;
      <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/ftp_user_list.php');"><div class="buttonEnding"></div>
    </td>
  </tr>
</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
interface/web/sites/templates/ftp_user_edit.htm
New file
@@ -0,0 +1,44 @@
<table width="500" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td class="frmText11">{tmpl_var name='server_id_txt'}:</td>
    <td class="frmText11">
        <select name="server_id" class="text">
            {tmpl_var name='server_id'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='parent_domain_id_txt'}:</td>
    <td class="frmText11">
        <select name="parent_domain_id" class="text">
            {tmpl_var name='parent_domain_id'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='username_txt'}:</td>
    <td class="frmText11"><input name="username" type="text" class="text" value="{tmpl_var name='username'}" size="20" maxlength="255"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='password_txt'}:</td>
    <td class="frmText11"><input name="password" type="password" class="text" value="{tmpl_var name='password'}" size="20" maxlength="255"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='quota_size_txt'}:</td>
    <td class="frmText11"><input name="quota_size" type="text" class="text" value="{tmpl_var name='quota_size'}" size="7" maxlength="7"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='active_txt'}:</td>
    <td class="frmText11">{tmpl_var name='active'}</td>
  </tr>  <tr>
    <td class="frmText11">&nbsp;</td>
    <td class="frmText11">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/ftp_user_edit.php');"><div class="buttonEnding"></div>&nbsp;
      <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/ftp_user_list.php');"><div class="buttonEnding"></div>
    </td>
  </tr>
</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
interface/web/sites/templates/ftp_user_list.htm
New file
@@ -0,0 +1,31 @@
<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
<input type="button" value="{tmpl_var name="add_new_record_txt"}" class="button" onClick="loadContent('sites/ftp_user_edit.php');" /><div class="buttonEnding"></div><br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="listTable">
  <tr>
    <td class="tblHead"><tmpl_var name="active_txt"></td>
    <td class="tblHead"><tmpl_var name="server_id_txt"></td>
    <td class="tblHead"><tmpl_var name="parent_domain_id_txt"></td>
    <td class="tblHead"><tmpl_var name="username_txt"></td>
    <td class="tblHead">&nbsp;</td>
  </tr>
  <tr>
    <td class="frmText11"><select name="search_active" onChange="submitForm('pageForm','sites/ftp_user_list.php');">{tmpl_var name='search_active'}</select></td>
    <td class="frmText11"><select name="search_server_id" onChange="submitForm('pageForm','sites/ftp_user_list.php');">{tmpl_var name='search_server_id'}</select></td>
    <td class="frmText11"><select name="search_parent_domain_id" onChange="submitForm('pageForm','sites/ftp_user_list.php');">{tmpl_var name='search_parent_domain_id'}</select></td>
    <td class="frmText11"><input type="text" name="search_username" value="{tmpl_var name='search_username'}" class="text" /></td>
    <td class="frmText11" align="right"><input name="Filter" type="button" id="Filter" value="{tmpl_var name="filter_txt"}" class="button" onClick="submitForm('pageForm','sites/ftp_user_list.php');"><div class="buttonEnding"></div></td>
  </tr>
  <tmpl_loop name="records">
  <tr bgcolor="{tmpl_var name="bgcolor"}">
    <td class="frmText11"><a href="#" onClick="loadContent('sites/ftp_user_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="active"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/ftp_user_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="server_id"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/ftp_user_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="parent_domain_id"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/ftp_user_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="username"}</a></td>
    <td class="frmText11" align="right">[<a href="javascript: del_record('sites/ftp_user_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}');" class="frmText11">{tmpl_var name='delete_txt'}</a>]</td>
  </tr>
  </tmpl_loop>
  <tr>
      <td colspan="5" height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
  </tr>
</table>
interface/web/sites/templates/web_aliasdomain_edit.htm
New file
@@ -0,0 +1,40 @@
<table width="500" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td class="frmText11">{tmpl_var name='domain_txt'}:</td>
    <td class="frmText11"><input name="domain" type="text" class="text" value="{tmpl_var name='domain'}" size="30" maxlength="255"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='parent_domain_id_txt'}:</td>
    <td class="frmText11">
        <select name="parent_domain_id" class="text">
            {tmpl_var name='parent_domain_id'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='redirect_type_txt'}:</td>
    <td class="frmText11">
        <select name="redirect_type" class="text">
            {tmpl_var name='redirect_type'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='redirect_path_txt'}:</td>
    <td class="frmText11"><input name="redirect_path" type="text" class="text" value="{tmpl_var name='redirect_path'}" size="30" maxlength="255"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='active_txt'}:</td>
    <td class="frmText11">{tmpl_var name='active'}</td>
  </tr>  <tr>
    <td class="frmText11">&nbsp;</td>
    <td class="frmText11">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_aliasdomain_edit.php');"><div class="buttonEnding"></div>&nbsp;
      <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_aliasdomain_list.php');"><div class="buttonEnding"></div>
    </td>
  </tr>
</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
interface/web/sites/templates/web_aliasdomain_list.htm
New file
@@ -0,0 +1,31 @@
<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
<input type="button" value="{tmpl_var name="add_new_record_txt"}" class="button" onClick="loadContent('sites/web_aliasdomain_edit.php');" /><div class="buttonEnding"></div><br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="listTable">
  <tr>
    <td class="tblHead"><tmpl_var name="active_txt"></td>
    <td class="tblHead"><tmpl_var name="server_id_txt"></td>
    <td class="tblHead"><tmpl_var name="parent_domain_id_txt"></td>
    <td class="tblHead"><tmpl_var name="domain_txt"></td>
    <td class="tblHead">&nbsp;</td>
  </tr>
  <tr>
    <td class="frmText11"><select name="search_active" onChange="submitForm('pageForm','sites/web_aliasdomain_list.php');">{tmpl_var name='search_active'}</select></td>
    <td class="frmText11"><select name="search_server_id" onChange="submitForm('pageForm','sites/web_aliasdomain_list.php');">{tmpl_var name='search_server_id'}</select></td>
    <td class="frmText11"><select name="search_parent_domain_id" onChange="submitForm('pageForm','sites/web_aliasdomain_list.php');">{tmpl_var name='search_parent_domain_id'}</select></td>
    <td class="frmText11"><input type="text" name="search_domain" value="{tmpl_var name='search_domain'}" class="text" /></td>
    <td class="frmText11" align="right"><input name="Filter" type="button" id="Filter" value="{tmpl_var name="filter_txt"}" class="button" onClick="submitForm('pageForm','sites/web_aliasdomain_list.php');"><div class="buttonEnding"></div></td>
  </tr>
  <tmpl_loop name="records">
  <tr bgcolor="{tmpl_var name="bgcolor"}">
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_aliasdomain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="active"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_aliasdomain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="server_id"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_aliasdomain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="parent_domain_id"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_aliasdomain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="domain"}</a></td>
    <td class="frmText11" align="right">[<a href="javascript: del_record('sites/web_aliasdomain_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}');" class="frmText11">{tmpl_var name='delete_txt'}</a>]</td>
  </tr>
  </tmpl_loop>
  <tr>
      <td colspan="5" height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
  </tr>
</table>
interface/web/sites/templates/web_domain_advanced.htm
New file
@@ -0,0 +1,24 @@
<table width="500" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td class="frmText11">{tmpl_var name='document_root_txt'}:</td>
    <td class="frmText11"><input name="document_root" type="text" class="text" value="{tmpl_var name='document_root'}" size="30" maxlength="255"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='system_user_txt'}:</td>
    <td class="frmText11"><input name="system_user" type="text" class="text" value="{tmpl_var name='system_user'}" size="30" maxlength="255"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='system_group_txt'}:</td>
    <td class="frmText11"><input name="system_group" type="text" class="text" value="{tmpl_var name='system_group'}" size="30" maxlength="255"></td>
  </tr>  <tr>
    <td class="frmText11">&nbsp;</td>
    <td class="frmText11">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><div class="buttonEnding"></div>&nbsp;
      <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><div class="buttonEnding"></div>
    </td>
  </tr>
</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
interface/web/sites/templates/web_domain_edit.htm
New file
@@ -0,0 +1,100 @@
<table width="500" border="0" cellspacing="0" cellpadding="2">
  <tmpl_if name="is_admin">
  <tr>
    <td class="frmText11">{tmpl_var name='server_id_txt'}:</td>
    <td class="frmText11">
        <select name="server_id" id="server_id" class="text" onChange="loadContentInto('ip_address','sites/ajax_get_ip.php?server_id='+document.getElementById('server_id').value)">
            {tmpl_var name='server_id'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='client_txt'}:</td>
    <td class="frmText11">
        <select name="client_group_id" class="text">
            {tmpl_var name='client_group_id'}
        </select>
    </td>
  </tr>
  </tmpl_if>
  <tr>
    <td class="frmText11">{tmpl_var name='ip_address_txt'}:</td>
    <td class="frmText11">
        <select name="ip_address" id="ip_address" class="text">
            {tmpl_var name='ip_address'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='domain_txt'}:</td>
    <td class="frmText11"><input name="domain" type="text" class="text" value="{tmpl_var name='domain'}" size="30" maxlength="255"></td>
  </tr>
  <!--
  <tr>
    <td class="frmText11">{tmpl_var name='type_txt'}:</td>
    <td class="frmText11">
        <select name="type" class="text">
            {tmpl_var name='type'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='parent_domain_id_txt'}:</td>
    <td class="frmText11">
        <select name="parent_domain_id" class="text">
            {tmpl_var name='parent_domain_id'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='vhost_type_txt'}:</td>
    <td class="frmText11">
        <select name="vhost_type" class="text">
            {tmpl_var name='vhost_type'}
        </select>
    </td>
  </tr>
  -->
  <tr>
    <td class="frmText11">{tmpl_var name='hd_quota_txt'}:</td>
    <td class="frmText11"><input name="hd_quota" type="text" class="text" value="{tmpl_var name='hd_quota'}" size="7" maxlength="7"> MB</td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='traffic_quota_txt'}:</td>
    <td class="frmText11"><input name="traffic_quota" type="text" class="text" value="{tmpl_var name='traffic_quota'}" size="7" maxlength="7"> MB</td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='cgi_txt'}:</td>
    <td class="frmText11">{tmpl_var name='cgi'}</td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='ssi_txt'}:</td>
    <td class="frmText11">{tmpl_var name='ssi'}</td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='suexec_txt'}:</td>
    <td class="frmText11">{tmpl_var name='suexec'}</td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='php_txt'}:</td>
    <td class="frmText11">
        <select name="php" class="text">
            {tmpl_var name='php'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='active_txt'}:</td>
    <td class="frmText11">{tmpl_var name='active'}</td>
  </tr>  <tr>
    <td class="frmText11">&nbsp;</td>
    <td class="frmText11">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><div class="buttonEnding"></div>&nbsp;
      <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><div class="buttonEnding"></div>
    </td>
  </tr>
</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
interface/web/sites/templates/web_domain_list.htm
New file
@@ -0,0 +1,28 @@
<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
<input type="button" value="{tmpl_var name="add_new_record_txt"}" class="button" onClick="loadContent('sites/web_domain_edit.php');" /><div class="buttonEnding"></div><br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="listTable">
  <tr>
    <td class="tblHead"><tmpl_var name="active_txt"></td>
    <td class="tblHead"><tmpl_var name="server_id_txt"></td>
    <td class="tblHead"><tmpl_var name="domain_txt"></td>
    <td class="tblHead">&nbsp;</td>
  </tr>
  <tr>
    <td class="frmText11"><select name="search_active" onChange="submitForm('pageForm','sites/web_domain_list.php');">{tmpl_var name='search_active'}</select></td>
    <td class="frmText11"><select name="search_server_id" onChange="submitForm('pageForm','sites/web_domain_list.php');">{tmpl_var name='search_server_id'}</select></td>
    <td class="frmText11"><input type="text" name="search_domain" value="{tmpl_var name='search_domain'}" class="text" /></td>
    <td class="frmText11" align="right"><input name="Filter" type="button" id="Filter" value="{tmpl_var name="filter_txt"}" class="button" onClick="submitForm('pageForm','sites/web_domain_list.php');"><div class="buttonEnding"></div></td>
  </tr>
  <tmpl_loop name="records">
  <tr bgcolor="{tmpl_var name="bgcolor"}">
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="active"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="server_id"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="domain"}</a></td>
    <td class="frmText11" align="right">[<a href="javascript: del_record('sites/web_domain_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}');" class="frmText11">{tmpl_var name='delete_txt'}</a>]</td>
  </tr>
  </tmpl_loop>
  <tr>
      <td colspan="4" height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
  </tr>
</table>
interface/web/sites/templates/web_domain_redirect.htm
New file
@@ -0,0 +1,24 @@
<table width="500" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td class="frmText11">{tmpl_var name='redirect_type_txt'}:</td>
    <td class="frmText11">
        <select name="redirect_type" class="text">
            {tmpl_var name='redirect_type'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='redirect_path_txt'}:</td>
    <td class="frmText11"><input name="redirect_path" type="text" class="text" value="{tmpl_var name='redirect_path'}" size="30" maxlength="255"></td>
  </tr>  <tr>
    <td class="frmText11">&nbsp;</td>
    <td class="frmText11">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><div class="buttonEnding"></div>&nbsp;
      <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><div class="buttonEnding"></div>
    </td>
  </tr>
</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
interface/web/sites/templates/web_subdomain_edit.htm
New file
@@ -0,0 +1,36 @@
<table width="500" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td class="frmText11">{tmpl_var name='domain_txt'}:</td>
    <td class="frmText11"><input name="domain" type="text" class="text" value="{tmpl_var name='domain'}" size="10" maxlength="255">
        . <select name="parent_domain_id" class="text">
            {tmpl_var name='parent_domain_id'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='redirect_type_txt'}:</td>
    <td class="frmText11">
        <select name="redirect_type" class="text">
            {tmpl_var name='redirect_type'}
        </select>
    </td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='redirect_path_txt'}:</td>
    <td class="frmText11"><input name="redirect_path" type="text" class="text" value="{tmpl_var name='redirect_path'}" size="30" maxlength="255"></td>
  </tr>
  <tr>
    <td class="frmText11">{tmpl_var name='active_txt'}:</td>
    <td class="frmText11">{tmpl_var name='active'}</td>
  </tr>  <tr>
    <td class="frmText11">&nbsp;</td>
    <td class="frmText11">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_subdomain_edit.php');"><div class="buttonEnding"></div>&nbsp;
      <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_subdomain_list.php');"><div class="buttonEnding"></div>
    </td>
  </tr>
</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
interface/web/sites/templates/web_subdomain_list.htm
New file
@@ -0,0 +1,31 @@
<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
<input type="button" value="{tmpl_var name="add_new_record_txt"}" class="button" onClick="loadContent('sites/web_subdomain_edit.php');" /><div class="buttonEnding"></div><br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="listTable">
  <tr>
    <td class="tblHead"><tmpl_var name="active_txt"></td>
    <td class="tblHead"><tmpl_var name="server_id_txt"></td>
    <td class="tblHead"><tmpl_var name="parent_domain_id_txt"></td>
    <td class="tblHead"><tmpl_var name="domain_txt"></td>
    <td class="tblHead">&nbsp;</td>
  </tr>
  <tr>
    <td class="frmText11"><select name="search_active" onChange="submitForm('pageForm','sites/web_subdomain_list.php');">{tmpl_var name='search_active'}</select></td>
    <td class="frmText11"><select name="search_server_id" onChange="submitForm('pageForm','sites/web_subdomain_list.php');">{tmpl_var name='search_server_id'}</select></td>
    <td class="frmText11"><select name="search_parent_domain_id" onChange="submitForm('pageForm','sites/web_subdomain_list.php');">{tmpl_var name='search_parent_domain_id'}</select></td>
    <td class="frmText11"><input type="text" name="search_domain" value="{tmpl_var name='search_domain'}" class="text" /></td>
    <td class="frmText11" align="right"><input name="Filter" type="button" id="Filter" value="{tmpl_var name="filter_txt"}" class="button" onClick="submitForm('pageForm','sites/web_subdomain_list.php');"><div class="buttonEnding"></div></td>
  </tr>
  <tmpl_loop name="records">
  <tr bgcolor="{tmpl_var name="bgcolor"}">
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_subdomain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="active"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_subdomain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="server_id"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_subdomain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="parent_domain_id"}</a></td>
    <td class="frmText11"><a href="#" onClick="loadContent('sites/web_subdomain_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="domain"}</a></td>
    <td class="frmText11" align="right">[<a href="javascript: del_record('sites/web_subdomain_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}');" class="frmText11">{tmpl_var name='delete_txt'}</a>]</td>
  </tr>
  </tmpl_loop>
  <tr>
      <td colspan="5" height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
  </tr>
</table>
interface/web/sites/web_aliasdomain_del.php
New file
@@ -0,0 +1,54 @@
<?php
/*
Copyright (c) 2007, 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/web_aliasdomain.list.php";
$tform_def_file = "form/web_aliasdomain.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"],'sites')) {
    header("Location: ../index.php");
    exit;
}
$app->uses("tform_actions");
$app->tform_actions->onDelete();
?>
interface/web/sites/web_aliasdomain_edit.php
New file
@@ -0,0 +1,91 @@
<?php
/*
Copyright (c) 2007, 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
******************************************/
$tform_def_file = "form/web_aliasdomain.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
    header("Location: ../index.php");
    exit;
}
// Loading classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
    /*
    function onShowEnd() {
        global $app, $conf;
        // Get the record of the parent domain
        $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"]));
        $this->dataRecord["domain"] = str_replace('.'.$parent_domain["domain"],'',$this->dataRecord["domain"]);
        $app->tpl->setVar("domain",$this->dataRecord["domain"]);
        parent::onShowEnd();
    }
    */
    function onSubmit() {
        global $app, $conf;
        // Get the record of the parent domain
        $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"]));
        // Set a few fixed values
        $this->dataRecord["type"] = 'alias';
        $this->dataRecord["server_id"] = $parent_domain["server_id"];
        //$this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"];
        parent::onSubmit();
    }
}
$page = new page_action;
$page->onLoad();
?>
interface/web/sites/web_aliasdomain_list.php
New file
@@ -0,0 +1,58 @@
<?php
/*
Copyright (c) 2007, 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.
*/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/web_aliasdomain.list.php";
/******************************************
* End Form configuration
******************************************/
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
    header("Location: ../index.php");
    exit;
}
$app->uses('listform_actions');
// Limit the results to alias domains
$app->listform_actions->SQLExtWhere = "type = 'alias'";
$app->listform_actions->onLoad();
?>
interface/web/sites/web_domain_del.php
New file
@@ -0,0 +1,54 @@
<?php
/*
Copyright (c) 2007, 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/web_domain.list.php";
$tform_def_file = "form/web_domain.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"],'sites')) {
    header("Location: ../index.php");
    exit;
}
$app->uses("tform_actions");
$app->tform_actions->onDelete();
?>
interface/web/sites/web_domain_edit.php
New file
@@ -0,0 +1,234 @@
<?php
/*
Copyright (c) 2007, 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
******************************************/
$tform_def_file = "form/web_domain.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
    header("Location: ../index.php");
    exit;
}
// Loading classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
    function onShowEnd() {
        global $app, $conf;
        if($_SESSION["s"]["user"]["typ"] != 'admin') {
            // Get the limits of the client
            $client_group_id = $_SESSION["s"]["user"]["default_group"];
            $client = $app->db->queryOneRecord("SELECT limit_maildomain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
            // Set the webserver to the default server of the client
            $tmp = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = $client[default_webserver]");
            $app->tpl->setVar("server_id","<option value='$client[default_webserver]'>$tmp[server_name]</option>");
            unset($tmp);
            // Fill the IP select field with the IP addresses that are allowed for this client
        } else {
            // The user is admin, so we fill in all IP addresses of the server
            if($this->id > 0) {
                $server_id = $this->dataRecord["server_id"];
            } else {
                // Get the first server ID
                $tmp = $app->db->queryOneRecord("SELECT server_id FROM server WHERE web_server = 1 ORDER BY server_name LIMIT 0,1");
                $server_id = $tmp['server_id'];
            }
            $sql = "SELECT ip_address FROM server_ip WHERE server_id = $server_id";
            $ips = $app->db->queryAllRecords($sql);
            $ip_select = "<option value='*'>*</option>";
            //$ip_select = "";
            if(is_array($ips)) {
                foreach( $ips as $ip) {
                    $selected = ($ip["ip_address"] == $this->dataRecord["ip_address"])?'SELECTED':'';
                    $ip_select .= "<option value='$ip[ip_address]' $selected>$ip[ip_address]</option>\r\n";
                }
            }
            $app->tpl->setVar("ip_address",$ip_select);
            unset($tmp);
            unset($ips);
            // Fill the client select field
            $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0";
            $clients = $app->db->queryAllRecords($sql);
            $client_select = "<option value='0'></option>";
            if(is_array($clients)) {
                foreach( $clients as $client) {
                    $selected = ($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
                    $client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
                }
            }
            $app->tpl->setVar("client_group_id",$client_select);
        }
        parent::onShowEnd();
    }
    function onSubmit() {
        global $app, $conf;
        // Set a few fixed values
        $this->dataRecord["parent_domain_id"] = 0;
        $this->dataRecord["type"] = 'vhost';
        $this->dataRecord["vhost_type"] = 'name';
        if($_SESSION["s"]["user"]["typ"] != 'admin') {
            // Get the limits of the client
            $client_group_id = $_SESSION["s"]["user"]["default_group"];
            $client = $app->db->queryOneRecord("SELECT limit_maildomain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
            // When the record is updated
            if($this->id > 0) {
                // restore the server ID if the user is not admin and record is edited
                $tmp = $app->db->queryOneRecord("SELECT server_id FROM web_domain WHERE domain_id = ".intval($this->id));
                $this->dataRecord["server_id"] = $tmp["server_id"];
                unset($tmp);
            // When the record is inserted
            } else {
                // set the server ID to the default mailserver of the client
                $this->dataRecord["server_id"] = $client["default_webserver"];
                /*
                // Check if the user may add another mail_domain
                if($client["limit_maildomain"] >= 0) {
                    $tmp = $app->db->queryOneRecord("SELECT count(domain_id) as number FROM mail_domain WHERE sys_groupid = $client_group_id");
                    if($tmp["number"] >= $client["limit_maildomain"]) {
                        $app->error($app->tform->wordbook["limit_webdomain_txt"]);
                    }
                }
                */
            }
            // Clients may not set the client_group_id, so we unset them if user is not a admin
            unset($this->dataRecord["client_group_id"]);
        }
        parent::onSubmit();
    }
    function onAfterInsert() {
        global $app, $conf;
        // make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it
        // also make sure that the user can not delete domain created by a admin
        if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
            $client_group_id = intval($this->dataRecord["client_group_id"]);
            $app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id);
        }
        // Get configuration for the web system
        $app->uses("getconf");
        $web_config = $app->getconf->get_server_config(intval($this->dataRecord["server_id"]),'web');
        $document_root = str_replace("[website_id]",$this->id,$web_config["website_path"]);
        // get the ID of the client
        if($_SESSION["s"]["user"]["typ"] != 'admin') {
            $client_group_id = $_SESSION["s"]["user"]["default_group"];
            $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
            $client_id = intval($client["client_id"]);
        } else {
            $client_id = intval($this->dataRecord["client_group_id"]);
            $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($this->dataRecord["client_group_id"]));
            $client_id = intval($client["client_id"]);
        }
        // Set the values for document_root, system_user and system_group
        $system_user = 'web'.$this->id;
        $system_group = 'client'.$client_id;
        $document_root = str_replace("[client_id]",$client_id,$document_root);
        $sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group', document_root = '$document_root' WHERE domain_id = ".$this->id;
        $app->db->query($sql);
    }
    function onAfterUpdate() {
        global $app, $conf;
        // make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it
        // also make sure that the user can not delete domain created by a admin
        if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
            $client_group_id = intval($this->dataRecord["client_group_id"]);
            $app->db->query("UPDATE web_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id);
        }
        // Get configuration for the web system
        $app->uses("getconf");
        $web_config = $app->getconf->get_server_config(intval($this->dataRecord["server_id"]),'web');
        $document_root = str_replace("[website_id]",$this->id,$web_config["website_path"]);
        // get the ID of the client
        if($_SESSION["s"]["user"]["typ"] != 'admin') {
            $client_group_id = $_SESSION["s"]["user"]["default_group"];
            $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
            $client_id = intval($client["client_id"]);
        } else {
            $client_id = intval($this->dataRecord["client_group_id"]);
            $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($this->dataRecord["client_group_id"]));
            $client_id = intval($client["client_id"]);
        }
        // Set the values for document_root, system_user and system_group
        $system_user = 'web'.$this->id;
        $system_group = 'client'.$client_id;
        $document_root = str_replace("[client_id]",$client_id,$document_root);
        $sql = "UPDATE web_domain SET system_user = '$system_user', system_group = '$system_group', document_root = '$document_root' WHERE domain_id = ".$this->id;
        $app->db->query($sql);
    }
}
$page = new page_action;
$page->onLoad();
?>
interface/web/sites/web_domain_list.php
New file
@@ -0,0 +1,58 @@
<?php
/*
Copyright (c) 2007, 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.
*/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/web_domain.list.php";
/******************************************
* End Form configuration
******************************************/
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
    header("Location: ../index.php");
    exit;
}
$app->uses('listform_actions');
// Limit the results to alias domains
// $app->listform_actions->SQLExtWhere = "type = 'local'";
$app->listform_actions->onLoad();
?>
interface/web/sites/web_subdomain_del.php
New file
@@ -0,0 +1,54 @@
<?php
/*
Copyright (c) 2007, 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/web_subdomain.list.php";
$tform_def_file = "form/web_subdomain.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"],'sites')) {
    header("Location: ../index.php");
    exit;
}
$app->uses("tform_actions");
$app->tform_actions->onDelete();
?>
interface/web/sites/web_subdomain_edit.php
New file
@@ -0,0 +1,89 @@
<?php
/*
Copyright (c) 2007, 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
******************************************/
$tform_def_file = "form/web_subdomain.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
    header("Location: ../index.php");
    exit;
}
// Loading classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
    function onShowEnd() {
        global $app, $conf;
        // Get the record of the parent domain
        $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"]));
        $this->dataRecord["domain"] = str_replace('.'.$parent_domain["domain"],'',$this->dataRecord["domain"]);
        $app->tpl->setVar("domain",$this->dataRecord["domain"]);
        parent::onShowEnd();
    }
    function onSubmit() {
        global $app, $conf;
        // Get the record of the parent domain
        $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"]));
        // Set a few fixed values
        $this->dataRecord["type"] = 'subdomain';
        $this->dataRecord["server_id"] = $parent_domain["server_id"];
        $this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"];
        parent::onSubmit();
    }
}
$page = new page_action;
$page->onLoad();
?>
interface/web/sites/web_subdomain_list.php
New file
@@ -0,0 +1,58 @@
<?php
/*
Copyright (c) 2007, 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.
*/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/web_subdomain.list.php";
/******************************************
* End Form configuration
******************************************/
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
    header("Location: ../index.php");
    exit;
}
$app->uses('listform_actions');
// Limit the results to alias domains
$app->listform_actions->SQLExtWhere = "type = 'subdomain'";
$app->listform_actions->onLoad();
?>
server/conf/apache.conf.master
New file
@@ -0,0 +1,2 @@
NameVirtualHost *:80
server/conf/vhost.conf.master
New file
@@ -0,0 +1,25 @@
NameVirtualHost *:80
<VirtualHost <tmpl_var name='ip_address'>:80>
    DocumentRoot <tmpl_var name='document_root'>
    ServerName <tmpl_var name='domain'>
    <tmpl_if name='cgi'>
    </tmpl_if>
    <tmpl_if name='ssi'>
    </tmpl_if>
    <tmpl_if name='suexec'>
    </tmpl_if>
    <tmpl_if name='php' op='==' value='mod'>
    </tmpl_if>
    <tmpl_if name='php' op='==' value='suphp'>
    </tmpl_if>
    <tmpl_if name='php' op='==' value='cgi'>
    </tmpl_if>
</VirtualHost>
server/mods-enabled/web_module.inc.php
New file
@@ -0,0 +1,86 @@
<?php
/*
Copyright (c) 2007, 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.
*/
class web_module {
    var $module_name = 'web_module';
    var $class_name = 'web_module';
    var $actions_available = array(    'web_domain_insert',
                                    'web_domain_update',
                                    'web_domain_delete');
    /*
         This function is called when the module is loaded
    */
    function onLoad() {
        global $app;
        /*
        Annonce the actions that where provided by this module, so plugins
        can register on them.
        */
        $app->plugins->announceEvents($this->module_name,$this->actions_available);
        /*
        As we want to get notified of any changes on several database tables,
        we register for them.
        The following function registers the function "functionname"
         to be executed when a record for the table "dbtable" is
         processed in the sys_datalog. "classname" is the name of the
         class that contains the function functionname.
        */
        $app->modules->registerTableHook('web_domain','mail_module','process');
    }
    /*
     This function is called when a change in one of the registered tables is detected.
     The function then raises the events for the plugins.
    */
    function process($tablename,$action,$data) {
        global $app;
        switch ($tablename) {
            case 'web_domain':
                if($action == 'i') $app->plugins->raiseEvent('web_domain_insert',$data);
                if($action == 'u') $app->plugins->raiseEvent('web_domain_update',$data);
                if($action == 'd') $app->plugins->raiseEvent('web_domain_delete',$data);
            break;
        } // end switch
    } // end function
} // end class
?>
server/plugins-enabled/apache2_plugin.inc.php
New file
@@ -0,0 +1,83 @@
<?php
/*
Copyright (c) 2007, 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.
*/
class apache2_plugin {
    var $plugin_name = 'apache2_plugin';
    var $class_name = $this->plugin_name;
    /*
         This function is called when the plugin is loaded
    */
    function onLoad() {
        global $app;
        /*
        Register for the events
        */
        $app->plugins->registerEvent('web_domain_insert',$this->plugin_name,'insert');
        $app->plugins->registerEvent('web_domain_update',$this->plugin_name,'update');
        $app->plugins->registerEvent('web_domain_delete',$this->plugin_name,'delete');
    }
    function insert($event_name,$data) {
        global $app, $conf;
    }
    function update($event_name,$data) {
        global $app, $conf;
        // load the server configuration options
        $app->uses("getconf");
        $web_config = $app->getconf->get_server_config($conf["server_id"], 'web');
    }
    function delete($event_name,$data) {
        global $app, $conf;
    }
} // end class
?>